PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.2
Elementor Website Builder – more than just a page builder v3.26.2
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/atomic-widgets-editor.js +5489 -2106 4.2.0-beta1 → 3.26.2 View file →
@@ -1,301 +1,2527 @@
1 +/*! elementor - v3.26.0 - 19-12-2024 */
1 2 /******/ (() => { // webpackBootstrap
2 3 /******/ var __webpack_modules__ = ({
3 4
4 -/***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js":
5 -/*!********************************************************************!*\
6 - !*** ../assets/dev/js/editor/elements/views/behaviors/sortable.js ***!
7 - \********************************************************************/
8 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
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__) => {
9 10
10 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
11 2084
2085 +/***/ }),
12 2086
13 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
14 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
15 -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16 -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17 -var SortableBehavior;
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) => {
18 2092
2093 +"use strict";
2094 +
2095 +
2096 +Object.defineProperty(exports, "__esModule", ({
2097 + value: true
2098 +}));
2099 +exports["default"] = void 0;
2100 +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
2101 +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); 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; } }
2102 +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
19 2103 /**
20 - * @typedef {import('../../../container/container')} Container
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}
21 2111 */
22 -SortableBehavior = Marionette.Behavior.extend({
23 - defaults: {
24 - elChildType: 'widget'
25 - },
26 - events: {
27 - sortstart: 'onSortStart',
28 - sortreceive: 'onSortReceive',
29 - sortupdate: 'onSortUpdate',
30 - sortover: 'onSortOver',
31 - sortout: 'onSortOut'
32 - },
33 - initialize: function initialize() {
34 - this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched).listenTo(this.view.options.model, 'request:sort:start', this.startSort).listenTo(this.view.options.model, 'request:sort:update', this.updateSort).listenTo(this.view.options.model, 'request:sort:receive', this.receiveSort);
35 - },
36 - onEditModeSwitched: function onEditModeSwitched(activeMode) {
37 - this.onToggleSortMode('edit' === activeMode);
38 - },
39 - refresh: function refresh() {
40 - this.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode'));
41 - },
42 - onRender: function onRender() {
43 - var _this = this;
44 - this.view.collection.on('update', function () {
45 - return _this.refresh();
46 - });
47 - _.defer(function () {
48 - return _this.refresh();
49 - });
50 - },
51 - onDestroy: function onDestroy() {
52 - this.deactivate();
53 - },
2112 +var _default = exports["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 +
2131 +/***/ }),
2132 +
2133 +/***/ "../assets/dev/js/modules/imports/args-object.js":
2134 +/*!*******************************************************!*\
2135 + !*** ../assets/dev/js/modules/imports/args-object.js ***!
2136 + \*******************************************************/
2137 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2138 +
2139 +"use strict";
2140 +
2141 +
2142 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2143 +Object.defineProperty(exports, "__esModule", ({
2144 + value: true
2145 +}));
2146 +exports["default"] = void 0;
2147 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2148 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2149 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2150 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2151 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2152 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2153 +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
2154 +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
2155 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2156 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2157 +var ArgsObject = exports["default"] = /*#__PURE__*/function (_InstanceType) {
54 2158 /**
55 - * Create an item placeholder in order to avoid UI jumps due to flex.
2159 + * Function constructor().
56 2160 *
57 - * @param {Object} $element - jQuery element instance to create placeholder for.
58 - * @param {string} className - Placeholder class.
59 - * @param {boolean} hide - Whether to hide the original element.
2161 + * Create ArgsObject.
60 2162 *
61 - * @return {void}
2163 + * @param {{}} args
62 2164 */
63 - createPlaceholder: function createPlaceholder($element) {
64 - var className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
65 - var hide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
66 - // Get the actual item size.
67 - $element.css('display', '');
68 - var _$element$ = $element[0],
69 - width = _$element$.clientWidth,
70 - height = _$element$.clientHeight;
71 - if (hide) {
72 - $element.css('display', 'none');
73 - }
74 - jQuery('<div />').css(_objectSpread(_objectSpread({}, $element.css(['flex-basis', 'flex-grow', 'flex-shrink', 'position'])), {}, {
75 - width: width,
76 - height: height
77 - })).addClass(className).insertAfter($element);
78 - },
2165 + function ArgsObject(args) {
2166 + var _this;
2167 + (0, _classCallCheck2.default)(this, ArgsObject);
2168 + _this = _callSuper(this, ArgsObject);
2169 + _this.args = args;
2170 + return _this;
2171 + }
2172 +
79 2173 /**
80 - * Return a settings object for jQuery UI sortable to make it swappable.
2174 + * Function requireArgument().
81 2175 *
82 - * @return {{stop: Function, start: Function}} options
2176 + * Validate property in args.
2177 + *
2178 + * @param {string} property
2179 + * @param {{}} args
2180 + *
2181 + * @throws {Error}
83 2182 */
84 - getSwappableOptions: function getSwappableOptions() {
85 - var _this2 = this;
86 - var $childViewContainer = this.getChildViewContainer(),
87 - placeholderClass = 'e-swappable--item-placeholder';
88 - return {
89 - start: function start(event, ui) {
90 - $childViewContainer.sortable('refreshPositions');
2183 + (0, _inherits2.default)(ArgsObject, _InstanceType);
2184 + return (0, _createClass2.default)(ArgsObject, [{
2185 + key: "requireArgument",
2186 + value: function requireArgument(property) {
2187 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
2188 + if (!Object.prototype.hasOwnProperty.call(args, property)) {
2189 + throw Error("".concat(property, " is required."));
2190 + }
2191 + }
91 2192
92 - // TODO: Find a better solution than this hack.
93 - // Used in order to prevent dragging a container into itself.
94 - _this2.createPlaceholder(ui.item, placeholderClass);
95 - },
96 - stop: function stop() {
97 - // Cleanup.
98 - $childViewContainer.find(".".concat(placeholderClass)).remove();
2193 + /**
2194 + * Function requireArgumentType().
2195 + *
2196 + * Validate property in args using `type === typeof(args.whatever)`.
2197 + *
2198 + * @param {string} property
2199 + * @param {string} type
2200 + * @param {{}} args
2201 + *
2202 + * @throws {Error}
2203 + */
2204 + }, {
2205 + key: "requireArgumentType",
2206 + value: function requireArgumentType(property, type) {
2207 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2208 + this.requireArgument(property, args);
2209 + if ((0, _typeof2.default)(args[property]) !== type) {
2210 + throw Error("".concat(property, " invalid type: ").concat(type, "."));
99 2211 }
100 - };
101 - },
102 - onToggleSortMode: function onToggleSortMode(isActive) {
103 - if (isActive) {
104 - this.activate();
105 - } else {
106 - this.deactivate();
107 2212 }
108 - },
109 - applySortable: function applySortable() {
110 - if (!elementor.userCan('design')) {
111 - return;
2213 +
2214 + /**
2215 + * Function requireArgumentInstance().
2216 + *
2217 + * Validate property in args using `args.whatever instanceof instance`.
2218 + *
2219 + * @param {string} property
2220 + * @param {*} instance
2221 + * @param {{}} args
2222 + *
2223 + * @throws {Error}
2224 + */
2225 + }, {
2226 + key: "requireArgumentInstance",
2227 + value: function requireArgumentInstance(property, instance) {
2228 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2229 + this.requireArgument(property, args);
2230 + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
2231 + throw Error("".concat(property, " invalid instance."));
2232 + }
112 2233 }
113 - var $childViewContainer = this.getChildViewContainer(),
114 - defaultSortableOptions = {
115 - placeholder: 'elementor-sortable-placeholder elementor-' + this.getOption('elChildType') + '-placeholder',
116 - cursorAt: {
117 - top: 20,
118 - left: 25
119 - },
120 - helper: this._getSortableHelper.bind(this),
121 - cancel: 'input, textarea, button, select, option, .elementor-inline-editing, .elementor-tab-title',
122 - // Fix: Sortable - Unable to drag and drop sections with huge height.
123 - start: function start() {
124 - $childViewContainer.sortable('refreshPositions');
125 - }
126 - };
127 - var sortableOptions = _.extend(defaultSortableOptions, this.view.getSortableOptions());
128 2234
129 - // Add a swappable behavior (used for flex containers).
130 - if (this.isSwappable()) {
131 - $childViewContainer.addClass('e-swappable');
132 - sortableOptions = _.extend(sortableOptions, this.getSwappableOptions());
2235 + /**
2236 + * Function requireArgumentConstructor().
2237 + *
2238 + * Validate property in args using `type === args.whatever.constructor`.
2239 + *
2240 + * @param {string} property
2241 + * @param {*} type
2242 + * @param {{}} args
2243 + *
2244 + * @throws {Error}
2245 + */
2246 + }, {
2247 + key: "requireArgumentConstructor",
2248 + value: function requireArgumentConstructor(property, type) {
2249 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2250 + this.requireArgument(property, args);
2251 +
2252 + // Note: Converting the constructor to string in order to avoid equation issues
2253 + // due to different memory addresses between iframes (window.Object !== window.top.Object).
2254 + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2255 + throw Error("".concat(property, " invalid constructor type."));
2256 + }
133 2257 }
2258 + }], [{
2259 + key: "getInstanceType",
2260 + value: function getInstanceType() {
2261 + return 'ArgsObject';
2262 + }
2263 + }]);
2264 +}(_instanceType.default);
134 2265
135 - // TODO: Temporary hack for Container.
136 - // Will be removed in the future when the Navigator will use React.
137 - if (sortableOptions.preventInit) {
138 - return;
2266 +/***/ }),
2267 +
2268 +/***/ "../assets/dev/js/modules/imports/instance-type.js":
2269 +/*!*********************************************************!*\
2270 + !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2271 + \*********************************************************/
2272 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2273 +
2274 +"use strict";
2275 +
2276 +
2277 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2278 +Object.defineProperty(exports, "__esModule", ({
2279 + value: true
2280 +}));
2281 +exports["default"] = void 0;
2282 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2283 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2284 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2285 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2286 +function _superPropGet(t, e, o, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), e, o); return 2 & r && "function" == typeof p ? function (t) { return p.apply(o, t); } : p; }
2287 +var InstanceType = exports["default"] = /*#__PURE__*/function () {
2288 + function InstanceType() {
2289 + var _this = this;
2290 + (0, _classCallCheck2.default)(this, InstanceType);
2291 + // Since anonymous classes sometimes do not get validated by babel, do it manually.
2292 + var target = this instanceof InstanceType ? this.constructor : void 0;
2293 + var prototypes = [];
2294 + while (target.__proto__ && target.__proto__.name) {
2295 + prototypes.push(target.__proto__);
2296 + target = target.__proto__;
139 2297 }
140 - $childViewContainer.sortable(sortableOptions);
141 - },
142 - /**
143 - * Enable sorting for this element, and generate sortable instance for it unless already generated.
144 - */
145 - activate: function activate() {
146 - if (!this.getChildViewContainer().sortable('instance')) {
147 - // Generate sortable instance for this element. Since fresh instances of sortable already allowing sorting,
148 - // we can return.
149 - this.applySortable();
150 - return;
2298 + prototypes.reverse().forEach(function (proto) {
2299 + return _this instanceof proto;
2300 + });
2301 + }
2302 + return (0, _createClass2.default)(InstanceType, null, [{
2303 + key: Symbol.hasInstance,
2304 + value: function value(target) {
2305 + /**
2306 + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2307 + * its give's opportunity to mange capabilities of instanceOf operator.
2308 + * saving current class each time will give option later to handle instanceOf manually.
2309 + */
2310 + var result = _superPropGet(InstanceType, Symbol.hasInstance, this, 2)([target]);
2311 +
2312 + // Act normal when validate a class, which does not have instance type.
2313 + if (target && !target.constructor.getInstanceType) {
2314 + return result;
2315 + }
2316 + if (target) {
2317 + if (!target.instanceTypes) {
2318 + target.instanceTypes = [];
2319 + }
2320 + if (!result) {
2321 + if (this.getInstanceType() === target.constructor.getInstanceType()) {
2322 + result = true;
2323 + }
2324 + }
2325 + if (result) {
2326 + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2327 + if (-1 === target.instanceTypes.indexOf(name)) {
2328 + target.instanceTypes.push(name);
2329 + }
2330 + }
2331 + }
2332 + if (!result && target) {
2333 + // Check if the given 'target', is instance of known types.
2334 + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2335 + }
2336 + return result;
151 2337 }
152 - this.getChildViewContainer().sortable('enable');
153 - },
154 - _getSortableHelper: function _getSortableHelper(event, $item) {
155 - var model = this.view.collection.get({
156 - cid: $item.data('model-cid')
2338 + }, {
2339 + key: "getInstanceType",
2340 + value: function getInstanceType() {
2341 + elementorModules.ForceMethodImplementation();
2342 + }
2343 + }]);
2344 +}();
2345 +
2346 +/***/ }),
2347 +
2348 +/***/ "../assets/dev/js/modules/imports/module.js":
2349 +/*!**************************************************!*\
2350 + !*** ../assets/dev/js/modules/imports/module.js ***!
2351 + \**************************************************/
2352 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2353 +
2354 +"use strict";
2355 +
2356 +
2357 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2358 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2359 +var Module = function Module() {
2360 + var $ = jQuery,
2361 + instanceParams = arguments,
2362 + self = this,
2363 + events = {};
2364 + var settings;
2365 + var ensureClosureMethods = function ensureClosureMethods() {
2366 + $.each(self, function (methodName) {
2367 + var oldMethod = self[methodName];
2368 + if ('function' !== typeof oldMethod) {
2369 + return;
2370 + }
2371 + self[methodName] = function () {
2372 + return oldMethod.apply(self, arguments);
2373 + };
157 2374 });
158 - return '<div style="height: 84px; width: 125px;" class="elementor-sortable-helper elementor-sortable-helper-' + model.get('elType') + '"><div class="icon"><i class="' + model.getIcon() + '"></i></div><div class="title-wrapper"><div class="title">' + model.getTitle() + '</div></div></div>';
159 - },
160 - getChildViewContainer: function getChildViewContainer() {
161 - return this.view.getChildViewContainer(this.view);
162 - },
163 - // The natural widget index in the column is wrong, since there are other elements
164 - // at the beginning of the column (background-overlay, element-overlay, resizeable-handle)
165 - getSortedElementNewIndex: function getSortedElementNewIndex($element) {
166 - var widgets = Object.values($element.parent().find('> .elementor-element'));
167 - return widgets.indexOf($element[0]);
168 - },
169 - /**
170 - * Disable sorting of the element unless no sortable instance exists, in which case there is already no option to
171 - * sort.
172 - */
173 - deactivate: function deactivate() {
174 - var childViewContainer = this.getChildViewContainer();
175 - if (childViewContainer.sortable('instance')) {
176 - childViewContainer.sortable('disable');
2375 + };
2376 + var initSettings = function initSettings() {
2377 + settings = self.getDefaultSettings();
2378 + var instanceSettings = instanceParams[0];
2379 + if (instanceSettings) {
2380 + $.extend(true, settings, instanceSettings);
177 2381 }
178 - },
179 - /**
180 - * Determine if the current instance of Sortable is swappable.
181 - *
182 - * @return {boolean} is swappable
183 - */
184 - isSwappable: function isSwappable() {
185 - return !!this.view.getSortableOptions().swappable;
186 - },
187 - startSort: function startSort(event, ui) {
188 - event.stopPropagation();
189 - var container = elementor.getContainer(ui.item.attr('data-id'));
190 - elementor.channels.data.reply('dragging:model', container.model).reply('dragging:view', container.view).reply('dragging:parent:view', this.view).trigger('drag:start', container.model).trigger(container.model.get('elType') + ':drag:start');
191 - },
192 - // On sorting element
193 - updateSort: function updateSort(ui, newIndex) {
194 - if (undefined === newIndex) {
195 - newIndex = ui.item.index();
2382 + };
2383 + var init = function init() {
2384 + self.__construct.apply(self, instanceParams);
2385 + ensureClosureMethods();
2386 + initSettings();
2387 + self.trigger('init');
2388 + };
2389 + this.getItems = function (items, itemKey) {
2390 + if (itemKey) {
2391 + var keyStack = itemKey.split('.'),
2392 + currentKey = keyStack.splice(0, 1);
2393 + if (!keyStack.length) {
2394 + return items[currentKey];
2395 + }
2396 + if (!items[currentKey]) {
2397 + return;
2398 + }
2399 + return this.getItems(items[currentKey], keyStack.join('.'));
196 2400 }
197 - var child = elementor.channels.data.request('dragging:view').getContainer();
198 - var result = this.moveChild(child, newIndex);
199 - if (!result) {
200 - jQuery(ui.sender).sortable('cancel');
2401 + return items;
2402 + };
2403 + this.getSettings = function (setting) {
2404 + return this.getItems(settings, setting);
2405 + };
2406 + this.setSettings = function (settingKey, value, settingsContainer) {
2407 + if (!settingsContainer) {
2408 + settingsContainer = settings;
201 2409 }
202 - },
203 - // On receiving element from another container
204 - receiveSort: function receiveSort(event, ui, newIndex) {
205 - event.stopPropagation();
206 - if (this.view.isCollectionFilled()) {
207 - jQuery(ui.sender).sortable('cancel');
208 - return;
2410 + if ('object' === (0, _typeof2.default)(settingKey)) {
2411 + $.extend(settingsContainer, settingKey);
2412 + return self;
209 2413 }
210 - var model = elementor.channels.data.request('dragging:model'),
211 - draggedElType = model.get('elType'),
212 - draggedIsInnerSection = 'section' === draggedElType && model.get('isInner'),
213 - targetIsInnerColumn = 'column' === this.view.getElementType() && this.view.isInner();
214 - if (draggedIsInnerSection && targetIsInnerColumn) {
215 - jQuery(ui.sender).sortable('cancel');
216 - return;
2414 + var keyStack = settingKey.split('.'),
2415 + currentKey = keyStack.splice(0, 1);
2416 + if (!keyStack.length) {
2417 + settingsContainer[currentKey] = value;
2418 + return self;
217 2419 }
218 - if (undefined === newIndex) {
219 - newIndex = ui.item.index();
2420 + if (!settingsContainer[currentKey]) {
2421 + settingsContainer[currentKey] = {};
220 2422 }
221 - var child = elementor.channels.data.request('dragging:view').getContainer();
222 - var result = this.moveChild(child, newIndex);
223 - if (!result) {
224 - jQuery(ui.sender).sortable('cancel');
2423 + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2424 + };
2425 + this.getErrorMessage = function (type, functionName) {
2426 + var message;
2427 + switch (type) {
2428 + case 'forceMethodImplementation':
2429 + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2430 + break;
2431 + default:
2432 + message = 'An error occurs';
225 2433 }
226 - },
227 - onSortStart: function onSortStart(event, ui) {
228 - if ('column' === this.options.elChildType) {
229 - var uiData = ui.item.data('sortableItem'),
230 - uiItems = uiData.items,
231 - itemHeight = 0;
232 - uiItems.forEach(function (item) {
233 - if (item.item[0] === ui.item[0]) {
234 - itemHeight = item.height;
235 - return false;
236 - }
2434 + return message;
2435 + };
2436 +
2437 + // TODO: This function should be deleted ?.
2438 + this.forceMethodImplementation = function (functionName) {
2439 + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2440 + };
2441 + this.on = function (eventName, callback) {
2442 + if ('object' === (0, _typeof2.default)(eventName)) {
2443 + $.each(eventName, function (singleEventName) {
2444 + self.on(singleEventName, this);
237 2445 });
238 - ui.placeholder.height(itemHeight);
2446 + return self;
239 2447 }
240 - this.startSort(event, ui);
241 - },
242 - onSortOver: function onSortOver(event) {
243 - event.stopPropagation();
244 - var model = elementor.channels.data.request('dragging:model');
245 - jQuery(event.target).addClass('elementor-draggable-over').attr({
246 - 'data-dragged-element': model.get('elType'),
247 - 'data-dragged-is-inner': model.get('isInner')
2448 + var eventNames = eventName.split(' ');
2449 + eventNames.forEach(function (singleEventName) {
2450 + if (!events[singleEventName]) {
2451 + events[singleEventName] = [];
2452 + }
2453 + events[singleEventName].push(callback);
248 2454 });
249 - this.$el.addClass('elementor-dragging-on-child');
250 - },
251 - onSortOut: function onSortOut(event) {
252 - event.stopPropagation();
253 - jQuery(event.target).removeClass('elementor-draggable-over').removeAttr('data-dragged-element data-dragged-is-inner');
254 - this.$el.removeClass('elementor-dragging-on-child');
255 - },
256 - onSortReceive: function onSortReceive(event, ui) {
257 - this.receiveSort(event, ui, this.getSortedElementNewIndex(ui.item));
258 - },
259 - onSortUpdate: function onSortUpdate(event, ui) {
260 - event.stopPropagation();
261 - if (this.getChildViewContainer()[0] !== ui.item.parent()[0]) {
262 - return;
2455 + return self;
2456 + };
2457 + this.off = function (eventName, callback) {
2458 + if (!events[eventName]) {
2459 + return self;
263 2460 }
264 - this.updateSort(ui, this.getSortedElementNewIndex(ui.item));
265 - },
266 - onAddChild: function onAddChild(view) {
267 - view.$el.attr('data-model-cid', view.model.cid);
268 - },
269 - /**
270 - * Move a child container to another position.
271 - *
272 - * @param {Container} child - The child container to move.
273 - * @param {number|string} index - New index.
274 - *
275 - * @return {Container|boolean}
276 - */
277 - moveChild: function moveChild(child, index) {
278 - return $e.run('document/elements/move', {
279 - container: child,
280 - target: this.view.getContainer(),
281 - options: {
282 - at: index
283 - }
2461 + if (!callback) {
2462 + delete events[eventName];
2463 + return self;
2464 + }
2465 + var callbackIndex = events[eventName].indexOf(callback);
2466 + if (-1 !== callbackIndex) {
2467 + delete events[eventName][callbackIndex];
2468 +
2469 + // Reset array index (for next off on same event).
2470 + events[eventName] = events[eventName].filter(function (val) {
2471 + return val;
2472 + });
2473 + }
2474 + return self;
2475 + };
2476 + this.trigger = function (eventName) {
2477 + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2478 + params = Array.prototype.slice.call(arguments, 1);
2479 + if (self[methodName]) {
2480 + self[methodName].apply(self, params);
2481 + }
2482 + var callbacks = events[eventName];
2483 + if (!callbacks) {
2484 + return self;
2485 + }
2486 + $.each(callbacks, function (index, callback) {
2487 + callback.apply(self, params);
284 2488 });
285 - }
286 -});
287 -module.exports = SortableBehavior;
2489 + return self;
2490 + };
2491 + init();
2492 +};
2493 +Module.prototype.__construct = function () {};
2494 +Module.prototype.getDefaultSettings = function () {
2495 + return {};
2496 +};
2497 +Module.prototype.getConstructorID = function () {
2498 + return this.constructor.name;
2499 +};
2500 +Module.extend = function (properties) {
2501 + var $ = jQuery,
2502 + parent = this;
2503 + var child = function child() {
2504 + return parent.apply(this, arguments);
2505 + };
2506 + $.extend(child, parent);
2507 + child.prototype = Object.create($.extend({}, parent.prototype, properties));
2508 + child.prototype.constructor = child;
2509 + child.__super__ = parent.prototype;
2510 + return child;
2511 +};
2512 +module.exports = Module;
288 2513
289 2514 /***/ }),
290 2515
291 -/***/ "../assets/dev/js/editor/elements/views/container/empty-component.js":
292 -/*!***************************************************************************!*\
293 - !*** ../assets/dev/js/editor/elements/views/container/empty-component.js ***!
294 - \***************************************************************************/
2516 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js":
2517 +/*!************************************************************************************!*\
2518 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js ***!
2519 + \************************************************************************************/
295 2520 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
296 2521
297 2522 "use strict";
2523 +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
298 2524
299 2525
300 2526 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
301 2527 Object.defineProperty(exports, "__esModule", ({
@@ -300,35 +2526,89 @@
300 2526 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
301 2527 Object.defineProperty(exports, "__esModule", ({
302 2528 value: true
303 2529 }));
304 -exports["default"] = EmptyComponent;
305 -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
306 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
307 -/* eslint-disable jsx-a11y/no-static-element-interactions */
308 -/* eslint-disable jsx-a11y/click-events-have-key-events */
2530 +exports["default"] = exports.CreateStyle = void 0;
2531 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2532 +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
2533 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2534 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2535 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2536 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2537 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2538 +var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2539 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2540 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2541 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2542 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2543 +var PROP_TYPE_CLASSES = 'classes';
309 2544
310 -function EmptyComponent() {
311 - var handleClick = function handleClick() {
312 - _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({
313 - targetName: 'add_container'
314 - });
315 - $e.route('panel/elements/categories');
316 - };
317 - return /*#__PURE__*/_react.default.createElement("div", {
318 - className: "elementor-first-add"
319 - }, /*#__PURE__*/_react.default.createElement("div", {
320 - className: "elementor-icon eicon-plus",
321 - onClick: handleClick
322 - }));
323 -}
2545 +/**
2546 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2547 + */
2548 +var CreateStyle = exports.CreateStyle = /*#__PURE__*/function (_$e$modules$editor$Co) {
2549 + function CreateStyle() {
2550 + (0, _classCallCheck2.default)(this, CreateStyle);
2551 + return _callSuper(this, CreateStyle, arguments);
2552 + }
2553 + (0, _inherits2.default)(CreateStyle, _$e$modules$editor$Co);
2554 + return (0, _createClass2.default)(CreateStyle, [{
2555 + key: "validateArgs",
2556 + value: function validateArgs(args) {
2557 + this.requireContainer(args);
2558 + this.requireArgumentConstructor('bind', String, args);
2559 + }
2560 + }, {
2561 + key: "randomId",
2562 + value: function randomId(containerId) {
2563 + return "s-".concat(containerId, "-").concat(elementorCommon.helpers.getUniqueId());
2564 + }
2565 + }, {
2566 + key: "apply",
2567 + value: function apply(args) {
2568 + var _container$settings$g;
2569 + var container = args.container,
2570 + styleDefID = args.styleDefID,
2571 + bind = args.bind;
2572 + var oldStyles = container.model.get('styles') || {};
324 2573
2574 + /* Translators: 1: container label, 2: number of old styles */
2575 + var label = sprintf((0, _i18n.__)('%1$s Style %2$s', 'elementor'), container.label, Object.keys(oldStyles).length + 1);
2576 + var newStyle = {
2577 + id: styleDefID !== null && styleDefID !== void 0 ? styleDefID : this.randomId(container.id),
2578 + label: label,
2579 + type: 'class',
2580 + variants: []
2581 + };
2582 + var oldBindSetting = (_container$settings$g = container.settings.get(bind)) !== null && _container$settings$g !== void 0 ? _container$settings$g : {
2583 + $$type: PROP_TYPE_CLASSES,
2584 + value: []
2585 + };
2586 + if (oldBindSetting.$$type !== PROP_TYPE_CLASSES || !Array.isArray(oldBindSetting.value)) {
2587 + throw new Error('Invalid bind setting prop type');
2588 + }
2589 + var newBindSetting = (0, _defineProperty2.default)({}, bind, {
2590 + $$type: PROP_TYPE_CLASSES,
2591 + value: [].concat((0, _toConsumableArray2.default)(oldBindSetting.value), [newStyle.id])
2592 + });
2593 + $e.internal('document/elements/set-settings', {
2594 + container: container,
2595 + settings: newBindSetting
2596 + });
2597 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, newStyle.id, newStyle));
2598 + container.model.set('styles', newStyles);
2599 + return newStyle;
2600 + }
2601 + }]);
2602 +}($e.modules.editor.CommandContainerInternalBase);
2603 +var _default = exports["default"] = CreateStyle;
2604 +
325 2605 /***/ }),
326 2606
327 -/***/ "../assets/dev/js/editor/utils/editor-one-events.js":
328 -/*!**********************************************************!*\
329 - !*** ../assets/dev/js/editor/utils/editor-one-events.js ***!
330 - \**********************************************************/
2607 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js":
2608 +/*!**************************************************************************************!*\
2609 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js ***!
2610 + \**************************************************************************************/
331 2611 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
332 2612
333 2613 "use strict";
334 2614
@@ -336,516 +2616,364 @@
336 2616 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
337 2617 Object.defineProperty(exports, "__esModule", ({
338 2618 value: true
339 2619 }));
340 -exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0;
2620 +exports["default"] = exports.CreateVariant = void 0;
341 2621 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
342 2622 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
343 2623 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2624 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2625 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2626 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2627 +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js");
344 2628 function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
345 2629 function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
346 -var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () {
347 - function EditorOneEventManager() {
348 - (0, _classCallCheck2.default)(this, EditorOneEventManager);
2630 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2631 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2632 +/**
2633 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2634 + */
2635 +var CreateVariant = exports.CreateVariant = /*#__PURE__*/function (_$e$modules$editor$Co) {
2636 + function CreateVariant() {
2637 + (0, _classCallCheck2.default)(this, CreateVariant);
2638 + return _callSuper(this, CreateVariant, arguments);
349 2639 }
350 - return (0, _createClass2.default)(EditorOneEventManager, null, [{
351 - key: "getEventsManager",
352 - value: function getEventsManager() {
353 - var _elementorCommon;
354 - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
355 - }
356 - }, {
357 - key: "getConfig",
358 - value: function getConfig() {
359 - var _this$getEventsManage;
360 - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
361 - }
362 - }, {
363 - key: "canSendEvents",
364 - value: function canSendEvents() {
365 - var _elementorCommon2;
366 - return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false;
367 - }
368 - }, {
369 - key: "isEventsManagerAvailable",
370 - value: function isEventsManagerAvailable() {
371 - var eventsManager = this.getEventsManager();
372 - return eventsManager && 'function' === typeof eventsManager.dispatchEvent;
373 - }
374 - }, {
375 - key: "dispatchEvent",
376 - value: function dispatchEvent(eventName, payload) {
377 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
378 - return false;
2640 + (0, _inherits2.default)(CreateVariant, _$e$modules$editor$Co);
2641 + return (0, _createClass2.default)(CreateVariant, [{
2642 + key: "validateArgs",
2643 + value: function validateArgs(args) {
2644 + this.requireContainer(args);
2645 + this.requireArgumentConstructor('styleDefID', String, args);
2646 + this.requireArgumentConstructor('meta', Object, args);
2647 + if (!('breakpoint' in args.meta && 'state' in args.meta)) {
2648 + throw new Error('Invalid meta arg');
379 2649 }
380 - try {
381 - return this.getEventsManager().dispatchEvent(eventName, payload);
382 - } catch (error) {
383 - return false;
384 - }
385 2650 }
386 2651 }, {
387 - key: "toLowerSnake",
388 - value: function toLowerSnake(value) {
389 - if (!value || 'string' !== typeof value) {
390 - return value;
2652 + key: "apply",
2653 + value: function apply(args) {
2654 + var container = args.container,
2655 + styleDefID = args.styleDefID,
2656 + meta = args.meta;
2657 + var oldStyles = container.model.get('styles') || {};
2658 + if (!oldStyles[styleDefID]) {
2659 + throw new Error('Style Def not found');
391 2660 }
392 - return value.replace(/\s+/g, '_').toLowerCase();
393 - }
394 - }, {
395 - key: "decodeHtmlEntities",
396 - value: function decodeHtmlEntities(text) {
397 - if (!text || 'string' !== typeof text) {
398 - return text;
2661 + var style = oldStyles[styleDefID];
2662 + if ((0, _getVariants.getVariantByMeta)(style.variants, meta)) {
2663 + throw new Error('Style Variant already exits');
399 2664 }
400 - var doc = new DOMParser().parseFromString(text, 'text/html');
401 - return doc.body.textContent || text;
2665 + style.variants.push({
2666 + meta: meta,
2667 + props: {}
2668 + });
2669 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, styleDefID, style));
2670 + container.model.set('styles', newStyles);
402 2671 }
403 - }, {
404 - key: "isInEditorContext",
405 - value: function isInEditorContext() {
406 - var _window$elementor;
407 - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
2672 + }]);
2673 +}($e.modules.editor.CommandContainerInternalBase);
2674 +var _default = exports["default"] = CreateVariant;
2675 +
2676 +/***/ }),
2677 +
2678 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js":
2679 +/*!************************************************************************************!*\
2680 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js ***!
2681 + \************************************************************************************/
2682 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2683 +
2684 +"use strict";
2685 +
2686 +
2687 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2688 +Object.defineProperty(exports, "__esModule", ({
2689 + value: true
2690 +}));
2691 +exports["default"] = exports.DeleteStyle = void 0;
2692 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2693 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2694 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2695 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2696 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2697 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2698 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2699 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2700 +/**
2701 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2702 + */
2703 +var DeleteStyle = exports.DeleteStyle = /*#__PURE__*/function (_$e$modules$editor$Co) {
2704 + function DeleteStyle() {
2705 + (0, _classCallCheck2.default)(this, DeleteStyle);
2706 + return _callSuper(this, DeleteStyle, arguments);
2707 + }
2708 + (0, _inherits2.default)(DeleteStyle, _$e$modules$editor$Co);
2709 + return (0, _createClass2.default)(DeleteStyle, [{
2710 + key: "validateArgs",
2711 + value: function validateArgs(args) {
2712 + this.requireContainer(args);
2713 + this.requireArgumentConstructor('styleDefID', String, args);
2714 + this.requireArgumentConstructor('bind', String, args);
408 2715 }
409 2716 }, {
410 - key: "getFinderContext",
411 - value: function getFinderContext() {
412 - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
413 - var config = this.getConfig();
414 - var isEditor = this.isInEditorContext();
415 - return {
416 - windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin,
417 - targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar)
418 - };
419 - }
420 - }, {
421 - key: "createBasePayload",
422 - value: function createBasePayload() {
423 - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
424 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
425 - var config = this.getConfig();
426 - return _objectSpread({
427 - app_type: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : 'editor',
428 - window_name: (_config$appTypes$edit2 = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.editor) !== null && _config$appTypes$edit2 !== void 0 ? _config$appTypes$edit2 : 'editor'
429 - }, overrides);
430 - }
431 - }, {
432 - key: "sendTopBarPublishDropdown",
433 - value: function sendTopBarPublishDropdown(targetName) {
434 - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
435 - var config = this.getConfig();
436 - return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({
437 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
438 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
439 - target_name: targetName,
440 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
441 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
442 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
443 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
444 - interaction_description: 'User selected an action from the publish dropdown'
445 - }));
446 - }
447 - }, {
448 - key: "sendTopBarPageList",
449 - value: function sendTopBarPageList(targetName) {
450 - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
451 - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
452 - var config = this.getConfig();
453 - return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({
454 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
455 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
456 - target_name: targetName,
457 - interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate,
458 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
459 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
460 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
461 - interaction_description: 'User selected an action from the page list dropdown'
462 - }));
463 - }
464 - }, {
465 - key: "sendSiteSettingsSession",
466 - value: function sendSiteSettingsSession(_ref) {
467 - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
468 - var targetType = _ref.targetType,
469 - _ref$visitedItems = _ref.visitedItems,
470 - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
471 - _ref$savedItems = _ref.savedItems,
472 - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
473 - state = _ref.state;
474 - var config = this.getConfig();
475 - return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({
476 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
477 - target_type: targetType,
478 - target_name: 'site_settings',
479 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
480 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
481 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
482 - interaction_description: 'Records areas visited as part of the site setting session',
483 - metadata: {
484 - visited_items: visitedItems,
485 - saved_items: savedItems
486 - },
487 - state: state
488 - }));
489 - }
490 - }, {
491 - key: "sendELibraryNav",
492 - value: function sendELibraryNav(tabName) {
493 - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
494 - var config = this.getConfig();
495 - return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({
496 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
497 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
498 - target_name: this.toLowerSnake(tabName),
499 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
500 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
501 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
502 - interaction_description: 'User navigates within elementor library'
503 - }));
504 - }
505 - }, {
506 - key: "sendELibraryInsert",
507 - value: function sendELibraryInsert(_ref2) {
508 - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
509 - var assetId = _ref2.assetId,
510 - assetName = _ref2.assetName,
511 - libraryType = _ref2.libraryType,
512 - _ref2$proRequired = _ref2.proRequired,
513 - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
514 - var config = this.getConfig();
515 - var payload = this.createBasePayload({
516 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
517 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
518 - target_name: String(assetId),
519 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
520 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
521 - location_l1: this.toLowerSnake(libraryType),
522 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
523 - interaction_description: 'User inserts block/pages from elementor library',
524 - metadata: {
525 - template_id: String(assetId),
526 - template_name: this.decodeHtmlEntities(assetName) || ''
527 - }
528 - });
529 - if (proRequired) {
530 - payload.state = 'pro_plan_required';
2717 + key: "apply",
2718 + value: function apply(args) {
2719 + var container = args.container,
2720 + styleDefID = args.styleDefID,
2721 + bind = args.bind;
2722 + var oldBindSetting = container.settings.get(bind);
2723 + if (!oldBindSetting) {
2724 + throw new Error('Setting not found');
531 2725 }
532 - return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload);
533 - }
534 - }, {
535 - key: "sendELibraryFavorite",
536 - value: function sendELibraryFavorite(_ref3) {
537 - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
538 - var assetId = _ref3.assetId,
539 - assetName = _ref3.assetName,
540 - libraryType = _ref3.libraryType,
541 - isFavorite = _ref3.isFavorite,
542 - _ref3$proRequired = _ref3.proRequired,
543 - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
544 - var config = this.getConfig();
545 - var payload = this.createBasePayload({
546 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
547 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
548 - target_name: String(assetId),
549 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
550 - target_value: Boolean(isFavorite),
551 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
552 - location_l1: this.toLowerSnake(libraryType),
553 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
554 - interaction_description: 'User favorite block/pages from elementor library',
555 - metadata: {
556 - template_id: String(assetId),
557 - template_name: this.decodeHtmlEntities(assetName) || ''
558 - }
2726 + var newBindSetting = (0, _defineProperty2.default)({}, bind, {
2727 + $$type: 'classes',
2728 + value: oldBindSetting.value.filter(function (id) {
2729 + return id !== styleDefID;
2730 + })
559 2731 });
560 - if (proRequired) {
561 - payload.state = 'pro_plan_required';
562 - }
563 - return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload);
564 - }
565 - }, {
566 - key: "sendELibraryGenerateAi",
567 - value: function sendELibraryGenerateAi(_ref4) {
568 - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
569 - var assetId = _ref4.assetId,
570 - assetName = _ref4.assetName,
571 - libraryType = _ref4.libraryType;
572 - var config = this.getConfig();
573 - return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({
574 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
575 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
576 - target_name: String(assetId),
577 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
578 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
579 - location_l1: this.toLowerSnake(libraryType),
580 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
581 - interaction_description: 'User generated block/page based on a library asset',
582 - metadata: {
583 - template_id: String(assetId),
584 - template_name: this.decodeHtmlEntities(assetName) || ''
585 - }
586 - }));
587 - }
588 - }, {
589 - key: "sendFinderSearchInput",
590 - value: function sendFinderSearchInput(_ref5) {
591 - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
592 - var resultsCount = _ref5.resultsCount,
593 - _ref5$searchTerm = _ref5.searchTerm,
594 - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
595 - var config = this.getConfig();
596 - var hasResults = resultsCount > 0;
597 - var finderContext = this.getFinderContext();
598 - var payload = this.createBasePayload({
599 - window_name: finderContext.windowName,
600 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
601 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
602 - target_name: 'finder',
603 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults,
604 - target_location: finderContext.targetLocation,
605 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
606 - interaction_description: 'Finder search input, follows debounce behavior',
607 - metadata: {
608 - results_count: resultsCount
609 - }
2732 + $e.internal('document/elements/set-settings', {
2733 + container: container,
2734 + settings: newBindSetting
610 2735 });
611 - if (!hasResults && searchTerm) {
612 - payload.metadata.search_term = searchTerm;
613 - }
614 - return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload);
2736 + var styles = container.model.get('styles') || {};
2737 + delete styles[styleDefID];
2738 + container.model.set('styles', styles);
615 2739 }
616 - }, {
617 - key: "sendFinderResultSelect",
618 - value: function sendFinderResultSelect(choice) {
619 - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
620 - var config = this.getConfig();
621 - var finderContext = this.getFinderContext();
622 - return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({
623 - window_name: finderContext.windowName,
624 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
625 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
626 - target_name: choice,
627 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
628 - target_location: finderContext.targetLocation,
629 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
630 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
631 - interaction_description: 'Finder search results was selected'
632 - }));
633 - }
634 - }, {
635 - key: "sendCanvasEmptyBoxAction",
636 - value: function sendCanvasEmptyBoxAction(_ref6) {
637 - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
638 - var targetName = _ref6.targetName,
639 - _ref6$metadata = _ref6.metadata,
640 - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
641 - _ref6$containerCreate = _ref6.containerCreated,
642 - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
643 - var config = this.getConfig();
644 - var payload = this.createBasePayload({
645 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
646 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
647 - target_name: targetName,
648 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
649 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
650 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
651 - interaction_description: 'Empty box on canvas actions'
652 - });
653 - if (Object.keys(metadata).length > 0) {
654 - payload.metadata = metadata;
2740 + }]);
2741 +}($e.modules.editor.CommandContainerInternalBase);
2742 +var _default = exports["default"] = DeleteStyle;
2743 +
2744 +/***/ }),
2745 +
2746 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js":
2747 +/*!**************************************************************************************!*\
2748 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js ***!
2749 + \**************************************************************************************/
2750 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2751 +
2752 +"use strict";
2753 +
2754 +
2755 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2756 +Object.defineProperty(exports, "__esModule", ({
2757 + value: true
2758 +}));
2759 +exports["default"] = exports.DeleteVariant = void 0;
2760 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2761 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2762 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2763 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2764 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2765 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2766 +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js");
2767 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2768 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2769 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2770 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2771 +/**
2772 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2773 + */
2774 +var DeleteVariant = exports.DeleteVariant = /*#__PURE__*/function (_$e$modules$editor$Co) {
2775 + function DeleteVariant() {
2776 + (0, _classCallCheck2.default)(this, DeleteVariant);
2777 + return _callSuper(this, DeleteVariant, arguments);
2778 + }
2779 + (0, _inherits2.default)(DeleteVariant, _$e$modules$editor$Co);
2780 + return (0, _createClass2.default)(DeleteVariant, [{
2781 + key: "validateArgs",
2782 + value: function validateArgs(args) {
2783 + this.requireContainer(args);
2784 + this.requireArgumentConstructor('styleDefID', String, args);
2785 + this.requireArgumentConstructor('meta', Object, args);
2786 + if (!('breakpoint' in args.meta && 'state' in args.meta)) {
2787 + throw new Error('Invalid meta arg');
655 2788 }
656 - if (containerCreated !== null) {
657 - payload.state = containerCreated;
658 - }
659 - return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload);
660 2789 }
661 2790 }, {
662 - key: "sendWidgetPanelSearch",
663 - value: function sendWidgetPanelSearch(_ref7) {
664 - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
665 - var resultsCount = _ref7.resultsCount,
666 - _ref7$userInput = _ref7.userInput,
667 - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
668 - var config = this.getConfig();
669 - var hasResults = resultsCount > 0;
670 - var payload = this.createBasePayload({
671 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
672 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
673 - target_name: 'search_widget',
674 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults,
675 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
676 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
677 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
678 - interaction_description: 'Widget search input, follows debounce behavior'
679 - });
680 - if (!hasResults && userInput) {
681 - payload.metadata = {
682 - user_input: userInput
683 - };
2791 + key: "apply",
2792 + value: function apply(args) {
2793 + var container = args.container,
2794 + styleDefID = args.styleDefID,
2795 + meta = args.meta;
2796 + var oldStyles = container.model.get('styles') || {};
2797 + var style = {};
2798 + if (!oldStyles[styleDefID]) {
2799 + throw new Error('Style Def not found');
684 2800 }
685 - return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload);
2801 + style = oldStyles[styleDefID];
2802 + style.variants = (0, _getVariants.getVariantsWithoutMeta)(style.variants, meta);
2803 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, style.id, style));
2804 + container.model.set('styles', newStyles);
686 2805 }
687 - }, {
688 - key: "createWpDashPayload",
689 - value: function createWpDashPayload() {
690 - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11;
691 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
692 - var config = this.getConfig();
693 - return this.createBasePayload(_objectSpread({
694 - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes5 = config.appTypes) === null || _config$appTypes5 === void 0 ? void 0 : _config$appTypes5.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : 'wpdash',
695 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
696 - location_l2: ''
697 - }, overrides));
698 - }
699 - }, {
700 - key: "sendWpDashElementorMenuClick",
701 - value: function sendWpDashElementorMenuClick() {
702 - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11;
703 - var config = this.getConfig();
704 - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({
705 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
706 - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
707 - target_name: 'elementor_menu_item',
708 - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
709 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
710 - interaction_description: 'core_user_clicked_elementor_menu_item'
711 - }));
712 - }
713 - }, {
714 - key: "sendWpDashEditorSubMenuHover",
715 - value: function sendWpDashEditorSubMenuHover() {
716 - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12;
717 - var config = this.getConfig();
718 - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({
719 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
720 - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
721 - target_name: 'wpdash_editor_sub_menu',
722 - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
723 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
724 - interaction_description: 'core_user_hovered_sub_menu'
725 - }));
726 - }
727 - }, {
728 - key: "sendWpDashThemeBuilderClick",
729 - value: function sendWpDashThemeBuilderClick() {
730 - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13;
731 - var config = this.getConfig();
732 - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({
733 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
734 - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
735 - target_name: 'theme_builder_menu_item',
736 - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
737 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
738 - interaction_description: 'core_user_clicked_theme_builder_menu_item'
739 - }));
740 - }
741 2806 }]);
742 -}();
743 -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
744 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
745 - return _.debounce(function (resultsCount, searchTerm) {
746 - EditorOneEventManager.sendFinderSearchInput({
747 - resultsCount: resultsCount,
748 - searchTerm: searchTerm
749 - });
750 - }, delay);
751 -};
752 -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
753 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
754 - return _.debounce(function (resultsCount, userInput) {
755 - EditorOneEventManager.sendWidgetPanelSearch({
756 - resultsCount: resultsCount,
757 - userInput: userInput
758 - });
759 - }, delay);
760 -};
761 -var _default = exports["default"] = EditorOneEventManager;
2807 +}($e.modules.editor.CommandContainerInternalBase);
2808 +var _default = exports["default"] = DeleteVariant;
762 2809
763 2810 /***/ }),
764 2811
765 -/***/ "../assets/dev/js/editor/utils/element-types.js":
766 -/*!******************************************************!*\
767 - !*** ../assets/dev/js/editor/utils/element-types.js ***!
768 - \******************************************************/
769 -/***/ ((module) => {
2812 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/index.js":
2813 +/*!*****************************************************************************!*\
2814 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/index.js ***!
2815 + \*****************************************************************************/
2816 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
770 2817
771 2818 "use strict";
772 2819
773 2820
2821 +Object.defineProperty(exports, "__esModule", ({
2822 + value: true
2823 +}));
2824 +Object.defineProperty(exports, "CreateStyle", ({
2825 + enumerable: true,
2826 + get: function get() {
2827 + return _createStyle.CreateStyle;
2828 + }
2829 +}));
2830 +Object.defineProperty(exports, "CreateVariant", ({
2831 + enumerable: true,
2832 + get: function get() {
2833 + return _createVariant.CreateVariant;
2834 + }
2835 +}));
2836 +Object.defineProperty(exports, "DeleteStyle", ({
2837 + enumerable: true,
2838 + get: function get() {
2839 + return _deleteStyle.DeleteStyle;
2840 + }
2841 +}));
2842 +Object.defineProperty(exports, "DeleteVariant", ({
2843 + enumerable: true,
2844 + get: function get() {
2845 + return _deleteVariant.DeleteVariant;
2846 + }
2847 +}));
2848 +Object.defineProperty(exports, "UpdateProps", ({
2849 + enumerable: true,
2850 + get: function get() {
2851 + return _updateProps.UpdateProps;
2852 + }
2853 +}));
2854 +var _updateProps = __webpack_require__(/*! ./update-props */ "../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js");
2855 +var _createStyle = __webpack_require__(/*! ./create-style */ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js");
2856 +var _deleteStyle = __webpack_require__(/*! ./delete-style */ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js");
2857 +var _createVariant = __webpack_require__(/*! ./create-variant */ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js");
2858 +var _deleteVariant = __webpack_require__(/*! ./delete-variant */ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js");
2859 +
2860 +/***/ }),
2861 +
2862 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js":
2863 +/*!************************************************************************************!*\
2864 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js ***!
2865 + \************************************************************************************/
2866 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2867 +
2868 +"use strict";
2869 +
2870 +
2871 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2872 +Object.defineProperty(exports, "__esModule", ({
2873 + value: true
2874 +}));
2875 +exports["default"] = exports.UpdateProps = void 0;
2876 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
2877 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2878 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2879 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2880 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2881 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2882 +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js");
2883 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2884 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
774 2885 /**
775 - * Returns an array of all available element types.
776 - *
777 - * @return {string[]} Array of element type strings.
2886 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
778 2887 */
779 -var getAllElementTypes = function getAllElementTypes() {
780 - return Object.keys(elementor.getConfig().elements);
781 -};
782 -module.exports = {
783 - getAllElementTypes: getAllElementTypes
784 -};
2888 +var UpdateProps = exports.UpdateProps = /*#__PURE__*/function (_$e$modules$editor$Co) {
2889 + function UpdateProps() {
2890 + (0, _classCallCheck2.default)(this, UpdateProps);
2891 + return _callSuper(this, UpdateProps, arguments);
2892 + }
2893 + (0, _inherits2.default)(UpdateProps, _$e$modules$editor$Co);
2894 + return (0, _createClass2.default)(UpdateProps, [{
2895 + key: "validateArgs",
2896 + value: function validateArgs(args) {
2897 + this.requireContainer(args);
2898 + this.requireArgumentConstructor('styleDefID', String, args);
2899 + this.requireArgumentConstructor('meta', Object, args);
2900 + this.requireArgumentConstructor('props', Object, args);
2901 + if (!('breakpoint' in args.meta && 'state' in args.meta)) {
2902 + throw new Error('Invalid meta arg');
2903 + }
2904 + if (0 === Object.keys(args.props).length) {
2905 + throw new Error('Props are empty');
2906 + }
2907 + }
2908 + }, {
2909 + key: "updateExistingVariant",
2910 + value: function updateExistingVariant(variant, props) {
2911 + Object.entries(props).forEach(function (_ref) {
2912 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
2913 + key = _ref2[0],
2914 + value = _ref2[1];
2915 + if (null === value || undefined === value) {
2916 + delete variant.props[key];
2917 + return;
2918 + }
2919 + variant.props[key] = value;
2920 + });
2921 + }
2922 + }, {
2923 + key: "apply",
2924 + value: function apply(args) {
2925 + var container = args.container,
2926 + styleDefID = args.styleDefID,
2927 + meta = args.meta,
2928 + props = args.props;
2929 + var styles = container.model.get('styles') || {};
2930 + var style = styles[styleDefID];
2931 + if (!style) {
2932 + throw new Error('Style Def not found');
2933 + }
2934 + var variant = (0, _getVariants.getVariantByMeta)(style.variants, meta);
2935 + if (!variant) {
2936 + throw new Error('Style Variant not found');
2937 + }
2938 + this.updateExistingVariant(variant, props);
2939 + }
2940 + }]);
2941 +}($e.modules.editor.CommandContainerInternalBase);
2942 +var _default = exports["default"] = UpdateProps;
785 2943
786 2944 /***/ }),
787 2945
788 -/***/ "../assets/dev/js/utils/react.js":
789 -/*!***************************************!*\
790 - !*** ../assets/dev/js/utils/react.js ***!
791 - \***************************************/
2946 +/***/ "../modules/atomic-widgets/assets/js/editor/commands/index.js":
2947 +/*!********************************************************************!*\
2948 + !*** ../modules/atomic-widgets/assets/js/editor/commands/index.js ***!
2949 + \********************************************************************/
792 2950 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
793 2951
794 2952 "use strict";
795 2953
796 2954
797 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
798 2955 Object.defineProperty(exports, "__esModule", ({
799 2956 value: true
800 2957 }));
801 -exports["default"] = void 0;
802 -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
803 -var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom"));
804 -var _client = __webpack_require__(/*! react-dom/client */ "../node_modules/react-dom/client.js");
805 -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
806 -/**
807 - * Support conditional rendering of a React App to the DOM, based on the React version.
808 - * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions.
809 - *
810 - * @param { React.ReactElement } app The app to render.
811 - * @param { HTMLElement } domElement The DOM element to render the app into.
812 - *
813 - * @return {{ unmount: () => void }} The unmount function.
814 - */
815 -function render(app, domElement) {
816 - var unmountFunction;
817 - try {
818 - var root = (0, _client.createRoot)(domElement);
819 - root.render(app);
820 - unmountFunction = function unmountFunction() {
821 - root.unmount();
822 - };
823 - } catch (e) {
824 - // eslint-disable-next-line react/no-deprecated
825 - ReactDOM.render(app, domElement);
826 - unmountFunction = function unmountFunction() {
827 - // eslint-disable-next-line react/no-deprecated
828 - ReactDOM.unmountComponentAtNode(domElement);
829 - };
2958 +Object.defineProperty(exports, "Styles", ({
2959 + enumerable: true,
2960 + get: function get() {
2961 + return _styles.Styles;
830 2962 }
831 - return {
832 - unmount: unmountFunction
833 - };
834 -}
835 -var _default = exports["default"] = {
836 - render: render
837 -};
2963 +}));
2964 +var _styles = __webpack_require__(/*! ./styles */ "../modules/atomic-widgets/assets/js/editor/commands/styles.js");
838 2965
839 2966 /***/ }),
840 2967
841 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js":
842 -/*!*******************************************************************************!*\
843 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js ***!
844 - \*******************************************************************************/
2968 +/***/ "../modules/atomic-widgets/assets/js/editor/commands/styles.js":
2969 +/*!*********************************************************************!*\
2970 + !*** ../modules/atomic-widgets/assets/js/editor/commands/styles.js ***!
2971 + \*********************************************************************/
845 2972 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
846 2973
847 2974 "use strict";
2975 +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
848 2976
849 2977
850 2978 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
851 2979 Object.defineProperty(exports, "__esModule", ({
@@ -850,105 +2978,214 @@
850 2978 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
851 2979 Object.defineProperty(exports, "__esModule", ({
852 2980 value: true
853 2981 }));
854 -exports["default"] = void 0;
2982 +exports["default"] = exports.Styles = void 0;
2983 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
855 2984 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
856 2985 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
857 2986 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
858 2987 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
859 -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
860 2988 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2989 +var _getVariants = __webpack_require__(/*! ../utils/get-variants */ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js");
2990 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2991 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
861 2992 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
862 2993 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
863 -function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
864 -var AtomicElementBaseModel = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
865 - function AtomicElementBaseModel() {
866 - (0, _classCallCheck2.default)(this, AtomicElementBaseModel);
867 - return _callSuper(this, AtomicElementBaseModel, arguments);
2994 +/**
2995 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2996 + */
2997 +var Styles = exports.Styles = /*#__PURE__*/function (_$e$modules$editor$do) {
2998 + function Styles() {
2999 + (0, _classCallCheck2.default)(this, Styles);
3000 + return _callSuper(this, Styles, arguments);
868 3001 }
869 - (0, _inherits2.default)(AtomicElementBaseModel, _elementor$modules$el);
870 - return (0, _createClass2.default)(AtomicElementBaseModel, [{
871 - key: "isValidChild",
3002 + (0, _inherits2.default)(Styles, _$e$modules$editor$do);
3003 + return (0, _createClass2.default)(Styles, [{
3004 + key: "validateArgs",
3005 + value: function validateArgs(args) {
3006 + this.requireContainer(args);
3007 + if (!args.bind && !args.styleDefID) {
3008 + throw new Error('Missing bind or styleDefID');
3009 + }
3010 + if (args.bind && 'string' !== typeof args.bind) {
3011 + throw new Error('Invalid bind arg');
3012 + }
3013 + if (args.styleDefID && 'string' !== typeof args.styleDefID) {
3014 + throw new Error('Invalid styleDefID arg');
3015 + }
3016 + }
3017 +
3018 + /**
3019 + * Function restore().
3020 + *
3021 + * Redo/Restore.
3022 + *
3023 + * @param {{}} historyItem
3024 + * @param {boolean} isRedo
3025 + */
3026 + }, {
3027 + key: "addToHistory",
872 3028 value:
873 3029 /**
874 - * Do not allow section, column or container be placed in the Atomic container.
3030 + * Function addToHistory().
875 3031 *
876 - * @param {*} childModel
3032 + * @param {Container} container
3033 + * @param {string} bind
3034 + * @param {string} styleDefID
3035 + * @param {{}} meta
3036 + * @param {{}} props
3037 + * @param {{}} oldProps
877 3038 */
878 - function isValidChild(childModel) {
879 - var elType = childModel.get('elType');
880 - return 'section' !== elType && 'column' !== elType;
3039 + function addToHistory(container, bind, styleDefID, meta, props, oldProps) {
3040 + var newPropsEmpty = Object.keys(props).reduce(function (emptyValues, key) {
3041 + emptyValues[key] = undefined;
3042 + return emptyValues;
3043 + }, {});
3044 + var changes = (0, _defineProperty2.default)({}, container.id, {
3045 + bind: bind,
3046 + styleDefID: styleDefID,
3047 + meta: meta,
3048 + old: {
3049 + props: _objectSpread(_objectSpread({}, newPropsEmpty), oldProps)
3050 + },
3051 + new: {
3052 + props: props
3053 + }
3054 + }),
3055 + historyItem = {
3056 + container: container,
3057 + data: {
3058 + changes: changes
3059 + },
3060 + type: 'change',
3061 + restore: Styles.restore
3062 + };
3063 + $e.internal('document/history/add-transaction', historyItem);
881 3064 }
882 3065 }, {
883 - key: "initialize",
884 - value: function initialize(attributes, options) {
885 - var _this$config;
886 - var elementType = this.get('elType');
887 - this.config = elementor.config.elements[elementType];
888 - if ((_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.meta) !== null && _this$config !== void 0 && _this$config.permanently_locked) {
889 - this.set('isLocked', true);
3066 + key: "getHistory",
3067 + value: function getHistory(args) {
3068 + var container = args.container,
3069 + subTitle = this.constructor.getSubTitle(args);
3070 + return {
3071 + container: container,
3072 + subTitle: subTitle,
3073 + type: 'change'
3074 + };
3075 + }
3076 + }, {
3077 + key: "apply",
3078 + value: function apply(args) {
3079 + var _args$styleDefID, _container$model$get;
3080 + var container = args.container;
3081 + var bind = args.bind,
3082 + meta = args.meta,
3083 + props = args.props;
3084 + container = container.lookup();
3085 + var styleDefID = (_args$styleDefID = args.styleDefID) !== null && _args$styleDefID !== void 0 ? _args$styleDefID : null;
3086 + var currentStyle = (_container$model$get = container.model.get('styles')) !== null && _container$model$get !== void 0 ? _container$model$get : {};
3087 +
3088 + // Saving a deep clone of the style before it mutates, as part of this command
3089 + var oldStyle = this.isHistoryActive() ? structuredClone(currentStyle) : null;
3090 + var style = {};
3091 + if (!styleDefID) {
3092 + // Create a new style definition for the first time
3093 + style = $e.internal('document/atomic-widgets/create-style', {
3094 + container: container,
3095 + bind: bind
3096 + });
3097 + styleDefID = style.id;
3098 + } else if (!currentStyle[styleDefID]) {
3099 + // Create a new style definition with the given ID
3100 + // used when the style is deleted and then re-applied (i.e. history undo/redo)
3101 + style = $e.internal('document/atomic-widgets/create-style', {
3102 + container: container,
3103 + styleDefID: styleDefID,
3104 + bind: bind
3105 + });
3106 + } else {
3107 + // Use the existing style definition
3108 + style = currentStyle[styleDefID];
890 3109 }
891 - var isNewElementCreate = 0 === this.get('elements').length && $e.commands.currentTrace.includes('document/elements/create');
892 - if (isNewElementCreate) {
893 - this.onElementCreate();
3110 + var currentVariant = (0, _getVariants.getVariantByMeta)(style.variants, meta);
3111 + if (!currentVariant) {
3112 + $e.internal('document/atomic-widgets/create-variant', {
3113 + container: container,
3114 + styleDefID: styleDefID,
3115 + meta: meta
3116 + });
894 3117 }
895 - _superPropGet(AtomicElementBaseModel, "initialize", this, 3)([attributes, options]);
896 - }
897 - }, {
898 - key: "getDefaultChildren",
899 - value: function getDefaultChildren() {
900 - var defaultChildren = this.config.default_children;
901 - return this.modifyDefaultChildren(defaultChildren);
902 - }
903 - }, {
904 - key: "onElementCreate",
905 - value: function onElementCreate() {
906 - var _this = this;
907 - if (this.get('skipDefaultChildren')) {
908 - this.unset('skipDefaultChildren', {
909 - silent: true
3118 + var nonEmptyValues = Object.values(_objectSpread(_objectSpread({}, currentVariant === null || currentVariant === void 0 ? void 0 : currentVariant.props), props)).filter(function (value) {
3119 + return value !== undefined;
3120 + });
3121 + if (0 === nonEmptyValues.length) {
3122 + // Doesn't have any props to use for this variant
3123 + $e.internal('document/atomic-widgets/delete-variant', {
3124 + container: container,
3125 + styleDefID: styleDefID,
3126 + meta: meta
910 3127 });
911 - return;
3128 + var newStyles = container.model.get('styles');
3129 + var newVariants = newStyles[styleDefID].variants;
3130 + if (0 === newVariants.length) {
3131 + // After deleting the variant, there are no variants left
3132 + $e.internal('document/atomic-widgets/delete-style', {
3133 + container: container,
3134 + styleDefID: styleDefID,
3135 + bind: bind
3136 + });
3137 + }
3138 + } else {
3139 + // Has valid props in the current variant
3140 + $e.internal('document/atomic-widgets/update-props', {
3141 + container: container,
3142 + styleDefID: styleDefID,
3143 + bind: bind,
3144 + meta: meta,
3145 + props: props
3146 + });
912 3147 }
913 - this.set('elements', this.getDefaultChildren().map(function (element) {
914 - return _this.buildElement(element);
915 - }));
3148 + if (null !== oldStyle) {
3149 + var _getVariantByMeta;
3150 + var oldStyleDef = oldStyle[styleDefID];
3151 + var oldProps = oldStyleDef !== null && oldStyleDef !== void 0 && oldStyleDef.variants ? (_getVariantByMeta = (0, _getVariants.getVariantByMeta)(oldStyleDef.variants, meta)) === null || _getVariantByMeta === void 0 ? void 0 : _getVariantByMeta.props : {};
3152 + this.addToHistory(container, bind, styleDefID, meta, props, oldProps);
3153 + }
916 3154 }
917 - }, {
918 - key: "modifyDefaultChildren",
919 - value: function modifyDefaultChildren(element) {
920 - return element;
3155 + }], [{
3156 + key: "getSubTitle",
3157 + value: function getSubTitle() {
3158 + return __('Style', 'elementor');
921 3159 }
922 3160 }, {
923 - key: "buildElement",
924 - value: function buildElement(element) {
925 - var _this2 = this,
926 - _element$settings;
927 - var id = elementorCommon.helpers.getUniqueId();
928 - var elements = (element.elements || []).map(function (el) {
929 - return _this2.buildElement(el);
3161 + key: "restore",
3162 + value: function restore(historyItem, isRedo) {
3163 + var container = historyItem.get('container');
3164 + var changes = historyItem.get('data').changes[container.id];
3165 + var bind = changes.bind,
3166 + styleDefID = changes.styleDefID,
3167 + meta = changes.meta;
3168 + var _ref = isRedo ? changes.new : changes.old,
3169 + props = _ref.props;
3170 + $e.run('document/atomic-widgets/styles', {
3171 + container: container,
3172 + bind: bind,
3173 + styleDefID: styleDefID,
3174 + meta: meta,
3175 + props: props
930 3176 });
931 - return {
932 - elType: element.elType,
933 - widgetType: element.widgetType,
934 - id: id,
935 - settings: (_element$settings = element.settings) !== null && _element$settings !== void 0 ? _element$settings : {},
936 - elements: elements,
937 - isLocked: element.isLocked || false,
938 - editor_settings: element.editor_settings || {},
939 - meta: element.meta || {}
940 - };
941 3177 }
942 3178 }]);
943 -}(elementor.modules.elements.models.Element);
3179 +}($e.modules.editor.document.CommandHistoryDebounceBase);
3180 +var _default = exports["default"] = Styles;
944 3181
945 3182 /***/ }),
946 3183
947 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js":
948 -/*!******************************************************************************!*\
949 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js ***!
950 - \******************************************************************************/
3184 +/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
3185 +/*!***************************************************************!*\
3186 + !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
3187 + \***************************************************************/
951 3188 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
952 3189
953 3190 "use strict";
954 3191
@@ -953,8 +3190,9 @@
953 3190 "use strict";
954 3191
955 3192
956 3193 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3194 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
957 3195 Object.defineProperty(exports, "__esModule", ({
958 3196 value: true
959 3197 }));
960 3198 exports["default"] = void 0;
@@ -962,53 +3200,45 @@
962 3200 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
963 3201 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
964 3202 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
965 3203 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3204 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
3205 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/atomic-widgets/assets/js/editor/commands/index.js"));
3206 +var commandsInternal = _interopRequireWildcard(__webpack_require__(/*! ./commands-internal/ */ "../modules/atomic-widgets/assets/js/editor/commands-internal/index.js"));
3207 +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
3208 +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
966 3209 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
967 3210 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
968 -var AtomicElementBaseType = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
969 - function AtomicElementBaseType(elementType, viewClass) {
970 - var _this;
971 - var modelClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
972 - var emptyViewClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
973 - (0, _classCallCheck2.default)(this, AtomicElementBaseType);
974 - _this = _callSuper(this, AtomicElementBaseType);
975 - _this.elementType = elementType;
976 - _this.viewClass = viewClass;
977 - _this.modelClass = modelClass;
978 - _this.emptyViewClass = emptyViewClass;
979 - return _this;
3211 +var Component = exports["default"] = /*#__PURE__*/function (_ComponentBase) {
3212 + function Component() {
3213 + (0, _classCallCheck2.default)(this, Component);
3214 + return _callSuper(this, Component, arguments);
980 3215 }
981 - (0, _inherits2.default)(AtomicElementBaseType, _elementor$modules$el);
982 - return (0, _createClass2.default)(AtomicElementBaseType, [{
983 - key: "getType",
984 - value: function getType() {
985 - return this.elementType;
3216 + (0, _inherits2.default)(Component, _ComponentBase);
3217 + return (0, _createClass2.default)(Component, [{
3218 + key: "getNamespace",
3219 + value: function getNamespace() {
3220 + return 'document/atomic-widgets';
986 3221 }
987 3222 }, {
988 - key: "getView",
989 - value: function getView() {
990 - return this.viewClass;
3223 + key: "defaultCommands",
3224 + value: function defaultCommands() {
3225 + return this.importCommands(commands);
991 3226 }
992 3227 }, {
993 - key: "getEmptyView",
994 - value: function getEmptyView() {
995 - return this.emptyViewClass || elementor.modules.elements.views.EmptyComponent;
3228 + key: "defaultCommandsInternal",
3229 + value: function defaultCommandsInternal() {
3230 + return this.importCommands(commandsInternal);
996 3231 }
997 - }, {
998 - key: "getModel",
999 - value: function getModel() {
1000 - return this.modelClass || elementor.modules.elements.models.AtomicElementBase;
1001 - }
1002 3232 }]);
1003 -}(elementor.modules.elements.types.Base);
3233 +}(_componentBase.default);
1004 3234
1005 3235 /***/ }),
1006 3236
1007 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js":
1008 -/*!************************************************************************************************!*\
1009 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js ***!
1010 - \************************************************************************************************/
3237 +/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-variants.js":
3238 +/*!************************************************************************!*\
3239 + !*** ../modules/atomic-widgets/assets/js/editor/utils/get-variants.js ***!
3240 + \************************************************************************/
1011 3241 /***/ ((__unused_webpack_module, exports) => {
1012 3242
1013 3243 "use strict";
1014 3244
@@ -1015,63 +3245,144 @@
1015 3245
1016 3246 Object.defineProperty(exports, "__esModule", ({
1017 3247 value: true
1018 3248 }));
1019 -exports["default"] = void 0;
1020 -var createDivBlockType = function createDivBlockType() {
1021 - var DivBlockView = elementor.modules.elements.views.createAtomicElementBase('e-div-block');
1022 - return new elementor.modules.elements.types.AtomicElementBase('e-div-block', DivBlockView);
1023 -};
1024 -var _default = exports["default"] = createDivBlockType;
3249 +exports.getVariantByMeta = getVariantByMeta;
3250 +exports.getVariantsWithoutMeta = getVariantsWithoutMeta;
3251 +function getVariantByMeta(variants, meta) {
3252 + return variants.find(function (variant) {
3253 + return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;
3254 + });
3255 +}
3256 +function getVariantsWithoutMeta(variants, meta) {
3257 + return variants.filter(function (variant) {
3258 + return variant.meta.breakpoint !== meta.breakpoint || variant.meta.state !== meta.state;
3259 + });
3260 +}
1025 3261
1026 3262 /***/ }),
1027 3263
1028 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js":
1029 -/*!**********************************************************************************************!*\
1030 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js ***!
1031 - \**********************************************************************************************/
1032 -/***/ ((__unused_webpack_module, exports) => {
3264 +/***/ "../modules/web-cli/assets/js/modules/command-base.js":
3265 +/*!************************************************************!*\
3266 + !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
3267 + \************************************************************/
3268 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1033 3269
1034 3270 "use strict";
1035 3271
1036 3272
3273 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1037 3274 Object.defineProperty(exports, "__esModule", ({
1038 3275 value: true
1039 3276 }));
1040 3277 exports["default"] = void 0;
1041 -var createFlexboxType = function createFlexboxType() {
1042 - var FlexboxView = elementor.modules.elements.views.createAtomicElementBase('e-flexbox');
1043 - return new elementor.modules.elements.types.AtomicElementBase('e-flexbox', FlexboxView);
1044 -};
1045 -var _default = exports["default"] = createFlexboxType;
3278 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3279 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3280 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3281 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3282 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3283 +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
3284 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
3285 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
3286 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3287 +/**
3288 + * @name $e.modules.CommandBase
3289 + */
3290 +var CommandBase = exports["default"] = /*#__PURE__*/function (_CommandInfra) {
3291 + function CommandBase() {
3292 + (0, _classCallCheck2.default)(this, CommandBase);
3293 + return _callSuper(this, CommandBase, arguments);
3294 + }
3295 + (0, _inherits2.default)(CommandBase, _CommandInfra);
3296 + return (0, _createClass2.default)(CommandBase, [{
3297 + key: "onBeforeRun",
3298 + value: function onBeforeRun() {
3299 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3300 + $e.hooks.runUIBefore(this.command, args);
3301 + }
3302 + }, {
3303 + key: "onAfterRun",
3304 + value: function onAfterRun() {
3305 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3306 + var result = arguments.length > 1 ? arguments[1] : undefined;
3307 + $e.hooks.runUIAfter(this.command, args, result);
3308 + }
3309 + }, {
3310 + key: "onBeforeApply",
3311 + value: function onBeforeApply() {
3312 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3313 + $e.hooks.runDataDependency(this.command, args);
3314 + }
3315 + }, {
3316 + key: "onAfterApply",
3317 + value: function onAfterApply() {
3318 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3319 + var result = arguments.length > 1 ? arguments[1] : undefined;
3320 + $e.hooks.runDataAfter(this.command, args, result);
3321 + }
3322 + }, {
3323 + key: "onCatchApply",
3324 + value: function onCatchApply(e) {
3325 + this.runCatchHooks(e);
3326 + }
1046 3327
1047 -/***/ }),
3328 + /**
3329 + * Run all the catch hooks.
3330 + *
3331 + * @param {Error} e
3332 + */
3333 + }, {
3334 + key: "runCatchHooks",
3335 + value: function runCatchHooks(e) {
3336 + $e.hooks.runDataCatch(this.command, this.args, e);
3337 + $e.hooks.runUICatch(this.command, this.args, e);
3338 + }
1048 3339
1049 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js":
1050 -/*!*******************************************************************************************!*\
1051 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js ***!
1052 - \*******************************************************************************************/
1053 -/***/ ((__unused_webpack_module, exports) => {
3340 + /**
3341 + * TODO - Remove - Backwards compatibility.
3342 + *
3343 + * Function requireContainer().
3344 + *
3345 + * Validate `arg.container` & `arg.containers`.
3346 + *
3347 + * @param {{}} args
3348 + * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead.
3349 + *
3350 + * @throws {Error}
3351 + */
3352 + }, {
3353 + key: "requireContainer",
3354 + value: function requireContainer() {
3355 + var _this = this;
3356 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
3357 + _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
3358 + if (!args.container && !args.containers) {
3359 + throw Error('container or containers are required.');
3360 + }
3361 + if (args.container && args.containers) {
3362 + throw Error('container and containers cannot go together please select one of them.');
3363 + }
3364 + var containers = args.containers || [args.container];
3365 + containers.forEach(function (container) {
3366 + _this.requireArgumentInstance('container', elementorModules.editor.Container, {
3367 + container: container
3368 + });
3369 + });
3370 + }
3371 + }], [{
3372 + key: "getInstanceType",
3373 + value: function getInstanceType() {
3374 + return 'CommandBase';
3375 + }
3376 + }]);
3377 +}(_commandInfra.default);
1054 3378
1055 -"use strict";
1056 -
1057 -
1058 -Object.defineProperty(exports, "__esModule", ({
1059 - value: true
1060 -}));
1061 -exports["default"] = void 0;
1062 -var createGridType = function createGridType() {
1063 - var GridView = elementor.modules.elements.views.createAtomicElementBase('e-grid');
1064 - return new elementor.modules.elements.types.AtomicElementBase('e-grid', GridView);
1065 -};
1066 -var _default = exports["default"] = createGridType;
1067 -
1068 3379 /***/ }),
1069 3380
1070 -/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
1071 -/*!***************************************************************!*\
1072 - !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
1073 - \***************************************************************/
3381 +/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
3382 +/*!*********************************************************************!*\
3383 + !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
3384 + \*********************************************************************/
1074 3385 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1075 3386
1076 3387 "use strict";
1077 3388
@@ -1076,9 +3387,8 @@
1076 3387 "use strict";
1077 3388
1078 3389
1079 3390 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1080 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1081 3391 Object.defineProperty(exports, "__esModule", ({
1082 3392 value: true
1083 3393 }));
1084 3394 exports["default"] = void 0;
@@ -1086,37 +3396,53 @@
1086 3396 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1087 3397 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1088 3398 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1089 3399 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1090 -var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js"));
1091 -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
3400 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
1092 3401 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1093 3402 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1094 -var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
1095 - function Component() {
1096 - (0, _classCallCheck2.default)(this, Component);
1097 - return _callSuper(this, Component, arguments);
3403 +/**
3404 + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
3405 + */
3406 +var CommandCallbackBase = exports["default"] = /*#__PURE__*/function (_CommandBase) {
3407 + function CommandCallbackBase() {
3408 + (0, _classCallCheck2.default)(this, CommandCallbackBase);
3409 + return _callSuper(this, CommandCallbackBase, arguments);
1098 3410 }
1099 - (0, _inherits2.default)(Component, _$e$modules$Component);
1100 - return (0, _createClass2.default)(Component, [{
1101 - key: "getNamespace",
1102 - value: function getNamespace() {
1103 - return 'document/atomic-widgets';
3411 + (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
3412 + return (0, _createClass2.default)(CommandCallbackBase, [{
3413 + key: "apply",
3414 + value: function apply() {
3415 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3416 + return this.constructor.getCallback()(args);
1104 3417 }
3418 + }], [{
3419 + key: "getInstanceType",
3420 + value: function getInstanceType() {
3421 + return 'CommandCallbackBase';
3422 + }
3423 +
3424 + /**
3425 + * Get original callback of the command.
3426 + *
3427 + * Support pure callbacks ( Non command-base ).
3428 + *
3429 + * @return {()=>{}} Command Results.
3430 + */
1105 3431 }, {
1106 - key: "defaultHooks",
1107 - value: function defaultHooks() {
1108 - return this.importHooks(hooks);
3432 + key: "getCallback",
3433 + value: function getCallback() {
3434 + return this.registerConfig.callback;
1109 3435 }
1110 3436 }]);
1111 -}($e.modules.ComponentBase);
3437 +}(_commandBase.default);
1112 3438
1113 3439 /***/ }),
1114 3440
1115 -/***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js":
1116 -/*!*****************************************************************************************!*\
1117 - !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***!
1118 - \*****************************************************************************************/
3441 +/***/ "../modules/web-cli/assets/js/modules/command-infra.js":
3442 +/*!*************************************************************!*\
3443 + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
3444 + \*************************************************************/
1119 3445 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1120 3446
1121 3447 "use strict";
1122 3448
@@ -1125,9 +3451,8 @@
1125 3451 Object.defineProperty(exports, "__esModule", ({
1126 3452 value: true
1127 3453 }));
1128 3454 exports["default"] = void 0;
1129 -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1130 3455 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1131 3456 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1132 3457 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1133 3458 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
@@ -1132,70 +3457,238 @@
1132 3457 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1133 3458 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1134 3459 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1135 3460 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1136 -var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
1137 -var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
3461 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3462 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
1138 3463 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1139 3464 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1140 -var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
1141 - function AtomicElementEmptyView() {
3465 +/**
3466 + * @typedef {import('../modules/component-base')} ComponentBase
3467 + */
3468 +var CommandInfra = exports["default"] = /*#__PURE__*/function (_ArgsObject) {
3469 + /**
3470 + * Function constructor().
3471 + *
3472 + * Create Commands Base.
3473 + *
3474 + * @param {{}} args
3475 + */
3476 + function CommandInfra() {
1142 3477 var _this;
1143 - (0, _classCallCheck2.default)(this, AtomicElementEmptyView);
1144 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1145 - args[_key] = arguments[_key];
3478 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3479 + (0, _classCallCheck2.default)(this, CommandInfra);
3480 + _this = _callSuper(this, CommandInfra, [args]);
3481 + if (!_this.constructor.registerConfig) {
3482 + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
1146 3483 }
1147 - _this = _callSuper(this, AtomicElementEmptyView, [].concat(args));
1148 - (0, _defineProperty2.default)(_this, "template", '<div></div>');
1149 - (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view');
1150 - (0, _defineProperty2.default)(_this, "unmount", null);
3484 +
3485 + // Acknowledge self about which command it run.
3486 + _this.command = _this.constructor.getCommand();
3487 +
3488 + // Assign instance of current component.
3489 + _this.component = _this.constructor.getComponent();
3490 +
3491 + // Who ever need do something before without `super` the constructor can use `initialize` method.
3492 + _this.initialize(args);
3493 +
3494 + // Refresh args, maybe the changed via `initialize`.
3495 + args = _this.args;
3496 +
3497 + // Validate args before run.
3498 + _this.validateArgs(args);
1151 3499 return _this;
1152 3500 }
1153 - (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView);
1154 - return (0, _createClass2.default)(AtomicElementEmptyView, [{
1155 - key: "renderReactDefaultElement",
1156 - value: function renderReactDefaultElement(container) {
1157 - var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, {
1158 - container: container
1159 - }), this.el),
1160 - unmount = _ReactUtils$render.unmount;
1161 - this.unmount = unmount;
3501 +
3502 + /**
3503 + * Function initialize().
3504 + *
3505 + * Initialize command, called after construction.
3506 + *
3507 + * @param {{}} args
3508 + */
3509 + (0, _inherits2.default)(CommandInfra, _ArgsObject);
3510 + return (0, _createClass2.default)(CommandInfra, [{
3511 + key: "currentCommand",
3512 + get:
3513 + /**
3514 + * @deprecated since 3.7.0, use `this.command` instead.
3515 + */
3516 + function get() {
3517 + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
3518 + return this.command;
1162 3519 }
1163 3520 }, {
1164 - key: "onBeforeRender",
1165 - value: function onBeforeRender() {
1166 - // In case the element is being rendered again, we need to unmount the previous React component.
1167 - if (this.unmount) {
1168 - this.unmount();
1169 - this.unmount = null;
1170 - }
3521 + key: "initialize",
3522 + value: function initialize() {
3523 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3524 + } // eslint-disable-line no-unused-vars
3525 +
3526 + /**
3527 + * Function validateArgs().
3528 + *
3529 + * Validate command arguments.
3530 + *
3531 + * @param {{}} args
3532 + */
3533 + }, {
3534 + key: "validateArgs",
3535 + value: function validateArgs() {
3536 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3537 + } // eslint-disable-line no-unused-vars
3538 +
3539 + // eslint-disable-next-line jsdoc/require-returns-check
3540 + /**
3541 + * Function apply().
3542 + *
3543 + * Do the actual command.
3544 + *
3545 + * @param {{}} args
3546 + *
3547 + * @return {*} Command results.
3548 + */
3549 + }, {
3550 + key: "apply",
3551 + value: function apply() {
3552 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3553 + // eslint-disable-line no-unused-vars
3554 + elementorModules.ForceMethodImplementation();
1171 3555 }
3556 +
3557 + /**
3558 + * Function run().
3559 + *
3560 + * Run command with history & hooks.
3561 + *
3562 + * @return {*} Command results.
3563 + */
1172 3564 }, {
1173 - key: "onRender",
1174 - value: function onRender() {
1175 - this.$el.addClass(this.className);
1176 - this.renderReactDefaultElement();
3565 + key: "run",
3566 + value: function run() {
3567 + return this.apply(this.args);
1177 3568 }
3569 +
3570 + /**
3571 + * Function onBeforeRun.
3572 + *
3573 + * Called before run().
3574 + *
3575 + * @param {{}} args
3576 + */
1178 3577 }, {
1179 - key: "onDestroy",
1180 - value: function onDestroy() {
1181 - var _this$unmount;
1182 - (_this$unmount = this.unmount) === null || _this$unmount === void 0 || _this$unmount.call(this);
3578 + key: "onBeforeRun",
3579 + value: function onBeforeRun() {
3580 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3581 + } // eslint-disable-line no-unused-vars
3582 +
3583 + /**
3584 + * Function onAfterRun.
3585 + *
3586 + * Called after run().
3587 + *
3588 + * @param {{}} args
3589 + * @param {*} result
3590 + */
3591 + }, {
3592 + key: "onAfterRun",
3593 + value: function onAfterRun() {
3594 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3595 + var result = arguments.length > 1 ? arguments[1] : undefined;
3596 + } // eslint-disable-line no-unused-vars
3597 +
3598 + /**
3599 + * Function onBeforeApply.
3600 + *
3601 + * Called before apply().
3602 + *
3603 + * @param {{}} args
3604 + */
3605 + }, {
3606 + key: "onBeforeApply",
3607 + value: function onBeforeApply() {
3608 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3609 + } // eslint-disable-line no-unused-vars
3610 +
3611 + /**
3612 + * Function onAfterApply.
3613 + *
3614 + * Called after apply().
3615 + *
3616 + * @param {{}} args
3617 + * @param {*} result
3618 + */
3619 + }, {
3620 + key: "onAfterApply",
3621 + value: function onAfterApply() {
3622 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3623 + var result = arguments.length > 1 ? arguments[1] : undefined;
3624 + } // eslint-disable-line no-unused-vars
3625 +
3626 + /**
3627 + * Function onCatchApply.
3628 + *
3629 + * Called after apply() failed.
3630 + *
3631 + * @param {Error} e
3632 + */
3633 + }, {
3634 + key: "onCatchApply",
3635 + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
3636 + }], [{
3637 + key: "getInstanceType",
3638 + value: function getInstanceType() {
3639 + return 'CommandInfra';
1183 3640 }
3641 +
3642 + /**
3643 + * Get info of command.
3644 + *
3645 + * @return {Object} Extra information about the command.
3646 + */
3647 + }, {
3648 + key: "getInfo",
3649 + value: function getInfo() {
3650 + return {};
3651 + }
3652 +
3653 + /**
3654 + * @return {string} Self command name.
3655 + */
3656 + }, {
3657 + key: "getCommand",
3658 + value: function getCommand() {
3659 + return this.registerConfig.command;
3660 + }
3661 +
3662 + /**
3663 + * @return {ComponentBase} Self component
3664 + */
3665 + }, {
3666 + key: "getComponent",
3667 + value: function getComponent() {
3668 + return this.registerConfig.component;
3669 + }
3670 + }, {
3671 + key: "setRegisterConfig",
3672 + value: function setRegisterConfig(config) {
3673 + this.registerConfig = Object.freeze(config);
3674 + }
1184 3675 }]);
1185 -}(Marionette.ItemView);
3676 +}(_argsObject.default);
3677 +/**
3678 + * @type {Object}
3679 + */
3680 +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
1186 3681
1187 3682 /***/ }),
1188 3683
1189 -/***/ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js":
1190 -/*!*************************************************************************************!*\
1191 - !*** ../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js ***!
1192 - \*************************************************************************************/
3684 +/***/ "../modules/web-cli/assets/js/modules/component-base.js":
3685 +/*!**************************************************************!*\
3686 + !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
3687 + \**************************************************************/
1193 3688 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1194 3689
1195 3690 "use strict";
1196 -/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1197 -/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
1198 3691
1199 3692
1200 3693 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1201 3694 Object.defineProperty(exports, "__esModule", ({
@@ -1200,506 +3693,593 @@
1200 3693 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1201 3694 Object.defineProperty(exports, "__esModule", ({
1202 3695 value: true
1203 3696 }));
1204 -exports["default"] = createAtomicElementBaseView;
1205 -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1206 -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1207 -var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
3697 +exports["default"] = void 0;
3698 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1208 3699 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1209 -var _elementTypes = __webpack_require__(/*! elementor-editor/utils/element-types */ "../assets/dev/js/editor/utils/element-types.js");
1210 -var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js"));
1211 -var BaseElementView = elementor.modules.elements.views.BaseElement;
1212 -function createAtomicElementBaseView(type) {
1213 - var AtomicElementView = BaseElementView.extend({
1214 - template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")),
1215 - emptyView: _atomicElementEmptyView.default,
1216 - _childrenRenderPromises: [],
1217 - _createElement: function _createElement(tag) {
1218 - var _elementor$$preview;
1219 - var previewDocument = (_elementor$$preview = elementor.$preview) === null || _elementor$$preview === void 0 || (_elementor$$preview = _elementor$$preview[0]) === null || _elementor$$preview === void 0 ? void 0 : _elementor$$preview.contentDocument;
1220 - if (previewDocument) {
1221 - return previewDocument.createElement(tag);
3700 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3701 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3702 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3703 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3704 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3705 +var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
3706 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
3707 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3708 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
3709 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
3710 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3711 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3712 +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
3713 +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
3714 +/**
3715 + * @typedef {import('./command-infra')} CommandInfra
3716 + * @typedef {import('./hook-base')} HookBase
3717 + * @typedef {import('../core/states/ui-state-base')} UiStateBase
3718 + */
3719 +var ComponentBase = exports["default"] = /*#__PURE__*/function (_Module) {
3720 + function ComponentBase() {
3721 + (0, _classCallCheck2.default)(this, ComponentBase);
3722 + return _callSuper(this, ComponentBase, arguments);
3723 + }
3724 + (0, _inherits2.default)(ComponentBase, _Module);
3725 + return (0, _createClass2.default)(ComponentBase, [{
3726 + key: "__construct",
3727 + value: function __construct() {
3728 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3729 + if (args.manager) {
3730 + this.manager = args.manager;
1222 3731 }
1223 - return document.createElement(tag);
1224 - },
1225 - getChildViewContainer: function getChildViewContainer() {
1226 - this.childViewContainer = '';
1227 - return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments);
1228 - },
1229 - getChildType: function getChildType() {
1230 - var atomicElements = Object.entries(elementor.config.elements).filter(function (_ref) {
3732 + this.commands = this.defaultCommands();
3733 + this.commandsInternal = this.defaultCommandsInternal();
3734 + this.hooks = this.defaultHooks();
3735 + this.routes = this.defaultRoutes();
3736 + this.tabs = this.defaultTabs();
3737 + this.shortcuts = this.defaultShortcuts();
3738 + this.utils = this.defaultUtils();
3739 + this.data = this.defaultData();
3740 + this.uiStates = this.defaultUiStates();
3741 + this.states = this.defaultStates();
3742 + this.defaultRoute = '';
3743 + this.currentTab = '';
3744 + }
3745 + }, {
3746 + key: "registerAPI",
3747 + value: function registerAPI() {
3748 + var _this = this;
3749 + Object.entries(this.getTabs()).forEach(function (tab) {
3750 + return _this.registerTabRoute(tab[0]);
3751 + });
3752 + Object.entries(this.getRoutes()).forEach(function (_ref) {
1231 3753 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1232 - element = _ref2[1];
1233 - return !!(element !== null && element !== void 0 && element.atomic_props_schema);
1234 - }).map(function (_ref3) {
1235 - var _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
1236 - elType = _ref4[0];
1237 - return elType;
3754 + route = _ref2[0],
3755 + callback = _ref2[1];
3756 + return _this.registerRoute(route, callback);
1238 3757 });
1239 - return ['widget', 'container'].concat((0, _toConsumableArray2.default)(atomicElements));
1240 - },
1241 - getRenderContext: function getRenderContext() {
1242 - var _this$_parent, _this$_parent$getRend;
1243 - return (_this$_parent = this._parent) === null || _this$_parent === void 0 || (_this$_parent$getRend = _this$_parent.getRenderContext) === null || _this$_parent$getRend === void 0 ? void 0 : _this$_parent$getRend.call(_this$_parent);
1244 - },
1245 - getResolverRenderContext: function getResolverRenderContext() {
1246 - var _this$_parent2, _this$_parent2$getRes;
1247 - return (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || (_this$_parent2$getRes = _this$_parent2.getResolverRenderContext) === null || _this$_parent2$getRes === void 0 ? void 0 : _this$_parent2$getRes.call(_this$_parent2);
1248 - },
1249 - render: function render() {
1250 - var _this = this;
1251 - this._currentRenderPromise = new Promise(function (resolve) {
1252 - // Optimize rendering by reusing existing child views instead of recreating them.
1253 - if (_this._shouldSkipFullRender()) {
1254 - _this._renderWithoutDomRecreation(resolve);
1255 - } else {
1256 - _this._renderWithDomRecreation(resolve);
1257 - }
3758 + Object.entries(this.getCommands()).forEach(function (_ref3) {
3759 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
3760 + command = _ref4[0],
3761 + callback = _ref4[1];
3762 + return _this.registerCommand(command, callback);
1258 3763 });
1259 - return this;
1260 - },
1261 - _shouldSkipFullRender: function _shouldSkipFullRender() {
1262 - return this.isRendered && this._hasConnectedChildren();
1263 - },
1264 - _hasConnectedChildren: function _hasConnectedChildren() {
1265 - var _this$children, _firstChild$$el$get$i, _firstChild$$el;
1266 - if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) {
1267 - return false;
1268 - }
1269 -
1270 - // If the parent's innerHTML was replaced, all children are detached together.
1271 - var firstChild = this.children.findByIndex(0);
1272 - return (_firstChild$$el$get$i = firstChild === null || firstChild === void 0 || (_firstChild$$el = firstChild.$el) === null || _firstChild$$el === void 0 || (_firstChild$$el = _firstChild$$el.get(0)) === null || _firstChild$$el === void 0 ? void 0 : _firstChild$$el.isConnected) !== null && _firstChild$$el$get$i !== void 0 ? _firstChild$$el$get$i : false;
1273 - },
1274 - _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) {
1275 - var _this2 = this;
1276 - this._beforeRender();
1277 - this._renderChildren();
1278 - this._waitForChildrenToComplete().then(function () {
1279 - _this2._afterRender();
1280 - resolve();
3764 + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
3765 + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
3766 + command = _ref6[0],
3767 + callback = _ref6[1];
3768 + return _this.registerCommandInternal(command, callback);
1281 3769 });
1282 - },
1283 - _renderWithDomRecreation: function _renderWithDomRecreation(resolve) {
1284 - BaseElementView.prototype.render.apply(this, arguments);
1285 - this._waitForChildrenToComplete().then(function () {
1286 - resolve();
3770 + Object.values(this.getHooks()).forEach(function (instance) {
3771 + return _this.registerHook(instance);
1287 3772 });
1288 - },
1289 - _beforeRender: function _beforeRender() {
1290 - this._isRendering = true;
1291 - this.triggerMethod('before:render', this);
1292 - },
1293 - _afterRender: function _afterRender() {
1294 - this._isRendering = false;
1295 - this.isRendered = true;
1296 - this.triggerMethod('render', this);
1297 - },
1298 - _waitForChildrenToComplete: function _waitForChildrenToComplete() {
1299 - var _this3 = this;
1300 - return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1301 - return _regenerator.default.wrap(function (_context) {
1302 - while (1) switch (_context.prev = _context.next) {
1303 - case 0:
1304 - if (!(_this3._childrenRenderPromises.length > 0)) {
1305 - _context.next = 1;
1306 - break;
1307 - }
1308 - _context.next = 1;
1309 - return Promise.all(_this3._childrenRenderPromises);
1310 - case 1:
1311 - case "end":
1312 - return _context.stop();
1313 - }
1314 - }, _callee);
1315 - }))();
1316 - },
1317 - _renderChildren: function _renderChildren() {
1318 - if (this._shouldSkipFullRender()) {
1319 - var _this$children2;
1320 - (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.each(function (childView) {
1321 - return childView.render();
1322 - });
1323 - } else {
1324 - BaseElementView.prototype._renderChildren.apply(this, arguments);
1325 - }
1326 - this._collectChildrenRenderPromises();
1327 - },
1328 - _collectChildrenRenderPromises: function _collectChildrenRenderPromises() {
1329 - var _this$children3,
1330 - _this4 = this;
1331 - this._childrenRenderPromises = [];
1332 - (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) {
1333 - if (childView._currentRenderPromise) {
1334 - _this4._childrenRenderPromises.push(childView._currentRenderPromise);
1335 - }
3773 + Object.entries(this.getData()).forEach(function (_ref7) {
3774 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3775 + command = _ref8[0],
3776 + callback = _ref8[1];
3777 + return _this.registerData(command, callback);
1336 3778 });
1337 - },
1338 - onRender: function onRender() {
1339 - var _this5 = this;
1340 - this.dispatchPreviewEvent('elementor/element/render');
1341 - BaseElementView.prototype.onRender.apply(this, arguments);
3779 + Object.values(this.getUiStates()).forEach(function (instance) {
3780 + return _this.registerUiState(instance);
3781 + });
3782 + Object.entries(this.getStates()).forEach(function (_ref9) {
3783 + var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
3784 + id = _ref10[0],
3785 + state = _ref10[1];
3786 + return _this.registerState(id, state);
3787 + });
3788 + }
1342 3789
1343 - // Defer to wait for everything to render.
1344 - setTimeout(function () {
1345 - _this5.droppableInitialize();
1346 - _this5.updateHandlesPosition();
1347 - });
1348 - },
1349 - onDestroy: function onDestroy() {
1350 - BaseElementView.prototype.onDestroy.apply(this, arguments);
1351 - this.dispatchPreviewEvent('elementor/element/destroy');
1352 - },
1353 - dispatchPreviewEvent: function dispatchPreviewEvent(eventType) {
1354 - var _elementor;
1355 - (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.$preview) === null || _elementor === void 0 || (_elementor = _elementor[0]) === null || _elementor === void 0 || _elementor.contentWindow.dispatchEvent(new CustomEvent(eventType, {
1356 - detail: {
1357 - id: this.model.get('id'),
1358 - type: this.model.get('elType'),
1359 - element: this.getDomElement().get(0)
1360 - }
1361 - }));
1362 - },
1363 - droppableInitialize: function droppableInitialize() {
1364 - this.$el.html5Droppable(this.getDroppableOptions());
1365 - },
3790 + // eslint-disable-next-line jsdoc/require-returns-check
1366 3791 /**
1367 - * Add a `Save as a Template` button to the context menu.
3792 + * @return {string} namespace
3793 + */
3794 + }, {
3795 + key: "getNamespace",
3796 + value: function getNamespace() {
3797 + (0, _forceMethodImplementation.default)();
3798 + }
3799 +
3800 + /**
3801 + * @deprecated since 3.7.0, use `getServiceName()` instead.
3802 + */
3803 + }, {
3804 + key: "getRootContainer",
3805 + value: function getRootContainer() {
3806 + _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
3807 + return this.getServiceName();
3808 + }
3809 + }, {
3810 + key: "getServiceName",
3811 + value: function getServiceName() {
3812 + return this.getNamespace().split('/')[0];
3813 + }
3814 + }, {
3815 + key: "store",
3816 + get: function get() {
3817 + return $e.store.get(this.getNamespace());
3818 + }
3819 + }, {
3820 + key: "defaultTabs",
3821 + value: function defaultTabs() {
3822 + return {};
3823 + }
3824 + }, {
3825 + key: "defaultRoutes",
3826 + value: function defaultRoutes() {
3827 + return {};
3828 + }
3829 + }, {
3830 + key: "defaultCommands",
3831 + value: function defaultCommands() {
3832 + return {};
3833 + }
3834 + }, {
3835 + key: "defaultCommandsInternal",
3836 + value: function defaultCommandsInternal() {
3837 + return {};
3838 + }
3839 + }, {
3840 + key: "defaultHooks",
3841 + value: function defaultHooks() {
3842 + return {};
3843 + }
3844 +
3845 + /**
3846 + * Get the component's default UI states.
1368 3847 *
1369 - * @return {Object} groups
3848 + * @return {Object} default UI states
1370 3849 */
1371 - getContextMenuGroups: function getContextMenuGroups() {
1372 - var _this6 = this,
1373 - _elementorCommon$conf;
1374 - var saveActions = [{
1375 - name: 'save',
1376 - title: __('Save as a template', 'elementor'),
1377 - callback: this.saveAsTemplate.bind(this),
1378 - isEnabled: function isEnabled() {
1379 - return !_this6.getContainer().isLocked();
3850 + }, {
3851 + key: "defaultUiStates",
3852 + value: function defaultUiStates() {
3853 + return {};
3854 + }
3855 +
3856 + /**
3857 + * Get the component's Redux slice settings.
3858 + *
3859 + * @return {Object} Redux slice settings
3860 + */
3861 + }, {
3862 + key: "defaultStates",
3863 + value: function defaultStates() {
3864 + return {};
3865 + }
3866 + }, {
3867 + key: "defaultShortcuts",
3868 + value: function defaultShortcuts() {
3869 + return {};
3870 + }
3871 + }, {
3872 + key: "defaultUtils",
3873 + value: function defaultUtils() {
3874 + return {};
3875 + }
3876 + }, {
3877 + key: "defaultData",
3878 + value: function defaultData() {
3879 + return {};
3880 + }
3881 + }, {
3882 + key: "getCommands",
3883 + value: function getCommands() {
3884 + return this.commands;
3885 + }
3886 + }, {
3887 + key: "getCommandsInternal",
3888 + value: function getCommandsInternal() {
3889 + return this.commandsInternal;
3890 + }
3891 + }, {
3892 + key: "getHooks",
3893 + value: function getHooks() {
3894 + return this.hooks;
3895 + }
3896 +
3897 + /**
3898 + * Retrieve the component's UI states.
3899 + *
3900 + * @return {Object} UI states
3901 + */
3902 + }, {
3903 + key: "getUiStates",
3904 + value: function getUiStates() {
3905 + return this.uiStates;
3906 + }
3907 +
3908 + /**
3909 + * Retrieve the component's Redux Slice.
3910 + *
3911 + * @return {Object} Redux Slice
3912 + */
3913 + }, {
3914 + key: "getStates",
3915 + value: function getStates() {
3916 + return this.states;
3917 + }
3918 + }, {
3919 + key: "getRoutes",
3920 + value: function getRoutes() {
3921 + return this.routes;
3922 + }
3923 + }, {
3924 + key: "getTabs",
3925 + value: function getTabs() {
3926 + return this.tabs;
3927 + }
3928 + }, {
3929 + key: "getShortcuts",
3930 + value: function getShortcuts() {
3931 + return this.shortcuts;
3932 + }
3933 + }, {
3934 + key: "getData",
3935 + value: function getData() {
3936 + return this.data;
3937 + }
3938 +
3939 + /**
3940 + * @param {string} command
3941 + * @param {(()=>{}|CommandInfra)} context
3942 + * @param {'default'|'internal'|'data'} commandsType
3943 + */
3944 + }, {
3945 + key: "registerCommand",
3946 + value: function registerCommand(command, context) {
3947 + var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
3948 + var commandsManager;
3949 + switch (commandsType) {
3950 + case 'default':
3951 + commandsManager = $e.commands;
3952 + break;
3953 + case 'internal':
3954 + commandsManager = $e.commandsInternal;
3955 + break;
3956 + case 'data':
3957 + commandsManager = $e.data;
3958 + break;
3959 + default:
3960 + throw new Error("Invalid commands type: '".concat(command, "'"));
3961 + }
3962 + var fullCommand = this.getNamespace() + '/' + command,
3963 + instanceType = context.getInstanceType ? context.getInstanceType() : false,
3964 + registerConfig = {
3965 + command: fullCommand,
3966 + component: this
3967 + };
3968 +
3969 + // Support pure callback.
3970 + if (!instanceType) {
3971 + if ($e.devTools) {
3972 + $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
1380 3973 }
1381 - }];
1382 - var isAdministrator = elementor.config.user.is_administrator;
1383 - var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components;
1384 - if (isExperimentalFeaturesEnabled && isAdministrator) {
1385 - var _window$elementorV2$u, _window$elementorV, _window$elementorV$is, _window$elementorV2$u2, _window$elementorV2, _window$elementorV2$h, _window$elementorV2$u3, _window$elementorV3, _window$elementorV3$i;
1386 - var isProActive = (_window$elementorV2$u = (_window$elementorV = window.elementorV2) === null || _window$elementorV === void 0 || (_window$elementorV = _window$elementorV.utils) === null || _window$elementorV === void 0 || (_window$elementorV$is = _window$elementorV.isProActive) === null || _window$elementorV$is === void 0 ? void 0 : _window$elementorV$is.call(_window$elementorV)) !== null && _window$elementorV2$u !== void 0 ? _window$elementorV2$u : true;
1387 - var hasProInstalled = (_window$elementorV2$u2 = (_window$elementorV2 = window.elementorV2) === null || _window$elementorV2 === void 0 || (_window$elementorV2 = _window$elementorV2.utils) === null || _window$elementorV2 === void 0 || (_window$elementorV2$h = _window$elementorV2.hasProInstalled) === null || _window$elementorV2$h === void 0 ? void 0 : _window$elementorV2$h.call(_window$elementorV2)) !== null && _window$elementorV2$u2 !== void 0 ? _window$elementorV2$u2 : false;
1388 - var isProOutdated = hasProInstalled && !((_window$elementorV2$u3 = (_window$elementorV3 = window.elementorV2) === null || _window$elementorV3 === void 0 || (_window$elementorV3 = _window$elementorV3.utils) === null || _window$elementorV3 === void 0 || (_window$elementorV3$i = _window$elementorV3.isProAtLeast) === null || _window$elementorV3$i === void 0 ? void 0 : _window$elementorV3$i.call(_window$elementorV3, '4.0')) !== null && _window$elementorV2$u3 !== void 0 ? _window$elementorV2$u3 : false);
1389 - var showPromoBadge = !isProActive && !isProOutdated;
1390 - var newBadge = "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>");
1391 - var badgeClass = 'elementor-context-menu-list__item__shortcut__promotion-badge';
1392 - var proBadge = "<a href=\"https://go.elementor.com/go-pro-components-Instance-create-context-menu/\" target=\"_blank\" onclick=\"event.stopPropagation()\" class=\"".concat(badgeClass, "\"><i class=\"eicon-upgrade-crown\"></i></a>");
1393 - saveActions.unshift({
1394 - name: 'save-component',
1395 - title: __('Create component', 'elementor'),
1396 - shortcut: isProActive || isProOutdated ? newBadge : proBadge,
1397 - hasShortcutAction: showPromoBadge,
1398 - callback: this.saveAsComponent.bind(this),
1399 - isEnabled: function isEnabled() {
1400 - return (isProActive || isProOutdated) && !_this6.getContainer().isLocked();
3974 + registerConfig.callback = context;
3975 +
3976 + // Unique class.
3977 + context = /*#__PURE__*/function (_CommandCallbackBase) {
3978 + function context() {
3979 + (0, _classCallCheck2.default)(this, context);
3980 + return _callSuper(this, context, arguments);
1401 3981 }
1402 - });
3982 + (0, _inherits2.default)(context, _CommandCallbackBase);
3983 + return (0, _createClass2.default)(context);
3984 + }(_commandCallbackBase.default);
1403 3985 }
1404 - var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments),
1405 - transferGroupClipboardIndex = groups.indexOf(_.findWhere(groups, {
1406 - name: 'clipboard'
1407 - }));
1408 - groups.splice(transferGroupClipboardIndex + 1, 0, {
1409 - name: 'save',
1410 - actions: saveActions
3986 + context.setRegisterConfig(registerConfig);
3987 + commandsManager.register(this, command, context);
3988 + }
3989 +
3990 + /**
3991 + * @param {HookBase} instance
3992 + */
3993 + }, {
3994 + key: "registerHook",
3995 + value: function registerHook(instance) {
3996 + return instance.register();
3997 + }
3998 + }, {
3999 + key: "registerCommandInternal",
4000 + value: function registerCommandInternal(command, context) {
4001 + this.registerCommand(command, context, 'internal');
4002 + }
4003 +
4004 + /**
4005 + * Register a UI state.
4006 + *
4007 + * @param {UiStateBase} instance - UI state instance.
4008 + *
4009 + * @return {void}
4010 + */
4011 + }, {
4012 + key: "registerUiState",
4013 + value: function registerUiState(instance) {
4014 + $e.uiStates.register(instance);
4015 + }
4016 +
4017 + /**
4018 + * Register a Redux Slice.
4019 + *
4020 + * @param {string} id - State id.
4021 + * @param {Object} stateConfig - The state config.
4022 + *
4023 + * @return {void}
4024 + */
4025 + }, {
4026 + key: "registerState",
4027 + value: function registerState(id, stateConfig) {
4028 + id = this.getNamespace() + (id ? "/".concat(id) : '');
4029 + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
4030 + name: id
4031 + }));
4032 + $e.store.register(id, slice);
4033 + }
4034 + }, {
4035 + key: "registerRoute",
4036 + value: function registerRoute(route, callback) {
4037 + $e.routes.register(this, route, callback);
4038 + }
4039 + }, {
4040 + key: "registerData",
4041 + value: function registerData(command, context) {
4042 + this.registerCommand(command, context, 'data');
4043 + }
4044 + }, {
4045 + key: "unregisterRoute",
4046 + value: function unregisterRoute(route) {
4047 + $e.routes.unregister(this, route);
4048 + }
4049 + }, {
4050 + key: "registerTabRoute",
4051 + value: function registerTabRoute(tab) {
4052 + var _this2 = this;
4053 + this.registerRoute(tab, function (args) {
4054 + return _this2.activateTab(tab, args);
1411 4055 });
1412 - return groups;
1413 - },
1414 - saveAsTemplate: function saveAsTemplate() {
1415 - elementor.templates.eventManager.sendNewSaveTemplateClickedEvent();
1416 - $e.route('library/save-template', {
1417 - model: this.model
1418 - });
1419 - },
1420 - saveAsComponent: function saveAsComponent(openContextMenuEvent, options) {
1421 - var _window$elementorV2$u4, _window$elementorV4, _window$elementorV4$h, _window$elementorV2$u5, _window$elementorV5, _window$elementorV5$i, _window$elementorV2$u6, _window$elementorV7, _window$elementorV7$i;
1422 - var hasProInstalled = (_window$elementorV2$u4 = (_window$elementorV4 = window.elementorV2) === null || _window$elementorV4 === void 0 || (_window$elementorV4 = _window$elementorV4.utils) === null || _window$elementorV4 === void 0 || (_window$elementorV4$h = _window$elementorV4.hasProInstalled) === null || _window$elementorV4$h === void 0 ? void 0 : _window$elementorV4$h.call(_window$elementorV4)) !== null && _window$elementorV2$u4 !== void 0 ? _window$elementorV2$u4 : false;
1423 - var isProOutdated = hasProInstalled && !((_window$elementorV2$u5 = (_window$elementorV5 = window.elementorV2) === null || _window$elementorV5 === void 0 || (_window$elementorV5 = _window$elementorV5.utils) === null || _window$elementorV5 === void 0 || (_window$elementorV5$i = _window$elementorV5.isProAtLeast) === null || _window$elementorV5$i === void 0 ? void 0 : _window$elementorV5$i.call(_window$elementorV5, '4.0')) !== null && _window$elementorV2$u5 !== void 0 ? _window$elementorV2$u5 : false);
1424 - if (isProOutdated) {
1425 - var _window$elementorV6, _window$elementorV6$n;
1426 - (_window$elementorV6 = window.elementorV2) === null || _window$elementorV6 === void 0 || (_window$elementorV6 = _window$elementorV6.editorNotifications) === null || _window$elementorV6 === void 0 || (_window$elementorV6$n = _window$elementorV6.notify) === null || _window$elementorV6$n === void 0 || _window$elementorV6$n.call(_window$elementorV6, {
1427 - type: 'info',
1428 - id: 'component-create-update',
1429 - message: __('To create new components, update Elementor Pro to the latest version.', 'elementor'),
1430 - additionalActionProps: [{
1431 - size: 'small',
1432 - variant: 'contained',
1433 - color: 'info',
1434 - href: '/wp-admin/plugins.php',
1435 - target: '_blank',
1436 - children: __('Update Now', 'elementor')
1437 - }]
4056 + }
4057 + }, {
4058 + key: "dependency",
4059 + value: function dependency() {
4060 + return true;
4061 + }
4062 + }, {
4063 + key: "open",
4064 + value: function open() {
4065 + return true;
4066 + }
4067 + }, {
4068 + key: "close",
4069 + value: function close() {
4070 + if (!this.isOpen) {
4071 + return false;
4072 + }
4073 + this.isOpen = false;
4074 + this.inactivate();
4075 + $e.routes.clearCurrent(this.getNamespace());
4076 + $e.routes.clearHistory(this.getServiceName());
4077 + return true;
4078 + }
4079 + }, {
4080 + key: "activate",
4081 + value: function activate() {
4082 + $e.components.activate(this.getNamespace());
4083 + }
4084 + }, {
4085 + key: "inactivate",
4086 + value: function inactivate() {
4087 + $e.components.inactivate(this.getNamespace());
4088 + }
4089 + }, {
4090 + key: "isActive",
4091 + value: function isActive() {
4092 + return $e.components.isActive(this.getNamespace());
4093 + }
4094 + }, {
4095 + key: "onRoute",
4096 + value: function onRoute(route) {
4097 + this.toggleRouteClass(route, true);
4098 + this.toggleHistoryClass();
4099 + this.activate();
4100 + this.trigger('route/open', route);
4101 + }
4102 + }, {
4103 + key: "onCloseRoute",
4104 + value: function onCloseRoute(route) {
4105 + this.toggleRouteClass(route, false);
4106 + this.inactivate();
4107 + this.trigger('route/close', route);
4108 + }
4109 + }, {
4110 + key: "setDefaultRoute",
4111 + value: function setDefaultRoute(route) {
4112 + this.defaultRoute = this.getNamespace() + '/' + route;
4113 + }
4114 + }, {
4115 + key: "getDefaultRoute",
4116 + value: function getDefaultRoute() {
4117 + return this.defaultRoute;
4118 + }
4119 + }, {
4120 + key: "removeTab",
4121 + value: function removeTab(tab) {
4122 + delete this.tabs[tab];
4123 + this.unregisterRoute(tab);
4124 + }
4125 + }, {
4126 + key: "hasTab",
4127 + value: function hasTab(tab) {
4128 + return !!this.tabs[tab];
4129 + }
4130 + }, {
4131 + key: "addTab",
4132 + value: function addTab(tab, args, position) {
4133 + var _this3 = this;
4134 + this.tabs[tab] = args;
4135 + // It can be 0.
4136 + if ('undefined' !== typeof position) {
4137 + var newTabs = {};
4138 + var ids = Object.keys(this.tabs);
4139 + // Remove new tab
4140 + ids.pop();
4141 +
4142 + // Add it to position.
4143 + ids.splice(position, 0, tab);
4144 + ids.forEach(function (id) {
4145 + newTabs[id] = _this3.tabs[id];
1438 4146 });
1439 - return;
4147 + this.tabs = newTabs;
1440 4148 }
1441 - var isProActive = (_window$elementorV2$u6 = (_window$elementorV7 = window.elementorV2) === null || _window$elementorV7 === void 0 || (_window$elementorV7 = _window$elementorV7.utils) === null || _window$elementorV7 === void 0 || (_window$elementorV7$i = _window$elementorV7.isProActive) === null || _window$elementorV7$i === void 0 ? void 0 : _window$elementorV7$i.call(_window$elementorV7)) !== null && _window$elementorV2$u6 !== void 0 ? _window$elementorV2$u6 : true;
1442 - if (!isProActive) {
1443 - return;
1444 - }
4149 + this.registerTabRoute(tab);
4150 + }
4151 + }, {
4152 + key: "getTabsWrapperSelector",
4153 + value: function getTabsWrapperSelector() {
4154 + return '';
4155 + }
4156 + }, {
4157 + key: "getTabRoute",
4158 + value: function getTabRoute(tab) {
4159 + return this.getNamespace() + '/' + tab;
4160 + }
4161 + }, {
4162 + key: "renderTab",
4163 + value: function renderTab(tab) {} // eslint-disable-line
4164 + }, {
4165 + key: "activateTab",
4166 + value: function activateTab(tab, args) {
4167 + var _this4 = this;
4168 + this.renderTab(tab, args);
4169 + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
4170 + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
4171 + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
4172 + }
4173 + }, {
4174 + key: "getActiveTabConfig",
4175 + value: function getActiveTabConfig() {
4176 + return this.tabs[this.currentTab] || {};
4177 + }
4178 + }, {
4179 + key: "getBodyClass",
4180 + value: function getBodyClass(route) {
4181 + return 'e-route-' + route.replace(/\//g, '-');
4182 + }
1445 4183
1446 - // Calculate the absolute position where the context menu was opened.
1447 - var openMenuOriginalEvent = openContextMenuEvent.originalEvent;
1448 - var iframeRect = elementor.$preview[0].getBoundingClientRect();
1449 - var anchorPosition = {
1450 - left: openMenuOriginalEvent.clientX + iframeRect.left,
1451 - top: openMenuOriginalEvent.clientY + iframeRect.top
1452 - };
1453 - window.dispatchEvent(new CustomEvent('elementor/editor/open-save-as-component-form', {
1454 - detail: {
1455 - element: elementor.getContainer(this.model.id).model.toJSON({
1456 - remove: ['default']
1457 - }),
1458 - anchorPosition: anchorPosition,
1459 - options: options
1460 - }
1461 - }));
1462 - },
1463 - isDroppingAllowed: function isDroppingAllowed() {
1464 - return this.getContainer().isEditable();
1465 - },
1466 - behaviors: function behaviors() {
1467 - var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments);
1468 - _.extend(behaviors, {
1469 - Sortable: {
1470 - behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"),
1471 - elChildType: 'widget'
1472 - }
4184 + /**
4185 + * If command includes uppercase character convert it to lowercase and add `-`.
4186 + * e.g: `CopyAll` is converted to `copy-all`.
4187 + *
4188 + * @param {string} commandName
4189 + */
4190 + }, {
4191 + key: "normalizeCommandName",
4192 + value: function normalizeCommandName(commandName) {
4193 + return commandName.replace(/[A-Z]/g, function (match, offset) {
4194 + return (offset > 0 ? '-' : '') + match.toLowerCase();
1473 4195 });
1474 - return elementor.hooks.applyFilters("elements/".concat(type, "/behaviors"), behaviors, this);
1475 - },
4196 + }
4197 +
1476 4198 /**
1477 - * @return {{}} options
4199 + * @param {{}} commandsFromImport
4200 + * @return {{}} imported commands
1478 4201 */
1479 - getSortableOptions: function getSortableOptions() {
1480 - return {
1481 - preventInit: true
1482 - };
1483 - },
1484 - getDroppableOptions: function getDroppableOptions() {
1485 - var _this7 = this;
1486 - var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add';
1487 - return {
1488 - axis: null,
1489 - items: items,
1490 - groups: ['elementor-element'],
1491 - horizontalThreshold: 0,
1492 - isDroppingAllowed: this.isDroppingAllowed.bind(this),
1493 - currentElementClass: 'elementor-html5dnd-current-element',
1494 - placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder',
1495 - hasDraggingOnChildClass: 'e-dragging-over',
1496 - getDropContainer: function getDropContainer() {
1497 - return _this7.getContainer();
1498 - },
1499 - onDropping: function onDropping(side, event) {
1500 - event.stopPropagation();
4202 + }, {
4203 + key: "importCommands",
4204 + value: function importCommands(commandsFromImport) {
4205 + var _this5 = this;
4206 + var commands = {};
1501 4207
1502 - // Triggering the drag end manually, since it won't fire above the iframe
1503 - elementor.getPreviewView().onPanelElementDragEnd();
1504 - var draggedView = elementor.channels.editor.request('element:dragged'),
1505 - draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el,
1506 - containerElement = event.currentTarget.parentElement,
1507 - elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []);
1508 - var targetIndex = elements.indexOf(event.currentTarget);
1509 - if (_this7.isPanelElement(draggedView, draggedElement)) {
1510 - var _elementorCommon;
1511 - if (_this7.draggingOnBottomOrRightSide(side) && !_this7.emptyViewIsCurrentlyBeingDraggedOver()) {
1512 - targetIndex++;
1513 - }
1514 - _this7.onDrop(event, {
1515 - at: targetIndex
1516 - });
1517 - if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.eventsManager) !== null && _elementorCommon !== void 0 && _elementorCommon.dispatchEvent) {
1518 - var selectedElement = elementor.channels.panelElements.request('element:selected');
1519 - if (selectedElement) {
1520 - var _selectedElement$mode, _selectedElement$mode2, _selectedElement$mode3, _selectedElement$mode4;
1521 - var elType = (_selectedElement$mode = (_selectedElement$mode2 = selectedElement.model) === null || _selectedElement$mode2 === void 0 ? void 0 : _selectedElement$mode2.get('elType')) !== null && _selectedElement$mode !== void 0 ? _selectedElement$mode : '';
1522 - var widgetType = (_selectedElement$mode3 = (_selectedElement$mode4 = selectedElement.model) === null || _selectedElement$mode4 === void 0 ? void 0 : _selectedElement$mode4.get('widgetType')) !== null && _selectedElement$mode3 !== void 0 ? _selectedElement$mode3 : '';
1523 - var elementName = 'widget' === elType ? widgetType : elType;
1524 - elementorCommon.eventsManager.dispatchEvent('add_element', {
1525 - location: 'editor_panel',
1526 - element_name: elementName,
1527 - element_type: elType,
1528 - widget_type: widgetType
1529 - });
1530 - }
1531 - }
1532 - return;
1533 - }
1534 - if (_this7.isParentElement(draggedView.getContainer().id)) {
1535 - return;
1536 - }
1537 - if (_this7.emptyViewIsCurrentlyBeingDraggedOver()) {
1538 - _this7.moveDroppedItem(draggedView, 0);
1539 - return;
1540 - }
1541 - _this7.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
1542 - }
1543 - };
1544 - },
1545 - moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) {
1546 - var selfIndex = elements.indexOf(draggedElement);
1547 - if (targetIndex === selfIndex) {
1548 - return;
4208 + // Convert `Commands` to `ComponentBase` workable format.
4209 + Object.entries(commandsFromImport).forEach(function (_ref11) {
4210 + var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
4211 + className = _ref12[0],
4212 + Class = _ref12[1];
4213 + var command = _this5.normalizeCommandName(className);
4214 + commands[command] = Class;
4215 + });
4216 + return commands;
4217 + }
4218 + }, {
4219 + key: "importHooks",
4220 + value: function importHooks(hooksFromImport) {
4221 + var hooks = {};
4222 + for (var key in hooksFromImport) {
4223 + var hook = new hooksFromImport[key]();
4224 + hooks[hook.getId()] = hook;
1549 4225 }
1550 - var dropIndex = this.getDropIndex(containerElement, side, targetIndex, selfIndex);
1551 - this.moveDroppedItem(draggedView, dropIndex);
1552 - },
1553 - isPanelElement: function isPanelElement(draggedView, draggedElement) {
1554 - return !draggedView || !draggedElement;
1555 - },
1556 - isParentElement: function isParentElement(draggedId) {
1557 - var current = this.container;
1558 - while (current) {
1559 - if (current.id === draggedId) {
1560 - return true;
1561 - }
1562 - current = current.parent;
1563 - }
1564 - return false;
1565 - },
1566 - getDropIndex: function getDropIndex(container, side, index, selfIndex) {
1567 - var styles = window.getComputedStyle(container);
1568 - var isFlex = ['flex', 'inline-flex'].includes(styles.display);
1569 - var isFlexReverse = isFlex && ['column-reverse', 'row-reverse'].includes(styles.flexDirection);
1570 - var isRow = isFlex && ['row-reverse', 'row'].includes(styles.flexDirection);
1571 - var isRtl = elementorCommon.config.isRTL;
1572 - var isReverse = isRow ? isFlexReverse !== isRtl : isFlexReverse;
4226 + return hooks;
4227 + }
1573 4228
1574 - // The element should be placed BEFORE the current target
1575 - // if is reversed + side is bottom/right OR not is reversed + side is top/left
1576 - if (isReverse === this.draggingOnBottomOrRightSide(side)) {
1577 - if (-1 === selfIndex || selfIndex >= index - 1) {
1578 - return index;
1579 - }
1580 - return index > 0 ? index - 1 : 0;
1581 - }
1582 - if (0 <= selfIndex && selfIndex < index) {
1583 - return index;
1584 - }
1585 - return index + 1;
1586 - },
1587 - moveDroppedItem: function moveDroppedItem(draggedView, dropIndex) {
1588 - // Reset the dragged element cache.
1589 - elementor.channels.editor.reply('element:dragged', null);
1590 - $e.run('document/elements/move', {
1591 - container: draggedView.getContainer(),
1592 - target: this.getContainer(),
1593 - options: {
1594 - at: dropIndex
1595 - }
4229 + /**
4230 + * Import & initialize the component's UI states.
4231 + * Should be used inside `defaultUiState()`.
4232 + *
4233 + * @param {Object} statesFromImport - UI states from import.
4234 + *
4235 + * @return {Object} UI States
4236 + */
4237 + }, {
4238 + key: "importUiStates",
4239 + value: function importUiStates(statesFromImport) {
4240 + var _this6 = this;
4241 + var uiStates = {};
4242 + Object.values(statesFromImport).forEach(function (className) {
4243 + var uiState = new className(_this6);
4244 + uiStates[uiState.getId()] = uiState;
1596 4245 });
1597 - },
1598 - getEditButtons: function getEditButtons() {
1599 - var elementData = elementor.getElementData(this.model),
1600 - editTools = {};
1601 - if ($e.components.get('document/elements').utils.allowAddingWidgets()) {
1602 - editTools.add = {
1603 - /* Translators: %s: Element Name. */
1604 - title: sprintf(__('Add %s', 'elementor'), elementData.title),
1605 - icon: 'plus'
1606 - };
1607 - editTools.edit = {
1608 - /* Translators: %s: Element Name. */
1609 - title: sprintf(__('Edit %s', 'elementor'), elementData.title),
1610 - icon: 'handle'
1611 - };
1612 - }
1613 - if (!this.getContainer().isLocked()) {
1614 - if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) {
1615 - editTools.duplicate = {
1616 - /* Translators: %s: Element Name. */
1617 - title: sprintf(__('Duplicate %s', 'elementor'), elementData.title),
1618 - icon: 'clone'
1619 - };
1620 - }
1621 - editTools.remove = {
1622 - /* Translators: %s: Element Name. */
1623 - title: sprintf(__('Delete %s', 'elementor'), elementData.title),
1624 - icon: 'close'
1625 - };
1626 - }
1627 - return editTools;
1628 - },
1629 - draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) {
1630 - return ['bottom', 'right'].includes(side);
1631 - },
1632 - emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() {
1633 - return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0;
1634 - },
4246 + return uiStates;
4247 + }
4248 +
1635 4249 /**
1636 - * Toggle the `New Section` view when clicking the `add` button in the edit tools.
4250 + * Set a UI state value.
4251 + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
1637 4252 *
4253 + * @param {string} state - Non-prefixed state ID.
4254 + * @param {*} value - New state value.
4255 + *
1638 4256 * @return {void}
1639 4257 */
1640 - onAddButtonClick: function onAddButtonClick() {
1641 - if (this.addSectionView && !this.addSectionView.isDestroyed) {
1642 - this.addSectionView.fadeToDeath();
1643 - return;
1644 - }
1645 - var addSectionView = new elementor.modules.elements.components.AddSectionView({
1646 - at: this.model.collection.indexOf(this.model)
1647 - });
1648 - addSectionView.render();
1649 - this.$el.before(addSectionView.$el);
1650 - addSectionView.$el.hide();
1651 -
1652 - // Delaying the slide down for slow-render browsers (such as FF)
1653 - setTimeout(function () {
1654 - addSectionView.$el.slideDown(null, function () {
1655 - // Remove inline style, for preview mode.
1656 - jQuery(this).css('display', '');
1657 - });
1658 - });
1659 - this.addSectionView = addSectionView;
1660 - },
1661 - isOverflowHidden: function isOverflowHidden() {
1662 - var elementStyles = window.getComputedStyle(this.el);
1663 - var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow];
1664 - return overflowStyles.includes('hidden') || overflowStyles.includes('auto');
1665 - },
1666 - updateHandlesPosition: function updateHandlesPosition() {
1667 - var elementType = this.$el.data('element_type');
1668 - var isElement = (0, _elementTypes.getAllElementTypes)().includes(elementType);
1669 - if (!isElement) {
1670 - return;
1671 - }
1672 - var shouldPlaceInside = this.isOverflowHidden();
1673 - if (!shouldPlaceInside && this.isTopLevelElement() && this.isFirstElementInStructure()) {
1674 - shouldPlaceInside = true;
1675 - }
1676 - this.$el.toggleClass('e-handles-inside', shouldPlaceInside);
1677 - },
1678 - isTopLevelElement: function isTopLevelElement() {
1679 - return this.container.parent && 'document' === this.container.parent.id;
1680 - },
1681 - isFirstElementInStructure: function isFirstElementInStructure() {
1682 - if (!this.model.collection) {
1683 - return true;
1684 - }
1685 - return 0 === this.model.collection.indexOf(this.model);
1686 - },
1687 - getInteractionId: function getInteractionId() {
1688 - var originId = this.model.get('originId');
1689 - var id = this.model.get('id');
1690 - return originId !== null && originId !== void 0 ? originId : id;
4258 + }, {
4259 + key: "setUiState",
4260 + value: function setUiState(state, value) {
4261 + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
1691 4262 }
1692 - });
1693 - return AtomicElementView;
1694 -}
4263 + }, {
4264 + key: "toggleRouteClass",
4265 + value: function toggleRouteClass(route, state) {
4266 + document.body.classList.toggle(this.getBodyClass(route), state);
4267 + }
4268 + }, {
4269 + key: "toggleHistoryClass",
4270 + value: function toggleHistoryClass() {
4271 + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
4272 + }
4273 + }]);
4274 +}(_module.default);
1695 4275
1696 4276 /***/ }),
1697 4277
1698 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js":
1699 -/*!*************************************************************************************************************!*\
1700 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js ***!
1701 - \*************************************************************************************************************/
4278 +/***/ "../modules/web-cli/assets/js/utils/console.js":
4279 +/*!*****************************************************!*\
4280 + !*** ../modules/web-cli/assets/js/utils/console.js ***!
4281 + \*****************************************************/
1702 4282 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1703 4283
1704 4284 "use strict";
1705 4285
@@ -1707,48 +4287,49 @@
1707 4287 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1708 4288 Object.defineProperty(exports, "__esModule", ({
1709 4289 value: true
1710 4290 }));
1711 -exports.DuplicateElement = void 0;
4291 +exports["default"] = void 0;
1712 4292 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1713 4293 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1714 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1715 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1716 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1717 -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js");
1718 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1719 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1720 -var DuplicateElement = exports.DuplicateElement = /*#__PURE__*/function (_$e$modules$hookData$) {
1721 - function DuplicateElement() {
1722 - (0, _classCallCheck2.default)(this, DuplicateElement);
1723 - return _callSuper(this, DuplicateElement, arguments);
4294 +var Console = exports["default"] = /*#__PURE__*/function () {
4295 + function Console() {
4296 + (0, _classCallCheck2.default)(this, Console);
1724 4297 }
1725 - (0, _inherits2.default)(DuplicateElement, _$e$modules$hookData$);
1726 - return (0, _createClass2.default)(DuplicateElement, [{
1727 - key: "getCommand",
1728 - value: function getCommand() {
1729 - return 'document/elements/duplicate';
4298 + return (0, _createClass2.default)(Console, null, [{
4299 + key: "error",
4300 + value: function error(message) {
4301 + // Show an error if devTools is available.
4302 + if ($e.devTools) {
4303 + $e.devTools.log.error(message);
4304 + }
4305 +
4306 + // If not a 'Hook-Break' then show error.
4307 + if (!(message instanceof $e.modules.HookBreak)) {
4308 + // eslint-disable-next-line no-console
4309 + console.error(message);
4310 + }
1730 4311 }
1731 4312 }, {
1732 - key: "getId",
1733 - value: function getId() {
1734 - return 'regenerate-local-style-ids--document/elements/duplicate';
4313 + key: "warn",
4314 + value: function warn() {
4315 + var _console;
4316 + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
4317 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4318 + args[_key] = arguments[_key];
4319 + }
4320 + args.unshift('%c %c', style, '');
4321 + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
1735 4322 }
1736 - }, {
1737 - key: "apply",
1738 - value: function apply(args, result) {
1739 - var containers = Array.isArray(result) ? result : [result];
1740 - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds);
1741 - }
1742 4323 }]);
1743 -}($e.modules.hookData.After);
4324 +}();
1744 4325
1745 4326 /***/ }),
1746 4327
1747 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js":
1748 -/*!**********************************************************************************************************!*\
1749 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js ***!
1750 - \**********************************************************************************************************/
4328 +/***/ "../modules/web-cli/assets/js/utils/deprecation.js":
4329 +/*!*********************************************************!*\
4330 + !*** ../modules/web-cli/assets/js/utils/deprecation.js ***!
4331 + \*********************************************************/
1751 4332 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1752 4333
1753 4334 "use strict";
1754 4335
@@ -1756,48 +4337,146 @@
1756 4337 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1757 4338 Object.defineProperty(exports, "__esModule", ({
1758 4339 value: true
1759 4340 }));
1760 -exports.ImportElement = void 0;
4341 +exports["default"] = void 0;
4342 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1761 4343 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1762 4344 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1763 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1764 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1765 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1766 -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js");
1767 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1768 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1769 -var ImportElement = exports.ImportElement = /*#__PURE__*/function (_$e$modules$hookData$) {
1770 - function ImportElement() {
1771 - (0, _classCallCheck2.default)(this, ImportElement);
1772 - return _callSuper(this, ImportElement, arguments);
4345 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4346 +// Copied from `modules/dev-tools/assets/js/deprecation.js`
4347 +/**
4348 + * @typedef {Object} Version
4349 + * @property {number} major1 The first number
4350 + * @property {number} major2 The second number
4351 + * @property {number} minor The third number
4352 + * @property {string} build The fourth number
4353 + */
4354 +
4355 +var softDeprecated = function softDeprecated(name, version, replacement) {
4356 + if (elementorWebCliConfig.isDebug) {
4357 + deprecatedMessage('soft', name, version, replacement);
1773 4358 }
1774 - (0, _inherits2.default)(ImportElement, _$e$modules$hookData$);
1775 - return (0, _createClass2.default)(ImportElement, [{
1776 - key: "getCommand",
1777 - value: function getCommand() {
1778 - return 'document/elements/import';
4359 +};
4360 +var hardDeprecated = function hardDeprecated(name, version, replacement) {
4361 + deprecatedMessage('hard', name, version, replacement);
4362 +};
4363 +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
4364 + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
4365 + if (replacement) {
4366 + message += " - Use `".concat(replacement, "` instead");
4367 + }
4368 + _console.default.warn(message);
4369 +};
4370 +var Deprecation = exports["default"] = /*#__PURE__*/function () {
4371 + function Deprecation() {
4372 + (0, _classCallCheck2.default)(this, Deprecation);
4373 + }
4374 + return (0, _createClass2.default)(Deprecation, null, [{
4375 + key: "deprecated",
4376 + value: function deprecated(name, version, replacement) {
4377 + if (this.isHardDeprecated(version)) {
4378 + hardDeprecated(name, version, replacement);
4379 + } else {
4380 + softDeprecated(name, version, replacement);
4381 + }
1779 4382 }
4383 +
4384 + /**
4385 + * @param {string} version
4386 + *
4387 + * @return {Version}
4388 + */
1780 4389 }, {
1781 - key: "getId",
1782 - value: function getId() {
1783 - return 'regenerate-local-style-ids--document/elements/import';
4390 + key: "parseVersion",
4391 + value: function parseVersion(version) {
4392 + var versionParts = version.split('.');
4393 + if (versionParts.length < 3 || versionParts.length > 4) {
4394 + throw new RangeError('Invalid Semantic Version string provided');
4395 + }
4396 + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
4397 + major1 = _versionParts[0],
4398 + major2 = _versionParts[1],
4399 + minor = _versionParts[2],
4400 + _versionParts$ = _versionParts[3],
4401 + build = _versionParts$ === void 0 ? '' : _versionParts$;
4402 + return {
4403 + major1: parseInt(major1),
4404 + major2: parseInt(major2),
4405 + minor: parseInt(minor),
4406 + build: build
4407 + };
1784 4408 }
4409 +
4410 + /**
4411 + * Get total of major.
4412 + *
4413 + * 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,
4414 + * versions with major2 more then 9 will be added to total.
4415 + *
4416 + * @param {Version} versionObj
4417 + *
4418 + * @return {number}
4419 + */
1785 4420 }, {
1786 - key: "apply",
1787 - value: function apply(args, result) {
1788 - var containers = Array.isArray(result) ? result : [result];
1789 - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds);
4421 + key: "getTotalMajor",
4422 + value: function getTotalMajor(versionObj) {
4423 + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
4424 + total = Number((total / 10).toFixed(0));
4425 + if (versionObj.major2 > 9) {
4426 + total = versionObj.major2 - 9;
4427 + }
4428 + return total;
1790 4429 }
4430 +
4431 + /**
4432 + * @param {string} version1
4433 + * @param {string} version2
4434 + *
4435 + * @return {number}
4436 + */
4437 + }, {
4438 + key: "compareVersion",
4439 + value: function compareVersion(version1, version2) {
4440 + var _this = this;
4441 + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
4442 + return _this.getTotalMajor(versionObj);
4443 + }).reduce(function (acc, major) {
4444 + return acc - major;
4445 + });
4446 + }
4447 +
4448 + /**
4449 + * @param {string} version
4450 + *
4451 + * @return {boolean}
4452 + */
4453 + }, {
4454 + key: "isSoftDeprecated",
4455 + value: function isSoftDeprecated(version) {
4456 + var total = this.compareVersion(version, elementorWebCliConfig.version);
4457 + return total <= 4;
4458 + }
4459 +
4460 + /**
4461 + * @param {string} version
4462 + * @return {boolean}
4463 + */
4464 + }, {
4465 + key: "isHardDeprecated",
4466 + value: function isHardDeprecated(version) {
4467 + var total = this.compareVersion(version, elementorWebCliConfig.version);
4468 + return total < 0 || total >= 8;
4469 + }
1791 4470 }]);
1792 -}($e.modules.hookData.After);
4471 +}();
1793 4472
1794 4473 /***/ }),
1795 4474
1796 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js":
1797 -/*!*********************************************************************************************************!*\
1798 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js ***!
1799 - \*********************************************************************************************************/
4475 +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
4476 +/*!*************************************************************************!*\
4477 + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
4478 + \*************************************************************************/
1800 4479 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1801 4480
1802 4481 "use strict";
1803 4482
@@ -1805,251 +4484,1142 @@
1805 4484 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1806 4485 Object.defineProperty(exports, "__esModule", ({
1807 4486 value: true
1808 4487 }));
1809 -exports.PasteElement = void 0;
4488 +exports["default"] = exports.ForceMethodImplementation = void 0;
4489 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1810 4490 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1811 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1812 4491 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1813 4492 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1814 4493 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1815 -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js");
4494 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
1816 4495 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1817 4496 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1818 -var PasteElement = exports.PasteElement = /*#__PURE__*/function (_$e$modules$hookData$) {
1819 - function PasteElement() {
1820 - (0, _classCallCheck2.default)(this, PasteElement);
1821 - return _callSuper(this, PasteElement, arguments);
4497 +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
4498 +var ForceMethodImplementation = exports.ForceMethodImplementation = /*#__PURE__*/function (_Error) {
4499 + function ForceMethodImplementation() {
4500 + var _this;
4501 + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4502 + (0, _classCallCheck2.default)(this, ForceMethodImplementation);
4503 + _this = _callSuper(this, ForceMethodImplementation, ["".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
4504 + Error.captureStackTrace(_this, ForceMethodImplementation);
4505 + return _this;
1822 4506 }
1823 - (0, _inherits2.default)(PasteElement, _$e$modules$hookData$);
1824 - return (0, _createClass2.default)(PasteElement, [{
1825 - key: "getCommand",
1826 - value: function getCommand() {
1827 - return 'document/elements/paste';
4507 + (0, _inherits2.default)(ForceMethodImplementation, _Error);
4508 + return (0, _createClass2.default)(ForceMethodImplementation);
4509 +}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4510 +var _default = exports["default"] = function _default() {
4511 + var stack = Error().stack,
4512 + caller = stack.split('\n')[2].trim(),
4513 + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
4514 + info = {};
4515 + info.functionName = callerName;
4516 + info.fullName = callerName;
4517 + if (info.functionName.includes('.')) {
4518 + var parts = info.functionName.split('.');
4519 + info.className = parts[0];
4520 + info.functionName = parts[1];
4521 + } else {
4522 + info.isStatic = true;
4523 + }
4524 + throw new ForceMethodImplementation(info);
4525 +};
4526 +
4527 +/***/ }),
4528 +
4529 +/***/ "../node_modules/redux-thunk/es/index.js":
4530 +/*!***********************************************!*\
4531 + !*** ../node_modules/redux-thunk/es/index.js ***!
4532 + \***********************************************/
4533 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4534 +
4535 +"use strict";
4536 +__webpack_require__.r(__webpack_exports__);
4537 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4538 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4539 +/* harmony export */ });
4540 +/** A function that accepts a potential "extra argument" value to be injected later,
4541 + * and returns an instance of the thunk middleware that uses that value
4542 + */
4543 +function createThunkMiddleware(extraArgument) {
4544 + // Standard Redux middleware definition pattern:
4545 + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
4546 + var middleware = function middleware(_ref) {
4547 + var dispatch = _ref.dispatch,
4548 + getState = _ref.getState;
4549 + return function (next) {
4550 + return function (action) {
4551 + // The thunk middleware looks for any functions that were passed to `store.dispatch`.
4552 + // If this "action" is really a function, call it and return the result.
4553 + if (typeof action === 'function') {
4554 + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
4555 + return action(dispatch, getState, extraArgument);
4556 + } // Otherwise, pass the action down the middleware chain as usual
4557 +
4558 +
4559 + return next(action);
4560 + };
4561 + };
4562 + };
4563 +
4564 + return middleware;
4565 +}
4566 +
4567 +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
4568 +// with whatever "extra arg" they want to inject into their thunks
4569 +
4570 +thunk.withExtraArgument = createThunkMiddleware;
4571 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
4572 +
4573 +/***/ }),
4574 +
4575 +/***/ "../node_modules/redux/es/redux.js":
4576 +/*!*****************************************!*\
4577 + !*** ../node_modules/redux/es/redux.js ***!
4578 + \*****************************************/
4579 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4580 +
4581 +"use strict";
4582 +__webpack_require__.r(__webpack_exports__);
4583 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4584 +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes),
4585 +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware),
4586 +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators),
4587 +/* harmony export */ combineReducers: () => (/* binding */ combineReducers),
4588 +/* harmony export */ compose: () => (/* binding */ compose),
4589 +/* harmony export */ createStore: () => (/* binding */ createStore),
4590 +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore)
4591 +/* harmony export */ });
4592 +/* 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");
4593 +
4594 +
4595 +/**
4596 + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
4597 + *
4598 + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
4599 + * during build.
4600 + * @param {number} code
4601 + */
4602 +function formatProdErrorMessage(code) {
4603 + 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. ';
4604 +}
4605 +
4606 +// Inlined version of the `symbol-observable` polyfill
4607 +var $$observable = (function () {
4608 + return typeof Symbol === 'function' && Symbol.observable || '@@observable';
4609 +})();
4610 +
4611 +/**
4612 + * These are private action types reserved by Redux.
4613 + * For any unknown actions, you must return the current state.
4614 + * If the current state is undefined, you must return the initial state.
4615 + * Do not reference these action types directly in your code.
4616 + */
4617 +var randomString = function randomString() {
4618 + return Math.random().toString(36).substring(7).split('').join('.');
4619 +};
4620 +
4621 +var ActionTypes = {
4622 + INIT: "@@redux/INIT" + randomString(),
4623 + REPLACE: "@@redux/REPLACE" + randomString(),
4624 + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
4625 + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
4626 + }
4627 +};
4628 +
4629 +/**
4630 + * @param {any} obj The object to inspect.
4631 + * @returns {boolean} True if the argument appears to be a plain object.
4632 + */
4633 +function isPlainObject(obj) {
4634 + if (typeof obj !== 'object' || obj === null) return false;
4635 + var proto = obj;
4636 +
4637 + while (Object.getPrototypeOf(proto) !== null) {
4638 + proto = Object.getPrototypeOf(proto);
4639 + }
4640 +
4641 + return Object.getPrototypeOf(obj) === proto;
4642 +}
4643 +
4644 +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
4645 +function miniKindOf(val) {
4646 + if (val === void 0) return 'undefined';
4647 + if (val === null) return 'null';
4648 + var type = typeof val;
4649 +
4650 + switch (type) {
4651 + case 'boolean':
4652 + case 'string':
4653 + case 'number':
4654 + case 'symbol':
4655 + case 'function':
4656 + {
4657 + return type;
4658 + }
4659 + }
4660 +
4661 + if (Array.isArray(val)) return 'array';
4662 + if (isDate(val)) return 'date';
4663 + if (isError(val)) return 'error';
4664 + var constructorName = ctorName(val);
4665 +
4666 + switch (constructorName) {
4667 + case 'Symbol':
4668 + case 'Promise':
4669 + case 'WeakMap':
4670 + case 'WeakSet':
4671 + case 'Map':
4672 + case 'Set':
4673 + return constructorName;
4674 + } // other
4675 +
4676 +
4677 + return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
4678 +}
4679 +
4680 +function ctorName(val) {
4681 + return typeof val.constructor === 'function' ? val.constructor.name : null;
4682 +}
4683 +
4684 +function isError(val) {
4685 + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
4686 +}
4687 +
4688 +function isDate(val) {
4689 + if (val instanceof Date) return true;
4690 + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
4691 +}
4692 +
4693 +function kindOf(val) {
4694 + var typeOfVal = typeof val;
4695 +
4696 + if (true) {
4697 + typeOfVal = miniKindOf(val);
4698 + }
4699 +
4700 + return typeOfVal;
4701 +}
4702 +
4703 +/**
4704 + * @deprecated
4705 + *
4706 + * **We recommend using the `configureStore` method
4707 + * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
4708 + *
4709 + * Redux Toolkit is our recommended approach for writing Redux logic today,
4710 + * including store setup, reducers, data fetching, and more.
4711 + *
4712 + * **For more details, please read this Redux docs page:**
4713 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
4714 + *
4715 + * `configureStore` from Redux Toolkit is an improved version of `createStore` that
4716 + * simplifies setup and helps avoid common bugs.
4717 + *
4718 + * You should not be using the `redux` core package by itself today, except for learning purposes.
4719 + * The `createStore` method from the core `redux` package will not be removed, but we encourage
4720 + * all users to migrate to using Redux Toolkit for all Redux code.
4721 + *
4722 + * If you want to use `createStore` without this visual deprecation warning, use
4723 + * the `legacy_createStore` import instead:
4724 + *
4725 + * `import { legacy_createStore as createStore} from 'redux'`
4726 + *
4727 + */
4728 +
4729 +function createStore(reducer, preloadedState, enhancer) {
4730 + var _ref2;
4731 +
4732 + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
4733 + 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.');
4734 + }
4735 +
4736 + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
4737 + enhancer = preloadedState;
4738 + preloadedState = undefined;
4739 + }
4740 +
4741 + if (typeof enhancer !== 'undefined') {
4742 + if (typeof enhancer !== 'function') {
4743 + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
1828 4744 }
1829 - }, {
1830 - key: "getId",
1831 - value: function getId() {
1832 - return 'regenerate-local-style-ids--document/elements/paste';
4745 +
4746 + return enhancer(createStore)(reducer, preloadedState);
4747 + }
4748 +
4749 + if (typeof reducer !== 'function') {
4750 + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
4751 + }
4752 +
4753 + var currentReducer = reducer;
4754 + var currentState = preloadedState;
4755 + var currentListeners = [];
4756 + var nextListeners = currentListeners;
4757 + var isDispatching = false;
4758 + /**
4759 + * This makes a shallow copy of currentListeners so we can use
4760 + * nextListeners as a temporary list while dispatching.
4761 + *
4762 + * This prevents any bugs around consumers calling
4763 + * subscribe/unsubscribe in the middle of a dispatch.
4764 + */
4765 +
4766 + function ensureCanMutateNextListeners() {
4767 + if (nextListeners === currentListeners) {
4768 + nextListeners = currentListeners.slice();
1833 4769 }
1834 - }, {
1835 - key: "apply",
1836 - value: function apply(args, result) {
1837 - var containers = Array.isArray(result) ? result : [result];
1838 - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds);
4770 + }
4771 + /**
4772 + * Reads the state tree managed by the store.
4773 + *
4774 + * @returns {any} The current state tree of your application.
4775 + */
4776 +
4777 +
4778 + function getState() {
4779 + if (isDispatching) {
4780 + 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.');
1839 4781 }
1840 - }]);
1841 -}($e.modules.hookData.After);
1842 4782
1843 -/***/ }),
4783 + return currentState;
4784 + }
4785 + /**
4786 + * Adds a change listener. It will be called any time an action is dispatched,
4787 + * and some part of the state tree may potentially have changed. You may then
4788 + * call `getState()` to read the current state tree inside the callback.
4789 + *
4790 + * You may call `dispatch()` from a change listener, with the following
4791 + * caveats:
4792 + *
4793 + * 1. The subscriptions are snapshotted just before every `dispatch()` call.
4794 + * If you subscribe or unsubscribe while the listeners are being invoked, this
4795 + * will not have any effect on the `dispatch()` that is currently in progress.
4796 + * However, the next `dispatch()` call, whether nested or not, will use a more
4797 + * recent snapshot of the subscription list.
4798 + *
4799 + * 2. The listener should not expect to see all state changes, as the state
4800 + * might have been updated multiple times during a nested `dispatch()` before
4801 + * the listener is called. It is, however, guaranteed that all subscribers
4802 + * registered before the `dispatch()` started will be called with the latest
4803 + * state by the time it exits.
4804 + *
4805 + * @param {Function} listener A callback to be invoked on every dispatch.
4806 + * @returns {Function} A function to remove this change listener.
4807 + */
1844 4808
1845 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/index.js":
1846 -/*!*****************************************************************!*\
1847 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/index.js ***!
1848 - \*****************************************************************/
1849 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1850 4809
1851 -"use strict";
4810 + function subscribe(listener) {
4811 + if (typeof listener !== 'function') {
4812 + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
4813 + }
1852 4814
4815 + if (isDispatching) {
4816 + 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.');
4817 + }
1853 4818
1854 -Object.defineProperty(exports, "__esModule", ({
1855 - value: true
1856 -}));
1857 -Object.defineProperty(exports, "DuplicateElement", ({
1858 - enumerable: true,
1859 - get: function get() {
1860 - return _duplicateElement.DuplicateElement;
4819 + var isSubscribed = true;
4820 + ensureCanMutateNextListeners();
4821 + nextListeners.push(listener);
4822 + return function unsubscribe() {
4823 + if (!isSubscribed) {
4824 + return;
4825 + }
4826 +
4827 + if (isDispatching) {
4828 + 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.');
4829 + }
4830 +
4831 + isSubscribed = false;
4832 + ensureCanMutateNextListeners();
4833 + var index = nextListeners.indexOf(listener);
4834 + nextListeners.splice(index, 1);
4835 + currentListeners = null;
4836 + };
1861 4837 }
1862 -}));
1863 -Object.defineProperty(exports, "ImportElement", ({
1864 - enumerable: true,
1865 - get: function get() {
1866 - return _importElement.ImportElement;
4838 + /**
4839 + * Dispatches an action. It is the only way to trigger a state change.
4840 + *
4841 + * The `reducer` function, used to create the store, will be called with the
4842 + * current state tree and the given `action`. Its return value will
4843 + * be considered the **next** state of the tree, and the change listeners
4844 + * will be notified.
4845 + *
4846 + * The base implementation only supports plain object actions. If you want to
4847 + * dispatch a Promise, an Observable, a thunk, or something else, you need to
4848 + * wrap your store creating function into the corresponding middleware. For
4849 + * example, see the documentation for the `redux-thunk` package. Even the
4850 + * middleware will eventually dispatch plain object actions using this method.
4851 + *
4852 + * @param {Object} action A plain object representing “what changed”. It is
4853 + * a good idea to keep actions serializable so you can record and replay user
4854 + * sessions, or use the time travelling `redux-devtools`. An action must have
4855 + * a `type` property which may not be `undefined`. It is a good idea to use
4856 + * string constants for action types.
4857 + *
4858 + * @returns {Object} For convenience, the same action object you dispatched.
4859 + *
4860 + * Note that, if you use a custom middleware, it may wrap `dispatch()` to
4861 + * return something else (for example, a Promise you can await).
4862 + */
4863 +
4864 +
4865 + function dispatch(action) {
4866 + if (!isPlainObject(action)) {
4867 + 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.");
4868 + }
4869 +
4870 + if (typeof action.type === 'undefined') {
4871 + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
4872 + }
4873 +
4874 + if (isDispatching) {
4875 + throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
4876 + }
4877 +
4878 + try {
4879 + isDispatching = true;
4880 + currentState = currentReducer(currentState, action);
4881 + } finally {
4882 + isDispatching = false;
4883 + }
4884 +
4885 + var listeners = currentListeners = nextListeners;
4886 +
4887 + for (var i = 0; i < listeners.length; i++) {
4888 + var listener = listeners[i];
4889 + listener();
4890 + }
4891 +
4892 + return action;
1867 4893 }
1868 -}));
1869 -Object.defineProperty(exports, "PasteElement", ({
1870 - enumerable: true,
1871 - get: function get() {
1872 - return _pasteElement.PasteElement;
4894 + /**
4895 + * Replaces the reducer currently used by the store to calculate the state.
4896 + *
4897 + * You might need this if your app implements code splitting and you want to
4898 + * load some of the reducers dynamically. You might also need this if you
4899 + * implement a hot reloading mechanism for Redux.
4900 + *
4901 + * @param {Function} nextReducer The reducer for the store to use instead.
4902 + * @returns {void}
4903 + */
4904 +
4905 +
4906 + function replaceReducer(nextReducer) {
4907 + if (typeof nextReducer !== 'function') {
4908 + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
4909 + }
4910 +
4911 + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
4912 + // Any reducers that existed in both the new and old rootReducer
4913 + // will receive the previous state. This effectively populates
4914 + // the new state tree with any relevant data from the old one.
4915 +
4916 + dispatch({
4917 + type: ActionTypes.REPLACE
4918 + });
1873 4919 }
1874 -}));
1875 -var _duplicateElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/duplicate-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js");
1876 -var _pasteElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/paste-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js");
1877 -var _importElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/import-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js");
4920 + /**
4921 + * Interoperability point for observable/reactive libraries.
4922 + * @returns {observable} A minimal observable of state changes.
4923 + * For more information, see the observable proposal:
4924 + * https://github.com/tc39/proposal-observable
4925 + */
1878 4926
1879 -/***/ }),
1880 4927
1881 -/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js":
1882 -/*!********************************************************************************!*\
1883 - !*** ../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js ***!
1884 - \********************************************************************************/
1885 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4928 + function observable() {
4929 + var _ref;
1886 4930
1887 -"use strict";
4931 + var outerSubscribe = subscribe;
4932 + return _ref = {
4933 + /**
4934 + * The minimal observable subscription method.
4935 + * @param {Object} observer Any object that can be used as an observer.
4936 + * The observer object should have a `next` method.
4937 + * @returns {subscription} An object with an `unsubscribe` method that can
4938 + * be used to unsubscribe the observable from the store, and prevent further
4939 + * emission of values from the observable.
4940 + */
4941 + subscribe: function subscribe(observer) {
4942 + if (typeof observer !== 'object' || observer === null) {
4943 + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
4944 + }
1888 4945
4946 + function observeState() {
4947 + if (observer.next) {
4948 + observer.next(getState());
4949 + }
4950 + }
1889 4951
1890 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1891 -Object.defineProperty(exports, "__esModule", ({
1892 - value: true
1893 -}));
1894 -exports.getElementChildren = getElementChildren;
1895 -var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1896 -function getElementChildren(model) {
1897 - var _model$get$models, _model$get;
1898 - var childModels = (_model$get$models = model === null || model === void 0 || (_model$get = model.get('elements')) === null || _model$get === void 0 ? void 0 : _model$get.models) !== null && _model$get$models !== void 0 ? _model$get$models : [];
1899 - var children = childModels.flatMap(getElementChildren);
1900 - return [model].concat((0, _toConsumableArray2.default)(children));
4952 + observeState();
4953 + var unsubscribe = outerSubscribe(observeState);
4954 + return {
4955 + unsubscribe: unsubscribe
4956 + };
4957 + }
4958 + }, _ref[$$observable] = function () {
4959 + return this;
4960 + }, _ref;
4961 + } // When a store is created, an "INIT" action is dispatched so that every
4962 + // reducer returns their initial state. This effectively populates
4963 + // the initial state tree.
4964 +
4965 +
4966 + dispatch({
4967 + type: ActionTypes.INIT
4968 + });
4969 + return _ref2 = {
4970 + dispatch: dispatch,
4971 + subscribe: subscribe,
4972 + getState: getState,
4973 + replaceReducer: replaceReducer
4974 + }, _ref2[$$observable] = observable, _ref2;
1901 4975 }
4976 +/**
4977 + * Creates a Redux store that holds the state tree.
4978 + *
4979 + * **We recommend using `configureStore` from the
4980 + * `@reduxjs/toolkit` package**, which replaces `createStore`:
4981 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
4982 + *
4983 + * The only way to change the data in the store is to call `dispatch()` on it.
4984 + *
4985 + * There should only be a single store in your app. To specify how different
4986 + * parts of the state tree respond to actions, you may combine several reducers
4987 + * into a single reducer function by using `combineReducers`.
4988 + *
4989 + * @param {Function} reducer A function that returns the next state tree, given
4990 + * the current state tree and the action to handle.
4991 + *
4992 + * @param {any} [preloadedState] The initial state. You may optionally specify it
4993 + * to hydrate the state from the server in universal apps, or to restore a
4994 + * previously serialized user session.
4995 + * If you use `combineReducers` to produce the root reducer function, this must be
4996 + * an object with the same shape as `combineReducers` keys.
4997 + *
4998 + * @param {Function} [enhancer] The store enhancer. You may optionally specify it
4999 + * to enhance the store with third-party capabilities such as middleware,
5000 + * time travel, persistence, etc. The only store enhancer that ships with Redux
5001 + * is `applyMiddleware()`.
5002 + *
5003 + * @returns {Store} A Redux store that lets you read the state, dispatch actions
5004 + * and subscribe to changes.
5005 + */
1902 5006
1903 -/***/ }),
5007 +var legacy_createStore = createStore;
1904 5008
1905 -/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js":
1906 -/*!*******************************************************************************!*\
1907 - !*** ../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js ***!
1908 - \*******************************************************************************/
1909 -/***/ ((__unused_webpack_module, exports) => {
5009 +/**
5010 + * Prints a warning in the console if it exists.
5011 + *
5012 + * @param {String} message The warning message.
5013 + * @returns {void}
5014 + */
5015 +function warning(message) {
5016 + /* eslint-disable no-console */
5017 + if (typeof console !== 'undefined' && typeof console.error === 'function') {
5018 + console.error(message);
5019 + }
5020 + /* eslint-enable no-console */
1910 5021
1911 -"use strict";
1912 5022
5023 + try {
5024 + // This error was thrown as a convenience so that if you enable
5025 + // "break on all exceptions" in your console,
5026 + // it would pause the execution at this line.
5027 + throw new Error(message);
5028 + } catch (e) {} // eslint-disable-line no-empty
1913 5029
1914 -Object.defineProperty(exports, "__esModule", ({
1915 - value: true
1916 -}));
1917 -exports.getRandomStyleId = getRandomStyleId;
5030 +}
5031 +
5032 +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
5033 + var reducerKeys = Object.keys(reducers);
5034 + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
5035 +
5036 + if (reducerKeys.length === 0) {
5037 + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
5038 + }
5039 +
5040 + if (!isPlainObject(inputState)) {
5041 + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
5042 + }
5043 +
5044 + var unexpectedKeys = Object.keys(inputState).filter(function (key) {
5045 + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
5046 + });
5047 + unexpectedKeys.forEach(function (key) {
5048 + unexpectedKeyCache[key] = true;
5049 + });
5050 + if (action && action.type === ActionTypes.REPLACE) return;
5051 +
5052 + if (unexpectedKeys.length > 0) {
5053 + 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.");
5054 + }
5055 +}
5056 +
5057 +function assertReducerShape(reducers) {
5058 + Object.keys(reducers).forEach(function (key) {
5059 + var reducer = reducers[key];
5060 + var initialState = reducer(undefined, {
5061 + type: ActionTypes.INIT
5062 + });
5063 +
5064 + if (typeof initialState === 'undefined') {
5065 + 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.");
5066 + }
5067 +
5068 + if (typeof reducer(undefined, {
5069 + type: ActionTypes.PROBE_UNKNOWN_ACTION()
5070 + }) === 'undefined') {
5071 + 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.");
5072 + }
5073 + });
5074 +}
1918 5075 /**
1919 - * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
5076 + * Turns an object whose values are different reducer functions, into a single
5077 + * reducer function. It will call every child reducer, and gather their results
5078 + * into a single state object, whose keys correspond to the keys of the passed
5079 + * reducer functions.
5080 + *
5081 + * @param {Object} reducers An object whose values correspond to different
5082 + * reducer functions that need to be combined into one. One handy way to obtain
5083 + * it is to use ES6 `import * as reducers` syntax. The reducers may never return
5084 + * undefined for any action. Instead, they should return their initial state
5085 + * if the state passed to them was undefined, and the current state for any
5086 + * unrecognized action.
5087 + *
5088 + * @returns {Function} A reducer function that invokes every reducer inside the
5089 + * passed object, and builds a state object with the same shape.
1920 5090 */
1921 5091
5092 +
5093 +function combineReducers(reducers) {
5094 + var reducerKeys = Object.keys(reducers);
5095 + var finalReducers = {};
5096 +
5097 + for (var i = 0; i < reducerKeys.length; i++) {
5098 + var key = reducerKeys[i];
5099 +
5100 + if (true) {
5101 + if (typeof reducers[key] === 'undefined') {
5102 + warning("No reducer provided for key \"" + key + "\"");
5103 + }
5104 + }
5105 +
5106 + if (typeof reducers[key] === 'function') {
5107 + finalReducers[key] = reducers[key];
5108 + }
5109 + }
5110 +
5111 + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
5112 + // keys multiple times.
5113 +
5114 + var unexpectedKeyCache;
5115 +
5116 + if (true) {
5117 + unexpectedKeyCache = {};
5118 + }
5119 +
5120 + var shapeAssertionError;
5121 +
5122 + try {
5123 + assertReducerShape(finalReducers);
5124 + } catch (e) {
5125 + shapeAssertionError = e;
5126 + }
5127 +
5128 + return function combination(state, action) {
5129 + if (state === void 0) {
5130 + state = {};
5131 + }
5132 +
5133 + if (shapeAssertionError) {
5134 + throw shapeAssertionError;
5135 + }
5136 +
5137 + if (true) {
5138 + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
5139 +
5140 + if (warningMessage) {
5141 + warning(warningMessage);
5142 + }
5143 + }
5144 +
5145 + var hasChanged = false;
5146 + var nextState = {};
5147 +
5148 + for (var _i = 0; _i < finalReducerKeys.length; _i++) {
5149 + var _key = finalReducerKeys[_i];
5150 + var reducer = finalReducers[_key];
5151 + var previousStateForKey = state[_key];
5152 + var nextStateForKey = reducer(previousStateForKey, action);
5153 +
5154 + if (typeof nextStateForKey === 'undefined') {
5155 + var actionType = action && action.type;
5156 + 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.");
5157 + }
5158 +
5159 + nextState[_key] = nextStateForKey;
5160 + hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
5161 + }
5162 +
5163 + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
5164 + return hasChanged ? nextState : state;
5165 + };
5166 +}
5167 +
5168 +function bindActionCreator(actionCreator, dispatch) {
5169 + return function () {
5170 + return dispatch(actionCreator.apply(this, arguments));
5171 + };
5172 +}
1922 5173 /**
1923 - * @param {Container} container
1924 - * @param {Object} existingStyleIds
1925 - * @return {string}
5174 + * Turns an object whose values are action creators, into an object with the
5175 + * same keys, but with every function wrapped into a `dispatch` call so they
5176 + * may be invoked directly. This is just a convenience method, as you can call
5177 + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
5178 + *
5179 + * For convenience, you can also pass an action creator as the first argument,
5180 + * and get a dispatch wrapped function in return.
5181 + *
5182 + * @param {Function|Object} actionCreators An object whose values are action
5183 + * creator functions. One handy way to obtain it is to use ES6 `import * as`
5184 + * syntax. You may also pass a single function.
5185 + *
5186 + * @param {Function} dispatch The `dispatch` function available on your Redux
5187 + * store.
5188 + *
5189 + * @returns {Function|Object} The object mimicking the original object, but with
5190 + * every action creator wrapped into the `dispatch` call. If you passed a
5191 + * function as `actionCreators`, the return value will also be a single
5192 + * function.
1926 5193 */
1927 -function getRandomStyleId(container) {
1928 - var existingStyleIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1929 - var id;
1930 - do {
1931 - id = "e-".concat(container.id, "-").concat(elementorCommon.helpers.getUniqueId());
1932 - } while (existingStyleIds.hasOwnProperty(id));
1933 - return id;
5194 +
5195 +
5196 +function bindActionCreators(actionCreators, dispatch) {
5197 + if (typeof actionCreators === 'function') {
5198 + return bindActionCreator(actionCreators, dispatch);
5199 + }
5200 +
5201 + if (typeof actionCreators !== 'object' || actionCreators === null) {
5202 + 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\"?");
5203 + }
5204 +
5205 + var boundActionCreators = {};
5206 +
5207 + for (var key in actionCreators) {
5208 + var actionCreator = actionCreators[key];
5209 +
5210 + if (typeof actionCreator === 'function') {
5211 + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
5212 + }
5213 + }
5214 +
5215 + return boundActionCreators;
1934 5216 }
1935 5217
5218 +/**
5219 + * Composes single-argument functions from right to left. The rightmost
5220 + * function can take multiple arguments as it provides the signature for
5221 + * the resulting composite function.
5222 + *
5223 + * @param {...Function} funcs The functions to compose.
5224 + * @returns {Function} A function obtained by composing the argument functions
5225 + * from right to left. For example, compose(f, g, h) is identical to doing
5226 + * (...args) => f(g(h(...args))).
5227 + */
5228 +function compose() {
5229 + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
5230 + funcs[_key] = arguments[_key];
5231 + }
5232 +
5233 + if (funcs.length === 0) {
5234 + return function (arg) {
5235 + return arg;
5236 + };
5237 + }
5238 +
5239 + if (funcs.length === 1) {
5240 + return funcs[0];
5241 + }
5242 +
5243 + return funcs.reduce(function (a, b) {
5244 + return function () {
5245 + return a(b.apply(void 0, arguments));
5246 + };
5247 + });
5248 +}
5249 +
5250 +/**
5251 + * Creates a store enhancer that applies middleware to the dispatch method
5252 + * of the Redux store. This is handy for a variety of tasks, such as expressing
5253 + * asynchronous actions in a concise manner, or logging every action payload.
5254 + *
5255 + * See `redux-thunk` package as an example of the Redux middleware.
5256 + *
5257 + * Because middleware is potentially asynchronous, this should be the first
5258 + * store enhancer in the composition chain.
5259 + *
5260 + * Note that each middleware will be given the `dispatch` and `getState` functions
5261 + * as named arguments.
5262 + *
5263 + * @param {...Function} middlewares The middleware chain to be applied.
5264 + * @returns {Function} A store enhancer applying the middleware.
5265 + */
5266 +
5267 +function applyMiddleware() {
5268 + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
5269 + middlewares[_key] = arguments[_key];
5270 + }
5271 +
5272 + return function (createStore) {
5273 + return function () {
5274 + var store = createStore.apply(void 0, arguments);
5275 +
5276 + var _dispatch = function dispatch() {
5277 + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
5278 + };
5279 +
5280 + var middlewareAPI = {
5281 + getState: store.getState,
5282 + dispatch: function dispatch() {
5283 + return _dispatch.apply(void 0, arguments);
5284 + }
5285 + };
5286 + var chain = middlewares.map(function (middleware) {
5287 + return middleware(middlewareAPI);
5288 + });
5289 + _dispatch = compose.apply(void 0, chain)(store.dispatch);
5290 + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
5291 + dispatch: _dispatch
5292 + });
5293 + };
5294 + };
5295 +}
5296 +
5297 +
5298 +
5299 +
1936 5300 /***/ }),
1937 5301
1938 -/***/ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js":
1939 -/*!**************************************************************************************!*\
1940 - !*** ../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js ***!
1941 - \**************************************************************************************/
1942 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5302 +/***/ "../node_modules/reselect/es/defaultMemoize.js":
5303 +/*!*****************************************************!*\
5304 + !*** ../node_modules/reselect/es/defaultMemoize.js ***!
5305 + \*****************************************************/
5306 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1943 5307
1944 5308 "use strict";
5309 +__webpack_require__.r(__webpack_exports__);
5310 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5311 +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator),
5312 +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck),
5313 +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize)
5314 +/* harmony export */ });
5315 +// Cache implementation based on Erik Rasmussen's `lru-memoize`:
5316 +// https://github.com/erikras/lru-memoize
5317 +var NOT_FOUND = 'NOT_FOUND';
1945 5318
5319 +function createSingletonCache(equals) {
5320 + var entry;
5321 + return {
5322 + get: function get(key) {
5323 + if (entry && equals(entry.key, key)) {
5324 + return entry.value;
5325 + }
1946 5326
1947 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1948 -Object.defineProperty(exports, "__esModule", ({
1949 - value: true
1950 -}));
1951 -exports.regenerateLocalStyleIds = regenerateLocalStyleIds;
1952 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1953 -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1954 -var _getElementChildren = __webpack_require__(/*! ./get-element-children */ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js");
1955 -var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js");
1956 -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1957 -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1958 -function regenerateLocalStyleIds(container) {
1959 - var allElements = (0, _getElementChildren.getElementChildren)(container.model);
1960 - var styledElements = allElements.filter(function (model) {
1961 - var _model$get;
1962 - return Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0;
1963 - });
1964 - updateElementsStyleIdsInsideOut(styledElements);
5327 + return NOT_FOUND;
5328 + },
5329 + put: function put(key, value) {
5330 + entry = {
5331 + key: key,
5332 + value: value
5333 + };
5334 + },
5335 + getEntries: function getEntries() {
5336 + return entry ? [entry] : [];
5337 + },
5338 + clear: function clear() {
5339 + entry = undefined;
5340 + }
5341 + };
1965 5342 }
1966 -function isClassesProp(prop) {
1967 - return prop.$$type && 'classes' === prop.$$type && Array.isArray(prop.value) && prop.value.length > 0;
1968 -}
1969 -function calculateNewStylesAndSettings(element, model, settings) {
1970 - var _settings$toJSON;
1971 - var originalStyles = model.get('styles');
1972 - var settingsJson = (_settings$toJSON = settings === null || settings === void 0 ? void 0 : settings.toJSON()) !== null && _settings$toJSON !== void 0 ? _settings$toJSON : {};
1973 - var classesProps = Object.entries(settingsJson).filter(function (_ref) {
1974 - var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1975 - propValue = _ref2[1];
1976 - return isClassesProp(propValue);
1977 - });
1978 - var newStyles = {};
1979 - var changedIds = {};
1980 - Object.entries(originalStyles).forEach(function (_ref3) {
1981 - var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
1982 - originalStyleId = _ref4[0],
1983 - style = _ref4[1];
1984 - var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(element, newStyles);
1985 - newStyles[newStyleId] = structuredClone(_objectSpread(_objectSpread({}, style), {}, {
1986 - id: newStyleId
1987 - }));
1988 - changedIds[originalStyleId] = newStyleId;
1989 - });
1990 - var newClassesProps = classesProps.map(function (_ref5) {
1991 - var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
1992 - key = _ref6[0],
1993 - value = _ref6[1];
1994 - return [key, _objectSpread(_objectSpread({}, value), {}, {
1995 - value: value.value.map(function (className) {
1996 - var _changedIds$className;
1997 - return (_changedIds$className = changedIds[className]) !== null && _changedIds$className !== void 0 ? _changedIds$className : className;
1998 - })
1999 - })];
2000 - }, {});
5343 +
5344 +function createLruCache(maxSize, equals) {
5345 + var entries = [];
5346 +
5347 + function get(key) {
5348 + var cacheIndex = entries.findIndex(function (entry) {
5349 + return equals(key, entry.key);
5350 + }); // We found a cached entry
5351 +
5352 + if (cacheIndex > -1) {
5353 + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
5354 +
5355 + if (cacheIndex > 0) {
5356 + entries.splice(cacheIndex, 1);
5357 + entries.unshift(entry);
5358 + }
5359 +
5360 + return entry.value;
5361 + } // No entry found in cache, return sentinel
5362 +
5363 +
5364 + return NOT_FOUND;
5365 + }
5366 +
5367 + function put(key, value) {
5368 + if (get(key) === NOT_FOUND) {
5369 + // TODO Is unshift slow?
5370 + entries.unshift({
5371 + key: key,
5372 + value: value
5373 + });
5374 +
5375 + if (entries.length > maxSize) {
5376 + entries.pop();
5377 + }
5378 + }
5379 + }
5380 +
5381 + function getEntries() {
5382 + return entries;
5383 + }
5384 +
5385 + function clear() {
5386 + entries = [];
5387 + }
5388 +
2001 5389 return {
2002 - newStyles: newStyles,
2003 - newSettings: Object.fromEntries(newClassesProps)
5390 + get: get,
5391 + put: put,
5392 + getEntries: getEntries,
5393 + clear: clear
2004 5394 };
2005 5395 }
2006 -function updateStyleIdForContainer(container) {
2007 - var model = container.model,
2008 - settings = container.settings;
2009 - var _calculateNewStylesAn = calculateNewStylesAndSettings(container, model, settings),
2010 - newStyles = _calculateNewStylesAn.newStyles,
2011 - newSettings = _calculateNewStylesAn.newSettings;
2012 - $e.internal('document/elements/set-settings', {
2013 - container: container,
2014 - settings: newSettings
2015 - });
2016 - model.set('styles', newStyles);
5396 +
5397 +var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
5398 + return a === b;
5399 +};
5400 +function createCacheKeyComparator(equalityCheck) {
5401 + return function areArgumentsShallowlyEqual(prev, next) {
5402 + if (prev === null || next === null || prev.length !== next.length) {
5403 + return false;
5404 + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
5405 +
5406 +
5407 + var length = prev.length;
5408 +
5409 + for (var i = 0; i < length; i++) {
5410 + if (!equalityCheck(prev[i], next[i])) {
5411 + return false;
5412 + }
5413 + }
5414 +
5415 + return true;
5416 + };
2017 5417 }
2018 -function updateStyleIdForModel(model) {
2019 - var settings = model.get('settings');
2020 - var _calculateNewStylesAn2 = calculateNewStylesAndSettings(model, model, settings),
2021 - newStyles = _calculateNewStylesAn2.newStyles,
2022 - newSettings = _calculateNewStylesAn2.newSettings;
2023 - settings.set(newSettings);
2024 - model.set('styles', newStyles);
5418 +// defaultMemoize now supports a configurable cache size with LRU behavior,
5419 +// and optional comparison of the result value with existing values
5420 +function defaultMemoize(func, equalityCheckOrOptions) {
5421 + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
5422 + equalityCheck: equalityCheckOrOptions
5423 + };
5424 + var _providedOptions$equa = providedOptions.equalityCheck,
5425 + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
5426 + _providedOptions$maxS = providedOptions.maxSize,
5427 + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
5428 + resultEqualityCheck = providedOptions.resultEqualityCheck;
5429 + var comparator = createCacheKeyComparator(equalityCheck);
5430 + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
5431 +
5432 + function memoized() {
5433 + var value = cache.get(arguments);
5434 +
5435 + if (value === NOT_FOUND) {
5436 + // @ts-ignore
5437 + value = func.apply(null, arguments);
5438 +
5439 + if (resultEqualityCheck) {
5440 + var entries = cache.getEntries();
5441 + var matchingEntry = entries.find(function (entry) {
5442 + return resultEqualityCheck(entry.value, value);
5443 + });
5444 +
5445 + if (matchingEntry) {
5446 + value = matchingEntry.value;
5447 + }
5448 + }
5449 +
5450 + cache.put(arguments, value);
5451 + }
5452 +
5453 + return value;
5454 + }
5455 +
5456 + memoized.clearCache = function () {
5457 + return cache.clear();
5458 + };
5459 +
5460 + return memoized;
2025 5461 }
2026 -function updateStyleId(model) {
2027 - var container = window.elementor.getContainer(model.get('id'));
2028 5462
2029 - // If view exists, update the styles via the container
2030 - if (container) {
2031 - updateStyleIdForContainer(container);
2032 - return;
5463 +/***/ }),
5464 +
5465 +/***/ "../node_modules/reselect/es/index.js":
5466 +/*!********************************************!*\
5467 + !*** ../node_modules/reselect/es/index.js ***!
5468 + \********************************************/
5469 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5470 +
5471 +"use strict";
5472 +__webpack_require__.r(__webpack_exports__);
5473 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5474 +/* harmony export */ createSelector: () => (/* binding */ createSelector),
5475 +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator),
5476 +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector),
5477 +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
5478 +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
5479 +/* harmony export */ });
5480 +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
5481 +
5482 +
5483 +
5484 +function getDependencies(funcs) {
5485 + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
5486 +
5487 + if (!dependencies.every(function (dep) {
5488 + return typeof dep === 'function';
5489 + })) {
5490 + var dependencyTypes = dependencies.map(function (dep) {
5491 + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
5492 + }).join(', ');
5493 + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
2033 5494 }
2034 - updateStyleIdForModel(model);
5495 +
5496 + return dependencies;
2035 5497 }
2036 -function updateElementsStyleIdsInsideOut(styledElements) {
2037 - styledElements === null || styledElements === void 0 || styledElements.reverse().forEach(updateStyleId);
5498 +
5499 +function createSelectorCreator(memoize) {
5500 + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5501 + memoizeOptionsFromArgs[_key - 1] = arguments[_key];
5502 + }
5503 +
5504 + var createSelector = function createSelector() {
5505 + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
5506 + funcs[_key2] = arguments[_key2];
5507 + }
5508 +
5509 + var _recomputations = 0;
5510 +
5511 + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
5512 + // So, start by declaring the default value here.
5513 + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
5514 +
5515 +
5516 + var directlyPassedOptions = {
5517 + memoizeOptions: undefined
5518 + }; // Normally, the result func or "output selector" is the last arg
5519 +
5520 + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
5521 +
5522 + if (typeof resultFunc === 'object') {
5523 + directlyPassedOptions = resultFunc; // and pop the real result func off
5524 +
5525 + resultFunc = funcs.pop();
5526 + }
5527 +
5528 + if (typeof resultFunc !== 'function') {
5529 + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
5530 + } // Determine which set of options we're using. Prefer options passed directly,
5531 + // but fall back to options given to createSelectorCreator.
5532 +
5533 +
5534 + var _directlyPassedOption = directlyPassedOptions,
5535 + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
5536 + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
5537 + // is an array. In most libs I've looked at, it's an equality function or options object.
5538 + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
5539 + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
5540 + // we wrap it in an array so we can apply it.
5541 +
5542 + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
5543 + var dependencies = getDependencies(funcs);
5544 + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
5545 + _recomputations++; // apply arguments instead of spreading for performance.
5546 +
5547 + return resultFunc.apply(null, arguments);
5548 + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
5549 +
5550 + var selector = memoize(function dependenciesChecker() {
5551 + var params = [];
5552 + var length = dependencies.length;
5553 +
5554 + for (var i = 0; i < length; i++) {
5555 + // apply arguments instead of spreading and mutate a local list of params for performance.
5556 + // @ts-ignore
5557 + params.push(dependencies[i].apply(null, arguments));
5558 + } // apply arguments instead of spreading for performance.
5559 +
5560 +
5561 + _lastResult = memoizedResultFunc.apply(null, params);
5562 + return _lastResult;
5563 + });
5564 + Object.assign(selector, {
5565 + resultFunc: resultFunc,
5566 + memoizedResultFunc: memoizedResultFunc,
5567 + dependencies: dependencies,
5568 + lastResult: function lastResult() {
5569 + return _lastResult;
5570 + },
5571 + recomputations: function recomputations() {
5572 + return _recomputations;
5573 + },
5574 + resetRecomputations: function resetRecomputations() {
5575 + return _recomputations = 0;
5576 + }
5577 + });
5578 + return selector;
5579 + }; // @ts-ignore
5580 +
5581 +
5582 + return createSelector;
2038 5583 }
5584 +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
5585 +// Manual definition of state and output arguments
5586 +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
5587 + if (selectorCreator === void 0) {
5588 + selectorCreator = createSelector;
5589 + }
2039 5590
5591 + if (typeof selectors !== 'object') {
5592 + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
5593 + }
5594 +
5595 + var objectKeys = Object.keys(selectors);
5596 + var resultSelector = selectorCreator( // @ts-ignore
5597 + objectKeys.map(function (key) {
5598 + return selectors[key];
5599 + }), function () {
5600 + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
5601 + values[_key3] = arguments[_key3];
5602 + }
5603 +
5604 + return values.reduce(function (composition, value, index) {
5605 + composition[objectKeys[index]] = value;
5606 + return composition;
5607 + }, {});
5608 + });
5609 + return resultSelector;
5610 +};
5611 +
2040 5612 /***/ }),
2041 5613
2042 -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
2043 -/*!***************************************************************!*\
2044 - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
2045 - \***************************************************************/
5614 +/***/ "@wordpress/i18n":
5615 +/*!**************************!*\
5616 + !*** external "wp.i18n" ***!
5617 + \**************************/
2046 5618 /***/ ((module) => {
2047 5619
2048 -function _OverloadYield(e, d) {
2049 - this.v = e, this.k = d;
2050 -}
2051 -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
5620 +"use strict";
5621 +module.exports = wp.i18n;
2052 5622
2053 5623 /***/ }),
2054 5624
2055 5625 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
@@ -2107,43 +5677,8 @@
2107 5677 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
2108 5678
2109 5679 /***/ }),
2110 5680
2111 -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
2112 -/*!******************************************************************!*\
2113 - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
2114 - \******************************************************************/
2115 -/***/ ((module) => {
2116 -
2117 -function asyncGeneratorStep(n, t, e, r, o, a, c) {
2118 - try {
2119 - var i = n[a](c),
2120 - u = i.value;
2121 - } catch (n) {
2122 - return void e(n);
2123 - }
2124 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2125 -}
2126 -function _asyncToGenerator(n) {
2127 - return function () {
2128 - var t = this,
2129 - e = arguments;
2130 - return new Promise(function (r, o) {
2131 - var a = n.apply(t, e);
2132 - function _next(n) {
2133 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2134 - }
2135 - function _throw(n) {
2136 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2137 - }
2138 - _next(void 0);
2139 - });
2140 - };
2141 -}
2142 -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2143 -
2144 -/***/ }),
2145 -
2146 5681 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
2147 5682 /*!****************************************************************!*\
2148 5683 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
2149 5684 \****************************************************************/
@@ -2155,8 +5690,27 @@
2155 5690 module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
2156 5691
2157 5692 /***/ }),
2158 5693
5694 +/***/ "../node_modules/@babel/runtime/helpers/construct.js":
5695 +/*!***********************************************************!*\
5696 + !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
5697 + \***********************************************************/
5698 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5699 +
5700 +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
5701 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
5702 +function _construct(t, e, r) {
5703 + if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
5704 + var o = [null];
5705 + o.push.apply(o, e);
5706 + var p = new (t.bind.apply(t, o))();
5707 + return r && setPrototypeOf(p, r.prototype), p;
5708 +}
5709 +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
5710 +
5711 +/***/ }),
5712 +
2159 5713 /***/ "../node_modules/@babel/runtime/helpers/createClass.js":
2160 5714 /*!*************************************************************!*\
2161 5715 !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
2162 5716 \*************************************************************/
@@ -2269,8 +5823,43 @@
2269 5823 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
2270 5824
2271 5825 /***/ }),
2272 5826
5827 +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
5828 +/*!******************************************************************!*\
5829 + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
5830 + \******************************************************************/
5831 +/***/ ((module) => {
5832 +
5833 +function _isNativeFunction(t) {
5834 + try {
5835 + return -1 !== Function.toString.call(t).indexOf("[native code]");
5836 + } catch (n) {
5837 + return "function" == typeof t;
5838 + }
5839 +}
5840 +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
5841 +
5842 +/***/ }),
5843 +
5844 +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
5845 +/*!**************************************************************************!*\
5846 + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
5847 + \**************************************************************************/
5848 +/***/ ((module) => {
5849 +
5850 +function _isNativeReflectConstruct() {
5851 + try {
5852 + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
5853 + } catch (t) {}
5854 + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
5855 + return !!t;
5856 + }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
5857 +}
5858 +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
5859 +
5860 +/***/ }),
5861 +
2273 5862 /***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js":
2274 5863 /*!*****************************************************************!*\
2275 5864 !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***!
2276 5865 \*****************************************************************/
@@ -2362,344 +5951,8 @@
2362 5951 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
2363 5952
2364 5953 /***/ }),
2365 5954
2366 -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
2367 -/*!*************************************************************!*\
2368 - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
2369 - \*************************************************************/
2370 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2371 -
2372 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2373 -function _regenerator() {
2374 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2375 - var e,
2376 - t,
2377 - r = "function" == typeof Symbol ? Symbol : {},
2378 - n = r.iterator || "@@iterator",
2379 - o = r.toStringTag || "@@toStringTag";
2380 - function i(r, n, o, i) {
2381 - var c = n && n.prototype instanceof Generator ? n : Generator,
2382 - u = Object.create(c.prototype);
2383 - return regeneratorDefine(u, "_invoke", function (r, n, o) {
2384 - var i,
2385 - c,
2386 - u,
2387 - f = 0,
2388 - p = o || [],
2389 - y = !1,
2390 - G = {
2391 - p: 0,
2392 - n: 0,
2393 - v: e,
2394 - a: d,
2395 - f: d.bind(e, 4),
2396 - d: function d(t, r) {
2397 - return i = t, c = 0, u = e, G.n = r, a;
2398 - }
2399 - };
2400 - function d(r, n) {
2401 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2402 - var o,
2403 - i = p[t],
2404 - d = G.p,
2405 - l = i[2];
2406 - 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));
2407 - }
2408 - if (o || r > 1) return a;
2409 - throw y = !0, n;
2410 - }
2411 - return function (o, p, l) {
2412 - if (f > 1) throw TypeError("Generator is already running");
2413 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2414 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2415 - try {
2416 - if (f = 2, i) {
2417 - if (c || (o = "next"), t = i[o]) {
2418 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2419 - if (!t.done) return t;
2420 - u = t.value, c < 2 && (c = 0);
2421 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2422 - i = e;
2423 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2424 - } catch (t) {
2425 - i = e, c = 1, u = t;
2426 - } finally {
2427 - f = 1;
2428 - }
2429 - }
2430 - return {
2431 - value: t,
2432 - done: y
2433 - };
2434 - };
2435 - }(r, o, i), !0), u;
2436 - }
2437 - var a = {};
2438 - function Generator() {}
2439 - function GeneratorFunction() {}
2440 - function GeneratorFunctionPrototype() {}
2441 - t = Object.getPrototypeOf;
2442 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
2443 - return this;
2444 - }), t),
2445 - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2446 - function f(e) {
2447 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2448 - }
2449 - 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 () {
2450 - return this;
2451 - }), regeneratorDefine(u, "toString", function () {
2452 - return "[object Generator]";
2453 - }), (module.exports = _regenerator = function _regenerator() {
2454 - return {
2455 - w: i,
2456 - m: f
2457 - };
2458 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2459 -}
2460 -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2461 -
2462 -/***/ }),
2463 -
2464 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
2465 -/*!******************************************************************!*\
2466 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
2467 - \******************************************************************/
2468 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2469 -
2470 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2471 -function _regeneratorAsync(n, e, r, t, o) {
2472 - var a = regeneratorAsyncGen(n, e, r, t, o);
2473 - return a.next().then(function (n) {
2474 - return n.done ? n.value : a.next();
2475 - });
2476 -}
2477 -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2478 -
2479 -/***/ }),
2480 -
2481 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
2482 -/*!*********************************************************************!*\
2483 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
2484 - \*********************************************************************/
2485 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2486 -
2487 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2488 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2489 -function _regeneratorAsyncGen(r, e, t, o, n) {
2490 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2491 -}
2492 -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2493 -
2494 -/***/ }),
2495 -
2496 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
2497 -/*!**************************************************************************!*\
2498 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
2499 - \**************************************************************************/
2500 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2501 -
2502 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2503 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2504 -function AsyncIterator(t, e) {
2505 - function n(r, o, i, f) {
2506 - try {
2507 - var c = t[r](o),
2508 - u = c.value;
2509 - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
2510 - n("next", t, i, f);
2511 - }, function (t) {
2512 - n("throw", t, i, f);
2513 - }) : e.resolve(u).then(function (t) {
2514 - c.value = t, i(c);
2515 - }, function (t) {
2516 - return n("throw", t, i, f);
2517 - });
2518 - } catch (t) {
2519 - f(t);
2520 - }
2521 - }
2522 - var r;
2523 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
2524 - return this;
2525 - })), regeneratorDefine(this, "_invoke", function (t, o, i) {
2526 - function f() {
2527 - return new e(function (e, r) {
2528 - n(t, i, e, r);
2529 - });
2530 - }
2531 - return r = r ? r.then(f, f) : f();
2532 - }, !0);
2533 -}
2534 -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2535 -
2536 -/***/ }),
2537 -
2538 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
2539 -/*!*******************************************************************!*\
2540 - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
2541 - \*******************************************************************/
2542 -/***/ ((module) => {
2543 -
2544 -function _regeneratorDefine(e, r, n, t) {
2545 - var i = Object.defineProperty;
2546 - try {
2547 - i({}, "", {});
2548 - } catch (e) {
2549 - i = 0;
2550 - }
2551 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2552 - function o(r, n) {
2553 - _regeneratorDefine(e, r, function (e) {
2554 - return this._invoke(r, n, e);
2555 - });
2556 - }
2557 - r ? i ? i(e, r, {
2558 - value: n,
2559 - enumerable: !t,
2560 - configurable: !t,
2561 - writable: !t
2562 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2563 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2564 -}
2565 -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2566 -
2567 -/***/ }),
2568 -
2569 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
2570 -/*!*****************************************************************!*\
2571 - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
2572 - \*****************************************************************/
2573 -/***/ ((module) => {
2574 -
2575 -function _regeneratorKeys(e) {
2576 - var n = Object(e),
2577 - r = [];
2578 - for (var t in n) r.unshift(t);
2579 - return function e() {
2580 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2581 - return e.done = !0, e;
2582 - };
2583 -}
2584 -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2585 -
2586 -/***/ }),
2587 -
2588 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
2589 -/*!********************************************************************!*\
2590 - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
2591 - \********************************************************************/
2592 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2593 -
2594 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2595 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2596 -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
2597 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2598 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2599 -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
2600 -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
2601 -function _regeneratorRuntime() {
2602 - "use strict";
2603 -
2604 - var r = regenerator(),
2605 - e = r.m(_regeneratorRuntime),
2606 - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2607 - function n(r) {
2608 - var e = "function" == typeof r && r.constructor;
2609 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2610 - }
2611 - var o = {
2612 - "throw": 1,
2613 - "return": 2,
2614 - "break": 3,
2615 - "continue": 3
2616 - };
2617 - function a(r) {
2618 - var e, t;
2619 - return function (n) {
2620 - e || (e = {
2621 - stop: function stop() {
2622 - return t(n.a, 2);
2623 - },
2624 - "catch": function _catch() {
2625 - return n.v;
2626 - },
2627 - abrupt: function abrupt(r, e) {
2628 - return t(n.a, o[r], e);
2629 - },
2630 - delegateYield: function delegateYield(r, o, a) {
2631 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2632 - },
2633 - finish: function finish(r) {
2634 - return t(n.f, r);
2635 - }
2636 - }, t = function t(r, _t, o) {
2637 - n.p = e.prev, n.n = e.next;
2638 - try {
2639 - return r(_t, o);
2640 - } finally {
2641 - e.next = n.n;
2642 - }
2643 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2644 - try {
2645 - return r.call(this, e);
2646 - } finally {
2647 - n.p = e.prev, n.n = e.next;
2648 - }
2649 - };
2650 - }
2651 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2652 - return {
2653 - wrap: function wrap(e, t, n, o) {
2654 - return r.w(a(e), t, n, o && o.reverse());
2655 - },
2656 - isGeneratorFunction: n,
2657 - mark: r.m,
2658 - awrap: function awrap(r, e) {
2659 - return new OverloadYield(r, e);
2660 - },
2661 - AsyncIterator: regeneratorAsyncIterator,
2662 - async: function async(r, e, t, o, u) {
2663 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2664 - },
2665 - keys: regeneratorKeys,
2666 - values: regeneratorValues
2667 - };
2668 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2669 -}
2670 -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2671 -
2672 -/***/ }),
2673 -
2674 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
2675 -/*!*******************************************************************!*\
2676 - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
2677 - \*******************************************************************/
2678 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2679 -
2680 -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2681 -function _regeneratorValues(e) {
2682 - if (null != e) {
2683 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
2684 - r = 0;
2685 - if (t) return t.call(e);
2686 - if ("function" == typeof e.next) return e;
2687 - if (!isNaN(e.length)) return {
2688 - next: function next() {
2689 - return e && r >= e.length && (e = void 0), {
2690 - value: e && e[r++],
2691 - done: !e
2692 - };
2693 - }
2694 - };
2695 - }
2696 - throw new TypeError(_typeof(e) + " is not iterable");
2697 -}
2698 -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2699 -
2700 -/***/ }),
2701 -
2702 5955 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
2703 5956 /*!****************************************************************!*\
2704 5957 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
2705 5958 \****************************************************************/
@@ -2836,98 +6089,217 @@
2836 6089 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2837 6090
2838 6091 /***/ }),
2839 6092
2840 -/***/ "../node_modules/@babel/runtime/regenerator/index.js":
2841 -/*!***********************************************************!*\
2842 - !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
2843 - \***********************************************************/
6093 +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
6094 +/*!*****************************************************************!*\
6095 + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
6096 + \*****************************************************************/
2844 6097 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2845 6098
2846 -// TODO(Babel 8): Remove this file.
6099 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
6100 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
6101 +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
6102 +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
6103 +function _wrapNativeSuper(t) {
6104 + var r = "function" == typeof Map ? new Map() : void 0;
6105 + return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) {
6106 + if (null === t || !isNativeFunction(t)) return t;
6107 + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
6108 + if (void 0 !== r) {
6109 + if (r.has(t)) return r.get(t);
6110 + r.set(t, Wrapper);
6111 + }
6112 + function Wrapper() {
6113 + return construct(t, arguments, getPrototypeOf(this).constructor);
6114 + }
6115 + return Wrapper.prototype = Object.create(t.prototype, {
6116 + constructor: {
6117 + value: Wrapper,
6118 + enumerable: !1,
6119 + writable: !0,
6120 + configurable: !0
6121 + }
6122 + }), setPrototypeOf(Wrapper, t);
6123 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t);
6124 +}
6125 +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
2847 6126
2848 -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
2849 -module.exports = runtime;
6127 +/***/ }),
2850 6128
2851 -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2852 -try {
2853 - regeneratorRuntime = runtime;
2854 -} catch (accidentalStrictMode) {
2855 - if (typeof globalThis === "object") {
2856 - globalThis.regeneratorRuntime = runtime;
2857 - } else {
2858 - Function("r", "regeneratorRuntime = r")(runtime);
6129 +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
6130 +/*!********************************************************************!*\
6131 + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
6132 + \********************************************************************/
6133 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6134 +
6135 +"use strict";
6136 +__webpack_require__.r(__webpack_exports__);
6137 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6138 +/* harmony export */ "default": () => (/* binding */ _defineProperty)
6139 +/* harmony export */ });
6140 +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
6141 +
6142 +function _defineProperty(e, r, t) {
6143 + return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r)) in e ? Object.defineProperty(e, r, {
6144 + value: t,
6145 + enumerable: !0,
6146 + configurable: !0,
6147 + writable: !0
6148 + }) : e[r] = t, e;
6149 +}
6150 +
6151 +
6152 +/***/ }),
6153 +
6154 +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
6155 +/*!*******************************************************************!*\
6156 + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
6157 + \*******************************************************************/
6158 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6159 +
6160 +"use strict";
6161 +__webpack_require__.r(__webpack_exports__);
6162 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6163 +/* harmony export */ "default": () => (/* binding */ _objectSpread2)
6164 +/* harmony export */ });
6165 +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
6166 +
6167 +function ownKeys(e, r) {
6168 + var t = Object.keys(e);
6169 + if (Object.getOwnPropertySymbols) {
6170 + var o = Object.getOwnPropertySymbols(e);
6171 + r && (o = o.filter(function (r) {
6172 + return Object.getOwnPropertyDescriptor(e, r).enumerable;
6173 + })), t.push.apply(t, o);
2859 6174 }
6175 + return t;
2860 6176 }
6177 +function _objectSpread2(e) {
6178 + for (var r = 1; r < arguments.length; r++) {
6179 + var t = null != arguments[r] ? arguments[r] : {};
6180 + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
6181 + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]);
6182 + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
6183 + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
6184 + });
6185 + }
6186 + return e;
6187 +}
2861 6188
2862 6189
2863 6190 /***/ }),
2864 6191
2865 -/***/ "../node_modules/react-dom/client.js":
2866 -/*!*******************************************!*\
2867 - !*** ../node_modules/react-dom/client.js ***!
2868 - \*******************************************/
2869 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6192 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
6193 +/*!*****************************************************************!*\
6194 + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
6195 + \*****************************************************************/
6196 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2870 6197
2871 6198 "use strict";
6199 +__webpack_require__.r(__webpack_exports__);
6200 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6201 +/* harmony export */ "default": () => (/* binding */ toPrimitive)
6202 +/* harmony export */ });
6203 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
2872 6204
2873 -
2874 -var m = __webpack_require__(/*! react-dom */ "react-dom");
2875 -if (false) // removed by dead control flow
2876 -{} else {
2877 - var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2878 - exports.createRoot = function(c, o) {
2879 - i.usingClientEntryPoint = true;
2880 - try {
2881 - return m.createRoot(c, o);
2882 - } finally {
2883 - i.usingClientEntryPoint = false;
2884 - }
2885 - };
2886 - exports.hydrateRoot = function(c, h, o) {
2887 - i.usingClientEntryPoint = true;
2888 - try {
2889 - return m.hydrateRoot(c, h, o);
2890 - } finally {
2891 - i.usingClientEntryPoint = false;
2892 - }
2893 - };
6205 +function toPrimitive(t, r) {
6206 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t;
6207 + var e = t[Symbol.toPrimitive];
6208 + if (void 0 !== e) {
6209 + var i = e.call(t, r || "default");
6210 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i;
6211 + throw new TypeError("@@toPrimitive must return a primitive value.");
6212 + }
6213 + return ("string" === r ? String : Number)(t);
2894 6214 }
2895 6215
2896 6216
2897 6217 /***/ }),
2898 6218
2899 -/***/ "@wordpress/i18n":
2900 -/*!**************************!*\
2901 - !*** external "wp.i18n" ***!
2902 - \**************************/
2903 -/***/ ((module) => {
6219 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
6220 +/*!*******************************************************************!*\
6221 + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
6222 + \*******************************************************************/
6223 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2904 6224
2905 6225 "use strict";
2906 -module.exports = wp.i18n;
6226 +__webpack_require__.r(__webpack_exports__);
6227 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6228 +/* harmony export */ "default": () => (/* binding */ toPropertyKey)
6229 +/* harmony export */ });
6230 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
6231 +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
2907 6232
6233 +
6234 +function toPropertyKey(t) {
6235 + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string");
6236 + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : i + "";
6237 +}
6238 +
6239 +
2908 6240 /***/ }),
2909 6241
2910 -/***/ "react":
2911 -/*!************************!*\
2912 - !*** external "React" ***!
2913 - \************************/
2914 -/***/ ((module) => {
6242 +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js":
6243 +/*!************************************************************!*\
6244 + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
6245 + \************************************************************/
6246 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2915 6247
2916 6248 "use strict";
2917 -module.exports = React;
6249 +__webpack_require__.r(__webpack_exports__);
6250 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6251 +/* harmony export */ "default": () => (/* binding */ _typeof)
6252 +/* harmony export */ });
6253 +function _typeof(o) {
6254 + "@babel/helpers - typeof";
2918 6255
6256 + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
6257 + return typeof o;
6258 + } : function (o) {
6259 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
6260 + }, _typeof(o);
6261 +}
6262 +
6263 +
2919 6264 /***/ }),
2920 6265
2921 -/***/ "react-dom":
2922 -/*!***************************!*\
2923 - !*** external "ReactDOM" ***!
2924 - \***************************/
2925 -/***/ ((module) => {
6266 +/***/ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs":
6267 +/*!******************************************************************************!*\
6268 + !*** ../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs ***!
6269 + \******************************************************************************/
6270 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2926 6271
2927 6272 "use strict";
2928 -module.exports = ReactDOM;
6273 +__webpack_require__.r(__webpack_exports__);
6274 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6275 +/* harmony export */ Immer: () => (/* binding */ un),
6276 +/* harmony export */ applyPatches: () => (/* binding */ pn),
6277 +/* harmony export */ castDraft: () => (/* binding */ K),
6278 +/* harmony export */ castImmutable: () => (/* binding */ $),
6279 +/* harmony export */ createDraft: () => (/* binding */ ln),
6280 +/* harmony export */ current: () => (/* binding */ R),
6281 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
6282 +/* harmony export */ enableAllPlugins: () => (/* binding */ J),
6283 +/* harmony export */ enableES5: () => (/* binding */ F),
6284 +/* harmony export */ enableMapSet: () => (/* binding */ C),
6285 +/* harmony export */ enablePatches: () => (/* binding */ T),
6286 +/* harmony export */ finishDraft: () => (/* binding */ dn),
6287 +/* harmony export */ freeze: () => (/* binding */ d),
6288 +/* harmony export */ immerable: () => (/* binding */ L),
6289 +/* harmony export */ isDraft: () => (/* binding */ r),
6290 +/* harmony export */ isDraftable: () => (/* binding */ t),
6291 +/* harmony export */ nothing: () => (/* binding */ H),
6292 +/* harmony export */ original: () => (/* binding */ e),
6293 +/* harmony export */ produce: () => (/* binding */ fn),
6294 +/* harmony export */ produceWithPatches: () => (/* binding */ cn),
6295 +/* harmony export */ setAutoFreeze: () => (/* binding */ sn),
6296 +/* harmony export */ setUseProxies: () => (/* binding */ vn)
6297 +/* harmony export */ });
6298 +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);
6299 +//# sourceMappingURL=immer.esm.js.map
2929 6300
6301 +
2930 6302 /***/ })
2931 6303
2932 6304 /******/ });
2933 6305 /************************************************************************/
@@ -2955,10 +6327,51 @@
2955 6327 /******/ return module.exports;
2956 6328 /******/ }
2957 6329 /******/
2958 6330 /************************************************************************/
6331 +/******/ /* webpack/runtime/define property getters */
6332 +/******/ (() => {
6333 +/******/ // define getter functions for harmony exports
6334 +/******/ __webpack_require__.d = (exports, definition) => {
6335 +/******/ for(var key in definition) {
6336 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
6337 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
6338 +/******/ }
6339 +/******/ }
6340 +/******/ };
6341 +/******/ })();
6342 +/******/
6343 +/******/ /* webpack/runtime/global */
6344 +/******/ (() => {
6345 +/******/ __webpack_require__.g = (function() {
6346 +/******/ if (typeof globalThis === 'object') return globalThis;
6347 +/******/ try {
6348 +/******/ return this || new Function('return this')();
6349 +/******/ } catch (e) {
6350 +/******/ if (typeof window === 'object') return window;
6351 +/******/ }
6352 +/******/ })();
6353 +/******/ })();
6354 +/******/
6355 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
6356 +/******/ (() => {
6357 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
6358 +/******/ })();
6359 +/******/
6360 +/******/ /* webpack/runtime/make namespace object */
6361 +/******/ (() => {
6362 +/******/ // define __esModule on exports
6363 +/******/ __webpack_require__.r = (exports) => {
6364 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
6365 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6366 +/******/ }
6367 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
6368 +/******/ };
6369 +/******/ })();
6370 +/******/
6371 +/************************************************************************/
2959 6372 var __webpack_exports__ = {};
2960 -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
6373 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
2961 6374 (() => {
2962 6375 "use strict";
2963 6376 /*!************************************************************!*\
2964 6377 !*** ../modules/atomic-widgets/assets/js/editor/module.js ***!
@@ -2971,14 +6384,8 @@
2971 6384 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2972 6385 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2973 6386 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2974 6387 var _component = _interopRequireDefault(__webpack_require__(/*! ./component */ "../modules/atomic-widgets/assets/js/editor/component.js"));
2975 -var _atomicElementBaseType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js"));
2976 -var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js"));
2977 -var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js"));
2978 -var _createDivBlockType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-div-block-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js"));
2979 -var _createFlexboxType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-flexbox-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js"));
2980 -var _createGridType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-grid-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js"));
2981 6388 function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2982 6389 function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
2983 6390 var Module = /*#__PURE__*/function (_elementorModules$edi) {
2984 6391 function Module() {
@@ -2989,32 +6396,8 @@
2989 6396 return (0, _createClass2.default)(Module, [{
2990 6397 key: "onInit",
2991 6398 value: function onInit() {
2992 6399 $e.components.register(new _component.default());
2993 - this.exposeAtomicElementClasses();
2994 - this.registerAtomicElements();
2995 - }
2996 - }, {
2997 - key: "exposeAtomicElementClasses",
2998 - value: function exposeAtomicElementClasses() {
2999 - elementor.modules.elements.types.AtomicElementBase = _atomicElementBaseType.default;
3000 - elementor.modules.elements.views.createAtomicElementBase = _createAtomicElementBaseView.default;
3001 - elementor.modules.elements.models.AtomicElementBase = _atomicElementBaseModel.default;
3002 - }
3003 - }, {
3004 - key: "registerAtomicElements",
3005 - value: function registerAtomicElements() {
3006 - this.registerAtomicElementTypeIfAbsent((0, _createDivBlockType.default)());
3007 - this.registerAtomicElementTypeIfAbsent((0, _createFlexboxType.default)());
3008 - this.registerAtomicElementTypeIfAbsent((0, _createGridType.default)());
3009 - }
3010 - }, {
3011 - key: "registerAtomicElementTypeIfAbsent",
3012 - value: function registerAtomicElementTypeIfAbsent(elementType) {
3013 - if (elementor.elementsManager.getElementTypeClass(elementType.getType())) {
3014 - return;
3015 - }
3016 - elementor.elementsManager.registerElementType(elementType);
3017 6400 }
3018 6401 }]);
3019 6402 }(elementorModules.editor.utils.Module);
3020 6403 new Module();