@symbo.ls/scratch 2.11.398 → 2.11.410
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory.js +165 -26
- package/dist/cjs/index.js +2413 -2123
- package/dist/cjs/set.js +2184 -1892
- package/dist/cjs/system/color.js +2009 -1716
- package/dist/cjs/system/document.js +1999 -1706
- package/dist/cjs/system/font.js +1954 -1662
- package/dist/cjs/system/index.js +2211 -1919
- package/dist/cjs/system/reset.js +2010 -1717
- package/dist/cjs/system/shadow.js +2163 -1869
- package/dist/cjs/system/spacing.js +2003 -1709
- package/dist/cjs/system/svg.js +1950 -1657
- package/dist/cjs/system/theme.js +2016 -1723
- package/dist/cjs/system/timing.js +2002 -1710
- package/dist/cjs/system/typography.js +2199 -1904
- package/dist/cjs/transforms/index.js +2189 -1897
- package/dist/cjs/utils/color.js +165 -26
- package/dist/cjs/utils/index.js +2200 -1907
- package/dist/cjs/utils/sequence.js +1935 -1642
- package/dist/cjs/utils/sprite.js +165 -26
- package/dist/cjs/utils/var.js +1981 -1688
- package/package.json +2 -2
package/dist/cjs/system/index.js
CHANGED
|
@@ -30,33 +30,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../../domql/packages/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
37
|
+
var __defProp3 = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
40
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
|
+
var __export3 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
43
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
44
|
};
|
|
45
|
-
var
|
|
45
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
46
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
-
for (let key of
|
|
48
|
-
if (!
|
|
49
|
-
|
|
47
|
+
for (let key of __getOwnPropNames3(from))
|
|
48
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
50
50
|
}
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
|
-
var
|
|
53
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var key_exports = {};
|
|
55
|
-
|
|
55
|
+
__export3(key_exports, {
|
|
56
56
|
createSnapshotId: () => createSnapshotId,
|
|
57
57
|
generateKey: () => generateKey
|
|
58
58
|
});
|
|
59
|
-
module2.exports =
|
|
59
|
+
module2.exports = __toCommonJS3(key_exports);
|
|
60
60
|
var generateKey = /* @__PURE__ */ function() {
|
|
61
61
|
let index = 0;
|
|
62
62
|
function newId() {
|
|
@@ -69,36 +69,36 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../../domql/packages/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
var
|
|
76
|
+
var __defProp3 = Object.defineProperty;
|
|
77
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
78
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
79
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
80
|
+
var __export3 = (target, all) => {
|
|
81
81
|
for (var name in all)
|
|
82
|
-
|
|
82
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
83
83
|
};
|
|
84
|
-
var
|
|
84
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
85
85
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
86
|
-
for (let key of
|
|
87
|
-
if (!
|
|
88
|
-
|
|
86
|
+
for (let key of __getOwnPropNames3(from))
|
|
87
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
88
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
89
89
|
}
|
|
90
90
|
return to;
|
|
91
91
|
};
|
|
92
|
-
var
|
|
92
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
93
93
|
var env_exports = {};
|
|
94
|
-
|
|
94
|
+
__export3(env_exports, {
|
|
95
95
|
NODE_ENV: () => NODE_ENV,
|
|
96
96
|
getNev: () => getNev,
|
|
97
97
|
isDevelopment: () => isDevelopment,
|
|
98
98
|
isProduction: () => isProduction,
|
|
99
99
|
isTest: () => isTest
|
|
100
100
|
});
|
|
101
|
-
module2.exports =
|
|
101
|
+
module2.exports = __toCommonJS3(env_exports);
|
|
102
102
|
var NODE_ENV = "development";
|
|
103
103
|
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
104
104
|
var isTest = (env = NODE_ENV) => env === "test";
|
|
@@ -107,35 +107,35 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../../domql/packages/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
var
|
|
114
|
+
var __defProp3 = Object.defineProperty;
|
|
115
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
116
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
117
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
118
|
+
var __export3 = (target, all) => {
|
|
119
119
|
for (var name in all)
|
|
120
|
-
|
|
120
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
121
121
|
};
|
|
122
|
-
var
|
|
122
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
123
123
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
124
|
-
for (let key of
|
|
125
|
-
if (!
|
|
126
|
-
|
|
124
|
+
for (let key of __getOwnPropNames3(from))
|
|
125
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
126
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
127
127
|
}
|
|
128
128
|
return to;
|
|
129
129
|
};
|
|
130
|
-
var
|
|
130
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
131
131
|
var globals_exports = {};
|
|
132
|
-
|
|
132
|
+
__export3(globals_exports, {
|
|
133
133
|
document: () => document4,
|
|
134
134
|
global: () => global,
|
|
135
135
|
self: () => self,
|
|
136
136
|
window: () => window2
|
|
137
137
|
});
|
|
138
|
-
module2.exports =
|
|
138
|
+
module2.exports = __toCommonJS3(globals_exports);
|
|
139
139
|
var global = globalThis;
|
|
140
140
|
var self = globalThis;
|
|
141
141
|
var window2 = globalThis;
|
|
@@ -143,33 +143,33 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../../domql/packages/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
var
|
|
154
|
-
var
|
|
150
|
+
var __defProp3 = Object.defineProperty;
|
|
151
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
152
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
153
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
154
|
+
var __export3 = (target, all) => {
|
|
155
155
|
for (var name in all)
|
|
156
|
-
|
|
156
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
157
157
|
};
|
|
158
|
-
var
|
|
158
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
159
159
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
160
|
-
for (let key of
|
|
161
|
-
if (!
|
|
162
|
-
|
|
160
|
+
for (let key of __getOwnPropNames3(from))
|
|
161
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
162
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
163
163
|
}
|
|
164
164
|
return to;
|
|
165
165
|
};
|
|
166
|
-
var
|
|
166
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
167
167
|
var node_exports = {};
|
|
168
|
-
|
|
168
|
+
__export3(node_exports, {
|
|
169
169
|
isHtmlElement: () => isHtmlElement,
|
|
170
170
|
isNode: () => isNode
|
|
171
171
|
});
|
|
172
|
-
module2.exports =
|
|
172
|
+
module2.exports = __toCommonJS3(node_exports);
|
|
173
173
|
var import_globals3 = require_globals();
|
|
174
174
|
var isNode = (obj) => {
|
|
175
175
|
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
@@ -180,29 +180,29 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../../domql/packages/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
|
-
var
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
var
|
|
187
|
+
var __defProp3 = Object.defineProperty;
|
|
188
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
189
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
190
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
191
|
+
var __export3 = (target, all) => {
|
|
192
192
|
for (var name in all)
|
|
193
|
-
|
|
193
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
194
194
|
};
|
|
195
|
-
var
|
|
195
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
196
196
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
197
|
-
for (let key of
|
|
198
|
-
if (!
|
|
199
|
-
|
|
197
|
+
for (let key of __getOwnPropNames3(from))
|
|
198
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
199
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
200
200
|
}
|
|
201
201
|
return to;
|
|
202
202
|
};
|
|
203
|
-
var
|
|
203
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
204
204
|
var types_exports = {};
|
|
205
|
-
|
|
205
|
+
__export3(types_exports, {
|
|
206
206
|
TYPES: () => TYPES,
|
|
207
207
|
is: () => is,
|
|
208
208
|
isArray: () => isArray7,
|
|
@@ -218,7 +218,7 @@ var require_types = __commonJS({
|
|
|
218
218
|
isString: () => isString8,
|
|
219
219
|
isUndefined: () => isUndefined
|
|
220
220
|
});
|
|
221
|
-
module2.exports =
|
|
221
|
+
module2.exports = __toCommonJS3(types_exports);
|
|
222
222
|
var import_node = require_node();
|
|
223
223
|
var isObject6 = (arg) => {
|
|
224
224
|
if (arg === null)
|
|
@@ -270,31 +270,32 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../../domql/packages/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
|
-
var
|
|
278
|
-
var
|
|
279
|
-
var
|
|
280
|
-
var
|
|
281
|
-
var
|
|
277
|
+
var __defProp3 = Object.defineProperty;
|
|
278
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
279
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
280
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
281
|
+
var __export3 = (target, all) => {
|
|
282
282
|
for (var name in all)
|
|
283
|
-
|
|
283
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
284
284
|
};
|
|
285
|
-
var
|
|
285
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
286
286
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
287
|
-
for (let key of
|
|
288
|
-
if (!
|
|
289
|
-
|
|
287
|
+
for (let key of __getOwnPropNames3(from))
|
|
288
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
289
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
290
290
|
}
|
|
291
291
|
return to;
|
|
292
292
|
};
|
|
293
|
-
var
|
|
293
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
294
294
|
var array_exports = {};
|
|
295
|
-
|
|
295
|
+
__export3(array_exports, {
|
|
296
296
|
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
297
297
|
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
298
|
+
arraysEqual: () => arraysEqual,
|
|
298
299
|
createNestedObject: () => createNestedObject,
|
|
299
300
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
300
301
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
@@ -308,7 +309,7 @@ var require_array = __commonJS({
|
|
|
308
309
|
reorderArrayByValues: () => reorderArrayByValues,
|
|
309
310
|
swapItemsInArray: () => swapItemsInArray
|
|
310
311
|
});
|
|
311
|
-
module2.exports =
|
|
312
|
+
module2.exports = __toCommonJS3(array_exports);
|
|
312
313
|
var import_object = require_object();
|
|
313
314
|
var import_types = require_types();
|
|
314
315
|
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
@@ -411,38 +412,53 @@ var require_array = __commonJS({
|
|
|
411
412
|
}
|
|
412
413
|
return newArray;
|
|
413
414
|
};
|
|
415
|
+
var arraysEqual = (arr1, arr2) => {
|
|
416
|
+
if (arr1.length !== arr2.length) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
420
|
+
if (arr1[i] !== arr2[i]) {
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return true;
|
|
425
|
+
};
|
|
414
426
|
}
|
|
415
427
|
});
|
|
416
428
|
|
|
417
|
-
//
|
|
429
|
+
// ../../../domql/packages/utils/dist/cjs/string.js
|
|
418
430
|
var require_string = __commonJS({
|
|
419
|
-
"
|
|
431
|
+
"../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
|
|
420
432
|
"use strict";
|
|
421
|
-
var
|
|
422
|
-
var
|
|
423
|
-
var
|
|
424
|
-
var
|
|
425
|
-
var
|
|
433
|
+
var __defProp3 = Object.defineProperty;
|
|
434
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
435
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
436
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
437
|
+
var __export3 = (target, all) => {
|
|
426
438
|
for (var name in all)
|
|
427
|
-
|
|
439
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
428
440
|
};
|
|
429
|
-
var
|
|
441
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
430
442
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
431
|
-
for (let key of
|
|
432
|
-
if (!
|
|
433
|
-
|
|
443
|
+
for (let key of __getOwnPropNames3(from))
|
|
444
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
445
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
434
446
|
}
|
|
435
447
|
return to;
|
|
436
448
|
};
|
|
437
|
-
var
|
|
449
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
438
450
|
var string_exports = {};
|
|
439
|
-
|
|
451
|
+
__export3(string_exports, {
|
|
452
|
+
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
453
|
+
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
454
|
+
findKeyPosition: () => findKeyPosition,
|
|
440
455
|
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
441
456
|
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
457
|
+
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
442
458
|
stringIncludesAny: () => stringIncludesAny,
|
|
443
459
|
trimStringFromSymbols: () => trimStringFromSymbols
|
|
444
460
|
});
|
|
445
|
-
module2.exports =
|
|
461
|
+
module2.exports = __toCommonJS3(string_exports);
|
|
446
462
|
var stringIncludesAny = (str, characters) => {
|
|
447
463
|
for (const char of characters) {
|
|
448
464
|
if (str.includes(char)) {
|
|
@@ -484,33 +500,100 @@ var require_string = __commonJS({
|
|
|
484
500
|
var lowercaseFirstLetter = (inputString) => {
|
|
485
501
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
486
502
|
};
|
|
503
|
+
var findKeyPosition = (str, key) => {
|
|
504
|
+
const lines = str.split("\n");
|
|
505
|
+
let startLineNumber = -1;
|
|
506
|
+
let endLineNumber = -1;
|
|
507
|
+
let startColumn = -1;
|
|
508
|
+
let endColumn = -1;
|
|
509
|
+
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
510
|
+
let braceCount = 0;
|
|
511
|
+
let foundKey = false;
|
|
512
|
+
for (let i = 0; i < lines.length; i++) {
|
|
513
|
+
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
514
|
+
foundKey = true;
|
|
515
|
+
startLineNumber = i + 1;
|
|
516
|
+
startColumn = lines[i].indexOf(key) + 1;
|
|
517
|
+
if (lines[i].includes("{}")) {
|
|
518
|
+
endLineNumber = startLineNumber;
|
|
519
|
+
endColumn = lines[i].indexOf("{}") + 3;
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
const line = lines[i].slice(startColumn + key.length);
|
|
523
|
+
if (line.includes("{") || line.includes("[")) {
|
|
524
|
+
braceCount = 1;
|
|
525
|
+
} else {
|
|
526
|
+
endLineNumber = i + 1;
|
|
527
|
+
endColumn = lines[i].length + 1;
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
} else if (foundKey) {
|
|
531
|
+
braceCount += (lines[i].match(/{/g) || []).length;
|
|
532
|
+
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
533
|
+
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
534
|
+
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
535
|
+
if (braceCount === 0) {
|
|
536
|
+
endLineNumber = i + 1;
|
|
537
|
+
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
startColumn,
|
|
544
|
+
endColumn,
|
|
545
|
+
startLineNumber,
|
|
546
|
+
endLineNumber
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
var replaceOctalEscapeSequences = (str) => {
|
|
550
|
+
const octalRegex = /\\([0-7]{1,3})/g;
|
|
551
|
+
return str.replace(octalRegex, (match, p1) => {
|
|
552
|
+
const octalValue = parseInt(p1, 8);
|
|
553
|
+
const char = String.fromCharCode(octalValue);
|
|
554
|
+
return char;
|
|
555
|
+
});
|
|
556
|
+
};
|
|
557
|
+
var customEncodeURIComponent = (str) => {
|
|
558
|
+
return str.split("").map((char) => {
|
|
559
|
+
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
560
|
+
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
561
|
+
}
|
|
562
|
+
return char;
|
|
563
|
+
}).join("");
|
|
564
|
+
};
|
|
565
|
+
var customDecodeURIComponent = (encodedStr) => {
|
|
566
|
+
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
567
|
+
};
|
|
487
568
|
}
|
|
488
569
|
});
|
|
489
570
|
|
|
490
|
-
//
|
|
571
|
+
// ../../../domql/packages/utils/dist/cjs/object.js
|
|
491
572
|
var require_object = __commonJS({
|
|
492
|
-
"
|
|
573
|
+
"../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
493
574
|
"use strict";
|
|
494
|
-
var
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
var
|
|
575
|
+
var __defProp3 = Object.defineProperty;
|
|
576
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
577
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
578
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
579
|
+
var __export3 = (target, all) => {
|
|
499
580
|
for (var name in all)
|
|
500
|
-
|
|
581
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
501
582
|
};
|
|
502
|
-
var
|
|
583
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
503
584
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
504
|
-
for (let key of
|
|
505
|
-
if (!
|
|
506
|
-
|
|
585
|
+
for (let key of __getOwnPropNames3(from))
|
|
586
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
587
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
507
588
|
}
|
|
508
589
|
return to;
|
|
509
590
|
};
|
|
510
|
-
var
|
|
591
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
511
592
|
var object_exports = {};
|
|
512
|
-
|
|
593
|
+
__export3(object_exports, {
|
|
594
|
+
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
513
595
|
clone: () => clone,
|
|
596
|
+
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
514
597
|
deepClone: () => deepClone2,
|
|
515
598
|
deepCloneExclude: () => deepCloneExclude,
|
|
516
599
|
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
@@ -525,6 +608,8 @@ var require_object = __commonJS({
|
|
|
525
608
|
diffObjects: () => diffObjects,
|
|
526
609
|
exec: () => exec,
|
|
527
610
|
flattenRecursive: () => flattenRecursive,
|
|
611
|
+
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
612
|
+
getExtendsInElement: () => getExtendsInElement,
|
|
528
613
|
hasOwnProperty: () => hasOwnProperty,
|
|
529
614
|
isEmpty: () => isEmpty,
|
|
530
615
|
isEmptyObject: () => isEmptyObject,
|
|
@@ -541,7 +626,7 @@ var require_object = __commonJS({
|
|
|
541
626
|
removeFromObject: () => removeFromObject,
|
|
542
627
|
stringToObject: () => stringToObject
|
|
543
628
|
});
|
|
544
|
-
module2.exports =
|
|
629
|
+
module2.exports = __toCommonJS3(object_exports);
|
|
545
630
|
var import_globals3 = require_globals();
|
|
546
631
|
var import_types = require_types();
|
|
547
632
|
var import_array = require_array();
|
|
@@ -994,38 +1079,92 @@ var require_object = __commonJS({
|
|
|
994
1079
|
}
|
|
995
1080
|
return obj;
|
|
996
1081
|
};
|
|
1082
|
+
var createObjectWithoutPrototype = (obj) => {
|
|
1083
|
+
if (obj === null || typeof obj !== "object") {
|
|
1084
|
+
return obj;
|
|
1085
|
+
}
|
|
1086
|
+
const newObj = /* @__PURE__ */ Object.create(null);
|
|
1087
|
+
for (const key in obj) {
|
|
1088
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1089
|
+
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return newObj;
|
|
1093
|
+
};
|
|
1094
|
+
var checkIfKeyIsComponent = (key) => {
|
|
1095
|
+
const isFirstKeyString = (0, import_types.isString)(key);
|
|
1096
|
+
if (!isFirstKeyString)
|
|
1097
|
+
return;
|
|
1098
|
+
const firstCharKey = key.slice(0, 1);
|
|
1099
|
+
return /^[A-Z]*$/.test(firstCharKey);
|
|
1100
|
+
};
|
|
1101
|
+
var getChildrenComponentsByKey = (key, el) => {
|
|
1102
|
+
if (key === el.key || el.__ref.__componentKey === key) {
|
|
1103
|
+
return el;
|
|
1104
|
+
}
|
|
1105
|
+
if (el.extend) {
|
|
1106
|
+
const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
|
|
1107
|
+
const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
1108
|
+
if (foundString || foundInArray)
|
|
1109
|
+
return el;
|
|
1110
|
+
}
|
|
1111
|
+
};
|
|
1112
|
+
var getExtendsInElement = (obj) => {
|
|
1113
|
+
let result = [];
|
|
1114
|
+
function traverse(o) {
|
|
1115
|
+
for (const key in o) {
|
|
1116
|
+
if (Object.hasOwnProperty.call(o, key)) {
|
|
1117
|
+
if (checkIfKeyIsComponent(key)) {
|
|
1118
|
+
result.push(key);
|
|
1119
|
+
}
|
|
1120
|
+
if (key === "extend") {
|
|
1121
|
+
if (typeof o[key] === "string") {
|
|
1122
|
+
result.push(o[key]);
|
|
1123
|
+
} else if (Array.isArray(o[key])) {
|
|
1124
|
+
result = result.concat(o[key]);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
if (typeof o[key] === "object" && o[key] !== null) {
|
|
1128
|
+
traverse(o[key]);
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
traverse(obj);
|
|
1134
|
+
return result;
|
|
1135
|
+
};
|
|
997
1136
|
}
|
|
998
1137
|
});
|
|
999
1138
|
|
|
1000
|
-
//
|
|
1139
|
+
// ../../../domql/packages/utils/dist/cjs/function.js
|
|
1001
1140
|
var require_function = __commonJS({
|
|
1002
|
-
"
|
|
1141
|
+
"../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
|
|
1003
1142
|
"use strict";
|
|
1004
|
-
var
|
|
1005
|
-
var
|
|
1006
|
-
var
|
|
1007
|
-
var
|
|
1008
|
-
var
|
|
1143
|
+
var __defProp3 = Object.defineProperty;
|
|
1144
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1145
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1146
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1147
|
+
var __export3 = (target, all) => {
|
|
1009
1148
|
for (var name in all)
|
|
1010
|
-
|
|
1149
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1011
1150
|
};
|
|
1012
|
-
var
|
|
1151
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1013
1152
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1014
|
-
for (let key of
|
|
1015
|
-
if (!
|
|
1016
|
-
|
|
1153
|
+
for (let key of __getOwnPropNames3(from))
|
|
1154
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1155
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1017
1156
|
}
|
|
1018
1157
|
return to;
|
|
1019
1158
|
};
|
|
1020
|
-
var
|
|
1159
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1021
1160
|
var function_exports = {};
|
|
1022
|
-
|
|
1161
|
+
__export3(function_exports, {
|
|
1023
1162
|
debounce: () => debounce,
|
|
1024
1163
|
debounceOnContext: () => debounceOnContext,
|
|
1025
1164
|
isStringFunction: () => isStringFunction,
|
|
1026
1165
|
memoize: () => memoize
|
|
1027
1166
|
});
|
|
1028
|
-
module2.exports =
|
|
1167
|
+
module2.exports = __toCommonJS3(function_exports);
|
|
1029
1168
|
function debounce(func, wait, immediate) {
|
|
1030
1169
|
let timeout;
|
|
1031
1170
|
return function() {
|
|
@@ -1072,33 +1211,33 @@ var require_function = __commonJS({
|
|
|
1072
1211
|
}
|
|
1073
1212
|
});
|
|
1074
1213
|
|
|
1075
|
-
//
|
|
1214
|
+
// ../../../domql/packages/utils/dist/cjs/log.js
|
|
1076
1215
|
var require_log = __commonJS({
|
|
1077
|
-
"
|
|
1216
|
+
"../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
1078
1217
|
"use strict";
|
|
1079
|
-
var
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1082
|
-
var
|
|
1083
|
-
var
|
|
1218
|
+
var __defProp3 = Object.defineProperty;
|
|
1219
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1220
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1221
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1222
|
+
var __export3 = (target, all) => {
|
|
1084
1223
|
for (var name in all)
|
|
1085
|
-
|
|
1224
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1086
1225
|
};
|
|
1087
|
-
var
|
|
1226
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1088
1227
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1089
|
-
for (let key of
|
|
1090
|
-
if (!
|
|
1091
|
-
|
|
1228
|
+
for (let key of __getOwnPropNames3(from))
|
|
1229
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1230
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1092
1231
|
}
|
|
1093
1232
|
return to;
|
|
1094
1233
|
};
|
|
1095
|
-
var
|
|
1234
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1096
1235
|
var log_exports = {};
|
|
1097
|
-
|
|
1236
|
+
__export3(log_exports, {
|
|
1098
1237
|
logGroupIf: () => logGroupIf,
|
|
1099
1238
|
logIf: () => logIf
|
|
1100
1239
|
});
|
|
1101
|
-
module2.exports =
|
|
1240
|
+
module2.exports = __toCommonJS3(log_exports);
|
|
1102
1241
|
var logIf = (bool, ...arg) => {
|
|
1103
1242
|
if (bool)
|
|
1104
1243
|
arg.map((v) => console.log(v));
|
|
@@ -1113,50 +1252,50 @@ var require_log = __commonJS({
|
|
|
1113
1252
|
}
|
|
1114
1253
|
});
|
|
1115
1254
|
|
|
1116
|
-
//
|
|
1255
|
+
// ../../../domql/packages/utils/dist/cjs/cookie.js
|
|
1117
1256
|
var require_cookie = __commonJS({
|
|
1118
|
-
"
|
|
1257
|
+
"../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1119
1258
|
"use strict";
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
var
|
|
1123
|
-
var
|
|
1124
|
-
var
|
|
1259
|
+
var __defProp3 = Object.defineProperty;
|
|
1260
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1261
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1262
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1263
|
+
var __export3 = (target, all) => {
|
|
1125
1264
|
for (var name in all)
|
|
1126
|
-
|
|
1265
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1127
1266
|
};
|
|
1128
|
-
var
|
|
1267
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1129
1268
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1130
|
-
for (let key of
|
|
1131
|
-
if (!
|
|
1132
|
-
|
|
1269
|
+
for (let key of __getOwnPropNames3(from))
|
|
1270
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1271
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1133
1272
|
}
|
|
1134
1273
|
return to;
|
|
1135
1274
|
};
|
|
1136
|
-
var
|
|
1275
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1137
1276
|
var cookie_exports = {};
|
|
1138
|
-
|
|
1277
|
+
__export3(cookie_exports, {
|
|
1139
1278
|
getCookie: () => getCookie,
|
|
1140
1279
|
isMobile: () => isMobile,
|
|
1141
1280
|
setCookie: () => setCookie
|
|
1142
1281
|
});
|
|
1143
|
-
module2.exports =
|
|
1282
|
+
module2.exports = __toCommonJS3(cookie_exports);
|
|
1144
1283
|
var import_types = require_types();
|
|
1145
|
-
var
|
|
1284
|
+
var import_utils27 = require_cjs();
|
|
1146
1285
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
1147
1286
|
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
1148
|
-
if ((0, import_types.isUndefined)(
|
|
1287
|
+
if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
|
|
1149
1288
|
return;
|
|
1150
1289
|
const d = /* @__PURE__ */ new Date();
|
|
1151
1290
|
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
1152
1291
|
const expires = `expires=${d.toUTCString()}`;
|
|
1153
|
-
|
|
1292
|
+
import_utils27.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
1154
1293
|
};
|
|
1155
1294
|
var getCookie = (cname) => {
|
|
1156
|
-
if ((0, import_types.isUndefined)(
|
|
1295
|
+
if ((0, import_types.isUndefined)(import_utils27.document) || (0, import_types.isUndefined)(import_utils27.document.cookie))
|
|
1157
1296
|
return;
|
|
1158
1297
|
const name = `${cname}=`;
|
|
1159
|
-
const decodedCookie = decodeURIComponent(
|
|
1298
|
+
const decodedCookie = decodeURIComponent(import_utils27.document.cookie);
|
|
1160
1299
|
const ca = decodedCookie.split(";");
|
|
1161
1300
|
for (let i = 0; i < ca.length; i++) {
|
|
1162
1301
|
let c = ca[i];
|
|
@@ -1170,33 +1309,33 @@ var require_cookie = __commonJS({
|
|
|
1170
1309
|
}
|
|
1171
1310
|
});
|
|
1172
1311
|
|
|
1173
|
-
//
|
|
1312
|
+
// ../../../domql/packages/utils/dist/cjs/tags.js
|
|
1174
1313
|
var require_tags = __commonJS({
|
|
1175
|
-
"
|
|
1314
|
+
"../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1176
1315
|
"use strict";
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1181
|
-
var
|
|
1316
|
+
var __defProp3 = Object.defineProperty;
|
|
1317
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1318
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1319
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1320
|
+
var __export3 = (target, all) => {
|
|
1182
1321
|
for (var name in all)
|
|
1183
|
-
|
|
1322
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1184
1323
|
};
|
|
1185
|
-
var
|
|
1324
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1186
1325
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1187
|
-
for (let key of
|
|
1188
|
-
if (!
|
|
1189
|
-
|
|
1326
|
+
for (let key of __getOwnPropNames3(from))
|
|
1327
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1328
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1190
1329
|
}
|
|
1191
1330
|
return to;
|
|
1192
1331
|
};
|
|
1193
|
-
var
|
|
1332
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1194
1333
|
var tags_exports = {};
|
|
1195
|
-
|
|
1334
|
+
__export3(tags_exports, {
|
|
1196
1335
|
HTML_TAGS: () => HTML_TAGS,
|
|
1197
1336
|
isValidHtmlTag: () => isValidHtmlTag
|
|
1198
1337
|
});
|
|
1199
|
-
module2.exports =
|
|
1338
|
+
module2.exports = __toCommonJS3(tags_exports);
|
|
1200
1339
|
var HTML_TAGS = {
|
|
1201
1340
|
root: [
|
|
1202
1341
|
"body",
|
|
@@ -1338,26 +1477,26 @@ var require_tags = __commonJS({
|
|
|
1338
1477
|
}
|
|
1339
1478
|
});
|
|
1340
1479
|
|
|
1341
|
-
//
|
|
1480
|
+
// ../../../domql/packages/utils/dist/cjs/index.js
|
|
1342
1481
|
var require_cjs = __commonJS({
|
|
1343
|
-
"
|
|
1482
|
+
"../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
|
|
1344
1483
|
"use strict";
|
|
1345
|
-
var
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
1348
|
-
var
|
|
1349
|
-
var
|
|
1484
|
+
var __defProp3 = Object.defineProperty;
|
|
1485
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1486
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1487
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1488
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1350
1489
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1351
|
-
for (let key of
|
|
1352
|
-
if (!
|
|
1353
|
-
|
|
1490
|
+
for (let key of __getOwnPropNames3(from))
|
|
1491
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1492
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1354
1493
|
}
|
|
1355
1494
|
return to;
|
|
1356
1495
|
};
|
|
1357
|
-
var __reExport = (target, mod, secondTarget) => (
|
|
1358
|
-
var
|
|
1496
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps3(target, mod, "default"), secondTarget && __copyProps3(secondTarget, mod, "default"));
|
|
1497
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1359
1498
|
var utils_exports = {};
|
|
1360
|
-
module2.exports =
|
|
1499
|
+
module2.exports = __toCommonJS3(utils_exports);
|
|
1361
1500
|
__reExport(utils_exports, require_key(), module2.exports);
|
|
1362
1501
|
__reExport(utils_exports, require_env(), module2.exports);
|
|
1363
1502
|
__reExport(utils_exports, require_types(), module2.exports);
|
|
@@ -1377,31 +1516,31 @@ var require_cjs = __commonJS({
|
|
|
1377
1516
|
var require_cjs2 = __commonJS({
|
|
1378
1517
|
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
1379
1518
|
"use strict";
|
|
1380
|
-
var
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1383
|
-
var
|
|
1384
|
-
var
|
|
1519
|
+
var __defProp3 = Object.defineProperty;
|
|
1520
|
+
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
1521
|
+
var __getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
1522
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
1523
|
+
var __export3 = (target, all) => {
|
|
1385
1524
|
for (var name in all)
|
|
1386
|
-
|
|
1525
|
+
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
1387
1526
|
};
|
|
1388
|
-
var
|
|
1527
|
+
var __copyProps3 = (to, from, except, desc) => {
|
|
1389
1528
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
1390
|
-
for (let key of
|
|
1391
|
-
if (!
|
|
1392
|
-
|
|
1529
|
+
for (let key of __getOwnPropNames3(from))
|
|
1530
|
+
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
1531
|
+
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
1393
1532
|
}
|
|
1394
1533
|
return to;
|
|
1395
1534
|
};
|
|
1396
|
-
var
|
|
1535
|
+
var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
1397
1536
|
var globals_exports = {};
|
|
1398
|
-
|
|
1537
|
+
__export3(globals_exports, {
|
|
1399
1538
|
document: () => document4,
|
|
1400
1539
|
global: () => global,
|
|
1401
1540
|
self: () => self,
|
|
1402
1541
|
window: () => window2
|
|
1403
1542
|
});
|
|
1404
|
-
module2.exports =
|
|
1543
|
+
module2.exports = __toCommonJS3(globals_exports);
|
|
1405
1544
|
var global = globalThis;
|
|
1406
1545
|
var self = globalThis;
|
|
1407
1546
|
var window2 = globalThis;
|
|
@@ -1409,1492 +1548,6 @@ var require_cjs2 = __commonJS({
|
|
|
1409
1548
|
}
|
|
1410
1549
|
});
|
|
1411
1550
|
|
|
1412
|
-
// ../../node_modules/@symbo.ls/utils/dist/cjs/index.js
|
|
1413
|
-
var require_cjs3 = __commonJS({
|
|
1414
|
-
"../../node_modules/@symbo.ls/utils/dist/cjs/index.js"(exports, module2) {
|
|
1415
|
-
"use strict";
|
|
1416
|
-
var __create2 = Object.create;
|
|
1417
|
-
var __defProp2 = Object.defineProperty;
|
|
1418
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1419
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1420
|
-
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1421
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1422
|
-
var __commonJS2 = (cb, mod) => function __require() {
|
|
1423
|
-
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1424
|
-
};
|
|
1425
|
-
var __export2 = (target, all) => {
|
|
1426
|
-
for (var name in all)
|
|
1427
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1428
|
-
};
|
|
1429
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
1430
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1431
|
-
for (let key of __getOwnPropNames2(from))
|
|
1432
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1433
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1434
|
-
}
|
|
1435
|
-
return to;
|
|
1436
|
-
};
|
|
1437
|
-
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1438
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1439
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1440
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1441
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1442
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1443
|
-
mod
|
|
1444
|
-
));
|
|
1445
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1446
|
-
var require_key2 = __commonJS2({
|
|
1447
|
-
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1448
|
-
"use strict";
|
|
1449
|
-
var __defProp22 = Object.defineProperty;
|
|
1450
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1451
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1452
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1453
|
-
var __export22 = (target, all) => {
|
|
1454
|
-
for (var name in all)
|
|
1455
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1456
|
-
};
|
|
1457
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1458
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1459
|
-
for (let key of __getOwnPropNames22(from))
|
|
1460
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1461
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1462
|
-
}
|
|
1463
|
-
return to;
|
|
1464
|
-
};
|
|
1465
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1466
|
-
var key_exports = {};
|
|
1467
|
-
__export22(key_exports, {
|
|
1468
|
-
createSnapshotId: () => createSnapshotId,
|
|
1469
|
-
generateKey: () => generateKey
|
|
1470
|
-
});
|
|
1471
|
-
module22.exports = __toCommonJS22(key_exports);
|
|
1472
|
-
var generateKey = /* @__PURE__ */ function() {
|
|
1473
|
-
let index = 0;
|
|
1474
|
-
function newId() {
|
|
1475
|
-
index++;
|
|
1476
|
-
return index;
|
|
1477
|
-
}
|
|
1478
|
-
return newId;
|
|
1479
|
-
}();
|
|
1480
|
-
var createSnapshotId = generateKey;
|
|
1481
|
-
}
|
|
1482
|
-
});
|
|
1483
|
-
var require_env2 = __commonJS2({
|
|
1484
|
-
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
1485
|
-
"use strict";
|
|
1486
|
-
var __defProp22 = Object.defineProperty;
|
|
1487
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1488
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1489
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1490
|
-
var __export22 = (target, all) => {
|
|
1491
|
-
for (var name in all)
|
|
1492
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1493
|
-
};
|
|
1494
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1495
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1496
|
-
for (let key of __getOwnPropNames22(from))
|
|
1497
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1498
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1499
|
-
}
|
|
1500
|
-
return to;
|
|
1501
|
-
};
|
|
1502
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1503
|
-
var env_exports = {};
|
|
1504
|
-
__export22(env_exports, {
|
|
1505
|
-
NODE_ENV: () => NODE_ENV,
|
|
1506
|
-
getNev: () => getNev,
|
|
1507
|
-
isDevelopment: () => isDevelopment,
|
|
1508
|
-
isProduction: () => isProduction,
|
|
1509
|
-
isTest: () => isTest
|
|
1510
|
-
});
|
|
1511
|
-
module22.exports = __toCommonJS22(env_exports);
|
|
1512
|
-
var NODE_ENV = "development";
|
|
1513
|
-
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
1514
|
-
var isTest = (env = NODE_ENV) => env === "test";
|
|
1515
|
-
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
1516
|
-
var getNev = (key, env = NODE_ENV) => env[key];
|
|
1517
|
-
}
|
|
1518
|
-
});
|
|
1519
|
-
var require_globals2 = __commonJS2({
|
|
1520
|
-
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
1521
|
-
"use strict";
|
|
1522
|
-
var __defProp22 = Object.defineProperty;
|
|
1523
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1524
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1525
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1526
|
-
var __export22 = (target, all) => {
|
|
1527
|
-
for (var name in all)
|
|
1528
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1529
|
-
};
|
|
1530
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1531
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1532
|
-
for (let key of __getOwnPropNames22(from))
|
|
1533
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1534
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1535
|
-
}
|
|
1536
|
-
return to;
|
|
1537
|
-
};
|
|
1538
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1539
|
-
var globals_exports = {};
|
|
1540
|
-
__export22(globals_exports, {
|
|
1541
|
-
document: () => document22,
|
|
1542
|
-
global: () => global,
|
|
1543
|
-
self: () => self,
|
|
1544
|
-
window: () => window2
|
|
1545
|
-
});
|
|
1546
|
-
module22.exports = __toCommonJS22(globals_exports);
|
|
1547
|
-
var global = globalThis;
|
|
1548
|
-
var self = globalThis;
|
|
1549
|
-
var window2 = globalThis;
|
|
1550
|
-
var document22 = window2.document;
|
|
1551
|
-
}
|
|
1552
|
-
});
|
|
1553
|
-
var require_node2 = __commonJS2({
|
|
1554
|
-
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
1555
|
-
"use strict";
|
|
1556
|
-
var __defProp22 = Object.defineProperty;
|
|
1557
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1558
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1559
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1560
|
-
var __export22 = (target, all) => {
|
|
1561
|
-
for (var name in all)
|
|
1562
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1563
|
-
};
|
|
1564
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1565
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1566
|
-
for (let key of __getOwnPropNames22(from))
|
|
1567
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1568
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1569
|
-
}
|
|
1570
|
-
return to;
|
|
1571
|
-
};
|
|
1572
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1573
|
-
var node_exports = {};
|
|
1574
|
-
__export22(node_exports, {
|
|
1575
|
-
isHtmlElement: () => isHtmlElement,
|
|
1576
|
-
isNode: () => isNode
|
|
1577
|
-
});
|
|
1578
|
-
module22.exports = __toCommonJS22(node_exports);
|
|
1579
|
-
var import_globals3 = require_globals2();
|
|
1580
|
-
var isNode = (obj) => {
|
|
1581
|
-
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
1582
|
-
};
|
|
1583
|
-
var isHtmlElement = (obj) => {
|
|
1584
|
-
return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
1585
|
-
};
|
|
1586
|
-
}
|
|
1587
|
-
});
|
|
1588
|
-
var require_types2 = __commonJS2({
|
|
1589
|
-
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
1590
|
-
"use strict";
|
|
1591
|
-
var __defProp22 = Object.defineProperty;
|
|
1592
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1593
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1594
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1595
|
-
var __export22 = (target, all) => {
|
|
1596
|
-
for (var name in all)
|
|
1597
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1598
|
-
};
|
|
1599
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1600
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1601
|
-
for (let key of __getOwnPropNames22(from))
|
|
1602
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1603
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1604
|
-
}
|
|
1605
|
-
return to;
|
|
1606
|
-
};
|
|
1607
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1608
|
-
var types_exports = {};
|
|
1609
|
-
__export22(types_exports, {
|
|
1610
|
-
TYPES: () => TYPES,
|
|
1611
|
-
is: () => is,
|
|
1612
|
-
isArray: () => isArray32,
|
|
1613
|
-
isBoolean: () => isBoolean,
|
|
1614
|
-
isDate: () => isDate,
|
|
1615
|
-
isDefined: () => isDefined2,
|
|
1616
|
-
isFunction: () => isFunction,
|
|
1617
|
-
isNot: () => isNot,
|
|
1618
|
-
isNull: () => isNull,
|
|
1619
|
-
isNumber: () => isNumber2,
|
|
1620
|
-
isObject: () => isObject32,
|
|
1621
|
-
isObjectLike: () => isObjectLike3,
|
|
1622
|
-
isString: () => isString22,
|
|
1623
|
-
isUndefined: () => isUndefined
|
|
1624
|
-
});
|
|
1625
|
-
module22.exports = __toCommonJS22(types_exports);
|
|
1626
|
-
var import_node = require_node2();
|
|
1627
|
-
var isObject32 = (arg) => {
|
|
1628
|
-
if (arg === null)
|
|
1629
|
-
return false;
|
|
1630
|
-
return typeof arg === "object" && arg.constructor === Object;
|
|
1631
|
-
};
|
|
1632
|
-
var isString22 = (arg) => typeof arg === "string";
|
|
1633
|
-
var isNumber2 = (arg) => typeof arg === "number";
|
|
1634
|
-
var isFunction = (arg) => typeof arg === "function";
|
|
1635
|
-
var isBoolean = (arg) => arg === true || arg === false;
|
|
1636
|
-
var isNull = (arg) => arg === null;
|
|
1637
|
-
var isArray32 = (arg) => Array.isArray(arg);
|
|
1638
|
-
var isDate = (d) => d instanceof Date;
|
|
1639
|
-
var isObjectLike3 = (arg) => {
|
|
1640
|
-
if (arg === null)
|
|
1641
|
-
return false;
|
|
1642
|
-
return typeof arg === "object";
|
|
1643
|
-
};
|
|
1644
|
-
var isDefined2 = (arg) => {
|
|
1645
|
-
return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
1646
|
-
};
|
|
1647
|
-
var isUndefined = (arg) => {
|
|
1648
|
-
return arg === void 0;
|
|
1649
|
-
};
|
|
1650
|
-
var TYPES = {
|
|
1651
|
-
boolean: isBoolean,
|
|
1652
|
-
array: isArray32,
|
|
1653
|
-
object: isObject32,
|
|
1654
|
-
string: isString22,
|
|
1655
|
-
date: isDate,
|
|
1656
|
-
number: isNumber2,
|
|
1657
|
-
null: isNull,
|
|
1658
|
-
function: isFunction,
|
|
1659
|
-
objectLike: isObjectLike3,
|
|
1660
|
-
node: import_node.isNode,
|
|
1661
|
-
htmlElement: import_node.isHtmlElement,
|
|
1662
|
-
defined: isDefined2
|
|
1663
|
-
};
|
|
1664
|
-
var is = (arg) => {
|
|
1665
|
-
return (...args) => {
|
|
1666
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
1667
|
-
};
|
|
1668
|
-
};
|
|
1669
|
-
var isNot = (arg) => {
|
|
1670
|
-
return (...args) => {
|
|
1671
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
1672
|
-
};
|
|
1673
|
-
};
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
var require_array2 = __commonJS2({
|
|
1677
|
-
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
|
|
1678
|
-
"use strict";
|
|
1679
|
-
var __defProp22 = Object.defineProperty;
|
|
1680
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1681
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1682
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1683
|
-
var __export22 = (target, all) => {
|
|
1684
|
-
for (var name in all)
|
|
1685
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1686
|
-
};
|
|
1687
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1688
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1689
|
-
for (let key of __getOwnPropNames22(from))
|
|
1690
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1691
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1692
|
-
}
|
|
1693
|
-
return to;
|
|
1694
|
-
};
|
|
1695
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1696
|
-
var array_exports = {};
|
|
1697
|
-
__export22(array_exports, {
|
|
1698
|
-
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
1699
|
-
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1700
|
-
createNestedObject: () => createNestedObject,
|
|
1701
|
-
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
1702
|
-
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
1703
|
-
getFrequencyInArray: () => getFrequencyInArray,
|
|
1704
|
-
joinArrays: () => joinArrays,
|
|
1705
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
1706
|
-
mergeArray: () => mergeArray,
|
|
1707
|
-
removeFromArray: () => removeFromArray,
|
|
1708
|
-
removeValueFromArray: () => removeValueFromArray,
|
|
1709
|
-
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1710
|
-
reorderArrayByValues: () => reorderArrayByValues,
|
|
1711
|
-
swapItemsInArray: () => swapItemsInArray
|
|
1712
|
-
});
|
|
1713
|
-
module22.exports = __toCommonJS22(array_exports);
|
|
1714
|
-
var import_object = require_object2();
|
|
1715
|
-
var import_types = require_types2();
|
|
1716
|
-
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
1717
|
-
return arr2.every((val) => arr1.includes(val));
|
|
1718
|
-
};
|
|
1719
|
-
var getFrequencyInArray = (arr, value) => {
|
|
1720
|
-
return arr.reduce((count, currentValue) => {
|
|
1721
|
-
return currentValue === value ? count + 1 : count;
|
|
1722
|
-
}, 0);
|
|
1723
|
-
};
|
|
1724
|
-
var removeFromArray = (arr, index) => {
|
|
1725
|
-
if ((0, import_types.isString)(index))
|
|
1726
|
-
index = parseInt(index);
|
|
1727
|
-
if ((0, import_types.isNumber)(index)) {
|
|
1728
|
-
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
1729
|
-
throw new Error("Invalid index");
|
|
1730
|
-
}
|
|
1731
|
-
arr.splice(index, 1);
|
|
1732
|
-
} else if ((0, import_types.isArray)(index)) {
|
|
1733
|
-
index.forEach((idx) => removeFromArray(arr, idx));
|
|
1734
|
-
} else {
|
|
1735
|
-
throw new Error("Invalid index");
|
|
1736
|
-
}
|
|
1737
|
-
return arr;
|
|
1738
|
-
};
|
|
1739
|
-
var swapItemsInArray = (arr, i, j) => {
|
|
1740
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1741
|
-
};
|
|
1742
|
-
var joinArrays = (...arrays) => {
|
|
1743
|
-
return [].concat(...arrays);
|
|
1744
|
-
};
|
|
1745
|
-
var mergeArray = (arr, excludeFrom = []) => {
|
|
1746
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
1747
|
-
};
|
|
1748
|
-
var mergeAndCloneIfArray = (obj) => {
|
|
1749
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
1750
|
-
};
|
|
1751
|
-
var cutArrayBeforeValue = (arr, value) => {
|
|
1752
|
-
const index = arr.indexOf(value);
|
|
1753
|
-
if (index !== -1) {
|
|
1754
|
-
return arr.slice(0, index);
|
|
1755
|
-
}
|
|
1756
|
-
return arr;
|
|
1757
|
-
};
|
|
1758
|
-
var cutArrayAfterValue = (arr, value) => {
|
|
1759
|
-
if (!(0, import_types.isArray)(arr))
|
|
1760
|
-
return;
|
|
1761
|
-
const index = arr.indexOf(value);
|
|
1762
|
-
if (index !== -1) {
|
|
1763
|
-
return arr.slice(index + 1);
|
|
1764
|
-
}
|
|
1765
|
-
return arr;
|
|
1766
|
-
};
|
|
1767
|
-
var createNestedObject = (arr, lastValue) => {
|
|
1768
|
-
const nestedObject = {};
|
|
1769
|
-
if (arr.length === 0) {
|
|
1770
|
-
return lastValue;
|
|
1771
|
-
}
|
|
1772
|
-
arr.reduce((obj, value, index) => {
|
|
1773
|
-
if (!obj[value]) {
|
|
1774
|
-
obj[value] = {};
|
|
1775
|
-
}
|
|
1776
|
-
if (index === arr.length - 1 && lastValue) {
|
|
1777
|
-
obj[value] = lastValue;
|
|
1778
|
-
}
|
|
1779
|
-
return obj[value];
|
|
1780
|
-
}, nestedObject);
|
|
1781
|
-
return nestedObject;
|
|
1782
|
-
};
|
|
1783
|
-
var removeValueFromArray = (arr, value) => {
|
|
1784
|
-
const index = arr.indexOf(value);
|
|
1785
|
-
if (index > -1) {
|
|
1786
|
-
const newArray = [...arr];
|
|
1787
|
-
newArray.splice(index, 1);
|
|
1788
|
-
return newArray;
|
|
1789
|
-
}
|
|
1790
|
-
return arr;
|
|
1791
|
-
};
|
|
1792
|
-
var removeValueFromArrayAll = (arr, value) => {
|
|
1793
|
-
return arr.filter((item) => item !== value);
|
|
1794
|
-
};
|
|
1795
|
-
var addItemAfterEveryElement = (array, item) => {
|
|
1796
|
-
const result = [];
|
|
1797
|
-
for (let i = 0; i < array.length; i++) {
|
|
1798
|
-
result.push(array[i]);
|
|
1799
|
-
if (i < array.length - 1) {
|
|
1800
|
-
result.push(item);
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
return result;
|
|
1804
|
-
};
|
|
1805
|
-
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
1806
|
-
const newArray = [...array];
|
|
1807
|
-
const indexToMove = newArray.indexOf(valueToMove);
|
|
1808
|
-
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
1809
|
-
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
1810
|
-
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
1811
|
-
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
1812
|
-
newArray.splice(insertIndex, 0, removedItem);
|
|
1813
|
-
}
|
|
1814
|
-
return newArray;
|
|
1815
|
-
};
|
|
1816
|
-
}
|
|
1817
|
-
});
|
|
1818
|
-
var require_string2 = __commonJS2({
|
|
1819
|
-
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
1820
|
-
"use strict";
|
|
1821
|
-
var __defProp22 = Object.defineProperty;
|
|
1822
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1823
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1824
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1825
|
-
var __export22 = (target, all) => {
|
|
1826
|
-
for (var name in all)
|
|
1827
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1828
|
-
};
|
|
1829
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1830
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1831
|
-
for (let key of __getOwnPropNames22(from))
|
|
1832
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1833
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1834
|
-
}
|
|
1835
|
-
return to;
|
|
1836
|
-
};
|
|
1837
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1838
|
-
var string_exports = {};
|
|
1839
|
-
__export22(string_exports, {
|
|
1840
|
-
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
1841
|
-
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
1842
|
-
stringIncludesAny: () => stringIncludesAny,
|
|
1843
|
-
trimStringFromSymbols: () => trimStringFromSymbols
|
|
1844
|
-
});
|
|
1845
|
-
module22.exports = __toCommonJS22(string_exports);
|
|
1846
|
-
var stringIncludesAny = (str, characters) => {
|
|
1847
|
-
for (const char of characters) {
|
|
1848
|
-
if (str.includes(char)) {
|
|
1849
|
-
return true;
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
return false;
|
|
1853
|
-
};
|
|
1854
|
-
var trimStringFromSymbols = (str, characters) => {
|
|
1855
|
-
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
1856
|
-
return str.replace(pattern, "");
|
|
1857
|
-
};
|
|
1858
|
-
var brackRegex = {
|
|
1859
|
-
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
1860
|
-
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
1861
|
-
};
|
|
1862
|
-
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
1863
|
-
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
1864
|
-
return str;
|
|
1865
|
-
const reg = brackRegex[options.bracketsLength || 2];
|
|
1866
|
-
return str.replace(reg, (_, parentPath, variable) => {
|
|
1867
|
-
if (parentPath) {
|
|
1868
|
-
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
1869
|
-
let parentState = state;
|
|
1870
|
-
for (let i = 0; i < parentLevels; i++) {
|
|
1871
|
-
parentState = parentState.parent;
|
|
1872
|
-
if (!parentState) {
|
|
1873
|
-
return "";
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
const value = parentState[variable.trim()];
|
|
1877
|
-
return value !== void 0 ? `${value}` : "";
|
|
1878
|
-
} else {
|
|
1879
|
-
const value = state[variable.trim()];
|
|
1880
|
-
return value !== void 0 ? `${value}` : "";
|
|
1881
|
-
}
|
|
1882
|
-
});
|
|
1883
|
-
};
|
|
1884
|
-
var lowercaseFirstLetter = (inputString) => {
|
|
1885
|
-
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
1886
|
-
};
|
|
1887
|
-
}
|
|
1888
|
-
});
|
|
1889
|
-
var require_object2 = __commonJS2({
|
|
1890
|
-
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
1891
|
-
"use strict";
|
|
1892
|
-
var __defProp22 = Object.defineProperty;
|
|
1893
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1894
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1895
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1896
|
-
var __export22 = (target, all) => {
|
|
1897
|
-
for (var name in all)
|
|
1898
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1899
|
-
};
|
|
1900
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
1901
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1902
|
-
for (let key of __getOwnPropNames22(from))
|
|
1903
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1904
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1905
|
-
}
|
|
1906
|
-
return to;
|
|
1907
|
-
};
|
|
1908
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1909
|
-
var object_exports = {};
|
|
1910
|
-
__export22(object_exports, {
|
|
1911
|
-
clone: () => clone,
|
|
1912
|
-
deepClone: () => deepClone2,
|
|
1913
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
1914
|
-
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
1915
|
-
deepContains: () => deepContains,
|
|
1916
|
-
deepDestringify: () => deepDestringify,
|
|
1917
|
-
deepDiff: () => deepDiff,
|
|
1918
|
-
deepMerge: () => deepMerge3,
|
|
1919
|
-
deepStringify: () => deepStringify,
|
|
1920
|
-
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
1921
|
-
diff: () => diff,
|
|
1922
|
-
diffArrays: () => diffArrays,
|
|
1923
|
-
diffObjects: () => diffObjects,
|
|
1924
|
-
exec: () => exec,
|
|
1925
|
-
flattenRecursive: () => flattenRecursive,
|
|
1926
|
-
hasOwnProperty: () => hasOwnProperty,
|
|
1927
|
-
isEmpty: () => isEmpty,
|
|
1928
|
-
isEmptyObject: () => isEmptyObject,
|
|
1929
|
-
isEqualDeep: () => isEqualDeep,
|
|
1930
|
-
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
1931
|
-
map: () => map,
|
|
1932
|
-
merge: () => merge5,
|
|
1933
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
1934
|
-
mergeIfExisted: () => mergeIfExisted,
|
|
1935
|
-
objectToString: () => objectToString,
|
|
1936
|
-
overwrite: () => overwrite,
|
|
1937
|
-
overwriteDeep: () => overwriteDeep2,
|
|
1938
|
-
overwriteShallow: () => overwriteShallow,
|
|
1939
|
-
removeFromObject: () => removeFromObject,
|
|
1940
|
-
stringToObject: () => stringToObject
|
|
1941
|
-
});
|
|
1942
|
-
module22.exports = __toCommonJS22(object_exports);
|
|
1943
|
-
var import_globals3 = require_globals2();
|
|
1944
|
-
var import_types = require_types2();
|
|
1945
|
-
var import_array = require_array2();
|
|
1946
|
-
var import_string = require_string2();
|
|
1947
|
-
var exec = (param, element, state, context) => {
|
|
1948
|
-
if ((0, import_types.isFunction)(param)) {
|
|
1949
|
-
return param(
|
|
1950
|
-
element,
|
|
1951
|
-
state || element.state,
|
|
1952
|
-
context || element.context
|
|
1953
|
-
);
|
|
1954
|
-
}
|
|
1955
|
-
return param;
|
|
1956
|
-
};
|
|
1957
|
-
var map = (obj, extention, element) => {
|
|
1958
|
-
for (const e in extention) {
|
|
1959
|
-
obj[e] = exec(extention[e], element);
|
|
1960
|
-
}
|
|
1961
|
-
};
|
|
1962
|
-
var merge5 = (element, obj, excludeFrom = []) => {
|
|
1963
|
-
for (const e in obj) {
|
|
1964
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
1965
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1966
|
-
continue;
|
|
1967
|
-
const elementProp = element[e];
|
|
1968
|
-
const objProp = obj[e];
|
|
1969
|
-
if (elementProp === void 0) {
|
|
1970
|
-
element[e] = objProp;
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
return element;
|
|
1974
|
-
};
|
|
1975
|
-
var deepMerge3 = (element, extend, excludeFrom = []) => {
|
|
1976
|
-
for (const e in extend) {
|
|
1977
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
1978
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1979
|
-
continue;
|
|
1980
|
-
const elementProp = element[e];
|
|
1981
|
-
const extendProp = extend[e];
|
|
1982
|
-
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
1983
|
-
deepMerge3(elementProp, extendProp, excludeFrom);
|
|
1984
|
-
} else if (elementProp === void 0) {
|
|
1985
|
-
element[e] = extendProp;
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
return element;
|
|
1989
|
-
};
|
|
1990
|
-
var clone = (obj, excludeFrom = []) => {
|
|
1991
|
-
const o = {};
|
|
1992
|
-
for (const prop in obj) {
|
|
1993
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1994
|
-
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1995
|
-
continue;
|
|
1996
|
-
o[prop] = obj[prop];
|
|
1997
|
-
}
|
|
1998
|
-
return o;
|
|
1999
|
-
};
|
|
2000
|
-
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
2001
|
-
if ((0, import_types.isArray)(obj)) {
|
|
2002
|
-
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2003
|
-
}
|
|
2004
|
-
const o = {};
|
|
2005
|
-
for (const k in obj) {
|
|
2006
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2007
|
-
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2008
|
-
continue;
|
|
2009
|
-
let v = obj[k];
|
|
2010
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2011
|
-
v = mergeArrayExclude(v, excludeFrom);
|
|
2012
|
-
}
|
|
2013
|
-
if ((0, import_types.isArray)(v)) {
|
|
2014
|
-
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2015
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
2016
|
-
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2017
|
-
} else
|
|
2018
|
-
o[k] = v;
|
|
2019
|
-
}
|
|
2020
|
-
return o;
|
|
2021
|
-
};
|
|
2022
|
-
var mergeArrayExclude = (arr, excl = []) => {
|
|
2023
|
-
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
2024
|
-
};
|
|
2025
|
-
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
2026
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2027
|
-
for (const prop in obj) {
|
|
2028
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2029
|
-
continue;
|
|
2030
|
-
if (prop === "__proto__")
|
|
2031
|
-
continue;
|
|
2032
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2033
|
-
continue;
|
|
2034
|
-
let objProp = obj[prop];
|
|
2035
|
-
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
2036
|
-
continue;
|
|
2037
|
-
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
2038
|
-
objProp = (0, import_array.mergeArray)(objProp);
|
|
2039
|
-
}
|
|
2040
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2041
|
-
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
2042
|
-
} else
|
|
2043
|
-
o[prop] = objProp;
|
|
2044
|
-
}
|
|
2045
|
-
return o;
|
|
2046
|
-
};
|
|
2047
|
-
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2048
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2049
|
-
for (const prop in obj) {
|
|
2050
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2051
|
-
continue;
|
|
2052
|
-
const objProp = obj[prop];
|
|
2053
|
-
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2054
|
-
continue;
|
|
2055
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2056
|
-
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2057
|
-
} else
|
|
2058
|
-
o[prop] = objProp;
|
|
2059
|
-
}
|
|
2060
|
-
return o;
|
|
2061
|
-
};
|
|
2062
|
-
var deepStringify = (obj, stringified = {}) => {
|
|
2063
|
-
for (const prop in obj) {
|
|
2064
|
-
const objProp = obj[prop];
|
|
2065
|
-
if ((0, import_types.isFunction)(objProp)) {
|
|
2066
|
-
stringified[prop] = objProp.toString();
|
|
2067
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2068
|
-
stringified[prop] = {};
|
|
2069
|
-
deepStringify(objProp, stringified[prop]);
|
|
2070
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2071
|
-
stringified[prop] = [];
|
|
2072
|
-
objProp.forEach((v, i) => {
|
|
2073
|
-
if ((0, import_types.isObject)(v)) {
|
|
2074
|
-
stringified[prop][i] = {};
|
|
2075
|
-
deepStringify(v, stringified[prop][i]);
|
|
2076
|
-
} else if ((0, import_types.isFunction)(v)) {
|
|
2077
|
-
stringified[prop][i] = v.toString();
|
|
2078
|
-
} else {
|
|
2079
|
-
stringified[prop][i] = v;
|
|
2080
|
-
}
|
|
2081
|
-
});
|
|
2082
|
-
} else {
|
|
2083
|
-
stringified[prop] = objProp;
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
return stringified;
|
|
2087
|
-
};
|
|
2088
|
-
var objectToString = (obj = {}, indent = 0) => {
|
|
2089
|
-
const spaces = " ".repeat(indent);
|
|
2090
|
-
let str = "{\n";
|
|
2091
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
2092
|
-
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2093
|
-
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2094
|
-
str += `${spaces} ${stringedKey}: `;
|
|
2095
|
-
if ((0, import_types.isArray)(value)) {
|
|
2096
|
-
str += "[\n";
|
|
2097
|
-
for (const element of value) {
|
|
2098
|
-
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2099
|
-
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2100
|
-
`;
|
|
2101
|
-
} else if ((0, import_types.isString)(element)) {
|
|
2102
|
-
str += `${spaces} '${element}',
|
|
2103
|
-
`;
|
|
2104
|
-
} else {
|
|
2105
|
-
str += `${spaces} ${element},
|
|
2106
|
-
`;
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
str += `${spaces} ]`;
|
|
2110
|
-
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2111
|
-
str += objectToString(value, indent + 1);
|
|
2112
|
-
} else if ((0, import_types.isString)(value)) {
|
|
2113
|
-
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2114
|
-
} else {
|
|
2115
|
-
str += value;
|
|
2116
|
-
}
|
|
2117
|
-
str += ",\n";
|
|
2118
|
-
}
|
|
2119
|
-
str += `${spaces}}`;
|
|
2120
|
-
return str;
|
|
2121
|
-
};
|
|
2122
|
-
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2123
|
-
for (const prop in obj) {
|
|
2124
|
-
const objProp = obj[prop];
|
|
2125
|
-
if ((0, import_types.isFunction)(objProp))
|
|
2126
|
-
continue;
|
|
2127
|
-
else if ((0, import_types.isObject)(objProp)) {
|
|
2128
|
-
detached[prop] = {};
|
|
2129
|
-
deepStringify(objProp, detached[prop]);
|
|
2130
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2131
|
-
detached[prop] = [];
|
|
2132
|
-
objProp.forEach((v, i) => {
|
|
2133
|
-
if ((0, import_types.isFunction)(v))
|
|
2134
|
-
return;
|
|
2135
|
-
if ((0, import_types.isObject)(v)) {
|
|
2136
|
-
detached[prop][i] = {};
|
|
2137
|
-
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2138
|
-
} else {
|
|
2139
|
-
detached[prop][i] = v;
|
|
2140
|
-
}
|
|
2141
|
-
});
|
|
2142
|
-
} else {
|
|
2143
|
-
detached[prop] = objProp;
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
return detached;
|
|
2147
|
-
};
|
|
2148
|
-
var deepDestringify = (obj, destringified = {}) => {
|
|
2149
|
-
for (const prop in obj) {
|
|
2150
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2151
|
-
if (!hasOwnProperty2)
|
|
2152
|
-
continue;
|
|
2153
|
-
const objProp = obj[prop];
|
|
2154
|
-
if ((0, import_types.isString)(objProp)) {
|
|
2155
|
-
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2156
|
-
try {
|
|
2157
|
-
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2158
|
-
destringified[prop] = evalProp;
|
|
2159
|
-
} catch (e) {
|
|
2160
|
-
if (e)
|
|
2161
|
-
destringified[prop] = objProp;
|
|
2162
|
-
}
|
|
2163
|
-
} else {
|
|
2164
|
-
destringified[prop] = objProp;
|
|
2165
|
-
}
|
|
2166
|
-
} else if ((0, import_types.isArray)(objProp)) {
|
|
2167
|
-
destringified[prop] = [];
|
|
2168
|
-
objProp.forEach((arrProp) => {
|
|
2169
|
-
if ((0, import_types.isString)(arrProp)) {
|
|
2170
|
-
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2171
|
-
try {
|
|
2172
|
-
const evalProp = import_globals3.window.eval(`(${arrProp})`);
|
|
2173
|
-
destringified[prop].push(evalProp);
|
|
2174
|
-
} catch (e) {
|
|
2175
|
-
if (e)
|
|
2176
|
-
destringified[prop].push(arrProp);
|
|
2177
|
-
}
|
|
2178
|
-
} else {
|
|
2179
|
-
destringified[prop].push(arrProp);
|
|
2180
|
-
}
|
|
2181
|
-
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2182
|
-
destringified[prop].push(deepDestringify(arrProp));
|
|
2183
|
-
} else {
|
|
2184
|
-
destringified[prop].push(arrProp);
|
|
2185
|
-
}
|
|
2186
|
-
});
|
|
2187
|
-
} else if ((0, import_types.isObject)(objProp)) {
|
|
2188
|
-
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2189
|
-
} else {
|
|
2190
|
-
destringified[prop] = objProp;
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
return destringified;
|
|
2194
|
-
};
|
|
2195
|
-
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2196
|
-
try {
|
|
2197
|
-
return import_globals3.window.eval("(" + str + ")");
|
|
2198
|
-
} catch (e) {
|
|
2199
|
-
if (opts.verbose)
|
|
2200
|
-
console.warn(e);
|
|
2201
|
-
}
|
|
2202
|
-
};
|
|
2203
|
-
var diffObjects = (original, objToDiff, cache) => {
|
|
2204
|
-
for (const e in objToDiff) {
|
|
2205
|
-
if (e === "ref")
|
|
2206
|
-
continue;
|
|
2207
|
-
const originalProp = original[e];
|
|
2208
|
-
const objToDiffProp = objToDiff[e];
|
|
2209
|
-
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2210
|
-
cache[e] = {};
|
|
2211
|
-
diff(originalProp, objToDiffProp, cache[e]);
|
|
2212
|
-
} else if (objToDiffProp !== void 0) {
|
|
2213
|
-
cache[e] = objToDiffProp;
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
return cache;
|
|
2217
|
-
};
|
|
2218
|
-
var diffArrays = (original, objToDiff, cache) => {
|
|
2219
|
-
if (original.length !== objToDiff.length) {
|
|
2220
|
-
cache = objToDiff;
|
|
2221
|
-
} else {
|
|
2222
|
-
const diffArr = [];
|
|
2223
|
-
for (let i = 0; i < original.length; i++) {
|
|
2224
|
-
const diffObj = diff(original[i], objToDiff[i]);
|
|
2225
|
-
if (Object.keys(diffObj).length > 0) {
|
|
2226
|
-
diffArr.push(diffObj);
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
if (diffArr.length > 0) {
|
|
2230
|
-
cache = diffArr;
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
return cache;
|
|
2234
|
-
};
|
|
2235
|
-
var diff = (original, objToDiff, cache = {}) => {
|
|
2236
|
-
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2237
|
-
cache = [];
|
|
2238
|
-
diffArrays(original, objToDiff, cache);
|
|
2239
|
-
} else {
|
|
2240
|
-
diffObjects(original, objToDiff, cache);
|
|
2241
|
-
}
|
|
2242
|
-
return cache;
|
|
2243
|
-
};
|
|
2244
|
-
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2245
|
-
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2246
|
-
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2247
|
-
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2248
|
-
var deepDiff = (lhs, rhs) => {
|
|
2249
|
-
if (lhs === rhs)
|
|
2250
|
-
return {};
|
|
2251
|
-
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2252
|
-
return rhs;
|
|
2253
|
-
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2254
|
-
if (!hasOwnProperty(rhs, key)) {
|
|
2255
|
-
acc[key] = void 0;
|
|
2256
|
-
}
|
|
2257
|
-
return acc;
|
|
2258
|
-
}, makeObjectWithoutPrototype());
|
|
2259
|
-
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2260
|
-
if (lhs.valueOf() === rhs.valueOf())
|
|
2261
|
-
return {};
|
|
2262
|
-
return rhs;
|
|
2263
|
-
}
|
|
2264
|
-
return Object.keys(rhs).reduce((acc, key) => {
|
|
2265
|
-
if (!hasOwnProperty(lhs, key)) {
|
|
2266
|
-
acc[key] = rhs[key];
|
|
2267
|
-
return acc;
|
|
2268
|
-
}
|
|
2269
|
-
const difference = diff(lhs[key], rhs[key]);
|
|
2270
|
-
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2271
|
-
return acc;
|
|
2272
|
-
}
|
|
2273
|
-
acc[key] = difference;
|
|
2274
|
-
return acc;
|
|
2275
|
-
}, deletedValues);
|
|
2276
|
-
};
|
|
2277
|
-
var overwrite = (element, params, excludeFrom = []) => {
|
|
2278
|
-
const { ref } = element;
|
|
2279
|
-
const changes = {};
|
|
2280
|
-
for (const e in params) {
|
|
2281
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2282
|
-
continue;
|
|
2283
|
-
const elementProp = element[e];
|
|
2284
|
-
const paramsProp = params[e];
|
|
2285
|
-
if (paramsProp) {
|
|
2286
|
-
ref.__cache[e] = changes[e] = elementProp;
|
|
2287
|
-
ref[e] = paramsProp;
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
return changes;
|
|
2291
|
-
};
|
|
2292
|
-
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2293
|
-
for (const e in params) {
|
|
2294
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2295
|
-
continue;
|
|
2296
|
-
obj[e] = params[e];
|
|
2297
|
-
}
|
|
2298
|
-
return obj;
|
|
2299
|
-
};
|
|
2300
|
-
var overwriteDeep2 = (obj, params, excludeFrom = []) => {
|
|
2301
|
-
for (const e in params) {
|
|
2302
|
-
if (e === "__proto__")
|
|
2303
|
-
continue;
|
|
2304
|
-
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2305
|
-
continue;
|
|
2306
|
-
const objProp = obj[e];
|
|
2307
|
-
const paramsProp = params[e];
|
|
2308
|
-
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2309
|
-
overwriteDeep2(objProp, paramsProp);
|
|
2310
|
-
} else if (paramsProp !== void 0) {
|
|
2311
|
-
obj[e] = paramsProp;
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
return obj;
|
|
2315
|
-
};
|
|
2316
|
-
var mergeIfExisted = (a, b) => {
|
|
2317
|
-
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2318
|
-
return deepMerge3(a, b);
|
|
2319
|
-
return a || b;
|
|
2320
|
-
};
|
|
2321
|
-
var flattenRecursive = (param, prop, stack = []) => {
|
|
2322
|
-
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2323
|
-
stack.push(objectized);
|
|
2324
|
-
const extendOfExtend = objectized[prop];
|
|
2325
|
-
if (extendOfExtend)
|
|
2326
|
-
flattenRecursive(extendOfExtend, prop, stack);
|
|
2327
|
-
delete objectized[prop];
|
|
2328
|
-
return stack;
|
|
2329
|
-
};
|
|
2330
|
-
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2331
|
-
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2332
|
-
return param === element;
|
|
2333
|
-
}
|
|
2334
|
-
if (visited.has(param) || visited.has(element)) {
|
|
2335
|
-
return true;
|
|
2336
|
-
}
|
|
2337
|
-
visited.add(param);
|
|
2338
|
-
visited.add(element);
|
|
2339
|
-
const keysParam = Object.keys(param);
|
|
2340
|
-
const keysElement = Object.keys(element);
|
|
2341
|
-
if (keysParam.length !== keysElement.length) {
|
|
2342
|
-
return false;
|
|
2343
|
-
}
|
|
2344
|
-
for (const key of keysParam) {
|
|
2345
|
-
if (!keysElement.includes(key)) {
|
|
2346
|
-
return false;
|
|
2347
|
-
}
|
|
2348
|
-
const paramProp = param[key];
|
|
2349
|
-
const elementProp = element[key];
|
|
2350
|
-
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2351
|
-
return false;
|
|
2352
|
-
}
|
|
2353
|
-
}
|
|
2354
|
-
return true;
|
|
2355
|
-
};
|
|
2356
|
-
var deepContains = (obj1, obj2) => {
|
|
2357
|
-
if (typeof obj1 !== typeof obj2) {
|
|
2358
|
-
return false;
|
|
2359
|
-
}
|
|
2360
|
-
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2361
|
-
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2362
|
-
if (obj1.length !== obj2.length) {
|
|
2363
|
-
return false;
|
|
2364
|
-
}
|
|
2365
|
-
for (let i = 0; i < obj1.length; i++) {
|
|
2366
|
-
if (!deepContains(obj1[i], obj2[i])) {
|
|
2367
|
-
return false;
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2371
|
-
for (const key in obj1) {
|
|
2372
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2373
|
-
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2374
|
-
return false;
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
} else {
|
|
2379
|
-
return obj2 === obj1;
|
|
2380
|
-
}
|
|
2381
|
-
return true;
|
|
2382
|
-
};
|
|
2383
|
-
var removeFromObject = (obj, props) => {
|
|
2384
|
-
if (props === void 0 || props === null)
|
|
2385
|
-
return obj;
|
|
2386
|
-
if ((0, import_types.is)(props)("string", "number")) {
|
|
2387
|
-
delete obj[props];
|
|
2388
|
-
} else if ((0, import_types.isArray)(props)) {
|
|
2389
|
-
props.forEach((prop) => delete obj[prop]);
|
|
2390
|
-
} else {
|
|
2391
|
-
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2392
|
-
}
|
|
2393
|
-
return obj;
|
|
2394
|
-
};
|
|
2395
|
-
}
|
|
2396
|
-
});
|
|
2397
|
-
var require_function2 = __commonJS2({
|
|
2398
|
-
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
2399
|
-
"use strict";
|
|
2400
|
-
var __defProp22 = Object.defineProperty;
|
|
2401
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2402
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2403
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2404
|
-
var __export22 = (target, all) => {
|
|
2405
|
-
for (var name in all)
|
|
2406
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2407
|
-
};
|
|
2408
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2409
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2410
|
-
for (let key of __getOwnPropNames22(from))
|
|
2411
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2412
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2413
|
-
}
|
|
2414
|
-
return to;
|
|
2415
|
-
};
|
|
2416
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2417
|
-
var function_exports = {};
|
|
2418
|
-
__export22(function_exports, {
|
|
2419
|
-
debounce: () => debounce,
|
|
2420
|
-
debounceOnContext: () => debounceOnContext,
|
|
2421
|
-
isStringFunction: () => isStringFunction,
|
|
2422
|
-
memoize: () => memoize
|
|
2423
|
-
});
|
|
2424
|
-
module22.exports = __toCommonJS22(function_exports);
|
|
2425
|
-
function debounce(func, wait, immediate) {
|
|
2426
|
-
let timeout;
|
|
2427
|
-
return function() {
|
|
2428
|
-
const context = this;
|
|
2429
|
-
const args = arguments;
|
|
2430
|
-
const later = function() {
|
|
2431
|
-
timeout = null;
|
|
2432
|
-
if (!immediate)
|
|
2433
|
-
func.apply(context, args);
|
|
2434
|
-
};
|
|
2435
|
-
const callNow = immediate && !timeout;
|
|
2436
|
-
clearTimeout(timeout);
|
|
2437
|
-
timeout = setTimeout(later, wait);
|
|
2438
|
-
if (callNow)
|
|
2439
|
-
func.apply(context, args);
|
|
2440
|
-
};
|
|
2441
|
-
}
|
|
2442
|
-
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2443
|
-
let timer;
|
|
2444
|
-
return (...args) => {
|
|
2445
|
-
clearTimeout(timer);
|
|
2446
|
-
timer = setTimeout(() => {
|
|
2447
|
-
func.apply(element, args);
|
|
2448
|
-
}, timeout);
|
|
2449
|
-
};
|
|
2450
|
-
};
|
|
2451
|
-
var memoize = (fn) => {
|
|
2452
|
-
const cache = {};
|
|
2453
|
-
return (...args) => {
|
|
2454
|
-
const n = args[0];
|
|
2455
|
-
if (n in cache) {
|
|
2456
|
-
return cache[n];
|
|
2457
|
-
} else {
|
|
2458
|
-
const result = fn(n);
|
|
2459
|
-
cache[n] = result;
|
|
2460
|
-
return result;
|
|
2461
|
-
}
|
|
2462
|
-
};
|
|
2463
|
-
};
|
|
2464
|
-
var isStringFunction = (inputString) => {
|
|
2465
|
-
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
2466
|
-
return functionRegex.test(inputString);
|
|
2467
|
-
};
|
|
2468
|
-
}
|
|
2469
|
-
});
|
|
2470
|
-
var require_log2 = __commonJS2({
|
|
2471
|
-
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
2472
|
-
"use strict";
|
|
2473
|
-
var __defProp22 = Object.defineProperty;
|
|
2474
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2475
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2476
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2477
|
-
var __export22 = (target, all) => {
|
|
2478
|
-
for (var name in all)
|
|
2479
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2480
|
-
};
|
|
2481
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2482
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2483
|
-
for (let key of __getOwnPropNames22(from))
|
|
2484
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2485
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2486
|
-
}
|
|
2487
|
-
return to;
|
|
2488
|
-
};
|
|
2489
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2490
|
-
var log_exports = {};
|
|
2491
|
-
__export22(log_exports, {
|
|
2492
|
-
logGroupIf: () => logGroupIf,
|
|
2493
|
-
logIf: () => logIf
|
|
2494
|
-
});
|
|
2495
|
-
module22.exports = __toCommonJS22(log_exports);
|
|
2496
|
-
var logIf = (bool, ...arg) => {
|
|
2497
|
-
if (bool)
|
|
2498
|
-
arg.map((v) => console.log(v));
|
|
2499
|
-
};
|
|
2500
|
-
var logGroupIf = (bool, key, ...arg) => {
|
|
2501
|
-
if (bool) {
|
|
2502
|
-
console.group(key);
|
|
2503
|
-
arg.map((v) => console.log(v));
|
|
2504
|
-
console.groupEnd(key);
|
|
2505
|
-
}
|
|
2506
|
-
};
|
|
2507
|
-
}
|
|
2508
|
-
});
|
|
2509
|
-
var require_cookie2 = __commonJS2({
|
|
2510
|
-
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
2511
|
-
"use strict";
|
|
2512
|
-
var __defProp22 = Object.defineProperty;
|
|
2513
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2514
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2515
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2516
|
-
var __export22 = (target, all) => {
|
|
2517
|
-
for (var name in all)
|
|
2518
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2519
|
-
};
|
|
2520
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2521
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2522
|
-
for (let key of __getOwnPropNames22(from))
|
|
2523
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2524
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2525
|
-
}
|
|
2526
|
-
return to;
|
|
2527
|
-
};
|
|
2528
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2529
|
-
var cookie_exports = {};
|
|
2530
|
-
__export22(cookie_exports, {
|
|
2531
|
-
getCookie: () => getCookie,
|
|
2532
|
-
isMobile: () => isMobile,
|
|
2533
|
-
setCookie: () => setCookie
|
|
2534
|
-
});
|
|
2535
|
-
module22.exports = __toCommonJS22(cookie_exports);
|
|
2536
|
-
var import_types = require_types2();
|
|
2537
|
-
var import_utils32 = require_cjs4();
|
|
2538
|
-
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2539
|
-
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2540
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2541
|
-
return;
|
|
2542
|
-
const d = /* @__PURE__ */ new Date();
|
|
2543
|
-
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2544
|
-
const expires = `expires=${d.toUTCString()}`;
|
|
2545
|
-
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2546
|
-
};
|
|
2547
|
-
var getCookie = (cname) => {
|
|
2548
|
-
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
2549
|
-
return;
|
|
2550
|
-
const name = `${cname}=`;
|
|
2551
|
-
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
2552
|
-
const ca = decodedCookie.split(";");
|
|
2553
|
-
for (let i = 0; i < ca.length; i++) {
|
|
2554
|
-
let c = ca[i];
|
|
2555
|
-
while (c.charAt(0) === " ")
|
|
2556
|
-
c = c.substring(1);
|
|
2557
|
-
if (c.indexOf(name) === 0)
|
|
2558
|
-
return c.substring(name.length, c.length);
|
|
2559
|
-
}
|
|
2560
|
-
return "";
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
});
|
|
2564
|
-
var require_tags2 = __commonJS2({
|
|
2565
|
-
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
2566
|
-
"use strict";
|
|
2567
|
-
var __defProp22 = Object.defineProperty;
|
|
2568
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2569
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2570
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2571
|
-
var __export22 = (target, all) => {
|
|
2572
|
-
for (var name in all)
|
|
2573
|
-
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2574
|
-
};
|
|
2575
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2576
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2577
|
-
for (let key of __getOwnPropNames22(from))
|
|
2578
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2579
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2580
|
-
}
|
|
2581
|
-
return to;
|
|
2582
|
-
};
|
|
2583
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2584
|
-
var tags_exports = {};
|
|
2585
|
-
__export22(tags_exports, {
|
|
2586
|
-
HTML_TAGS: () => HTML_TAGS,
|
|
2587
|
-
isValidHtmlTag: () => isValidHtmlTag
|
|
2588
|
-
});
|
|
2589
|
-
module22.exports = __toCommonJS22(tags_exports);
|
|
2590
|
-
var HTML_TAGS = {
|
|
2591
|
-
root: [
|
|
2592
|
-
"body",
|
|
2593
|
-
"html"
|
|
2594
|
-
],
|
|
2595
|
-
head: [
|
|
2596
|
-
"title",
|
|
2597
|
-
"base",
|
|
2598
|
-
"meta",
|
|
2599
|
-
"style"
|
|
2600
|
-
],
|
|
2601
|
-
body: [
|
|
2602
|
-
"string",
|
|
2603
|
-
"fragment",
|
|
2604
|
-
"a",
|
|
2605
|
-
"abbr",
|
|
2606
|
-
"acronym",
|
|
2607
|
-
"address",
|
|
2608
|
-
"applet",
|
|
2609
|
-
"area",
|
|
2610
|
-
"article",
|
|
2611
|
-
"aside",
|
|
2612
|
-
"audio",
|
|
2613
|
-
"b",
|
|
2614
|
-
"basefont",
|
|
2615
|
-
"bdi",
|
|
2616
|
-
"bdo",
|
|
2617
|
-
"big",
|
|
2618
|
-
"blockquote",
|
|
2619
|
-
"br",
|
|
2620
|
-
"button",
|
|
2621
|
-
"canvas",
|
|
2622
|
-
"caption",
|
|
2623
|
-
"center",
|
|
2624
|
-
"cite",
|
|
2625
|
-
"code",
|
|
2626
|
-
"search",
|
|
2627
|
-
"col",
|
|
2628
|
-
"colgroup",
|
|
2629
|
-
"data",
|
|
2630
|
-
"datalist",
|
|
2631
|
-
"dd",
|
|
2632
|
-
"del",
|
|
2633
|
-
"details",
|
|
2634
|
-
"dfn",
|
|
2635
|
-
"dialog",
|
|
2636
|
-
"dir",
|
|
2637
|
-
"div",
|
|
2638
|
-
"dl",
|
|
2639
|
-
"dt",
|
|
2640
|
-
"em",
|
|
2641
|
-
"embed",
|
|
2642
|
-
"fieldset",
|
|
2643
|
-
"figcaption",
|
|
2644
|
-
"figure",
|
|
2645
|
-
"font",
|
|
2646
|
-
"footer",
|
|
2647
|
-
"form",
|
|
2648
|
-
"frame",
|
|
2649
|
-
"frameset",
|
|
2650
|
-
"h1",
|
|
2651
|
-
"h2",
|
|
2652
|
-
"h3",
|
|
2653
|
-
"h4",
|
|
2654
|
-
"h5",
|
|
2655
|
-
"h6",
|
|
2656
|
-
"head",
|
|
2657
|
-
"header",
|
|
2658
|
-
"hr",
|
|
2659
|
-
"i",
|
|
2660
|
-
"iframe",
|
|
2661
|
-
"img",
|
|
2662
|
-
"input",
|
|
2663
|
-
"ins",
|
|
2664
|
-
"kbd",
|
|
2665
|
-
"label",
|
|
2666
|
-
"legend",
|
|
2667
|
-
"li",
|
|
2668
|
-
"link",
|
|
2669
|
-
"main",
|
|
2670
|
-
"map",
|
|
2671
|
-
"mark",
|
|
2672
|
-
"meter",
|
|
2673
|
-
"nav",
|
|
2674
|
-
"noframes",
|
|
2675
|
-
"noscript",
|
|
2676
|
-
"object",
|
|
2677
|
-
"ol",
|
|
2678
|
-
"optgroup",
|
|
2679
|
-
"option",
|
|
2680
|
-
"output",
|
|
2681
|
-
"p",
|
|
2682
|
-
"param",
|
|
2683
|
-
"picture",
|
|
2684
|
-
"pre",
|
|
2685
|
-
"progress",
|
|
2686
|
-
"hgroup",
|
|
2687
|
-
"q",
|
|
2688
|
-
"rp",
|
|
2689
|
-
"rt",
|
|
2690
|
-
"ruby",
|
|
2691
|
-
"s",
|
|
2692
|
-
"samp",
|
|
2693
|
-
"script",
|
|
2694
|
-
"section",
|
|
2695
|
-
"select",
|
|
2696
|
-
"small",
|
|
2697
|
-
"source",
|
|
2698
|
-
"span",
|
|
2699
|
-
"strike",
|
|
2700
|
-
"strong",
|
|
2701
|
-
"sub",
|
|
2702
|
-
"summary",
|
|
2703
|
-
"sup",
|
|
2704
|
-
"table",
|
|
2705
|
-
"tbody",
|
|
2706
|
-
"td",
|
|
2707
|
-
"template",
|
|
2708
|
-
"hgroup",
|
|
2709
|
-
"textarea",
|
|
2710
|
-
"tfoot",
|
|
2711
|
-
"th",
|
|
2712
|
-
"thead",
|
|
2713
|
-
"time",
|
|
2714
|
-
"tr",
|
|
2715
|
-
"track",
|
|
2716
|
-
"tt",
|
|
2717
|
-
"u",
|
|
2718
|
-
"ul",
|
|
2719
|
-
"var",
|
|
2720
|
-
"video",
|
|
2721
|
-
"wbr",
|
|
2722
|
-
// SVG
|
|
2723
|
-
"svg",
|
|
2724
|
-
"path"
|
|
2725
|
-
]
|
|
2726
|
-
};
|
|
2727
|
-
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
2728
|
-
}
|
|
2729
|
-
});
|
|
2730
|
-
var require_cjs4 = __commonJS2({
|
|
2731
|
-
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
2732
|
-
"use strict";
|
|
2733
|
-
var __defProp22 = Object.defineProperty;
|
|
2734
|
-
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2735
|
-
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2736
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2737
|
-
var __copyProps22 = (to, from, except, desc) => {
|
|
2738
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
2739
|
-
for (let key of __getOwnPropNames22(from))
|
|
2740
|
-
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2741
|
-
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2742
|
-
}
|
|
2743
|
-
return to;
|
|
2744
|
-
};
|
|
2745
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
2746
|
-
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2747
|
-
var utils_exports = {};
|
|
2748
|
-
module22.exports = __toCommonJS22(utils_exports);
|
|
2749
|
-
__reExport(utils_exports, require_key2(), module22.exports);
|
|
2750
|
-
__reExport(utils_exports, require_env2(), module22.exports);
|
|
2751
|
-
__reExport(utils_exports, require_types2(), module22.exports);
|
|
2752
|
-
__reExport(utils_exports, require_object2(), module22.exports);
|
|
2753
|
-
__reExport(utils_exports, require_function2(), module22.exports);
|
|
2754
|
-
__reExport(utils_exports, require_array2(), module22.exports);
|
|
2755
|
-
__reExport(utils_exports, require_node2(), module22.exports);
|
|
2756
|
-
__reExport(utils_exports, require_log2(), module22.exports);
|
|
2757
|
-
__reExport(utils_exports, require_string2(), module22.exports);
|
|
2758
|
-
__reExport(utils_exports, require_globals2(), module22.exports);
|
|
2759
|
-
__reExport(utils_exports, require_cookie2(), module22.exports);
|
|
2760
|
-
__reExport(utils_exports, require_tags2(), module22.exports);
|
|
2761
|
-
}
|
|
2762
|
-
});
|
|
2763
|
-
var src_exports = {};
|
|
2764
|
-
__export2(src_exports, {
|
|
2765
|
-
arrayzeValue: () => arrayzeValue3,
|
|
2766
|
-
copyStringToClipboard: () => copyStringToClipboard,
|
|
2767
|
-
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
2768
|
-
findClosestNumber: () => findClosestNumber,
|
|
2769
|
-
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2770
|
-
formatDate: () => formatDate,
|
|
2771
|
-
loadJavascript: () => loadJavascript,
|
|
2772
|
-
loadJavascriptFile: () => loadJavascriptFile,
|
|
2773
|
-
removeChars: () => removeChars,
|
|
2774
|
-
toCamelCase: () => toCamelCase2,
|
|
2775
|
-
toDashCase: () => toDashCase2,
|
|
2776
|
-
toDescriptionCase: () => toDescriptionCase,
|
|
2777
|
-
toTitleCase: () => toTitleCase,
|
|
2778
|
-
toggleFullscreen: () => toggleFullscreen
|
|
2779
|
-
});
|
|
2780
|
-
module2.exports = __toCommonJS2(src_exports);
|
|
2781
|
-
var import_utils25 = __toESM2(require_cjs4(), 1);
|
|
2782
|
-
var toggleFullscreen = (el) => {
|
|
2783
|
-
if (!document.fullscreenElement) {
|
|
2784
|
-
el.node.requestFullscreen().catch((err) => {
|
|
2785
|
-
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
2786
|
-
});
|
|
2787
|
-
} else {
|
|
2788
|
-
document.exitFullscreen();
|
|
2789
|
-
}
|
|
2790
|
-
};
|
|
2791
|
-
var import_utils26 = __toESM2(require_cjs4(), 1);
|
|
2792
|
-
var findClosestNumber = (number, arr) => {
|
|
2793
|
-
return ((0, import_utils26.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
2794
|
-
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
2795
|
-
});
|
|
2796
|
-
};
|
|
2797
|
-
var findClosestNumberInFactory = (val, factory) => {
|
|
2798
|
-
val = parseFloat(val);
|
|
2799
|
-
if ((0, import_utils26.isObject)(factory))
|
|
2800
|
-
factory = Object.values(factory);
|
|
2801
|
-
return findClosestNumber(val, factory);
|
|
2802
|
-
};
|
|
2803
|
-
var formatDate = (timestamp) => {
|
|
2804
|
-
if (!timestamp)
|
|
2805
|
-
return "";
|
|
2806
|
-
const d = new Date(timestamp);
|
|
2807
|
-
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
2808
|
-
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
2809
|
-
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
2810
|
-
return `${da} ${mo}, ${ye}`;
|
|
2811
|
-
};
|
|
2812
|
-
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
2813
|
-
const fib = [0, 1];
|
|
2814
|
-
for (let i = 2; i <= n; i++) {
|
|
2815
|
-
fib[i] = fib[i - 1] + fib[i - 2];
|
|
2816
|
-
}
|
|
2817
|
-
return fib[n];
|
|
2818
|
-
};
|
|
2819
|
-
var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
|
|
2820
|
-
return new Promise((resolve, reject) => {
|
|
2821
|
-
try {
|
|
2822
|
-
const scriptEle = doc.createElement("script");
|
|
2823
|
-
scriptEle.type = type;
|
|
2824
|
-
scriptEle.async = async;
|
|
2825
|
-
scriptEle.src = FILE_URL;
|
|
2826
|
-
scriptEle.addEventListener("load", (ev) => {
|
|
2827
|
-
resolve({
|
|
2828
|
-
status: true
|
|
2829
|
-
});
|
|
2830
|
-
});
|
|
2831
|
-
scriptEle.addEventListener("error", (ev) => {
|
|
2832
|
-
reject({
|
|
2833
|
-
status: false,
|
|
2834
|
-
message: `Failed to load the script ${FILE_URL}`
|
|
2835
|
-
});
|
|
2836
|
-
});
|
|
2837
|
-
doc.body.appendChild(scriptEle);
|
|
2838
|
-
} catch (error) {
|
|
2839
|
-
reject(error);
|
|
2840
|
-
}
|
|
2841
|
-
});
|
|
2842
|
-
};
|
|
2843
|
-
var loadJavascript = (body, async = true, doc = document, type = "text/javascript") => {
|
|
2844
|
-
try {
|
|
2845
|
-
const scriptEle = doc.createElement("script");
|
|
2846
|
-
scriptEle.type = type;
|
|
2847
|
-
scriptEle.async = async;
|
|
2848
|
-
scriptEle.innerHTML = body;
|
|
2849
|
-
doc.body.appendChild(scriptEle);
|
|
2850
|
-
} catch (error) {
|
|
2851
|
-
console.warn(error);
|
|
2852
|
-
}
|
|
2853
|
-
};
|
|
2854
|
-
var copyStringToClipboard = (str) => {
|
|
2855
|
-
const el = document.createElement("textarea");
|
|
2856
|
-
el.value = str;
|
|
2857
|
-
el.setAttribute("readonly", "");
|
|
2858
|
-
el.style = { position: "absolute", left: "-9999px" };
|
|
2859
|
-
document.body.appendChild(el);
|
|
2860
|
-
el.select();
|
|
2861
|
-
document.execCommand("copy");
|
|
2862
|
-
document.body.removeChild(el);
|
|
2863
|
-
};
|
|
2864
|
-
var removeChars = (str) => {
|
|
2865
|
-
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
2866
|
-
};
|
|
2867
|
-
var toCamelCase2 = (str) => {
|
|
2868
|
-
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
2869
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
2870
|
-
}).replaceAll(/\s+/g, "");
|
|
2871
|
-
};
|
|
2872
|
-
var toTitleCase = (str) => str && str.replace(
|
|
2873
|
-
/\w\S*/g,
|
|
2874
|
-
(txt) => {
|
|
2875
|
-
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
2876
|
-
}
|
|
2877
|
-
);
|
|
2878
|
-
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2879
|
-
var toDescriptionCase = (str = "") => {
|
|
2880
|
-
if (typeof str !== "string")
|
|
2881
|
-
return;
|
|
2882
|
-
const result = str.replace(/([A-Z])/g, " $1");
|
|
2883
|
-
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2884
|
-
};
|
|
2885
|
-
var arrayzeValue3 = (val) => {
|
|
2886
|
-
if ((0, import_utils25.isArray)(val))
|
|
2887
|
-
return val;
|
|
2888
|
-
if ((0, import_utils25.isString)(val))
|
|
2889
|
-
return val.split(" ");
|
|
2890
|
-
if ((0, import_utils25.isObject)(val))
|
|
2891
|
-
return Object.values(val);
|
|
2892
|
-
if ((0, import_utils25.isNumber)(val))
|
|
2893
|
-
return [val];
|
|
2894
|
-
};
|
|
2895
|
-
}
|
|
2896
|
-
});
|
|
2897
|
-
|
|
2898
1551
|
// src/system/index.js
|
|
2899
1552
|
var system_exports = {};
|
|
2900
1553
|
__export(system_exports, {
|
|
@@ -2931,7 +1584,7 @@ __export(system_exports, {
|
|
|
2931
1584
|
module.exports = __toCommonJS(system_exports);
|
|
2932
1585
|
|
|
2933
1586
|
// src/system/color.js
|
|
2934
|
-
var
|
|
1587
|
+
var import_utils8 = __toESM(require_cjs(), 1);
|
|
2935
1588
|
|
|
2936
1589
|
// src/factory.js
|
|
2937
1590
|
var import_utils = __toESM(require_cjs(), 1);
|
|
@@ -3111,181 +1764,1823 @@ var DEVICES = {
|
|
|
3111
1764
|
mobileS: [480, 768],
|
|
3112
1765
|
mobileXS: [375, 768]
|
|
3113
1766
|
};
|
|
3114
|
-
|
|
3115
|
-
// src/defaultConfig/cases.js
|
|
3116
|
-
var CASES = {};
|
|
3117
|
-
|
|
3118
|
-
// src/defaultConfig/animation.js
|
|
3119
|
-
var ANIMATION = {};
|
|
3120
|
-
|
|
3121
|
-
// src/defaultConfig/svg.js
|
|
3122
|
-
var SVG = {};
|
|
3123
|
-
var SVG_DATA = {};
|
|
3124
|
-
|
|
3125
|
-
// src/defaultConfig/templates.js
|
|
3126
|
-
var TEMPLATES = {};
|
|
3127
|
-
|
|
3128
|
-
// src/defaultConfig/grid.js
|
|
3129
|
-
var defaultProps4 = {};
|
|
3130
|
-
var GRID = defaultProps4;
|
|
3131
|
-
|
|
3132
|
-
// src/defaultConfig/index.js
|
|
3133
|
-
var RESET = {};
|
|
3134
|
-
|
|
3135
|
-
// src/factory.js
|
|
3136
|
-
var CSS_VARS = {};
|
|
3137
|
-
var CONFIG = {
|
|
3138
|
-
verbose: false,
|
|
3139
|
-
useVariable: true,
|
|
3140
|
-
useReset: true,
|
|
3141
|
-
CSS_VARS,
|
|
3142
|
-
...defaultConfig_exports
|
|
1767
|
+
|
|
1768
|
+
// src/defaultConfig/cases.js
|
|
1769
|
+
var CASES = {};
|
|
1770
|
+
|
|
1771
|
+
// src/defaultConfig/animation.js
|
|
1772
|
+
var ANIMATION = {};
|
|
1773
|
+
|
|
1774
|
+
// src/defaultConfig/svg.js
|
|
1775
|
+
var SVG = {};
|
|
1776
|
+
var SVG_DATA = {};
|
|
1777
|
+
|
|
1778
|
+
// src/defaultConfig/templates.js
|
|
1779
|
+
var TEMPLATES = {};
|
|
1780
|
+
|
|
1781
|
+
// src/defaultConfig/grid.js
|
|
1782
|
+
var defaultProps4 = {};
|
|
1783
|
+
var GRID = defaultProps4;
|
|
1784
|
+
|
|
1785
|
+
// src/defaultConfig/index.js
|
|
1786
|
+
var RESET = {};
|
|
1787
|
+
|
|
1788
|
+
// src/factory.js
|
|
1789
|
+
var CSS_VARS = {};
|
|
1790
|
+
var CONFIG = {
|
|
1791
|
+
verbose: false,
|
|
1792
|
+
useVariable: true,
|
|
1793
|
+
useReset: true,
|
|
1794
|
+
CSS_VARS,
|
|
1795
|
+
...defaultConfig_exports
|
|
1796
|
+
};
|
|
1797
|
+
var cachedConfig = (0, import_utils.deepClone)(CONFIG);
|
|
1798
|
+
var FACTORY = {
|
|
1799
|
+
active: "0",
|
|
1800
|
+
0: CONFIG
|
|
1801
|
+
};
|
|
1802
|
+
var getActiveConfig = (def) => {
|
|
1803
|
+
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
1804
|
+
};
|
|
1805
|
+
|
|
1806
|
+
// src/utils/unit.js
|
|
1807
|
+
var isScalingUnit = (unit) => {
|
|
1808
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1809
|
+
};
|
|
1810
|
+
|
|
1811
|
+
// src/utils/color.js
|
|
1812
|
+
var import_globals = __toESM(require_cjs2(), 1);
|
|
1813
|
+
var import_utils2 = __toESM(require_cjs(), 1);
|
|
1814
|
+
var colorStringToRgbaArray = (color) => {
|
|
1815
|
+
if (color === "")
|
|
1816
|
+
return [0, 0, 0, 0];
|
|
1817
|
+
if (color.toLowerCase() === "transparent")
|
|
1818
|
+
return [0, 0, 0, 0];
|
|
1819
|
+
if (color[0] === "#") {
|
|
1820
|
+
if (color.length < 7) {
|
|
1821
|
+
color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
|
|
1822
|
+
}
|
|
1823
|
+
return [
|
|
1824
|
+
parseInt(color.substr(1, 2), 16),
|
|
1825
|
+
parseInt(color.substr(3, 2), 16),
|
|
1826
|
+
parseInt(color.substr(5, 2), 16),
|
|
1827
|
+
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
1828
|
+
];
|
|
1829
|
+
}
|
|
1830
|
+
if (color.indexOf("rgb") === -1) {
|
|
1831
|
+
if (import_globals.document && import_globals.window) {
|
|
1832
|
+
const elem = import_globals.document.body.appendChild(import_globals.document.createElement("fictum"));
|
|
1833
|
+
const flag = "rgb(1, 2, 3)";
|
|
1834
|
+
elem.style.color = flag;
|
|
1835
|
+
if (elem.style.color !== flag) {
|
|
1836
|
+
import_globals.document.body.removeChild(elem);
|
|
1837
|
+
return;
|
|
1838
|
+
}
|
|
1839
|
+
elem.style.color = color;
|
|
1840
|
+
if (elem.style.color === flag || elem.style.color === "") {
|
|
1841
|
+
import_globals.document.body.removeChild(elem);
|
|
1842
|
+
return [0, 0, 0, 0];
|
|
1843
|
+
}
|
|
1844
|
+
color = import_globals.window.getComputedStyle(elem).color;
|
|
1845
|
+
import_globals.document.body.removeChild(elem);
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
if (color.indexOf("rgb") === 0) {
|
|
1849
|
+
if (color.indexOf("rgba") === -1)
|
|
1850
|
+
color = `${color}, 1`;
|
|
1851
|
+
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
1852
|
+
}
|
|
1853
|
+
return [0, 0, 0, 0];
|
|
1854
|
+
};
|
|
1855
|
+
var hexToRgbArray = (hex, alpha = 1) => {
|
|
1856
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
1857
|
+
return [r, g, b];
|
|
1858
|
+
};
|
|
1859
|
+
var rgbArrayToHex = ([r, g, b]) => {
|
|
1860
|
+
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
1861
|
+
};
|
|
1862
|
+
var rgbToHSL = (r, g, b) => {
|
|
1863
|
+
const a = Math.max(r, g, b);
|
|
1864
|
+
const n = a - Math.min(r, g, b);
|
|
1865
|
+
const f = 1 - Math.abs(a + a - n - 1);
|
|
1866
|
+
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
1867
|
+
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
1868
|
+
};
|
|
1869
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
1870
|
+
Math.min(k - 3, 9 - k, 1),
|
|
1871
|
+
-1
|
|
1872
|
+
)) => [f(0), f(8), f(4)];
|
|
1873
|
+
var getColorShade = (col, amt) => {
|
|
1874
|
+
const num = parseInt(col, 16);
|
|
1875
|
+
let r = (num >> 16) + amt;
|
|
1876
|
+
if (r > 255)
|
|
1877
|
+
r = 255;
|
|
1878
|
+
else if (r < 0)
|
|
1879
|
+
r = 0;
|
|
1880
|
+
let b = (num >> 8 & 255) + amt;
|
|
1881
|
+
if (b > 255)
|
|
1882
|
+
b = 255;
|
|
1883
|
+
else if (b < 0)
|
|
1884
|
+
b = 0;
|
|
1885
|
+
let g = (num & 255) + amt;
|
|
1886
|
+
if (g > 255)
|
|
1887
|
+
g = 255;
|
|
1888
|
+
else if (g < 0)
|
|
1889
|
+
g = 0;
|
|
1890
|
+
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
1891
|
+
};
|
|
1892
|
+
var getRgbTone = (rgb, tone) => {
|
|
1893
|
+
if ((0, import_utils2.isString)(rgb) && rgb.includes("rgb"))
|
|
1894
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
1895
|
+
if ((0, import_utils2.isString)(rgb))
|
|
1896
|
+
rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
1897
|
+
if ((0, import_utils2.isNumber)(tone))
|
|
1898
|
+
tone += "";
|
|
1899
|
+
const toHex = rgbArrayToHex(rgb);
|
|
1900
|
+
const abs = tone.slice(0, 1);
|
|
1901
|
+
if (abs === "-" || abs === "+") {
|
|
1902
|
+
const colorShade = getColorShade(toHex, parseFloat(tone));
|
|
1903
|
+
return hexToRgbArray(colorShade).join(", ");
|
|
1904
|
+
} else {
|
|
1905
|
+
const [r, g, b] = rgb;
|
|
1906
|
+
const hsl = rgbToHSL(r, g, b);
|
|
1907
|
+
const [h, s, l] = hsl;
|
|
1908
|
+
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
1909
|
+
return newRgb;
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
// src/utils/font.js
|
|
1914
|
+
var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
1915
|
+
if (LIBRARY[key])
|
|
1916
|
+
return LIBRARY[key].value;
|
|
1917
|
+
if (LIBRARY.default)
|
|
1918
|
+
return LIBRARY[LIBRARY.default].value;
|
|
1919
|
+
const hasValue = Object.keys(LIBRARY)[0];
|
|
1920
|
+
return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
|
|
1921
|
+
};
|
|
1922
|
+
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
1923
|
+
var setCustomFont = (name, url, weight) => `
|
|
1924
|
+
font-family: '${name}';
|
|
1925
|
+
font-style: normal;
|
|
1926
|
+
${weight && `font-weight: ${weight};`}
|
|
1927
|
+
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
1928
|
+
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
1929
|
+
${setCustomFont(name, url, weight)}
|
|
1930
|
+
}`;
|
|
1931
|
+
var getFontFaceEach = (name, weights) => {
|
|
1932
|
+
const keys = Object.keys(weights);
|
|
1933
|
+
return keys.map((key) => {
|
|
1934
|
+
const { url, fontWeight } = weights[key];
|
|
1935
|
+
return setCustomFont(name, url, fontWeight);
|
|
1936
|
+
});
|
|
1937
|
+
};
|
|
1938
|
+
|
|
1939
|
+
// src/utils/sequence.js
|
|
1940
|
+
var import_utils4 = __toESM(require_cjs(), 1);
|
|
1941
|
+
|
|
1942
|
+
// ../utils/dist/cjs/index.js
|
|
1943
|
+
var __create2 = Object.create;
|
|
1944
|
+
var __defProp2 = Object.defineProperty;
|
|
1945
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1946
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1947
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1948
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1949
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
1950
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1951
|
+
};
|
|
1952
|
+
var __export2 = (target, all) => {
|
|
1953
|
+
for (var name in all)
|
|
1954
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1955
|
+
};
|
|
1956
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1957
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1958
|
+
for (let key of __getOwnPropNames2(from))
|
|
1959
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1960
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1961
|
+
}
|
|
1962
|
+
return to;
|
|
1963
|
+
};
|
|
1964
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1965
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
1966
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
1967
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1968
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1969
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1970
|
+
mod
|
|
1971
|
+
));
|
|
1972
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1973
|
+
var require_key2 = __commonJS2({
|
|
1974
|
+
"../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
|
|
1975
|
+
"use strict";
|
|
1976
|
+
var __defProp22 = Object.defineProperty;
|
|
1977
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1978
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1979
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1980
|
+
var __export22 = (target, all) => {
|
|
1981
|
+
for (var name in all)
|
|
1982
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1983
|
+
};
|
|
1984
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1985
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1986
|
+
for (let key of __getOwnPropNames22(from))
|
|
1987
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1988
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1989
|
+
}
|
|
1990
|
+
return to;
|
|
1991
|
+
};
|
|
1992
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1993
|
+
var key_exports = {};
|
|
1994
|
+
__export22(key_exports, {
|
|
1995
|
+
createSnapshotId: () => createSnapshotId,
|
|
1996
|
+
generateKey: () => generateKey
|
|
1997
|
+
});
|
|
1998
|
+
module2.exports = __toCommonJS22(key_exports);
|
|
1999
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
2000
|
+
let index = 0;
|
|
2001
|
+
function newId() {
|
|
2002
|
+
index++;
|
|
2003
|
+
return index;
|
|
2004
|
+
}
|
|
2005
|
+
return newId;
|
|
2006
|
+
}();
|
|
2007
|
+
var createSnapshotId = generateKey;
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
var require_env2 = __commonJS2({
|
|
2011
|
+
"../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
|
|
2012
|
+
"use strict";
|
|
2013
|
+
var __defProp22 = Object.defineProperty;
|
|
2014
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2015
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2016
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2017
|
+
var __export22 = (target, all) => {
|
|
2018
|
+
for (var name in all)
|
|
2019
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2020
|
+
};
|
|
2021
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2022
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2023
|
+
for (let key of __getOwnPropNames22(from))
|
|
2024
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2025
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2026
|
+
}
|
|
2027
|
+
return to;
|
|
2028
|
+
};
|
|
2029
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2030
|
+
var env_exports = {};
|
|
2031
|
+
__export22(env_exports, {
|
|
2032
|
+
NODE_ENV: () => NODE_ENV,
|
|
2033
|
+
getNev: () => getNev,
|
|
2034
|
+
isDevelopment: () => isDevelopment,
|
|
2035
|
+
isProduction: () => isProduction,
|
|
2036
|
+
isTest: () => isTest
|
|
2037
|
+
});
|
|
2038
|
+
module2.exports = __toCommonJS22(env_exports);
|
|
2039
|
+
var NODE_ENV = "development";
|
|
2040
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
2041
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
2042
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
2043
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
var require_globals2 = __commonJS2({
|
|
2047
|
+
"../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
|
|
2048
|
+
"use strict";
|
|
2049
|
+
var __defProp22 = Object.defineProperty;
|
|
2050
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2051
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2052
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2053
|
+
var __export22 = (target, all) => {
|
|
2054
|
+
for (var name in all)
|
|
2055
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2056
|
+
};
|
|
2057
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2058
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2059
|
+
for (let key of __getOwnPropNames22(from))
|
|
2060
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2061
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2062
|
+
}
|
|
2063
|
+
return to;
|
|
2064
|
+
};
|
|
2065
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2066
|
+
var globals_exports = {};
|
|
2067
|
+
__export22(globals_exports, {
|
|
2068
|
+
document: () => document22,
|
|
2069
|
+
global: () => global,
|
|
2070
|
+
self: () => self,
|
|
2071
|
+
window: () => window2
|
|
2072
|
+
});
|
|
2073
|
+
module2.exports = __toCommonJS22(globals_exports);
|
|
2074
|
+
var global = globalThis;
|
|
2075
|
+
var self = globalThis;
|
|
2076
|
+
var window2 = globalThis;
|
|
2077
|
+
var document22 = window2.document;
|
|
2078
|
+
}
|
|
2079
|
+
});
|
|
2080
|
+
var require_node2 = __commonJS2({
|
|
2081
|
+
"../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
|
|
2082
|
+
"use strict";
|
|
2083
|
+
var __defProp22 = Object.defineProperty;
|
|
2084
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2085
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2086
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2087
|
+
var __export22 = (target, all) => {
|
|
2088
|
+
for (var name in all)
|
|
2089
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2090
|
+
};
|
|
2091
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2092
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2093
|
+
for (let key of __getOwnPropNames22(from))
|
|
2094
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2095
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2096
|
+
}
|
|
2097
|
+
return to;
|
|
2098
|
+
};
|
|
2099
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2100
|
+
var node_exports = {};
|
|
2101
|
+
__export22(node_exports, {
|
|
2102
|
+
isHtmlElement: () => isHtmlElement,
|
|
2103
|
+
isNode: () => isNode
|
|
2104
|
+
});
|
|
2105
|
+
module2.exports = __toCommonJS22(node_exports);
|
|
2106
|
+
var import_globals3 = require_globals2();
|
|
2107
|
+
var isNode = (obj) => {
|
|
2108
|
+
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
2109
|
+
};
|
|
2110
|
+
var isHtmlElement = (obj) => {
|
|
2111
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
});
|
|
2115
|
+
var require_types2 = __commonJS2({
|
|
2116
|
+
"../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
|
|
2117
|
+
"use strict";
|
|
2118
|
+
var __defProp22 = Object.defineProperty;
|
|
2119
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2120
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2121
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2122
|
+
var __export22 = (target, all) => {
|
|
2123
|
+
for (var name in all)
|
|
2124
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2125
|
+
};
|
|
2126
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2127
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2128
|
+
for (let key of __getOwnPropNames22(from))
|
|
2129
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2130
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2131
|
+
}
|
|
2132
|
+
return to;
|
|
2133
|
+
};
|
|
2134
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2135
|
+
var types_exports = {};
|
|
2136
|
+
__export22(types_exports, {
|
|
2137
|
+
TYPES: () => TYPES,
|
|
2138
|
+
is: () => is,
|
|
2139
|
+
isArray: () => isArray32,
|
|
2140
|
+
isBoolean: () => isBoolean,
|
|
2141
|
+
isDate: () => isDate,
|
|
2142
|
+
isDefined: () => isDefined2,
|
|
2143
|
+
isFunction: () => isFunction,
|
|
2144
|
+
isNot: () => isNot,
|
|
2145
|
+
isNull: () => isNull,
|
|
2146
|
+
isNumber: () => isNumber2,
|
|
2147
|
+
isObject: () => isObject32,
|
|
2148
|
+
isObjectLike: () => isObjectLike3,
|
|
2149
|
+
isString: () => isString22,
|
|
2150
|
+
isUndefined: () => isUndefined
|
|
2151
|
+
});
|
|
2152
|
+
module2.exports = __toCommonJS22(types_exports);
|
|
2153
|
+
var import_node = require_node2();
|
|
2154
|
+
var isObject32 = (arg) => {
|
|
2155
|
+
if (arg === null)
|
|
2156
|
+
return false;
|
|
2157
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
2158
|
+
};
|
|
2159
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
2160
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
2161
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
2162
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
2163
|
+
var isNull = (arg) => arg === null;
|
|
2164
|
+
var isArray32 = (arg) => Array.isArray(arg);
|
|
2165
|
+
var isDate = (d) => d instanceof Date;
|
|
2166
|
+
var isObjectLike3 = (arg) => {
|
|
2167
|
+
if (arg === null)
|
|
2168
|
+
return false;
|
|
2169
|
+
return typeof arg === "object";
|
|
2170
|
+
};
|
|
2171
|
+
var isDefined2 = (arg) => {
|
|
2172
|
+
return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
|
|
2173
|
+
};
|
|
2174
|
+
var isUndefined = (arg) => {
|
|
2175
|
+
return arg === void 0;
|
|
2176
|
+
};
|
|
2177
|
+
var TYPES = {
|
|
2178
|
+
boolean: isBoolean,
|
|
2179
|
+
array: isArray32,
|
|
2180
|
+
object: isObject32,
|
|
2181
|
+
string: isString22,
|
|
2182
|
+
date: isDate,
|
|
2183
|
+
number: isNumber2,
|
|
2184
|
+
null: isNull,
|
|
2185
|
+
function: isFunction,
|
|
2186
|
+
objectLike: isObjectLike3,
|
|
2187
|
+
node: import_node.isNode,
|
|
2188
|
+
htmlElement: import_node.isHtmlElement,
|
|
2189
|
+
defined: isDefined2
|
|
2190
|
+
};
|
|
2191
|
+
var is = (arg) => {
|
|
2192
|
+
return (...args) => {
|
|
2193
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
2194
|
+
};
|
|
2195
|
+
};
|
|
2196
|
+
var isNot = (arg) => {
|
|
2197
|
+
return (...args) => {
|
|
2198
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
2199
|
+
};
|
|
2200
|
+
};
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
var require_array2 = __commonJS2({
|
|
2204
|
+
"../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
|
|
2205
|
+
"use strict";
|
|
2206
|
+
var __defProp22 = Object.defineProperty;
|
|
2207
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2208
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2209
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2210
|
+
var __export22 = (target, all) => {
|
|
2211
|
+
for (var name in all)
|
|
2212
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2213
|
+
};
|
|
2214
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2215
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2216
|
+
for (let key of __getOwnPropNames22(from))
|
|
2217
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2218
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2219
|
+
}
|
|
2220
|
+
return to;
|
|
2221
|
+
};
|
|
2222
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2223
|
+
var array_exports = {};
|
|
2224
|
+
__export22(array_exports, {
|
|
2225
|
+
addItemAfterEveryElement: () => addItemAfterEveryElement,
|
|
2226
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
2227
|
+
arraysEqual: () => arraysEqual,
|
|
2228
|
+
createNestedObject: () => createNestedObject,
|
|
2229
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
2230
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
2231
|
+
getFrequencyInArray: () => getFrequencyInArray,
|
|
2232
|
+
joinArrays: () => joinArrays,
|
|
2233
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
2234
|
+
mergeArray: () => mergeArray,
|
|
2235
|
+
removeFromArray: () => removeFromArray,
|
|
2236
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
2237
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
2238
|
+
reorderArrayByValues: () => reorderArrayByValues,
|
|
2239
|
+
swapItemsInArray: () => swapItemsInArray
|
|
2240
|
+
});
|
|
2241
|
+
module2.exports = __toCommonJS22(array_exports);
|
|
2242
|
+
var import_object = require_object2();
|
|
2243
|
+
var import_types = require_types2();
|
|
2244
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
2245
|
+
return arr2.every((val) => arr1.includes(val));
|
|
2246
|
+
};
|
|
2247
|
+
var getFrequencyInArray = (arr, value) => {
|
|
2248
|
+
return arr.reduce((count, currentValue) => {
|
|
2249
|
+
return currentValue === value ? count + 1 : count;
|
|
2250
|
+
}, 0);
|
|
2251
|
+
};
|
|
2252
|
+
var removeFromArray = (arr, index) => {
|
|
2253
|
+
if ((0, import_types.isString)(index))
|
|
2254
|
+
index = parseInt(index);
|
|
2255
|
+
if ((0, import_types.isNumber)(index)) {
|
|
2256
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
2257
|
+
throw new Error("Invalid index");
|
|
2258
|
+
}
|
|
2259
|
+
arr.splice(index, 1);
|
|
2260
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
2261
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
2262
|
+
} else {
|
|
2263
|
+
throw new Error("Invalid index");
|
|
2264
|
+
}
|
|
2265
|
+
return arr;
|
|
2266
|
+
};
|
|
2267
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
2268
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
2269
|
+
};
|
|
2270
|
+
var joinArrays = (...arrays) => {
|
|
2271
|
+
return [].concat(...arrays);
|
|
2272
|
+
};
|
|
2273
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
2274
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
2275
|
+
};
|
|
2276
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
2277
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
2278
|
+
};
|
|
2279
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
2280
|
+
const index = arr.indexOf(value);
|
|
2281
|
+
if (index !== -1) {
|
|
2282
|
+
return arr.slice(0, index);
|
|
2283
|
+
}
|
|
2284
|
+
return arr;
|
|
2285
|
+
};
|
|
2286
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
2287
|
+
if (!(0, import_types.isArray)(arr))
|
|
2288
|
+
return;
|
|
2289
|
+
const index = arr.indexOf(value);
|
|
2290
|
+
if (index !== -1) {
|
|
2291
|
+
return arr.slice(index + 1);
|
|
2292
|
+
}
|
|
2293
|
+
return arr;
|
|
2294
|
+
};
|
|
2295
|
+
var createNestedObject = (arr, lastValue) => {
|
|
2296
|
+
const nestedObject = {};
|
|
2297
|
+
if (arr.length === 0) {
|
|
2298
|
+
return lastValue;
|
|
2299
|
+
}
|
|
2300
|
+
arr.reduce((obj, value, index) => {
|
|
2301
|
+
if (!obj[value]) {
|
|
2302
|
+
obj[value] = {};
|
|
2303
|
+
}
|
|
2304
|
+
if (index === arr.length - 1 && lastValue) {
|
|
2305
|
+
obj[value] = lastValue;
|
|
2306
|
+
}
|
|
2307
|
+
return obj[value];
|
|
2308
|
+
}, nestedObject);
|
|
2309
|
+
return nestedObject;
|
|
2310
|
+
};
|
|
2311
|
+
var removeValueFromArray = (arr, value) => {
|
|
2312
|
+
const index = arr.indexOf(value);
|
|
2313
|
+
if (index > -1) {
|
|
2314
|
+
const newArray = [...arr];
|
|
2315
|
+
newArray.splice(index, 1);
|
|
2316
|
+
return newArray;
|
|
2317
|
+
}
|
|
2318
|
+
return arr;
|
|
2319
|
+
};
|
|
2320
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
2321
|
+
return arr.filter((item) => item !== value);
|
|
2322
|
+
};
|
|
2323
|
+
var addItemAfterEveryElement = (array, item) => {
|
|
2324
|
+
const result = [];
|
|
2325
|
+
for (let i = 0; i < array.length; i++) {
|
|
2326
|
+
result.push(array[i]);
|
|
2327
|
+
if (i < array.length - 1) {
|
|
2328
|
+
result.push(item);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
return result;
|
|
2332
|
+
};
|
|
2333
|
+
var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
|
|
2334
|
+
const newArray = [...array];
|
|
2335
|
+
const indexToMove = newArray.indexOf(valueToMove);
|
|
2336
|
+
const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
|
|
2337
|
+
if (indexToMove !== -1 && indexToInsertBefore !== -1) {
|
|
2338
|
+
const removedItem = newArray.splice(indexToMove, 1)[0];
|
|
2339
|
+
const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
|
|
2340
|
+
newArray.splice(insertIndex, 0, removedItem);
|
|
2341
|
+
}
|
|
2342
|
+
return newArray;
|
|
2343
|
+
};
|
|
2344
|
+
var arraysEqual = (arr1, arr2) => {
|
|
2345
|
+
if (arr1.length !== arr2.length) {
|
|
2346
|
+
return false;
|
|
2347
|
+
}
|
|
2348
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
2349
|
+
if (arr1[i] !== arr2[i]) {
|
|
2350
|
+
return false;
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
return true;
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
});
|
|
2357
|
+
var require_string2 = __commonJS2({
|
|
2358
|
+
"../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
|
|
2359
|
+
"use strict";
|
|
2360
|
+
var __defProp22 = Object.defineProperty;
|
|
2361
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2362
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2363
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2364
|
+
var __export22 = (target, all) => {
|
|
2365
|
+
for (var name in all)
|
|
2366
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2367
|
+
};
|
|
2368
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2369
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2370
|
+
for (let key of __getOwnPropNames22(from))
|
|
2371
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2372
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2373
|
+
}
|
|
2374
|
+
return to;
|
|
2375
|
+
};
|
|
2376
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2377
|
+
var string_exports = {};
|
|
2378
|
+
__export22(string_exports, {
|
|
2379
|
+
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
2380
|
+
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
2381
|
+
findKeyPosition: () => findKeyPosition,
|
|
2382
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
2383
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
2384
|
+
replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
|
|
2385
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
2386
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
2387
|
+
});
|
|
2388
|
+
module2.exports = __toCommonJS22(string_exports);
|
|
2389
|
+
var stringIncludesAny = (str, characters) => {
|
|
2390
|
+
for (const char of characters) {
|
|
2391
|
+
if (str.includes(char)) {
|
|
2392
|
+
return true;
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
return false;
|
|
2396
|
+
};
|
|
2397
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
2398
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
2399
|
+
return str.replace(pattern, "");
|
|
2400
|
+
};
|
|
2401
|
+
var brackRegex = {
|
|
2402
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
2403
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
2404
|
+
};
|
|
2405
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
2406
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
2407
|
+
return str;
|
|
2408
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
2409
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
2410
|
+
if (parentPath) {
|
|
2411
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
2412
|
+
let parentState = state;
|
|
2413
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
2414
|
+
parentState = parentState.parent;
|
|
2415
|
+
if (!parentState) {
|
|
2416
|
+
return "";
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
const value = parentState[variable.trim()];
|
|
2420
|
+
return value !== void 0 ? `${value}` : "";
|
|
2421
|
+
} else {
|
|
2422
|
+
const value = state[variable.trim()];
|
|
2423
|
+
return value !== void 0 ? `${value}` : "";
|
|
2424
|
+
}
|
|
2425
|
+
});
|
|
2426
|
+
};
|
|
2427
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
2428
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
2429
|
+
};
|
|
2430
|
+
var findKeyPosition = (str, key) => {
|
|
2431
|
+
const lines = str.split("\n");
|
|
2432
|
+
let startLineNumber = -1;
|
|
2433
|
+
let endLineNumber = -1;
|
|
2434
|
+
let startColumn = -1;
|
|
2435
|
+
let endColumn = -1;
|
|
2436
|
+
const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
|
|
2437
|
+
let braceCount = 0;
|
|
2438
|
+
let foundKey = false;
|
|
2439
|
+
for (let i = 0; i < lines.length; i++) {
|
|
2440
|
+
if (keyPattern.test(lines[i]) && !foundKey) {
|
|
2441
|
+
foundKey = true;
|
|
2442
|
+
startLineNumber = i + 1;
|
|
2443
|
+
startColumn = lines[i].indexOf(key) + 1;
|
|
2444
|
+
if (lines[i].includes("{}")) {
|
|
2445
|
+
endLineNumber = startLineNumber;
|
|
2446
|
+
endColumn = lines[i].indexOf("{}") + 3;
|
|
2447
|
+
break;
|
|
2448
|
+
}
|
|
2449
|
+
const line = lines[i].slice(startColumn + key.length);
|
|
2450
|
+
if (line.includes("{") || line.includes("[")) {
|
|
2451
|
+
braceCount = 1;
|
|
2452
|
+
} else {
|
|
2453
|
+
endLineNumber = i + 1;
|
|
2454
|
+
endColumn = lines[i].length + 1;
|
|
2455
|
+
break;
|
|
2456
|
+
}
|
|
2457
|
+
} else if (foundKey) {
|
|
2458
|
+
braceCount += (lines[i].match(/{/g) || []).length;
|
|
2459
|
+
braceCount += (lines[i].match(/\[/g) || []).length;
|
|
2460
|
+
braceCount -= (lines[i].match(/}/g) || []).length;
|
|
2461
|
+
braceCount -= (lines[i].match(/]/g) || []).length;
|
|
2462
|
+
if (braceCount === 0) {
|
|
2463
|
+
endLineNumber = i + 1;
|
|
2464
|
+
endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
|
|
2465
|
+
break;
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
return {
|
|
2470
|
+
startColumn,
|
|
2471
|
+
endColumn,
|
|
2472
|
+
startLineNumber,
|
|
2473
|
+
endLineNumber
|
|
2474
|
+
};
|
|
2475
|
+
};
|
|
2476
|
+
var replaceOctalEscapeSequences = (str) => {
|
|
2477
|
+
const octalRegex = /\\([0-7]{1,3})/g;
|
|
2478
|
+
return str.replace(octalRegex, (match, p1) => {
|
|
2479
|
+
const octalValue = parseInt(p1, 8);
|
|
2480
|
+
const char = String.fromCharCode(octalValue);
|
|
2481
|
+
return char;
|
|
2482
|
+
});
|
|
2483
|
+
};
|
|
2484
|
+
var customEncodeURIComponent = (str) => {
|
|
2485
|
+
return str.split("").map((char) => {
|
|
2486
|
+
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
2487
|
+
return "%" + char.charCodeAt(0).toString(16).toUpperCase();
|
|
2488
|
+
}
|
|
2489
|
+
return char;
|
|
2490
|
+
}).join("");
|
|
2491
|
+
};
|
|
2492
|
+
var customDecodeURIComponent = (encodedStr) => {
|
|
2493
|
+
return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2497
|
+
var require_object2 = __commonJS2({
|
|
2498
|
+
"../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
|
|
2499
|
+
"use strict";
|
|
2500
|
+
var __defProp22 = Object.defineProperty;
|
|
2501
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2502
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2503
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2504
|
+
var __export22 = (target, all) => {
|
|
2505
|
+
for (var name in all)
|
|
2506
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2507
|
+
};
|
|
2508
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2509
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2510
|
+
for (let key of __getOwnPropNames22(from))
|
|
2511
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2512
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2513
|
+
}
|
|
2514
|
+
return to;
|
|
2515
|
+
};
|
|
2516
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2517
|
+
var object_exports = {};
|
|
2518
|
+
__export22(object_exports, {
|
|
2519
|
+
checkIfKeyIsComponent: () => checkIfKeyIsComponent,
|
|
2520
|
+
clone: () => clone,
|
|
2521
|
+
createObjectWithoutPrototype: () => createObjectWithoutPrototype,
|
|
2522
|
+
deepClone: () => deepClone2,
|
|
2523
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
2524
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
2525
|
+
deepContains: () => deepContains,
|
|
2526
|
+
deepDestringify: () => deepDestringify,
|
|
2527
|
+
deepDiff: () => deepDiff,
|
|
2528
|
+
deepMerge: () => deepMerge3,
|
|
2529
|
+
deepStringify: () => deepStringify,
|
|
2530
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
2531
|
+
diff: () => diff,
|
|
2532
|
+
diffArrays: () => diffArrays,
|
|
2533
|
+
diffObjects: () => diffObjects,
|
|
2534
|
+
exec: () => exec,
|
|
2535
|
+
flattenRecursive: () => flattenRecursive,
|
|
2536
|
+
getChildrenComponentsByKey: () => getChildrenComponentsByKey,
|
|
2537
|
+
getExtendsInElement: () => getExtendsInElement,
|
|
2538
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
2539
|
+
isEmpty: () => isEmpty,
|
|
2540
|
+
isEmptyObject: () => isEmptyObject,
|
|
2541
|
+
isEqualDeep: () => isEqualDeep,
|
|
2542
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
2543
|
+
map: () => map,
|
|
2544
|
+
merge: () => merge5,
|
|
2545
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
2546
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
2547
|
+
objectToString: () => objectToString,
|
|
2548
|
+
overwrite: () => overwrite,
|
|
2549
|
+
overwriteDeep: () => overwriteDeep2,
|
|
2550
|
+
overwriteShallow: () => overwriteShallow,
|
|
2551
|
+
removeFromObject: () => removeFromObject,
|
|
2552
|
+
stringToObject: () => stringToObject
|
|
2553
|
+
});
|
|
2554
|
+
module2.exports = __toCommonJS22(object_exports);
|
|
2555
|
+
var import_globals3 = require_globals2();
|
|
2556
|
+
var import_types = require_types2();
|
|
2557
|
+
var import_array = require_array2();
|
|
2558
|
+
var import_string = require_string2();
|
|
2559
|
+
var exec = (param, element, state, context) => {
|
|
2560
|
+
if ((0, import_types.isFunction)(param)) {
|
|
2561
|
+
return param(
|
|
2562
|
+
element,
|
|
2563
|
+
state || element.state,
|
|
2564
|
+
context || element.context
|
|
2565
|
+
);
|
|
2566
|
+
}
|
|
2567
|
+
return param;
|
|
2568
|
+
};
|
|
2569
|
+
var map = (obj, extention, element) => {
|
|
2570
|
+
for (const e in extention) {
|
|
2571
|
+
obj[e] = exec(extention[e], element);
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
var merge5 = (element, obj, excludeFrom = []) => {
|
|
2575
|
+
for (const e in obj) {
|
|
2576
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
2577
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2578
|
+
continue;
|
|
2579
|
+
const elementProp = element[e];
|
|
2580
|
+
const objProp = obj[e];
|
|
2581
|
+
if (elementProp === void 0) {
|
|
2582
|
+
element[e] = objProp;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
return element;
|
|
2586
|
+
};
|
|
2587
|
+
var deepMerge3 = (element, extend, excludeFrom = []) => {
|
|
2588
|
+
for (const e in extend) {
|
|
2589
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
2590
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
2591
|
+
continue;
|
|
2592
|
+
const elementProp = element[e];
|
|
2593
|
+
const extendProp = extend[e];
|
|
2594
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
2595
|
+
deepMerge3(elementProp, extendProp, excludeFrom);
|
|
2596
|
+
} else if (elementProp === void 0) {
|
|
2597
|
+
element[e] = extendProp;
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
return element;
|
|
2601
|
+
};
|
|
2602
|
+
var clone = (obj, excludeFrom = []) => {
|
|
2603
|
+
const o = {};
|
|
2604
|
+
for (const prop in obj) {
|
|
2605
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2606
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2607
|
+
continue;
|
|
2608
|
+
o[prop] = obj[prop];
|
|
2609
|
+
}
|
|
2610
|
+
return o;
|
|
2611
|
+
};
|
|
2612
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
2613
|
+
if ((0, import_types.isArray)(obj)) {
|
|
2614
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2615
|
+
}
|
|
2616
|
+
const o = {};
|
|
2617
|
+
for (const k in obj) {
|
|
2618
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
2619
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
2620
|
+
continue;
|
|
2621
|
+
let v = obj[k];
|
|
2622
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
2623
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
2624
|
+
}
|
|
2625
|
+
if ((0, import_types.isArray)(v)) {
|
|
2626
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
2627
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
2628
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
2629
|
+
} else
|
|
2630
|
+
o[k] = v;
|
|
2631
|
+
}
|
|
2632
|
+
return o;
|
|
2633
|
+
};
|
|
2634
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
2635
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
2636
|
+
};
|
|
2637
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
2638
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2639
|
+
for (const prop in obj) {
|
|
2640
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2641
|
+
continue;
|
|
2642
|
+
if (prop === "__proto__")
|
|
2643
|
+
continue;
|
|
2644
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
2645
|
+
continue;
|
|
2646
|
+
let objProp = obj[prop];
|
|
2647
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
2648
|
+
continue;
|
|
2649
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
2650
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
2651
|
+
}
|
|
2652
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2653
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
2654
|
+
} else
|
|
2655
|
+
o[prop] = objProp;
|
|
2656
|
+
}
|
|
2657
|
+
return o;
|
|
2658
|
+
};
|
|
2659
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2660
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2661
|
+
for (const prop in obj) {
|
|
2662
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2663
|
+
continue;
|
|
2664
|
+
const objProp = obj[prop];
|
|
2665
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2666
|
+
continue;
|
|
2667
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2668
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2669
|
+
} else
|
|
2670
|
+
o[prop] = objProp;
|
|
2671
|
+
}
|
|
2672
|
+
return o;
|
|
2673
|
+
};
|
|
2674
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
2675
|
+
for (const prop in obj) {
|
|
2676
|
+
const objProp = obj[prop];
|
|
2677
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
2678
|
+
stringified[prop] = objProp.toString();
|
|
2679
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2680
|
+
stringified[prop] = {};
|
|
2681
|
+
deepStringify(objProp, stringified[prop]);
|
|
2682
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2683
|
+
stringified[prop] = [];
|
|
2684
|
+
objProp.forEach((v, i) => {
|
|
2685
|
+
if ((0, import_types.isObject)(v)) {
|
|
2686
|
+
stringified[prop][i] = {};
|
|
2687
|
+
deepStringify(v, stringified[prop][i]);
|
|
2688
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
2689
|
+
stringified[prop][i] = v.toString();
|
|
2690
|
+
} else {
|
|
2691
|
+
stringified[prop][i] = v;
|
|
2692
|
+
}
|
|
2693
|
+
});
|
|
2694
|
+
} else {
|
|
2695
|
+
stringified[prop] = objProp;
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2698
|
+
return stringified;
|
|
2699
|
+
};
|
|
2700
|
+
var objectToString = (obj = {}, indent = 0) => {
|
|
2701
|
+
const spaces = " ".repeat(indent);
|
|
2702
|
+
let str = "{\n";
|
|
2703
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2704
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2705
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2706
|
+
str += `${spaces} ${stringedKey}: `;
|
|
2707
|
+
if ((0, import_types.isArray)(value)) {
|
|
2708
|
+
str += "[\n";
|
|
2709
|
+
for (const element of value) {
|
|
2710
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2711
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2712
|
+
`;
|
|
2713
|
+
} else if ((0, import_types.isString)(element)) {
|
|
2714
|
+
str += `${spaces} '${element}',
|
|
2715
|
+
`;
|
|
2716
|
+
} else {
|
|
2717
|
+
str += `${spaces} ${element},
|
|
2718
|
+
`;
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
str += `${spaces} ]`;
|
|
2722
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2723
|
+
str += objectToString(value, indent + 1);
|
|
2724
|
+
} else if ((0, import_types.isString)(value)) {
|
|
2725
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2726
|
+
} else {
|
|
2727
|
+
str += value;
|
|
2728
|
+
}
|
|
2729
|
+
str += ",\n";
|
|
2730
|
+
}
|
|
2731
|
+
str += `${spaces}}`;
|
|
2732
|
+
return str;
|
|
2733
|
+
};
|
|
2734
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2735
|
+
for (const prop in obj) {
|
|
2736
|
+
const objProp = obj[prop];
|
|
2737
|
+
if ((0, import_types.isFunction)(objProp))
|
|
2738
|
+
continue;
|
|
2739
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
2740
|
+
detached[prop] = {};
|
|
2741
|
+
deepStringify(objProp, detached[prop]);
|
|
2742
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2743
|
+
detached[prop] = [];
|
|
2744
|
+
objProp.forEach((v, i) => {
|
|
2745
|
+
if ((0, import_types.isFunction)(v))
|
|
2746
|
+
return;
|
|
2747
|
+
if ((0, import_types.isObject)(v)) {
|
|
2748
|
+
detached[prop][i] = {};
|
|
2749
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2750
|
+
} else {
|
|
2751
|
+
detached[prop][i] = v;
|
|
2752
|
+
}
|
|
2753
|
+
});
|
|
2754
|
+
} else {
|
|
2755
|
+
detached[prop] = objProp;
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
return detached;
|
|
2759
|
+
};
|
|
2760
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
2761
|
+
for (const prop in obj) {
|
|
2762
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2763
|
+
if (!hasOwnProperty2)
|
|
2764
|
+
continue;
|
|
2765
|
+
const objProp = obj[prop];
|
|
2766
|
+
if ((0, import_types.isString)(objProp)) {
|
|
2767
|
+
if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2768
|
+
try {
|
|
2769
|
+
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2770
|
+
destringified[prop] = evalProp;
|
|
2771
|
+
} catch (e) {
|
|
2772
|
+
if (e)
|
|
2773
|
+
destringified[prop] = objProp;
|
|
2774
|
+
}
|
|
2775
|
+
} else {
|
|
2776
|
+
destringified[prop] = objProp;
|
|
2777
|
+
}
|
|
2778
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2779
|
+
destringified[prop] = [];
|
|
2780
|
+
objProp.forEach((arrProp) => {
|
|
2781
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
2782
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2783
|
+
try {
|
|
2784
|
+
const evalProp = import_globals3.window.eval(`(${arrProp})`);
|
|
2785
|
+
destringified[prop].push(evalProp);
|
|
2786
|
+
} catch (e) {
|
|
2787
|
+
if (e)
|
|
2788
|
+
destringified[prop].push(arrProp);
|
|
2789
|
+
}
|
|
2790
|
+
} else {
|
|
2791
|
+
destringified[prop].push(arrProp);
|
|
2792
|
+
}
|
|
2793
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2794
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
2795
|
+
} else {
|
|
2796
|
+
destringified[prop].push(arrProp);
|
|
2797
|
+
}
|
|
2798
|
+
});
|
|
2799
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2800
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2801
|
+
} else {
|
|
2802
|
+
destringified[prop] = objProp;
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
return destringified;
|
|
2806
|
+
};
|
|
2807
|
+
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2808
|
+
try {
|
|
2809
|
+
return import_globals3.window.eval("(" + str + ")");
|
|
2810
|
+
} catch (e) {
|
|
2811
|
+
if (opts.verbose)
|
|
2812
|
+
console.warn(e);
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
2816
|
+
for (const e in objToDiff) {
|
|
2817
|
+
if (e === "ref")
|
|
2818
|
+
continue;
|
|
2819
|
+
const originalProp = original[e];
|
|
2820
|
+
const objToDiffProp = objToDiff[e];
|
|
2821
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2822
|
+
cache[e] = {};
|
|
2823
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
2824
|
+
} else if (objToDiffProp !== void 0) {
|
|
2825
|
+
cache[e] = objToDiffProp;
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
return cache;
|
|
2829
|
+
};
|
|
2830
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
2831
|
+
if (original.length !== objToDiff.length) {
|
|
2832
|
+
cache = objToDiff;
|
|
2833
|
+
} else {
|
|
2834
|
+
const diffArr = [];
|
|
2835
|
+
for (let i = 0; i < original.length; i++) {
|
|
2836
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
2837
|
+
if (Object.keys(diffObj).length > 0) {
|
|
2838
|
+
diffArr.push(diffObj);
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
if (diffArr.length > 0) {
|
|
2842
|
+
cache = diffArr;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
return cache;
|
|
2846
|
+
};
|
|
2847
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
2848
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2849
|
+
cache = [];
|
|
2850
|
+
diffArrays(original, objToDiff, cache);
|
|
2851
|
+
} else {
|
|
2852
|
+
diffObjects(original, objToDiff, cache);
|
|
2853
|
+
}
|
|
2854
|
+
return cache;
|
|
2855
|
+
};
|
|
2856
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2857
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2858
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2859
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2860
|
+
var deepDiff = (lhs, rhs) => {
|
|
2861
|
+
if (lhs === rhs)
|
|
2862
|
+
return {};
|
|
2863
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2864
|
+
return rhs;
|
|
2865
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2866
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
2867
|
+
acc[key] = void 0;
|
|
2868
|
+
}
|
|
2869
|
+
return acc;
|
|
2870
|
+
}, makeObjectWithoutPrototype());
|
|
2871
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2872
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
2873
|
+
return {};
|
|
2874
|
+
return rhs;
|
|
2875
|
+
}
|
|
2876
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
2877
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
2878
|
+
acc[key] = rhs[key];
|
|
2879
|
+
return acc;
|
|
2880
|
+
}
|
|
2881
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
2882
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2883
|
+
return acc;
|
|
2884
|
+
}
|
|
2885
|
+
acc[key] = difference;
|
|
2886
|
+
return acc;
|
|
2887
|
+
}, deletedValues);
|
|
2888
|
+
};
|
|
2889
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
2890
|
+
const { ref } = element;
|
|
2891
|
+
const changes = {};
|
|
2892
|
+
for (const e in params) {
|
|
2893
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2894
|
+
continue;
|
|
2895
|
+
const elementProp = element[e];
|
|
2896
|
+
const paramsProp = params[e];
|
|
2897
|
+
if (paramsProp) {
|
|
2898
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
2899
|
+
ref[e] = paramsProp;
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
return changes;
|
|
2903
|
+
};
|
|
2904
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2905
|
+
for (const e in params) {
|
|
2906
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2907
|
+
continue;
|
|
2908
|
+
obj[e] = params[e];
|
|
2909
|
+
}
|
|
2910
|
+
return obj;
|
|
2911
|
+
};
|
|
2912
|
+
var overwriteDeep2 = (obj, params, excludeFrom = []) => {
|
|
2913
|
+
for (const e in params) {
|
|
2914
|
+
if (e === "__proto__")
|
|
2915
|
+
continue;
|
|
2916
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2917
|
+
continue;
|
|
2918
|
+
const objProp = obj[e];
|
|
2919
|
+
const paramsProp = params[e];
|
|
2920
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2921
|
+
overwriteDeep2(objProp, paramsProp);
|
|
2922
|
+
} else if (paramsProp !== void 0) {
|
|
2923
|
+
obj[e] = paramsProp;
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
return obj;
|
|
2927
|
+
};
|
|
2928
|
+
var mergeIfExisted = (a, b) => {
|
|
2929
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2930
|
+
return deepMerge3(a, b);
|
|
2931
|
+
return a || b;
|
|
2932
|
+
};
|
|
2933
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
2934
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2935
|
+
stack.push(objectized);
|
|
2936
|
+
const extendOfExtend = objectized[prop];
|
|
2937
|
+
if (extendOfExtend)
|
|
2938
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
2939
|
+
delete objectized[prop];
|
|
2940
|
+
return stack;
|
|
2941
|
+
};
|
|
2942
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2943
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2944
|
+
return param === element;
|
|
2945
|
+
}
|
|
2946
|
+
if (visited.has(param) || visited.has(element)) {
|
|
2947
|
+
return true;
|
|
2948
|
+
}
|
|
2949
|
+
visited.add(param);
|
|
2950
|
+
visited.add(element);
|
|
2951
|
+
const keysParam = Object.keys(param);
|
|
2952
|
+
const keysElement = Object.keys(element);
|
|
2953
|
+
if (keysParam.length !== keysElement.length) {
|
|
2954
|
+
return false;
|
|
2955
|
+
}
|
|
2956
|
+
for (const key of keysParam) {
|
|
2957
|
+
if (!keysElement.includes(key)) {
|
|
2958
|
+
return false;
|
|
2959
|
+
}
|
|
2960
|
+
const paramProp = param[key];
|
|
2961
|
+
const elementProp = element[key];
|
|
2962
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2963
|
+
return false;
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
return true;
|
|
2967
|
+
};
|
|
2968
|
+
var deepContains = (obj1, obj2) => {
|
|
2969
|
+
if (typeof obj1 !== typeof obj2) {
|
|
2970
|
+
return false;
|
|
2971
|
+
}
|
|
2972
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2973
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2974
|
+
if (obj1.length !== obj2.length) {
|
|
2975
|
+
return false;
|
|
2976
|
+
}
|
|
2977
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
2978
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
2979
|
+
return false;
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2983
|
+
for (const key in obj1) {
|
|
2984
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2985
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2986
|
+
return false;
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
} else {
|
|
2991
|
+
return obj2 === obj1;
|
|
2992
|
+
}
|
|
2993
|
+
return true;
|
|
2994
|
+
};
|
|
2995
|
+
var removeFromObject = (obj, props) => {
|
|
2996
|
+
if (props === void 0 || props === null)
|
|
2997
|
+
return obj;
|
|
2998
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
2999
|
+
delete obj[props];
|
|
3000
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
3001
|
+
props.forEach((prop) => delete obj[prop]);
|
|
3002
|
+
} else {
|
|
3003
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
3004
|
+
}
|
|
3005
|
+
return obj;
|
|
3006
|
+
};
|
|
3007
|
+
var createObjectWithoutPrototype = (obj) => {
|
|
3008
|
+
if (obj === null || typeof obj !== "object") {
|
|
3009
|
+
return obj;
|
|
3010
|
+
}
|
|
3011
|
+
const newObj = /* @__PURE__ */ Object.create(null);
|
|
3012
|
+
for (const key in obj) {
|
|
3013
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3014
|
+
newObj[key] = createObjectWithoutPrototype(obj[key]);
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
return newObj;
|
|
3018
|
+
};
|
|
3019
|
+
var checkIfKeyIsComponent = (key) => {
|
|
3020
|
+
const isFirstKeyString = (0, import_types.isString)(key);
|
|
3021
|
+
if (!isFirstKeyString)
|
|
3022
|
+
return;
|
|
3023
|
+
const firstCharKey = key.slice(0, 1);
|
|
3024
|
+
return /^[A-Z]*$/.test(firstCharKey);
|
|
3025
|
+
};
|
|
3026
|
+
var getChildrenComponentsByKey = (key, el) => {
|
|
3027
|
+
if (key === el.key || el.__ref.__componentKey === key) {
|
|
3028
|
+
return el;
|
|
3029
|
+
}
|
|
3030
|
+
if (el.extend) {
|
|
3031
|
+
const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
|
|
3032
|
+
const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
|
|
3033
|
+
if (foundString || foundInArray)
|
|
3034
|
+
return el;
|
|
3035
|
+
}
|
|
3036
|
+
};
|
|
3037
|
+
var getExtendsInElement = (obj) => {
|
|
3038
|
+
let result = [];
|
|
3039
|
+
function traverse(o) {
|
|
3040
|
+
for (const key in o) {
|
|
3041
|
+
if (Object.hasOwnProperty.call(o, key)) {
|
|
3042
|
+
if (checkIfKeyIsComponent(key)) {
|
|
3043
|
+
result.push(key);
|
|
3044
|
+
}
|
|
3045
|
+
if (key === "extend") {
|
|
3046
|
+
if (typeof o[key] === "string") {
|
|
3047
|
+
result.push(o[key]);
|
|
3048
|
+
} else if (Array.isArray(o[key])) {
|
|
3049
|
+
result = result.concat(o[key]);
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
if (typeof o[key] === "object" && o[key] !== null) {
|
|
3053
|
+
traverse(o[key]);
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
traverse(obj);
|
|
3059
|
+
return result;
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
});
|
|
3063
|
+
var require_function2 = __commonJS2({
|
|
3064
|
+
"../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
|
|
3065
|
+
"use strict";
|
|
3066
|
+
var __defProp22 = Object.defineProperty;
|
|
3067
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3068
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3069
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3070
|
+
var __export22 = (target, all) => {
|
|
3071
|
+
for (var name in all)
|
|
3072
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3073
|
+
};
|
|
3074
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3075
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3076
|
+
for (let key of __getOwnPropNames22(from))
|
|
3077
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3078
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3079
|
+
}
|
|
3080
|
+
return to;
|
|
3081
|
+
};
|
|
3082
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3083
|
+
var function_exports = {};
|
|
3084
|
+
__export22(function_exports, {
|
|
3085
|
+
debounce: () => debounce,
|
|
3086
|
+
debounceOnContext: () => debounceOnContext,
|
|
3087
|
+
isStringFunction: () => isStringFunction,
|
|
3088
|
+
memoize: () => memoize
|
|
3089
|
+
});
|
|
3090
|
+
module2.exports = __toCommonJS22(function_exports);
|
|
3091
|
+
function debounce(func, wait, immediate) {
|
|
3092
|
+
let timeout;
|
|
3093
|
+
return function() {
|
|
3094
|
+
const context = this;
|
|
3095
|
+
const args = arguments;
|
|
3096
|
+
const later = function() {
|
|
3097
|
+
timeout = null;
|
|
3098
|
+
if (!immediate)
|
|
3099
|
+
func.apply(context, args);
|
|
3100
|
+
};
|
|
3101
|
+
const callNow = immediate && !timeout;
|
|
3102
|
+
clearTimeout(timeout);
|
|
3103
|
+
timeout = setTimeout(later, wait);
|
|
3104
|
+
if (callNow)
|
|
3105
|
+
func.apply(context, args);
|
|
3106
|
+
};
|
|
3107
|
+
}
|
|
3108
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
3109
|
+
let timer;
|
|
3110
|
+
return (...args) => {
|
|
3111
|
+
clearTimeout(timer);
|
|
3112
|
+
timer = setTimeout(() => {
|
|
3113
|
+
func.apply(element, args);
|
|
3114
|
+
}, timeout);
|
|
3115
|
+
};
|
|
3116
|
+
};
|
|
3117
|
+
var memoize = (fn) => {
|
|
3118
|
+
const cache = {};
|
|
3119
|
+
return (...args) => {
|
|
3120
|
+
const n = args[0];
|
|
3121
|
+
if (n in cache) {
|
|
3122
|
+
return cache[n];
|
|
3123
|
+
} else {
|
|
3124
|
+
const result = fn(n);
|
|
3125
|
+
cache[n] = result;
|
|
3126
|
+
return result;
|
|
3127
|
+
}
|
|
3128
|
+
};
|
|
3129
|
+
};
|
|
3130
|
+
var isStringFunction = (inputString) => {
|
|
3131
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
3132
|
+
return functionRegex.test(inputString);
|
|
3133
|
+
};
|
|
3134
|
+
}
|
|
3135
|
+
});
|
|
3136
|
+
var require_log2 = __commonJS2({
|
|
3137
|
+
"../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
|
|
3138
|
+
"use strict";
|
|
3139
|
+
var __defProp22 = Object.defineProperty;
|
|
3140
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3141
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3142
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3143
|
+
var __export22 = (target, all) => {
|
|
3144
|
+
for (var name in all)
|
|
3145
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3146
|
+
};
|
|
3147
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3148
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3149
|
+
for (let key of __getOwnPropNames22(from))
|
|
3150
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3151
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3152
|
+
}
|
|
3153
|
+
return to;
|
|
3154
|
+
};
|
|
3155
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3156
|
+
var log_exports = {};
|
|
3157
|
+
__export22(log_exports, {
|
|
3158
|
+
logGroupIf: () => logGroupIf,
|
|
3159
|
+
logIf: () => logIf
|
|
3160
|
+
});
|
|
3161
|
+
module2.exports = __toCommonJS22(log_exports);
|
|
3162
|
+
var logIf = (bool, ...arg) => {
|
|
3163
|
+
if (bool)
|
|
3164
|
+
arg.map((v) => console.log(v));
|
|
3165
|
+
};
|
|
3166
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
3167
|
+
if (bool) {
|
|
3168
|
+
console.group(key);
|
|
3169
|
+
arg.map((v) => console.log(v));
|
|
3170
|
+
console.groupEnd(key);
|
|
3171
|
+
}
|
|
3172
|
+
};
|
|
3173
|
+
}
|
|
3174
|
+
});
|
|
3175
|
+
var require_cookie2 = __commonJS2({
|
|
3176
|
+
"../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
3177
|
+
"use strict";
|
|
3178
|
+
var __defProp22 = Object.defineProperty;
|
|
3179
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3180
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3181
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3182
|
+
var __export22 = (target, all) => {
|
|
3183
|
+
for (var name in all)
|
|
3184
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3185
|
+
};
|
|
3186
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3187
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3188
|
+
for (let key of __getOwnPropNames22(from))
|
|
3189
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3190
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3191
|
+
}
|
|
3192
|
+
return to;
|
|
3193
|
+
};
|
|
3194
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3195
|
+
var cookie_exports = {};
|
|
3196
|
+
__export22(cookie_exports, {
|
|
3197
|
+
getCookie: () => getCookie,
|
|
3198
|
+
isMobile: () => isMobile,
|
|
3199
|
+
setCookie: () => setCookie
|
|
3200
|
+
});
|
|
3201
|
+
module2.exports = __toCommonJS22(cookie_exports);
|
|
3202
|
+
var import_types = require_types2();
|
|
3203
|
+
var import_utils32 = require_cjs3();
|
|
3204
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
3205
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
3206
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3207
|
+
return;
|
|
3208
|
+
const d = /* @__PURE__ */ new Date();
|
|
3209
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
3210
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
3211
|
+
import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
3212
|
+
};
|
|
3213
|
+
var getCookie = (cname) => {
|
|
3214
|
+
if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
|
|
3215
|
+
return;
|
|
3216
|
+
const name = `${cname}=`;
|
|
3217
|
+
const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
|
|
3218
|
+
const ca = decodedCookie.split(";");
|
|
3219
|
+
for (let i = 0; i < ca.length; i++) {
|
|
3220
|
+
let c = ca[i];
|
|
3221
|
+
while (c.charAt(0) === " ")
|
|
3222
|
+
c = c.substring(1);
|
|
3223
|
+
if (c.indexOf(name) === 0)
|
|
3224
|
+
return c.substring(name.length, c.length);
|
|
3225
|
+
}
|
|
3226
|
+
return "";
|
|
3227
|
+
};
|
|
3228
|
+
}
|
|
3229
|
+
});
|
|
3230
|
+
var require_tags2 = __commonJS2({
|
|
3231
|
+
"../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
|
|
3232
|
+
"use strict";
|
|
3233
|
+
var __defProp22 = Object.defineProperty;
|
|
3234
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3235
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3236
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3237
|
+
var __export22 = (target, all) => {
|
|
3238
|
+
for (var name in all)
|
|
3239
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
3240
|
+
};
|
|
3241
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3242
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3243
|
+
for (let key of __getOwnPropNames22(from))
|
|
3244
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3245
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3246
|
+
}
|
|
3247
|
+
return to;
|
|
3248
|
+
};
|
|
3249
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3250
|
+
var tags_exports = {};
|
|
3251
|
+
__export22(tags_exports, {
|
|
3252
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
3253
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
3254
|
+
});
|
|
3255
|
+
module2.exports = __toCommonJS22(tags_exports);
|
|
3256
|
+
var HTML_TAGS = {
|
|
3257
|
+
root: [
|
|
3258
|
+
"body",
|
|
3259
|
+
"html"
|
|
3260
|
+
],
|
|
3261
|
+
head: [
|
|
3262
|
+
"title",
|
|
3263
|
+
"base",
|
|
3264
|
+
"meta",
|
|
3265
|
+
"style"
|
|
3266
|
+
],
|
|
3267
|
+
body: [
|
|
3268
|
+
"string",
|
|
3269
|
+
"fragment",
|
|
3270
|
+
"a",
|
|
3271
|
+
"abbr",
|
|
3272
|
+
"acronym",
|
|
3273
|
+
"address",
|
|
3274
|
+
"applet",
|
|
3275
|
+
"area",
|
|
3276
|
+
"article",
|
|
3277
|
+
"aside",
|
|
3278
|
+
"audio",
|
|
3279
|
+
"b",
|
|
3280
|
+
"basefont",
|
|
3281
|
+
"bdi",
|
|
3282
|
+
"bdo",
|
|
3283
|
+
"big",
|
|
3284
|
+
"blockquote",
|
|
3285
|
+
"br",
|
|
3286
|
+
"button",
|
|
3287
|
+
"canvas",
|
|
3288
|
+
"caption",
|
|
3289
|
+
"center",
|
|
3290
|
+
"cite",
|
|
3291
|
+
"code",
|
|
3292
|
+
"search",
|
|
3293
|
+
"col",
|
|
3294
|
+
"colgroup",
|
|
3295
|
+
"data",
|
|
3296
|
+
"datalist",
|
|
3297
|
+
"dd",
|
|
3298
|
+
"del",
|
|
3299
|
+
"details",
|
|
3300
|
+
"dfn",
|
|
3301
|
+
"dialog",
|
|
3302
|
+
"dir",
|
|
3303
|
+
"div",
|
|
3304
|
+
"dl",
|
|
3305
|
+
"dt",
|
|
3306
|
+
"em",
|
|
3307
|
+
"embed",
|
|
3308
|
+
"fieldset",
|
|
3309
|
+
"figcaption",
|
|
3310
|
+
"figure",
|
|
3311
|
+
"font",
|
|
3312
|
+
"footer",
|
|
3313
|
+
"form",
|
|
3314
|
+
"frame",
|
|
3315
|
+
"frameset",
|
|
3316
|
+
"h1",
|
|
3317
|
+
"h2",
|
|
3318
|
+
"h3",
|
|
3319
|
+
"h4",
|
|
3320
|
+
"h5",
|
|
3321
|
+
"h6",
|
|
3322
|
+
"head",
|
|
3323
|
+
"header",
|
|
3324
|
+
"hr",
|
|
3325
|
+
"i",
|
|
3326
|
+
"iframe",
|
|
3327
|
+
"img",
|
|
3328
|
+
"input",
|
|
3329
|
+
"ins",
|
|
3330
|
+
"kbd",
|
|
3331
|
+
"label",
|
|
3332
|
+
"legend",
|
|
3333
|
+
"li",
|
|
3334
|
+
"link",
|
|
3335
|
+
"main",
|
|
3336
|
+
"map",
|
|
3337
|
+
"mark",
|
|
3338
|
+
"meter",
|
|
3339
|
+
"nav",
|
|
3340
|
+
"noframes",
|
|
3341
|
+
"noscript",
|
|
3342
|
+
"object",
|
|
3343
|
+
"ol",
|
|
3344
|
+
"optgroup",
|
|
3345
|
+
"option",
|
|
3346
|
+
"output",
|
|
3347
|
+
"p",
|
|
3348
|
+
"param",
|
|
3349
|
+
"picture",
|
|
3350
|
+
"pre",
|
|
3351
|
+
"progress",
|
|
3352
|
+
"hgroup",
|
|
3353
|
+
"q",
|
|
3354
|
+
"rp",
|
|
3355
|
+
"rt",
|
|
3356
|
+
"ruby",
|
|
3357
|
+
"s",
|
|
3358
|
+
"samp",
|
|
3359
|
+
"script",
|
|
3360
|
+
"section",
|
|
3361
|
+
"select",
|
|
3362
|
+
"small",
|
|
3363
|
+
"source",
|
|
3364
|
+
"span",
|
|
3365
|
+
"strike",
|
|
3366
|
+
"strong",
|
|
3367
|
+
"sub",
|
|
3368
|
+
"summary",
|
|
3369
|
+
"sup",
|
|
3370
|
+
"table",
|
|
3371
|
+
"tbody",
|
|
3372
|
+
"td",
|
|
3373
|
+
"template",
|
|
3374
|
+
"hgroup",
|
|
3375
|
+
"textarea",
|
|
3376
|
+
"tfoot",
|
|
3377
|
+
"th",
|
|
3378
|
+
"thead",
|
|
3379
|
+
"time",
|
|
3380
|
+
"tr",
|
|
3381
|
+
"track",
|
|
3382
|
+
"tt",
|
|
3383
|
+
"u",
|
|
3384
|
+
"ul",
|
|
3385
|
+
"var",
|
|
3386
|
+
"video",
|
|
3387
|
+
"wbr",
|
|
3388
|
+
// SVG
|
|
3389
|
+
"svg",
|
|
3390
|
+
"path"
|
|
3391
|
+
]
|
|
3392
|
+
};
|
|
3393
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
3394
|
+
}
|
|
3395
|
+
});
|
|
3396
|
+
var require_cjs3 = __commonJS2({
|
|
3397
|
+
"../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
|
|
3398
|
+
"use strict";
|
|
3399
|
+
var __defProp22 = Object.defineProperty;
|
|
3400
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
3401
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
3402
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
3403
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
3404
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
3405
|
+
for (let key of __getOwnPropNames22(from))
|
|
3406
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
3407
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
3408
|
+
}
|
|
3409
|
+
return to;
|
|
3410
|
+
};
|
|
3411
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
3412
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
3413
|
+
var utils_exports = {};
|
|
3414
|
+
module2.exports = __toCommonJS22(utils_exports);
|
|
3415
|
+
__reExport(utils_exports, require_key2(), module2.exports);
|
|
3416
|
+
__reExport(utils_exports, require_env2(), module2.exports);
|
|
3417
|
+
__reExport(utils_exports, require_types2(), module2.exports);
|
|
3418
|
+
__reExport(utils_exports, require_object2(), module2.exports);
|
|
3419
|
+
__reExport(utils_exports, require_function2(), module2.exports);
|
|
3420
|
+
__reExport(utils_exports, require_array2(), module2.exports);
|
|
3421
|
+
__reExport(utils_exports, require_node2(), module2.exports);
|
|
3422
|
+
__reExport(utils_exports, require_log2(), module2.exports);
|
|
3423
|
+
__reExport(utils_exports, require_string2(), module2.exports);
|
|
3424
|
+
__reExport(utils_exports, require_globals2(), module2.exports);
|
|
3425
|
+
__reExport(utils_exports, require_cookie2(), module2.exports);
|
|
3426
|
+
__reExport(utils_exports, require_tags2(), module2.exports);
|
|
3427
|
+
}
|
|
3428
|
+
});
|
|
3429
|
+
var src_exports = {};
|
|
3430
|
+
__export2(src_exports, {
|
|
3431
|
+
arrayzeValue: () => arrayzeValue,
|
|
3432
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
3433
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
3434
|
+
findClosestNumber: () => findClosestNumber,
|
|
3435
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
3436
|
+
formatDate: () => formatDate,
|
|
3437
|
+
isPhoto: () => isPhoto,
|
|
3438
|
+
loadCssFile: () => loadCssFile,
|
|
3439
|
+
loadJavascript: () => loadJavascript,
|
|
3440
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
3441
|
+
removeChars: () => removeChars,
|
|
3442
|
+
toCamelCase: () => toCamelCase,
|
|
3443
|
+
toDashCase: () => toDashCase,
|
|
3444
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
3445
|
+
toTitleCase: () => toTitleCase,
|
|
3446
|
+
toggleFullscreen: () => toggleFullscreen
|
|
3447
|
+
});
|
|
3448
|
+
module.exports = __toCommonJS2(src_exports);
|
|
3449
|
+
var import_utils22 = __toESM2(require_cjs3(), 1);
|
|
3450
|
+
var toggleFullscreen = (el) => {
|
|
3451
|
+
if (!document.fullscreenElement) {
|
|
3452
|
+
el.node.requestFullscreen().catch((err) => {
|
|
3453
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
3454
|
+
});
|
|
3455
|
+
} else {
|
|
3456
|
+
document.exitFullscreen();
|
|
3457
|
+
}
|
|
3458
|
+
};
|
|
3459
|
+
var import_utils3 = __toESM2(require_cjs3(), 1);
|
|
3460
|
+
var findClosestNumber = (number, arr) => {
|
|
3461
|
+
return ((0, import_utils3.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
3462
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
3463
|
+
});
|
|
3143
3464
|
};
|
|
3144
|
-
var
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3465
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
3466
|
+
val = parseFloat(val);
|
|
3467
|
+
if ((0, import_utils3.isObject)(factory))
|
|
3468
|
+
factory = Object.values(factory);
|
|
3469
|
+
return findClosestNumber(val, factory);
|
|
3148
3470
|
};
|
|
3149
|
-
var
|
|
3150
|
-
|
|
3471
|
+
var formatDate = (timestamp) => {
|
|
3472
|
+
if (!timestamp)
|
|
3473
|
+
return "";
|
|
3474
|
+
const d = new Date(timestamp);
|
|
3475
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
3476
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
3477
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
3478
|
+
return `${da} ${mo}, ${ye}`;
|
|
3151
3479
|
};
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3480
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
3481
|
+
const fib = [0, 1];
|
|
3482
|
+
for (let i = 2; i <= n; i++) {
|
|
3483
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
3484
|
+
}
|
|
3485
|
+
return fib[n];
|
|
3156
3486
|
};
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3487
|
+
var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
3488
|
+
return new Promise((resolve, reject) => {
|
|
3489
|
+
try {
|
|
3490
|
+
const scriptEle = doc.createElement("script");
|
|
3491
|
+
scriptEle.type = type;
|
|
3492
|
+
scriptEle.async = async;
|
|
3493
|
+
scriptEle.src = FILE_URL;
|
|
3494
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
3495
|
+
resolve({
|
|
3496
|
+
status: true
|
|
3497
|
+
});
|
|
3498
|
+
});
|
|
3499
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
3500
|
+
reject({
|
|
3501
|
+
status: false,
|
|
3502
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
3503
|
+
});
|
|
3504
|
+
});
|
|
3505
|
+
doc.body.appendChild(scriptEle);
|
|
3506
|
+
} catch (error) {
|
|
3507
|
+
reject(error);
|
|
3169
3508
|
}
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
elem.style.color = color;
|
|
3187
|
-
if (elem.style.color === flag || elem.style.color === "") {
|
|
3188
|
-
import_globals.document.body.removeChild(elem);
|
|
3189
|
-
return [0, 0, 0, 0];
|
|
3190
|
-
}
|
|
3191
|
-
color = import_globals.window.getComputedStyle(elem).color;
|
|
3192
|
-
import_globals.document.body.removeChild(elem);
|
|
3509
|
+
});
|
|
3510
|
+
};
|
|
3511
|
+
var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
3512
|
+
return new Promise((resolve, reject) => {
|
|
3513
|
+
try {
|
|
3514
|
+
const linkElem = doc.createElement("link");
|
|
3515
|
+
linkElem.rel = "stylesheet";
|
|
3516
|
+
linkElem.href = FILE_URL;
|
|
3517
|
+
linkElem.addEventListener("load", (ev) => {
|
|
3518
|
+
resolve({
|
|
3519
|
+
status: true
|
|
3520
|
+
});
|
|
3521
|
+
});
|
|
3522
|
+
doc.head.appendChild(linkElem);
|
|
3523
|
+
} catch (error) {
|
|
3524
|
+
reject(error);
|
|
3193
3525
|
}
|
|
3194
|
-
}
|
|
3195
|
-
if (color.indexOf("rgb") === 0) {
|
|
3196
|
-
if (color.indexOf("rgba") === -1)
|
|
3197
|
-
color = `${color}, 1`;
|
|
3198
|
-
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
3199
|
-
}
|
|
3200
|
-
return [0, 0, 0, 0];
|
|
3526
|
+
});
|
|
3201
3527
|
};
|
|
3202
|
-
var
|
|
3203
|
-
|
|
3204
|
-
|
|
3528
|
+
var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
|
|
3529
|
+
try {
|
|
3530
|
+
const scriptEle = doc.createElement("script");
|
|
3531
|
+
scriptEle.type = type;
|
|
3532
|
+
scriptEle.async = async;
|
|
3533
|
+
scriptEle.id = id;
|
|
3534
|
+
scriptEle.innerHTML = body;
|
|
3535
|
+
doc.body.appendChild(scriptEle);
|
|
3536
|
+
} catch (error) {
|
|
3537
|
+
console.warn(error);
|
|
3538
|
+
}
|
|
3205
3539
|
};
|
|
3206
|
-
var
|
|
3207
|
-
|
|
3540
|
+
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
3541
|
+
var copyStringToClipboard = (str) => {
|
|
3542
|
+
const el = document.createElement("textarea");
|
|
3543
|
+
el.value = str;
|
|
3544
|
+
el.setAttribute("readonly", "");
|
|
3545
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
3546
|
+
document.body.appendChild(el);
|
|
3547
|
+
el.select();
|
|
3548
|
+
document.execCommand("copy");
|
|
3549
|
+
document.body.removeChild(el);
|
|
3208
3550
|
};
|
|
3209
|
-
var
|
|
3210
|
-
|
|
3211
|
-
const n = a - Math.min(r, g, b);
|
|
3212
|
-
const f = 1 - Math.abs(a + a - n - 1);
|
|
3213
|
-
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
3214
|
-
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
3551
|
+
var removeChars = (str) => {
|
|
3552
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
3215
3553
|
};
|
|
3216
|
-
var
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
)
|
|
3220
|
-
var getColorShade = (col, amt) => {
|
|
3221
|
-
const num = parseInt(col, 16);
|
|
3222
|
-
let r = (num >> 16) + amt;
|
|
3223
|
-
if (r > 255)
|
|
3224
|
-
r = 255;
|
|
3225
|
-
else if (r < 0)
|
|
3226
|
-
r = 0;
|
|
3227
|
-
let b = (num >> 8 & 255) + amt;
|
|
3228
|
-
if (b > 255)
|
|
3229
|
-
b = 255;
|
|
3230
|
-
else if (b < 0)
|
|
3231
|
-
b = 0;
|
|
3232
|
-
let g = (num & 255) + amt;
|
|
3233
|
-
if (g > 255)
|
|
3234
|
-
g = 255;
|
|
3235
|
-
else if (g < 0)
|
|
3236
|
-
g = 0;
|
|
3237
|
-
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
3554
|
+
var toCamelCase = (str) => {
|
|
3555
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
3556
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
3557
|
+
}).replaceAll(/\s+/g, "");
|
|
3238
3558
|
};
|
|
3239
|
-
var
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
3244
|
-
if ((0, import_utils2.isNumber)(tone))
|
|
3245
|
-
tone += "";
|
|
3246
|
-
const toHex = rgbArrayToHex(rgb);
|
|
3247
|
-
const abs = tone.slice(0, 1);
|
|
3248
|
-
if (abs === "-" || abs === "+") {
|
|
3249
|
-
const colorShade = getColorShade(toHex, parseFloat(tone));
|
|
3250
|
-
return hexToRgbArray(colorShade).join(", ");
|
|
3251
|
-
} else {
|
|
3252
|
-
const [r, g, b] = rgb;
|
|
3253
|
-
const hsl = rgbToHSL(r, g, b);
|
|
3254
|
-
const [h, s, l] = hsl;
|
|
3255
|
-
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
3256
|
-
return newRgb;
|
|
3559
|
+
var toTitleCase = (str) => str && str.replace(
|
|
3560
|
+
/\w\S*/g,
|
|
3561
|
+
(txt) => {
|
|
3562
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
3257
3563
|
}
|
|
3564
|
+
);
|
|
3565
|
+
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
3566
|
+
var toDescriptionCase = (str = "") => {
|
|
3567
|
+
if (typeof str !== "string")
|
|
3568
|
+
return;
|
|
3569
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
3570
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
3258
3571
|
};
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
if (
|
|
3263
|
-
return
|
|
3264
|
-
if (
|
|
3265
|
-
return
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
};
|
|
3269
|
-
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
3270
|
-
var setCustomFont = (name, url, weight) => `
|
|
3271
|
-
font-family: '${name}';
|
|
3272
|
-
font-style: normal;
|
|
3273
|
-
${weight && `font-weight: ${weight};`}
|
|
3274
|
-
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
3275
|
-
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
3276
|
-
${setCustomFont(name, url, weight)}
|
|
3277
|
-
}`;
|
|
3278
|
-
var getFontFaceEach = (name, weights) => {
|
|
3279
|
-
const keys = Object.keys(weights);
|
|
3280
|
-
return keys.map((key) => {
|
|
3281
|
-
const { url, fontWeight } = weights[key];
|
|
3282
|
-
return setCustomFont(name, url, fontWeight);
|
|
3283
|
-
});
|
|
3572
|
+
var arrayzeValue = (val) => {
|
|
3573
|
+
if ((0, import_utils22.isArray)(val))
|
|
3574
|
+
return val;
|
|
3575
|
+
if ((0, import_utils22.isString)(val))
|
|
3576
|
+
return val.split(" ");
|
|
3577
|
+
if ((0, import_utils22.isObject)(val))
|
|
3578
|
+
return Object.values(val);
|
|
3579
|
+
if ((0, import_utils22.isNumber)(val))
|
|
3580
|
+
return [val];
|
|
3284
3581
|
};
|
|
3285
3582
|
|
|
3286
3583
|
// src/utils/sequence.js
|
|
3287
|
-
var import_utils3 = __toESM(require_cjs(), 1);
|
|
3288
|
-
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
3289
3584
|
var numToLetterMap = {
|
|
3290
3585
|
"-6": "U",
|
|
3291
3586
|
"-5": "V",
|
|
@@ -3427,9 +3722,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
3427
3722
|
unit = UNIT2.default,
|
|
3428
3723
|
useVariable
|
|
3429
3724
|
} = sequenceProps;
|
|
3430
|
-
if ((0,
|
|
3725
|
+
if ((0, import_utils4.isString)(value) && value.slice(0, 2) === "--")
|
|
3431
3726
|
return `var(${value})`;
|
|
3432
|
-
const prefix = `--${(0
|
|
3727
|
+
const prefix = `--${(void 0)(sequenceProps.type.replace(".", "-"))}-`;
|
|
3433
3728
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
3434
3729
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
3435
3730
|
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
@@ -3492,7 +3787,7 @@ var findHeadings = (propertyNames) => {
|
|
|
3492
3787
|
};
|
|
3493
3788
|
|
|
3494
3789
|
// src/utils/var.js
|
|
3495
|
-
var
|
|
3790
|
+
var import_utils6 = __toESM(require_cjs(), 1);
|
|
3496
3791
|
var applySequenceGlobalVars = (vars, obj, options) => {
|
|
3497
3792
|
const CONFIG2 = getActiveConfig();
|
|
3498
3793
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
@@ -3563,7 +3858,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
3563
3858
|
};
|
|
3564
3859
|
|
|
3565
3860
|
// src/utils/sprite.js
|
|
3566
|
-
var
|
|
3861
|
+
var import_utils7 = __toESM(require_cjs(), 1);
|
|
3567
3862
|
var generateSprite = (icons) => {
|
|
3568
3863
|
const CONFIG2 = getActiveConfig();
|
|
3569
3864
|
let sprite = "";
|
|
@@ -3577,7 +3872,7 @@ var generateSprite = (icons) => {
|
|
|
3577
3872
|
return sprite;
|
|
3578
3873
|
};
|
|
3579
3874
|
var parseRootAttributes = (htmlString) => {
|
|
3580
|
-
if (!(0,
|
|
3875
|
+
if (!(0, import_utils7.isString)(htmlString)) {
|
|
3581
3876
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
3582
3877
|
}
|
|
3583
3878
|
const match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -3597,7 +3892,7 @@ var replaceIdsAndUrls = (code, key) => {
|
|
|
3597
3892
|
const urlRegex = /url\(#([^)]*)\)/g;
|
|
3598
3893
|
const matches = code.match(/id="([^"]*)"/g);
|
|
3599
3894
|
let replacedCode = code;
|
|
3600
|
-
if ((0,
|
|
3895
|
+
if ((0, import_utils7.isArray)(matches)) {
|
|
3601
3896
|
matches.forEach(() => {
|
|
3602
3897
|
const randomKey = Math.floor(Math.random() * 1e5);
|
|
3603
3898
|
replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
|
|
@@ -3624,7 +3919,7 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
3624
3919
|
// src/system/color.js
|
|
3625
3920
|
var getColor = (value, key, config) => {
|
|
3626
3921
|
const CONFIG2 = config || getActiveConfig();
|
|
3627
|
-
if (!(0,
|
|
3922
|
+
if (!(0, import_utils8.isString)(value)) {
|
|
3628
3923
|
if (CONFIG2.verbose)
|
|
3629
3924
|
console.warn(value, "- type for color is not valid");
|
|
3630
3925
|
return;
|
|
@@ -3633,7 +3928,7 @@ var getColor = (value, key, config) => {
|
|
|
3633
3928
|
return `var(${value})`;
|
|
3634
3929
|
if (key && value[key])
|
|
3635
3930
|
value = value[key];
|
|
3636
|
-
const [name, alpha, tone] = (0,
|
|
3931
|
+
const [name, alpha, tone] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
|
|
3637
3932
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
3638
3933
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
3639
3934
|
if (!val) {
|
|
@@ -3665,17 +3960,17 @@ var getMediaColor = (value, globalTheme, config) => {
|
|
|
3665
3960
|
const CONFIG2 = config || getActiveConfig();
|
|
3666
3961
|
if (!globalTheme)
|
|
3667
3962
|
globalTheme = CONFIG2.globalTheme;
|
|
3668
|
-
if (!(0,
|
|
3963
|
+
if (!(0, import_utils8.isString)(value)) {
|
|
3669
3964
|
if (CONFIG2.verbose)
|
|
3670
3965
|
console.warn(value, "- type for color is not valid");
|
|
3671
3966
|
return;
|
|
3672
3967
|
}
|
|
3673
3968
|
if (value.slice(0, 2) === "--")
|
|
3674
3969
|
return `var(${value})`;
|
|
3675
|
-
const [name] = (0,
|
|
3970
|
+
const [name] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
|
|
3676
3971
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
3677
3972
|
const val = COLOR2[name] || GRADIENT2[name];
|
|
3678
|
-
const isObj = (0,
|
|
3973
|
+
const isObj = (0, import_utils8.isObject)(val);
|
|
3679
3974
|
if (isObj && val.value)
|
|
3680
3975
|
return getColor(value, `@${globalTheme}`, config);
|
|
3681
3976
|
else if (isObj) {
|
|
@@ -3698,7 +3993,7 @@ var getMediaColor = (value, globalTheme, config) => {
|
|
|
3698
3993
|
};
|
|
3699
3994
|
var setColor = (val, key, suffix) => {
|
|
3700
3995
|
const CONFIG2 = getActiveConfig();
|
|
3701
|
-
if ((0,
|
|
3996
|
+
if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--") {
|
|
3702
3997
|
val = getColor(val.slice(2));
|
|
3703
3998
|
if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
|
|
3704
3999
|
if (CONFIG2.verbose)
|
|
@@ -3706,13 +4001,13 @@ var setColor = (val, key, suffix) => {
|
|
|
3706
4001
|
val = val.split(" ")[0];
|
|
3707
4002
|
}
|
|
3708
4003
|
}
|
|
3709
|
-
if ((0,
|
|
4004
|
+
if ((0, import_utils8.isArray)(val)) {
|
|
3710
4005
|
return {
|
|
3711
4006
|
"@light": setColor(val[0], key, "light"),
|
|
3712
4007
|
"@dark": setColor(val[1], key, "dark")
|
|
3713
4008
|
};
|
|
3714
4009
|
}
|
|
3715
|
-
if ((0,
|
|
4010
|
+
if ((0, import_utils8.isObject)(val)) {
|
|
3716
4011
|
const obj = {};
|
|
3717
4012
|
for (const variant in val) {
|
|
3718
4013
|
obj[variant] = setColor(
|
|
@@ -3741,15 +4036,15 @@ var setColor = (val, key, suffix) => {
|
|
|
3741
4036
|
};
|
|
3742
4037
|
var setGradient = (val, key, suffix) => {
|
|
3743
4038
|
const CONFIG2 = getActiveConfig();
|
|
3744
|
-
if ((0,
|
|
4039
|
+
if ((0, import_utils8.isString)(val) && val.slice(0, 2) === "--")
|
|
3745
4040
|
val = getColor(val.slice(2));
|
|
3746
|
-
if ((0,
|
|
4041
|
+
if ((0, import_utils8.isArray)(val)) {
|
|
3747
4042
|
return {
|
|
3748
4043
|
"@light": setGradient(val[0], key, "light"),
|
|
3749
4044
|
"@dark": setGradient(val[0], key, "dark")
|
|
3750
4045
|
};
|
|
3751
4046
|
}
|
|
3752
|
-
if ((0,
|
|
4047
|
+
if ((0, import_utils8.isObject)(val)) {
|
|
3753
4048
|
const obj = {};
|
|
3754
4049
|
for (const variant in val)
|
|
3755
4050
|
obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -3766,7 +4061,7 @@ var setGradient = (val, key, suffix) => {
|
|
|
3766
4061
|
};
|
|
3767
4062
|
|
|
3768
4063
|
// src/system/theme.js
|
|
3769
|
-
var
|
|
4064
|
+
var import_utils10 = __toESM(require_cjs(), 1);
|
|
3770
4065
|
var setThemeValue = (theme) => {
|
|
3771
4066
|
const value = {};
|
|
3772
4067
|
const { state, media, helpers, ...rest } = theme;
|
|
@@ -3789,7 +4084,7 @@ var getTheme = (value, modifier) => {
|
|
|
3789
4084
|
if (CONFIG2.useVariable)
|
|
3790
4085
|
return getMediaTheme(value, modifier);
|
|
3791
4086
|
const { THEME: THEME2 } = CONFIG2;
|
|
3792
|
-
if ((0,
|
|
4087
|
+
if ((0, import_utils10.isString)(value)) {
|
|
3793
4088
|
const [theme, subtheme] = value.split(" ");
|
|
3794
4089
|
const isOurTheme = THEME2[theme];
|
|
3795
4090
|
if (isOurTheme) {
|
|
@@ -3798,7 +4093,7 @@ var getTheme = (value, modifier) => {
|
|
|
3798
4093
|
value = [theme, subtheme || modifier];
|
|
3799
4094
|
}
|
|
3800
4095
|
}
|
|
3801
|
-
if ((0,
|
|
4096
|
+
if ((0, import_utils10.isObjectLike)(value) && value[1]) {
|
|
3802
4097
|
const themeName = value[0];
|
|
3803
4098
|
const subThemeName = value[1];
|
|
3804
4099
|
const { helpers, media, state } = THEME2[themeName];
|
|
@@ -3808,11 +4103,11 @@ var getTheme = (value, modifier) => {
|
|
|
3808
4103
|
return getThemeValue(helpers[subThemeName]);
|
|
3809
4104
|
if (state && state[subThemeName])
|
|
3810
4105
|
return getThemeValue(state[subThemeName]);
|
|
3811
|
-
} else if ((0,
|
|
4106
|
+
} else if ((0, import_utils10.isObject)(value))
|
|
3812
4107
|
return setThemeValue(value);
|
|
3813
4108
|
};
|
|
3814
4109
|
var setInverseTheme = (theme, variant, value) => {
|
|
3815
|
-
if ((0,
|
|
4110
|
+
if ((0, import_utils10.isObject)(variant)) {
|
|
3816
4111
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
3817
4112
|
} else if (variant === true) {
|
|
3818
4113
|
const { color, background } = value;
|
|
@@ -3827,7 +4122,7 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
3827
4122
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
3828
4123
|
const result = getTheme(variant);
|
|
3829
4124
|
themeValue[`&:${key}`] = result;
|
|
3830
|
-
if ((0,
|
|
4125
|
+
if ((0, import_utils10.isObject)(variant) && !variant.value)
|
|
3831
4126
|
variant.value = result;
|
|
3832
4127
|
};
|
|
3833
4128
|
var setSelectors = (theme, value) => {
|
|
@@ -3845,7 +4140,7 @@ var setSelectors = (theme, value) => {
|
|
|
3845
4140
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
3846
4141
|
const result = getTheme(variant);
|
|
3847
4142
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
3848
|
-
if ((0,
|
|
4143
|
+
if ((0, import_utils10.isObject)(variant) && !variant.value)
|
|
3849
4144
|
variant.value = result;
|
|
3850
4145
|
};
|
|
3851
4146
|
var setMedia = (theme, value) => {
|
|
@@ -3871,7 +4166,7 @@ var setHelpers = (theme, value) => {
|
|
|
3871
4166
|
const keys = Object.keys(helpers);
|
|
3872
4167
|
keys.map((key) => {
|
|
3873
4168
|
const helper = helpers[key];
|
|
3874
|
-
if ((0,
|
|
4169
|
+
if ((0, import_utils10.isString)(helper))
|
|
3875
4170
|
helpers[key] = CONFIG2.THEME[helper];
|
|
3876
4171
|
else
|
|
3877
4172
|
getThemeValue(helpers[key]);
|
|
@@ -3895,7 +4190,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
3895
4190
|
const CONFIG2 = getActiveConfig();
|
|
3896
4191
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
3897
4192
|
const theme = { value: val };
|
|
3898
|
-
if ((0,
|
|
4193
|
+
if ((0, import_utils10.isObjectLike)(val)) {
|
|
3899
4194
|
for (const param in val) {
|
|
3900
4195
|
const symb = param.slice(0, 1);
|
|
3901
4196
|
const value = val[param];
|
|
@@ -3923,7 +4218,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
3923
4218
|
};
|
|
3924
4219
|
}
|
|
3925
4220
|
}
|
|
3926
|
-
if ((0,
|
|
4221
|
+
if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--") {
|
|
3927
4222
|
const { THEME: THEME2 } = CONFIG2;
|
|
3928
4223
|
const value = THEME2[val.slice(2)];
|
|
3929
4224
|
const getReferenced = getMediaTheme(value, prefers);
|
|
@@ -3936,7 +4231,7 @@ var recursiveTheme = (val) => {
|
|
|
3936
4231
|
const obj = {};
|
|
3937
4232
|
for (const param in val) {
|
|
3938
4233
|
const symb = param.slice(0, 1);
|
|
3939
|
-
if ((0,
|
|
4234
|
+
if ((0, import_utils10.isObjectLike)(val[param])) {
|
|
3940
4235
|
if (symb === "@") {
|
|
3941
4236
|
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
3942
4237
|
const media = `@media screen and ${query}`;
|
|
@@ -3956,25 +4251,25 @@ var findModifierFromArray = (val, modifierArray) => {
|
|
|
3956
4251
|
return val;
|
|
3957
4252
|
};
|
|
3958
4253
|
var findModifier = (val, modifier) => {
|
|
3959
|
-
if ((0,
|
|
4254
|
+
if ((0, import_utils10.isArray)(modifier))
|
|
3960
4255
|
return findModifierFromArray(val, modifier);
|
|
3961
|
-
else if ((0,
|
|
4256
|
+
else if ((0, import_utils10.isString)(modifier) && val[modifier])
|
|
3962
4257
|
return val[modifier];
|
|
3963
4258
|
else
|
|
3964
4259
|
return val;
|
|
3965
4260
|
};
|
|
3966
4261
|
var getMediaTheme = (value, modifier) => {
|
|
3967
4262
|
const activeConfig = getActiveConfig();
|
|
3968
|
-
if ((0,
|
|
4263
|
+
if ((0, import_utils10.isString)(value) && value.slice(0, 2) === "--") {
|
|
3969
4264
|
value = getMediaTheme(value.slice(2));
|
|
3970
4265
|
}
|
|
3971
|
-
if (!value || !(0,
|
|
4266
|
+
if (!value || !(0, import_utils10.isString)(value)) {
|
|
3972
4267
|
if (activeConfig.verbose) {
|
|
3973
4268
|
console.warn(`${value} - Theme is not a string`);
|
|
3974
4269
|
}
|
|
3975
4270
|
return;
|
|
3976
4271
|
}
|
|
3977
|
-
const [themeName, ...themeModifiers] = (0,
|
|
4272
|
+
const [themeName, ...themeModifiers] = (0, import_utils10.isArray)(value) ? value : value.split(" ");
|
|
3978
4273
|
let themeValue = activeConfig.THEME[themeName];
|
|
3979
4274
|
if (themeValue && (themeModifiers || modifier)) {
|
|
3980
4275
|
themeValue = findModifier(themeValue, themeModifiers.length ? themeModifiers : modifier);
|
|
@@ -3984,11 +4279,10 @@ var getMediaTheme = (value, modifier) => {
|
|
|
3984
4279
|
};
|
|
3985
4280
|
|
|
3986
4281
|
// src/system/font.js
|
|
3987
|
-
var
|
|
3988
|
-
var import_utils11 = __toESM(require_cjs3(), 1);
|
|
4282
|
+
var import_utils11 = __toESM(require_cjs(), 1);
|
|
3989
4283
|
var setFont = (val, key) => {
|
|
3990
4284
|
const CSSvar = `--font-${key}`;
|
|
3991
|
-
if (!val || (0,
|
|
4285
|
+
if (!val || (0, import_utils11.isArray)(val) && !val[0])
|
|
3992
4286
|
return;
|
|
3993
4287
|
const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
|
|
3994
4288
|
return { var: CSSvar, value: val, fontFace };
|
|
@@ -4004,15 +4298,15 @@ var setFontFamily = (val, key) => {
|
|
|
4004
4298
|
let { value, type } = val;
|
|
4005
4299
|
if (val.isDefault)
|
|
4006
4300
|
FONT_FAMILY2.default = key;
|
|
4007
|
-
if ((0,
|
|
4008
|
-
value = (0
|
|
4301
|
+
if ((0, import_utils11.isObject)(value))
|
|
4302
|
+
value = (void 0)(value);
|
|
4009
4303
|
const CSSvar = `--font-family-${key}`;
|
|
4010
4304
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
4011
4305
|
return { var: CSSvar, value: str, arr: value, type };
|
|
4012
4306
|
};
|
|
4013
4307
|
|
|
4014
4308
|
// src/system/typography.js
|
|
4015
|
-
var
|
|
4309
|
+
var import_utils14 = __toESM(require_cjs(), 1);
|
|
4016
4310
|
var runThroughMedia = (FACTORY2) => {
|
|
4017
4311
|
const CONFIG2 = getActiveConfig();
|
|
4018
4312
|
const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
|
|
@@ -4032,7 +4326,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
4032
4326
|
h1Matches,
|
|
4033
4327
|
unit
|
|
4034
4328
|
} = FACTORY2;
|
|
4035
|
-
(0,
|
|
4329
|
+
(0, import_utils14.merge)(mediaValue, {
|
|
4036
4330
|
type,
|
|
4037
4331
|
base,
|
|
4038
4332
|
ratio,
|
|
@@ -4049,7 +4343,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
4049
4343
|
applyMediaSequenceVars(FACTORY2, prop);
|
|
4050
4344
|
continue;
|
|
4051
4345
|
}
|
|
4052
|
-
(0,
|
|
4346
|
+
(0, import_utils14.merge)(mediaValue, {
|
|
4053
4347
|
sequence: {},
|
|
4054
4348
|
scales: {},
|
|
4055
4349
|
templates: {},
|
|
@@ -4097,8 +4391,7 @@ var getFontSizeByKey = (value) => {
|
|
|
4097
4391
|
};
|
|
4098
4392
|
|
|
4099
4393
|
// src/system/spacing.js
|
|
4100
|
-
var
|
|
4101
|
-
var import_utils16 = __toESM(require_cjs(), 1);
|
|
4394
|
+
var import_utils17 = __toESM(require_cjs(), 1);
|
|
4102
4395
|
var runThroughMedia2 = (FACTORY2) => {
|
|
4103
4396
|
for (const prop in FACTORY2) {
|
|
4104
4397
|
const mediaProps = FACTORY2[prop];
|
|
@@ -4114,7 +4407,7 @@ var runThroughMedia2 = (FACTORY2) => {
|
|
|
4114
4407
|
h1Matches,
|
|
4115
4408
|
unit
|
|
4116
4409
|
} = FACTORY2;
|
|
4117
|
-
(0,
|
|
4410
|
+
(0, import_utils17.merge)(mediaProps, {
|
|
4118
4411
|
type,
|
|
4119
4412
|
base,
|
|
4120
4413
|
ratio,
|
|
@@ -4148,11 +4441,11 @@ var getSequence = (sequenceProps) => {
|
|
|
4148
4441
|
};
|
|
4149
4442
|
var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
4150
4443
|
const sequence = getSequence(sequenceProps);
|
|
4151
|
-
if ((0,
|
|
4444
|
+
if ((0, import_utils17.isString)(value) && (value.includes("calc") || value.includes("var"))) {
|
|
4152
4445
|
return { [propertyName]: value };
|
|
4153
4446
|
}
|
|
4154
|
-
const stack = (0
|
|
4155
|
-
if (!(0,
|
|
4447
|
+
const stack = (void 0)(value);
|
|
4448
|
+
if (!(0, import_utils17.isArray)(stack))
|
|
4156
4449
|
return;
|
|
4157
4450
|
if (stack.length > 1) {
|
|
4158
4451
|
let suffix = "";
|
|
@@ -4187,7 +4480,7 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
4187
4480
|
let sequenceProps = SPACING2[spacingRatio];
|
|
4188
4481
|
if (!sequenceProps) {
|
|
4189
4482
|
const { type, base, range, subSequence } = SPACING2;
|
|
4190
|
-
sequenceProps = SPACING2[spacingRatio] = (0,
|
|
4483
|
+
sequenceProps = SPACING2[spacingRatio] = (0, import_utils17.merge)({
|
|
4191
4484
|
ratio: spacingRatio,
|
|
4192
4485
|
type: type + "-" + spacingRatio,
|
|
4193
4486
|
unit,
|
|
@@ -4210,16 +4503,16 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
4210
4503
|
};
|
|
4211
4504
|
|
|
4212
4505
|
// src/system/shadow.js
|
|
4213
|
-
var
|
|
4506
|
+
var import_utils19 = __toESM(require_cjs(), 1);
|
|
4214
4507
|
var setShadow = (value, key, suffix, prefers) => {
|
|
4215
4508
|
const CONFIG2 = getActiveConfig();
|
|
4216
|
-
if ((0,
|
|
4509
|
+
if ((0, import_utils19.isArray)(value)) {
|
|
4217
4510
|
return {
|
|
4218
4511
|
"@light": setShadow(value[0], key, "light"),
|
|
4219
4512
|
"@dark": setShadow(value[1], key, "dark")
|
|
4220
4513
|
};
|
|
4221
4514
|
}
|
|
4222
|
-
if ((0,
|
|
4515
|
+
if ((0, import_utils19.isObject)(value)) {
|
|
4223
4516
|
const obj = {};
|
|
4224
4517
|
for (const variant in value) {
|
|
4225
4518
|
obj[variant] = setShadow(
|
|
@@ -4230,7 +4523,7 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
4230
4523
|
}
|
|
4231
4524
|
return obj;
|
|
4232
4525
|
}
|
|
4233
|
-
if ((0,
|
|
4526
|
+
if ((0, import_utils19.isString)(value) && value.includes(",")) {
|
|
4234
4527
|
value = value.split(",").map((v) => {
|
|
4235
4528
|
v = v.trim();
|
|
4236
4529
|
if (v.startsWith("--"))
|
|
@@ -4258,17 +4551,17 @@ var getShadow = (value, globalTheme) => {
|
|
|
4258
4551
|
const CONFIG2 = getActiveConfig();
|
|
4259
4552
|
if (!globalTheme)
|
|
4260
4553
|
globalTheme = CONFIG2.globalTheme;
|
|
4261
|
-
if (!(0,
|
|
4554
|
+
if (!(0, import_utils19.isString)(value)) {
|
|
4262
4555
|
if (CONFIG2.verbose)
|
|
4263
4556
|
console.warn(value, "- type for color is not valid");
|
|
4264
4557
|
return;
|
|
4265
4558
|
}
|
|
4266
4559
|
if (value.slice(0, 2) === "--")
|
|
4267
4560
|
return `var(${value})`;
|
|
4268
|
-
const [name] = (0,
|
|
4561
|
+
const [name] = (0, import_utils19.isArray)(value) ? value : value.split(" ");
|
|
4269
4562
|
const { SHADOW: SHADOW2 } = CONFIG2;
|
|
4270
4563
|
const val = SHADOW2[name];
|
|
4271
|
-
const isObj = (0,
|
|
4564
|
+
const isObj = (0, import_utils19.isObject)(val);
|
|
4272
4565
|
if (!val) {
|
|
4273
4566
|
if (CONFIG2.verbose)
|
|
4274
4567
|
console.warn("Can't find color ", name);
|
|
@@ -4297,7 +4590,6 @@ var getShadow = (value, globalTheme) => {
|
|
|
4297
4590
|
};
|
|
4298
4591
|
|
|
4299
4592
|
// src/system/timing.js
|
|
4300
|
-
var import_utils19 = __toESM(require_cjs3(), 1);
|
|
4301
4593
|
var applyTimingSequence = () => {
|
|
4302
4594
|
const CONFIG2 = getActiveConfig();
|
|
4303
4595
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
@@ -4307,7 +4599,7 @@ var applyTimingSequence = () => {
|
|
|
4307
4599
|
var getTimingFunction = (value) => {
|
|
4308
4600
|
const CONFIG2 = getActiveConfig();
|
|
4309
4601
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
4310
|
-
return TIMING2[value] || TIMING2[(0
|
|
4602
|
+
return TIMING2[value] || TIMING2[(void 0)(value)] || value;
|
|
4311
4603
|
};
|
|
4312
4604
|
var getTimingByKey = (value, property = "timing") => {
|
|
4313
4605
|
const CONFIG2 = getActiveConfig();
|
|
@@ -4320,11 +4612,11 @@ var getTimingByKey = (value, property = "timing") => {
|
|
|
4320
4612
|
};
|
|
4321
4613
|
|
|
4322
4614
|
// src/system/document.js
|
|
4323
|
-
var
|
|
4615
|
+
var import_utils23 = __toESM(require_cjs(), 1);
|
|
4324
4616
|
var applyDocument = () => {
|
|
4325
4617
|
const CONFIG2 = getActiveConfig();
|
|
4326
4618
|
const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
4327
|
-
return (0,
|
|
4619
|
+
return (0, import_utils23.merge)(DOCUMENT2, {
|
|
4328
4620
|
theme: THEME2.document,
|
|
4329
4621
|
fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
|
|
4330
4622
|
fontSize: TYPOGRAPHY2.base,
|
|
@@ -4409,7 +4701,7 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
|
|
|
4409
4701
|
};
|
|
4410
4702
|
|
|
4411
4703
|
// src/system/reset.js
|
|
4412
|
-
var
|
|
4704
|
+
var import_utils26 = __toESM(require_cjs(), 1);
|
|
4413
4705
|
var applyReset = (reset = {}) => {
|
|
4414
4706
|
const CONFIG2 = getActiveConfig();
|
|
4415
4707
|
const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
|
|
@@ -4431,8 +4723,8 @@ var applyReset = (reset = {}) => {
|
|
|
4431
4723
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
4432
4724
|
const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
|
|
4433
4725
|
if (RESET2.html)
|
|
4434
|
-
(0,
|
|
4435
|
-
return (0,
|
|
4726
|
+
(0, import_utils26.overwriteDeep)(RESET2.html, globalTheme);
|
|
4727
|
+
return (0, import_utils26.deepMerge)((0, import_utils26.merge)(RESET2, reset), {
|
|
4436
4728
|
html: {
|
|
4437
4729
|
position: "absolute",
|
|
4438
4730
|
// overflow: 'hidden',
|