@symbo.ls/scratch 2.11.125 → 2.11.131

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.
Files changed (43) hide show
  1. package/package.json +2 -2
  2. package/LICENSE +0 -21
  3. package/dist/cjs/defaultConfig/animation.js +0 -26
  4. package/dist/cjs/defaultConfig/cases.js +0 -26
  5. package/dist/cjs/defaultConfig/color.js +0 -28
  6. package/dist/cjs/defaultConfig/document.js +0 -26
  7. package/dist/cjs/defaultConfig/font-family.js +0 -34
  8. package/dist/cjs/defaultConfig/font.js +0 -26
  9. package/dist/cjs/defaultConfig/icons.js +0 -26
  10. package/dist/cjs/defaultConfig/index.js +0 -221
  11. package/dist/cjs/defaultConfig/media.js +0 -51
  12. package/dist/cjs/defaultConfig/responsive.js +0 -50
  13. package/dist/cjs/defaultConfig/sequence.js +0 -51
  14. package/dist/cjs/defaultConfig/spacing.js +0 -85
  15. package/dist/cjs/defaultConfig/svg.js +0 -28
  16. package/dist/cjs/defaultConfig/templates.js +0 -26
  17. package/dist/cjs/defaultConfig/theme.js +0 -26
  18. package/dist/cjs/defaultConfig/timing.js +0 -67
  19. package/dist/cjs/defaultConfig/typography.js +0 -71
  20. package/dist/cjs/defaultConfig/unit.js +0 -28
  21. package/dist/cjs/factory.js +0 -1502
  22. package/dist/cjs/index.js +0 -3083
  23. package/dist/cjs/package.json +0 -4
  24. package/dist/cjs/set.js +0 -2452
  25. package/dist/cjs/system/color.js +0 -1735
  26. package/dist/cjs/system/document.js +0 -1528
  27. package/dist/cjs/system/font.js +0 -1568
  28. package/dist/cjs/system/index.js +0 -2640
  29. package/dist/cjs/system/reset.js +0 -1637
  30. package/dist/cjs/system/spacing.js +0 -1812
  31. package/dist/cjs/system/svg.js +0 -1639
  32. package/dist/cjs/system/theme.js +0 -1823
  33. package/dist/cjs/system/timing.js +0 -1725
  34. package/dist/cjs/system/typography.js +0 -1778
  35. package/dist/cjs/tests/index.js +0 -30
  36. package/dist/cjs/transforms/index.js +0 -2001
  37. package/dist/cjs/utils/color.js +0 -1423
  38. package/dist/cjs/utils/font.js +0 -72
  39. package/dist/cjs/utils/index.js +0 -2001
  40. package/dist/cjs/utils/sequence.js +0 -1671
  41. package/dist/cjs/utils/sprite.js +0 -1546
  42. package/dist/cjs/utils/theme.js +0 -34
  43. package/dist/cjs/utils/var.js +0 -1527
