@symbo.ls/scratch 2.11.504 → 2.11.514

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.
@@ -34,3844 +34,59 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  var require_cjs = __commonJS({
35
35
  "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
36
36
  "use strict";
37
- var __defProp2 = Object.defineProperty;
37
+ var __defProp3 = Object.defineProperty;
38
38
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
39
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
40
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
41
41
  var __export2 = (target, all) => {
42
42
  for (var name in all)
43
- __defProp2(target, name, { get: all[name], enumerable: true });
43
+ __defProp3(target, name, { get: all[name], enumerable: true });
44
44
  };
45
45
  var __copyProps2 = (to, from, except, desc) => {
46
46
  if (from && typeof from === "object" || typeof from === "function") {
47
47
  for (let key of __getOwnPropNames2(from))
48
- if (!__hasOwnProp2.call(to, key) && key !== except)
49
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
48
+ if (!__hasOwnProp3.call(to, key) && key !== except)
49
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
50
50
  }
51
51
  return to;
52
52
  };
53
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
54
54
  var globals_exports = {};
55
55
  __export2(globals_exports, {
56
- document: () => document4,
56
+ document: () => document5,
57
57
  global: () => global,
58
58
  self: () => self,
59
- window: () => window3
59
+ window: () => window4
60
60
  });
61
61
  module2.exports = __toCommonJS2(globals_exports);
62
62
  var global = globalThis;
63
63
  var self = globalThis;
64
- var window3 = globalThis;
65
- var document4 = window3.document;
66
- }
67
- });
68
-
69
- // ../../node_modules/@domql/utils/dist/cjs/key.js
70
- var require_key = __commonJS({
71
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
72
- "use strict";
73
- var __defProp2 = Object.defineProperty;
74
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
75
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
76
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
77
- var __export2 = (target, all) => {
78
- for (var name in all)
79
- __defProp2(target, name, { get: all[name], enumerable: true });
80
- };
81
- var __copyProps2 = (to, from, except, desc) => {
82
- if (from && typeof from === "object" || typeof from === "function") {
83
- for (let key of __getOwnPropNames2(from))
84
- if (!__hasOwnProp2.call(to, key) && key !== except)
85
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
86
- }
87
- return to;
88
- };
89
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
90
- var key_exports = {};
91
- __export2(key_exports, {
92
- createSnapshotId: () => createSnapshotId,
93
- generateKey: () => generateKey
94
- });
95
- module2.exports = __toCommonJS2(key_exports);
96
- var generateKey = /* @__PURE__ */ function() {
97
- let index = 0;
98
- function newId() {
99
- index++;
100
- return index;
101
- }
102
- return newId;
103
- }();
104
- var createSnapshotId = generateKey;
105
- }
106
- });
107
-
108
- // ../../node_modules/@domql/utils/dist/cjs/env.js
109
- var require_env = __commonJS({
110
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
111
- "use strict";
112
- var __defProp2 = Object.defineProperty;
113
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
114
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
115
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
116
- var __export2 = (target, all) => {
117
- for (var name in all)
118
- __defProp2(target, name, { get: all[name], enumerable: true });
119
- };
120
- var __copyProps2 = (to, from, except, desc) => {
121
- if (from && typeof from === "object" || typeof from === "function") {
122
- for (let key of __getOwnPropNames2(from))
123
- if (!__hasOwnProp2.call(to, key) && key !== except)
124
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
125
- }
126
- return to;
127
- };
128
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
129
- var env_exports = {};
130
- __export2(env_exports, {
131
- NODE_ENV: () => NODE_ENV,
132
- getNev: () => getNev,
133
- isDevelopment: () => isDevelopment,
134
- isProduction: () => isProduction,
135
- isTest: () => isTest
136
- });
137
- module2.exports = __toCommonJS2(env_exports);
138
- var NODE_ENV = "development";
139
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
140
- var isTest = (env = NODE_ENV) => env === "test";
141
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
142
- var getNev = (key, env = NODE_ENV) => env[key];
143
- }
144
- });
145
-
146
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
147
- var require_globals = __commonJS({
148
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
149
- "use strict";
150
- var __defProp2 = Object.defineProperty;
151
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
152
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
153
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
154
- var __export2 = (target, all) => {
155
- for (var name in all)
156
- __defProp2(target, name, { get: all[name], enumerable: true });
157
- };
158
- var __copyProps2 = (to, from, except, desc) => {
159
- if (from && typeof from === "object" || typeof from === "function") {
160
- for (let key of __getOwnPropNames2(from))
161
- if (!__hasOwnProp2.call(to, key) && key !== except)
162
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
163
- }
164
- return to;
165
- };
166
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
167
- var globals_exports = {};
168
- __export2(globals_exports, {
169
- document: () => document4,
170
- global: () => global,
171
- self: () => self,
172
- window: () => window3
173
- });
174
- module2.exports = __toCommonJS2(globals_exports);
175
- var global = globalThis;
176
- var self = globalThis;
177
- var window3 = globalThis;
178
- var document4 = window3.document;
179
- }
180
- });
181
-
182
- // ../../node_modules/@domql/utils/dist/cjs/node.js
183
- var require_node = __commonJS({
184
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
185
- "use strict";
186
- var __defProp2 = Object.defineProperty;
187
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
188
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
189
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
190
- var __export2 = (target, all) => {
191
- for (var name in all)
192
- __defProp2(target, name, { get: all[name], enumerable: true });
193
- };
194
- var __copyProps2 = (to, from, except, desc) => {
195
- if (from && typeof from === "object" || typeof from === "function") {
196
- for (let key of __getOwnPropNames2(from))
197
- if (!__hasOwnProp2.call(to, key) && key !== except)
198
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
199
- }
200
- return to;
201
- };
202
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
203
- var node_exports = {};
204
- __export2(node_exports, {
205
- isDOMNode: () => isDOMNode,
206
- isHtmlElement: () => isHtmlElement,
207
- isNode: () => isNode
208
- });
209
- module2.exports = __toCommonJS2(node_exports);
210
- var import_globals3 = require_globals();
211
- var isNode = (obj) => {
212
- return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
213
- };
214
- var isHtmlElement = (obj) => {
215
- return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
216
- };
217
- var isDOMNode = (obj) => {
218
- return typeof import_globals3.window !== "undefined" && (obj instanceof import_globals3.window.Node || obj instanceof import_globals3.window.Window || obj === import_globals3.window || obj === document);
219
- };
220
- }
221
- });
222
-
223
- // ../../node_modules/@domql/utils/dist/cjs/types.js
224
- var require_types = __commonJS({
225
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
226
- "use strict";
227
- var __defProp2 = Object.defineProperty;
228
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
229
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
230
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
231
- var __export2 = (target, all) => {
232
- for (var name in all)
233
- __defProp2(target, name, { get: all[name], enumerable: true });
234
- };
235
- var __copyProps2 = (to, from, except, desc) => {
236
- if (from && typeof from === "object" || typeof from === "function") {
237
- for (let key of __getOwnPropNames2(from))
238
- if (!__hasOwnProp2.call(to, key) && key !== except)
239
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
240
- }
241
- return to;
242
- };
243
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
244
- var types_exports = {};
245
- __export2(types_exports, {
246
- TYPES: () => TYPES,
247
- is: () => is,
248
- isArray: () => isArray2,
249
- isBoolean: () => isBoolean,
250
- isDate: () => isDate,
251
- isDefined: () => isDefined2,
252
- isFunction: () => isFunction,
253
- isNot: () => isNot,
254
- isNull: () => isNull,
255
- isNumber: () => isNumber2,
256
- isObject: () => isObject2,
257
- isObjectLike: () => isObjectLike2,
258
- isString: () => isString4,
259
- isUndefined: () => isUndefined
260
- });
261
- module2.exports = __toCommonJS2(types_exports);
262
- var import_node = require_node();
263
- var isObject2 = (arg) => {
264
- if (arg === null)
265
- return false;
266
- return typeof arg === "object" && arg.constructor === Object;
267
- };
268
- var isString4 = (arg) => typeof arg === "string";
269
- var isNumber2 = (arg) => typeof arg === "number";
270
- var isFunction = (arg) => typeof arg === "function";
271
- var isBoolean = (arg) => arg === true || arg === false;
272
- var isNull = (arg) => arg === null;
273
- var isArray2 = (arg) => Array.isArray(arg);
274
- var isDate = (d) => d instanceof Date;
275
- var isObjectLike2 = (arg) => {
276
- if (arg === null)
277
- return false;
278
- return typeof arg === "object";
279
- };
280
- var isDefined2 = (arg) => {
281
- return isObject2(arg) || isObjectLike2(arg) || isString4(arg) || isNumber2(arg) || isFunction(arg) || isArray2(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
282
- };
283
- var isUndefined = (arg) => {
284
- return arg === void 0;
285
- };
286
- var TYPES = {
287
- boolean: isBoolean,
288
- array: isArray2,
289
- object: isObject2,
290
- string: isString4,
291
- date: isDate,
292
- number: isNumber2,
293
- null: isNull,
294
- function: isFunction,
295
- objectLike: isObjectLike2,
296
- node: import_node.isNode,
297
- htmlElement: import_node.isHtmlElement,
298
- defined: isDefined2
299
- };
300
- var is = (arg) => {
301
- return (...args) => {
302
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
303
- };
304
- };
305
- var isNot = (arg) => {
306
- return (...args) => {
307
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
308
- };
309
- };
310
- }
311
- });
312
-
313
- // ../../node_modules/@domql/utils/dist/cjs/array.js
314
- var require_array = __commonJS({
315
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
316
- "use strict";
317
- var __defProp2 = Object.defineProperty;
318
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
319
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
320
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
321
- var __export2 = (target, all) => {
322
- for (var name in all)
323
- __defProp2(target, name, { get: all[name], enumerable: true });
324
- };
325
- var __copyProps2 = (to, from, except, desc) => {
326
- if (from && typeof from === "object" || typeof from === "function") {
327
- for (let key of __getOwnPropNames2(from))
328
- if (!__hasOwnProp2.call(to, key) && key !== except)
329
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
330
- }
331
- return to;
332
- };
333
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
334
- var array_exports = {};
335
- __export2(array_exports, {
336
- addItemAfterEveryElement: () => addItemAfterEveryElement,
337
- arrayContainsOtherArray: () => arrayContainsOtherArray,
338
- arraysEqual: () => arraysEqual,
339
- checkIfStringIsInArray: () => checkIfStringIsInArray,
340
- cutArrayAfterValue: () => cutArrayAfterValue,
341
- cutArrayBeforeValue: () => cutArrayBeforeValue,
342
- filterArrays: () => filterArrays,
343
- filterArraysFast: () => filterArraysFast,
344
- getFrequencyInArray: () => getFrequencyInArray,
345
- joinArrays: () => joinArrays,
346
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
347
- mergeArray: () => mergeArray,
348
- removeFromArray: () => removeFromArray,
349
- removeValueFromArray: () => removeValueFromArray,
350
- removeValueFromArrayAll: () => removeValueFromArrayAll,
351
- reorderArrayByValues: () => reorderArrayByValues,
352
- swapItemsInArray: () => swapItemsInArray
353
- });
354
- module2.exports = __toCommonJS2(array_exports);
355
- var import_object = require_object();
356
- var import_types = require_types();
357
- var arrayContainsOtherArray = (arr1, arr2) => {
358
- return arr2.every((val) => arr1.includes(val));
359
- };
360
- var getFrequencyInArray = (arr, value) => {
361
- return arr.reduce((count, currentValue) => {
362
- return currentValue === value ? count + 1 : count;
363
- }, 0);
364
- };
365
- var removeFromArray = (arr, index) => {
366
- if ((0, import_types.isString)(index))
367
- index = parseInt(index);
368
- if ((0, import_types.isNumber)(index)) {
369
- if (index < 0 || index >= arr.length || isNaN(index)) {
370
- throw new Error("Invalid index");
371
- }
372
- arr.splice(index, 1);
373
- } else if ((0, import_types.isArray)(index)) {
374
- index.forEach((idx) => removeFromArray(arr, idx));
375
- } else {
376
- throw new Error("Invalid index");
377
- }
378
- return arr;
379
- };
380
- var swapItemsInArray = (arr, i, j) => {
381
- [arr[i], arr[j]] = [arr[j], arr[i]];
382
- };
383
- var joinArrays = (...arrays) => {
384
- return [].concat(...arrays);
385
- };
386
- var mergeArray = (arr, exclude = []) => {
387
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
388
- };
389
- var mergeAndCloneIfArray = (obj) => {
390
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
391
- };
392
- var cutArrayBeforeValue = (arr, value) => {
393
- const index = arr.indexOf(value);
394
- if (index !== -1) {
395
- return arr.slice(0, index);
396
- }
397
- return arr;
398
- };
399
- var cutArrayAfterValue = (arr, value) => {
400
- if (!(0, import_types.isArray)(arr))
401
- return;
402
- const index = arr.indexOf(value);
403
- if (index !== -1) {
404
- return arr.slice(index + 1);
405
- }
406
- return arr;
407
- };
408
- var removeValueFromArray = (arr, value) => {
409
- const index = arr.indexOf(value);
410
- if (index > -1) {
411
- const newArray = [...arr];
412
- newArray.splice(index, 1);
413
- return newArray;
414
- }
415
- return arr;
416
- };
417
- var removeValueFromArrayAll = (arr, value) => {
418
- return arr.filter((item) => item !== value);
419
- };
420
- var addItemAfterEveryElement = (array, item) => {
421
- const result = [];
422
- for (let i = 0; i < array.length; i++) {
423
- result.push(array[i]);
424
- if (i < array.length - 1) {
425
- result.push(item);
426
- }
427
- }
428
- return result;
429
- };
430
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
431
- const newArray = [...array];
432
- const indexToMove = newArray.indexOf(valueToMove);
433
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
434
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
435
- const removedItem = newArray.splice(indexToMove, 1)[0];
436
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
437
- newArray.splice(insertIndex, 0, removedItem);
438
- }
439
- return newArray;
440
- };
441
- var arraysEqual = (arr1, arr2) => {
442
- if (arr1.length !== arr2.length) {
443
- return false;
444
- }
445
- for (let i = 0; i < arr1.length; i++) {
446
- if (arr1[i] !== arr2[i]) {
447
- return false;
448
- }
449
- }
450
- return true;
451
- };
452
- var filterArrays = (sourceArr, excludeArr) => {
453
- return sourceArr.filter((item) => !excludeArr.includes(item));
454
- };
455
- var filterArraysFast = (sourceArr, excludeArr) => {
456
- const excludeSet = new Set(excludeArr);
457
- return sourceArr.filter((item) => !excludeSet.has(item));
458
- };
459
- var checkIfStringIsInArray = (string, arr) => {
460
- if (!string)
461
- return;
462
- return arr.filter((v) => string.includes(v)).length;
463
- };
464
- }
465
- });
466
-
467
- // ../../node_modules/@domql/utils/dist/cjs/string.js
468
- var require_string = __commonJS({
469
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
470
- "use strict";
471
- var __defProp2 = Object.defineProperty;
472
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
473
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
474
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
475
- var __export2 = (target, all) => {
476
- for (var name in all)
477
- __defProp2(target, name, { get: all[name], enumerable: true });
478
- };
479
- var __copyProps2 = (to, from, except, desc) => {
480
- if (from && typeof from === "object" || typeof from === "function") {
481
- for (let key of __getOwnPropNames2(from))
482
- if (!__hasOwnProp2.call(to, key) && key !== except)
483
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
484
- }
485
- return to;
486
- };
487
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
488
- var string_exports = {};
489
- __export2(string_exports, {
490
- customDecodeURIComponent: () => customDecodeURIComponent,
491
- customEncodeURIComponent: () => customEncodeURIComponent,
492
- decodeNewlines: () => decodeNewlines,
493
- encodeNewlines: () => encodeNewlines,
494
- findKeyPosition: () => findKeyPosition,
495
- lowercaseFirstLetter: () => lowercaseFirstLetter,
496
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
497
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
498
- stringIncludesAny: () => stringIncludesAny,
499
- trimStringFromSymbols: () => trimStringFromSymbols
500
- });
501
- module2.exports = __toCommonJS2(string_exports);
502
- var stringIncludesAny = (str, characters) => {
503
- for (const char of characters) {
504
- if (str.includes(char)) {
505
- return true;
506
- }
507
- }
508
- return false;
509
- };
510
- var trimStringFromSymbols = (str, characters) => {
511
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
512
- return str.replace(pattern, "");
513
- };
514
- var brackRegex = {
515
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
516
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
517
- };
518
- function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
519
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
520
- return str;
521
- const reg = brackRegex[options.bracketsLength || 2];
522
- const obj = forcedState || this.state || {};
523
- return str.replace(reg, (_, parentPath, variable) => {
524
- if (parentPath) {
525
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
526
- let parentState = obj;
527
- for (let i = 0; i < parentLevels; i++) {
528
- parentState = parentState.parent;
529
- if (!parentState) {
530
- return "";
531
- }
532
- }
533
- const value = parentState[variable.trim()];
534
- return value !== void 0 ? `${value}` : "";
535
- } else {
536
- const value = obj[variable.trim()];
537
- return value !== void 0 ? `${value}` : "";
538
- }
539
- });
540
- }
541
- var lowercaseFirstLetter = (inputString) => {
542
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
543
- };
544
- var findKeyPosition = (str, key) => {
545
- const lines = str.split("\n");
546
- let startLineNumber = -1;
547
- let endLineNumber = -1;
548
- let startColumn = -1;
549
- let endColumn = -1;
550
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
551
- let braceCount = 0;
552
- let foundKey = false;
553
- for (let i = 0; i < lines.length; i++) {
554
- if (keyPattern.test(lines[i]) && !foundKey) {
555
- foundKey = true;
556
- startLineNumber = i + 1;
557
- startColumn = lines[i].indexOf(key) + 1;
558
- if (lines[i].includes("{}")) {
559
- endLineNumber = startLineNumber;
560
- endColumn = lines[i].indexOf("{}") + 3;
561
- break;
562
- }
563
- const line = lines[i].slice(startColumn + key.length);
564
- if (line.includes("{") || line.includes("[")) {
565
- braceCount = 1;
566
- } else {
567
- endLineNumber = i + 1;
568
- endColumn = lines[i].length + 1;
569
- break;
570
- }
571
- } else if (foundKey) {
572
- braceCount += (lines[i].match(/{/g) || []).length;
573
- braceCount += (lines[i].match(/\[/g) || []).length;
574
- braceCount -= (lines[i].match(/}/g) || []).length;
575
- braceCount -= (lines[i].match(/]/g) || []).length;
576
- if (braceCount === 0) {
577
- endLineNumber = i + 1;
578
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
579
- break;
580
- }
581
- }
582
- }
583
- return {
584
- startColumn,
585
- endColumn,
586
- startLineNumber,
587
- endLineNumber
588
- };
589
- };
590
- var replaceOctalEscapeSequences = (str) => {
591
- const octalRegex = /\\([0-7]{1,3})/g;
592
- return str.replace(octalRegex, (match, p1) => {
593
- const octalValue = parseInt(p1, 8);
594
- const char = String.fromCharCode(octalValue);
595
- return char;
596
- });
597
- };
598
- var encodeNewlines = (str) => {
599
- return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
600
- };
601
- var decodeNewlines = (encodedStr) => {
602
- return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
603
- };
604
- var customEncodeURIComponent = (str) => {
605
- return str.split("").map((char) => {
606
- if (/[^a-zA-Z0-9\s]/.test(char)) {
607
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
608
- }
609
- return char;
610
- }).join("");
611
- };
612
- var customDecodeURIComponent = (encodedStr) => {
613
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
614
- };
615
- }
616
- });
617
-
618
- // ../../node_modules/@domql/utils/dist/cjs/object.js
619
- var require_object = __commonJS({
620
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
621
- "use strict";
622
- var __defProp2 = Object.defineProperty;
623
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
624
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
625
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
626
- var __export2 = (target, all) => {
627
- for (var name in all)
628
- __defProp2(target, name, { get: all[name], enumerable: true });
629
- };
630
- var __copyProps2 = (to, from, except, desc) => {
631
- if (from && typeof from === "object" || typeof from === "function") {
632
- for (let key of __getOwnPropNames2(from))
633
- if (!__hasOwnProp2.call(to, key) && key !== except)
634
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
635
- }
636
- return to;
637
- };
638
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
639
- var object_exports = {};
640
- __export2(object_exports, {
641
- clone: () => clone,
642
- createNestedObject: () => createNestedObject,
643
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
644
- deepClone: () => deepClone2,
645
- deepContains: () => deepContains,
646
- deepDestringify: () => deepDestringify,
647
- deepDiff: () => deepDiff,
648
- deepMerge: () => deepMerge2,
649
- deepStringify: () => deepStringify,
650
- deepStringifyWithMaxDepth: () => deepStringifyWithMaxDepth,
651
- detachFunctionsFromObject: () => detachFunctionsFromObject,
652
- detectInfiniteLoop: () => detectInfiniteLoop,
653
- diff: () => diff,
654
- diffArrays: () => diffArrays,
655
- diffObjects: () => diffObjects,
656
- excludeKeysFromObject: () => excludeKeysFromObject,
657
- exec: () => exec,
658
- flattenRecursive: () => flattenRecursive,
659
- hasOwnProperty: () => hasOwnProperty,
660
- isCyclic: () => isCyclic,
661
- isEmpty: () => isEmpty,
662
- isEmptyObject: () => isEmptyObject,
663
- isEqualDeep: () => isEqualDeep,
664
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
665
- map: () => map,
666
- merge: () => merge,
667
- mergeArrayExclude: () => mergeArrayExclude,
668
- mergeIfExisted: () => mergeIfExisted,
669
- objectToString: () => objectToString,
670
- overwrite: () => overwrite,
671
- overwriteDeep: () => overwriteDeep,
672
- overwriteShallow: () => overwriteShallow,
673
- removeFromObject: () => removeFromObject,
674
- removeNestedKeyByPath: () => removeNestedKeyByPath,
675
- stringToObject: () => stringToObject
676
- });
677
- module2.exports = __toCommonJS2(object_exports);
678
- var import_globals3 = require_globals();
679
- var import_types = require_types();
680
- var import_array = require_array();
681
- var import_string = require_string();
682
- var import_node = require_node();
683
- var ENV = "development";
684
- var exec = (param, element, state, context) => {
685
- if ((0, import_types.isFunction)(param)) {
686
- return param.call(
687
- element,
688
- element,
689
- state || element.state,
690
- context || element.context
691
- );
692
- }
693
- return param;
694
- };
695
- var map = (obj, extention, element) => {
696
- for (const e in extention) {
697
- obj[e] = exec(extention[e], element);
698
- }
699
- };
700
- var merge = (element, obj, excludeFrom = []) => {
701
- for (const e in obj) {
702
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
703
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
704
- continue;
705
- const elementProp = element[e];
706
- const objProp = obj[e];
707
- if (elementProp === void 0) {
708
- element[e] = objProp;
709
- }
710
- }
711
- return element;
712
- };
713
- var deepMerge2 = (element, extend, excludeFrom = []) => {
714
- for (const e in extend) {
715
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
716
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
717
- continue;
718
- const elementProp = element[e];
719
- const extendProp = extend[e];
720
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
721
- deepMerge2(elementProp, extendProp, excludeFrom);
722
- } else if (elementProp === void 0) {
723
- element[e] = extendProp;
724
- }
725
- }
726
- return element;
727
- };
728
- var clone = (obj, excludeFrom = []) => {
729
- const o = {};
730
- for (const prop in obj) {
731
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
732
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
733
- continue;
734
- o[prop] = obj[prop];
735
- }
736
- return o;
737
- };
738
- var mergeArrayExclude = (arr, exclude = []) => {
739
- return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
740
- };
741
- var deepClone2 = (obj, options = {}) => {
742
- const {
743
- exclude = [],
744
- cleanUndefined = false,
745
- cleanNull = false,
746
- window: targetWindow,
747
- visited = /* @__PURE__ */ new WeakMap(),
748
- handleExtend = false
749
- } = options;
750
- if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
751
- return obj;
752
- }
753
- if (visited.has(obj)) {
754
- return visited.get(obj);
755
- }
756
- const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
757
- visited.set(obj, clone2);
758
- for (const key in obj) {
759
- if (!Object.prototype.hasOwnProperty.call(obj, key))
760
- continue;
761
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
762
- continue;
763
- const value = obj[key];
764
- if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
765
- continue;
766
- if ((0, import_node.isDOMNode)(value)) {
767
- clone2[key] = value;
768
- continue;
769
- }
770
- if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
771
- clone2[key] = (0, import_array.mergeArray)(value, exclude);
772
- continue;
773
- }
774
- if ((0, import_types.isFunction)(value) && targetWindow) {
775
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
776
- continue;
777
- }
778
- if ((0, import_types.isObjectLike)(value)) {
779
- clone2[key] = deepClone2(value, {
780
- ...options,
781
- visited
782
- });
783
- } else {
784
- clone2[key] = value;
785
- }
786
- }
787
- return clone2;
788
- };
789
- var deepStringify = (obj, stringified = {}) => {
790
- var _a, _b;
791
- if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
792
- (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
793
- obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
794
- }
795
- for (const prop in obj) {
796
- const objProp = obj[prop];
797
- if ((0, import_types.isFunction)(objProp)) {
798
- stringified[prop] = objProp.toString();
799
- } else if ((0, import_types.isObject)(objProp)) {
800
- stringified[prop] = {};
801
- deepStringify(objProp, stringified[prop]);
802
- } else if ((0, import_types.isArray)(objProp)) {
803
- stringified[prop] = [];
804
- objProp.forEach((v, i) => {
805
- if ((0, import_types.isObject)(v)) {
806
- stringified[prop][i] = {};
807
- deepStringify(v, stringified[prop][i]);
808
- } else if ((0, import_types.isFunction)(v)) {
809
- stringified[prop][i] = v.toString();
810
- } else {
811
- stringified[prop][i] = v;
812
- }
813
- });
814
- } else {
815
- stringified[prop] = objProp;
816
- }
817
- }
818
- return stringified;
819
- };
820
- var MAX_DEPTH = 100;
821
- var deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "") => {
822
- if (depth > MAX_DEPTH) {
823
- console.warn(`Maximum depth exceeded at path: ${path}. Possible circular reference.`);
824
- return "[MAX_DEPTH_EXCEEDED]";
825
- }
826
- for (const prop in obj) {
827
- const currentPath = path ? `${path}.${prop}` : prop;
828
- const objProp = obj[prop];
829
- if ((0, import_types.isFunction)(objProp)) {
830
- stringified[prop] = objProp.toString();
831
- } else if ((0, import_types.isObject)(objProp)) {
832
- stringified[prop] = {};
833
- deepStringifyWithMaxDepth(objProp, stringified[prop], depth + 1, currentPath);
834
- } else if ((0, import_types.isArray)(objProp)) {
835
- stringified[prop] = [];
836
- objProp.forEach((v, i) => {
837
- const itemPath = `${currentPath}[${i}]`;
838
- if ((0, import_types.isObject)(v)) {
839
- stringified[prop][i] = {};
840
- deepStringifyWithMaxDepth(v, stringified[prop][i], depth + 1, itemPath);
841
- } else if ((0, import_types.isFunction)(v)) {
842
- stringified[prop][i] = v.toString();
843
- } else {
844
- stringified[prop][i] = v;
845
- }
846
- });
847
- } else {
848
- stringified[prop] = objProp;
849
- }
850
- }
851
- return stringified;
852
- };
853
- var objectToString = (obj = {}, indent = 0) => {
854
- if (obj === null || typeof obj !== "object") {
855
- return String(obj);
856
- }
857
- if (Object.keys(obj).length === 0) {
858
- return "{}";
859
- }
860
- const spaces = " ".repeat(indent);
861
- let str = "{\n";
862
- for (const [key, value] of Object.entries(obj)) {
863
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
864
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
865
- str += `${spaces} ${stringedKey}: `;
866
- if ((0, import_types.isArray)(value)) {
867
- str += "[\n";
868
- for (const element of value) {
869
- if ((0, import_types.isObjectLike)(element) && element !== null) {
870
- str += `${spaces} ${objectToString(element, indent + 2)},
871
- `;
872
- } else if ((0, import_types.isString)(element)) {
873
- str += `${spaces} '${element}',
874
- `;
875
- } else {
876
- str += `${spaces} ${element},
877
- `;
878
- }
879
- }
880
- str += `${spaces} ]`;
881
- } else if ((0, import_types.isObjectLike)(value)) {
882
- str += objectToString(value, indent + 1);
883
- } else if ((0, import_types.isString)(value)) {
884
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
885
- } else {
886
- str += value;
887
- }
888
- str += ",\n";
889
- }
890
- str += `${spaces}}`;
891
- return str;
892
- };
893
- var detachFunctionsFromObject = (obj, detached = {}) => {
894
- for (const prop in obj) {
895
- const objProp = obj[prop];
896
- if ((0, import_types.isFunction)(objProp))
897
- continue;
898
- else if ((0, import_types.isObject)(objProp)) {
899
- detached[prop] = {};
900
- deepStringify(objProp, detached[prop]);
901
- } else if ((0, import_types.isArray)(objProp)) {
902
- detached[prop] = [];
903
- objProp.forEach((v, i) => {
904
- if ((0, import_types.isFunction)(v))
905
- return;
906
- if ((0, import_types.isObject)(v)) {
907
- detached[prop][i] = {};
908
- detachFunctionsFromObject(v, detached[prop][i]);
909
- } else {
910
- detached[prop][i] = v;
911
- }
912
- });
913
- } else {
914
- detached[prop] = objProp;
915
- }
916
- }
917
- return detached;
918
- };
919
- var deepDestringify = (obj, destringified = {}) => {
920
- for (const prop in obj) {
921
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
922
- if (!hasOwnProperty2)
923
- continue;
924
- const objProp = obj[prop];
925
- if ((0, import_types.isString)(objProp)) {
926
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
927
- try {
928
- const evalProp = import_globals3.window.eval(`(${objProp})`);
929
- destringified[prop] = evalProp;
930
- } catch (e) {
931
- if (e)
932
- destringified[prop] = objProp;
933
- }
934
- } else {
935
- destringified[prop] = objProp;
936
- }
937
- } else if ((0, import_types.isArray)(objProp)) {
938
- destringified[prop] = [];
939
- objProp.forEach((arrProp) => {
940
- if ((0, import_types.isString)(arrProp)) {
941
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
942
- try {
943
- const evalProp = import_globals3.window.eval(`(${arrProp})`);
944
- destringified[prop].push(evalProp);
945
- } catch (e) {
946
- if (e)
947
- destringified[prop].push(arrProp);
948
- }
949
- } else {
950
- destringified[prop].push(arrProp);
951
- }
952
- } else if ((0, import_types.isObject)(arrProp)) {
953
- destringified[prop].push(deepDestringify(arrProp));
954
- } else {
955
- destringified[prop].push(arrProp);
956
- }
957
- });
958
- } else if ((0, import_types.isObject)(objProp)) {
959
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
960
- } else {
961
- destringified[prop] = objProp;
962
- }
963
- }
964
- return destringified;
965
- };
966
- var stringToObject = (str, opts = { verbose: true }) => {
967
- try {
968
- return str ? import_globals3.window.eval("(" + str + ")") : {};
969
- } catch (e) {
970
- if (opts.verbose)
971
- console.warn(e);
972
- }
973
- };
974
- var diffObjects = (original, objToDiff, cache) => {
975
- for (const e in objToDiff) {
976
- if (e === "ref")
977
- continue;
978
- const originalProp = original[e];
979
- const objToDiffProp = objToDiff[e];
980
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
981
- cache[e] = {};
982
- diff(originalProp, objToDiffProp, cache[e]);
983
- } else if (objToDiffProp !== void 0) {
984
- cache[e] = objToDiffProp;
985
- }
986
- }
987
- return cache;
988
- };
989
- var diffArrays = (original, objToDiff, cache) => {
990
- if (original.length !== objToDiff.length) {
991
- cache = objToDiff;
992
- } else {
993
- const diffArr = [];
994
- for (let i = 0; i < original.length; i++) {
995
- const diffObj = diff(original[i], objToDiff[i]);
996
- if (Object.keys(diffObj).length > 0) {
997
- diffArr.push(diffObj);
998
- }
999
- }
1000
- if (diffArr.length > 0) {
1001
- cache = diffArr;
1002
- }
1003
- }
1004
- return cache;
1005
- };
1006
- var diff = (original, objToDiff, cache = {}) => {
1007
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
1008
- cache = [];
1009
- diffArrays(original, objToDiff, cache);
1010
- } else {
1011
- diffObjects(original, objToDiff, cache);
1012
- }
1013
- return cache;
1014
- };
1015
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
1016
- var isEmpty = (o) => Object.keys(o).length === 0;
1017
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
1018
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
1019
- var deepDiff = (lhs, rhs) => {
1020
- if (lhs === rhs)
1021
- return {};
1022
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
1023
- return rhs;
1024
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
1025
- if (!hasOwnProperty(rhs, key)) {
1026
- acc[key] = void 0;
1027
- }
1028
- return acc;
1029
- }, makeObjectWithoutPrototype());
1030
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
1031
- if (lhs.valueOf() === rhs.valueOf())
1032
- return {};
1033
- return rhs;
1034
- }
1035
- return Object.keys(rhs).reduce((acc, key) => {
1036
- if (!hasOwnProperty(lhs, key)) {
1037
- acc[key] = rhs[key];
1038
- return acc;
1039
- }
1040
- const difference = diff(lhs[key], rhs[key]);
1041
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
1042
- return acc;
1043
- }
1044
- acc[key] = difference;
1045
- return acc;
1046
- }, deletedValues);
1047
- };
1048
- var overwrite = (element, params, opts = {}) => {
1049
- const { __ref: ref } = element;
1050
- const excl = opts.exclude || [];
1051
- const allowUnderscore = opts.preventUnderscore;
1052
- const preventCaching = opts.preventCaching;
1053
- for (const e in params) {
1054
- if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
1055
- continue;
1056
- const elementProp = element[e];
1057
- const paramsProp = params[e];
1058
- if (paramsProp !== void 0) {
1059
- element[e] = paramsProp;
1060
- if (ref && !preventCaching) {
1061
- ref.__cache[e] = elementProp;
1062
- }
1063
- if ((0, import_types.isObject)(opts.diff)) {
1064
- diff[e] = elementProp;
1065
- }
1066
- }
1067
- }
1068
- return element;
1069
- };
1070
- var overwriteShallow = (obj, params, excludeFrom = []) => {
1071
- for (const e in params) {
1072
- if (excludeFrom.includes(e) || e.startsWith("__"))
1073
- continue;
1074
- obj[e] = params[e];
1075
- }
1076
- return obj;
1077
- };
1078
- var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
1079
- const excl = opts.exclude || [];
1080
- const forcedExclude = opts.preventForce ? [] : ["node", "window"];
1081
- if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
1082
- return params;
1083
- }
1084
- if (visited.has(obj))
1085
- return visited.get(obj);
1086
- visited.set(obj, obj);
1087
- for (const e in params) {
1088
- if (!Object.hasOwnProperty.call(params, e))
1089
- continue;
1090
- if (excl.includes(e) || forcedExclude && e.startsWith("__"))
1091
- continue;
1092
- const objProp = obj[e];
1093
- const paramsProp = params[e];
1094
- if ((0, import_node.isDOMNode)(paramsProp)) {
1095
- obj[e] = paramsProp;
1096
- } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
1097
- obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
1098
- } else if (paramsProp !== void 0) {
1099
- obj[e] = paramsProp;
1100
- }
1101
- }
1102
- return obj;
1103
- };
1104
- var mergeIfExisted = (a, b) => {
1105
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
1106
- return deepMerge2(a, b);
1107
- return a || b;
1108
- };
1109
- var flattenRecursive = (param, prop, stack = []) => {
1110
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
1111
- stack.push(objectized);
1112
- const extendOfExtend = objectized[prop];
1113
- if (extendOfExtend)
1114
- flattenRecursive(extendOfExtend, prop, stack);
1115
- delete objectized[prop];
1116
- return stack;
1117
- };
1118
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
1119
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
1120
- return param === element;
1121
- }
1122
- if (visited.has(param) || visited.has(element)) {
1123
- return true;
1124
- }
1125
- visited.add(param);
1126
- visited.add(element);
1127
- const keysParam = Object.keys(param);
1128
- const keysElement = Object.keys(element);
1129
- if (keysParam.length !== keysElement.length) {
1130
- return false;
1131
- }
1132
- for (const key of keysParam) {
1133
- if (!keysElement.includes(key)) {
1134
- return false;
1135
- }
1136
- const paramProp = param[key];
1137
- const elementProp = element[key];
1138
- if (!isEqualDeep(paramProp, elementProp, visited)) {
1139
- return false;
1140
- }
1141
- }
1142
- return true;
1143
- };
1144
- var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
1145
- if (obj1 === obj2)
1146
- return true;
1147
- if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
1148
- return false;
1149
- if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
1150
- return obj1 === obj2;
1151
- const stack = [[obj1, obj2]];
1152
- const visited = /* @__PURE__ */ new WeakSet();
1153
- while (stack.length > 0) {
1154
- const [current1, current2] = stack.pop();
1155
- if (visited.has(current1))
1156
- continue;
1157
- visited.add(current1);
1158
- const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
1159
- const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
1160
- if (keys1.length !== keys2.length)
1161
- return false;
1162
- for (const key of keys1) {
1163
- if (!Object.prototype.hasOwnProperty.call(current2, key))
1164
- return false;
1165
- const value1 = current1[key];
1166
- const value2 = current2[key];
1167
- if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
1168
- if (value1 !== value2)
1169
- return false;
1170
- } else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
1171
- if (value1 !== value2) {
1172
- stack.push([value1, value2]);
1173
- }
1174
- } else if (value1 !== value2) {
1175
- return false;
1176
- }
1177
- }
1178
- }
1179
- return true;
1180
- };
1181
- var removeFromObject = (obj, props) => {
1182
- if (props === void 0 || props === null)
1183
- return obj;
1184
- if ((0, import_types.is)(props)("string", "number")) {
1185
- delete obj[props];
1186
- } else if ((0, import_types.isArray)(props)) {
1187
- props.forEach((prop) => delete obj[prop]);
1188
- } else {
1189
- throw new Error("Invalid input: props must be a string or an array of strings");
1190
- }
1191
- return obj;
1192
- };
1193
- var createObjectWithoutPrototype = (obj) => {
1194
- if (obj === null || typeof obj !== "object") {
1195
- return obj;
1196
- }
1197
- const newObj = /* @__PURE__ */ Object.create(null);
1198
- for (const key in obj) {
1199
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
1200
- newObj[key] = createObjectWithoutPrototype(obj[key]);
1201
- }
1202
- }
1203
- return newObj;
1204
- };
1205
- var createNestedObject = (arr, lastValue) => {
1206
- const nestedObject = {};
1207
- if (arr.length === 0) {
1208
- return lastValue;
1209
- }
1210
- arr.reduce((obj, value, index) => {
1211
- if (!obj[value]) {
1212
- obj[value] = {};
1213
- }
1214
- if (index === arr.length - 1 && lastValue) {
1215
- obj[value] = lastValue;
1216
- }
1217
- return obj[value];
1218
- }, nestedObject);
1219
- return nestedObject;
1220
- };
1221
- var removeNestedKeyByPath = (obj, path) => {
1222
- if (!Array.isArray(path)) {
1223
- throw new Error("Path must be an array.");
1224
- }
1225
- let current = obj;
1226
- for (let i = 0; i < path.length - 1; i++) {
1227
- if (current[path[i]] === void 0) {
1228
- return;
1229
- }
1230
- current = current[path[i]];
1231
- }
1232
- const lastKey = path[path.length - 1];
1233
- if (current && Object.hasOwnProperty.call(current, lastKey)) {
1234
- delete current[lastKey];
1235
- }
1236
- };
1237
- var detectInfiniteLoop = (arr) => {
1238
- const maxRepeats = 10;
1239
- let pattern = [];
1240
- let repeatCount = 0;
1241
- for (let i = 0; i < arr.length; i++) {
1242
- if (pattern.length < 2) {
1243
- pattern.push(arr[i]);
1244
- } else {
1245
- if (arr[i] === pattern[i % 2]) {
1246
- repeatCount++;
1247
- } else {
1248
- pattern = [arr[i - 1], arr[i]];
1249
- repeatCount = 1;
1250
- }
1251
- if (repeatCount >= maxRepeats * 2) {
1252
- if (ENV === "test" || ENV === "development") {
1253
- console.warn("Warning: Potential infinite loop detected due to repeated sequence:", pattern);
1254
- }
1255
- return true;
1256
- }
1257
- }
1258
- }
1259
- };
1260
- var isCyclic = (obj) => {
1261
- const seenObjects = [];
1262
- function detect(obj2) {
1263
- if (obj2 && typeof obj2 === "object") {
1264
- if (seenObjects.indexOf(obj2) !== -1) {
1265
- return true;
1266
- }
1267
- seenObjects.push(obj2);
1268
- for (const key in obj2) {
1269
- if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
1270
- console.log(obj2, "cycle at " + key);
1271
- return true;
1272
- }
1273
- }
1274
- }
1275
- return false;
1276
- }
1277
- return detect(obj);
1278
- };
1279
- var excludeKeysFromObject = (obj, excludedKeys) => {
1280
- const result = { ...obj };
1281
- excludedKeys.forEach((key) => delete result[key]);
1282
- return result;
1283
- };
1284
- }
1285
- });
1286
-
1287
- // ../../node_modules/@domql/utils/dist/cjs/function.js
1288
- var require_function = __commonJS({
1289
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
1290
- "use strict";
1291
- var __defProp2 = Object.defineProperty;
1292
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1293
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1294
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1295
- var __export2 = (target, all) => {
1296
- for (var name in all)
1297
- __defProp2(target, name, { get: all[name], enumerable: true });
1298
- };
1299
- var __copyProps2 = (to, from, except, desc) => {
1300
- if (from && typeof from === "object" || typeof from === "function") {
1301
- for (let key of __getOwnPropNames2(from))
1302
- if (!__hasOwnProp2.call(to, key) && key !== except)
1303
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1304
- }
1305
- return to;
1306
- };
1307
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1308
- var function_exports = {};
1309
- __export2(function_exports, {
1310
- cloneFunction: () => cloneFunction,
1311
- debounce: () => debounce,
1312
- debounceOnContext: () => debounceOnContext,
1313
- isStringFunction: () => isStringFunction,
1314
- memoize: () => memoize
1315
- });
1316
- module2.exports = __toCommonJS2(function_exports);
1317
- function debounce(func, wait, immediate) {
1318
- let timeout;
1319
- return function() {
1320
- const context = this;
1321
- const args = arguments;
1322
- const later = function() {
1323
- timeout = null;
1324
- if (!immediate)
1325
- func.apply(context, args);
1326
- };
1327
- const callNow = immediate && !timeout;
1328
- clearTimeout(timeout);
1329
- timeout = setTimeout(later, wait);
1330
- if (callNow)
1331
- func.apply(context, args);
1332
- };
1333
- }
1334
- var debounceOnContext = (element, func, timeout = 300) => {
1335
- let timer;
1336
- return (...args) => {
1337
- clearTimeout(timer);
1338
- timer = setTimeout(() => {
1339
- func.apply(element, args);
1340
- }, timeout);
1341
- };
1342
- };
1343
- var memoize = (fn) => {
1344
- const cache = {};
1345
- return (...args) => {
1346
- const n = args[0];
1347
- if (n in cache) {
1348
- return cache[n];
1349
- } else {
1350
- const result = fn(n);
1351
- cache[n] = result;
1352
- return result;
1353
- }
1354
- };
1355
- };
1356
- var isStringFunction = (inputString) => {
1357
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
1358
- return functionRegex.test(inputString);
1359
- };
1360
- function cloneFunction(fn, win = window) {
1361
- const temp = function() {
1362
- return fn.apply(win, arguments);
1363
- };
1364
- for (const key in fn) {
1365
- if (Object.hasOwnProperty.call(fn, key)) {
1366
- temp[key] = fn[key];
1367
- }
1368
- }
1369
- return temp;
1370
- }
1371
- }
1372
- });
1373
-
1374
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1375
- var require_log = __commonJS({
1376
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1377
- "use strict";
1378
- var __defProp2 = Object.defineProperty;
1379
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1380
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1381
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1382
- var __export2 = (target, all) => {
1383
- for (var name in all)
1384
- __defProp2(target, name, { get: all[name], enumerable: true });
1385
- };
1386
- var __copyProps2 = (to, from, except, desc) => {
1387
- if (from && typeof from === "object" || typeof from === "function") {
1388
- for (let key of __getOwnPropNames2(from))
1389
- if (!__hasOwnProp2.call(to, key) && key !== except)
1390
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1391
- }
1392
- return to;
1393
- };
1394
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1395
- var log_exports = {};
1396
- __export2(log_exports, {
1397
- logGroupIf: () => logGroupIf,
1398
- logIf: () => logIf
1399
- });
1400
- module2.exports = __toCommonJS2(log_exports);
1401
- var logIf = (bool, ...arg) => {
1402
- if (bool)
1403
- arg.map((v) => console.log(v));
1404
- };
1405
- var logGroupIf = (bool, key, ...arg) => {
1406
- if (bool) {
1407
- console.group(key);
1408
- arg.map((v) => console.log(v));
1409
- console.groupEnd(key);
1410
- }
1411
- };
1412
- }
1413
- });
1414
-
1415
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1416
- var require_cookie = __commonJS({
1417
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1418
- "use strict";
1419
- var __defProp2 = Object.defineProperty;
1420
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1421
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1422
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1423
- var __export2 = (target, all) => {
1424
- for (var name in all)
1425
- __defProp2(target, name, { get: all[name], enumerable: true });
1426
- };
1427
- var __copyProps2 = (to, from, except, desc) => {
1428
- if (from && typeof from === "object" || typeof from === "function") {
1429
- for (let key of __getOwnPropNames2(from))
1430
- if (!__hasOwnProp2.call(to, key) && key !== except)
1431
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1432
- }
1433
- return to;
1434
- };
1435
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1436
- var cookie_exports = {};
1437
- __export2(cookie_exports, {
1438
- getCookie: () => getCookie,
1439
- getLocalStorage: () => getLocalStorage,
1440
- isMobile: () => isMobile,
1441
- removeCookie: () => removeCookie,
1442
- setCookie: () => setCookie,
1443
- setLocalStorage: () => setLocalStorage
1444
- });
1445
- module2.exports = __toCommonJS2(cookie_exports);
1446
- var import_types = require_types();
1447
- var import_utils8 = require_cjs2();
1448
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1449
- var setCookie = (cname, cvalue, exdays = 365) => {
1450
- if ((0, import_types.isUndefined)(import_utils8.document) || (0, import_types.isUndefined)(import_utils8.document.cookie))
1451
- return;
1452
- const d = /* @__PURE__ */ new Date();
1453
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1454
- const expires = `expires=${d.toUTCString()}`;
1455
- import_utils8.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1456
- };
1457
- var getCookie = (cname) => {
1458
- if ((0, import_types.isUndefined)(import_utils8.document) || (0, import_types.isUndefined)(import_utils8.document.cookie))
1459
- return;
1460
- const name = `${cname}=`;
1461
- const decodedCookie = decodeURIComponent(import_utils8.document.cookie);
1462
- const ca = decodedCookie.split(";");
1463
- for (let i = 0; i < ca.length; i++) {
1464
- let c = ca[i];
1465
- while (c.charAt(0) === " ")
1466
- c = c.substring(1);
1467
- if (c.indexOf(name) === 0)
1468
- return c.substring(name.length, c.length);
1469
- }
1470
- return "";
1471
- };
1472
- var removeCookie = (cname) => {
1473
- if ((0, import_types.isUndefined)(import_utils8.document) || (0, import_types.isUndefined)(import_utils8.document.cookie))
1474
- return;
1475
- import_utils8.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1476
- };
1477
- function getLocalStorage(key) {
1478
- let savedJSON;
1479
- if (window.localStorage) {
1480
- try {
1481
- savedJSON = JSON.parse(window.localStorage.getItem(key));
1482
- } catch (e) {
1483
- }
1484
- }
1485
- if (typeof savedJSON !== "undefined") {
1486
- return savedJSON;
1487
- }
1488
- }
1489
- function setLocalStorage(key, data) {
1490
- if (data && window.localStorage) {
1491
- if (typeof data === "object") {
1492
- window.localStorage.setItem(key, JSON.stringify(data));
1493
- } else {
1494
- window.localStorage.setItem(key, data);
1495
- }
1496
- }
1497
- }
1498
- }
1499
- });
1500
-
1501
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1502
- var require_tags = __commonJS({
1503
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1504
- "use strict";
1505
- var __defProp2 = Object.defineProperty;
1506
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1507
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1508
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1509
- var __export2 = (target, all) => {
1510
- for (var name in all)
1511
- __defProp2(target, name, { get: all[name], enumerable: true });
1512
- };
1513
- var __copyProps2 = (to, from, except, desc) => {
1514
- if (from && typeof from === "object" || typeof from === "function") {
1515
- for (let key of __getOwnPropNames2(from))
1516
- if (!__hasOwnProp2.call(to, key) && key !== except)
1517
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1518
- }
1519
- return to;
1520
- };
1521
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1522
- var tags_exports = {};
1523
- __export2(tags_exports, {
1524
- HTML_TAGS: () => HTML_TAGS,
1525
- isValidHtmlTag: () => isValidHtmlTag
1526
- });
1527
- module2.exports = __toCommonJS2(tags_exports);
1528
- var HTML_TAGS = {
1529
- root: [
1530
- "body",
1531
- "html"
1532
- ],
1533
- head: [
1534
- "title",
1535
- "base",
1536
- "meta",
1537
- "style",
1538
- "noscript",
1539
- "script"
1540
- ],
1541
- body: [
1542
- "string",
1543
- "style",
1544
- "fragment",
1545
- "a",
1546
- "abbr",
1547
- "acronym",
1548
- "address",
1549
- "applet",
1550
- "area",
1551
- "article",
1552
- "aside",
1553
- "audio",
1554
- "b",
1555
- "basefont",
1556
- "bdi",
1557
- "bdo",
1558
- "big",
1559
- "blockquote",
1560
- "br",
1561
- "button",
1562
- "canvas",
1563
- "caption",
1564
- "center",
1565
- "cite",
1566
- "code",
1567
- "search",
1568
- "col",
1569
- "colgroup",
1570
- "data",
1571
- "datalist",
1572
- "dd",
1573
- "del",
1574
- "details",
1575
- "dfn",
1576
- "dialog",
1577
- "dir",
1578
- "div",
1579
- "dl",
1580
- "dt",
1581
- "em",
1582
- "embed",
1583
- "fieldset",
1584
- "figcaption",
1585
- "figure",
1586
- "font",
1587
- "footer",
1588
- "form",
1589
- "frame",
1590
- "frameset",
1591
- "h1",
1592
- "h2",
1593
- "h3",
1594
- "h4",
1595
- "h5",
1596
- "h6",
1597
- "head",
1598
- "header",
1599
- "hr",
1600
- "i",
1601
- "iframe",
1602
- "img",
1603
- "input",
1604
- "ins",
1605
- "kbd",
1606
- "label",
1607
- "legend",
1608
- "li",
1609
- "link",
1610
- "main",
1611
- "map",
1612
- "mark",
1613
- "meter",
1614
- "nav",
1615
- "noframes",
1616
- "noscript",
1617
- "object",
1618
- "ol",
1619
- "optgroup",
1620
- "option",
1621
- "output",
1622
- "p",
1623
- "param",
1624
- "picture",
1625
- "pre",
1626
- "progress",
1627
- "hgroup",
1628
- "q",
1629
- "rp",
1630
- "rt",
1631
- "ruby",
1632
- "s",
1633
- "samp",
1634
- "script",
1635
- "section",
1636
- "select",
1637
- "small",
1638
- "source",
1639
- "span",
1640
- "strike",
1641
- "strong",
1642
- "sub",
1643
- "summary",
1644
- "sup",
1645
- "table",
1646
- "tbody",
1647
- "td",
1648
- "template",
1649
- "hgroup",
1650
- "textarea",
1651
- "tfoot",
1652
- "th",
1653
- "thead",
1654
- "time",
1655
- "tr",
1656
- "track",
1657
- "tt",
1658
- "u",
1659
- "ul",
1660
- "var",
1661
- "video",
1662
- "wbr",
1663
- // SVG
1664
- "svg",
1665
- "path"
1666
- ]
1667
- };
1668
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
1669
- }
1670
- });
1671
-
1672
- // ../../node_modules/@domql/utils/dist/cjs/component.js
1673
- var require_component = __commonJS({
1674
- "../../node_modules/@domql/utils/dist/cjs/component.js"(exports, module2) {
1675
- "use strict";
1676
- var __defProp2 = Object.defineProperty;
1677
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1678
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1679
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1680
- var __export2 = (target, all) => {
1681
- for (var name in all)
1682
- __defProp2(target, name, { get: all[name], enumerable: true });
1683
- };
1684
- var __copyProps2 = (to, from, except, desc) => {
1685
- if (from && typeof from === "object" || typeof from === "function") {
1686
- for (let key of __getOwnPropNames2(from))
1687
- if (!__hasOwnProp2.call(to, key) && key !== except)
1688
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1689
- }
1690
- return to;
1691
- };
1692
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1693
- var component_exports = {};
1694
- __export2(component_exports, {
1695
- addAdditionalExtend: () => addAdditionalExtend,
1696
- addChildrenIfNotInOriginal: () => addChildrenIfNotInOriginal,
1697
- applyComponentFromContext: () => applyComponentFromContext,
1698
- applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1699
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1700
- checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1701
- checkIfSugar: () => checkIfSugar,
1702
- extendizeByKey: () => extendizeByKey,
1703
- extractComponentKeyFromKey: () => extractComponentKeyFromKey,
1704
- getCapitalCaseKeys: () => getCapitalCaseKeys,
1705
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1706
- getExtendsInElement: () => getExtendsInElement,
1707
- hasVariantProp: () => hasVariantProp,
1708
- isVariant: () => isVariant,
1709
- setContentKey: () => setContentKey
1710
- });
1711
- module2.exports = __toCommonJS2(component_exports);
1712
- var import__ = require_cjs2();
1713
- var ENV = "development";
1714
- var checkIfKeyIsComponent = (key) => {
1715
- const isFirstKeyString = (0, import__.isString)(key);
1716
- if (!isFirstKeyString)
1717
- return;
1718
- const firstCharKey = key.slice(0, 1);
1719
- return /^[A-Z]*$/.test(firstCharKey);
1720
- };
1721
- var checkIfKeyIsProperty = (key) => {
1722
- const isFirstKeyString = (0, import__.isString)(key);
1723
- if (!isFirstKeyString)
1724
- return;
1725
- const firstCharKey = key.slice(0, 1);
1726
- return /^[a-z]*$/.test(firstCharKey);
1727
- };
1728
- var addAdditionalExtend = (newExtend, element) => {
1729
- if (!newExtend)
1730
- return element;
1731
- const { extend: elementExtend } = element;
1732
- const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
1733
- const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
1734
- const extend = (0, import__.joinArrays)(receivedArray, originalArray);
1735
- return { ...element, extend };
1736
- };
1737
- var checkIfSugar = (element, parent, key) => {
1738
- var _a;
1739
- const {
1740
- extend,
1741
- props,
1742
- childExtend,
1743
- extends: extendProps,
1744
- childExtends,
1745
- childProps,
1746
- children,
1747
- on,
1748
- $collection,
1749
- $stateCollection,
1750
- $propsCollection
1751
- } = element;
1752
- const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1753
- if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1754
- const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1755
- if (logErr)
1756
- logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1757
- }
1758
- return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1759
- };
1760
- var extractComponentKeyFromKey = (key) => {
1761
- return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1762
- };
1763
- var extendizeByKey = (element, parent, key) => {
1764
- const { context } = parent;
1765
- const { tag, extend, childExtends } = element;
1766
- const isSugar = checkIfSugar(element, parent, key);
1767
- const extendFromKey = extractComponentKeyFromKey(key);
1768
- const isExtendKeyComponent = context && context.components[extendFromKey];
1769
- if (element === isExtendKeyComponent)
1770
- return element;
1771
- else if (isSugar) {
1772
- const newElem = addAdditionalExtend(element.extends, {
1773
- extend: extendFromKey,
1774
- tag,
1775
- props: { ...element }
1776
- });
1777
- if (newElem.props.data) {
1778
- newElem.data = newElem.props.data;
1779
- delete newElem.props.data;
1780
- }
1781
- if (newElem.props.state) {
1782
- newElem.state = newElem.props.state;
1783
- delete newElem.props.state;
1784
- }
1785
- if (newElem.props.attr) {
1786
- newElem.attr = newElem.props.attr;
1787
- delete newElem.props.attr;
1788
- }
1789
- if (newElem.props.if) {
1790
- newElem.if = newElem.props.if;
1791
- delete newElem.props.if;
1792
- }
1793
- if (childExtends)
1794
- newElem.childExtend = childExtends;
1795
- return newElem;
1796
- } else if (!extend || extend === true) {
1797
- return {
1798
- ...element,
1799
- tag,
1800
- extend: extendFromKey
1801
- };
1802
- } else if (extend) {
1803
- return addAdditionalExtend(extendFromKey, element);
1804
- } else if ((0, import__.isFunction)(element)) {
1805
- return {
1806
- extend: extendFromKey,
1807
- tag,
1808
- props: { ...(0, import__.exec)(element, parent) }
1809
- };
1810
- }
1811
- };
1812
- function getCapitalCaseKeys(obj) {
1813
- return Object.keys(obj).filter((key) => /^[A-Z]/.test(key));
1814
- }
1815
- var addChildrenIfNotInOriginal = (element, parent, key) => {
1816
- const childElems = getCapitalCaseKeys(element.props);
1817
- if (!childElems.length)
1818
- return element;
1819
- for (const i in childElems) {
1820
- const childKey = childElems[i];
1821
- const childElem = element[childKey];
1822
- const newChild = element.props[childKey];
1823
- const assignChild = (val) => {
1824
- element[childKey] = val;
1825
- delete element.props[childKey];
1826
- };
1827
- if (newChild == null ? void 0 : newChild.ignoreExtend)
1828
- continue;
1829
- if (newChild === null)
1830
- assignChild(null);
1831
- else if (!childElem)
1832
- assignChild((0, import__.deepClone)(newChild));
1833
- else {
1834
- const isSugarChildElem = checkIfSugar(childElem, parent, key);
1835
- if (isSugarChildElem)
1836
- continue;
1837
- assignChild({
1838
- extend: element[childKey],
1839
- props: newChild
1840
- });
1841
- }
1842
- }
1843
- };
1844
- var applyKeyComponentAsExtend = (element, parent, key) => {
1845
- return extendizeByKey(element, parent, key) || element;
1846
- };
1847
- var applyComponentFromContext = (element, parent, options) => {
1848
- const { context } = element;
1849
- if (!context || !context.components)
1850
- return;
1851
- const { components } = context;
1852
- const { extend } = element;
1853
- const execExtend = (0, import__.exec)(extend, element);
1854
- if ((0, import__.isString)(execExtend)) {
1855
- const componentExists = components[execExtend] || components["smbls." + execExtend];
1856
- if (componentExists)
1857
- element.extend = componentExists;
1858
- else {
1859
- if ((ENV === "test" || ENV === "development") && options.verbose) {
1860
- console.warn(execExtend, "is not in library", components, element);
1861
- console.warn("replacing with ", {});
1862
- }
1863
- element.extend = {};
1864
- }
1865
- }
1866
- };
1867
- var isVariant = (param) => {
1868
- if (!(0, import__.isString)(param))
1869
- return;
1870
- const firstCharKey = param.slice(0, 1);
1871
- return firstCharKey === ".";
1872
- };
1873
- var hasVariantProp = (element) => {
1874
- const { props } = element;
1875
- if ((0, import__.isObject)(props) && (0, import__.isString)(props.variant))
1876
- return true;
1877
- };
1878
- var getChildrenComponentsByKey = (key, el) => {
1879
- if (key === el.key || el.__ref.__componentKey === key) {
1880
- return el;
1881
- }
1882
- if (el.extend) {
1883
- const foundString = (0, import__.isString)(el.extend) && el.extend === key;
1884
- const foundInArray = (0, import__.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
1885
- if (foundString || foundInArray)
1886
- return el;
1887
- }
1888
- if (el.parent && el.parent.childExtend) {
1889
- const foundString = (0, import__.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1890
- const foundInArray = (0, import__.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1891
- if (foundString || foundInArray)
1892
- return el;
1893
- }
1894
- };
1895
- var getExtendsInElement = (obj) => {
1896
- let result = [];
1897
- function traverse(o) {
1898
- for (const key in o) {
1899
- if (Object.hasOwnProperty.call(o, key)) {
1900
- if (checkIfKeyIsComponent(key)) {
1901
- result.push(key);
1902
- }
1903
- if (key === "extend" || key === "extends") {
1904
- if (typeof o[key] === "string") {
1905
- result.push(o[key]);
1906
- } else if (Array.isArray(o[key])) {
1907
- result = result.concat(o[key]);
1908
- }
1909
- }
1910
- if (typeof o[key] === "object" && o[key] !== null) {
1911
- traverse(o[key]);
1912
- }
1913
- }
1914
- }
1915
- }
1916
- traverse(obj);
1917
- return result;
1918
- };
1919
- var setContentKey = (el, opts = {}) => {
1920
- const { __ref: ref } = el;
1921
- const contentElementKey = opts.contentElementKey;
1922
- if (contentElementKey !== "content" && contentElementKey !== ref.contentElementKey || !ref.contentElementKey) {
1923
- ref.contentElementKey = contentElementKey || "content";
1924
- } else
1925
- ref.contentElementKey = "content";
1926
- if (contentElementKey !== "content")
1927
- opts.contentElementKey = "content";
1928
- return ref.contentElementKey;
1929
- };
1930
- }
1931
- });
1932
-
1933
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1934
- var require_cjs2 = __commonJS({
1935
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1936
- "use strict";
1937
- var __defProp2 = Object.defineProperty;
1938
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1939
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1940
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1941
- var __copyProps2 = (to, from, except, desc) => {
1942
- if (from && typeof from === "object" || typeof from === "function") {
1943
- for (let key of __getOwnPropNames2(from))
1944
- if (!__hasOwnProp2.call(to, key) && key !== except)
1945
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1946
- }
1947
- return to;
1948
- };
1949
- var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1950
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1951
- var utils_exports = {};
1952
- module2.exports = __toCommonJS2(utils_exports);
1953
- __reExport(utils_exports, require_key(), module2.exports);
1954
- __reExport(utils_exports, require_env(), module2.exports);
1955
- __reExport(utils_exports, require_types(), module2.exports);
1956
- __reExport(utils_exports, require_object(), module2.exports);
1957
- __reExport(utils_exports, require_function(), module2.exports);
1958
- __reExport(utils_exports, require_array(), module2.exports);
1959
- __reExport(utils_exports, require_node(), module2.exports);
1960
- __reExport(utils_exports, require_log(), module2.exports);
1961
- __reExport(utils_exports, require_string(), module2.exports);
1962
- __reExport(utils_exports, require_globals(), module2.exports);
1963
- __reExport(utils_exports, require_cookie(), module2.exports);
1964
- __reExport(utils_exports, require_tags(), module2.exports);
1965
- __reExport(utils_exports, require_component(), module2.exports);
64
+ var window4 = globalThis;
65
+ var document5 = window4.document;
1966
66
  }
1967
67
  });
1968
68
 
1969
69
  // ../utils/dist/cjs/index.js
1970
- var require_cjs3 = __commonJS({
70
+ var require_cjs2 = __commonJS({
1971
71
  "../utils/dist/cjs/index.js"(exports, module2) {
1972
72
  "use strict";
1973
- var __create2 = Object.create;
1974
- var __defProp2 = Object.defineProperty;
73
+ var __defProp3 = Object.defineProperty;
1975
74
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1976
75
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
1977
- var __getProtoOf2 = Object.getPrototypeOf;
1978
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1979
- var __commonJS2 = (cb, mod) => function __require() {
1980
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1981
- };
76
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1982
77
  var __export2 = (target, all) => {
1983
78
  for (var name in all)
1984
- __defProp2(target, name, { get: all[name], enumerable: true });
79
+ __defProp3(target, name, { get: all[name], enumerable: true });
1985
80
  };
1986
81
  var __copyProps2 = (to, from, except, desc) => {
1987
82
  if (from && typeof from === "object" || typeof from === "function") {
1988
83
  for (let key of __getOwnPropNames2(from))
1989
- if (!__hasOwnProp2.call(to, key) && key !== except)
1990
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
84
+ if (!__hasOwnProp3.call(to, key) && key !== except)
85
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1991
86
  }
1992
87
  return to;
1993
88
  };
1994
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1995
- // If the importer is in node compatibility mode or this is not an ESM
1996
- // file that has been converted to a CommonJS file using a Babel-
1997
- // compatible transform (i.e. "__esModule" has not been set), then set
1998
- // "default" to the CommonJS "module.exports" for node compatibility.
1999
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
2000
- mod
2001
- ));
2002
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
2003
- var require_key2 = __commonJS2({
2004
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
2005
- "use strict";
2006
- var __defProp22 = Object.defineProperty;
2007
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2008
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2009
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2010
- var __export22 = (target, all) => {
2011
- for (var name in all)
2012
- __defProp22(target, name, { get: all[name], enumerable: true });
2013
- };
2014
- var __copyProps22 = (to, from, except, desc) => {
2015
- if (from && typeof from === "object" || typeof from === "function") {
2016
- for (let key of __getOwnPropNames22(from))
2017
- if (!__hasOwnProp22.call(to, key) && key !== except)
2018
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2019
- }
2020
- return to;
2021
- };
2022
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2023
- var key_exports = {};
2024
- __export22(key_exports, {
2025
- createSnapshotId: () => createSnapshotId,
2026
- generateKey: () => generateKey
2027
- });
2028
- module22.exports = __toCommonJS22(key_exports);
2029
- var generateKey = /* @__PURE__ */ function() {
2030
- let index = 0;
2031
- function newId() {
2032
- index++;
2033
- return index;
2034
- }
2035
- return newId;
2036
- }();
2037
- var createSnapshotId = generateKey;
2038
- }
2039
- });
2040
- var require_env2 = __commonJS2({
2041
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
2042
- "use strict";
2043
- var __defProp22 = Object.defineProperty;
2044
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2045
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2046
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2047
- var __export22 = (target, all) => {
2048
- for (var name in all)
2049
- __defProp22(target, name, { get: all[name], enumerable: true });
2050
- };
2051
- var __copyProps22 = (to, from, except, desc) => {
2052
- if (from && typeof from === "object" || typeof from === "function") {
2053
- for (let key of __getOwnPropNames22(from))
2054
- if (!__hasOwnProp22.call(to, key) && key !== except)
2055
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2056
- }
2057
- return to;
2058
- };
2059
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2060
- var env_exports = {};
2061
- __export22(env_exports, {
2062
- NODE_ENV: () => NODE_ENV,
2063
- getNev: () => getNev,
2064
- isDevelopment: () => isDevelopment,
2065
- isProduction: () => isProduction,
2066
- isTest: () => isTest
2067
- });
2068
- module22.exports = __toCommonJS22(env_exports);
2069
- var NODE_ENV = "development";
2070
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
2071
- var isTest = (env = NODE_ENV) => env === "test";
2072
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
2073
- var getNev = (key, env = NODE_ENV) => env[key];
2074
- }
2075
- });
2076
- var require_globals2 = __commonJS2({
2077
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
2078
- "use strict";
2079
- var __defProp22 = Object.defineProperty;
2080
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2081
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2082
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2083
- var __export22 = (target, all) => {
2084
- for (var name in all)
2085
- __defProp22(target, name, { get: all[name], enumerable: true });
2086
- };
2087
- var __copyProps22 = (to, from, except, desc) => {
2088
- if (from && typeof from === "object" || typeof from === "function") {
2089
- for (let key of __getOwnPropNames22(from))
2090
- if (!__hasOwnProp22.call(to, key) && key !== except)
2091
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2092
- }
2093
- return to;
2094
- };
2095
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2096
- var globals_exports = {};
2097
- __export22(globals_exports, {
2098
- document: () => document22,
2099
- global: () => global,
2100
- self: () => self,
2101
- window: () => window22
2102
- });
2103
- module22.exports = __toCommonJS22(globals_exports);
2104
- var global = globalThis;
2105
- var self = globalThis;
2106
- var window22 = globalThis;
2107
- var document22 = window22.document;
2108
- }
2109
- });
2110
- var require_node2 = __commonJS2({
2111
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
2112
- "use strict";
2113
- var __defProp22 = Object.defineProperty;
2114
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2115
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2116
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2117
- var __export22 = (target, all) => {
2118
- for (var name in all)
2119
- __defProp22(target, name, { get: all[name], enumerable: true });
2120
- };
2121
- var __copyProps22 = (to, from, except, desc) => {
2122
- if (from && typeof from === "object" || typeof from === "function") {
2123
- for (let key of __getOwnPropNames22(from))
2124
- if (!__hasOwnProp22.call(to, key) && key !== except)
2125
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2126
- }
2127
- return to;
2128
- };
2129
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2130
- var node_exports = {};
2131
- __export22(node_exports, {
2132
- isDOMNode: () => isDOMNode,
2133
- isHtmlElement: () => isHtmlElement,
2134
- isNode: () => isNode
2135
- });
2136
- module22.exports = __toCommonJS22(node_exports);
2137
- var import_globals3 = require_globals2();
2138
- var isNode = (obj) => {
2139
- return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
2140
- };
2141
- var isHtmlElement = (obj) => {
2142
- return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
2143
- };
2144
- var isDOMNode = (obj) => {
2145
- return typeof import_globals3.window !== "undefined" && (obj instanceof import_globals3.window.Node || obj instanceof import_globals3.window.Window || obj === import_globals3.window || obj === document);
2146
- };
2147
- }
2148
- });
2149
- var require_types2 = __commonJS2({
2150
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
2151
- "use strict";
2152
- var __defProp22 = Object.defineProperty;
2153
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2154
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2155
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2156
- var __export22 = (target, all) => {
2157
- for (var name in all)
2158
- __defProp22(target, name, { get: all[name], enumerable: true });
2159
- };
2160
- var __copyProps22 = (to, from, except, desc) => {
2161
- if (from && typeof from === "object" || typeof from === "function") {
2162
- for (let key of __getOwnPropNames22(from))
2163
- if (!__hasOwnProp22.call(to, key) && key !== except)
2164
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2165
- }
2166
- return to;
2167
- };
2168
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2169
- var types_exports = {};
2170
- __export22(types_exports, {
2171
- TYPES: () => TYPES,
2172
- is: () => is,
2173
- isArray: () => isArray3,
2174
- isBoolean: () => isBoolean,
2175
- isDate: () => isDate,
2176
- isDefined: () => isDefined2,
2177
- isFunction: () => isFunction,
2178
- isNot: () => isNot,
2179
- isNull: () => isNull,
2180
- isNumber: () => isNumber2,
2181
- isObject: () => isObject3,
2182
- isObjectLike: () => isObjectLike2,
2183
- isString: () => isString22,
2184
- isUndefined: () => isUndefined
2185
- });
2186
- module22.exports = __toCommonJS22(types_exports);
2187
- var import_node = require_node2();
2188
- var isObject3 = (arg) => {
2189
- if (arg === null)
2190
- return false;
2191
- return typeof arg === "object" && arg.constructor === Object;
2192
- };
2193
- var isString22 = (arg) => typeof arg === "string";
2194
- var isNumber2 = (arg) => typeof arg === "number";
2195
- var isFunction = (arg) => typeof arg === "function";
2196
- var isBoolean = (arg) => arg === true || arg === false;
2197
- var isNull = (arg) => arg === null;
2198
- var isArray3 = (arg) => Array.isArray(arg);
2199
- var isDate = (d) => d instanceof Date;
2200
- var isObjectLike2 = (arg) => {
2201
- if (arg === null)
2202
- return false;
2203
- return typeof arg === "object";
2204
- };
2205
- var isDefined2 = (arg) => {
2206
- return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
2207
- };
2208
- var isUndefined = (arg) => {
2209
- return arg === void 0;
2210
- };
2211
- var TYPES = {
2212
- boolean: isBoolean,
2213
- array: isArray3,
2214
- object: isObject3,
2215
- string: isString22,
2216
- date: isDate,
2217
- number: isNumber2,
2218
- null: isNull,
2219
- function: isFunction,
2220
- objectLike: isObjectLike2,
2221
- node: import_node.isNode,
2222
- htmlElement: import_node.isHtmlElement,
2223
- defined: isDefined2
2224
- };
2225
- var is = (arg) => {
2226
- return (...args) => {
2227
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
2228
- };
2229
- };
2230
- var isNot = (arg) => {
2231
- return (...args) => {
2232
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
2233
- };
2234
- };
2235
- }
2236
- });
2237
- var require_array2 = __commonJS2({
2238
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports2, module22) {
2239
- "use strict";
2240
- var __defProp22 = Object.defineProperty;
2241
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2242
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2243
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2244
- var __export22 = (target, all) => {
2245
- for (var name in all)
2246
- __defProp22(target, name, { get: all[name], enumerable: true });
2247
- };
2248
- var __copyProps22 = (to, from, except, desc) => {
2249
- if (from && typeof from === "object" || typeof from === "function") {
2250
- for (let key of __getOwnPropNames22(from))
2251
- if (!__hasOwnProp22.call(to, key) && key !== except)
2252
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2253
- }
2254
- return to;
2255
- };
2256
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2257
- var array_exports = {};
2258
- __export22(array_exports, {
2259
- addItemAfterEveryElement: () => addItemAfterEveryElement,
2260
- arrayContainsOtherArray: () => arrayContainsOtherArray,
2261
- arraysEqual: () => arraysEqual,
2262
- checkIfStringIsInArray: () => checkIfStringIsInArray,
2263
- cutArrayAfterValue: () => cutArrayAfterValue,
2264
- cutArrayBeforeValue: () => cutArrayBeforeValue,
2265
- filterArrays: () => filterArrays,
2266
- filterArraysFast: () => filterArraysFast,
2267
- getFrequencyInArray: () => getFrequencyInArray,
2268
- joinArrays: () => joinArrays,
2269
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
2270
- mergeArray: () => mergeArray,
2271
- removeFromArray: () => removeFromArray,
2272
- removeValueFromArray: () => removeValueFromArray,
2273
- removeValueFromArrayAll: () => removeValueFromArrayAll,
2274
- reorderArrayByValues: () => reorderArrayByValues,
2275
- swapItemsInArray: () => swapItemsInArray
2276
- });
2277
- module22.exports = __toCommonJS22(array_exports);
2278
- var import_object = require_object2();
2279
- var import_types = require_types2();
2280
- var arrayContainsOtherArray = (arr1, arr2) => {
2281
- return arr2.every((val) => arr1.includes(val));
2282
- };
2283
- var getFrequencyInArray = (arr, value) => {
2284
- return arr.reduce((count, currentValue) => {
2285
- return currentValue === value ? count + 1 : count;
2286
- }, 0);
2287
- };
2288
- var removeFromArray = (arr, index) => {
2289
- if ((0, import_types.isString)(index))
2290
- index = parseInt(index);
2291
- if ((0, import_types.isNumber)(index)) {
2292
- if (index < 0 || index >= arr.length || isNaN(index)) {
2293
- throw new Error("Invalid index");
2294
- }
2295
- arr.splice(index, 1);
2296
- } else if ((0, import_types.isArray)(index)) {
2297
- index.forEach((idx) => removeFromArray(arr, idx));
2298
- } else {
2299
- throw new Error("Invalid index");
2300
- }
2301
- return arr;
2302
- };
2303
- var swapItemsInArray = (arr, i, j) => {
2304
- [arr[i], arr[j]] = [arr[j], arr[i]];
2305
- };
2306
- var joinArrays = (...arrays) => {
2307
- return [].concat(...arrays);
2308
- };
2309
- var mergeArray = (arr, exclude = []) => {
2310
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, { exclude }), exclude), {});
2311
- };
2312
- var mergeAndCloneIfArray = (obj) => {
2313
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
2314
- };
2315
- var cutArrayBeforeValue = (arr, value) => {
2316
- const index = arr.indexOf(value);
2317
- if (index !== -1) {
2318
- return arr.slice(0, index);
2319
- }
2320
- return arr;
2321
- };
2322
- var cutArrayAfterValue = (arr, value) => {
2323
- if (!(0, import_types.isArray)(arr))
2324
- return;
2325
- const index = arr.indexOf(value);
2326
- if (index !== -1) {
2327
- return arr.slice(index + 1);
2328
- }
2329
- return arr;
2330
- };
2331
- var removeValueFromArray = (arr, value) => {
2332
- const index = arr.indexOf(value);
2333
- if (index > -1) {
2334
- const newArray = [...arr];
2335
- newArray.splice(index, 1);
2336
- return newArray;
2337
- }
2338
- return arr;
2339
- };
2340
- var removeValueFromArrayAll = (arr, value) => {
2341
- return arr.filter((item) => item !== value);
2342
- };
2343
- var addItemAfterEveryElement = (array, item) => {
2344
- const result = [];
2345
- for (let i = 0; i < array.length; i++) {
2346
- result.push(array[i]);
2347
- if (i < array.length - 1) {
2348
- result.push(item);
2349
- }
2350
- }
2351
- return result;
2352
- };
2353
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
2354
- const newArray = [...array];
2355
- const indexToMove = newArray.indexOf(valueToMove);
2356
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
2357
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
2358
- const removedItem = newArray.splice(indexToMove, 1)[0];
2359
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
2360
- newArray.splice(insertIndex, 0, removedItem);
2361
- }
2362
- return newArray;
2363
- };
2364
- var arraysEqual = (arr1, arr2) => {
2365
- if (arr1.length !== arr2.length) {
2366
- return false;
2367
- }
2368
- for (let i = 0; i < arr1.length; i++) {
2369
- if (arr1[i] !== arr2[i]) {
2370
- return false;
2371
- }
2372
- }
2373
- return true;
2374
- };
2375
- var filterArrays = (sourceArr, excludeArr) => {
2376
- return sourceArr.filter((item) => !excludeArr.includes(item));
2377
- };
2378
- var filterArraysFast = (sourceArr, excludeArr) => {
2379
- const excludeSet = new Set(excludeArr);
2380
- return sourceArr.filter((item) => !excludeSet.has(item));
2381
- };
2382
- var checkIfStringIsInArray = (string, arr) => {
2383
- if (!string)
2384
- return;
2385
- return arr.filter((v) => string.includes(v)).length;
2386
- };
2387
- }
2388
- });
2389
- var require_string2 = __commonJS2({
2390
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
2391
- "use strict";
2392
- var __defProp22 = Object.defineProperty;
2393
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2394
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2395
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2396
- var __export22 = (target, all) => {
2397
- for (var name in all)
2398
- __defProp22(target, name, { get: all[name], enumerable: true });
2399
- };
2400
- var __copyProps22 = (to, from, except, desc) => {
2401
- if (from && typeof from === "object" || typeof from === "function") {
2402
- for (let key of __getOwnPropNames22(from))
2403
- if (!__hasOwnProp22.call(to, key) && key !== except)
2404
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2405
- }
2406
- return to;
2407
- };
2408
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2409
- var string_exports = {};
2410
- __export22(string_exports, {
2411
- customDecodeURIComponent: () => customDecodeURIComponent,
2412
- customEncodeURIComponent: () => customEncodeURIComponent,
2413
- decodeNewlines: () => decodeNewlines,
2414
- encodeNewlines: () => encodeNewlines,
2415
- findKeyPosition: () => findKeyPosition,
2416
- lowercaseFirstLetter: () => lowercaseFirstLetter,
2417
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2418
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2419
- stringIncludesAny: () => stringIncludesAny,
2420
- trimStringFromSymbols: () => trimStringFromSymbols
2421
- });
2422
- module22.exports = __toCommonJS22(string_exports);
2423
- var stringIncludesAny = (str, characters) => {
2424
- for (const char of characters) {
2425
- if (str.includes(char)) {
2426
- return true;
2427
- }
2428
- }
2429
- return false;
2430
- };
2431
- var trimStringFromSymbols = (str, characters) => {
2432
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2433
- return str.replace(pattern, "");
2434
- };
2435
- var brackRegex = {
2436
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2437
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2438
- };
2439
- function replaceLiteralsWithObjectFields(str, options = {}, forcedState) {
2440
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2441
- return str;
2442
- const reg = brackRegex[options.bracketsLength || 2];
2443
- const obj = forcedState || this.state || {};
2444
- return str.replace(reg, (_, parentPath, variable) => {
2445
- if (parentPath) {
2446
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2447
- let parentState = obj;
2448
- for (let i = 0; i < parentLevels; i++) {
2449
- parentState = parentState.parent;
2450
- if (!parentState) {
2451
- return "";
2452
- }
2453
- }
2454
- const value = parentState[variable.trim()];
2455
- return value !== void 0 ? `${value}` : "";
2456
- } else {
2457
- const value = obj[variable.trim()];
2458
- return value !== void 0 ? `${value}` : "";
2459
- }
2460
- });
2461
- }
2462
- var lowercaseFirstLetter = (inputString) => {
2463
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2464
- };
2465
- var findKeyPosition = (str, key) => {
2466
- const lines = str.split("\n");
2467
- let startLineNumber = -1;
2468
- let endLineNumber = -1;
2469
- let startColumn = -1;
2470
- let endColumn = -1;
2471
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2472
- let braceCount = 0;
2473
- let foundKey = false;
2474
- for (let i = 0; i < lines.length; i++) {
2475
- if (keyPattern.test(lines[i]) && !foundKey) {
2476
- foundKey = true;
2477
- startLineNumber = i + 1;
2478
- startColumn = lines[i].indexOf(key) + 1;
2479
- if (lines[i].includes("{}")) {
2480
- endLineNumber = startLineNumber;
2481
- endColumn = lines[i].indexOf("{}") + 3;
2482
- break;
2483
- }
2484
- const line = lines[i].slice(startColumn + key.length);
2485
- if (line.includes("{") || line.includes("[")) {
2486
- braceCount = 1;
2487
- } else {
2488
- endLineNumber = i + 1;
2489
- endColumn = lines[i].length + 1;
2490
- break;
2491
- }
2492
- } else if (foundKey) {
2493
- braceCount += (lines[i].match(/{/g) || []).length;
2494
- braceCount += (lines[i].match(/\[/g) || []).length;
2495
- braceCount -= (lines[i].match(/}/g) || []).length;
2496
- braceCount -= (lines[i].match(/]/g) || []).length;
2497
- if (braceCount === 0) {
2498
- endLineNumber = i + 1;
2499
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2500
- break;
2501
- }
2502
- }
2503
- }
2504
- return {
2505
- startColumn,
2506
- endColumn,
2507
- startLineNumber,
2508
- endLineNumber
2509
- };
2510
- };
2511
- var replaceOctalEscapeSequences = (str) => {
2512
- const octalRegex = /\\([0-7]{1,3})/g;
2513
- return str.replace(octalRegex, (match, p1) => {
2514
- const octalValue = parseInt(p1, 8);
2515
- const char = String.fromCharCode(octalValue);
2516
- return char;
2517
- });
2518
- };
2519
- var encodeNewlines = (str) => {
2520
- return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
2521
- };
2522
- var decodeNewlines = (encodedStr) => {
2523
- return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
2524
- };
2525
- var customEncodeURIComponent = (str) => {
2526
- return str.split("").map((char) => {
2527
- if (/[^a-zA-Z0-9\s]/.test(char)) {
2528
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2529
- }
2530
- return char;
2531
- }).join("");
2532
- };
2533
- var customDecodeURIComponent = (encodedStr) => {
2534
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2535
- };
2536
- }
2537
- });
2538
- var require_object2 = __commonJS2({
2539
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
2540
- "use strict";
2541
- var __defProp22 = Object.defineProperty;
2542
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2543
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2544
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2545
- var __export22 = (target, all) => {
2546
- for (var name in all)
2547
- __defProp22(target, name, { get: all[name], enumerable: true });
2548
- };
2549
- var __copyProps22 = (to, from, except, desc) => {
2550
- if (from && typeof from === "object" || typeof from === "function") {
2551
- for (let key of __getOwnPropNames22(from))
2552
- if (!__hasOwnProp22.call(to, key) && key !== except)
2553
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2554
- }
2555
- return to;
2556
- };
2557
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2558
- var object_exports = {};
2559
- __export22(object_exports, {
2560
- clone: () => clone,
2561
- createNestedObject: () => createNestedObject,
2562
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2563
- deepClone: () => deepClone2,
2564
- deepContains: () => deepContains,
2565
- deepDestringify: () => deepDestringify,
2566
- deepDiff: () => deepDiff,
2567
- deepMerge: () => deepMerge2,
2568
- deepStringify: () => deepStringify,
2569
- deepStringifyWithMaxDepth: () => deepStringifyWithMaxDepth,
2570
- detachFunctionsFromObject: () => detachFunctionsFromObject,
2571
- detectInfiniteLoop: () => detectInfiniteLoop,
2572
- diff: () => diff,
2573
- diffArrays: () => diffArrays,
2574
- diffObjects: () => diffObjects,
2575
- excludeKeysFromObject: () => excludeKeysFromObject,
2576
- exec: () => exec,
2577
- flattenRecursive: () => flattenRecursive,
2578
- hasOwnProperty: () => hasOwnProperty,
2579
- isCyclic: () => isCyclic,
2580
- isEmpty: () => isEmpty,
2581
- isEmptyObject: () => isEmptyObject,
2582
- isEqualDeep: () => isEqualDeep,
2583
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2584
- map: () => map,
2585
- merge: () => merge,
2586
- mergeArrayExclude: () => mergeArrayExclude,
2587
- mergeIfExisted: () => mergeIfExisted,
2588
- objectToString: () => objectToString,
2589
- overwrite: () => overwrite,
2590
- overwriteDeep: () => overwriteDeep,
2591
- overwriteShallow: () => overwriteShallow,
2592
- removeFromObject: () => removeFromObject,
2593
- removeNestedKeyByPath: () => removeNestedKeyByPath,
2594
- stringToObject: () => stringToObject
2595
- });
2596
- module22.exports = __toCommonJS22(object_exports);
2597
- var import_globals3 = require_globals2();
2598
- var import_types = require_types2();
2599
- var import_array = require_array2();
2600
- var import_string = require_string2();
2601
- var import_node = require_node2();
2602
- var ENV = "development";
2603
- var exec = (param, element, state, context) => {
2604
- if ((0, import_types.isFunction)(param)) {
2605
- return param.call(
2606
- element,
2607
- element,
2608
- state || element.state,
2609
- context || element.context
2610
- );
2611
- }
2612
- return param;
2613
- };
2614
- var map = (obj, extention, element) => {
2615
- for (const e in extention) {
2616
- obj[e] = exec(extention[e], element);
2617
- }
2618
- };
2619
- var merge = (element, obj, excludeFrom = []) => {
2620
- for (const e in obj) {
2621
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2622
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2623
- continue;
2624
- const elementProp = element[e];
2625
- const objProp = obj[e];
2626
- if (elementProp === void 0) {
2627
- element[e] = objProp;
2628
- }
2629
- }
2630
- return element;
2631
- };
2632
- var deepMerge2 = (element, extend, excludeFrom = []) => {
2633
- for (const e in extend) {
2634
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2635
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2636
- continue;
2637
- const elementProp = element[e];
2638
- const extendProp = extend[e];
2639
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2640
- deepMerge2(elementProp, extendProp, excludeFrom);
2641
- } else if (elementProp === void 0) {
2642
- element[e] = extendProp;
2643
- }
2644
- }
2645
- return element;
2646
- };
2647
- var clone = (obj, excludeFrom = []) => {
2648
- const o = {};
2649
- for (const prop in obj) {
2650
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2651
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2652
- continue;
2653
- o[prop] = obj[prop];
2654
- }
2655
- return o;
2656
- };
2657
- var mergeArrayExclude = (arr, exclude = []) => {
2658
- return arr.reduce((acc, curr) => deepMerge2(acc, deepClone2(curr, { exclude })), {});
2659
- };
2660
- var deepClone2 = (obj, options = {}) => {
2661
- const {
2662
- exclude = [],
2663
- cleanUndefined = false,
2664
- cleanNull = false,
2665
- window: targetWindow,
2666
- visited = /* @__PURE__ */ new WeakMap(),
2667
- handleExtend = false
2668
- } = options;
2669
- if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj)) {
2670
- return obj;
2671
- }
2672
- if (visited.has(obj)) {
2673
- return visited.get(obj);
2674
- }
2675
- const clone2 = targetWindow ? (0, import_types.isArray)(obj) ? new targetWindow.Array() : new targetWindow.Object() : (0, import_types.isArray)(obj) ? [] : {};
2676
- visited.set(obj, clone2);
2677
- for (const key in obj) {
2678
- if (!Object.prototype.hasOwnProperty.call(obj, key))
2679
- continue;
2680
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
2681
- continue;
2682
- const value = obj[key];
2683
- if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
2684
- continue;
2685
- if ((0, import_node.isDOMNode)(value)) {
2686
- clone2[key] = value;
2687
- continue;
2688
- }
2689
- if (handleExtend && key === "extend" && (0, import_types.isArray)(value)) {
2690
- clone2[key] = (0, import_array.mergeArray)(value, exclude);
2691
- continue;
2692
- }
2693
- if ((0, import_types.isFunction)(value) && targetWindow) {
2694
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
2695
- continue;
2696
- }
2697
- if ((0, import_types.isObjectLike)(value)) {
2698
- clone2[key] = deepClone2(value, {
2699
- ...options,
2700
- visited
2701
- });
2702
- } else {
2703
- clone2[key] = value;
2704
- }
2705
- }
2706
- return clone2;
2707
- };
2708
- var deepStringify = (obj, stringified = {}) => {
2709
- var _a, _b;
2710
- if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2711
- (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2712
- obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2713
- }
2714
- for (const prop in obj) {
2715
- const objProp = obj[prop];
2716
- if ((0, import_types.isFunction)(objProp)) {
2717
- stringified[prop] = objProp.toString();
2718
- } else if ((0, import_types.isObject)(objProp)) {
2719
- stringified[prop] = {};
2720
- deepStringify(objProp, stringified[prop]);
2721
- } else if ((0, import_types.isArray)(objProp)) {
2722
- stringified[prop] = [];
2723
- objProp.forEach((v, i) => {
2724
- if ((0, import_types.isObject)(v)) {
2725
- stringified[prop][i] = {};
2726
- deepStringify(v, stringified[prop][i]);
2727
- } else if ((0, import_types.isFunction)(v)) {
2728
- stringified[prop][i] = v.toString();
2729
- } else {
2730
- stringified[prop][i] = v;
2731
- }
2732
- });
2733
- } else {
2734
- stringified[prop] = objProp;
2735
- }
2736
- }
2737
- return stringified;
2738
- };
2739
- var MAX_DEPTH = 100;
2740
- var deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "") => {
2741
- if (depth > MAX_DEPTH) {
2742
- console.warn(`Maximum depth exceeded at path: ${path}. Possible circular reference.`);
2743
- return "[MAX_DEPTH_EXCEEDED]";
2744
- }
2745
- for (const prop in obj) {
2746
- const currentPath = path ? `${path}.${prop}` : prop;
2747
- const objProp = obj[prop];
2748
- if ((0, import_types.isFunction)(objProp)) {
2749
- stringified[prop] = objProp.toString();
2750
- } else if ((0, import_types.isObject)(objProp)) {
2751
- stringified[prop] = {};
2752
- deepStringifyWithMaxDepth(objProp, stringified[prop], depth + 1, currentPath);
2753
- } else if ((0, import_types.isArray)(objProp)) {
2754
- stringified[prop] = [];
2755
- objProp.forEach((v, i) => {
2756
- const itemPath = `${currentPath}[${i}]`;
2757
- if ((0, import_types.isObject)(v)) {
2758
- stringified[prop][i] = {};
2759
- deepStringifyWithMaxDepth(v, stringified[prop][i], depth + 1, itemPath);
2760
- } else if ((0, import_types.isFunction)(v)) {
2761
- stringified[prop][i] = v.toString();
2762
- } else {
2763
- stringified[prop][i] = v;
2764
- }
2765
- });
2766
- } else {
2767
- stringified[prop] = objProp;
2768
- }
2769
- }
2770
- return stringified;
2771
- };
2772
- var objectToString = (obj = {}, indent = 0) => {
2773
- if (obj === null || typeof obj !== "object") {
2774
- return String(obj);
2775
- }
2776
- if (Object.keys(obj).length === 0) {
2777
- return "{}";
2778
- }
2779
- const spaces = " ".repeat(indent);
2780
- let str = "{\n";
2781
- for (const [key, value] of Object.entries(obj)) {
2782
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2783
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2784
- str += `${spaces} ${stringedKey}: `;
2785
- if ((0, import_types.isArray)(value)) {
2786
- str += "[\n";
2787
- for (const element of value) {
2788
- if ((0, import_types.isObjectLike)(element) && element !== null) {
2789
- str += `${spaces} ${objectToString(element, indent + 2)},
2790
- `;
2791
- } else if ((0, import_types.isString)(element)) {
2792
- str += `${spaces} '${element}',
2793
- `;
2794
- } else {
2795
- str += `${spaces} ${element},
2796
- `;
2797
- }
2798
- }
2799
- str += `${spaces} ]`;
2800
- } else if ((0, import_types.isObjectLike)(value)) {
2801
- str += objectToString(value, indent + 1);
2802
- } else if ((0, import_types.isString)(value)) {
2803
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2804
- } else {
2805
- str += value;
2806
- }
2807
- str += ",\n";
2808
- }
2809
- str += `${spaces}}`;
2810
- return str;
2811
- };
2812
- var detachFunctionsFromObject = (obj, detached = {}) => {
2813
- for (const prop in obj) {
2814
- const objProp = obj[prop];
2815
- if ((0, import_types.isFunction)(objProp))
2816
- continue;
2817
- else if ((0, import_types.isObject)(objProp)) {
2818
- detached[prop] = {};
2819
- deepStringify(objProp, detached[prop]);
2820
- } else if ((0, import_types.isArray)(objProp)) {
2821
- detached[prop] = [];
2822
- objProp.forEach((v, i) => {
2823
- if ((0, import_types.isFunction)(v))
2824
- return;
2825
- if ((0, import_types.isObject)(v)) {
2826
- detached[prop][i] = {};
2827
- detachFunctionsFromObject(v, detached[prop][i]);
2828
- } else {
2829
- detached[prop][i] = v;
2830
- }
2831
- });
2832
- } else {
2833
- detached[prop] = objProp;
2834
- }
2835
- }
2836
- return detached;
2837
- };
2838
- var deepDestringify = (obj, destringified = {}) => {
2839
- for (const prop in obj) {
2840
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2841
- if (!hasOwnProperty2)
2842
- continue;
2843
- const objProp = obj[prop];
2844
- if ((0, import_types.isString)(objProp)) {
2845
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2846
- try {
2847
- const evalProp = import_globals3.window.eval(`(${objProp})`);
2848
- destringified[prop] = evalProp;
2849
- } catch (e) {
2850
- if (e)
2851
- destringified[prop] = objProp;
2852
- }
2853
- } else {
2854
- destringified[prop] = objProp;
2855
- }
2856
- } else if ((0, import_types.isArray)(objProp)) {
2857
- destringified[prop] = [];
2858
- objProp.forEach((arrProp) => {
2859
- if ((0, import_types.isString)(arrProp)) {
2860
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
2861
- try {
2862
- const evalProp = import_globals3.window.eval(`(${arrProp})`);
2863
- destringified[prop].push(evalProp);
2864
- } catch (e) {
2865
- if (e)
2866
- destringified[prop].push(arrProp);
2867
- }
2868
- } else {
2869
- destringified[prop].push(arrProp);
2870
- }
2871
- } else if ((0, import_types.isObject)(arrProp)) {
2872
- destringified[prop].push(deepDestringify(arrProp));
2873
- } else {
2874
- destringified[prop].push(arrProp);
2875
- }
2876
- });
2877
- } else if ((0, import_types.isObject)(objProp)) {
2878
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
2879
- } else {
2880
- destringified[prop] = objProp;
2881
- }
2882
- }
2883
- return destringified;
2884
- };
2885
- var stringToObject = (str, opts = { verbose: true }) => {
2886
- try {
2887
- return str ? import_globals3.window.eval("(" + str + ")") : {};
2888
- } catch (e) {
2889
- if (opts.verbose)
2890
- console.warn(e);
2891
- }
2892
- };
2893
- var diffObjects = (original, objToDiff, cache) => {
2894
- for (const e in objToDiff) {
2895
- if (e === "ref")
2896
- continue;
2897
- const originalProp = original[e];
2898
- const objToDiffProp = objToDiff[e];
2899
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2900
- cache[e] = {};
2901
- diff(originalProp, objToDiffProp, cache[e]);
2902
- } else if (objToDiffProp !== void 0) {
2903
- cache[e] = objToDiffProp;
2904
- }
2905
- }
2906
- return cache;
2907
- };
2908
- var diffArrays = (original, objToDiff, cache) => {
2909
- if (original.length !== objToDiff.length) {
2910
- cache = objToDiff;
2911
- } else {
2912
- const diffArr = [];
2913
- for (let i = 0; i < original.length; i++) {
2914
- const diffObj = diff(original[i], objToDiff[i]);
2915
- if (Object.keys(diffObj).length > 0) {
2916
- diffArr.push(diffObj);
2917
- }
2918
- }
2919
- if (diffArr.length > 0) {
2920
- cache = diffArr;
2921
- }
2922
- }
2923
- return cache;
2924
- };
2925
- var diff = (original, objToDiff, cache = {}) => {
2926
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2927
- cache = [];
2928
- diffArrays(original, objToDiff, cache);
2929
- } else {
2930
- diffObjects(original, objToDiff, cache);
2931
- }
2932
- return cache;
2933
- };
2934
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2935
- var isEmpty = (o) => Object.keys(o).length === 0;
2936
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2937
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2938
- var deepDiff = (lhs, rhs) => {
2939
- if (lhs === rhs)
2940
- return {};
2941
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2942
- return rhs;
2943
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2944
- if (!hasOwnProperty(rhs, key)) {
2945
- acc[key] = void 0;
2946
- }
2947
- return acc;
2948
- }, makeObjectWithoutPrototype());
2949
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2950
- if (lhs.valueOf() === rhs.valueOf())
2951
- return {};
2952
- return rhs;
2953
- }
2954
- return Object.keys(rhs).reduce((acc, key) => {
2955
- if (!hasOwnProperty(lhs, key)) {
2956
- acc[key] = rhs[key];
2957
- return acc;
2958
- }
2959
- const difference = diff(lhs[key], rhs[key]);
2960
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2961
- return acc;
2962
- }
2963
- acc[key] = difference;
2964
- return acc;
2965
- }, deletedValues);
2966
- };
2967
- var overwrite = (element, params, opts = {}) => {
2968
- const { __ref: ref } = element;
2969
- const excl = opts.exclude || [];
2970
- const allowUnderscore = opts.preventUnderscore;
2971
- const preventCaching = opts.preventCaching;
2972
- for (const e in params) {
2973
- if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
2974
- continue;
2975
- const elementProp = element[e];
2976
- const paramsProp = params[e];
2977
- if (paramsProp !== void 0) {
2978
- element[e] = paramsProp;
2979
- if (ref && !preventCaching) {
2980
- ref.__cache[e] = elementProp;
2981
- }
2982
- if ((0, import_types.isObject)(opts.diff)) {
2983
- diff[e] = elementProp;
2984
- }
2985
- }
2986
- }
2987
- return element;
2988
- };
2989
- var overwriteShallow = (obj, params, excludeFrom = []) => {
2990
- for (const e in params) {
2991
- if (excludeFrom.includes(e) || e.startsWith("__"))
2992
- continue;
2993
- obj[e] = params[e];
2994
- }
2995
- return obj;
2996
- };
2997
- var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
2998
- const excl = opts.exclude || [];
2999
- const forcedExclude = opts.preventForce ? [] : ["node", "window"];
3000
- if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
3001
- return params;
3002
- }
3003
- if (visited.has(obj))
3004
- return visited.get(obj);
3005
- visited.set(obj, obj);
3006
- for (const e in params) {
3007
- if (!Object.hasOwnProperty.call(params, e))
3008
- continue;
3009
- if (excl.includes(e) || forcedExclude && e.startsWith("__"))
3010
- continue;
3011
- const objProp = obj[e];
3012
- const paramsProp = params[e];
3013
- if ((0, import_node.isDOMNode)(paramsProp)) {
3014
- obj[e] = paramsProp;
3015
- } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
3016
- obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
3017
- } else if (paramsProp !== void 0) {
3018
- obj[e] = paramsProp;
3019
- }
3020
- }
3021
- return obj;
3022
- };
3023
- var mergeIfExisted = (a, b) => {
3024
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
3025
- return deepMerge2(a, b);
3026
- return a || b;
3027
- };
3028
- var flattenRecursive = (param, prop, stack = []) => {
3029
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
3030
- stack.push(objectized);
3031
- const extendOfExtend = objectized[prop];
3032
- if (extendOfExtend)
3033
- flattenRecursive(extendOfExtend, prop, stack);
3034
- delete objectized[prop];
3035
- return stack;
3036
- };
3037
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
3038
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
3039
- return param === element;
3040
- }
3041
- if (visited.has(param) || visited.has(element)) {
3042
- return true;
3043
- }
3044
- visited.add(param);
3045
- visited.add(element);
3046
- const keysParam = Object.keys(param);
3047
- const keysElement = Object.keys(element);
3048
- if (keysParam.length !== keysElement.length) {
3049
- return false;
3050
- }
3051
- for (const key of keysParam) {
3052
- if (!keysElement.includes(key)) {
3053
- return false;
3054
- }
3055
- const paramProp = param[key];
3056
- const elementProp = element[key];
3057
- if (!isEqualDeep(paramProp, elementProp, visited)) {
3058
- return false;
3059
- }
3060
- }
3061
- return true;
3062
- };
3063
- var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
3064
- if (obj1 === obj2)
3065
- return true;
3066
- if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
3067
- return false;
3068
- if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
3069
- return obj1 === obj2;
3070
- const stack = [[obj1, obj2]];
3071
- const visited = /* @__PURE__ */ new WeakSet();
3072
- while (stack.length > 0) {
3073
- const [current1, current2] = stack.pop();
3074
- if (visited.has(current1))
3075
- continue;
3076
- visited.add(current1);
3077
- const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
3078
- const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
3079
- if (keys1.length !== keys2.length)
3080
- return false;
3081
- for (const key of keys1) {
3082
- if (!Object.prototype.hasOwnProperty.call(current2, key))
3083
- return false;
3084
- const value1 = current1[key];
3085
- const value2 = current2[key];
3086
- if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
3087
- if (value1 !== value2)
3088
- return false;
3089
- } else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
3090
- if (value1 !== value2) {
3091
- stack.push([value1, value2]);
3092
- }
3093
- } else if (value1 !== value2) {
3094
- return false;
3095
- }
3096
- }
3097
- }
3098
- return true;
3099
- };
3100
- var removeFromObject = (obj, props) => {
3101
- if (props === void 0 || props === null)
3102
- return obj;
3103
- if ((0, import_types.is)(props)("string", "number")) {
3104
- delete obj[props];
3105
- } else if ((0, import_types.isArray)(props)) {
3106
- props.forEach((prop) => delete obj[prop]);
3107
- } else {
3108
- throw new Error("Invalid input: props must be a string or an array of strings");
3109
- }
3110
- return obj;
3111
- };
3112
- var createObjectWithoutPrototype = (obj) => {
3113
- if (obj === null || typeof obj !== "object") {
3114
- return obj;
3115
- }
3116
- const newObj = /* @__PURE__ */ Object.create(null);
3117
- for (const key in obj) {
3118
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
3119
- newObj[key] = createObjectWithoutPrototype(obj[key]);
3120
- }
3121
- }
3122
- return newObj;
3123
- };
3124
- var createNestedObject = (arr, lastValue) => {
3125
- const nestedObject = {};
3126
- if (arr.length === 0) {
3127
- return lastValue;
3128
- }
3129
- arr.reduce((obj, value, index) => {
3130
- if (!obj[value]) {
3131
- obj[value] = {};
3132
- }
3133
- if (index === arr.length - 1 && lastValue) {
3134
- obj[value] = lastValue;
3135
- }
3136
- return obj[value];
3137
- }, nestedObject);
3138
- return nestedObject;
3139
- };
3140
- var removeNestedKeyByPath = (obj, path) => {
3141
- if (!Array.isArray(path)) {
3142
- throw new Error("Path must be an array.");
3143
- }
3144
- let current = obj;
3145
- for (let i = 0; i < path.length - 1; i++) {
3146
- if (current[path[i]] === void 0) {
3147
- return;
3148
- }
3149
- current = current[path[i]];
3150
- }
3151
- const lastKey = path[path.length - 1];
3152
- if (current && Object.hasOwnProperty.call(current, lastKey)) {
3153
- delete current[lastKey];
3154
- }
3155
- };
3156
- var detectInfiniteLoop = (arr) => {
3157
- const maxRepeats = 10;
3158
- let pattern = [];
3159
- let repeatCount = 0;
3160
- for (let i = 0; i < arr.length; i++) {
3161
- if (pattern.length < 2) {
3162
- pattern.push(arr[i]);
3163
- } else {
3164
- if (arr[i] === pattern[i % 2]) {
3165
- repeatCount++;
3166
- } else {
3167
- pattern = [arr[i - 1], arr[i]];
3168
- repeatCount = 1;
3169
- }
3170
- if (repeatCount >= maxRepeats * 2) {
3171
- if (ENV === "test" || ENV === "development") {
3172
- console.warn("Warning: Potential infinite loop detected due to repeated sequence:", pattern);
3173
- }
3174
- return true;
3175
- }
3176
- }
3177
- }
3178
- };
3179
- var isCyclic = (obj) => {
3180
- const seenObjects = [];
3181
- function detect(obj2) {
3182
- if (obj2 && typeof obj2 === "object") {
3183
- if (seenObjects.indexOf(obj2) !== -1) {
3184
- return true;
3185
- }
3186
- seenObjects.push(obj2);
3187
- for (const key in obj2) {
3188
- if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
3189
- console.log(obj2, "cycle at " + key);
3190
- return true;
3191
- }
3192
- }
3193
- }
3194
- return false;
3195
- }
3196
- return detect(obj);
3197
- };
3198
- var excludeKeysFromObject = (obj, excludedKeys) => {
3199
- const result = { ...obj };
3200
- excludedKeys.forEach((key) => delete result[key]);
3201
- return result;
3202
- };
3203
- }
3204
- });
3205
- var require_function2 = __commonJS2({
3206
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
3207
- "use strict";
3208
- var __defProp22 = Object.defineProperty;
3209
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3210
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3211
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3212
- var __export22 = (target, all) => {
3213
- for (var name in all)
3214
- __defProp22(target, name, { get: all[name], enumerable: true });
3215
- };
3216
- var __copyProps22 = (to, from, except, desc) => {
3217
- if (from && typeof from === "object" || typeof from === "function") {
3218
- for (let key of __getOwnPropNames22(from))
3219
- if (!__hasOwnProp22.call(to, key) && key !== except)
3220
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3221
- }
3222
- return to;
3223
- };
3224
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3225
- var function_exports = {};
3226
- __export22(function_exports, {
3227
- cloneFunction: () => cloneFunction,
3228
- debounce: () => debounce,
3229
- debounceOnContext: () => debounceOnContext,
3230
- isStringFunction: () => isStringFunction,
3231
- memoize: () => memoize
3232
- });
3233
- module22.exports = __toCommonJS22(function_exports);
3234
- function debounce(func, wait, immediate) {
3235
- let timeout;
3236
- return function() {
3237
- const context = this;
3238
- const args = arguments;
3239
- const later = function() {
3240
- timeout = null;
3241
- if (!immediate)
3242
- func.apply(context, args);
3243
- };
3244
- const callNow = immediate && !timeout;
3245
- clearTimeout(timeout);
3246
- timeout = setTimeout(later, wait);
3247
- if (callNow)
3248
- func.apply(context, args);
3249
- };
3250
- }
3251
- var debounceOnContext = (element, func, timeout = 300) => {
3252
- let timer;
3253
- return (...args) => {
3254
- clearTimeout(timer);
3255
- timer = setTimeout(() => {
3256
- func.apply(element, args);
3257
- }, timeout);
3258
- };
3259
- };
3260
- var memoize = (fn) => {
3261
- const cache = {};
3262
- return (...args) => {
3263
- const n = args[0];
3264
- if (n in cache) {
3265
- return cache[n];
3266
- } else {
3267
- const result = fn(n);
3268
- cache[n] = result;
3269
- return result;
3270
- }
3271
- };
3272
- };
3273
- var isStringFunction = (inputString) => {
3274
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
3275
- return functionRegex.test(inputString);
3276
- };
3277
- function cloneFunction(fn, win = window) {
3278
- const temp = function() {
3279
- return fn.apply(win, arguments);
3280
- };
3281
- for (const key in fn) {
3282
- if (Object.hasOwnProperty.call(fn, key)) {
3283
- temp[key] = fn[key];
3284
- }
3285
- }
3286
- return temp;
3287
- }
3288
- }
3289
- });
3290
- var require_log2 = __commonJS2({
3291
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
3292
- "use strict";
3293
- var __defProp22 = Object.defineProperty;
3294
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3295
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3296
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3297
- var __export22 = (target, all) => {
3298
- for (var name in all)
3299
- __defProp22(target, name, { get: all[name], enumerable: true });
3300
- };
3301
- var __copyProps22 = (to, from, except, desc) => {
3302
- if (from && typeof from === "object" || typeof from === "function") {
3303
- for (let key of __getOwnPropNames22(from))
3304
- if (!__hasOwnProp22.call(to, key) && key !== except)
3305
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3306
- }
3307
- return to;
3308
- };
3309
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3310
- var log_exports = {};
3311
- __export22(log_exports, {
3312
- logGroupIf: () => logGroupIf,
3313
- logIf: () => logIf
3314
- });
3315
- module22.exports = __toCommonJS22(log_exports);
3316
- var logIf = (bool, ...arg) => {
3317
- if (bool)
3318
- arg.map((v) => console.log(v));
3319
- };
3320
- var logGroupIf = (bool, key, ...arg) => {
3321
- if (bool) {
3322
- console.group(key);
3323
- arg.map((v) => console.log(v));
3324
- console.groupEnd(key);
3325
- }
3326
- };
3327
- }
3328
- });
3329
- var require_cookie2 = __commonJS2({
3330
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
3331
- "use strict";
3332
- var __defProp22 = Object.defineProperty;
3333
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3334
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3335
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3336
- var __export22 = (target, all) => {
3337
- for (var name in all)
3338
- __defProp22(target, name, { get: all[name], enumerable: true });
3339
- };
3340
- var __copyProps22 = (to, from, except, desc) => {
3341
- if (from && typeof from === "object" || typeof from === "function") {
3342
- for (let key of __getOwnPropNames22(from))
3343
- if (!__hasOwnProp22.call(to, key) && key !== except)
3344
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3345
- }
3346
- return to;
3347
- };
3348
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3349
- var cookie_exports = {};
3350
- __export22(cookie_exports, {
3351
- getCookie: () => getCookie,
3352
- getLocalStorage: () => getLocalStorage,
3353
- isMobile: () => isMobile,
3354
- removeCookie: () => removeCookie,
3355
- setCookie: () => setCookie,
3356
- setLocalStorage: () => setLocalStorage
3357
- });
3358
- module22.exports = __toCommonJS22(cookie_exports);
3359
- var import_types = require_types2();
3360
- var import_utils32 = require_cjs4();
3361
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
3362
- var setCookie = (cname, cvalue, exdays = 365) => {
3363
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3364
- return;
3365
- const d = /* @__PURE__ */ new Date();
3366
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
3367
- const expires = `expires=${d.toUTCString()}`;
3368
- import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
3369
- };
3370
- var getCookie = (cname) => {
3371
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3372
- return;
3373
- const name = `${cname}=`;
3374
- const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
3375
- const ca = decodedCookie.split(";");
3376
- for (let i = 0; i < ca.length; i++) {
3377
- let c = ca[i];
3378
- while (c.charAt(0) === " ")
3379
- c = c.substring(1);
3380
- if (c.indexOf(name) === 0)
3381
- return c.substring(name.length, c.length);
3382
- }
3383
- return "";
3384
- };
3385
- var removeCookie = (cname) => {
3386
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3387
- return;
3388
- import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3389
- };
3390
- function getLocalStorage(key) {
3391
- let savedJSON;
3392
- if (window.localStorage) {
3393
- try {
3394
- savedJSON = JSON.parse(window.localStorage.getItem(key));
3395
- } catch (e) {
3396
- }
3397
- }
3398
- if (typeof savedJSON !== "undefined") {
3399
- return savedJSON;
3400
- }
3401
- }
3402
- function setLocalStorage(key, data) {
3403
- if (data && window.localStorage) {
3404
- if (typeof data === "object") {
3405
- window.localStorage.setItem(key, JSON.stringify(data));
3406
- } else {
3407
- window.localStorage.setItem(key, data);
3408
- }
3409
- }
3410
- }
3411
- }
3412
- });
3413
- var require_tags2 = __commonJS2({
3414
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
3415
- "use strict";
3416
- var __defProp22 = Object.defineProperty;
3417
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3418
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3419
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3420
- var __export22 = (target, all) => {
3421
- for (var name in all)
3422
- __defProp22(target, name, { get: all[name], enumerable: true });
3423
- };
3424
- var __copyProps22 = (to, from, except, desc) => {
3425
- if (from && typeof from === "object" || typeof from === "function") {
3426
- for (let key of __getOwnPropNames22(from))
3427
- if (!__hasOwnProp22.call(to, key) && key !== except)
3428
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3429
- }
3430
- return to;
3431
- };
3432
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3433
- var tags_exports = {};
3434
- __export22(tags_exports, {
3435
- HTML_TAGS: () => HTML_TAGS,
3436
- isValidHtmlTag: () => isValidHtmlTag
3437
- });
3438
- module22.exports = __toCommonJS22(tags_exports);
3439
- var HTML_TAGS = {
3440
- root: [
3441
- "body",
3442
- "html"
3443
- ],
3444
- head: [
3445
- "title",
3446
- "base",
3447
- "meta",
3448
- "style",
3449
- "noscript",
3450
- "script"
3451
- ],
3452
- body: [
3453
- "string",
3454
- "style",
3455
- "fragment",
3456
- "a",
3457
- "abbr",
3458
- "acronym",
3459
- "address",
3460
- "applet",
3461
- "area",
3462
- "article",
3463
- "aside",
3464
- "audio",
3465
- "b",
3466
- "basefont",
3467
- "bdi",
3468
- "bdo",
3469
- "big",
3470
- "blockquote",
3471
- "br",
3472
- "button",
3473
- "canvas",
3474
- "caption",
3475
- "center",
3476
- "cite",
3477
- "code",
3478
- "search",
3479
- "col",
3480
- "colgroup",
3481
- "data",
3482
- "datalist",
3483
- "dd",
3484
- "del",
3485
- "details",
3486
- "dfn",
3487
- "dialog",
3488
- "dir",
3489
- "div",
3490
- "dl",
3491
- "dt",
3492
- "em",
3493
- "embed",
3494
- "fieldset",
3495
- "figcaption",
3496
- "figure",
3497
- "font",
3498
- "footer",
3499
- "form",
3500
- "frame",
3501
- "frameset",
3502
- "h1",
3503
- "h2",
3504
- "h3",
3505
- "h4",
3506
- "h5",
3507
- "h6",
3508
- "head",
3509
- "header",
3510
- "hr",
3511
- "i",
3512
- "iframe",
3513
- "img",
3514
- "input",
3515
- "ins",
3516
- "kbd",
3517
- "label",
3518
- "legend",
3519
- "li",
3520
- "link",
3521
- "main",
3522
- "map",
3523
- "mark",
3524
- "meter",
3525
- "nav",
3526
- "noframes",
3527
- "noscript",
3528
- "object",
3529
- "ol",
3530
- "optgroup",
3531
- "option",
3532
- "output",
3533
- "p",
3534
- "param",
3535
- "picture",
3536
- "pre",
3537
- "progress",
3538
- "hgroup",
3539
- "q",
3540
- "rp",
3541
- "rt",
3542
- "ruby",
3543
- "s",
3544
- "samp",
3545
- "script",
3546
- "section",
3547
- "select",
3548
- "small",
3549
- "source",
3550
- "span",
3551
- "strike",
3552
- "strong",
3553
- "sub",
3554
- "summary",
3555
- "sup",
3556
- "table",
3557
- "tbody",
3558
- "td",
3559
- "template",
3560
- "hgroup",
3561
- "textarea",
3562
- "tfoot",
3563
- "th",
3564
- "thead",
3565
- "time",
3566
- "tr",
3567
- "track",
3568
- "tt",
3569
- "u",
3570
- "ul",
3571
- "var",
3572
- "video",
3573
- "wbr",
3574
- // SVG
3575
- "svg",
3576
- "path"
3577
- ]
3578
- };
3579
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
3580
- }
3581
- });
3582
- var require_component2 = __commonJS2({
3583
- "../../node_modules/@domql/utils/dist/cjs/component.js"(exports2, module22) {
3584
- "use strict";
3585
- var __defProp22 = Object.defineProperty;
3586
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3587
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3588
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3589
- var __export22 = (target, all) => {
3590
- for (var name in all)
3591
- __defProp22(target, name, { get: all[name], enumerable: true });
3592
- };
3593
- var __copyProps22 = (to, from, except, desc) => {
3594
- if (from && typeof from === "object" || typeof from === "function") {
3595
- for (let key of __getOwnPropNames22(from))
3596
- if (!__hasOwnProp22.call(to, key) && key !== except)
3597
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3598
- }
3599
- return to;
3600
- };
3601
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3602
- var component_exports = {};
3603
- __export22(component_exports, {
3604
- addAdditionalExtend: () => addAdditionalExtend,
3605
- addChildrenIfNotInOriginal: () => addChildrenIfNotInOriginal,
3606
- applyComponentFromContext: () => applyComponentFromContext,
3607
- applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3608
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3609
- checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3610
- checkIfSugar: () => checkIfSugar,
3611
- extendizeByKey: () => extendizeByKey,
3612
- extractComponentKeyFromKey: () => extractComponentKeyFromKey,
3613
- getCapitalCaseKeys: () => getCapitalCaseKeys,
3614
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3615
- getExtendsInElement: () => getExtendsInElement,
3616
- hasVariantProp: () => hasVariantProp,
3617
- isVariant: () => isVariant,
3618
- setContentKey: () => setContentKey
3619
- });
3620
- module22.exports = __toCommonJS22(component_exports);
3621
- var import__ = require_cjs4();
3622
- var ENV = "development";
3623
- var checkIfKeyIsComponent = (key) => {
3624
- const isFirstKeyString = (0, import__.isString)(key);
3625
- if (!isFirstKeyString)
3626
- return;
3627
- const firstCharKey = key.slice(0, 1);
3628
- return /^[A-Z]*$/.test(firstCharKey);
3629
- };
3630
- var checkIfKeyIsProperty = (key) => {
3631
- const isFirstKeyString = (0, import__.isString)(key);
3632
- if (!isFirstKeyString)
3633
- return;
3634
- const firstCharKey = key.slice(0, 1);
3635
- return /^[a-z]*$/.test(firstCharKey);
3636
- };
3637
- var addAdditionalExtend = (newExtend, element) => {
3638
- if (!newExtend)
3639
- return element;
3640
- const { extend: elementExtend } = element;
3641
- const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
3642
- const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
3643
- const extend = (0, import__.joinArrays)(receivedArray, originalArray);
3644
- return { ...element, extend };
3645
- };
3646
- var checkIfSugar = (element, parent, key) => {
3647
- var _a;
3648
- const {
3649
- extend,
3650
- props,
3651
- childExtend,
3652
- extends: extendProps,
3653
- childExtends,
3654
- childProps,
3655
- children,
3656
- on,
3657
- $collection,
3658
- $stateCollection,
3659
- $propsCollection
3660
- } = element;
3661
- const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3662
- if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3663
- const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3664
- if (logErr)
3665
- logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3666
- }
3667
- return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3668
- };
3669
- var extractComponentKeyFromKey = (key) => {
3670
- return key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3671
- };
3672
- var extendizeByKey = (element, parent, key) => {
3673
- const { context } = parent;
3674
- const { tag, extend, childExtends } = element;
3675
- const isSugar = checkIfSugar(element, parent, key);
3676
- const extendFromKey = extractComponentKeyFromKey(key);
3677
- const isExtendKeyComponent = context && context.components[extendFromKey];
3678
- if (element === isExtendKeyComponent)
3679
- return element;
3680
- else if (isSugar) {
3681
- const newElem = addAdditionalExtend(element.extends, {
3682
- extend: extendFromKey,
3683
- tag,
3684
- props: { ...element }
3685
- });
3686
- if (newElem.props.data) {
3687
- newElem.data = newElem.props.data;
3688
- delete newElem.props.data;
3689
- }
3690
- if (newElem.props.state) {
3691
- newElem.state = newElem.props.state;
3692
- delete newElem.props.state;
3693
- }
3694
- if (newElem.props.attr) {
3695
- newElem.attr = newElem.props.attr;
3696
- delete newElem.props.attr;
3697
- }
3698
- if (newElem.props.if) {
3699
- newElem.if = newElem.props.if;
3700
- delete newElem.props.if;
3701
- }
3702
- if (childExtends)
3703
- newElem.childExtend = childExtends;
3704
- return newElem;
3705
- } else if (!extend || extend === true) {
3706
- return {
3707
- ...element,
3708
- tag,
3709
- extend: extendFromKey
3710
- };
3711
- } else if (extend) {
3712
- return addAdditionalExtend(extendFromKey, element);
3713
- } else if ((0, import__.isFunction)(element)) {
3714
- return {
3715
- extend: extendFromKey,
3716
- tag,
3717
- props: { ...(0, import__.exec)(element, parent) }
3718
- };
3719
- }
3720
- };
3721
- function getCapitalCaseKeys(obj) {
3722
- return Object.keys(obj).filter((key) => /^[A-Z]/.test(key));
3723
- }
3724
- var addChildrenIfNotInOriginal = (element, parent, key) => {
3725
- const childElems = getCapitalCaseKeys(element.props);
3726
- if (!childElems.length)
3727
- return element;
3728
- for (const i in childElems) {
3729
- const childKey = childElems[i];
3730
- const childElem = element[childKey];
3731
- const newChild = element.props[childKey];
3732
- const assignChild = (val) => {
3733
- element[childKey] = val;
3734
- delete element.props[childKey];
3735
- };
3736
- if (newChild == null ? void 0 : newChild.ignoreExtend)
3737
- continue;
3738
- if (newChild === null)
3739
- assignChild(null);
3740
- else if (!childElem)
3741
- assignChild((0, import__.deepClone)(newChild));
3742
- else {
3743
- const isSugarChildElem = checkIfSugar(childElem, parent, key);
3744
- if (isSugarChildElem)
3745
- continue;
3746
- assignChild({
3747
- extend: element[childKey],
3748
- props: newChild
3749
- });
3750
- }
3751
- }
3752
- };
3753
- var applyKeyComponentAsExtend = (element, parent, key) => {
3754
- return extendizeByKey(element, parent, key) || element;
3755
- };
3756
- var applyComponentFromContext = (element, parent, options) => {
3757
- const { context } = element;
3758
- if (!context || !context.components)
3759
- return;
3760
- const { components } = context;
3761
- const { extend } = element;
3762
- const execExtend = (0, import__.exec)(extend, element);
3763
- if ((0, import__.isString)(execExtend)) {
3764
- const componentExists = components[execExtend] || components["smbls." + execExtend];
3765
- if (componentExists)
3766
- element.extend = componentExists;
3767
- else {
3768
- if ((ENV === "test" || ENV === "development") && options.verbose) {
3769
- console.warn(execExtend, "is not in library", components, element);
3770
- console.warn("replacing with ", {});
3771
- }
3772
- element.extend = {};
3773
- }
3774
- }
3775
- };
3776
- var isVariant = (param) => {
3777
- if (!(0, import__.isString)(param))
3778
- return;
3779
- const firstCharKey = param.slice(0, 1);
3780
- return firstCharKey === ".";
3781
- };
3782
- var hasVariantProp = (element) => {
3783
- const { props } = element;
3784
- if ((0, import__.isObject)(props) && (0, import__.isString)(props.variant))
3785
- return true;
3786
- };
3787
- var getChildrenComponentsByKey = (key, el) => {
3788
- if (key === el.key || el.__ref.__componentKey === key) {
3789
- return el;
3790
- }
3791
- if (el.extend) {
3792
- const foundString = (0, import__.isString)(el.extend) && el.extend === key;
3793
- const foundInArray = (0, import__.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
3794
- if (foundString || foundInArray)
3795
- return el;
3796
- }
3797
- if (el.parent && el.parent.childExtend) {
3798
- const foundString = (0, import__.isString)(el.parent.childExtend) && el.parent.childExtend === key;
3799
- const foundInArray = (0, import__.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
3800
- if (foundString || foundInArray)
3801
- return el;
3802
- }
3803
- };
3804
- var getExtendsInElement = (obj) => {
3805
- let result = [];
3806
- function traverse(o) {
3807
- for (const key in o) {
3808
- if (Object.hasOwnProperty.call(o, key)) {
3809
- if (checkIfKeyIsComponent(key)) {
3810
- result.push(key);
3811
- }
3812
- if (key === "extend" || key === "extends") {
3813
- if (typeof o[key] === "string") {
3814
- result.push(o[key]);
3815
- } else if (Array.isArray(o[key])) {
3816
- result = result.concat(o[key]);
3817
- }
3818
- }
3819
- if (typeof o[key] === "object" && o[key] !== null) {
3820
- traverse(o[key]);
3821
- }
3822
- }
3823
- }
3824
- }
3825
- traverse(obj);
3826
- return result;
3827
- };
3828
- var setContentKey = (el, opts = {}) => {
3829
- const { __ref: ref } = el;
3830
- const contentElementKey = opts.contentElementKey;
3831
- if (contentElementKey !== "content" && contentElementKey !== ref.contentElementKey || !ref.contentElementKey) {
3832
- ref.contentElementKey = contentElementKey || "content";
3833
- } else
3834
- ref.contentElementKey = "content";
3835
- if (contentElementKey !== "content")
3836
- opts.contentElementKey = "content";
3837
- return ref.contentElementKey;
3838
- };
3839
- }
3840
- });
3841
- var require_cjs4 = __commonJS2({
3842
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
3843
- "use strict";
3844
- var __defProp22 = Object.defineProperty;
3845
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3846
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3847
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3848
- var __copyProps22 = (to, from, except, desc) => {
3849
- if (from && typeof from === "object" || typeof from === "function") {
3850
- for (let key of __getOwnPropNames22(from))
3851
- if (!__hasOwnProp22.call(to, key) && key !== except)
3852
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3853
- }
3854
- return to;
3855
- };
3856
- var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3857
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3858
- var utils_exports = {};
3859
- module22.exports = __toCommonJS22(utils_exports);
3860
- __reExport(utils_exports, require_key2(), module22.exports);
3861
- __reExport(utils_exports, require_env2(), module22.exports);
3862
- __reExport(utils_exports, require_types2(), module22.exports);
3863
- __reExport(utils_exports, require_object2(), module22.exports);
3864
- __reExport(utils_exports, require_function2(), module22.exports);
3865
- __reExport(utils_exports, require_array2(), module22.exports);
3866
- __reExport(utils_exports, require_node2(), module22.exports);
3867
- __reExport(utils_exports, require_log2(), module22.exports);
3868
- __reExport(utils_exports, require_string2(), module22.exports);
3869
- __reExport(utils_exports, require_globals2(), module22.exports);
3870
- __reExport(utils_exports, require_cookie2(), module22.exports);
3871
- __reExport(utils_exports, require_tags2(), module22.exports);
3872
- __reExport(utils_exports, require_component2(), module22.exports);
3873
- }
3874
- });
89
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
3875
90
  var src_exports = {};
