@symbo.ls/scratch 2.11.410 → 2.11.430

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,29 +34,29 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
34
  var require_key = __commonJS({
35
35
  "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
36
36
  "use strict";
37
- var __defProp3 = Object.defineProperty;
38
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
39
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
40
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
41
- var __export3 = (target, all) => {
37
+ var __defProp2 = Object.defineProperty;
38
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
41
+ var __export2 = (target, all) => {
42
42
  for (var name in all)
43
- __defProp3(target, name, { get: all[name], enumerable: true });
43
+ __defProp2(target, name, { get: all[name], enumerable: true });
44
44
  };
45
- var __copyProps3 = (to, from, except, desc) => {
45
+ var __copyProps2 = (to, from, except, desc) => {
46
46
  if (from && typeof from === "object" || typeof from === "function") {
47
- for (let key of __getOwnPropNames3(from))
48
- if (!__hasOwnProp3.call(to, key) && key !== except)
49
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
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 });
50
50
  }
51
51
  return to;
52
52
  };
53
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
54
54
  var key_exports = {};
55
- __export3(key_exports, {
55
+ __export2(key_exports, {
56
56
  createSnapshotId: () => createSnapshotId,
57
57
  generateKey: () => generateKey
58
58
  });
59
- module2.exports = __toCommonJS3(key_exports);
59
+ module2.exports = __toCommonJS2(key_exports);
60
60
  var generateKey = /* @__PURE__ */ function() {
61
61
  let index = 0;
62
62
  function newId() {
@@ -73,32 +73,32 @@ var require_key = __commonJS({
73
73
  var require_env = __commonJS({
74
74
  "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
75
75
  "use strict";
76
- var __defProp3 = Object.defineProperty;
77
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
78
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
79
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
80
- var __export3 = (target, all) => {
76
+ var __defProp2 = Object.defineProperty;
77
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
78
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
79
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
80
+ var __export2 = (target, all) => {
81
81
  for (var name in all)
82
- __defProp3(target, name, { get: all[name], enumerable: true });
82
+ __defProp2(target, name, { get: all[name], enumerable: true });
83
83
  };
84
- var __copyProps3 = (to, from, except, desc) => {
84
+ var __copyProps2 = (to, from, except, desc) => {
85
85
  if (from && typeof from === "object" || typeof from === "function") {
86
- for (let key of __getOwnPropNames3(from))
87
- if (!__hasOwnProp3.call(to, key) && key !== except)
88
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
86
+ for (let key of __getOwnPropNames2(from))
87
+ if (!__hasOwnProp2.call(to, key) && key !== except)
88
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
89
89
  }
90
90
  return to;
91
91
  };
92
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
92
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
93
93
  var env_exports = {};
94
- __export3(env_exports, {
94
+ __export2(env_exports, {
95
95
  NODE_ENV: () => NODE_ENV,
96
96
  getNev: () => getNev,
97
97
  isDevelopment: () => isDevelopment,
98
98
  isProduction: () => isProduction,
99
99
  isTest: () => isTest
100
100
  });
101
- module2.exports = __toCommonJS3(env_exports);
101
+ module2.exports = __toCommonJS2(env_exports);
102
102
  var NODE_ENV = "development";
103
103
  var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
104
104
  var isTest = (env = NODE_ENV) => env === "test";
@@ -111,35 +111,35 @@ var require_env = __commonJS({
111
111
  var require_globals = __commonJS({
112
112
  "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
113
113
  "use strict";
114
- var __defProp3 = Object.defineProperty;
115
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
116
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
117
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
118
- var __export3 = (target, all) => {
114
+ var __defProp2 = Object.defineProperty;
115
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
116
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
117
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
118
+ var __export2 = (target, all) => {
119
119
  for (var name in all)
120
- __defProp3(target, name, { get: all[name], enumerable: true });
120
+ __defProp2(target, name, { get: all[name], enumerable: true });
121
121
  };
122
- var __copyProps3 = (to, from, except, desc) => {
122
+ var __copyProps2 = (to, from, except, desc) => {
123
123
  if (from && typeof from === "object" || typeof from === "function") {
124
- for (let key of __getOwnPropNames3(from))
125
- if (!__hasOwnProp3.call(to, key) && key !== except)
126
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
124
+ for (let key of __getOwnPropNames2(from))
125
+ if (!__hasOwnProp2.call(to, key) && key !== except)
126
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
127
127
  }
128
128
  return to;
129
129
  };
130
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
130
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
131
131
  var globals_exports = {};
132
- __export3(globals_exports, {
132
+ __export2(globals_exports, {
133
133
  document: () => document3,
134
134
  global: () => global,
135
135
  self: () => self,
136
- window: () => window2
136
+ window: () => window3
137
137
  });
138
- module2.exports = __toCommonJS3(globals_exports);
138
+ module2.exports = __toCommonJS2(globals_exports);
139
139
  var global = globalThis;
140
140
  var self = globalThis;
141
- var window2 = globalThis;
142
- var document3 = window2.document;
141
+ var window3 = globalThis;
142
+ var document3 = window3.document;
143
143
  }
144
144
  });
145
145
 
@@ -147,29 +147,30 @@ var require_globals = __commonJS({
147
147
  var require_node = __commonJS({
148
148
  "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
149
149
  "use strict";
150
- var __defProp3 = Object.defineProperty;
151
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
152
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
153
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
154
- var __export3 = (target, all) => {
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
155
  for (var name in all)
156
- __defProp3(target, name, { get: all[name], enumerable: true });
156
+ __defProp2(target, name, { get: all[name], enumerable: true });
157
157
  };
158
- var __copyProps3 = (to, from, except, desc) => {
158
+ var __copyProps2 = (to, from, except, desc) => {
159
159
  if (from && typeof from === "object" || typeof from === "function") {
160
- for (let key of __getOwnPropNames3(from))
161
- if (!__hasOwnProp3.call(to, key) && key !== except)
162
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
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
163
  }
164
164
  return to;
165
165
  };
166
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
166
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
167
167
  var node_exports = {};
168
- __export3(node_exports, {
168
+ __export2(node_exports, {
169
+ isDOMNode: () => isDOMNode,
169
170
  isHtmlElement: () => isHtmlElement,
170
171
  isNode: () => isNode
171
172
  });
172
- module2.exports = __toCommonJS3(node_exports);
173
+ module2.exports = __toCommonJS2(node_exports);
173
174
  var import_globals2 = require_globals();
174
175
  var isNode = (obj) => {
175
176
  return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
@@ -177,6 +178,9 @@ var require_node = __commonJS({
177
178
  var isHtmlElement = (obj) => {
178
179
  return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
179
180
  };
181
+ var isDOMNode = (obj) => {
182
+ return typeof import_globals2.window !== "undefined" && (obj instanceof import_globals2.window.Node || obj instanceof import_globals2.window.Window || obj === import_globals2.window || obj === document);
183
+ };
180
184
  }
181
185
  });
182
186
 
@@ -184,25 +188,25 @@ var require_node = __commonJS({
184
188
  var require_types = __commonJS({
185
189
  "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
186
190
  "use strict";
187
- var __defProp3 = Object.defineProperty;
188
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
189
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
190
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
191
- var __export3 = (target, all) => {
191
+ var __defProp2 = Object.defineProperty;
192
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
193
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
194
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
195
+ var __export2 = (target, all) => {
192
196
  for (var name in all)
193
- __defProp3(target, name, { get: all[name], enumerable: true });
197
+ __defProp2(target, name, { get: all[name], enumerable: true });
194
198
  };
195
- var __copyProps3 = (to, from, except, desc) => {
199
+ var __copyProps2 = (to, from, except, desc) => {
196
200
  if (from && typeof from === "object" || typeof from === "function") {
197
- for (let key of __getOwnPropNames3(from))
198
- if (!__hasOwnProp3.call(to, key) && key !== except)
199
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
201
+ for (let key of __getOwnPropNames2(from))
202
+ if (!__hasOwnProp2.call(to, key) && key !== except)
203
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
200
204
  }
201
205
  return to;
202
206
  };
203
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
207
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
204
208
  var types_exports = {};
205
- __export3(types_exports, {
209
+ __export2(types_exports, {
206
210
  TYPES: () => TYPES,
207
211
  is: () => is,
208
212
  isArray: () => isArray2,
@@ -218,7 +222,7 @@ var require_types = __commonJS({
218
222
  isString: () => isString4,
219
223
  isUndefined: () => isUndefined
220
224
  });
221
- module2.exports = __toCommonJS3(types_exports);
225
+ module2.exports = __toCommonJS2(types_exports);
222
226
  var import_node = require_node();
223
227
  var isObject2 = (arg) => {
224
228
  if (arg === null)
@@ -274,25 +278,25 @@ var require_types = __commonJS({
274
278
  var require_array = __commonJS({
275
279
  "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
276
280
  "use strict";
277
- var __defProp3 = Object.defineProperty;
278
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
279
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
280
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
281
- var __export3 = (target, all) => {
281
+ var __defProp2 = Object.defineProperty;
282
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
283
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
284
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
285
+ var __export2 = (target, all) => {
282
286
  for (var name in all)
283
- __defProp3(target, name, { get: all[name], enumerable: true });
287
+ __defProp2(target, name, { get: all[name], enumerable: true });
284
288
  };
285
- var __copyProps3 = (to, from, except, desc) => {
289
+ var __copyProps2 = (to, from, except, desc) => {
286
290
  if (from && typeof from === "object" || typeof from === "function") {
287
- for (let key of __getOwnPropNames3(from))
288
- if (!__hasOwnProp3.call(to, key) && key !== except)
289
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
291
+ for (let key of __getOwnPropNames2(from))
292
+ if (!__hasOwnProp2.call(to, key) && key !== except)
293
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
290
294
  }
291
295
  return to;
292
296
  };
293
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
297
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
294
298
  var array_exports = {};
295
- __export3(array_exports, {
299
+ __export2(array_exports, {
296
300
  addItemAfterEveryElement: () => addItemAfterEveryElement,
297
301
  arrayContainsOtherArray: () => arrayContainsOtherArray,
298
302
  arraysEqual: () => arraysEqual,
@@ -309,7 +313,7 @@ var require_array = __commonJS({
309
313
  reorderArrayByValues: () => reorderArrayByValues,
310
314
  swapItemsInArray: () => swapItemsInArray
311
315
  });
312
- module2.exports = __toCommonJS3(array_exports);
316
+ module2.exports = __toCommonJS2(array_exports);
313
317
  var import_object = require_object();
314
318
  var import_types = require_types();
315
319
  var arrayContainsOtherArray = (arr1, arr2) => {
@@ -342,10 +346,10 @@ var require_array = __commonJS({
342
346
  return [].concat(...arrays);
343
347
  };
344
348
  var mergeArray = (arr, excludeFrom = []) => {
345
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
349
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
346
350
  };
347
351
  var mergeAndCloneIfArray = (obj) => {
348
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
352
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
349
353
  };
350
354
  var cutArrayBeforeValue = (arr, value) => {
351
355
  const index = arr.indexOf(value);
@@ -430,27 +434,29 @@ var require_array = __commonJS({
430
434
  var require_string = __commonJS({
431
435
  "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
432
436
  "use strict";
433
- var __defProp3 = Object.defineProperty;
434
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
435
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
436
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
437
- var __export3 = (target, all) => {
437
+ var __defProp2 = Object.defineProperty;
438
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
439
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
440
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
441
+ var __export2 = (target, all) => {
438
442
  for (var name in all)
439
- __defProp3(target, name, { get: all[name], enumerable: true });
443
+ __defProp2(target, name, { get: all[name], enumerable: true });
440
444
  };
441
- var __copyProps3 = (to, from, except, desc) => {
445
+ var __copyProps2 = (to, from, except, desc) => {
442
446
  if (from && typeof from === "object" || typeof from === "function") {
443
- for (let key of __getOwnPropNames3(from))
444
- if (!__hasOwnProp3.call(to, key) && key !== except)
445
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
447
+ for (let key of __getOwnPropNames2(from))
448
+ if (!__hasOwnProp2.call(to, key) && key !== except)
449
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
446
450
  }
447
451
  return to;
448
452
  };
449
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
453
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
450
454
  var string_exports = {};
451
- __export3(string_exports, {
455
+ __export2(string_exports, {
452
456
  customDecodeURIComponent: () => customDecodeURIComponent,
453
457
  customEncodeURIComponent: () => customEncodeURIComponent,
458
+ decodeNewlines: () => decodeNewlines,
459
+ encodeNewlines: () => encodeNewlines,
454
460
  findKeyPosition: () => findKeyPosition,
455
461
  lowercaseFirstLetter: () => lowercaseFirstLetter,
456
462
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
@@ -458,7 +464,7 @@ var require_string = __commonJS({
458
464
  stringIncludesAny: () => stringIncludesAny,
459
465
  trimStringFromSymbols: () => trimStringFromSymbols
460
466
  });
461
- module2.exports = __toCommonJS3(string_exports);
467
+ module2.exports = __toCommonJS2(string_exports);
462
468
  var stringIncludesAny = (str, characters) => {
463
469
  for (const char of characters) {
464
470
  if (str.includes(char)) {
@@ -554,6 +560,12 @@ var require_string = __commonJS({
554
560
  return char;
555
561
  });
556
562
  };
563
+ var encodeNewlines = (str) => {
564
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
565
+ };
566
+ var decodeNewlines = (encodedStr) => {
567
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
568
+ };
557
569
  var customEncodeURIComponent = (str) => {
558
570
  return str.split("").map((char) => {
559
571
  if (/[^a-zA-Z0-9\s]/.test(char)) {
@@ -572,25 +584,25 @@ var require_string = __commonJS({
572
584
  var require_object = __commonJS({
573
585
  "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
574
586
  "use strict";
575
- var __defProp3 = Object.defineProperty;
576
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
577
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
578
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
579
- var __export3 = (target, all) => {
587
+ var __defProp2 = Object.defineProperty;
588
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
589
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
590
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
591
+ var __export2 = (target, all) => {
580
592
  for (var name in all)
581
- __defProp3(target, name, { get: all[name], enumerable: true });
593
+ __defProp2(target, name, { get: all[name], enumerable: true });
582
594
  };
583
- var __copyProps3 = (to, from, except, desc) => {
595
+ var __copyProps2 = (to, from, except, desc) => {
584
596
  if (from && typeof from === "object" || typeof from === "function") {
585
- for (let key of __getOwnPropNames3(from))
586
- if (!__hasOwnProp3.call(to, key) && key !== except)
587
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
597
+ for (let key of __getOwnPropNames2(from))
598
+ if (!__hasOwnProp2.call(to, key) && key !== except)
599
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
588
600
  }
589
601
  return to;
590
602
  };
591
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
603
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
592
604
  var object_exports = {};
593
- __export3(object_exports, {
605
+ __export2(object_exports, {
594
606
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
595
607
  clone: () => clone,
596
608
  createObjectWithoutPrototype: () => createObjectWithoutPrototype,
@@ -626,11 +638,12 @@ var require_object = __commonJS({
626
638
  removeFromObject: () => removeFromObject,
627
639
  stringToObject: () => stringToObject
628
640
  });
629
- module2.exports = __toCommonJS3(object_exports);
641
+ module2.exports = __toCommonJS2(object_exports);
630
642
  var import_globals2 = require_globals();
631
643
  var import_types = require_types();
632
644
  var import_array = require_array();
633
645
  var import_string = require_string();
646
+ var import_node = require_node();
634
647
  var exec = (param, element, state, context) => {
635
648
  if ((0, import_types.isFunction)(param)) {
636
649
  return param(
@@ -709,30 +722,31 @@ var require_object = __commonJS({
709
722
  var mergeArrayExclude = (arr, excl = []) => {
710
723
  return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
711
724
  };
712
- var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
713
- const o = (0, import_types.isArray)(obj) ? [] : {};
714
- for (const prop in obj) {
715
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
716
- continue;
717
- if (prop === "__proto__")
718
- continue;
719
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
720
- continue;
721
- let objProp = obj[prop];
722
- if (cleanUndefined && (0, import_types.isUndefined)(objProp))
723
- continue;
724
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
725
- objProp = (0, import_array.mergeArray)(objProp);
725
+ var deepClone2 = (obj, exclude = [], cleanUndefined = false, visited = /* @__PURE__ */ new WeakMap()) => {
726
+ if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj))
727
+ return obj;
728
+ if (visited.has(obj))
729
+ return visited.get(obj);
730
+ const clone2 = (0, import_types.isArray)(obj) ? [] : {};
731
+ visited.set(obj, clone2);
732
+ for (const key in obj) {
733
+ if (Object.prototype.hasOwnProperty.call(obj, key) && !exclude.includes(key)) {
734
+ const value = obj[key];
735
+ if ((0, import_node.isDOMNode)(value)) {
736
+ clone2[key] = value;
737
+ } else if (key === "extend" && (0, import_types.isArray)(value)) {
738
+ clone2[key] = (0, import_array.mergeArray)(value, exclude);
739
+ } else if ((0, import_types.isObjectLike)(value)) {
740
+ clone2[key] = deepClone2(value, exclude, cleanUndefined, visited);
741
+ } else {
742
+ clone2[key] = value;
743
+ }
726
744
  }
727
- if ((0, import_types.isObjectLike)(objProp)) {
728
- o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
729
- } else
730
- o[prop] = objProp;
731
745
  }
732
- return o;
746
+ return clone2;
733
747
  };
734
748
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
735
- const o = (0, import_types.isArray)(obj) ? [] : {};
749
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
736
750
  for (const prop in obj) {
737
751
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
738
752
  continue;
@@ -986,7 +1000,7 @@ var require_object = __commonJS({
986
1000
  };
987
1001
  var overwriteDeep = (obj, params, excludeFrom = []) => {
988
1002
  for (const e in params) {
989
- if (e === "__proto__")
1003
+ if (e === "__ref")
990
1004
  continue;
991
1005
  if (excludeFrom.includes(e) || e.startsWith("__"))
992
1006
  continue;
@@ -1040,30 +1054,40 @@ var require_object = __commonJS({
1040
1054
  }
1041
1055
  return true;
1042
1056
  };
1043
- var deepContains = (obj1, obj2) => {
1044
- if (typeof obj1 !== typeof obj2) {
1057
+ var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
1058
+ if (obj1 === obj2)
1059
+ return true;
1060
+ if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
1045
1061
  return false;
1046
- }
1047
- if ((0, import_types.isObjectLike)(obj1)) {
1048
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
1049
- if (obj1.length !== obj2.length) {
1062
+ if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
1063
+ return obj1 === obj2;
1064
+ const stack = [[obj1, obj2]];
1065
+ const visited = /* @__PURE__ */ new WeakSet();
1066
+ while (stack.length > 0) {
1067
+ const [current1, current2] = stack.pop();
1068
+ if (visited.has(current1))
1069
+ continue;
1070
+ visited.add(current1);
1071
+ const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
1072
+ const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
1073
+ if (keys1.length !== keys2.length)
1074
+ return false;
1075
+ for (const key of keys1) {
1076
+ if (!Object.prototype.hasOwnProperty.call(current2, key))
1050
1077
  return false;
1051
- }
1052
- for (let i = 0; i < obj1.length; i++) {
1053
- if (!deepContains(obj1[i], obj2[i])) {
1054
- return false;
1055
- }
1056
- }
1057
- } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
1058
- for (const key in obj1) {
1059
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
1060
- if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
1078
+ const value1 = current1[key];
1079
+ const value2 = current2[key];
1080
+ if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
1081
+ if (value1 !== value2)
1061
1082
  return false;
1083
+ } else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
1084
+ if (value1 !== value2) {
1085
+ stack.push([value1, value2]);
1062
1086
  }
1087
+ } else if (value1 !== value2) {
1088
+ return false;
1063
1089
  }
1064
1090
  }
1065
- } else {
1066
- return obj2 === obj1;
1067
1091
  }
1068
1092
  return true;
1069
1093
  };
@@ -1108,6 +1132,12 @@ var require_object = __commonJS({
1108
1132
  if (foundString || foundInArray)
1109
1133
  return el;
1110
1134
  }
1135
+ if (el.parent && el.parent.childExtend) {
1136
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1137
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1138
+ if (foundString || foundInArray)
1139
+ return el;
1140
+ }
1111
1141
  };
1112
1142
  var getExtendsInElement = (obj) => {
1113
1143
  let result = [];
@@ -1140,31 +1170,31 @@ var require_object = __commonJS({
1140
1170
  var require_function = __commonJS({
1141
1171
  "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
1142
1172
  "use strict";
1143
- var __defProp3 = Object.defineProperty;
1144
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1145
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1146
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1147
- var __export3 = (target, all) => {
1173
+ var __defProp2 = Object.defineProperty;
1174
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1175
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1176
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1177
+ var __export2 = (target, all) => {
1148
1178
  for (var name in all)
1149
- __defProp3(target, name, { get: all[name], enumerable: true });
1179
+ __defProp2(target, name, { get: all[name], enumerable: true });
1150
1180
  };
1151
- var __copyProps3 = (to, from, except, desc) => {
1181
+ var __copyProps2 = (to, from, except, desc) => {
1152
1182
  if (from && typeof from === "object" || typeof from === "function") {
1153
- for (let key of __getOwnPropNames3(from))
1154
- if (!__hasOwnProp3.call(to, key) && key !== except)
1155
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1183
+ for (let key of __getOwnPropNames2(from))
1184
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1185
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1156
1186
  }
1157
1187
  return to;
1158
1188
  };
1159
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1189
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1160
1190
  var function_exports = {};
1161
- __export3(function_exports, {
1191
+ __export2(function_exports, {
1162
1192
  debounce: () => debounce,
1163
1193
  debounceOnContext: () => debounceOnContext,
1164
1194
  isStringFunction: () => isStringFunction,
1165
1195
  memoize: () => memoize
1166
1196
  });
1167
- module2.exports = __toCommonJS3(function_exports);
1197
+ module2.exports = __toCommonJS2(function_exports);
1168
1198
  function debounce(func, wait, immediate) {
1169
1199
  let timeout;
1170
1200
  return function() {
@@ -1215,29 +1245,29 @@ var require_function = __commonJS({
1215
1245
  var require_log = __commonJS({
1216
1246
  "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
1217
1247
  "use strict";
1218
- var __defProp3 = Object.defineProperty;
1219
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1220
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1221
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1222
- var __export3 = (target, all) => {
1248
+ var __defProp2 = Object.defineProperty;
1249
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1250
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1251
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1252
+ var __export2 = (target, all) => {
1223
1253
  for (var name in all)
1224
- __defProp3(target, name, { get: all[name], enumerable: true });
1254
+ __defProp2(target, name, { get: all[name], enumerable: true });
1225
1255
  };
1226
- var __copyProps3 = (to, from, except, desc) => {
1256
+ var __copyProps2 = (to, from, except, desc) => {
1227
1257
  if (from && typeof from === "object" || typeof from === "function") {
1228
- for (let key of __getOwnPropNames3(from))
1229
- if (!__hasOwnProp3.call(to, key) && key !== except)
1230
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1258
+ for (let key of __getOwnPropNames2(from))
1259
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1260
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1231
1261
  }
1232
1262
  return to;
1233
1263
  };
1234
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1264
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1235
1265
  var log_exports = {};
1236
- __export3(log_exports, {
1266
+ __export2(log_exports, {
1237
1267
  logGroupIf: () => logGroupIf,
1238
1268
  logIf: () => logIf
1239
1269
  });
1240
- module2.exports = __toCommonJS3(log_exports);
1270
+ module2.exports = __toCommonJS2(log_exports);
1241
1271
  var logIf = (bool, ...arg) => {
1242
1272
  if (bool)
1243
1273
  arg.map((v) => console.log(v));
@@ -1256,46 +1286,46 @@ var require_log = __commonJS({
1256
1286
  var require_cookie = __commonJS({
1257
1287
  "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1258
1288
  "use strict";
1259
- var __defProp3 = Object.defineProperty;
1260
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1261
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1262
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1263
- var __export3 = (target, all) => {
1289
+ var __defProp2 = Object.defineProperty;
1290
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1291
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1292
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1293
+ var __export2 = (target, all) => {
1264
1294
  for (var name in all)
1265
- __defProp3(target, name, { get: all[name], enumerable: true });
1295
+ __defProp2(target, name, { get: all[name], enumerable: true });
1266
1296
  };
1267
- var __copyProps3 = (to, from, except, desc) => {
1297
+ var __copyProps2 = (to, from, except, desc) => {
1268
1298
  if (from && typeof from === "object" || typeof from === "function") {
1269
- for (let key of __getOwnPropNames3(from))
1270
- if (!__hasOwnProp3.call(to, key) && key !== except)
1271
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1299
+ for (let key of __getOwnPropNames2(from))
1300
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1301
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1272
1302
  }
1273
1303
  return to;
1274
1304
  };
1275
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1305
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1276
1306
  var cookie_exports = {};
1277
- __export3(cookie_exports, {
1307
+ __export2(cookie_exports, {
1278
1308
  getCookie: () => getCookie,
1279
1309
  isMobile: () => isMobile,
1280
1310
  setCookie: () => setCookie
1281
1311
  });
1282
- module2.exports = __toCommonJS3(cookie_exports);
1312
+ module2.exports = __toCommonJS2(cookie_exports);
1283
1313
  var import_types = require_types();
1284
- var import_utils10 = require_cjs();
1314
+ var import_utils9 = require_cjs();
1285
1315
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1286
1316
  var setCookie = (cname, cvalue, exdays = 365) => {
1287
- if ((0, import_types.isUndefined)(import_utils10.document) || (0, import_types.isUndefined)(import_utils10.document.cookie))
1317
+ if ((0, import_types.isUndefined)(import_utils9.document) || (0, import_types.isUndefined)(import_utils9.document.cookie))
1288
1318
  return;
1289
1319
  const d = /* @__PURE__ */ new Date();
1290
1320
  d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1291
1321
  const expires = `expires=${d.toUTCString()}`;
1292
- import_utils10.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1322
+ import_utils9.document.cookie = `${cname}=${cvalue};${expires};path=/`;
1293
1323
  };
1294
1324
  var getCookie = (cname) => {
1295
- if ((0, import_types.isUndefined)(import_utils10.document) || (0, import_types.isUndefined)(import_utils10.document.cookie))
1325
+ if ((0, import_types.isUndefined)(import_utils9.document) || (0, import_types.isUndefined)(import_utils9.document.cookie))
1296
1326
  return;
1297
1327
  const name = `${cname}=`;
1298
- const decodedCookie = decodeURIComponent(import_utils10.document.cookie);
1328
+ const decodedCookie = decodeURIComponent(import_utils9.document.cookie);
1299
1329
  const ca = decodedCookie.split(";");
1300
1330
  for (let i = 0; i < ca.length; i++) {
1301
1331
  let c = ca[i];
@@ -1313,29 +1343,29 @@ var require_cookie = __commonJS({
1313
1343
  var require_tags = __commonJS({
1314
1344
  "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1315
1345
  "use strict";
1316
- var __defProp3 = Object.defineProperty;
1317
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1318
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1319
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1320
- var __export3 = (target, all) => {
1346
+ var __defProp2 = Object.defineProperty;
1347
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1348
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1349
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1350
+ var __export2 = (target, all) => {
1321
1351
  for (var name in all)
1322
- __defProp3(target, name, { get: all[name], enumerable: true });
1352
+ __defProp2(target, name, { get: all[name], enumerable: true });
1323
1353
  };
1324
- var __copyProps3 = (to, from, except, desc) => {
1354
+ var __copyProps2 = (to, from, except, desc) => {
1325
1355
  if (from && typeof from === "object" || typeof from === "function") {
1326
- for (let key of __getOwnPropNames3(from))
1327
- if (!__hasOwnProp3.call(to, key) && key !== except)
1328
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1356
+ for (let key of __getOwnPropNames2(from))
1357
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1358
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1329
1359
  }
1330
1360
  return to;
1331
1361
  };
1332
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1362
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1333
1363
  var tags_exports = {};
1334
- __export3(tags_exports, {
1364
+ __export2(tags_exports, {
1335
1365
  HTML_TAGS: () => HTML_TAGS,
1336
1366
  isValidHtmlTag: () => isValidHtmlTag
1337
1367
  });
1338
- module2.exports = __toCommonJS3(tags_exports);
1368
+ module2.exports = __toCommonJS2(tags_exports);
1339
1369
  var HTML_TAGS = {
1340
1370
  root: [
1341
1371
  "body",
@@ -1481,22 +1511,22 @@ var require_tags = __commonJS({
1481
1511
  var require_cjs = __commonJS({
1482
1512
  "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1483
1513
  "use strict";
1484
- var __defProp3 = Object.defineProperty;
1485
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1486
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1487
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1488
- var __copyProps3 = (to, from, except, desc) => {
1514
+ var __defProp2 = Object.defineProperty;
1515
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1516
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1517
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1518
+ var __copyProps2 = (to, from, except, desc) => {
1489
1519
  if (from && typeof from === "object" || typeof from === "function") {
1490
- for (let key of __getOwnPropNames3(from))
1491
- if (!__hasOwnProp3.call(to, key) && key !== except)
1492
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1520
+ for (let key of __getOwnPropNames2(from))
1521
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1522
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1493
1523
  }
1494
1524
  return to;
1495
1525
  };
1496
- var __reExport = (target, mod, secondTarget) => (__copyProps3(target, mod, "default"), secondTarget && __copyProps3(secondTarget, mod, "default"));
1497
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1526
+ var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1527
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1498
1528
  var utils_exports = {};
1499
- module2.exports = __toCommonJS3(utils_exports);
1529
+ module2.exports = __toCommonJS2(utils_exports);
1500
1530
  __reExport(utils_exports, require_key(), module2.exports);
1501
1531
  __reExport(utils_exports, require_env(), module2.exports);
1502
1532
  __reExport(utils_exports, require_types(), module2.exports);
@@ -1516,1932 +1546,1980 @@ var require_cjs = __commonJS({
1516
1546
  var require_cjs2 = __commonJS({
1517
1547
  "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
1518
1548
  "use strict";
1519
- var __defProp3 = Object.defineProperty;
1520
- var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
1521
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
1522
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
1523
- var __export3 = (target, all) => {
1549
+ var __defProp2 = Object.defineProperty;
1550
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1551
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1552
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1553
+ var __export2 = (target, all) => {
1524
1554
  for (var name in all)
1525
- __defProp3(target, name, { get: all[name], enumerable: true });
1555
+ __defProp2(target, name, { get: all[name], enumerable: true });
1526
1556
  };
1527
- var __copyProps3 = (to, from, except, desc) => {
1557
+ var __copyProps2 = (to, from, except, desc) => {
1528
1558
  if (from && typeof from === "object" || typeof from === "function") {
1529
- for (let key of __getOwnPropNames3(from))
1530
- if (!__hasOwnProp3.call(to, key) && key !== except)
1531
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
1559
+ for (let key of __getOwnPropNames2(from))
1560
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1561
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1532
1562
  }
1533
1563
  return to;
1534
1564
  };
1535
- var __toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
1565
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1536
1566
  var globals_exports = {};
1537
- __export3(globals_exports, {
1567
+ __export2(globals_exports, {
1538
1568
  document: () => document3,
1539
1569
  global: () => global,
1540
1570
  self: () => self,
1541
- window: () => window2
1571
+ window: () => window3
1542
1572
  });
1543
- module2.exports = __toCommonJS3(globals_exports);
1573
+ module2.exports = __toCommonJS2(globals_exports);
1544
1574
  var global = globalThis;
1545
1575
  var self = globalThis;
1546
- var window2 = globalThis;
1547
- var document3 = window2.document;
1576
+ var window3 = globalThis;
1577
+ var document3 = window3.document;
1548
1578
  }
1549
1579
  });
1550
1580
 
1551
- // src/system/document.js
1552
- var document_exports = {};
1553
- __export(document_exports, {
1554
- applyDocument: () => applyDocument
1555
- });
1556
- module.exports = __toCommonJS(document_exports);
1557
- var import_utils8 = __toESM(require_cjs(), 1);
1558
-
1559
- // src/factory.js
1560
- var import_utils = __toESM(require_cjs(), 1);
1561
-
1562
- // src/defaultConfig/index.js
1563
- var defaultConfig_exports = {};
1564
- __export(defaultConfig_exports, {
1565
- ANIMATION: () => ANIMATION,
1566
- BREAKPOINTS: () => BREAKPOINTS,
1567
- CASES: () => CASES,
1568
- COLOR: () => COLOR,
1569
- DEVICES: () => DEVICES,
1570
- DOCUMENT: () => DOCUMENT,
1571
- FONT: () => FONT,
1572
- FONT_FACE: () => FONT_FACE,
1573
- FONT_FAMILY: () => FONT_FAMILY,
1574
- FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
1575
- GRADIENT: () => GRADIENT,
1576
- GRID: () => GRID,
1577
- ICONS: () => ICONS,
1578
- MEDIA: () => MEDIA,
1579
- RESET: () => RESET,
1580
- SEMANTIC_ICONS: () => SEMANTIC_ICONS,
1581
- SEQUENCE: () => SEQUENCE,
1582
- SHADOW: () => SHADOW,
1583
- SPACING: () => SPACING,
1584
- SVG: () => SVG,
1585
- SVG_DATA: () => SVG_DATA,
1586
- TEMPLATES: () => TEMPLATES,
1587
- THEME: () => THEME,
1588
- TIMING: () => TIMING,
1589
- TYPOGRAPHY: () => TYPOGRAPHY,
1590
- UNIT: () => UNIT
1591
- });
1592
-
1593
- // src/defaultConfig/sequence.js
1594
- var SEQUENCE = {
1595
- "minor-second": 1.067,
1596
- "major-second": 1.125,
1597
- "minor-third": 1.2,
1598
- "major-third": 1.25,
1599
- "perfect-fourth": 1.333,
1600
- "augmented-fourth": 1.414,
1601
- "perfect-fifth": 1.5,
1602
- "minor-sixth": 1.6,
1603
- phi: 1.618,
1604
- // golden-ratio
1605
- "major-sixth": 1.667,
1606
- "square-root-3": 1.732,
1607
- // theodorus
1608
- "minor-seventh": 1.778,
1609
- "major-seventh": 1.875,
1610
- octave: 2,
1611
- "square-root-5": 2.23,
1612
- // pythagoras
1613
- "major-tenth": 2.5,
1614
- "major-eleventh": 2.667,
1615
- "major-twelfth": 3,
1616
- pi: 3.14,
1617
- // archimedes
1618
- "double-octave": 4
1619
- };
1620
-
1621
- // src/defaultConfig/unit.js
1622
- var UNIT = {
1623
- default: "em"
1624
- };
1625
-
1626
- // src/defaultConfig/typography.js
1627
- var defaultProps = {
1628
- browserDefault: 16,
1629
- base: 16,
1630
- type: "font-size",
1631
- ratio: SEQUENCE["minor-third"],
1632
- range: [-3, 12],
1633
- h1Matches: 6,
1634
- lineHeight: 1.5,
1635
- subSequence: true,
1636
- mediaRegenerate: false,
1637
- unit: "em",
1638
- templates: {},
1639
- sequence: {},
1640
- scales: {},
1641
- vars: {}
1642
- };
1643
- var TYPOGRAPHY = defaultProps;
1644
-
1645
- // src/defaultConfig/font.js
1646
- var FONT = {};
1647
-
1648
- // src/defaultConfig/font-family.js
1649
- var FONT_FAMILY = {};
1650
- var FONT_FAMILY_TYPES = {
1651
- "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
1652
- serif: "Times New Roman, Georgia, serif, --system-default",
1653
- monospace: "Courier New, monospace, --system-default"
1654
- };
1655
- var FONT_FACE = {};
1656
-
1657
- // src/defaultConfig/media.js
1658
- var MEDIA = {
1659
- tv: "(min-width: 2780px)",
1660
- light: "(prefers-color-scheme: light)",
1661
- dark: "(prefers-color-scheme: dark)",
1662
- print: "print"
1663
- };
1664
-
1665
- // src/defaultConfig/spacing.js
1666
- var defaultProps2 = {
1667
- base: TYPOGRAPHY.base,
1668
- type: "spacing",
1669
- ratio: SEQUENCE.phi,
1670
- range: [-5, 15],
1671
- subSequence: true,
1672
- mediaRegenerate: false,
1673
- unit: "em",
1674
- sequence: {},
1675
- scales: {},
1676
- vars: {}
1677
- };
1678
- var SPACING = defaultProps2;
1679
-
1680
- // src/defaultConfig/color.js
1681
- var COLOR = {};
1682
- var GRADIENT = {};
1683
-
1684
- // src/defaultConfig/theme.js
1685
- var THEME = {};
1686
-
1687
- // src/defaultConfig/shadow.js
1688
- var SHADOW = {};
1689
-
1690
- // src/defaultConfig/icons.js
1691
- var ICONS = {};
1692
- var SEMANTIC_ICONS = {};
1693
-
1694
- // src/defaultConfig/timing.js
1695
- var defaultProps3 = {
1696
- default: 150,
1697
- base: 150,
1698
- type: "timing",
1699
- ratio: SEQUENCE["perfect-fourth"],
1700
- range: [-3, 12],
1701
- mediaRegenerate: false,
1702
- unit: "ms",
1703
- sequence: {},
1704
- scales: {},
1705
- vars: {}
1706
- };
1707
- var TIMING = defaultProps3;
1708
-
1709
- // src/defaultConfig/document.js
1710
- var DOCUMENT = {};
1711
-
1712
- // src/defaultConfig/responsive.js
1713
- var BREAKPOINTS = {
1714
- screenL: 1920,
1715
- screenM: 1680,
1716
- screenS: 1440,
1717
- tabletL: 1366,
1718
- tabletM: 1280,
1719
- tabletS: 1024,
1720
- mobileL: 768,
1721
- mobileM: 560,
1722
- mobileS: 480,
1723
- mobileXS: 375
1724
- };
1725
- var DEVICES = {
1726
- screenL: [1920, 1024],
1727
- screenM: [1680, 1024],
1728
- screenS: [1440, 978],
1729
- tabletL: [1366, 926],
1730
- tabletM: [1280, 768],
1731
- tabletS: [1024, 768],
1732
- mobileL: [768, 375],
1733
- mobileM: [560, 768],
1734
- mobileS: [480, 768],
1735
- mobileXS: [375, 768]
1736
- };
1737
-
1738
- // src/defaultConfig/cases.js
1739
- var CASES = {};
1740
-
1741
- // src/defaultConfig/animation.js
1742
- var ANIMATION = {};
1743
-
1744
- // src/defaultConfig/svg.js
1745
- var SVG = {};
1746
- var SVG_DATA = {};
1747
-
1748
- // src/defaultConfig/templates.js
1749
- var TEMPLATES = {};
1750
-
1751
- // src/defaultConfig/grid.js
1752
- var defaultProps4 = {};
1753
- var GRID = defaultProps4;
1754
-
1755
- // src/defaultConfig/index.js
1756
- var RESET = {};
1757
-
1758
- // src/factory.js
1759
- var CSS_VARS = {};
1760
- var CONFIG = {
1761
- verbose: false,
1762
- useVariable: true,
1763
- useReset: true,
1764
- CSS_VARS,
1765
- ...defaultConfig_exports
1766
- };
1767
- var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1768
- var FACTORY = {
1769
- active: "0",
1770
- 0: CONFIG
1771
- };
1772
- var getActiveConfig = (def) => {
1773
- return FACTORY[def || FACTORY.active] || CONFIG;
1774
- };
1775
-
1776
- // src/utils/color.js
1777
- var import_globals = __toESM(require_cjs2(), 1);
1778
- var import_utils2 = __toESM(require_cjs(), 1);
1779
-
1780
- // src/utils/font.js
1781
- var getDefaultOrFirstKey = (LIBRARY, key) => {
1782
- if (LIBRARY[key])
1783
- return LIBRARY[key].value;
1784
- if (LIBRARY.default)
1785
- return LIBRARY[LIBRARY.default].value;
1786
- const hasValue = Object.keys(LIBRARY)[0];
1787
- return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
1788
- };
1789
-
1790
- // src/utils/sequence.js
1791
- var import_utils4 = __toESM(require_cjs(), 1);
1792
-
1793
1581
  // ../utils/dist/cjs/index.js
1794
- var __create2 = Object.create;
1795
- var __defProp2 = Object.defineProperty;
1796
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1797
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1798
- var __getProtoOf2 = Object.getPrototypeOf;
1799
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1800
- var __commonJS2 = (cb, mod) => function __require() {
1801
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1802
- };
1803
- var __export2 = (target, all) => {
1804
- for (var name in all)
1805
- __defProp2(target, name, { get: all[name], enumerable: true });
1806
- };
1807
- var __copyProps2 = (to, from, except, desc) => {
1808
- if (from && typeof from === "object" || typeof from === "function") {
1809
- for (let key of __getOwnPropNames2(from))
1810
- if (!__hasOwnProp2.call(to, key) && key !== except)
1811
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1812
- }
1813
- return to;
1814
- };
1815
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1816
- // If the importer is in node compatibility mode or this is not an ESM
1817
- // file that has been converted to a CommonJS file using a Babel-
1818
- // compatible transform (i.e. "__esModule" has not been set), then set
1819
- // "default" to the CommonJS "module.exports" for node compatibility.
1820
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1821
- mod
1822
- ));
1823
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1824
- var require_key2 = __commonJS2({
1825
- "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
1582
+ var require_cjs3 = __commonJS({
1583
+ "../utils/dist/cjs/index.js"(exports, module2) {
1826
1584
  "use strict";
1827
- var __defProp22 = Object.defineProperty;
1828
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1829
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1830
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1831
- var __export22 = (target, all) => {
1585
+ var __create2 = Object.create;
1586
+ var __defProp2 = Object.defineProperty;
1587
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1588
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1589
+ var __getProtoOf2 = Object.getPrototypeOf;
1590
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1591
+ var __commonJS2 = (cb, mod) => function __require() {
1592
+ return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1593
+ };
1594
+ var __export2 = (target, all) => {
1832
1595
  for (var name in all)
1833
- __defProp22(target, name, { get: all[name], enumerable: true });
1596
+ __defProp2(target, name, { get: all[name], enumerable: true });
1834
1597
  };
1835
- var __copyProps22 = (to, from, except, desc) => {
1598
+ var __copyProps2 = (to, from, except, desc) => {
1836
1599
  if (from && typeof from === "object" || typeof from === "function") {
1837
- for (let key of __getOwnPropNames22(from))
1838
- if (!__hasOwnProp22.call(to, key) && key !== except)
1839
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1600
+ for (let key of __getOwnPropNames2(from))
1601
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1602
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1840
1603
  }
1841
1604
  return to;
1842
1605
  };
1843
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1844
- var key_exports = {};
1845
- __export22(key_exports, {
1846
- createSnapshotId: () => createSnapshotId,
1847
- generateKey: () => generateKey
1848
- });
1849
- module2.exports = __toCommonJS22(key_exports);
1850
- var generateKey = /* @__PURE__ */ function() {
1851
- let index = 0;
1852
- function newId() {
1853
- index++;
1854
- return index;
1606
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
1607
+ // If the importer is in node compatibility mode or this is not an ESM
1608
+ // file that has been converted to a CommonJS file using a Babel-
1609
+ // compatible transform (i.e. "__esModule" has not been set), then set
1610
+ // "default" to the CommonJS "module.exports" for node compatibility.
1611
+ isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
1612
+ mod
1613
+ ));
1614
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1615
+ var require_key2 = __commonJS2({
1616
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports2, module22) {
1617
+ "use strict";
1618
+ var __defProp22 = Object.defineProperty;
1619
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1620
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1621
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1622
+ var __export22 = (target, all) => {
1623
+ for (var name in all)
1624
+ __defProp22(target, name, { get: all[name], enumerable: true });
1625
+ };
1626
+ var __copyProps22 = (to, from, except, desc) => {
1627
+ if (from && typeof from === "object" || typeof from === "function") {
1628
+ for (let key of __getOwnPropNames22(from))
1629
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1630
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1631
+ }
1632
+ return to;
1633
+ };
1634
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1635
+ var key_exports = {};
1636
+ __export22(key_exports, {
1637
+ createSnapshotId: () => createSnapshotId,
1638
+ generateKey: () => generateKey
1639
+ });
1640
+ module22.exports = __toCommonJS22(key_exports);
1641
+ var generateKey = /* @__PURE__ */ function() {
1642
+ let index = 0;
1643
+ function newId() {
1644
+ index++;
1645
+ return index;
1646
+ }
1647
+ return newId;
1648
+ }();
1649
+ var createSnapshotId = generateKey;
1855
1650
  }
1856
- return newId;
1857
- }();
1858
- var createSnapshotId = generateKey;
1859
- }
1860
- });
1861
- var require_env2 = __commonJS2({
1862
- "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
1863
- "use strict";
1864
- var __defProp22 = Object.defineProperty;
1865
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1866
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1867
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1868
- var __export22 = (target, all) => {
1869
- for (var name in all)
1870
- __defProp22(target, name, { get: all[name], enumerable: true });
1871
- };
1872
- var __copyProps22 = (to, from, except, desc) => {
1873
- if (from && typeof from === "object" || typeof from === "function") {
1874
- for (let key of __getOwnPropNames22(from))
1875
- if (!__hasOwnProp22.call(to, key) && key !== except)
1876
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1651
+ });
1652
+ var require_env2 = __commonJS2({
1653
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports2, module22) {
1654
+ "use strict";
1655
+ var __defProp22 = Object.defineProperty;
1656
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1657
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1658
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1659
+ var __export22 = (target, all) => {
1660
+ for (var name in all)
1661
+ __defProp22(target, name, { get: all[name], enumerable: true });
1662
+ };
1663
+ var __copyProps22 = (to, from, except, desc) => {
1664
+ if (from && typeof from === "object" || typeof from === "function") {
1665
+ for (let key of __getOwnPropNames22(from))
1666
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1667
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1668
+ }
1669
+ return to;
1670
+ };
1671
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1672
+ var env_exports = {};
1673
+ __export22(env_exports, {
1674
+ NODE_ENV: () => NODE_ENV,
1675
+ getNev: () => getNev,
1676
+ isDevelopment: () => isDevelopment,
1677
+ isProduction: () => isProduction,
1678
+ isTest: () => isTest
1679
+ });
1680
+ module22.exports = __toCommonJS22(env_exports);
1681
+ var NODE_ENV = "development";
1682
+ var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
1683
+ var isTest = (env = NODE_ENV) => env === "test";
1684
+ var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
1685
+ var getNev = (key, env = NODE_ENV) => env[key];
1877
1686
  }
1878
- return to;
1879
- };
1880
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1881
- var env_exports = {};
1882
- __export22(env_exports, {
1883
- NODE_ENV: () => NODE_ENV,
1884
- getNev: () => getNev,
1885
- isDevelopment: () => isDevelopment,
1886
- isProduction: () => isProduction,
1887
- isTest: () => isTest
1888
1687
  });
1889
- module2.exports = __toCommonJS22(env_exports);
1890
- var NODE_ENV = "development";
1891
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
1892
- var isTest = (env = NODE_ENV) => env === "test";
1893
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
1894
- var getNev = (key, env = NODE_ENV) => env[key];
1895
- }
1896
- });
1897
- var require_globals2 = __commonJS2({
1898
- "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
1899
- "use strict";
1900
- var __defProp22 = Object.defineProperty;
1901
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1902
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1903
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1904
- var __export22 = (target, all) => {
1905
- for (var name in all)
1906
- __defProp22(target, name, { get: all[name], enumerable: true });
1907
- };
1908
- var __copyProps22 = (to, from, except, desc) => {
1909
- if (from && typeof from === "object" || typeof from === "function") {
1910
- for (let key of __getOwnPropNames22(from))
1911
- if (!__hasOwnProp22.call(to, key) && key !== except)
1912
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1688
+ var require_globals2 = __commonJS2({
1689
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports2, module22) {
1690
+ "use strict";
1691
+ var __defProp22 = Object.defineProperty;
1692
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1693
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1694
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1695
+ var __export22 = (target, all) => {
1696
+ for (var name in all)
1697
+ __defProp22(target, name, { get: all[name], enumerable: true });
1698
+ };
1699
+ var __copyProps22 = (to, from, except, desc) => {
1700
+ if (from && typeof from === "object" || typeof from === "function") {
1701
+ for (let key of __getOwnPropNames22(from))
1702
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1703
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1704
+ }
1705
+ return to;
1706
+ };
1707
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1708
+ var globals_exports = {};
1709
+ __export22(globals_exports, {
1710
+ document: () => document22,
1711
+ global: () => global,
1712
+ self: () => self,
1713
+ window: () => window22
1714
+ });
1715
+ module22.exports = __toCommonJS22(globals_exports);
1716
+ var global = globalThis;
1717
+ var self = globalThis;
1718
+ var window22 = globalThis;
1719
+ var document22 = window22.document;
1913
1720
  }
1914
- return to;
1915
- };
1916
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1917
- var globals_exports = {};
1918
- __export22(globals_exports, {
1919
- document: () => document22,
1920
- global: () => global,
1921
- self: () => self,
1922
- window: () => window2
1923
1721
  });
1924
- module2.exports = __toCommonJS22(globals_exports);
1925
- var global = globalThis;
1926
- var self = globalThis;
1927
- var window2 = globalThis;
1928
- var document22 = window2.document;
1929
- }
1930
- });
1931
- var require_node2 = __commonJS2({
1932
- "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
1933
- "use strict";
1934
- var __defProp22 = Object.defineProperty;
1935
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1936
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1937
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1938
- var __export22 = (target, all) => {
1939
- for (var name in all)
1940
- __defProp22(target, name, { get: all[name], enumerable: true });
1941
- };
1942
- var __copyProps22 = (to, from, except, desc) => {
1943
- if (from && typeof from === "object" || typeof from === "function") {
1944
- for (let key of __getOwnPropNames22(from))
1945
- if (!__hasOwnProp22.call(to, key) && key !== except)
1946
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1722
+ var require_node2 = __commonJS2({
1723
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports2, module22) {
1724
+ "use strict";
1725
+ var __defProp22 = Object.defineProperty;
1726
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1727
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1728
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1729
+ var __export22 = (target, all) => {
1730
+ for (var name in all)
1731
+ __defProp22(target, name, { get: all[name], enumerable: true });
1732
+ };
1733
+ var __copyProps22 = (to, from, except, desc) => {
1734
+ if (from && typeof from === "object" || typeof from === "function") {
1735
+ for (let key of __getOwnPropNames22(from))
1736
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1737
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1738
+ }
1739
+ return to;
1740
+ };
1741
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1742
+ var node_exports = {};
1743
+ __export22(node_exports, {
1744
+ isHtmlElement: () => isHtmlElement,
1745
+ isNode: () => isNode
1746
+ });
1747
+ module22.exports = __toCommonJS22(node_exports);
1748
+ var import_globals2 = require_globals2();
1749
+ var isNode = (obj) => {
1750
+ return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
1751
+ };
1752
+ var isHtmlElement = (obj) => {
1753
+ return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
1754
+ };
1947
1755
  }
1948
- return to;
1949
- };
1950
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1951
- var node_exports = {};
1952
- __export22(node_exports, {
1953
- isHtmlElement: () => isHtmlElement,
1954
- isNode: () => isNode
1955
1756
  });
1956
- module2.exports = __toCommonJS22(node_exports);
1957
- var import_globals2 = require_globals2();
1958
- var isNode = (obj) => {
1959
- return (typeof Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
1960
- };
1961
- var isHtmlElement = (obj) => {
1962
- return (typeof HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
1963
- };
1964
- }
1965
- });
1966
- var require_types2 = __commonJS2({
1967
- "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
1968
- "use strict";
1969
- var __defProp22 = Object.defineProperty;
1970
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1971
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
1972
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1973
- var __export22 = (target, all) => {
1974
- for (var name in all)
1975
- __defProp22(target, name, { get: all[name], enumerable: true });
1976
- };
1977
- var __copyProps22 = (to, from, except, desc) => {
1978
- if (from && typeof from === "object" || typeof from === "function") {
1979
- for (let key of __getOwnPropNames22(from))
1980
- if (!__hasOwnProp22.call(to, key) && key !== except)
1981
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1757
+ var require_types2 = __commonJS2({
1758
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports2, module22) {
1759
+ "use strict";
1760
+ var __defProp22 = Object.defineProperty;
1761
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1762
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1763
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1764
+ var __export22 = (target, all) => {
1765
+ for (var name in all)
1766
+ __defProp22(target, name, { get: all[name], enumerable: true });
1767
+ };
1768
+ var __copyProps22 = (to, from, except, desc) => {
1769
+ if (from && typeof from === "object" || typeof from === "function") {
1770
+ for (let key of __getOwnPropNames22(from))
1771
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1772
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1773
+ }
1774
+ return to;
1775
+ };
1776
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1777
+ var types_exports = {};
1778
+ __export22(types_exports, {
1779
+ TYPES: () => TYPES,
1780
+ is: () => is,
1781
+ isArray: () => isArray3,
1782
+ isBoolean: () => isBoolean,
1783
+ isDate: () => isDate,
1784
+ isDefined: () => isDefined2,
1785
+ isFunction: () => isFunction,
1786
+ isNot: () => isNot,
1787
+ isNull: () => isNull,
1788
+ isNumber: () => isNumber2,
1789
+ isObject: () => isObject3,
1790
+ isObjectLike: () => isObjectLike2,
1791
+ isString: () => isString22,
1792
+ isUndefined: () => isUndefined
1793
+ });
1794
+ module22.exports = __toCommonJS22(types_exports);
1795
+ var import_node = require_node2();
1796
+ var isObject3 = (arg) => {
1797
+ if (arg === null)
1798
+ return false;
1799
+ return typeof arg === "object" && arg.constructor === Object;
1800
+ };
1801
+ var isString22 = (arg) => typeof arg === "string";
1802
+ var isNumber2 = (arg) => typeof arg === "number";
1803
+ var isFunction = (arg) => typeof arg === "function";
1804
+ var isBoolean = (arg) => arg === true || arg === false;
1805
+ var isNull = (arg) => arg === null;
1806
+ var isArray3 = (arg) => Array.isArray(arg);
1807
+ var isDate = (d) => d instanceof Date;
1808
+ var isObjectLike2 = (arg) => {
1809
+ if (arg === null)
1810
+ return false;
1811
+ return typeof arg === "object";
1812
+ };
1813
+ var isDefined2 = (arg) => {
1814
+ return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
1815
+ };
1816
+ var isUndefined = (arg) => {
1817
+ return arg === void 0;
1818
+ };
1819
+ var TYPES = {
1820
+ boolean: isBoolean,
1821
+ array: isArray3,
1822
+ object: isObject3,
1823
+ string: isString22,
1824
+ date: isDate,
1825
+ number: isNumber2,
1826
+ null: isNull,
1827
+ function: isFunction,
1828
+ objectLike: isObjectLike2,
1829
+ node: import_node.isNode,
1830
+ htmlElement: import_node.isHtmlElement,
1831
+ defined: isDefined2
1832
+ };
1833
+ var is = (arg) => {
1834
+ return (...args) => {
1835
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
1836
+ };
1837
+ };
1838
+ var isNot = (arg) => {
1839
+ return (...args) => {
1840
+ return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
1841
+ };
1842
+ };
1982
1843
  }
1983
- return to;
1984
- };
1985
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1986
- var types_exports = {};
1987
- __export22(types_exports, {
1988
- TYPES: () => TYPES,
1989
- is: () => is,
1990
- isArray: () => isArray3,
1991
- isBoolean: () => isBoolean,
1992
- isDate: () => isDate,
1993
- isDefined: () => isDefined2,
1994
- isFunction: () => isFunction,
1995
- isNot: () => isNot,
1996
- isNull: () => isNull,
1997
- isNumber: () => isNumber2,
1998
- isObject: () => isObject3,
1999
- isObjectLike: () => isObjectLike2,
2000
- isString: () => isString22,
2001
- isUndefined: () => isUndefined
2002
1844
  });
2003
- module2.exports = __toCommonJS22(types_exports);
2004
- var import_node = require_node2();
2005
- var isObject3 = (arg) => {
2006
- if (arg === null)
2007
- return false;
2008
- return typeof arg === "object" && arg.constructor === Object;
2009
- };
2010
- var isString22 = (arg) => typeof arg === "string";
2011
- var isNumber2 = (arg) => typeof arg === "number";
2012
- var isFunction = (arg) => typeof arg === "function";
2013
- var isBoolean = (arg) => arg === true || arg === false;
2014
- var isNull = (arg) => arg === null;
2015
- var isArray3 = (arg) => Array.isArray(arg);
2016
- var isDate = (d) => d instanceof Date;
2017
- var isObjectLike2 = (arg) => {
2018
- if (arg === null)
2019
- return false;
2020
- return typeof arg === "object";
2021
- };
2022
- var isDefined2 = (arg) => {
2023
- return isObject3(arg) || isObjectLike2(arg) || isString22(arg) || isNumber2(arg) || isFunction(arg) || isArray3(arg) || isObjectLike2(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
2024
- };
2025
- var isUndefined = (arg) => {
2026
- return arg === void 0;
2027
- };
2028
- var TYPES = {
2029
- boolean: isBoolean,
2030
- array: isArray3,
2031
- object: isObject3,
2032
- string: isString22,
2033
- date: isDate,
2034
- number: isNumber2,
2035
- null: isNull,
2036
- function: isFunction,
2037
- objectLike: isObjectLike2,
2038
- node: import_node.isNode,
2039
- htmlElement: import_node.isHtmlElement,
2040
- defined: isDefined2
2041
- };
2042
- var is = (arg) => {
2043
- return (...args) => {
2044
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
2045
- };
2046
- };
2047
- var isNot = (arg) => {
2048
- return (...args) => {
2049
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
2050
- };
2051
- };
2052
- }
2053
- });
2054
- var require_array2 = __commonJS2({
2055
- "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
2056
- "use strict";
2057
- var __defProp22 = Object.defineProperty;
2058
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2059
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2060
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2061
- var __export22 = (target, all) => {
2062
- for (var name in all)
2063
- __defProp22(target, name, { get: all[name], enumerable: true });
2064
- };
2065
- var __copyProps22 = (to, from, except, desc) => {
2066
- if (from && typeof from === "object" || typeof from === "function") {
2067
- for (let key of __getOwnPropNames22(from))
2068
- if (!__hasOwnProp22.call(to, key) && key !== except)
2069
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1845
+ var require_array2 = __commonJS2({
1846
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports2, module22) {
1847
+ "use strict";
1848
+ var __defProp22 = Object.defineProperty;
1849
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
1850
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
1851
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
1852
+ var __export22 = (target, all) => {
1853
+ for (var name in all)
1854
+ __defProp22(target, name, { get: all[name], enumerable: true });
1855
+ };
1856
+ var __copyProps22 = (to, from, except, desc) => {
1857
+ if (from && typeof from === "object" || typeof from === "function") {
1858
+ for (let key of __getOwnPropNames22(from))
1859
+ if (!__hasOwnProp22.call(to, key) && key !== except)
1860
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
1861
+ }
1862
+ return to;
1863
+ };
1864
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
1865
+ var array_exports = {};
1866
+ __export22(array_exports, {
1867
+ addItemAfterEveryElement: () => addItemAfterEveryElement,
1868
+ arrayContainsOtherArray: () => arrayContainsOtherArray,
1869
+ arraysEqual: () => arraysEqual,
1870
+ createNestedObject: () => createNestedObject,
1871
+ cutArrayAfterValue: () => cutArrayAfterValue,
1872
+ cutArrayBeforeValue: () => cutArrayBeforeValue,
1873
+ getFrequencyInArray: () => getFrequencyInArray,
1874
+ joinArrays: () => joinArrays,
1875
+ mergeAndCloneIfArray: () => mergeAndCloneIfArray,
1876
+ mergeArray: () => mergeArray,
1877
+ removeFromArray: () => removeFromArray,
1878
+ removeValueFromArray: () => removeValueFromArray,
1879
+ removeValueFromArrayAll: () => removeValueFromArrayAll,
1880
+ reorderArrayByValues: () => reorderArrayByValues,
1881
+ swapItemsInArray: () => swapItemsInArray
1882
+ });
1883
+ module22.exports = __toCommonJS22(array_exports);
1884
+ var import_object = require_object2();
1885
+ var import_types = require_types2();
1886
+ var arrayContainsOtherArray = (arr1, arr2) => {
1887
+ return arr2.every((val) => arr1.includes(val));
1888
+ };
1889
+ var getFrequencyInArray = (arr, value) => {
1890
+ return arr.reduce((count, currentValue) => {
1891
+ return currentValue === value ? count + 1 : count;
1892
+ }, 0);
1893
+ };
1894
+ var removeFromArray = (arr, index) => {
1895
+ if ((0, import_types.isString)(index))
1896
+ index = parseInt(index);
1897
+ if ((0, import_types.isNumber)(index)) {
1898
+ if (index < 0 || index >= arr.length || isNaN(index)) {
1899
+ throw new Error("Invalid index");
1900
+ }
1901
+ arr.splice(index, 1);
1902
+ } else if ((0, import_types.isArray)(index)) {
1903
+ index.forEach((idx) => removeFromArray(arr, idx));
1904
+ } else {
1905
+ throw new Error("Invalid index");
1906
+ }
1907
+ return arr;
1908
+ };
1909
+ var swapItemsInArray = (arr, i, j) => {
1910
+ [arr[i], arr[j]] = [arr[j], arr[i]];
1911
+ };
1912
+ var joinArrays = (...arrays) => {
1913
+ return [].concat(...arrays);
1914
+ };
1915
+ var mergeArray = (arr, excludeFrom = []) => {
1916
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
1917
+ };
1918
+ var mergeAndCloneIfArray = (obj) => {
1919
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
1920
+ };
1921
+ var cutArrayBeforeValue = (arr, value) => {
1922
+ const index = arr.indexOf(value);
1923
+ if (index !== -1) {
1924
+ return arr.slice(0, index);
1925
+ }
1926
+ return arr;
1927
+ };
1928
+ var cutArrayAfterValue = (arr, value) => {
1929
+ if (!(0, import_types.isArray)(arr))
1930
+ return;
1931
+ const index = arr.indexOf(value);
1932
+ if (index !== -1) {
1933
+ return arr.slice(index + 1);
1934
+ }
1935
+ return arr;
1936
+ };
1937
+ var createNestedObject = (arr, lastValue) => {
1938
+ const nestedObject = {};
1939
+ if (arr.length === 0) {
1940
+ return lastValue;
1941
+ }
1942
+ arr.reduce((obj, value, index) => {
1943
+ if (!obj[value]) {
1944
+ obj[value] = {};
1945
+ }
1946
+ if (index === arr.length - 1 && lastValue) {
1947
+ obj[value] = lastValue;
1948
+ }
1949
+ return obj[value];
1950
+ }, nestedObject);
1951
+ return nestedObject;
1952
+ };
1953
+ var removeValueFromArray = (arr, value) => {
1954
+ const index = arr.indexOf(value);
1955
+ if (index > -1) {
1956
+ const newArray = [...arr];
1957
+ newArray.splice(index, 1);
1958
+ return newArray;
1959
+ }
1960
+ return arr;
1961
+ };
1962
+ var removeValueFromArrayAll = (arr, value) => {
1963
+ return arr.filter((item) => item !== value);
1964
+ };
1965
+ var addItemAfterEveryElement = (array, item) => {
1966
+ const result = [];
1967
+ for (let i = 0; i < array.length; i++) {
1968
+ result.push(array[i]);
1969
+ if (i < array.length - 1) {
1970
+ result.push(item);
1971
+ }
1972
+ }
1973
+ return result;
1974
+ };
1975
+ var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
1976
+ const newArray = [...array];
1977
+ const indexToMove = newArray.indexOf(valueToMove);
1978
+ const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
1979
+ if (indexToMove !== -1 && indexToInsertBefore !== -1) {
1980
+ const removedItem = newArray.splice(indexToMove, 1)[0];
1981
+ const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
1982
+ newArray.splice(insertIndex, 0, removedItem);
1983
+ }
1984
+ return newArray;
1985
+ };
1986
+ var arraysEqual = (arr1, arr2) => {
1987
+ if (arr1.length !== arr2.length) {
1988
+ return false;
1989
+ }
1990
+ for (let i = 0; i < arr1.length; i++) {
1991
+ if (arr1[i] !== arr2[i]) {
1992
+ return false;
1993
+ }
1994
+ }
1995
+ return true;
1996
+ };
2070
1997
  }
2071
- return to;
2072
- };
2073
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2074
- var array_exports = {};
2075
- __export22(array_exports, {
2076
- addItemAfterEveryElement: () => addItemAfterEveryElement,
2077
- arrayContainsOtherArray: () => arrayContainsOtherArray,
2078
- arraysEqual: () => arraysEqual,
2079
- createNestedObject: () => createNestedObject,
2080
- cutArrayAfterValue: () => cutArrayAfterValue,
2081
- cutArrayBeforeValue: () => cutArrayBeforeValue,
2082
- getFrequencyInArray: () => getFrequencyInArray,
2083
- joinArrays: () => joinArrays,
2084
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
2085
- mergeArray: () => mergeArray,
2086
- removeFromArray: () => removeFromArray,
2087
- removeValueFromArray: () => removeValueFromArray,
2088
- removeValueFromArrayAll: () => removeValueFromArrayAll,
2089
- reorderArrayByValues: () => reorderArrayByValues,
2090
- swapItemsInArray: () => swapItemsInArray
2091
1998
  });
2092
- module2.exports = __toCommonJS22(array_exports);
2093
- var import_object = require_object2();
2094
- var import_types = require_types2();
2095
- var arrayContainsOtherArray = (arr1, arr2) => {
2096
- return arr2.every((val) => arr1.includes(val));
2097
- };
2098
- var getFrequencyInArray = (arr, value) => {
2099
- return arr.reduce((count, currentValue) => {
2100
- return currentValue === value ? count + 1 : count;
2101
- }, 0);
2102
- };
2103
- var removeFromArray = (arr, index) => {
2104
- if ((0, import_types.isString)(index))
2105
- index = parseInt(index);
2106
- if ((0, import_types.isNumber)(index)) {
2107
- if (index < 0 || index >= arr.length || isNaN(index)) {
2108
- throw new Error("Invalid index");
2109
- }
2110
- arr.splice(index, 1);
2111
- } else if ((0, import_types.isArray)(index)) {
2112
- index.forEach((idx) => removeFromArray(arr, idx));
2113
- } else {
2114
- throw new Error("Invalid index");
2115
- }
2116
- return arr;
2117
- };
2118
- var swapItemsInArray = (arr, i, j) => {
2119
- [arr[i], arr[j]] = [arr[j], arr[i]];
2120
- };
2121
- var joinArrays = (...arrays) => {
2122
- return [].concat(...arrays);
2123
- };
2124
- var mergeArray = (arr, excludeFrom = []) => {
2125
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
2126
- };
2127
- var mergeAndCloneIfArray = (obj) => {
2128
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
2129
- };
2130
- var cutArrayBeforeValue = (arr, value) => {
2131
- const index = arr.indexOf(value);
2132
- if (index !== -1) {
2133
- return arr.slice(0, index);
2134
- }
2135
- return arr;
2136
- };
2137
- var cutArrayAfterValue = (arr, value) => {
2138
- if (!(0, import_types.isArray)(arr))
2139
- return;
2140
- const index = arr.indexOf(value);
2141
- if (index !== -1) {
2142
- return arr.slice(index + 1);
2143
- }
2144
- return arr;
2145
- };
2146
- var createNestedObject = (arr, lastValue) => {
2147
- const nestedObject = {};
2148
- if (arr.length === 0) {
2149
- return lastValue;
2150
- }
2151
- arr.reduce((obj, value, index) => {
2152
- if (!obj[value]) {
2153
- obj[value] = {};
2154
- }
2155
- if (index === arr.length - 1 && lastValue) {
2156
- obj[value] = lastValue;
2157
- }
2158
- return obj[value];
2159
- }, nestedObject);
2160
- return nestedObject;
2161
- };
2162
- var removeValueFromArray = (arr, value) => {
2163
- const index = arr.indexOf(value);
2164
- if (index > -1) {
2165
- const newArray = [...arr];
2166
- newArray.splice(index, 1);
2167
- return newArray;
2168
- }
2169
- return arr;
2170
- };
2171
- var removeValueFromArrayAll = (arr, value) => {
2172
- return arr.filter((item) => item !== value);
2173
- };
2174
- var addItemAfterEveryElement = (array, item) => {
2175
- const result = [];
2176
- for (let i = 0; i < array.length; i++) {
2177
- result.push(array[i]);
2178
- if (i < array.length - 1) {
2179
- result.push(item);
2180
- }
2181
- }
2182
- return result;
2183
- };
2184
- var reorderArrayByValues = (array, valueToMove, insertBeforeValue) => {
2185
- const newArray = [...array];
2186
- const indexToMove = newArray.indexOf(valueToMove);
2187
- const indexToInsertBefore = newArray.indexOf(insertBeforeValue);
2188
- if (indexToMove !== -1 && indexToInsertBefore !== -1) {
2189
- const removedItem = newArray.splice(indexToMove, 1)[0];
2190
- const insertIndex = indexToInsertBefore < indexToMove ? indexToInsertBefore : indexToInsertBefore + 1;
2191
- newArray.splice(insertIndex, 0, removedItem);
2192
- }
2193
- return newArray;
2194
- };
2195
- var arraysEqual = (arr1, arr2) => {
2196
- if (arr1.length !== arr2.length) {
2197
- return false;
2198
- }
2199
- for (let i = 0; i < arr1.length; i++) {
2200
- if (arr1[i] !== arr2[i]) {
2201
- return false;
2202
- }
2203
- }
2204
- return true;
2205
- };
2206
- }
2207
- });
2208
- var require_string2 = __commonJS2({
2209
- "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
2210
- "use strict";
2211
- var __defProp22 = Object.defineProperty;
2212
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2213
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2214
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2215
- var __export22 = (target, all) => {
2216
- for (var name in all)
2217
- __defProp22(target, name, { get: all[name], enumerable: true });
2218
- };
2219
- var __copyProps22 = (to, from, except, desc) => {
2220
- if (from && typeof from === "object" || typeof from === "function") {
2221
- for (let key of __getOwnPropNames22(from))
2222
- if (!__hasOwnProp22.call(to, key) && key !== except)
2223
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2224
- }
2225
- return to;
2226
- };
2227
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2228
- var string_exports = {};
2229
- __export22(string_exports, {
2230
- customDecodeURIComponent: () => customDecodeURIComponent,
2231
- customEncodeURIComponent: () => customEncodeURIComponent,
2232
- findKeyPosition: () => findKeyPosition,
2233
- lowercaseFirstLetter: () => lowercaseFirstLetter,
2234
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2235
- replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2236
- stringIncludesAny: () => stringIncludesAny,
2237
- trimStringFromSymbols: () => trimStringFromSymbols
2238
- });
2239
- module2.exports = __toCommonJS22(string_exports);
2240
- var stringIncludesAny = (str, characters) => {
2241
- for (const char of characters) {
2242
- if (str.includes(char)) {
2243
- return true;
2244
- }
2245
- }
2246
- return false;
2247
- };
2248
- var trimStringFromSymbols = (str, characters) => {
2249
- const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2250
- return str.replace(pattern, "");
2251
- };
2252
- var brackRegex = {
2253
- 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2254
- 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2255
- };
2256
- var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
2257
- if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2258
- return str;
2259
- const reg = brackRegex[options.bracketsLength || 2];
2260
- return str.replace(reg, (_, parentPath, variable) => {
2261
- if (parentPath) {
2262
- const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2263
- let parentState = state;
2264
- for (let i = 0; i < parentLevels; i++) {
2265
- parentState = parentState.parent;
2266
- if (!parentState) {
2267
- return "";
2268
- }
2269
- }
2270
- const value = parentState[variable.trim()];
2271
- return value !== void 0 ? `${value}` : "";
2272
- } else {
2273
- const value = state[variable.trim()];
2274
- return value !== void 0 ? `${value}` : "";
2275
- }
2276
- });
2277
- };
2278
- var lowercaseFirstLetter = (inputString) => {
2279
- return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2280
- };
2281
- var findKeyPosition = (str, key) => {
2282
- const lines = str.split("\n");
2283
- let startLineNumber = -1;
2284
- let endLineNumber = -1;
2285
- let startColumn = -1;
2286
- let endColumn = -1;
2287
- const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2288
- let braceCount = 0;
2289
- let foundKey = false;
2290
- for (let i = 0; i < lines.length; i++) {
2291
- if (keyPattern.test(lines[i]) && !foundKey) {
2292
- foundKey = true;
2293
- startLineNumber = i + 1;
2294
- startColumn = lines[i].indexOf(key) + 1;
2295
- if (lines[i].includes("{}")) {
2296
- endLineNumber = startLineNumber;
2297
- endColumn = lines[i].indexOf("{}") + 3;
2298
- break;
2299
- }
2300
- const line = lines[i].slice(startColumn + key.length);
2301
- if (line.includes("{") || line.includes("[")) {
2302
- braceCount = 1;
2303
- } else {
2304
- endLineNumber = i + 1;
2305
- endColumn = lines[i].length + 1;
2306
- break;
2307
- }
2308
- } else if (foundKey) {
2309
- braceCount += (lines[i].match(/{/g) || []).length;
2310
- braceCount += (lines[i].match(/\[/g) || []).length;
2311
- braceCount -= (lines[i].match(/}/g) || []).length;
2312
- braceCount -= (lines[i].match(/]/g) || []).length;
2313
- if (braceCount === 0) {
2314
- endLineNumber = i + 1;
2315
- endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2316
- break;
2317
- }
2318
- }
2319
- }
2320
- return {
2321
- startColumn,
2322
- endColumn,
2323
- startLineNumber,
2324
- endLineNumber
2325
- };
2326
- };
2327
- var replaceOctalEscapeSequences = (str) => {
2328
- const octalRegex = /\\([0-7]{1,3})/g;
2329
- return str.replace(octalRegex, (match, p1) => {
2330
- const octalValue = parseInt(p1, 8);
2331
- const char = String.fromCharCode(octalValue);
2332
- return char;
2333
- });
2334
- };
2335
- var customEncodeURIComponent = (str) => {
2336
- return str.split("").map((char) => {
2337
- if (/[^a-zA-Z0-9\s]/.test(char)) {
2338
- return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2339
- }
2340
- return char;
2341
- }).join("");
2342
- };
2343
- var customDecodeURIComponent = (encodedStr) => {
2344
- return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2345
- };
2346
- }
2347
- });
2348
- var require_object2 = __commonJS2({
2349
- "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
2350
- "use strict";
2351
- var __defProp22 = Object.defineProperty;
2352
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2353
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2354
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2355
- var __export22 = (target, all) => {
2356
- for (var name in all)
2357
- __defProp22(target, name, { get: all[name], enumerable: true });
2358
- };
2359
- var __copyProps22 = (to, from, except, desc) => {
2360
- if (from && typeof from === "object" || typeof from === "function") {
2361
- for (let key of __getOwnPropNames22(from))
2362
- if (!__hasOwnProp22.call(to, key) && key !== except)
2363
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2364
- }
2365
- return to;
2366
- };
2367
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2368
- var object_exports = {};
2369
- __export22(object_exports, {
2370
- checkIfKeyIsComponent: () => checkIfKeyIsComponent,
2371
- clone: () => clone,
2372
- createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2373
- deepClone: () => deepClone2,
2374
- deepCloneExclude: () => deepCloneExclude,
2375
- deepCloneWithExtend: () => deepCloneWithExtend,
2376
- deepContains: () => deepContains,
2377
- deepDestringify: () => deepDestringify,
2378
- deepDiff: () => deepDiff,
2379
- deepMerge: () => deepMerge2,
2380
- deepStringify: () => deepStringify,
2381
- detachFunctionsFromObject: () => detachFunctionsFromObject,
2382
- diff: () => diff,
2383
- diffArrays: () => diffArrays,
2384
- diffObjects: () => diffObjects,
2385
- exec: () => exec,
2386
- flattenRecursive: () => flattenRecursive,
2387
- getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2388
- getExtendsInElement: () => getExtendsInElement,
2389
- hasOwnProperty: () => hasOwnProperty,
2390
- isEmpty: () => isEmpty,
2391
- isEmptyObject: () => isEmptyObject,
2392
- isEqualDeep: () => isEqualDeep,
2393
- makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2394
- map: () => map,
2395
- merge: () => merge2,
2396
- mergeArrayExclude: () => mergeArrayExclude,
2397
- mergeIfExisted: () => mergeIfExisted,
2398
- objectToString: () => objectToString,
2399
- overwrite: () => overwrite,
2400
- overwriteDeep: () => overwriteDeep,
2401
- overwriteShallow: () => overwriteShallow,
2402
- removeFromObject: () => removeFromObject,
2403
- stringToObject: () => stringToObject
2404
- });
2405
- module2.exports = __toCommonJS22(object_exports);
2406
- var import_globals2 = require_globals2();
2407
- var import_types = require_types2();
2408
- var import_array = require_array2();
2409
- var import_string = require_string2();
2410
- var exec = (param, element, state, context) => {
2411
- if ((0, import_types.isFunction)(param)) {
2412
- return param(
2413
- element,
2414
- state || element.state,
2415
- context || element.context
2416
- );
2417
- }
2418
- return param;
2419
- };
2420
- var map = (obj, extention, element) => {
2421
- for (const e in extention) {
2422
- obj[e] = exec(extention[e], element);
2423
- }
2424
- };
2425
- var merge2 = (element, obj, excludeFrom = []) => {
2426
- for (const e in obj) {
2427
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2428
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2429
- continue;
2430
- const elementProp = element[e];
2431
- const objProp = obj[e];
2432
- if (elementProp === void 0) {
2433
- element[e] = objProp;
2434
- }
2435
- }
2436
- return element;
2437
- };
2438
- var deepMerge2 = (element, extend, excludeFrom = []) => {
2439
- for (const e in extend) {
2440
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2441
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2442
- continue;
2443
- const elementProp = element[e];
2444
- const extendProp = extend[e];
2445
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2446
- deepMerge2(elementProp, extendProp, excludeFrom);
2447
- } else if (elementProp === void 0) {
2448
- element[e] = extendProp;
2449
- }
2450
- }
2451
- return element;
2452
- };
2453
- var clone = (obj, excludeFrom = []) => {
2454
- const o = {};
2455
- for (const prop in obj) {
2456
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2457
- if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2458
- continue;
2459
- o[prop] = obj[prop];
2460
- }
2461
- return o;
2462
- };
2463
- var deepCloneExclude = (obj, excludeFrom = []) => {
2464
- if ((0, import_types.isArray)(obj)) {
2465
- return obj.map((x) => deepCloneExclude(x, excludeFrom));
2466
- }
2467
- const o = {};
2468
- for (const k in obj) {
2469
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
2470
- if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
2471
- continue;
2472
- let v = obj[k];
2473
- if (k === "extend" && (0, import_types.isArray)(v)) {
2474
- v = mergeArrayExclude(v, excludeFrom);
2475
- }
2476
- if ((0, import_types.isArray)(v)) {
2477
- o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
2478
- } else if ((0, import_types.isObject)(v)) {
2479
- o[k] = deepCloneExclude(v, excludeFrom);
2480
- } else
2481
- o[k] = v;
2482
- }
2483
- return o;
2484
- };
2485
- var mergeArrayExclude = (arr, excl = []) => {
2486
- return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
2487
- };
2488
- var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
2489
- const o = (0, import_types.isArray)(obj) ? [] : {};
2490
- for (const prop in obj) {
2491
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
2492
- continue;
2493
- if (prop === "__proto__")
2494
- continue;
2495
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
2496
- continue;
2497
- let objProp = obj[prop];
2498
- if (cleanUndefined && (0, import_types.isUndefined)(objProp))
2499
- continue;
2500
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
2501
- objProp = (0, import_array.mergeArray)(objProp);
2502
- }
2503
- if ((0, import_types.isObjectLike)(objProp)) {
2504
- o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
2505
- } else
2506
- o[prop] = objProp;
2507
- }
2508
- return o;
2509
- };
2510
- var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2511
- const o = (0, import_types.isArray)(obj) ? [] : {};
2512
- for (const prop in obj) {
2513
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
2514
- continue;
2515
- const objProp = obj[prop];
2516
- if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
2517
- continue;
2518
- if ((0, import_types.isObjectLike)(objProp)) {
2519
- o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
2520
- } else
2521
- o[prop] = objProp;
2522
- }
2523
- return o;
2524
- };
2525
- var deepStringify = (obj, stringified = {}) => {
2526
- for (const prop in obj) {
2527
- const objProp = obj[prop];
2528
- if ((0, import_types.isFunction)(objProp)) {
2529
- stringified[prop] = objProp.toString();
2530
- } else if ((0, import_types.isObject)(objProp)) {
2531
- stringified[prop] = {};
2532
- deepStringify(objProp, stringified[prop]);
2533
- } else if ((0, import_types.isArray)(objProp)) {
2534
- stringified[prop] = [];
2535
- objProp.forEach((v, i) => {
2536
- if ((0, import_types.isObject)(v)) {
2537
- stringified[prop][i] = {};
2538
- deepStringify(v, stringified[prop][i]);
2539
- } else if ((0, import_types.isFunction)(v)) {
2540
- stringified[prop][i] = v.toString();
2541
- } else {
2542
- stringified[prop][i] = v;
2543
- }
2544
- });
2545
- } else {
2546
- stringified[prop] = objProp;
2547
- }
2548
- }
2549
- return stringified;
2550
- };
2551
- var objectToString = (obj = {}, indent = 0) => {
2552
- const spaces = " ".repeat(indent);
2553
- let str = "{\n";
2554
- for (const [key, value] of Object.entries(obj)) {
2555
- const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2556
- const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2557
- str += `${spaces} ${stringedKey}: `;
2558
- if ((0, import_types.isArray)(value)) {
2559
- str += "[\n";
2560
- for (const element of value) {
2561
- if ((0, import_types.isObject)(element) && element !== null) {
2562
- str += `${spaces} ${objectToString(element, indent + 2)},
2563
- `;
2564
- } else if ((0, import_types.isString)(element)) {
2565
- str += `${spaces} '${element}',
2566
- `;
2567
- } else {
2568
- str += `${spaces} ${element},
2569
- `;
2570
- }
1999
+ var require_string2 = __commonJS2({
2000
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports2, module22) {
2001
+ "use strict";
2002
+ var __defProp22 = Object.defineProperty;
2003
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2004
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2005
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2006
+ var __export22 = (target, all) => {
2007
+ for (var name in all)
2008
+ __defProp22(target, name, { get: all[name], enumerable: true });
2009
+ };
2010
+ var __copyProps22 = (to, from, except, desc) => {
2011
+ if (from && typeof from === "object" || typeof from === "function") {
2012
+ for (let key of __getOwnPropNames22(from))
2013
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2014
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2571
2015
  }
2572
- str += `${spaces} ]`;
2573
- } else if ((0, import_types.isObjectLike)(value)) {
2574
- str += objectToString(value, indent + 1);
2575
- } else if ((0, import_types.isString)(value)) {
2576
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2577
- } else {
2578
- str += value;
2579
- }
2580
- str += ",\n";
2581
- }
2582
- str += `${spaces}}`;
2583
- return str;
2584
- };
2585
- var detachFunctionsFromObject = (obj, detached = {}) => {
2586
- for (const prop in obj) {
2587
- const objProp = obj[prop];
2588
- if ((0, import_types.isFunction)(objProp))
2589
- continue;
2590
- else if ((0, import_types.isObject)(objProp)) {
2591
- detached[prop] = {};
2592
- deepStringify(objProp, detached[prop]);
2593
- } else if ((0, import_types.isArray)(objProp)) {
2594
- detached[prop] = [];
2595
- objProp.forEach((v, i) => {
2596
- if ((0, import_types.isFunction)(v))
2597
- return;
2598
- if ((0, import_types.isObject)(v)) {
2599
- detached[prop][i] = {};
2600
- detachFunctionsFromObject(v, detached[prop][i]);
2601
- } else {
2602
- detached[prop][i] = v;
2603
- }
2604
- });
2605
- } else {
2606
- detached[prop] = objProp;
2607
- }
2608
- }
2609
- return detached;
2610
- };
2611
- var deepDestringify = (obj, destringified = {}) => {
2612
- for (const prop in obj) {
2613
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2614
- if (!hasOwnProperty2)
2615
- continue;
2616
- const objProp = obj[prop];
2617
- if ((0, import_types.isString)(objProp)) {
2618
- if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2619
- try {
2620
- const evalProp = import_globals2.window.eval(`(${objProp})`);
2621
- destringified[prop] = evalProp;
2622
- } catch (e) {
2623
- if (e)
2624
- destringified[prop] = objProp;
2016
+ return to;
2017
+ };
2018
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2019
+ var string_exports = {};
2020
+ __export22(string_exports, {
2021
+ customDecodeURIComponent: () => customDecodeURIComponent,
2022
+ customEncodeURIComponent: () => customEncodeURIComponent,
2023
+ decodeNewlines: () => decodeNewlines,
2024
+ encodeNewlines: () => encodeNewlines,
2025
+ findKeyPosition: () => findKeyPosition,
2026
+ lowercaseFirstLetter: () => lowercaseFirstLetter,
2027
+ replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
2028
+ replaceOctalEscapeSequences: () => replaceOctalEscapeSequences,
2029
+ stringIncludesAny: () => stringIncludesAny,
2030
+ trimStringFromSymbols: () => trimStringFromSymbols
2031
+ });
2032
+ module22.exports = __toCommonJS22(string_exports);
2033
+ var stringIncludesAny = (str, characters) => {
2034
+ for (const char of characters) {
2035
+ if (str.includes(char)) {
2036
+ return true;
2625
2037
  }
2626
- } else {
2627
- destringified[prop] = objProp;
2628
2038
  }
2629
- } else if ((0, import_types.isArray)(objProp)) {
2630
- destringified[prop] = [];
2631
- objProp.forEach((arrProp) => {
2632
- if ((0, import_types.isString)(arrProp)) {
2633
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
2634
- try {
2635
- const evalProp = import_globals2.window.eval(`(${arrProp})`);
2636
- destringified[prop].push(evalProp);
2637
- } catch (e) {
2638
- if (e)
2639
- destringified[prop].push(arrProp);
2039
+ return false;
2040
+ };
2041
+ var trimStringFromSymbols = (str, characters) => {
2042
+ const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
2043
+ return str.replace(pattern, "");
2044
+ };
2045
+ var brackRegex = {
2046
+ 2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
2047
+ 3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
2048
+ };
2049
+ var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
2050
+ if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
2051
+ return str;
2052
+ const reg = brackRegex[options.bracketsLength || 2];
2053
+ return str.replace(reg, (_, parentPath, variable) => {
2054
+ if (parentPath) {
2055
+ const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
2056
+ let parentState = state;
2057
+ for (let i = 0; i < parentLevels; i++) {
2058
+ parentState = parentState.parent;
2059
+ if (!parentState) {
2060
+ return "";
2640
2061
  }
2641
- } else {
2642
- destringified[prop].push(arrProp);
2643
2062
  }
2644
- } else if ((0, import_types.isObject)(arrProp)) {
2645
- destringified[prop].push(deepDestringify(arrProp));
2063
+ const value = parentState[variable.trim()];
2064
+ return value !== void 0 ? `${value}` : "";
2646
2065
  } else {
2647
- destringified[prop].push(arrProp);
2648
- }
2649
- });
2650
- } else if ((0, import_types.isObject)(objProp)) {
2651
- destringified[prop] = deepDestringify(objProp, destringified[prop]);
2652
- } else {
2653
- destringified[prop] = objProp;
2654
- }
2655
- }
2656
- return destringified;
2657
- };
2658
- var stringToObject = (str, opts = { verbose: true }) => {
2659
- try {
2660
- return import_globals2.window.eval("(" + str + ")");
2661
- } catch (e) {
2662
- if (opts.verbose)
2663
- console.warn(e);
2664
- }
2665
- };
2666
- var diffObjects = (original, objToDiff, cache) => {
2667
- for (const e in objToDiff) {
2668
- if (e === "ref")
2669
- continue;
2670
- const originalProp = original[e];
2671
- const objToDiffProp = objToDiff[e];
2672
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2673
- cache[e] = {};
2674
- diff(originalProp, objToDiffProp, cache[e]);
2675
- } else if (objToDiffProp !== void 0) {
2676
- cache[e] = objToDiffProp;
2677
- }
2678
- }
2679
- return cache;
2680
- };
2681
- var diffArrays = (original, objToDiff, cache) => {
2682
- if (original.length !== objToDiff.length) {
2683
- cache = objToDiff;
2684
- } else {
2685
- const diffArr = [];
2686
- for (let i = 0; i < original.length; i++) {
2687
- const diffObj = diff(original[i], objToDiff[i]);
2688
- if (Object.keys(diffObj).length > 0) {
2689
- diffArr.push(diffObj);
2690
- }
2691
- }
2692
- if (diffArr.length > 0) {
2693
- cache = diffArr;
2694
- }
2695
- }
2696
- return cache;
2697
- };
2698
- var diff = (original, objToDiff, cache = {}) => {
2699
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2700
- cache = [];
2701
- diffArrays(original, objToDiff, cache);
2702
- } else {
2703
- diffObjects(original, objToDiff, cache);
2704
- }
2705
- return cache;
2706
- };
2707
- var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2708
- var isEmpty = (o) => Object.keys(o).length === 0;
2709
- var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2710
- var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2711
- var deepDiff = (lhs, rhs) => {
2712
- if (lhs === rhs)
2713
- return {};
2714
- if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2715
- return rhs;
2716
- const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2717
- if (!hasOwnProperty(rhs, key)) {
2718
- acc[key] = void 0;
2719
- }
2720
- return acc;
2721
- }, makeObjectWithoutPrototype());
2722
- if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2723
- if (lhs.valueOf() === rhs.valueOf())
2724
- return {};
2725
- return rhs;
2726
- }
2727
- return Object.keys(rhs).reduce((acc, key) => {
2728
- if (!hasOwnProperty(lhs, key)) {
2729
- acc[key] = rhs[key];
2730
- return acc;
2731
- }
2732
- const difference = diff(lhs[key], rhs[key]);
2733
- if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2734
- return acc;
2735
- }
2736
- acc[key] = difference;
2737
- return acc;
2738
- }, deletedValues);
2739
- };
2740
- var overwrite = (element, params, excludeFrom = []) => {
2741
- const { ref } = element;
2742
- const changes = {};
2743
- for (const e in params) {
2744
- if (excludeFrom.includes(e) || e.startsWith("__"))
2745
- continue;
2746
- const elementProp = element[e];
2747
- const paramsProp = params[e];
2748
- if (paramsProp) {
2749
- ref.__cache[e] = changes[e] = elementProp;
2750
- ref[e] = paramsProp;
2751
- }
2752
- }
2753
- return changes;
2754
- };
2755
- var overwriteShallow = (obj, params, excludeFrom = []) => {
2756
- for (const e in params) {
2757
- if (excludeFrom.includes(e) || e.startsWith("__"))
2758
- continue;
2759
- obj[e] = params[e];
2760
- }
2761
- return obj;
2762
- };
2763
- var overwriteDeep = (obj, params, excludeFrom = []) => {
2764
- for (const e in params) {
2765
- if (e === "__proto__")
2766
- continue;
2767
- if (excludeFrom.includes(e) || e.startsWith("__"))
2768
- continue;
2769
- const objProp = obj[e];
2770
- const paramsProp = params[e];
2771
- if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2772
- overwriteDeep(objProp, paramsProp);
2773
- } else if (paramsProp !== void 0) {
2774
- obj[e] = paramsProp;
2775
- }
2776
- }
2777
- return obj;
2778
- };
2779
- var mergeIfExisted = (a, b) => {
2780
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
2781
- return deepMerge2(a, b);
2782
- return a || b;
2783
- };
2784
- var flattenRecursive = (param, prop, stack = []) => {
2785
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
2786
- stack.push(objectized);
2787
- const extendOfExtend = objectized[prop];
2788
- if (extendOfExtend)
2789
- flattenRecursive(extendOfExtend, prop, stack);
2790
- delete objectized[prop];
2791
- return stack;
2792
- };
2793
- var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
2794
- if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
2795
- return param === element;
2796
- }
2797
- if (visited.has(param) || visited.has(element)) {
2798
- return true;
2799
- }
2800
- visited.add(param);
2801
- visited.add(element);
2802
- const keysParam = Object.keys(param);
2803
- const keysElement = Object.keys(element);
2804
- if (keysParam.length !== keysElement.length) {
2805
- return false;
2806
- }
2807
- for (const key of keysParam) {
2808
- if (!keysElement.includes(key)) {
2809
- return false;
2810
- }
2811
- const paramProp = param[key];
2812
- const elementProp = element[key];
2813
- if (!isEqualDeep(paramProp, elementProp, visited)) {
2814
- return false;
2815
- }
2816
- }
2817
- return true;
2818
- };
2819
- var deepContains = (obj1, obj2) => {
2820
- if (typeof obj1 !== typeof obj2) {
2821
- return false;
2066
+ const value = state[variable.trim()];
2067
+ return value !== void 0 ? `${value}` : "";
2068
+ }
2069
+ });
2070
+ };
2071
+ var lowercaseFirstLetter = (inputString) => {
2072
+ return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
2073
+ };
2074
+ var findKeyPosition = (str, key) => {
2075
+ const lines = str.split("\n");
2076
+ let startLineNumber = -1;
2077
+ let endLineNumber = -1;
2078
+ let startColumn = -1;
2079
+ let endColumn = -1;
2080
+ const keyPattern = new RegExp(`\\b${key}\\b\\s*:\\s*`);
2081
+ let braceCount = 0;
2082
+ let foundKey = false;
2083
+ for (let i = 0; i < lines.length; i++) {
2084
+ if (keyPattern.test(lines[i]) && !foundKey) {
2085
+ foundKey = true;
2086
+ startLineNumber = i + 1;
2087
+ startColumn = lines[i].indexOf(key) + 1;
2088
+ if (lines[i].includes("{}")) {
2089
+ endLineNumber = startLineNumber;
2090
+ endColumn = lines[i].indexOf("{}") + 3;
2091
+ break;
2092
+ }
2093
+ const line = lines[i].slice(startColumn + key.length);
2094
+ if (line.includes("{") || line.includes("[")) {
2095
+ braceCount = 1;
2096
+ } else {
2097
+ endLineNumber = i + 1;
2098
+ endColumn = lines[i].length + 1;
2099
+ break;
2100
+ }
2101
+ } else if (foundKey) {
2102
+ braceCount += (lines[i].match(/{/g) || []).length;
2103
+ braceCount += (lines[i].match(/\[/g) || []).length;
2104
+ braceCount -= (lines[i].match(/}/g) || []).length;
2105
+ braceCount -= (lines[i].match(/]/g) || []).length;
2106
+ if (braceCount === 0) {
2107
+ endLineNumber = i + 1;
2108
+ endColumn = lines[i].lastIndexOf("}") !== -1 ? lines[i].lastIndexOf("}") + 2 : lines[i].length + 1;
2109
+ break;
2110
+ }
2111
+ }
2112
+ }
2113
+ return {
2114
+ startColumn,
2115
+ endColumn,
2116
+ startLineNumber,
2117
+ endLineNumber
2118
+ };
2119
+ };
2120
+ var replaceOctalEscapeSequences = (str) => {
2121
+ const octalRegex = /\\([0-7]{1,3})/g;
2122
+ return str.replace(octalRegex, (match, p1) => {
2123
+ const octalValue = parseInt(p1, 8);
2124
+ const char = String.fromCharCode(octalValue);
2125
+ return char;
2126
+ });
2127
+ };
2128
+ var encodeNewlines = (str) => {
2129
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
2130
+ };
2131
+ var decodeNewlines = (encodedStr) => {
2132
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
2133
+ };
2134
+ var customEncodeURIComponent = (str) => {
2135
+ return str.split("").map((char) => {
2136
+ if (/[^a-zA-Z0-9\s]/.test(char)) {
2137
+ return "%" + char.charCodeAt(0).toString(16).toUpperCase();
2138
+ }
2139
+ return char;
2140
+ }).join("");
2141
+ };
2142
+ var customDecodeURIComponent = (encodedStr) => {
2143
+ return encodedStr.replace(/%[0-9A-Fa-f]{2}/g, (match) => String.fromCharCode(parseInt(match.slice(1), 16)));
2144
+ };
2822
2145
  }
2823
- if ((0, import_types.isObjectLike)(obj1)) {
2824
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
2825
- if (obj1.length !== obj2.length) {
2146
+ });
2147
+ var require_object2 = __commonJS2({
2148
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports2, module22) {
2149
+ "use strict";
2150
+ var __defProp22 = Object.defineProperty;
2151
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2152
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2153
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2154
+ var __export22 = (target, all) => {
2155
+ for (var name in all)
2156
+ __defProp22(target, name, { get: all[name], enumerable: true });
2157
+ };
2158
+ var __copyProps22 = (to, from, except, desc) => {
2159
+ if (from && typeof from === "object" || typeof from === "function") {
2160
+ for (let key of __getOwnPropNames22(from))
2161
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2162
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2163
+ }
2164
+ return to;
2165
+ };
2166
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2167
+ var object_exports = {};
2168
+ __export22(object_exports, {
2169
+ checkIfKeyIsComponent: () => checkIfKeyIsComponent,
2170
+ clone: () => clone,
2171
+ createObjectWithoutPrototype: () => createObjectWithoutPrototype,
2172
+ deepClone: () => deepClone2,
2173
+ deepCloneExclude: () => deepCloneExclude,
2174
+ deepCloneWithExtend: () => deepCloneWithExtend,
2175
+ deepContains: () => deepContains,
2176
+ deepDestringify: () => deepDestringify,
2177
+ deepDiff: () => deepDiff,
2178
+ deepMerge: () => deepMerge2,
2179
+ deepStringify: () => deepStringify,
2180
+ detachFunctionsFromObject: () => detachFunctionsFromObject,
2181
+ diff: () => diff,
2182
+ diffArrays: () => diffArrays,
2183
+ diffObjects: () => diffObjects,
2184
+ exec: () => exec,
2185
+ flattenRecursive: () => flattenRecursive,
2186
+ getChildrenComponentsByKey: () => getChildrenComponentsByKey,
2187
+ getExtendsInElement: () => getExtendsInElement,
2188
+ hasOwnProperty: () => hasOwnProperty,
2189
+ isEmpty: () => isEmpty,
2190
+ isEmptyObject: () => isEmptyObject,
2191
+ isEqualDeep: () => isEqualDeep,
2192
+ makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
2193
+ map: () => map,
2194
+ merge: () => merge2,
2195
+ mergeArrayExclude: () => mergeArrayExclude,
2196
+ mergeIfExisted: () => mergeIfExisted,
2197
+ objectToString: () => objectToString,
2198
+ overwrite: () => overwrite,
2199
+ overwriteDeep: () => overwriteDeep,
2200
+ overwriteShallow: () => overwriteShallow,
2201
+ removeFromObject: () => removeFromObject,
2202
+ stringToObject: () => stringToObject
2203
+ });
2204
+ module22.exports = __toCommonJS22(object_exports);
2205
+ var import_globals2 = require_globals2();
2206
+ var import_types = require_types2();
2207
+ var import_array = require_array2();
2208
+ var import_string = require_string2();
2209
+ var exec = (param, element, state, context) => {
2210
+ if ((0, import_types.isFunction)(param)) {
2211
+ return param(
2212
+ element,
2213
+ state || element.state,
2214
+ context || element.context
2215
+ );
2216
+ }
2217
+ return param;
2218
+ };
2219
+ var map = (obj, extention, element) => {
2220
+ for (const e in extention) {
2221
+ obj[e] = exec(extention[e], element);
2222
+ }
2223
+ };
2224
+ var merge2 = (element, obj, excludeFrom = []) => {
2225
+ for (const e in obj) {
2226
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
2227
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2228
+ continue;
2229
+ const elementProp = element[e];
2230
+ const objProp = obj[e];
2231
+ if (elementProp === void 0) {
2232
+ element[e] = objProp;
2233
+ }
2234
+ }
2235
+ return element;
2236
+ };
2237
+ var deepMerge2 = (element, extend, excludeFrom = []) => {
2238
+ for (const e in extend) {
2239
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
2240
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
2241
+ continue;
2242
+ const elementProp = element[e];
2243
+ const extendProp = extend[e];
2244
+ if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
2245
+ deepMerge2(elementProp, extendProp, excludeFrom);
2246
+ } else if (elementProp === void 0) {
2247
+ element[e] = extendProp;
2248
+ }
2249
+ }
2250
+ return element;
2251
+ };
2252
+ var clone = (obj, excludeFrom = []) => {
2253
+ const o = {};
2254
+ for (const prop in obj) {
2255
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2256
+ if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
2257
+ continue;
2258
+ o[prop] = obj[prop];
2259
+ }
2260
+ return o;
2261
+ };
2262
+ var deepCloneExclude = (obj, excludeFrom = []) => {
2263
+ if ((0, import_types.isArray)(obj)) {
2264
+ return obj.map((x) => deepCloneExclude(x, excludeFrom));
2265
+ }
2266
+ const o = {};
2267
+ for (const k in obj) {
2268
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
2269
+ if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
2270
+ continue;
2271
+ let v = obj[k];
2272
+ if (k === "extend" && (0, import_types.isArray)(v)) {
2273
+ v = mergeArrayExclude(v, excludeFrom);
2274
+ }
2275
+ if ((0, import_types.isArray)(v)) {
2276
+ o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
2277
+ } else if ((0, import_types.isObject)(v)) {
2278
+ o[k] = deepCloneExclude(v, excludeFrom);
2279
+ } else
2280
+ o[k] = v;
2281
+ }
2282
+ return o;
2283
+ };
2284
+ var mergeArrayExclude = (arr, excl = []) => {
2285
+ return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
2286
+ };
2287
+ var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
2288
+ const o = (0, import_types.isArray)(obj) ? [] : {};
2289
+ for (const prop in obj) {
2290
+ if (!Object.prototype.hasOwnProperty.call(obj, prop))
2291
+ continue;
2292
+ if (prop === "__proto__")
2293
+ continue;
2294
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
2295
+ continue;
2296
+ let objProp = obj[prop];
2297
+ if (cleanUndefined && (0, import_types.isUndefined)(objProp))
2298
+ continue;
2299
+ if (prop === "extend" && (0, import_types.isArray)(objProp)) {
2300
+ objProp = (0, import_array.mergeArray)(objProp);
2301
+ }
2302
+ if ((0, import_types.isObjectLike)(objProp)) {
2303
+ o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
2304
+ } else
2305
+ o[prop] = objProp;
2306
+ }
2307
+ return o;
2308
+ };
2309
+ var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2310
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
2311
+ for (const prop in obj) {
2312
+ if (!Object.prototype.hasOwnProperty.call(obj, prop))
2313
+ continue;
2314
+ const objProp = obj[prop];
2315
+ if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
2316
+ continue;
2317
+ if ((0, import_types.isObjectLike)(objProp)) {
2318
+ o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
2319
+ } else
2320
+ o[prop] = objProp;
2321
+ }
2322
+ return o;
2323
+ };
2324
+ var deepStringify = (obj, stringified = {}) => {
2325
+ for (const prop in obj) {
2326
+ const objProp = obj[prop];
2327
+ if ((0, import_types.isFunction)(objProp)) {
2328
+ stringified[prop] = objProp.toString();
2329
+ } else if ((0, import_types.isObject)(objProp)) {
2330
+ stringified[prop] = {};
2331
+ deepStringify(objProp, stringified[prop]);
2332
+ } else if ((0, import_types.isArray)(objProp)) {
2333
+ stringified[prop] = [];
2334
+ objProp.forEach((v, i) => {
2335
+ if ((0, import_types.isObject)(v)) {
2336
+ stringified[prop][i] = {};
2337
+ deepStringify(v, stringified[prop][i]);
2338
+ } else if ((0, import_types.isFunction)(v)) {
2339
+ stringified[prop][i] = v.toString();
2340
+ } else {
2341
+ stringified[prop][i] = v;
2342
+ }
2343
+ });
2344
+ } else {
2345
+ stringified[prop] = objProp;
2346
+ }
2347
+ }
2348
+ return stringified;
2349
+ };
2350
+ var objectToString = (obj = {}, indent = 0) => {
2351
+ const spaces = " ".repeat(indent);
2352
+ let str = "{\n";
2353
+ for (const [key, value] of Object.entries(obj)) {
2354
+ const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
2355
+ const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
2356
+ str += `${spaces} ${stringedKey}: `;
2357
+ if ((0, import_types.isArray)(value)) {
2358
+ str += "[\n";
2359
+ for (const element of value) {
2360
+ if ((0, import_types.isObject)(element) && element !== null) {
2361
+ str += `${spaces} ${objectToString(element, indent + 2)},
2362
+ `;
2363
+ } else if ((0, import_types.isString)(element)) {
2364
+ str += `${spaces} '${element}',
2365
+ `;
2366
+ } else {
2367
+ str += `${spaces} ${element},
2368
+ `;
2369
+ }
2370
+ }
2371
+ str += `${spaces} ]`;
2372
+ } else if ((0, import_types.isObjectLike)(value)) {
2373
+ str += objectToString(value, indent + 1);
2374
+ } else if ((0, import_types.isString)(value)) {
2375
+ str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
2376
+ } else {
2377
+ str += value;
2378
+ }
2379
+ str += ",\n";
2380
+ }
2381
+ str += `${spaces}}`;
2382
+ return str;
2383
+ };
2384
+ var detachFunctionsFromObject = (obj, detached = {}) => {
2385
+ for (const prop in obj) {
2386
+ const objProp = obj[prop];
2387
+ if ((0, import_types.isFunction)(objProp))
2388
+ continue;
2389
+ else if ((0, import_types.isObject)(objProp)) {
2390
+ detached[prop] = {};
2391
+ deepStringify(objProp, detached[prop]);
2392
+ } else if ((0, import_types.isArray)(objProp)) {
2393
+ detached[prop] = [];
2394
+ objProp.forEach((v, i) => {
2395
+ if ((0, import_types.isFunction)(v))
2396
+ return;
2397
+ if ((0, import_types.isObject)(v)) {
2398
+ detached[prop][i] = {};
2399
+ detachFunctionsFromObject(v, detached[prop][i]);
2400
+ } else {
2401
+ detached[prop][i] = v;
2402
+ }
2403
+ });
2404
+ } else {
2405
+ detached[prop] = objProp;
2406
+ }
2407
+ }
2408
+ return detached;
2409
+ };
2410
+ var deepDestringify = (obj, destringified = {}) => {
2411
+ for (const prop in obj) {
2412
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
2413
+ if (!hasOwnProperty2)
2414
+ continue;
2415
+ const objProp = obj[prop];
2416
+ if ((0, import_types.isString)(objProp)) {
2417
+ if ((objProp.includes("(){") || objProp.includes("() {") || objProp.includes("=>") || objProp.startsWith("()") || objProp.startsWith("async") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
2418
+ try {
2419
+ const evalProp = import_globals2.window.eval(`(${objProp})`);
2420
+ destringified[prop] = evalProp;
2421
+ } catch (e) {
2422
+ if (e)
2423
+ destringified[prop] = objProp;
2424
+ }
2425
+ } else {
2426
+ destringified[prop] = objProp;
2427
+ }
2428
+ } else if ((0, import_types.isArray)(objProp)) {
2429
+ destringified[prop] = [];
2430
+ objProp.forEach((arrProp) => {
2431
+ if ((0, import_types.isString)(arrProp)) {
2432
+ if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
2433
+ try {
2434
+ const evalProp = import_globals2.window.eval(`(${arrProp})`);
2435
+ destringified[prop].push(evalProp);
2436
+ } catch (e) {
2437
+ if (e)
2438
+ destringified[prop].push(arrProp);
2439
+ }
2440
+ } else {
2441
+ destringified[prop].push(arrProp);
2442
+ }
2443
+ } else if ((0, import_types.isObject)(arrProp)) {
2444
+ destringified[prop].push(deepDestringify(arrProp));
2445
+ } else {
2446
+ destringified[prop].push(arrProp);
2447
+ }
2448
+ });
2449
+ } else if ((0, import_types.isObject)(objProp)) {
2450
+ destringified[prop] = deepDestringify(objProp, destringified[prop]);
2451
+ } else {
2452
+ destringified[prop] = objProp;
2453
+ }
2454
+ }
2455
+ return destringified;
2456
+ };
2457
+ var stringToObject = (str, opts = { verbose: true }) => {
2458
+ try {
2459
+ return import_globals2.window.eval("(" + str + ")");
2460
+ } catch (e) {
2461
+ if (opts.verbose)
2462
+ console.warn(e);
2463
+ }
2464
+ };
2465
+ var diffObjects = (original, objToDiff, cache) => {
2466
+ for (const e in objToDiff) {
2467
+ if (e === "ref")
2468
+ continue;
2469
+ const originalProp = original[e];
2470
+ const objToDiffProp = objToDiff[e];
2471
+ if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
2472
+ cache[e] = {};
2473
+ diff(originalProp, objToDiffProp, cache[e]);
2474
+ } else if (objToDiffProp !== void 0) {
2475
+ cache[e] = objToDiffProp;
2476
+ }
2477
+ }
2478
+ return cache;
2479
+ };
2480
+ var diffArrays = (original, objToDiff, cache) => {
2481
+ if (original.length !== objToDiff.length) {
2482
+ cache = objToDiff;
2483
+ } else {
2484
+ const diffArr = [];
2485
+ for (let i = 0; i < original.length; i++) {
2486
+ const diffObj = diff(original[i], objToDiff[i]);
2487
+ if (Object.keys(diffObj).length > 0) {
2488
+ diffArr.push(diffObj);
2489
+ }
2490
+ }
2491
+ if (diffArr.length > 0) {
2492
+ cache = diffArr;
2493
+ }
2494
+ }
2495
+ return cache;
2496
+ };
2497
+ var diff = (original, objToDiff, cache = {}) => {
2498
+ if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
2499
+ cache = [];
2500
+ diffArrays(original, objToDiff, cache);
2501
+ } else {
2502
+ diffObjects(original, objToDiff, cache);
2503
+ }
2504
+ return cache;
2505
+ };
2506
+ var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
2507
+ var isEmpty = (o) => Object.keys(o).length === 0;
2508
+ var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
2509
+ var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
2510
+ var deepDiff = (lhs, rhs) => {
2511
+ if (lhs === rhs)
2512
+ return {};
2513
+ if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
2514
+ return rhs;
2515
+ const deletedValues = Object.keys(lhs).reduce((acc, key) => {
2516
+ if (!hasOwnProperty(rhs, key)) {
2517
+ acc[key] = void 0;
2518
+ }
2519
+ return acc;
2520
+ }, makeObjectWithoutPrototype());
2521
+ if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
2522
+ if (lhs.valueOf() === rhs.valueOf())
2523
+ return {};
2524
+ return rhs;
2525
+ }
2526
+ return Object.keys(rhs).reduce((acc, key) => {
2527
+ if (!hasOwnProperty(lhs, key)) {
2528
+ acc[key] = rhs[key];
2529
+ return acc;
2530
+ }
2531
+ const difference = diff(lhs[key], rhs[key]);
2532
+ if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
2533
+ return acc;
2534
+ }
2535
+ acc[key] = difference;
2536
+ return acc;
2537
+ }, deletedValues);
2538
+ };
2539
+ var overwrite = (element, params, excludeFrom = []) => {
2540
+ const { ref } = element;
2541
+ const changes = {};
2542
+ for (const e in params) {
2543
+ if (excludeFrom.includes(e) || e.startsWith("__"))
2544
+ continue;
2545
+ const elementProp = element[e];
2546
+ const paramsProp = params[e];
2547
+ if (paramsProp) {
2548
+ ref.__cache[e] = changes[e] = elementProp;
2549
+ ref[e] = paramsProp;
2550
+ }
2551
+ }
2552
+ return changes;
2553
+ };
2554
+ var overwriteShallow = (obj, params, excludeFrom = []) => {
2555
+ for (const e in params) {
2556
+ if (excludeFrom.includes(e) || e.startsWith("__"))
2557
+ continue;
2558
+ obj[e] = params[e];
2559
+ }
2560
+ return obj;
2561
+ };
2562
+ var overwriteDeep = (obj, params, excludeFrom = []) => {
2563
+ for (const e in params) {
2564
+ if (e === "__ref")
2565
+ continue;
2566
+ if (excludeFrom.includes(e) || e.startsWith("__"))
2567
+ continue;
2568
+ const objProp = obj[e];
2569
+ const paramsProp = params[e];
2570
+ if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2571
+ overwriteDeep(objProp, paramsProp);
2572
+ } else if (paramsProp !== void 0) {
2573
+ obj[e] = paramsProp;
2574
+ }
2575
+ }
2576
+ return obj;
2577
+ };
2578
+ var mergeIfExisted = (a, b) => {
2579
+ if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
2580
+ return deepMerge2(a, b);
2581
+ return a || b;
2582
+ };
2583
+ var flattenRecursive = (param, prop, stack = []) => {
2584
+ const objectized = (0, import_array.mergeAndCloneIfArray)(param);
2585
+ stack.push(objectized);
2586
+ const extendOfExtend = objectized[prop];
2587
+ if (extendOfExtend)
2588
+ flattenRecursive(extendOfExtend, prop, stack);
2589
+ delete objectized[prop];
2590
+ return stack;
2591
+ };
2592
+ var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
2593
+ if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
2594
+ return param === element;
2595
+ }
2596
+ if (visited.has(param) || visited.has(element)) {
2597
+ return true;
2598
+ }
2599
+ visited.add(param);
2600
+ visited.add(element);
2601
+ const keysParam = Object.keys(param);
2602
+ const keysElement = Object.keys(element);
2603
+ if (keysParam.length !== keysElement.length) {
2826
2604
  return false;
2827
2605
  }
2828
- for (let i = 0; i < obj1.length; i++) {
2829
- if (!deepContains(obj1[i], obj2[i])) {
2606
+ for (const key of keysParam) {
2607
+ if (!keysElement.includes(key)) {
2830
2608
  return false;
2831
2609
  }
2832
- }
2833
- } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
2834
- for (const key in obj1) {
2835
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
2836
- if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
2610
+ const paramProp = param[key];
2611
+ const elementProp = element[key];
2612
+ if (!isEqualDeep(paramProp, elementProp, visited)) {
2837
2613
  return false;
2838
2614
  }
2839
2615
  }
2840
- }
2841
- } else {
2842
- return obj2 === obj1;
2843
- }
2844
- return true;
2845
- };
2846
- var removeFromObject = (obj, props) => {
2847
- if (props === void 0 || props === null)
2848
- return obj;
2849
- if ((0, import_types.is)(props)("string", "number")) {
2850
- delete obj[props];
2851
- } else if ((0, import_types.isArray)(props)) {
2852
- props.forEach((prop) => delete obj[prop]);
2853
- } else {
2854
- throw new Error("Invalid input: props must be a string or an array of strings");
2855
- }
2856
- return obj;
2857
- };
2858
- var createObjectWithoutPrototype = (obj) => {
2859
- if (obj === null || typeof obj !== "object") {
2860
- return obj;
2861
- }
2862
- const newObj = /* @__PURE__ */ Object.create(null);
2863
- for (const key in obj) {
2864
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
2865
- newObj[key] = createObjectWithoutPrototype(obj[key]);
2866
- }
2867
- }
2868
- return newObj;
2869
- };
2870
- var checkIfKeyIsComponent = (key) => {
2871
- const isFirstKeyString = (0, import_types.isString)(key);
2872
- if (!isFirstKeyString)
2873
- return;
2874
- const firstCharKey = key.slice(0, 1);
2875
- return /^[A-Z]*$/.test(firstCharKey);
2876
- };
2877
- var getChildrenComponentsByKey = (key, el) => {
2878
- if (key === el.key || el.__ref.__componentKey === key) {
2879
- return el;
2880
- }
2881
- if (el.extend) {
2882
- const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
2883
- const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
2884
- if (foundString || foundInArray)
2885
- return el;
2886
- }
2887
- };
2888
- var getExtendsInElement = (obj) => {
2889
- let result = [];
2890
- function traverse(o) {
2891
- for (const key in o) {
2892
- if (Object.hasOwnProperty.call(o, key)) {
2893
- if (checkIfKeyIsComponent(key)) {
2894
- result.push(key);
2895
- }
2896
- if (key === "extend") {
2897
- if (typeof o[key] === "string") {
2898
- result.push(o[key]);
2899
- } else if (Array.isArray(o[key])) {
2900
- result = result.concat(o[key]);
2616
+ return true;
2617
+ };
2618
+ var deepContains = (obj1, obj2) => {
2619
+ if (typeof obj1 !== typeof obj2) {
2620
+ return false;
2621
+ }
2622
+ if ((0, import_types.isObjectLike)(obj1)) {
2623
+ if (Array.isArray(obj1) && Array.isArray(obj2)) {
2624
+ if (obj1.length !== obj2.length) {
2625
+ return false;
2626
+ }
2627
+ for (let i = 0; i < obj1.length; i++) {
2628
+ if (!deepContains(obj1[i], obj2[i])) {
2629
+ return false;
2630
+ }
2631
+ }
2632
+ } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
2633
+ for (const key in obj1) {
2634
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
2635
+ if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
2636
+ return false;
2637
+ }
2901
2638
  }
2902
2639
  }
2903
- if (typeof o[key] === "object" && o[key] !== null) {
2904
- traverse(o[key]);
2640
+ } else {
2641
+ return obj2 === obj1;
2642
+ }
2643
+ return true;
2644
+ };
2645
+ var removeFromObject = (obj, props) => {
2646
+ if (props === void 0 || props === null)
2647
+ return obj;
2648
+ if ((0, import_types.is)(props)("string", "number")) {
2649
+ delete obj[props];
2650
+ } else if ((0, import_types.isArray)(props)) {
2651
+ props.forEach((prop) => delete obj[prop]);
2652
+ } else {
2653
+ throw new Error("Invalid input: props must be a string or an array of strings");
2654
+ }
2655
+ return obj;
2656
+ };
2657
+ var createObjectWithoutPrototype = (obj) => {
2658
+ if (obj === null || typeof obj !== "object") {
2659
+ return obj;
2660
+ }
2661
+ const newObj = /* @__PURE__ */ Object.create(null);
2662
+ for (const key in obj) {
2663
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
2664
+ newObj[key] = createObjectWithoutPrototype(obj[key]);
2905
2665
  }
2906
2666
  }
2907
- }
2908
- }
2909
- traverse(obj);
2910
- return result;
2911
- };
2912
- }
2913
- });
2914
- var require_function2 = __commonJS2({
2915
- "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
2916
- "use strict";
2917
- var __defProp22 = Object.defineProperty;
2918
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2919
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2920
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2921
- var __export22 = (target, all) => {
2922
- for (var name in all)
2923
- __defProp22(target, name, { get: all[name], enumerable: true });
2924
- };
2925
- var __copyProps22 = (to, from, except, desc) => {
2926
- if (from && typeof from === "object" || typeof from === "function") {
2927
- for (let key of __getOwnPropNames22(from))
2928
- if (!__hasOwnProp22.call(to, key) && key !== except)
2929
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2667
+ return newObj;
2668
+ };
2669
+ var checkIfKeyIsComponent = (key) => {
2670
+ const isFirstKeyString = (0, import_types.isString)(key);
2671
+ if (!isFirstKeyString)
2672
+ return;
2673
+ const firstCharKey = key.slice(0, 1);
2674
+ return /^[A-Z]*$/.test(firstCharKey);
2675
+ };
2676
+ var getChildrenComponentsByKey = (key, el) => {
2677
+ if (key === el.key || el.__ref.__componentKey === key) {
2678
+ return el;
2679
+ }
2680
+ if (el.extend) {
2681
+ const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
2682
+ const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
2683
+ if (foundString || foundInArray)
2684
+ return el;
2685
+ }
2686
+ if (el.parent && el.parent.childExtend) {
2687
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
2688
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
2689
+ if (foundString || foundInArray)
2690
+ return el;
2691
+ }
2692
+ };
2693
+ var getExtendsInElement = (obj) => {
2694
+ let result = [];
2695
+ function traverse(o) {
2696
+ for (const key in o) {
2697
+ if (Object.hasOwnProperty.call(o, key)) {
2698
+ if (checkIfKeyIsComponent(key)) {
2699
+ result.push(key);
2700
+ }
2701
+ if (key === "extend") {
2702
+ if (typeof o[key] === "string") {
2703
+ result.push(o[key]);
2704
+ } else if (Array.isArray(o[key])) {
2705
+ result = result.concat(o[key]);
2706
+ }
2707
+ }
2708
+ if (typeof o[key] === "object" && o[key] !== null) {
2709
+ traverse(o[key]);
2710
+ }
2711
+ }
2712
+ }
2713
+ }
2714
+ traverse(obj);
2715
+ return result;
2716
+ };
2930
2717
  }
2931
- return to;
2932
- };
2933
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2934
- var function_exports = {};
2935
- __export22(function_exports, {
2936
- debounce: () => debounce,
2937
- debounceOnContext: () => debounceOnContext,
2938
- isStringFunction: () => isStringFunction,
2939
- memoize: () => memoize
2940
2718
  });
2941
- module2.exports = __toCommonJS22(function_exports);
2942
- function debounce(func, wait, immediate) {
2943
- let timeout;
2944
- return function() {
2945
- const context = this;
2946
- const args = arguments;
2947
- const later = function() {
2948
- timeout = null;
2949
- if (!immediate)
2950
- func.apply(context, args);
2719
+ var require_function2 = __commonJS2({
2720
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports2, module22) {
2721
+ "use strict";
2722
+ var __defProp22 = Object.defineProperty;
2723
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2724
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2725
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2726
+ var __export22 = (target, all) => {
2727
+ for (var name in all)
2728
+ __defProp22(target, name, { get: all[name], enumerable: true });
2951
2729
  };
2952
- const callNow = immediate && !timeout;
2953
- clearTimeout(timeout);
2954
- timeout = setTimeout(later, wait);
2955
- if (callNow)
2956
- func.apply(context, args);
2957
- };
2958
- }
2959
- var debounceOnContext = (element, func, timeout = 300) => {
2960
- let timer;
2961
- return (...args) => {
2962
- clearTimeout(timer);
2963
- timer = setTimeout(() => {
2964
- func.apply(element, args);
2965
- }, timeout);
2966
- };
2967
- };
2968
- var memoize = (fn) => {
2969
- const cache = {};
2970
- return (...args) => {
2971
- const n = args[0];
2972
- if (n in cache) {
2973
- return cache[n];
2974
- } else {
2975
- const result = fn(n);
2976
- cache[n] = result;
2977
- return result;
2730
+ var __copyProps22 = (to, from, except, desc) => {
2731
+ if (from && typeof from === "object" || typeof from === "function") {
2732
+ for (let key of __getOwnPropNames22(from))
2733
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2734
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2735
+ }
2736
+ return to;
2737
+ };
2738
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2739
+ var function_exports = {};
2740
+ __export22(function_exports, {
2741
+ debounce: () => debounce,
2742
+ debounceOnContext: () => debounceOnContext,
2743
+ isStringFunction: () => isStringFunction,
2744
+ memoize: () => memoize
2745
+ });
2746
+ module22.exports = __toCommonJS22(function_exports);
2747
+ function debounce(func, wait, immediate) {
2748
+ let timeout;
2749
+ return function() {
2750
+ const context = this;
2751
+ const args = arguments;
2752
+ const later = function() {
2753
+ timeout = null;
2754
+ if (!immediate)
2755
+ func.apply(context, args);
2756
+ };
2757
+ const callNow = immediate && !timeout;
2758
+ clearTimeout(timeout);
2759
+ timeout = setTimeout(later, wait);
2760
+ if (callNow)
2761
+ func.apply(context, args);
2762
+ };
2978
2763
  }
2979
- };
2980
- };
2981
- var isStringFunction = (inputString) => {
2982
- const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
2983
- return functionRegex.test(inputString);
2984
- };
2985
- }
2986
- });
2987
- var require_log2 = __commonJS2({
2988
- "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
2989
- "use strict";
2990
- var __defProp22 = Object.defineProperty;
2991
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2992
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
2993
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2994
- var __export22 = (target, all) => {
2995
- for (var name in all)
2996
- __defProp22(target, name, { get: all[name], enumerable: true });
2997
- };
2998
- var __copyProps22 = (to, from, except, desc) => {
2999
- if (from && typeof from === "object" || typeof from === "function") {
3000
- for (let key of __getOwnPropNames22(from))
3001
- if (!__hasOwnProp22.call(to, key) && key !== except)
3002
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2764
+ var debounceOnContext = (element, func, timeout = 300) => {
2765
+ let timer;
2766
+ return (...args) => {
2767
+ clearTimeout(timer);
2768
+ timer = setTimeout(() => {
2769
+ func.apply(element, args);
2770
+ }, timeout);
2771
+ };
2772
+ };
2773
+ var memoize = (fn) => {
2774
+ const cache = {};
2775
+ return (...args) => {
2776
+ const n = args[0];
2777
+ if (n in cache) {
2778
+ return cache[n];
2779
+ } else {
2780
+ const result = fn(n);
2781
+ cache[n] = result;
2782
+ return result;
2783
+ }
2784
+ };
2785
+ };
2786
+ var isStringFunction = (inputString) => {
2787
+ const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
2788
+ return functionRegex.test(inputString);
2789
+ };
3003
2790
  }
3004
- return to;
3005
- };
3006
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3007
- var log_exports = {};
3008
- __export22(log_exports, {
3009
- logGroupIf: () => logGroupIf,
3010
- logIf: () => logIf
3011
2791
  });
3012
- module2.exports = __toCommonJS22(log_exports);
3013
- var logIf = (bool, ...arg) => {
3014
- if (bool)
3015
- arg.map((v) => console.log(v));
3016
- };
3017
- var logGroupIf = (bool, key, ...arg) => {
3018
- if (bool) {
3019
- console.group(key);
3020
- arg.map((v) => console.log(v));
3021
- console.groupEnd(key);
2792
+ var require_log2 = __commonJS2({
2793
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports2, module22) {
2794
+ "use strict";
2795
+ var __defProp22 = Object.defineProperty;
2796
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2797
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2798
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2799
+ var __export22 = (target, all) => {
2800
+ for (var name in all)
2801
+ __defProp22(target, name, { get: all[name], enumerable: true });
2802
+ };
2803
+ var __copyProps22 = (to, from, except, desc) => {
2804
+ if (from && typeof from === "object" || typeof from === "function") {
2805
+ for (let key of __getOwnPropNames22(from))
2806
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2807
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2808
+ }
2809
+ return to;
2810
+ };
2811
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2812
+ var log_exports = {};
2813
+ __export22(log_exports, {
2814
+ logGroupIf: () => logGroupIf,
2815
+ logIf: () => logIf
2816
+ });
2817
+ module22.exports = __toCommonJS22(log_exports);
2818
+ var logIf = (bool, ...arg) => {
2819
+ if (bool)
2820
+ arg.map((v) => console.log(v));
2821
+ };
2822
+ var logGroupIf = (bool, key, ...arg) => {
2823
+ if (bool) {
2824
+ console.group(key);
2825
+ arg.map((v) => console.log(v));
2826
+ console.groupEnd(key);
2827
+ }
2828
+ };
3022
2829
  }
3023
- };
3024
- }
3025
- });
3026
- var require_cookie2 = __commonJS2({
3027
- "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
3028
- "use strict";
3029
- var __defProp22 = Object.defineProperty;
3030
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3031
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3032
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3033
- var __export22 = (target, all) => {
3034
- for (var name in all)
3035
- __defProp22(target, name, { get: all[name], enumerable: true });
3036
- };
3037
- var __copyProps22 = (to, from, except, desc) => {
3038
- if (from && typeof from === "object" || typeof from === "function") {
3039
- for (let key of __getOwnPropNames22(from))
3040
- if (!__hasOwnProp22.call(to, key) && key !== except)
3041
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2830
+ });
2831
+ var require_cookie2 = __commonJS2({
2832
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports2, module22) {
2833
+ "use strict";
2834
+ var __defProp22 = Object.defineProperty;
2835
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2836
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2837
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2838
+ var __export22 = (target, all) => {
2839
+ for (var name in all)
2840
+ __defProp22(target, name, { get: all[name], enumerable: true });
2841
+ };
2842
+ var __copyProps22 = (to, from, except, desc) => {
2843
+ if (from && typeof from === "object" || typeof from === "function") {
2844
+ for (let key of __getOwnPropNames22(from))
2845
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2846
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2847
+ }
2848
+ return to;
2849
+ };
2850
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2851
+ var cookie_exports = {};
2852
+ __export22(cookie_exports, {
2853
+ getCookie: () => getCookie,
2854
+ isMobile: () => isMobile,
2855
+ setCookie: () => setCookie
2856
+ });
2857
+ module22.exports = __toCommonJS22(cookie_exports);
2858
+ var import_types = require_types2();
2859
+ var import_utils32 = require_cjs4();
2860
+ var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
2861
+ var setCookie = (cname, cvalue, exdays = 365) => {
2862
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2863
+ return;
2864
+ const d = /* @__PURE__ */ new Date();
2865
+ d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
2866
+ const expires = `expires=${d.toUTCString()}`;
2867
+ import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
2868
+ };
2869
+ var getCookie = (cname) => {
2870
+ if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
2871
+ return;
2872
+ const name = `${cname}=`;
2873
+ const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
2874
+ const ca = decodedCookie.split(";");
2875
+ for (let i = 0; i < ca.length; i++) {
2876
+ let c = ca[i];
2877
+ while (c.charAt(0) === " ")
2878
+ c = c.substring(1);
2879
+ if (c.indexOf(name) === 0)
2880
+ return c.substring(name.length, c.length);
2881
+ }
2882
+ return "";
2883
+ };
3042
2884
  }
3043
- return to;
3044
- };
3045
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3046
- var cookie_exports = {};
3047
- __export22(cookie_exports, {
3048
- getCookie: () => getCookie,
3049
- isMobile: () => isMobile,
3050
- setCookie: () => setCookie
3051
2885
  });
3052
- module2.exports = __toCommonJS22(cookie_exports);
3053
- var import_types = require_types2();
3054
- var import_utils32 = require_cjs3();
3055
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
3056
- var setCookie = (cname, cvalue, exdays = 365) => {
3057
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3058
- return;
3059
- const d = /* @__PURE__ */ new Date();
3060
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
3061
- const expires = `expires=${d.toUTCString()}`;
3062
- import_utils32.document.cookie = `${cname}=${cvalue};${expires};path=/`;
3063
- };
3064
- var getCookie = (cname) => {
3065
- if ((0, import_types.isUndefined)(import_utils32.document) || (0, import_types.isUndefined)(import_utils32.document.cookie))
3066
- return;
3067
- const name = `${cname}=`;
3068
- const decodedCookie = decodeURIComponent(import_utils32.document.cookie);
3069
- const ca = decodedCookie.split(";");
3070
- for (let i = 0; i < ca.length; i++) {
3071
- let c = ca[i];
3072
- while (c.charAt(0) === " ")
3073
- c = c.substring(1);
3074
- if (c.indexOf(name) === 0)
3075
- return c.substring(name.length, c.length);
2886
+ var require_tags2 = __commonJS2({
2887
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports2, module22) {
2888
+ "use strict";
2889
+ var __defProp22 = Object.defineProperty;
2890
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
2891
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
2892
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
2893
+ var __export22 = (target, all) => {
2894
+ for (var name in all)
2895
+ __defProp22(target, name, { get: all[name], enumerable: true });
2896
+ };
2897
+ var __copyProps22 = (to, from, except, desc) => {
2898
+ if (from && typeof from === "object" || typeof from === "function") {
2899
+ for (let key of __getOwnPropNames22(from))
2900
+ if (!__hasOwnProp22.call(to, key) && key !== except)
2901
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
2902
+ }
2903
+ return to;
2904
+ };
2905
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
2906
+ var tags_exports = {};
2907
+ __export22(tags_exports, {
2908
+ HTML_TAGS: () => HTML_TAGS,
2909
+ isValidHtmlTag: () => isValidHtmlTag
2910
+ });
2911
+ module22.exports = __toCommonJS22(tags_exports);
2912
+ var HTML_TAGS = {
2913
+ root: [
2914
+ "body",
2915
+ "html"
2916
+ ],
2917
+ head: [
2918
+ "title",
2919
+ "base",
2920
+ "meta",
2921
+ "style"
2922
+ ],
2923
+ body: [
2924
+ "string",
2925
+ "fragment",
2926
+ "a",
2927
+ "abbr",
2928
+ "acronym",
2929
+ "address",
2930
+ "applet",
2931
+ "area",
2932
+ "article",
2933
+ "aside",
2934
+ "audio",
2935
+ "b",
2936
+ "basefont",
2937
+ "bdi",
2938
+ "bdo",
2939
+ "big",
2940
+ "blockquote",
2941
+ "br",
2942
+ "button",
2943
+ "canvas",
2944
+ "caption",
2945
+ "center",
2946
+ "cite",
2947
+ "code",
2948
+ "search",
2949
+ "col",
2950
+ "colgroup",
2951
+ "data",
2952
+ "datalist",
2953
+ "dd",
2954
+ "del",
2955
+ "details",
2956
+ "dfn",
2957
+ "dialog",
2958
+ "dir",
2959
+ "div",
2960
+ "dl",
2961
+ "dt",
2962
+ "em",
2963
+ "embed",
2964
+ "fieldset",
2965
+ "figcaption",
2966
+ "figure",
2967
+ "font",
2968
+ "footer",
2969
+ "form",
2970
+ "frame",
2971
+ "frameset",
2972
+ "h1",
2973
+ "h2",
2974
+ "h3",
2975
+ "h4",
2976
+ "h5",
2977
+ "h6",
2978
+ "head",
2979
+ "header",
2980
+ "hr",
2981
+ "i",
2982
+ "iframe",
2983
+ "img",
2984
+ "input",
2985
+ "ins",
2986
+ "kbd",
2987
+ "label",
2988
+ "legend",
2989
+ "li",
2990
+ "link",
2991
+ "main",
2992
+ "map",
2993
+ "mark",
2994
+ "meter",
2995
+ "nav",
2996
+ "noframes",
2997
+ "noscript",
2998
+ "object",
2999
+ "ol",
3000
+ "optgroup",
3001
+ "option",
3002
+ "output",
3003
+ "p",
3004
+ "param",
3005
+ "picture",
3006
+ "pre",
3007
+ "progress",
3008
+ "hgroup",
3009
+ "q",
3010
+ "rp",
3011
+ "rt",
3012
+ "ruby",
3013
+ "s",
3014
+ "samp",
3015
+ "script",
3016
+ "section",
3017
+ "select",
3018
+ "small",
3019
+ "source",
3020
+ "span",
3021
+ "strike",
3022
+ "strong",
3023
+ "sub",
3024
+ "summary",
3025
+ "sup",
3026
+ "table",
3027
+ "tbody",
3028
+ "td",
3029
+ "template",
3030
+ "hgroup",
3031
+ "textarea",
3032
+ "tfoot",
3033
+ "th",
3034
+ "thead",
3035
+ "time",
3036
+ "tr",
3037
+ "track",
3038
+ "tt",
3039
+ "u",
3040
+ "ul",
3041
+ "var",
3042
+ "video",
3043
+ "wbr",
3044
+ // SVG
3045
+ "svg",
3046
+ "path"
3047
+ ]
3048
+ };
3049
+ var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
3076
3050
  }
3077
- return "";
3078
- };
3079
- }
3080
- });
3081
- var require_tags2 = __commonJS2({
3082
- "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
3083
- "use strict";
3084
- var __defProp22 = Object.defineProperty;
3085
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3086
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3087
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3088
- var __export22 = (target, all) => {
3089
- for (var name in all)
3090
- __defProp22(target, name, { get: all[name], enumerable: true });
3091
- };
3092
- var __copyProps22 = (to, from, except, desc) => {
3093
- if (from && typeof from === "object" || typeof from === "function") {
3094
- for (let key of __getOwnPropNames22(from))
3095
- if (!__hasOwnProp22.call(to, key) && key !== except)
3096
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3051
+ });
3052
+ var require_cjs4 = __commonJS2({
3053
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports2, module22) {
3054
+ "use strict";
3055
+ var __defProp22 = Object.defineProperty;
3056
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3057
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
3058
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3059
+ var __copyProps22 = (to, from, except, desc) => {
3060
+ if (from && typeof from === "object" || typeof from === "function") {
3061
+ for (let key of __getOwnPropNames22(from))
3062
+ if (!__hasOwnProp22.call(to, key) && key !== except)
3063
+ __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3064
+ }
3065
+ return to;
3066
+ };
3067
+ var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3068
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3069
+ var utils_exports = {};
3070
+ module22.exports = __toCommonJS22(utils_exports);
3071
+ __reExport(utils_exports, require_key2(), module22.exports);
3072
+ __reExport(utils_exports, require_env2(), module22.exports);
3073
+ __reExport(utils_exports, require_types2(), module22.exports);
3074
+ __reExport(utils_exports, require_object2(), module22.exports);
3075
+ __reExport(utils_exports, require_function2(), module22.exports);
3076
+ __reExport(utils_exports, require_array2(), module22.exports);
3077
+ __reExport(utils_exports, require_node2(), module22.exports);
3078
+ __reExport(utils_exports, require_log2(), module22.exports);
3079
+ __reExport(utils_exports, require_string2(), module22.exports);
3080
+ __reExport(utils_exports, require_globals2(), module22.exports);
3081
+ __reExport(utils_exports, require_cookie2(), module22.exports);
3082
+ __reExport(utils_exports, require_tags2(), module22.exports);
3097
3083
  }
3098
- return to;
3099
- };
3100
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3101
- var tags_exports = {};
3102
- __export22(tags_exports, {
3103
- HTML_TAGS: () => HTML_TAGS,
3104
- isValidHtmlTag: () => isValidHtmlTag
3105
3084
  });
3106
- module2.exports = __toCommonJS22(tags_exports);
3107
- var HTML_TAGS = {
3108
- root: [
3109
- "body",
3110
- "html"
3111
- ],
3112
- head: [
3113
- "title",
3114
- "base",
3115
- "meta",
3116
- "style"
3117
- ],
3118
- body: [
3119
- "string",
3120
- "fragment",
3121
- "a",
3122
- "abbr",
3123
- "acronym",
3124
- "address",
3125
- "applet",
3126
- "area",
3127
- "article",
3128
- "aside",
3129
- "audio",
3130
- "b",
3131
- "basefont",
3132
- "bdi",
3133
- "bdo",
3134
- "big",
3135
- "blockquote",
3136
- "br",
3137
- "button",
3138
- "canvas",
3139
- "caption",
3140
- "center",
3141
- "cite",
3142
- "code",
3143
- "search",
3144
- "col",
3145
- "colgroup",
3146
- "data",
3147
- "datalist",
3148
- "dd",
3149
- "del",
3150
- "details",
3151
- "dfn",
3152
- "dialog",
3153
- "dir",
3154
- "div",
3155
- "dl",
3156
- "dt",
3157
- "em",
3158
- "embed",
3159
- "fieldset",
3160
- "figcaption",
3161
- "figure",
3162
- "font",
3163
- "footer",
3164
- "form",
3165
- "frame",
3166
- "frameset",
3167
- "h1",
3168
- "h2",
3169
- "h3",
3170
- "h4",
3171
- "h5",
3172
- "h6",
3173
- "head",
3174
- "header",
3175
- "hr",
3176
- "i",
3177
- "iframe",
3178
- "img",
3179
- "input",
3180
- "ins",
3181
- "kbd",
3182
- "label",
3183
- "legend",
3184
- "li",
3185
- "link",
3186
- "main",
3187
- "map",
3188
- "mark",
3189
- "meter",
3190
- "nav",
3191
- "noframes",
3192
- "noscript",
3193
- "object",
3194
- "ol",
3195
- "optgroup",
3196
- "option",
3197
- "output",
3198
- "p",
3199
- "param",
3200
- "picture",
3201
- "pre",
3202
- "progress",
3203
- "hgroup",
3204
- "q",
3205
- "rp",
3206
- "rt",
3207
- "ruby",
3208
- "s",
3209
- "samp",
3210
- "script",
3211
- "section",
3212
- "select",
3213
- "small",
3214
- "source",
3215
- "span",
3216
- "strike",
3217
- "strong",
3218
- "sub",
3219
- "summary",
3220
- "sup",
3221
- "table",
3222
- "tbody",
3223
- "td",
3224
- "template",
3225
- "hgroup",
3226
- "textarea",
3227
- "tfoot",
3228
- "th",
3229
- "thead",
3230
- "time",
3231
- "tr",
3232
- "track",
3233
- "tt",
3234
- "u",
3235
- "ul",
3236
- "var",
3237
- "video",
3238
- "wbr",
3239
- // SVG
3240
- "svg",
3241
- "path"
3242
- ]
3085
+ var src_exports = {};
3086
+ __export2(src_exports, {
3087
+ arrayzeValue: () => arrayzeValue,
3088
+ copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
3089
+ copyStringToClipboard: () => copyStringToClipboard,
3090
+ fibonacciNumberByIndex: () => fibonacciNumberByIndex,
3091
+ findClosestNumber: () => findClosestNumber,
3092
+ findClosestNumberInFactory: () => findClosestNumberInFactory,
3093
+ formatDate: () => formatDate,
3094
+ isPhoto: () => isPhoto,
3095
+ loadCssFile: () => loadCssFile,
3096
+ loadJavascript: () => loadJavascript,
3097
+ loadJavascriptFile: () => loadJavascriptFile,
3098
+ loadJavascriptFileSync: () => loadJavascriptFileSync,
3099
+ removeChars: () => removeChars,
3100
+ toCamelCase: () => toCamelCase,
3101
+ toDashCase: () => toDashCase2,
3102
+ toDescriptionCase: () => toDescriptionCase,
3103
+ toTitleCase: () => toTitleCase,
3104
+ toggleFullscreen: () => toggleFullscreen
3105
+ });
3106
+ module2.exports = __toCommonJS2(src_exports);
3107
+ var import_utils22 = __toESM2(require_cjs4(), 1);
3108
+ var toggleFullscreen = async (el) => {
3109
+ if (!document.fullscreenElement) {
3110
+ try {
3111
+ await (el.node || document).requestFullscreen();
3112
+ } catch (err) {
3113
+ console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
3114
+ }
3115
+ } else {
3116
+ await document.exitFullscreen();
3117
+ }
3243
3118
  };
3244
- var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
3245
- }
3246
- });
3247
- var require_cjs3 = __commonJS2({
3248
- "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
3249
- "use strict";
3250
- var __defProp22 = Object.defineProperty;
3251
- var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
3252
- var __getOwnPropNames22 = Object.getOwnPropertyNames;
3253
- var __hasOwnProp22 = Object.prototype.hasOwnProperty;
3254
- var __copyProps22 = (to, from, except, desc) => {
3255
- if (from && typeof from === "object" || typeof from === "function") {
3256
- for (let key of __getOwnPropNames22(from))
3257
- if (!__hasOwnProp22.call(to, key) && key !== except)
3258
- __defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
3119
+ var import_utils9 = __toESM2(require_cjs4(), 1);
3120
+ var findClosestNumber = (number, arr) => {
3121
+ return ((0, import_utils9.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3122
+ return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3123
+ });
3124
+ };
3125
+ var findClosestNumberInFactory = (val, factory) => {
3126
+ val = parseFloat(val);
3127
+ if ((0, import_utils9.isObject)(factory))
3128
+ factory = Object.values(factory);
3129
+ return findClosestNumber(val, factory);
3130
+ };
3131
+ var formatDate = (timestamp) => {
3132
+ if (!timestamp)
3133
+ return "";
3134
+ const d = new Date(timestamp);
3135
+ const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
3136
+ const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
3137
+ const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
3138
+ return `${da} ${mo}, ${ye}`;
3139
+ };
3140
+ var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
3141
+ const fib = [0, 1];
3142
+ for (let i = 2; i <= n; i++) {
3143
+ fib[i] = fib[i - 1] + fib[i - 2];
3144
+ }
3145
+ return fib[n];
3146
+ };
3147
+ var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3148
+ return new Promise((resolve, reject) => {
3149
+ try {
3150
+ const scriptEle = doc.createElement("script");
3151
+ scriptEle.type = type;
3152
+ scriptEle.async = async;
3153
+ scriptEle.src = FILE_URL;
3154
+ scriptEle.addEventListener("load", (ev) => {
3155
+ resolve({
3156
+ status: true
3157
+ });
3158
+ });
3159
+ scriptEle.addEventListener("error", (ev) => {
3160
+ reject(new Error({
3161
+ status: false,
3162
+ message: `Failed to load the script ${FILE_URL}`
3163
+ }));
3164
+ });
3165
+ doc.body.appendChild(scriptEle);
3166
+ } catch (error) {
3167
+ reject(error);
3168
+ }
3169
+ });
3170
+ };
3171
+ var loadJavascriptFileSync = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
3172
+ const xhr = new window.XMLHttpRequest();
3173
+ xhr.open("GET", FILE_URL, false);
3174
+ xhr.send();
3175
+ if (xhr.status === 200) {
3176
+ const scriptEle = doc.createElement("script");
3177
+ scriptEle.type = type;
3178
+ scriptEle.text = xhr.responseText;
3179
+ doc.body.appendChild(scriptEle);
3180
+ if (typeof fallback === "function")
3181
+ fallback();
3182
+ } else {
3183
+ throw new Error(`Failed to load the script ${FILE_URL}`);
3184
+ }
3185
+ };
3186
+ var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3187
+ return new Promise((resolve, reject) => {
3188
+ try {
3189
+ const linkElem = doc.createElement("link");
3190
+ linkElem.rel = "stylesheet";
3191
+ linkElem.href = FILE_URL;
3192
+ linkElem.addEventListener("load", (ev) => {
3193
+ resolve({
3194
+ status: true
3195
+ });
3196
+ });
3197
+ doc.head.appendChild(linkElem);
3198
+ } catch (error) {
3199
+ reject(error);
3200
+ }
3201
+ });
3202
+ };
3203
+ var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
3204
+ try {
3205
+ const scriptEle = doc.createElement("script");
3206
+ scriptEle.type = type;
3207
+ scriptEle.async = async;
3208
+ scriptEle.id = id;
3209
+ scriptEle.innerHTML = body;
3210
+ doc.body.appendChild(scriptEle);
3211
+ } catch (error) {
3212
+ console.warn(error);
3213
+ }
3214
+ };
3215
+ var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
3216
+ var copyStringToClipboard = async (str) => {
3217
+ try {
3218
+ await navigator.clipboard.writeText(str);
3219
+ } catch (err) {
3220
+ console.warn("Failed to copy text: ", err);
3259
3221
  }
3260
- return to;
3261
3222
  };
3262
- var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
3263
- var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
3264
- var utils_exports = {};
3265
- module2.exports = __toCommonJS22(utils_exports);
3266
- __reExport(utils_exports, require_key2(), module2.exports);
3267
- __reExport(utils_exports, require_env2(), module2.exports);
3268
- __reExport(utils_exports, require_types2(), module2.exports);
3269
- __reExport(utils_exports, require_object2(), module2.exports);
3270
- __reExport(utils_exports, require_function2(), module2.exports);
3271
- __reExport(utils_exports, require_array2(), module2.exports);
3272
- __reExport(utils_exports, require_node2(), module2.exports);
3273
- __reExport(utils_exports, require_log2(), module2.exports);
3274
- __reExport(utils_exports, require_string2(), module2.exports);
3275
- __reExport(utils_exports, require_globals2(), module2.exports);
3276
- __reExport(utils_exports, require_cookie2(), module2.exports);
3277
- __reExport(utils_exports, require_tags2(), module2.exports);
3223
+ var copyJavaScriptToClipboard = async (jsCode) => {
3224
+ try {
3225
+ const blob = new Blob([jsCode], { type: "text/javascript" });
3226
+ const clipboardItem = new window.ClipboardItem({ "text/plain": blob });
3227
+ await navigator.clipboard.write([clipboardItem]);
3228
+ console.log("JavaScript code copied to clipboard as text/javascript");
3229
+ } catch (err) {
3230
+ console.error("Failed to copy JavaScript code: ", err);
3231
+ }
3232
+ };
3233
+ var removeChars = (str) => {
3234
+ return str.replace(/[^a-zA-Z0-9_]/g, "");
3235
+ };
3236
+ var toCamelCase = (str) => {
3237
+ return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
3238
+ return index === 0 ? word.toLowerCase() : word.toUpperCase();
3239
+ }).replaceAll(/\s+/g, "");
3240
+ };
3241
+ var toTitleCase = (str) => str && str.replace(
3242
+ /\w\S*/g,
3243
+ (txt) => {
3244
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
3245
+ }
3246
+ );
3247
+ var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
3248
+ var toDescriptionCase = (str = "") => {
3249
+ if (typeof str !== "string")
3250
+ return;
3251
+ const result = str.replace(/([A-Z])/g, " $1");
3252
+ return result.charAt(0).toUpperCase() + result.slice(1);
3253
+ };
3254
+ var arrayzeValue = (val) => {
3255
+ if ((0, import_utils22.isArray)(val))
3256
+ return val;
3257
+ if ((0, import_utils22.isString)(val))
3258
+ return val.split(" ");
3259
+ if ((0, import_utils22.isObject)(val))
3260
+ return Object.values(val);
3261
+ if ((0, import_utils22.isNumber)(val))
3262
+ return [val];
3263
+ };
3278
3264
  }
3279
3265
  });
3280
- var src_exports = {};
3281
- __export2(src_exports, {
3282
- arrayzeValue: () => arrayzeValue,
3283
- copyStringToClipboard: () => copyStringToClipboard,
3284
- fibonacciNumberByIndex: () => fibonacciNumberByIndex,
3285
- findClosestNumber: () => findClosestNumber,
3286
- findClosestNumberInFactory: () => findClosestNumberInFactory,
3287
- formatDate: () => formatDate,
3288
- isPhoto: () => isPhoto,
3289
- loadCssFile: () => loadCssFile,
3290
- loadJavascript: () => loadJavascript,
3291
- loadJavascriptFile: () => loadJavascriptFile,
3292
- removeChars: () => removeChars,
3293
- toCamelCase: () => toCamelCase,
3294
- toDashCase: () => toDashCase,
3295
- toDescriptionCase: () => toDescriptionCase,
3296
- toTitleCase: () => toTitleCase,
3297
- toggleFullscreen: () => toggleFullscreen
3266
+
3267
+ // src/system/document.js
3268
+ var document_exports = {};
3269
+ __export(document_exports, {
3270
+ applyDocument: () => applyDocument
3298
3271
  });
3299
- module.exports = __toCommonJS2(src_exports);
3300
- var import_utils22 = __toESM2(require_cjs3(), 1);
3301
- var toggleFullscreen = (el) => {
3302
- if (!document.fullscreenElement) {
3303
- el.node.requestFullscreen().catch((err) => {
3304
- console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
3305
- });
3306
- } else {
3307
- document.exitFullscreen();
3308
- }
3272
+ module.exports = __toCommonJS(document_exports);
3273
+ var import_utils7 = __toESM(require_cjs(), 1);
3274
+
3275
+ // src/factory.js
3276
+ var import_utils = __toESM(require_cjs(), 1);
3277
+
3278
+ // src/defaultConfig/index.js
3279
+ var defaultConfig_exports = {};
3280
+ __export(defaultConfig_exports, {
3281
+ ANIMATION: () => ANIMATION,
3282
+ BREAKPOINTS: () => BREAKPOINTS,
3283
+ CASES: () => CASES,
3284
+ COLOR: () => COLOR,
3285
+ DEVICES: () => DEVICES,
3286
+ DOCUMENT: () => DOCUMENT,
3287
+ FONT: () => FONT,
3288
+ FONT_FACE: () => FONT_FACE,
3289
+ FONT_FAMILY: () => FONT_FAMILY,
3290
+ FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
3291
+ GRADIENT: () => GRADIENT,
3292
+ GRID: () => GRID,
3293
+ ICONS: () => ICONS,
3294
+ MEDIA: () => MEDIA,
3295
+ RESET: () => RESET,
3296
+ SEMANTIC_ICONS: () => SEMANTIC_ICONS,
3297
+ SEQUENCE: () => SEQUENCE,
3298
+ SHADOW: () => SHADOW,
3299
+ SPACING: () => SPACING,
3300
+ SVG: () => SVG,
3301
+ SVG_DATA: () => SVG_DATA,
3302
+ TEMPLATES: () => TEMPLATES,
3303
+ THEME: () => THEME,
3304
+ TIMING: () => TIMING,
3305
+ TYPOGRAPHY: () => TYPOGRAPHY,
3306
+ UNIT: () => UNIT
3307
+ });
3308
+
3309
+ // src/defaultConfig/sequence.js
3310
+ var SEQUENCE = {
3311
+ "minor-second": 1.067,
3312
+ "major-second": 1.125,
3313
+ "minor-third": 1.2,
3314
+ "major-third": 1.25,
3315
+ "perfect-fourth": 1.333,
3316
+ "augmented-fourth": 1.414,
3317
+ "perfect-fifth": 1.5,
3318
+ "minor-sixth": 1.6,
3319
+ phi: 1.618,
3320
+ // golden-ratio
3321
+ "major-sixth": 1.667,
3322
+ "square-root-3": 1.732,
3323
+ // theodorus
3324
+ "minor-seventh": 1.778,
3325
+ "major-seventh": 1.875,
3326
+ octave: 2,
3327
+ "square-root-5": 2.23,
3328
+ // pythagoras
3329
+ "major-tenth": 2.5,
3330
+ "major-eleventh": 2.667,
3331
+ "major-twelfth": 3,
3332
+ pi: 3.14,
3333
+ // archimedes
3334
+ "double-octave": 4
3309
3335
  };
3310
- var import_utils3 = __toESM2(require_cjs3(), 1);
3311
- var findClosestNumber = (number, arr) => {
3312
- return ((0, import_utils3.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
3313
- return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
3314
- });
3336
+
3337
+ // src/defaultConfig/unit.js
3338
+ var UNIT = {
3339
+ default: "em"
3315
3340
  };
3316
- var findClosestNumberInFactory = (val, factory) => {
3317
- val = parseFloat(val);
3318
- if ((0, import_utils3.isObject)(factory))
3319
- factory = Object.values(factory);
3320
- return findClosestNumber(val, factory);
3341
+
3342
+ // src/defaultConfig/typography.js
3343
+ var defaultProps = {
3344
+ browserDefault: 16,
3345
+ base: 16,
3346
+ type: "font-size",
3347
+ ratio: SEQUENCE["minor-third"],
3348
+ range: [-3, 12],
3349
+ h1Matches: 6,
3350
+ lineHeight: 1.5,
3351
+ subSequence: true,
3352
+ mediaRegenerate: false,
3353
+ unit: "em",
3354
+ templates: {},
3355
+ sequence: {},
3356
+ scales: {},
3357
+ vars: {}
3321
3358
  };
3322
- var formatDate = (timestamp) => {
3323
- if (!timestamp)
3324
- return "";
3325
- const d = new Date(timestamp);
3326
- const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
3327
- const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
3328
- const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
3329
- return `${da} ${mo}, ${ye}`;
3359
+ var TYPOGRAPHY = defaultProps;
3360
+
3361
+ // src/defaultConfig/font.js
3362
+ var FONT = {};
3363
+
3364
+ // src/defaultConfig/font-family.js
3365
+ var FONT_FAMILY = {};
3366
+ var FONT_FAMILY_TYPES = {
3367
+ "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
3368
+ serif: "Times New Roman, Georgia, serif, --system-default",
3369
+ monospace: "Courier New, monospace, --system-default"
3330
3370
  };
3331
- var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
3332
- const fib = [0, 1];
3333
- for (let i = 2; i <= n; i++) {
3334
- fib[i] = fib[i - 1] + fib[i - 2];
3335
- }
3336
- return fib[n];
3371
+ var FONT_FACE = {};
3372
+
3373
+ // src/defaultConfig/media.js
3374
+ var MEDIA = {
3375
+ tv: "(min-width: 2780px)",
3376
+ light: "(prefers-color-scheme: light)",
3377
+ dark: "(prefers-color-scheme: dark)",
3378
+ print: "print"
3337
3379
  };
3338
- var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3339
- return new Promise((resolve, reject) => {
3340
- try {
3341
- const scriptEle = doc.createElement("script");
3342
- scriptEle.type = type;
3343
- scriptEle.async = async;
3344
- scriptEle.src = FILE_URL;
3345
- scriptEle.addEventListener("load", (ev) => {
3346
- resolve({
3347
- status: true
3348
- });
3349
- });
3350
- scriptEle.addEventListener("error", (ev) => {
3351
- reject({
3352
- status: false,
3353
- message: `Failed to load the script ${FILE_URL}`
3354
- });
3355
- });
3356
- doc.body.appendChild(scriptEle);
3357
- } catch (error) {
3358
- reject(error);
3359
- }
3360
- });
3380
+
3381
+ // src/defaultConfig/spacing.js
3382
+ var defaultProps2 = {
3383
+ base: TYPOGRAPHY.base,
3384
+ type: "spacing",
3385
+ ratio: SEQUENCE.phi,
3386
+ range: [-5, 15],
3387
+ subSequence: true,
3388
+ mediaRegenerate: false,
3389
+ unit: "em",
3390
+ sequence: {},
3391
+ scales: {},
3392
+ vars: {}
3361
3393
  };
3362
- var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
3363
- return new Promise((resolve, reject) => {
3364
- try {
3365
- const linkElem = doc.createElement("link");
3366
- linkElem.rel = "stylesheet";
3367
- linkElem.href = FILE_URL;
3368
- linkElem.addEventListener("load", (ev) => {
3369
- resolve({
3370
- status: true
3371
- });
3372
- });
3373
- doc.head.appendChild(linkElem);
3374
- } catch (error) {
3375
- reject(error);
3376
- }
3377
- });
3394
+ var SPACING = defaultProps2;
3395
+
3396
+ // src/defaultConfig/color.js
3397
+ var COLOR = {};
3398
+ var GRADIENT = {};
3399
+
3400
+ // src/defaultConfig/theme.js
3401
+ var THEME = {};
3402
+
3403
+ // src/defaultConfig/shadow.js
3404
+ var SHADOW = {};
3405
+
3406
+ // src/defaultConfig/icons.js
3407
+ var ICONS = {};
3408
+ var SEMANTIC_ICONS = {};
3409
+
3410
+ // src/defaultConfig/timing.js
3411
+ var defaultProps3 = {
3412
+ default: 150,
3413
+ base: 150,
3414
+ type: "timing",
3415
+ ratio: SEQUENCE["perfect-fourth"],
3416
+ range: [-3, 12],
3417
+ mediaRegenerate: false,
3418
+ unit: "ms",
3419
+ sequence: {},
3420
+ scales: {},
3421
+ vars: {}
3378
3422
  };
3379
- var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
3380
- try {
3381
- const scriptEle = doc.createElement("script");
3382
- scriptEle.type = type;
3383
- scriptEle.async = async;
3384
- scriptEle.id = id;
3385
- scriptEle.innerHTML = body;
3386
- doc.body.appendChild(scriptEle);
3387
- } catch (error) {
3388
- console.warn(error);
3389
- }
3423
+ var TIMING = defaultProps3;
3424
+
3425
+ // src/defaultConfig/document.js
3426
+ var DOCUMENT = {};
3427
+
3428
+ // src/defaultConfig/responsive.js
3429
+ var BREAKPOINTS = {
3430
+ screenL: 1920,
3431
+ screenM: 1680,
3432
+ screenS: 1440,
3433
+ tabletL: 1366,
3434
+ tabletM: 1280,
3435
+ tabletS: 1024,
3436
+ mobileL: 768,
3437
+ mobileM: 560,
3438
+ mobileS: 480,
3439
+ mobileXS: 375
3390
3440
  };
3391
- var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
3392
- var copyStringToClipboard = (str) => {
3393
- const el = document.createElement("textarea");
3394
- el.value = str;
3395
- el.setAttribute("readonly", "");
3396
- el.style = { position: "absolute", left: "-9999px" };
3397
- document.body.appendChild(el);
3398
- el.select();
3399
- document.execCommand("copy");
3400
- document.body.removeChild(el);
3441
+ var DEVICES = {
3442
+ screenXXL: [2560, 1440],
3443
+ screenXL: [2240, 1260],
3444
+ screenL: [1920, 1024],
3445
+ screenM: [1680, 1024],
3446
+ screenS: [1440, 720],
3447
+ tabletL: [1366, 926],
3448
+ tabletM: [1280, 768],
3449
+ tabletS: [1024, 768],
3450
+ mobileL: [768, 375],
3451
+ mobileM: [560, 768],
3452
+ mobileS: [480, 768],
3453
+ mobileXS: [375, 768]
3401
3454
  };
3402
- var removeChars = (str) => {
3403
- return str.replace(/[^a-zA-Z0-9_]/g, "");
3455
+
3456
+ // src/defaultConfig/cases.js
3457
+ var CASES = {};
3458
+
3459
+ // src/defaultConfig/animation.js
3460
+ var ANIMATION = {};
3461
+
3462
+ // src/defaultConfig/svg.js
3463
+ var SVG = {};
3464
+ var SVG_DATA = {};
3465
+
3466
+ // src/defaultConfig/templates.js
3467
+ var TEMPLATES = {};
3468
+
3469
+ // src/defaultConfig/grid.js
3470
+ var defaultProps4 = {};
3471
+ var GRID = defaultProps4;
3472
+
3473
+ // src/defaultConfig/index.js
3474
+ var RESET = {};
3475
+
3476
+ // src/factory.js
3477
+ var CSS_VARS = {};
3478
+ var CONFIG = {
3479
+ verbose: false,
3480
+ useVariable: true,
3481
+ useReset: true,
3482
+ CSS_VARS,
3483
+ ...defaultConfig_exports
3404
3484
  };
3405
- var toCamelCase = (str) => {
3406
- return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
3407
- return index === 0 ? word.toLowerCase() : word.toUpperCase();
3408
- }).replaceAll(/\s+/g, "");
3485
+ var cachedConfig = (0, import_utils.deepClone)(CONFIG);
3486
+ var FACTORY = {
3487
+ active: "0",
3488
+ 0: CONFIG
3409
3489
  };
3410
- var toTitleCase = (str) => str && str.replace(
3411
- /\w\S*/g,
3412
- (txt) => {
3413
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
3414
- }
3415
- );
3416
- var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
3417
- var toDescriptionCase = (str = "") => {
3418
- if (typeof str !== "string")
3419
- return;
3420
- const result = str.replace(/([A-Z])/g, " $1");
3421
- return result.charAt(0).toUpperCase() + result.slice(1);
3490
+ var getActiveConfig = (def) => {
3491
+ return FACTORY[def || FACTORY.active] || CONFIG;
3422
3492
  };
3423
- var arrayzeValue = (val) => {
3424
- if ((0, import_utils22.isArray)(val))
3425
- return val;
3426
- if ((0, import_utils22.isString)(val))
3427
- return val.split(" ");
3428
- if ((0, import_utils22.isObject)(val))
3429
- return Object.values(val);
3430
- if ((0, import_utils22.isNumber)(val))
3431
- return [val];
3493
+
3494
+ // src/utils/color.js
3495
+ var import_globals = __toESM(require_cjs2(), 1);
3496
+ var import_utils2 = __toESM(require_cjs(), 1);
3497
+
3498
+ // src/utils/font.js
3499
+ var getDefaultOrFirstKey = (LIBRARY, key) => {
3500
+ if (LIBRARY[key])
3501
+ return LIBRARY[key].value;
3502
+ if (LIBRARY.default)
3503
+ return LIBRARY[LIBRARY.default].value;
3504
+ const hasValue = Object.keys(LIBRARY)[0];
3505
+ return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
3432
3506
  };
3433
3507
 
3508
+ // src/utils/sequence.js
3509
+ var import_utils3 = __toESM(require_cjs(), 1);
3510
+ var import_utils4 = __toESM(require_cjs3(), 1);
3511
+
3434
3512
  // src/utils/var.js
3435
- var import_utils6 = __toESM(require_cjs(), 1);
3513
+ var import_utils5 = __toESM(require_cjs(), 1);
3436
3514
 
3437
3515
  // src/utils/sprite.js
3438
- var import_utils7 = __toESM(require_cjs(), 1);
3516
+ var import_utils6 = __toESM(require_cjs(), 1);
3439
3517
 
3440
3518
  // src/system/document.js
3441
3519
  var applyDocument = () => {
3442
3520
  const CONFIG2 = getActiveConfig();
3443
3521
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
3444
- return (0, import_utils8.merge)(DOCUMENT2, {
3522
+ return (0, import_utils7.merge)(DOCUMENT2, {
3445
3523
  theme: THEME2.document,
3446
3524
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
3447
3525
  fontSize: TYPOGRAPHY2.base,