@@ -1,1527 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
-
33
- // ../../node_modules/@domql/utils/dist/cjs/key.js
34
- var require_key = __commonJS({
35
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
36
- "use strict";
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
- for (var name in all)
43
- __defProp2(target, name, { get: all[name], enumerable: true });
44
- };
45
- var __copyProps2 = (to, from, except, desc) => {
46
- if (from && typeof from === "object" || typeof from === "function") {
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
- }
51
- return to;
52
- };
53
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
54
- var key_exports = {};
55
- __export2(key_exports, {
56
- createKey: () => createKey,
57
- createSnapshotId: () => createSnapshotId
58
- });
59
- module2.exports = __toCommonJS2(key_exports);
60
- var createKey = function() {
61
- let index = 0;
62
- function newId() {
63
- index++;
64
- return index;
65
- }
66
- return newId;
67
- }();
68
- var createSnapshotId = createKey;
69
- }
70
- });
71
-
72
- // ../../node_modules/@domql/utils/dist/cjs/env.js
73
- var require_env = __commonJS({
74
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
75
- "use strict";
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
- for (var name in all)
82
- __defProp2(target, name, { get: all[name], enumerable: true });
83
- };
84
- var __copyProps2 = (to, from, except, desc) => {
85
- if (from && typeof from === "object" || typeof from === "function") {
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
- }
90
- return to;
91
- };
92
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
93
- var env_exports = {};
94
- __export2(env_exports, {
95
- NODE_ENV: () => NODE_ENV,
96
- getNev: () => getNev,
97
- isDevelopment: () => isDevelopment,
98
- isProduction: () => isProduction,
99
- isTest: () => isTest
100
- });
101
- module2.exports = __toCommonJS2(env_exports);
102
- var NODE_ENV = "development";
103
- var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
104
- var isTest = (env = NODE_ENV) => env === "test";
105
- var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
106
- var getNev = (key, env = NODE_ENV) => env[key];
107
- }
108
- });
109
-
110
- // ../../node_modules/@domql/tags/dist/cjs/htmlTags.js
111
- var require_htmlTags = __commonJS({
112
- "../../node_modules/@domql/tags/dist/cjs/htmlTags.js"(exports, module2) {
113
- "use strict";
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
- for (var name in all)
120
- __defProp2(target, name, { get: all[name], enumerable: true });
121
- };
122
- var __copyProps2 = (to, from, except, desc) => {
123
- if (from && typeof from === "object" || typeof from === "function") {
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
- }
128
- return to;
129
- };
130
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
131
- var htmlTags_exports = {};
132
- __export2(htmlTags_exports, {
133
- HTML_TAGS: () => HTML_TAGS
134
- });
135
- module2.exports = __toCommonJS2(htmlTags_exports);
136
- var HTML_TAGS = {
137
- root: [
138
- "body",
139
- "html"
140
- ],
141
- head: [
142
- "title",
143
- "base",
144
- "meta",
145
- "style"
146
- ],
147
- body: [
148
- "string",
149
- "fragment",
150
- "a",
151
- "abbr",
152
- "acronym",
153
- "address",
154
- "applet",
155
- "area",
156
- "article",
157
- "aside",
158
- "audio",
159
- "b",
160
- "basefont",
161
- "bdi",
162
- "bdo",
163
- "big",
164
- "blockquote",
165
- "br",
166
- "button",
167
- "canvas",
168
- "caption",
169
- "center",
170
- "cite",
171
- "code",
172
- "col",
173
- "colgroup",
174
- "data",
175
- "datalist",
176
- "dd",
177
- "del",
178
- "details",
179
- "dfn",
180
- "dialog",
181
- "dir",
182
- "div",
183
- "dl",
184
- "dt",
185
- "em",
186
- "embed",
187
- "fieldset",
188
- "figcaption",
189
- "figure",
190
- "font",
191
- "footer",
192
- "form",
193
- "frame",
194
- "frameset",
195
- "h1",
196
- "h2",
197
- "h3",
198
- "h4",
199
- "h5",
200
- "h6",
201
- "head",
202
- "header",
203
- "hr",
204
- "i",
205
- "iframe",
206
- "img",
207
- "input",
208
- "ins",
209
- "kbd",
210
- "label",
211
- "legend",
212
- "li",
213
- "link",
214
- "main",
215
- "map",
216
- "mark",
217
- "meter",
218
- "nav",
219
- "noframes",
220
- "noscript",
221
- "object",
222
- "ol",
223
- "optgroup",
224
- "option",
225
- "output",
226
- "p",
227
- "param",
228
- "picture",
229
- "pre",
230
- "progress",
231
- "q",
232
- "rp",
233
- "rt",
234
- "ruby",
235
- "s",
236
- "samp",
237
- "script",
238
- "section",
239
- "select",
240
- "small",
241
- "source",
242
- "span",
243
- "strike",
244
- "strong",
245
- "sub",
246
- "summary",
247
- "sup",
248
- "table",
249
- "tbody",
250
- "td",
251
- "template",
252
- "textarea",
253
- "tfoot",
254
- "th",
255
- "thead",
256
- "time",
257
- "tr",
258
- "track",
259
- "tt",
260
- "u",
261
- "ul",
262
- "var",
263
- "video",
264
- "wbr",
265
- // SVG
266
- "svg",
267
- "path"
268
- ]
269
- };
270
- }
271
- });
272
-
273
- // ../../node_modules/@domql/tags/dist/cjs/index.js
274
- var require_cjs = __commonJS({
275
- "../../node_modules/@domql/tags/dist/cjs/index.js"(exports, module2) {
276
- "use strict";
277
- var __defProp2 = Object.defineProperty;
278
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
279
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
280
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
281
- var __copyProps2 = (to, from, except, desc) => {
282
- if (from && typeof from === "object" || typeof from === "function") {
283
- for (let key of __getOwnPropNames2(from))
284
- if (!__hasOwnProp2.call(to, key) && key !== except)
285
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
286
- }
287
- return to;
288
- };
289
- var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
290
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
291
- var tags_exports = {};
292
- module2.exports = __toCommonJS2(tags_exports);
293
- __reExport(tags_exports, require_htmlTags(), module2.exports);
294
- }
295
- });
296
-
297
- // ../../node_modules/@domql/globals/dist/cjs/index.js
298
- var require_cjs2 = __commonJS({
299
- "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
300
- "use strict";
301
- var __defProp2 = Object.defineProperty;
302
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
303
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
304
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
305
- var __export2 = (target, all) => {
306
- for (var name in all)
307
- __defProp2(target, name, { get: all[name], enumerable: true });
308
- };
309
- var __copyProps2 = (to, from, except, desc) => {
310
- if (from && typeof from === "object" || typeof from === "function") {
311
- for (let key of __getOwnPropNames2(from))
312
- if (!__hasOwnProp2.call(to, key) && key !== except)
313
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
314
- }
315
- return to;
316
- };
317
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
318
- var globals_exports = {};
319
- __export2(globals_exports, {
320
- document: () => document2,
321
- global: () => global,
322
- self: () => self,
323
- window: () => window
324
- });
325
- module2.exports = __toCommonJS2(globals_exports);
326
- var global = globalThis;
327
- var self = globalThis;
328
- var window = globalThis;
329
- var document2 = window.document;
330
- }
331
- });
332
-
333
- // ../../node_modules/@domql/utils/dist/cjs/node.js
334
- var require_node = __commonJS({
335
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
336
- "use strict";
337
- var __defProp2 = Object.defineProperty;
338
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
339
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
340
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
341
- var __export2 = (target, all) => {
342
- for (var name in all)
343
- __defProp2(target, name, { get: all[name], enumerable: true });
344
- };
345
- var __copyProps2 = (to, from, except, desc) => {
346
- if (from && typeof from === "object" || typeof from === "function") {
347
- for (let key of __getOwnPropNames2(from))
348
- if (!__hasOwnProp2.call(to, key) && key !== except)
349
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
350
- }
351
- return to;
352
- };
353
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
354
- var node_exports = {};
355
- __export2(node_exports, {
356
- isHtmlElement: () => isHtmlElement,
357
- isNode: () => isNode
358
- });
359
- module2.exports = __toCommonJS2(node_exports);
360
- var import_globals = require_cjs2();
361
- var isNode = (obj) => {
362
- return (typeof Node === "object" ? obj instanceof import_globals.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
363
- };
364
- var isHtmlElement = (obj) => {
365
- return (typeof HTMLElement === "object" ? obj instanceof import_globals.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
366
- };
367
- }
368
- });
369
-
370
- // ../../node_modules/@domql/utils/dist/cjs/types.js
371
- var require_types = __commonJS({
372
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
373
- "use strict";
374
- var __defProp2 = Object.defineProperty;
375
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
376
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
377
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
378
- var __export2 = (target, all) => {
379
- for (var name in all)
380
- __defProp2(target, name, { get: all[name], enumerable: true });
381
- };
382
- var __copyProps2 = (to, from, except, desc) => {
383
- if (from && typeof from === "object" || typeof from === "function") {
384
- for (let key of __getOwnPropNames2(from))
385
- if (!__hasOwnProp2.call(to, key) && key !== except)
386
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
387
- }
388
- return to;
389
- };
390
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
391
- var types_exports = {};
392
- __export2(types_exports, {
393
- TYPES: () => TYPES,
394
- is: () => is,
395
- isArray: () => isArray,
396
- isBoolean: () => isBoolean,
397
- isDefined: () => isDefined2,
398
- isFunction: () => isFunction,
399
- isNot: () => isNot,
400
- isNull: () => isNull,
401
- isNumber: () => isNumber,
402
- isObject: () => isObject2,
403
- isObjectLike: () => isObjectLike2,
404
- isString: () => isString,
405
- isUndefined: () => isUndefined,
406
- isValidHtmlTag: () => isValidHtmlTag
407
- });
408
- module2.exports = __toCommonJS2(types_exports);
409
- var import_tags = require_cjs();
410
- var import_node = require_node();
411
- var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.includes(arg);
412
- var isObject2 = (arg) => {
413
- if (arg === null)
414
- return false;
415
- return typeof arg === "object" && arg.constructor === Object;
416
- };
417
- var isString = (arg) => typeof arg === "string";
418
- var isNumber = (arg) => typeof arg === "number";
419
- var isFunction = (arg) => typeof arg === "function";
420
- var isBoolean = (arg) => arg === true || arg === false;
421
- var isNull = (arg) => arg === null;
422
- var isArray = (arg) => Array.isArray(arg);
423
- var isObjectLike2 = (arg) => {
424
- if (arg === null)
425
- return false;
426
- return typeof arg === "object";
427
- };
428
- var isDefined2 = (arg) => {
429
- return isObject2(arg) || isObjectLike2(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike2(arg) || isBoolean(arg) || isNull(arg);
430
- };
431
- var isUndefined = (arg) => {
432
- return arg === void 0;
433
- };
434
- var TYPES = {
435
- boolean: isBoolean,
436
- array: isArray,
437
- object: isObject2,
438
- string: isString,
439
- number: isNumber,
440
- null: isNull,
441
- function: isFunction,
442
- objectLike: isObjectLike2,
443
- node: import_node.isNode,
444
- htmlElement: import_node.isHtmlElement,
445
- defined: isDefined2
446
- };
447
- var is = (arg) => {
448
- return (...args) => {
449
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
450
- };
451
- };
452
- var isNot = (arg) => {
453
- return (...args) => {
454
- return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
455
- };
456
- };
457
- }
458
- });
459
-
460
- // ../../node_modules/@domql/utils/dist/cjs/array.js
461
- var require_array = __commonJS({
462
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
463
- "use strict";
464
- var __defProp2 = Object.defineProperty;
465
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
466
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
467
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
468
- var __export2 = (target, all) => {
469
- for (var name in all)
470
- __defProp2(target, name, { get: all[name], enumerable: true });
471
- };
472
- var __copyProps2 = (to, from, except, desc) => {
473
- if (from && typeof from === "object" || typeof from === "function") {
474
- for (let key of __getOwnPropNames2(from))
475
- if (!__hasOwnProp2.call(to, key) && key !== except)
476
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
477
- }
478
- return to;
479
- };
480
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
481
- var array_exports = {};
482
- __export2(array_exports, {
483
- arrayContainsOtherArray: () => arrayContainsOtherArray,
484
- createNestedObject: () => createNestedObject,
485
- cutArrayAfterValue: () => cutArrayAfterValue,
486
- cutArrayBeforeValue: () => cutArrayBeforeValue,
487
- joinArrays: () => joinArrays,
488
- mergeAndCloneIfArray: () => mergeAndCloneIfArray,
489
- mergeArray: () => mergeArray,
490
- removeFromArray: () => removeFromArray,
491
- swapItemsInArray: () => swapItemsInArray
492
- });
493
- module2.exports = __toCommonJS2(array_exports);
494
- var import_object = require_object();
495
- var import_types = require_types();
496
- var arrayContainsOtherArray = (arr1, arr2) => {
497
- return arr2.every((val) => arr1.includes(val));
498
- };
499
- var removeFromArray = (arr, index) => {
500
- if ((0, import_types.isString)(index))
501
- index = parseInt(index);
502
- if ((0, import_types.isNumber)(index)) {
503
- if (index < 0 || index >= arr.length || isNaN(index)) {
504
- throw new Error("Invalid index");
505
- }
506
- arr.splice(index, 1);
507
- } else if ((0, import_types.isArray)(index)) {
508
- index.forEach((idx) => removeFromArray(arr, idx));
509
- } else {
510
- throw new Error("Invalid index");
511
- }
512
- return arr;
513
- };
514
- var swapItemsInArray = (arr, i, j) => {
515
- [arr[i], arr[j]] = [arr[j], arr[i]];
516
- };
517
- var joinArrays = (...arrays) => {
518
- return [].concat(...arrays);
519
- };
520
- var mergeArray = (arr, excludeFrom = []) => {
521
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
522
- };
523
- var mergeAndCloneIfArray = (obj) => {
524
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
525
- };
526
- var cutArrayBeforeValue = (arr, value) => {
527
- const index = arr.indexOf(value);
528
- if (index !== -1) {
529
- return arr.slice(0, index);
530
- }
531
- return arr;
532
- };
533
- var cutArrayAfterValue = (arr, value) => {
534
- const index = arr.indexOf(value);
535
- if (index !== -1) {
536
- return arr.slice(index + 1);
537
- }
538
- return arr;
539
- };
540
- var createNestedObject = (arr, lastValue) => {
541
- const nestedObject = {};
542
- if (arr.length === 0) {
543
- return lastValue;
544
- }
545
- arr.reduce((obj, value, index) => {
546
- if (!obj[value]) {
547
- obj[value] = {};
548
- }
549
- if (index === arr.length - 1 && lastValue) {
550
- obj[value] = lastValue;
551
- }
552
- return obj[value];
553
- }, nestedObject);
554
- return nestedObject;
555
- };
556
- }
557
- });
558
-
559
- // ../../node_modules/@domql/utils/dist/cjs/string.js
560
- var require_string = __commonJS({
561
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
562
- "use strict";
563
- var __defProp2 = Object.defineProperty;
564
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
565
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
566
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
567
- var __export2 = (target, all) => {
568
- for (var name in all)
569
- __defProp2(target, name, { get: all[name], enumerable: true });
570
- };
571
- var __copyProps2 = (to, from, except, desc) => {
572
- if (from && typeof from === "object" || typeof from === "function") {
573
- for (let key of __getOwnPropNames2(from))
574
- if (!__hasOwnProp2.call(to, key) && key !== except)
575
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
576
- }
577
- return to;
578
- };
579
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
580
- var string_exports = {};
581
- __export2(string_exports, {
582
- replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
583
- stringIncludesAny: () => stringIncludesAny
584
- });
585
- module2.exports = __toCommonJS2(string_exports);
586
- var stringIncludesAny = (str, characters) => {
587
- for (const char of characters) {
588
- if (str.includes(char)) {
589
- return true;
590
- }
591
- }
592
- return false;
593
- };
594
- var brackRegex = /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g;
595
- var replaceLiteralsWithObjectFields = (str, state) => {
596
- if (!str.includes("{{"))
597
- return str;
598
- return str.replace(brackRegex, (_, parentPath, variable) => {
599
- if (parentPath) {
600
- const parentLevels = parentPath.match(/\.\.\//g).length;
601
- let parentState = state;
602
- for (let i = 0; i < parentLevels; i++) {
603
- parentState = parentState.parent;
604
- if (!parentState) {
605
- return "";
606
- }
607
- }
608
- const value = parentState[variable.trim()];
609
- return value !== void 0 ? `${value}` : "";
610
- } else {
611
- const value = state[variable.trim()];
612
- return value !== void 0 ? `${value}` : "";
613
- }
614
- });
615
- };
616
- }
617
- });
618
-
619
- // ../../node_modules/@domql/utils/dist/cjs/object.js
620
- var require_object = __commonJS({
621
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
622
- "use strict";
623
- var __defProp2 = Object.defineProperty;
624
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
625
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
626
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
627
- var __export2 = (target, all) => {
628
- for (var name in all)
629
- __defProp2(target, name, { get: all[name], enumerable: true });
630
- };
631
- var __copyProps2 = (to, from, except, desc) => {
632
- if (from && typeof from === "object" || typeof from === "function") {
633
- for (let key of __getOwnPropNames2(from))
634
- if (!__hasOwnProp2.call(to, key) && key !== except)
635
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
636
- }
637
- return to;
638
- };
639
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
640
- var object_exports = {};
641
- __export2(object_exports, {
642
- clone: () => clone,
643
- deepClone: () => deepClone2,
644
- deepCloneExclude: () => deepCloneExclude,
645
- deepDestringify: () => deepDestringify,
646
- deepMerge: () => deepMerge2,
647
- deepStringify: () => deepStringify,
648
- detachFunctionsFromObject: () => detachFunctionsFromObject,
649
- diff: () => diff,
650
- diffArrays: () => diffArrays,
651
- diffObjects: () => diffObjects,
652
- exec: () => exec,
653
- flattenRecursive: () => flattenRecursive,
654
- isEqualDeep: () => isEqualDeep,
655
- map: () => map,
656
- merge: () => merge,
657
- mergeArrayExclude: () => mergeArrayExclude,
658
- mergeIfExisted: () => mergeIfExisted,
659
- objectToString: () => objectToString,
660
- overwrite: () => overwrite,
661
- overwriteDeep: () => overwriteDeep,
662
- overwriteShallow: () => overwriteShallow,
663
- removeFromObject: () => removeFromObject,
664
- stringToObject: () => stringToObject
665
- });
666
- module2.exports = __toCommonJS2(object_exports);
667
- var import_globals = require_cjs2();
668
- var import_types = require_types();
669
- var import_array = require_array();
670
- var import_string = require_string();
671
- var exec = (param, element, state, context) => {
672
- if ((0, import_types.isFunction)(param)) {
673
- return param(
674
- element,
675
- state || element.state,
676
- context || element.context
677
- );
678
- }
679
- return param;
680
- };
681
- var map = (obj, extention, element) => {
682
- for (const e in extention) {
683
- obj[e] = exec(extention[e], element);
684
- }
685
- };
686
- var merge = (element, obj, excludeFrom = []) => {
687
- for (const e in obj) {
688
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
689
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
690
- continue;
691
- const elementProp = element[e];
692
- const objProp = obj[e];
693
- if (elementProp === void 0) {
694
- element[e] = objProp;
695
- }
696
- }
697
- return element;
698
- };
699
- var deepMerge2 = (element, extend, excludeFrom = []) => {
700
- for (const e in extend) {
701
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
702
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
703
- continue;
704
- const elementProp = element[e];
705
- const extendProp = extend[e];
706
- if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
707
- deepMerge2(elementProp, extendProp);
708
- } else if (elementProp === void 0) {
709
- element[e] = extendProp;
710
- }
711
- }
712
- return element;
713
- };
714
- var clone = (obj, excludeFrom = []) => {
715
- const o = {};
716
- for (const prop in obj) {
717
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
718
- if (!hasOwnProperty || excludeFrom.includes(prop) || prop.startsWith("__"))
719
- continue;
720
- o[prop] = obj[prop];
721
- }
722
- return o;
723
- };
724
- var deepCloneExclude = (obj, excludeFrom = []) => {
725
- if ((0, import_types.isArray)(obj)) {
726
- return obj.map((x) => deepCloneExclude(x, excludeFrom));
727
- }
728
- const o = {};
729
- for (const k in obj) {
730
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, k);
731
- if (!hasOwnProperty || excludeFrom.includes(k) || k.startsWith("__"))
732
- continue;
733
- let v = obj[k];
734
- if (k === "extend" && (0, import_types.isArray)(v)) {
735
- v = mergeArrayExclude(v, excludeFrom);
736
- }
737
- if ((0, import_types.isArray)(v)) {
738
- o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
739
- } else if ((0, import_types.isObject)(v)) {
740
- o[k] = deepCloneExclude(v, excludeFrom);
741
- } else
742
- o[k] = v;
743
- }
744
- return o;
745
- };
746
- var mergeArrayExclude = (arr, excl = []) => {
747
- return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
748
- };
749
- var deepClone2 = (obj, excludeFrom = []) => {
750
- const o = (0, import_types.isArray)(obj) ? [] : {};
751
- for (const prop in obj) {
752
- if (prop === "__proto__")
753
- continue;
754
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
755
- continue;
756
- let objProp = obj[prop];
757
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
758
- objProp = (0, import_array.mergeArray)(objProp);
759
- }
760
- if ((0, import_types.isObjectLike)(objProp)) {
761
- o[prop] = deepClone2(objProp, excludeFrom);
762
- } else
763
- o[prop] = objProp;
764
- }
765
- return o;
766
- };
767
- var deepStringify = (obj, stringified = {}) => {
768
- for (const prop in obj) {
769
- const objProp = obj[prop];
770
- if ((0, import_types.isFunction)(objProp)) {
771
- stringified[prop] = objProp.toString();
772
- } else if ((0, import_types.isObject)(objProp)) {
773
- stringified[prop] = {};
774
- deepStringify(objProp, stringified[prop]);
775
- } else if ((0, import_types.isArray)(objProp)) {
776
- stringified[prop] = [];
777
- objProp.forEach((v, i) => {
778
- if ((0, import_types.isObject)(v)) {
779
- stringified[prop][i] = {};
780
- deepStringify(v, stringified[prop][i]);
781
- } else if ((0, import_types.isFunction)(v)) {
782
- stringified[prop][i] = v.toString();
783
- } else {
784
- stringified[prop][i] = v;
785
- }
786
- });
787
- } else {
788
- stringified[prop] = objProp;
789
- }
790
- }
791
- return stringified;
792
- };
793
- var objectToString = (obj, indent = 0) => {
794
- const spaces = " ".repeat(indent);
795
- let str = "{\n";
796
- for (const [key, value] of Object.entries(obj)) {
797
- const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
798
- const stringedKey = keyAllowdChars ? `'${key}'` : key;
799
- str += `${spaces} ${stringedKey}: `;
800
- if ((0, import_types.isArray)(value)) {
801
- str += "[\n";
802
- for (const element of value) {
803
- if ((0, import_types.isObject)(element) && element !== null) {
804
- str += `${spaces} ${objectToString(element, indent + 2)},
805
- `;
806
- } else if ((0, import_types.isString)(element)) {
807
- str += `${spaces} '${element}',
808
- `;
809
- } else {
810
- str += `${spaces} ${element},
811
- `;
812
- }
813
- }
814
- str += `${spaces} ]`;
815
- } else if ((0, import_types.isObject)(value)) {
816
- str += objectToString(value, indent + 1);
817
- } else if ((0, import_types.isString)(value)) {
818
- str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
819
- } else {
820
- str += value;
821
- }
822
- str += ",\n";
823
- }
824
- str += `${spaces}}`;
825
- return str;
826
- };
827
- var detachFunctionsFromObject = (obj, detached = {}) => {
828
- for (const prop in obj) {
829
- const objProp = obj[prop];
830
- if ((0, import_types.isFunction)(objProp))
831
- continue;
832
- else if ((0, import_types.isObject)(objProp)) {
833
- detached[prop] = {};
834
- deepStringify(objProp, detached[prop]);
835
- } else if ((0, import_types.isArray)(objProp)) {
836
- detached[prop] = [];
837
- objProp.forEach((v, i) => {
838
- if ((0, import_types.isFunction)(v))
839
- return;
840
- if ((0, import_types.isObject)(v)) {
841
- detached[prop][i] = {};
842
- detachFunctionsFromObject(v, detached[prop][i]);
843
- } else {
844
- detached[prop][i] = v;
845
- }
846
- });
847
- } else {
848
- detached[prop] = objProp;
849
- }
850
- }
851
- return detached;
852
- };
853
- var deepDestringify = (obj, stringified = {}) => {
854
- for (const prop in obj) {
855
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
856
- if (!hasOwnProperty)
857
- continue;
858
- const objProp = obj[prop];
859
- if ((0, import_types.isString)(objProp)) {
860
- if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
861
- try {
862
- const evalProp = import_globals.window.eval(`(${objProp})`);
863
- stringified[prop] = evalProp;
864
- } catch (e) {
865
- if (e)
866
- stringified[prop] = objProp;
867
- }
868
- } else {
869
- stringified[prop] = objProp;
870
- }
871
- } else if ((0, import_types.isArray)(objProp)) {
872
- stringified[prop] = [];
873
- objProp.forEach((arrProp) => {
874
- if ((0, import_types.isString)(arrProp)) {
875
- if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
876
- try {
877
- const evalProp = import_globals.window.eval(`(${arrProp})`);
878
- stringified[prop].push(evalProp);
879
- } catch (e) {
880
- if (e)
881
- stringified[prop].push(arrProp);
882
- }
883
- } else {
884
- stringified[prop].push(arrProp);
885
- }
886
- } else if ((0, import_types.isObject)(arrProp)) {
887
- stringified[prop].push(deepDestringify(arrProp));
888
- } else {
889
- stringified[prop].push(arrProp);
890
- }
891
- });
892
- } else if ((0, import_types.isObject)(objProp)) {
893
- stringified[prop] = deepDestringify(objProp, stringified[prop]);
894
- } else {
895
- stringified[prop] = objProp;
896
- }
897
- }
898
- return stringified;
899
- };
900
- var stringToObject = (str) => {
901
- let obj;
902
- try {
903
- obj = import_globals.window.eval("(" + str + ")");
904
- } catch (e) {
905
- console.warn(e);
906
- }
907
- if (obj)
908
- return obj;
909
- };
910
- var diffObjects = (original, objToDiff, cache) => {
911
- for (const e in objToDiff) {
912
- if (e === "ref")
913
- continue;
914
- const originalProp = original[e];
915
- const objToDiffProp = objToDiff[e];
916
- if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
917
- cache[e] = {};
918
- diff(originalProp, objToDiffProp, cache[e]);
919
- } else if (objToDiffProp !== void 0) {
920
- cache[e] = objToDiffProp;
921
- }
922
- }
923
- return cache;
924
- };
925
- var diffArrays = (original, objToDiff, cache) => {
926
- if (original.length !== objToDiff.length) {
927
- cache = objToDiff;
928
- } else {
929
- const diffArr = [];
930
- for (let i = 0; i < original.length; i++) {
931
- const diffObj = diff(original[i], objToDiff[i]);
932
- if (Object.keys(diffObj).length > 0) {
933
- diffArr.push(diffObj);
934
- }
935
- }
936
- if (diffArr.length > 0) {
937
- cache = diffArr;
938
- }
939
- }
940
- return cache;
941
- };
942
- var diff = (original, objToDiff, cache = {}) => {
943
- if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
944
- cache = [];
945
- diffArrays(original, objToDiff, cache);
946
- } else {
947
- diffObjects(original, objToDiff, cache);
948
- }
949
- return cache;
950
- };
951
- var overwrite = (element, params, excludeFrom = []) => {
952
- const { ref } = element;
953
- const changes = {};
954
- for (const e in params) {
955
- if (excludeFrom.includes(e) || e.startsWith("__"))
956
- continue;
957
- const elementProp = element[e];
958
- const paramsProp = params[e];
959
- if (paramsProp) {
960
- ref.__cache[e] = changes[e] = elementProp;
961
- ref[e] = paramsProp;
962
- }
963
- }
964
- return changes;
965
- };
966
- var overwriteShallow = (obj, params, excludeFrom = []) => {
967
- for (const e in params) {
968
- if (excludeFrom.includes(e) || e.startsWith("__"))
969
- continue;
970
- obj[e] = params[e];
971
- }
972
- return obj;
973
- };
974
- var overwriteDeep = (obj, params, excludeFrom = []) => {
975
- for (const e in params) {
976
- if (e === "__proto__")
977
- continue;
978
- if (excludeFrom.includes(e) || e.startsWith("__"))
979
- continue;
980
- const objProp = obj[e];
981
- const paramsProp = params[e];
982
- if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
983
- overwriteDeep(objProp, paramsProp);
984
- } else if (paramsProp !== void 0) {
985
- obj[e] = paramsProp;
986
- }
987
- }
988
- return obj;
989
- };
990
- var mergeIfExisted = (a, b) => {
991
- if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
992
- return deepMerge2(a, b);
993
- return a || b;
994
- };
995
- var flattenRecursive = (param, prop, stack = []) => {
996
- const objectized = (0, import_array.mergeAndCloneIfArray)(param);
997
- stack.push(objectized);
998
- const extendOfExtend = objectized[prop];
999
- if (extendOfExtend)
1000
- flattenRecursive(extendOfExtend, prop, stack);
1001
- delete objectized[prop];
1002
- return stack;
1003
- };
1004
- var isEqualDeep = (param, element) => {
1005
- if (param === element)
1006
- return true;
1007
- if (!param || !element)
1008
- return false;
1009
- for (const prop in param) {
1010
- const paramProp = param[prop];
1011
- const elementProp = element[prop];
1012
- if ((0, import_types.isObjectLike)(paramProp)) {
1013
- const isEqual = isEqualDeep(paramProp, elementProp);
1014
- if (!isEqual)
1015
- return false;
1016
- } else {
1017
- const isEqual = paramProp === elementProp;
1018
- if (!isEqual)
1019
- return false;
1020
- }
1021
- }
1022
- return true;
1023
- };
1024
- var removeFromObject = (obj, props) => {
1025
- if (props === void 0 || props === null)
1026
- return obj;
1027
- if ((0, import_types.is)(props)("string", "number")) {
1028
- delete obj[props];
1029
- } else if ((0, import_types.isArray)(props)) {
1030
- props.forEach((prop) => delete obj[prop]);
1031
- } else {
1032
- throw new Error("Invalid input: props must be a string or an array of strings");
1033
- }
1034
- return obj;
1035
- };
1036
- }
1037
- });
1038
-
1039
- // ../../node_modules/@domql/utils/dist/cjs/function.js
1040
- var require_function = __commonJS({
1041
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
1042
- "use strict";
1043
- var __defProp2 = Object.defineProperty;
1044
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1045
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1046
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1047
- var __export2 = (target, all) => {
1048
- for (var name in all)
1049
- __defProp2(target, name, { get: all[name], enumerable: true });
1050
- };
1051
- var __copyProps2 = (to, from, except, desc) => {
1052
- if (from && typeof from === "object" || typeof from === "function") {
1053
- for (let key of __getOwnPropNames2(from))
1054
- if (!__hasOwnProp2.call(to, key) && key !== except)
1055
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1056
- }
1057
- return to;
1058
- };
1059
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1060
- var function_exports = {};
1061
- __export2(function_exports, {
1062
- debounce: () => debounce,
1063
- memoize: () => memoize
1064
- });
1065
- module2.exports = __toCommonJS2(function_exports);
1066
- var debounce = (element, func, timeout = 300) => {
1067
- let timer;
1068
- return (...args) => {
1069
- clearTimeout(timer);
1070
- timer = setTimeout(() => {
1071
- func.apply(element, args);
1072
- }, timeout);
1073
- };
1074
- };
1075
- var memoize = (fn) => {
1076
- const cache = {};
1077
- return (...args) => {
1078
- const n = args[0];
1079
- if (n in cache) {
1080
- return cache[n];
1081
- } else {
1082
- const result = fn(n);
1083
- cache[n] = result;
1084
- return result;
1085
- }
1086
- };
1087
- };
1088
- }
1089
- });
1090
-
1091
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1092
- var require_log = __commonJS({
1093
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1094
- "use strict";
1095
- var __defProp2 = Object.defineProperty;
1096
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1097
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1098
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1099
- var __export2 = (target, all) => {
1100
- for (var name in all)
1101
- __defProp2(target, name, { get: all[name], enumerable: true });
1102
- };
1103
- var __copyProps2 = (to, from, except, desc) => {
1104
- if (from && typeof from === "object" || typeof from === "function") {
1105
- for (let key of __getOwnPropNames2(from))
1106
- if (!__hasOwnProp2.call(to, key) && key !== except)
1107
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1108
- }
1109
- return to;
1110
- };
1111
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1112
- var log_exports = {};
1113
- __export2(log_exports, {
1114
- logGroupIf: () => logGroupIf,
1115
- logIf: () => logIf
1116
- });
1117
- module2.exports = __toCommonJS2(log_exports);
1118
- var logIf = (bool, ...arg) => {
1119
- if (bool)
1120
- arg.map((v) => console.log(v));
1121
- };
1122
- var logGroupIf = (bool, key, ...arg) => {
1123
- if (bool) {
1124
- console.group(key);
1125
- arg.map((v) => console.log(v));
1126
- console.groupEnd(key);
1127
- }
1128
- };
1129
- }
1130
- });
1131
-
1132
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
1133
- var require_globals = __commonJS({
1134
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
1135
- "use strict";
1136
- var __defProp2 = Object.defineProperty;
1137
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1138
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1139
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1140
- var __export2 = (target, all) => {
1141
- for (var name in all)
1142
- __defProp2(target, name, { get: all[name], enumerable: true });
1143
- };
1144
- var __copyProps2 = (to, from, except, desc) => {
1145
- if (from && typeof from === "object" || typeof from === "function") {
1146
- for (let key of __getOwnPropNames2(from))
1147
- if (!__hasOwnProp2.call(to, key) && key !== except)
1148
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1149
- }
1150
- return to;
1151
- };
1152
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1153
- var globals_exports = {};
1154
- __export2(globals_exports, {
1155
- document: () => document2,
1156
- global: () => global,
1157
- self: () => self,
1158
- window: () => window
1159
- });
1160
- module2.exports = __toCommonJS2(globals_exports);
1161
- var global = globalThis;
1162
- var self = globalThis;
1163
- var window = globalThis;
1164
- var document2 = window.document;
1165
- }
1166
- });
1167
-
1168
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1169
- var require_cookie = __commonJS({
1170
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1171
- "use strict";
1172
- var __defProp2 = Object.defineProperty;
1173
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1174
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1175
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1176
- var __export2 = (target, all) => {
1177
- for (var name in all)
1178
- __defProp2(target, name, { get: all[name], enumerable: true });
1179
- };
1180
- var __copyProps2 = (to, from, except, desc) => {
1181
- if (from && typeof from === "object" || typeof from === "function") {
1182
- for (let key of __getOwnPropNames2(from))
1183
- if (!__hasOwnProp2.call(to, key) && key !== except)
1184
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1185
- }
1186
- return to;
1187
- };
1188
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1189
- var cookie_exports = {};
1190
- __export2(cookie_exports, {
1191
- getCookie: () => getCookie,
1192
- isMobile: () => isMobile,
1193
- setCookie: () => setCookie
1194
- });
1195
- module2.exports = __toCommonJS2(cookie_exports);
1196
- var import_types = require_types();
1197
- var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
1198
- var setCookie = (cname, cvalue, exdays = 365) => {
1199
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1200
- return;
1201
- const d = /* @__PURE__ */ new Date();
1202
- d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
1203
- const expires = `expires=${d.toUTCString()}`;
1204
- document.cookie = `${cname}=${cvalue};${expires};path=/`;
1205
- };
1206
- var getCookie = (cname) => {
1207
- if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
1208
- return;
1209
- const name = `${cname}=`;
1210
- const decodedCookie = decodeURIComponent(document.cookie);
1211
- const ca = decodedCookie.split(";");
1212
- for (let i = 0; i < ca.length; i++) {
1213
- let c = ca[i];
1214
- while (c.charAt(0) === " ")
1215
- c = c.substring(1);
1216
- if (c.indexOf(name) === 0)
1217
- return c.substring(name.length, c.length);
1218
- }
1219
- return "";
1220
- };
1221
- }
1222
- });
1223
-
1224
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1225
- var require_cjs3 = __commonJS({
1226
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1227
- "use strict";
1228
- var __defProp2 = Object.defineProperty;
1229
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1230
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
1231
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1232
- var __copyProps2 = (to, from, except, desc) => {
1233
- if (from && typeof from === "object" || typeof from === "function") {
1234
- for (let key of __getOwnPropNames2(from))
1235
- if (!__hasOwnProp2.call(to, key) && key !== except)
1236
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1237
- }
1238
- return to;
1239
- };
1240
- var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
1241
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1242
- var utils_exports = {};
1243
- module2.exports = __toCommonJS2(utils_exports);
1244
- __reExport(utils_exports, require_key(), module2.exports);
1245
- __reExport(utils_exports, require_env(), module2.exports);
1246
- __reExport(utils_exports, require_types(), module2.exports);
1247
- __reExport(utils_exports, require_object(), module2.exports);
1248
- __reExport(utils_exports, require_function(), module2.exports);
1249
- __reExport(utils_exports, require_array(), module2.exports);
1250
- __reExport(utils_exports, require_node(), module2.exports);
1251
- __reExport(utils_exports, require_log(), module2.exports);
1252
- __reExport(utils_exports, require_string(), module2.exports);
1253
- __reExport(utils_exports, require_globals(), module2.exports);
1254
- __reExport(utils_exports, require_cookie(), module2.exports);
1255
- }
1256
- });
1257
-
1258
- // src/utils/var.js
1259
- var var_exports = {};
1260
- __export(var_exports, {
1261
- applySequenceVars: () => applySequenceVars,
1262
- setVariables: () => setVariables
1263
- });
1264
- module.exports = __toCommonJS(var_exports);
1265
- var import_utils2 = __toESM(require_cjs3(), 1);
1266
-
1267
- // src/factory.js
1268
- var import_utils = __toESM(require_cjs3(), 1);
1269
-
1270
- // src/defaultConfig/index.js
1271
- var defaultConfig_exports = {};
1272
- __export(defaultConfig_exports, {
1273
- ANIMATION: () => ANIMATION,
1274
- BREAKPOINTS: () => BREAKPOINTS,
1275
- CASES: () => CASES,
1276
- COLOR: () => COLOR,
1277
- DEVICES: () => DEVICES,
1278
- DOCUMENT: () => DOCUMENT,
1279
- FONT: () => FONT,
1280
- FONT_FACE: () => FONT_FACE,
1281
- FONT_FAMILY: () => FONT_FAMILY,
1282
- FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
1283
- GRADIENT: () => GRADIENT,
1284
- ICONS: () => ICONS,
1285
- MEDIA: () => MEDIA,
1286
- RESET: () => RESET,
1287
- SEQUENCE: () => SEQUENCE,
1288
- SPACING: () => SPACING,
1289
- SVG: () => SVG,
1290
- SVG_DATA: () => SVG_DATA,
1291
- TEMPLATES: () => TEMPLATES,
1292
- THEME: () => THEME,
1293
- TIMING: () => TIMING,
1294
- TYPOGRAPHY: () => TYPOGRAPHY,
1295
- UNIT: () => UNIT
1296
- });
1297
-
1298
- // src/defaultConfig/sequence.js
1299
- var SEQUENCE = {
1300
- "minor-second": 1.067,
1301
- "major-second": 1.125,
1302
- "minor-third": 1.2,
1303
- "major-third": 1.25,
1304
- "perfect-fourth": 1.333,
1305
- "augmented-fourth": 1.414,
1306
- "perfect-fifth": 1.5,
1307
- "minor-sixth": 1.6,
1308
- phi: 1.618,
1309
- // golden-ratio
1310
- "major-sixth": 1.667,
1311
- "square-root-3": 1.732,
1312
- // theodorus
1313
- "minor-seventh": 1.778,
1314
- "major-seventh": 1.875,
1315
- octave: 2,
1316
- "square-root-5": 2.23,
1317
- // pythagoras
1318
- "major-tenth": 2.5,
1319
- "major-eleventh": 2.667,
1320
- "major-twelfth": 3,
1321
- pi: 3.14,
1322
- // archimedes
1323
- "double-octave": 4
1324
- };
1325
-
1326
- // src/defaultConfig/unit.js
1327
- var UNIT = {
1328
- default: "em"
1329
- };
1330
-
1331
- // src/defaultConfig/typography.js
1332
- var defaultProps = {
1333
- browserDefault: 16,
1334
- base: 16,
1335
- type: "font-size",
1336
- ratio: SEQUENCE["minor-third"],
1337
- range: [-3, 12],
1338
- h1Matches: 6,
1339
- lineHeight: 1.5,
1340
- subSequence: true,
1341
- unit: "em",
1342
- templates: {},
1343
- sequence: {},
1344
- scales: {},
1345
- vars: {}
1346
- };
1347
- var TYPOGRAPHY = defaultProps;
1348
-
1349
- // src/defaultConfig/font.js
1350
- var FONT = {};
1351
-
1352
- // src/defaultConfig/font-family.js
1353
- var FONT_FAMILY = {};
1354
- var FONT_FAMILY_TYPES = {
1355
- "sans-serif": "Helvetica, Arial, sans-serif, --system-default",
1356
- serif: "Times New Roman, Georgia, serif, --system-default",
1357
- monospace: "Courier New, monospace, --system-default"
1358
- };
1359
- var FONT_FACE = {};
1360
-
1361
- // src/defaultConfig/media.js
1362
- var MEDIA = {
1363
- tv: "(min-width: 2780px)",
1364
- screenL: "(max-width: 1920px)",
1365
- "screenL<": "(min-width: 1920px)",
1366
- screenM: "(max-width: 1680px)",
1367
- "screenM<": "(min-width: 1680px)",
1368
- screenS: "(max-width: 1440px)",
1369
- "screenS<": "(min-width: 1440px)",
1370
- tabletL: "(max-width: 1366px)",
1371
- "tabletL<": "(min-width: 1366px)",
1372
- tabletM: "(max-width: 1280px)",
1373
- "tabletM<": "(min-width: 1280px)",
1374
- tabletS: "(max-width: 1024px)",
1375
- "tabletS<": "(min-width: 1024px)",
1376
- mobileL: "(max-width: 768px)",
1377
- "mobileL<": "(min-width: 768px)",
1378
- mobileM: "(max-width: 560px)",
1379
- "mobileM<": "(min-width: 560px)",
1380
- mobileS: "(max-width: 480px)",
1381
- "mobileS<": "(min-width: 480px)",
1382
- mobileXS: "(max-width: 375px)",
1383
- "mobileXS<": "(min-width: 375px)",
1384
- light: "(prefers-color-scheme: light)",
1385
- dark: "(prefers-color-scheme: dark)",
1386
- print: "print"
1387
- };
1388
-
1389
- // src/defaultConfig/spacing.js
1390
- var defaultProps2 = {
1391
- base: TYPOGRAPHY.base,
1392
- type: "spacing",
1393
- ratio: SEQUENCE.phi,
1394
- range: [-5, 15],
1395
- subSequence: true,
1396
- unit: "em",
1397
- sequence: {},
1398
- scales: {},
1399
- vars: {}
1400
- };
1401
- var SPACING = defaultProps2;
1402
-
1403
- // src/defaultConfig/color.js
1404
- var COLOR = {};
1405
- var GRADIENT = {};
1406
-
1407
- // src/defaultConfig/theme.js
1408
- var THEME = {};
1409
-
1410
- // src/defaultConfig/icons.js
1411
- var ICONS = {};
1412
-
1413
- // src/defaultConfig/timing.js
1414
- var defaultProps3 = {
1415
- default: 150,
1416
- base: 150,
1417
- type: "timing",
1418
- ratio: SEQUENCE["perfect-fourth"],
1419
- range: [-3, 12],
1420
- unit: "ms",
1421
- sequence: {},
1422
- scales: {},
1423
- vars: {}
1424
- };
1425
- var TIMING = defaultProps3;
1426
-
1427
- // src/defaultConfig/document.js
1428
- var DOCUMENT = {};
1429
-
1430
- // src/defaultConfig/responsive.js
1431
- var BREAKPOINTS = {
1432
- screenL: 1920,
1433
- screenM: 1680,
1434
- screenS: 1440,
1435
- tabletL: 1366,
1436
- tabletM: 1280,
1437
- tabletS: 1024,
1438
- mobileL: 768,
1439
- mobileM: 560,
1440
- mobileS: 480,
1441
- mobileXS: 375
1442
- };
1443
- var DEVICES = {
1444
- screenL: [1920, 1024],
1445
- screenM: [1680, 1024],
1446
- screenS: [1440, 978],
1447
- tabletL: [1366, 926],
1448
- tabletM: [1280, 768],
1449
- tabletS: [1024, 768],
1450
- mobileL: [768, 375],
1451
- mobileM: [560, 768],
1452
- mobileS: [480, 768],
1453
- mobileXS: [375, 768]
1454
- };
1455
-
1456
- // src/defaultConfig/cases.js
1457
- var CASES = {};
1458
-
1459
- // src/defaultConfig/animation.js
1460
- var ANIMATION = {};
1461
-
1462
- // src/defaultConfig/svg.js
1463
- var SVG = {};
1464
- var SVG_DATA = {};
1465
-
1466
- // src/defaultConfig/templates.js
1467
- var TEMPLATES = {};
1468
-
1469
- // src/defaultConfig/index.js
1470
- var RESET = {};
1471
-
1472
- // src/factory.js
1473
- var CSS_VARS = {};
1474
- var CONFIG = {
1475
- verbose: false,
1476
- useVariable: true,
1477
- useReset: true,
1478
- CSS_VARS,
1479
- ...defaultConfig_exports
1480
- };
1481
- var cachedConfig = (0, import_utils.deepClone)(CONFIG);
1482
- var FACTORY = {
1483
- active: "0",
1484
- 0: CONFIG
1485
- };
1486
- var getActiveConfig = (def) => {
1487
- return FACTORY[def || FACTORY.active];
1488
- };
1489
-
1490
- // src/utils/var.js
1491
- var setVariables = (result, key) => {
1492
- const CONFIG2 = getActiveConfig();
1493
- const { CSS_VARS: CSS_VARS2 } = CONFIG2;
1494
- if ((0, import_utils2.isObjectLike)(result.value)) {
1495
- } else {
1496
- CSS_VARS2[result.var] = result.value;
1497
- }
1498
- };
1499
- var applySequenceVars = (props, mediaName, options = {}) => {
1500
- const CONFIG2 = getActiveConfig();
1501
- const { UNIT: UNIT2, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
1502
- const unit = props.unit || UNIT2.default;
1503
- const { sequence, scales } = props;
1504
- for (const key in sequence) {
1505
- const item = sequence[key];
1506
- const value = (props.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
1507
- if (mediaName) {
1508
- const query = MEDIA2[mediaName];
1509
- if (!query) {
1510
- if (CONFIG2.verbose)
1511
- console.warn("Can't find query ", query);
1512
- }
1513
- let underMediaQuery = CSS_VARS2[`@media ${query}`];
1514
- if (!underMediaQuery)
1515
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1516
- underMediaQuery[item.variable] = `var(${item.variable + "-" + mediaName})`;
1517
- CSS_VARS2[item.variable + "-" + mediaName] = value;
1518
- } else {
1519
- if (options.useDefault === false) {
1520
- CSS_VARS2[item.variable] = value;
1521
- } else {
1522
- CSS_VARS2[item.variable + "-default"] = value;
1523
- CSS_VARS2[item.variable] = `var(${item.variable + "-default"})`;
1524
- }
1525
- }
1526
- }
1527
- };