3876
91
  __export2(src_exports, {
3877
92
  arrayzeValue: () => arrayzeValue,
@@ -3887,7 +102,6 @@ var require_cjs3 = __commonJS({
3887
102
  loadJavascriptFile: () => loadJavascriptFile,
3888
103
  loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
3889
104
  loadJavascriptFileSync: () => loadJavascriptFileSync,
3890
- registerFrameListener: () => registerFrameListener,
3891
105
  removeChars: () => removeChars,
3892
106
  toCamelCase: () => toCamelCase,
3893
107
  toDashCase: () => toDashCase2,
@@ -3896,7 +110,17 @@ var require_cjs3 = __commonJS({
3896
110
  toggleFullscreen: () => toggleFullscreen
3897
111
  });
3898
112
  module2.exports = __toCommonJS2(src_exports);
3899
- var import_utils22 = __toESM2(require_cjs4(), 1);
113
+ var window22 = globalThis;
114
+ var document22 = window22.document;
115
+ var isObject2 = (arg) => {
116
+ if (arg === null)
117
+ return false;
118
+ return typeof arg === "object" && arg.constructor === Object;
119
+ };
120
+ var isString2 = (arg) => typeof arg === "string";
121
+ var isNumber2 = (arg) => typeof arg === "number";
122
+ var isArray2 = (arg) => Array.isArray(arg);
123
+ var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
3900
124
  async function toggleFullscreen(opts) {
3901
125
  if (!document.fullscreenElement) {
3902
126
  try {
@@ -3908,15 +132,14 @@ var require_cjs3 = __commonJS({
3908
132
  await document.exitFullscreen();
3909
133
  }
3910
134
  }
3911
- var import_utils8 = __toESM2(require_cjs4(), 1);
3912
135
  var findClosestNumber = (number, arr) => {
3913
- return ((0, import_utils8.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
136
+ return (isArray2(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3914
137
  return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3915
138
  });
3916
139
  };
3917
140
  var findClosestNumberInFactory = (val, factory) => {
3918
141
  val = parseFloat(val);
3919
- if ((0, import_utils8.isObject)(factory))
142
+ if (isObject2(factory))
3920
143
  factory = Object.values(factory);
3921
144
  return findClosestNumber(val, factory);
3922
145
  };
@@ -4025,13 +248,6 @@ var require_cjs3 = __commonJS({
4025
248
  }
4026
249
  };
4027
250
  var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
4028
- var registerFrameListener = (el) => {
4029
- const { __ref: ref } = el;
4030
- const { frameListeners } = ref.root.data;
4031
- if (frameListeners && !frameListeners.has(el)) {
4032
- frameListeners.add(el);
4033
- }
4034
- };
4035
251
  var copyStringToClipboard = async (str) => {
4036
252
  try {
4037
253
  await navigator.clipboard.writeText(str);
@@ -4071,13 +287,13 @@ var require_cjs3 = __commonJS({
4071
287
  return result.charAt(0).toUpperCase() + result.slice(1);
4072
288
  };
4073
289
  var arrayzeValue = (val) => {
4074
- if ((0, import_utils22.isArray)(val))
290
+ if (isArray2(val))
4075
291
  return val;
4076
- if ((0, import_utils22.isString)(val))
292
+ if (isString2(val))
4077
293
  return val.split(" ");
4078
- if ((0, import_utils22.isObject)(val))
294
+ if (isObject2(val))
4079
295
  return Object.values(val);
4080
- if ((0, import_utils22.isNumber)(val))
296
+ if (isNumber2(val))
4081
297
  return [val];
4082
298
  };
4083
299
  }
@@ -4092,18 +308,127 @@ __export(svg_exports, {
4092
308
  setSvgIcon: () => setSvgIcon
4093
309
  });
4094
310
  module.exports = __toCommonJS(svg_exports);
4095
- var import_globals2 = __toESM(require_cjs(), 1);
311
+ var import_globals5 = __toESM(require_cjs(), 1);
4096
312
 
4097
313
  // src/utils/color.js
4098
- var import_globals = __toESM(require_cjs(), 1);
4099
- var import_utils = __toESM(require_cjs2(), 1);
314
+ var import_globals4 = __toESM(require_cjs(), 1);
4100
315
 
4101
- // src/utils/sequence.js
4102
- var import_utils3 = __toESM(require_cjs2(), 1);
4103
- var import_utils4 = __toESM(require_cjs3(), 1);
316
+ // ../../../domql/packages/utils/dist/esm/globals.js
317
+ var window2 = globalThis;
318
+ var document2 = window2.document;
4104
319
 
4105
- // src/factory.js
4106
- var import_utils2 = __toESM(require_cjs2(), 1);
320
+ // ../../../domql/packages/utils/dist/esm/node.js
321
+ var isDOMNode = (obj) => {
322
+ return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
323
+ };
324
+
325
+ // ../../../domql/packages/utils/dist/esm/types.js
326
+ var isString = (arg) => typeof arg === "string";
327
+ var isFunction = (arg) => typeof arg === "function";
328
+ var isNull = (arg) => arg === null;
329
+ var isArray = (arg) => Array.isArray(arg);
330
+ var isObjectLike = (arg) => {
331
+ if (arg === null)
332
+ return false;
333
+ return typeof arg === "object";
334
+ };
335
+ var isUndefined = (arg) => {
336
+ return arg === void 0;
337
+ };
338
+
339
+ // ../../../domql/packages/utils/dist/esm/array.js
340
+ var mergeArray = (arr, exclude = []) => {
341
+ return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
342
+ };
343
+
344
+ // ../../../domql/packages/utils/dist/esm/object.js
345
+ var __defProp2 = Object.defineProperty;
346
+ var __defProps = Object.defineProperties;
347
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
348
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
349
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
350
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
351
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
352
+ var __spreadValues = (a, b) => {
353
+ for (var prop in b || (b = {}))
354
+ if (__hasOwnProp2.call(b, prop))
355
+ __defNormalProp(a, prop, b[prop]);
356
+ if (__getOwnPropSymbols)
357
+ for (var prop of __getOwnPropSymbols(b)) {
358
+ if (__propIsEnum.call(b, prop))
359
+ __defNormalProp(a, prop, b[prop]);
360
+ }
361
+ return a;
362
+ };
363
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
364
+ var deepMerge = (element, extend, excludeFrom = []) => {
365
+ for (const e in extend) {
366
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
367
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
368
+ continue;
369
+ const elementProp = element[e];
370
+ const extendProp = extend[e];
371
+ if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
372
+ deepMerge(elementProp, extendProp, excludeFrom);
373
+ } else if (elementProp === void 0) {
374
+ element[e] = extendProp;
375
+ }
376
+ }
377
+ return element;
378
+ };
379
+ var deepClone = (obj, options = {}) => {
380
+ const {
381
+ exclude = [],
382
+ cleanUndefined = false,
383
+ cleanNull = false,
384
+ window: targetWindow,
385
+ visited = /* @__PURE__ */ new WeakMap(),
386
+ handleExtend = false
387
+ } = options;
388
+ if (!isObjectLike(obj) || isDOMNode(obj)) {
389
+ return obj;
390
+ }
391
+ if (visited.has(obj)) {
392
+ return visited.get(obj);
393
+ }
394
+ const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
395
+ visited.set(obj, clone2);
396
+ for (const key in obj) {
397
+ if (!Object.prototype.hasOwnProperty.call(obj, key))
398
+ continue;
399
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
400
+ continue;
401
+ const value = obj[key];
402
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
403
+ continue;
404
+ if (isDOMNode(value)) {
405
+ clone2[key] = value;
406
+ continue;
407
+ }
408
+ if (handleExtend && key === "extend" && isArray(value)) {
409
+ clone2[key] = mergeArray(value, exclude);
410
+ continue;
411
+ }
412
+ if (isFunction(value) && targetWindow) {
413
+ clone2[key] = targetWindow.eval("(" + value.toString() + ")");
414
+ continue;
415
+ }
416
+ if (isObjectLike(value)) {
417
+ clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
418
+ visited
419
+ }));
420
+ } else {
421
+ clone2[key] = value;
422
+ }
423
+ }
424
+ return clone2;
425
+ };
426
+
427
+ // ../../../domql/packages/utils/dist/esm/cookie.js
428
+ var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
429
+
430
+ // src/utils/sequence.js
431
+ var import_utils4 = __toESM(require_cjs2(), 1);
4107
432
 
4108
433
  // src/defaultConfig/index.js
4109
434
  var defaultConfig_exports = {};
@@ -4317,7 +642,7 @@ var CONFIG = {
4317
642
  CSS_VARS,
4318
643
  ...void 0 || defaultConfig_exports
4319
644
  };
4320
- var cachedConfig = (0, import_utils2.deepClone)(CONFIG);
645
+ var cachedConfig = deepClone(CONFIG);
4321
646
  var FACTORY = {
4322
647
  active: "0",
4323
648
  0: CONFIG
@@ -4326,11 +651,7 @@ var getActiveConfig = (def) => {
4326
651
  return FACTORY[def || FACTORY.active] || CONFIG;
4327
652
  };
4328
653
 
4329
- // src/utils/var.js
4330
- var import_utils5 = __toESM(require_cjs2(), 1);
4331
-
4332
654
  // src/utils/sprite.js
4333
- var import_utils6 = __toESM(require_cjs2(), 1);
4334
655
  var generateSprite = (icons) => {
4335
656
  const CONFIG2 = getActiveConfig();
4336
657
  let sprite = "";
@@ -4345,7 +666,7 @@ var generateSprite = (icons) => {
4345
666
  };
4346
667
  var parseRootAttributes = (htmlString) => {
4347
668
  const val = htmlString.default || htmlString;
4348
- if (!(0, import_utils6.isString)(val)) {
669
+ if (!isString(val)) {
4349
670
  return console.warn(`parseRootAttributes: ${val} is not a string`);
4350
671
  }
4351
672
  const match = val.match(/<svg\s+(.*?)>/);
@@ -4365,7 +686,7 @@ var replaceIdsAndUrls = (code, key) => {
4365
686
  const urlRegex = /url\(#([^)]*)\)/g;
4366
687
  const matches = code.match(/id="([^"]*)"/g);
4367
688
  let replacedCode = code;
4368
- if ((0, import_utils6.isArray)(matches)) {
689
+ if (isArray(matches)) {
4369
690
  matches.forEach(() => {
4370
691
  const randomKey = Math.floor(Math.random() * 1e5);
4371
692
  replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
@@ -4391,7 +712,7 @@ var convertSvgToSymbol = (key, code) => {
4391
712
 
4392
713
  // src/system/svg.js
4393
714
  var DEF_OPTIONS = {
4394
- document: import_globals2.document
715
+ document: import_globals5.document
4395
716
  };
4396
717
  var setSVG = (val, key) => {
4397
718
  const CONFIG2 = getActiveConfig();
@@ -4428,9 +749,9 @@ var appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
4428
749
  appendSVG(lib, options);
4429
750
  };
4430
751
  var createSVGSpriteElement = (options = { isRoot: true }) => {
4431
- if (!import_globals2.document || !import_globals2.document.createElementNS)
752
+ if (!import_globals5.document || !import_globals5.document.createElementNS)
4432
753
  return;
4433
- const svgElem = import_globals2.document.createElementNS("http://www.w3.org/2000/svg", "svg");
754
+ const svgElem = import_globals5.document.createElementNS("http://www.w3.org/2000/svg", "svg");
4434
755
  if (options.isRoot) {
4435
756
  svgElem.setAttribute("aria-hidden", "true");
4436
757
  svgElem.setAttribute("width", "0");
@@ -4442,7 +763,7 @@ var createSVGSpriteElement = (options = { isRoot: true }) => {
4442
763
  };
4443
764
  var appendSVG = (lib, options = DEF_OPTIONS) => {
4444
765
  const CONFIG2 = getActiveConfig();
4445
- const doc = options.document || import_globals2.document;
766
+ const doc = options.document || import_globals5.document;
4446
767
  if (!doc || !doc.documentElement) {
4447
768
  if (CONFIG2.verbose) {
4448
769
  console.warn("To append SVG sprites it should be run in browser environment");