@symbo.ls/scratch 2.11.360 → 2.11.373
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory.js +10 -4
- package/dist/cjs/index.js +1549 -115
- package/dist/cjs/set.js +1530 -93
- package/dist/cjs/system/color.js +1487 -38
- package/dist/cjs/system/document.js +1477 -28
- package/dist/cjs/system/font.js +1485 -47
- package/dist/cjs/system/index.js +1536 -104
- package/dist/cjs/system/reset.js +1486 -37
- package/dist/cjs/system/shadow.js +1492 -57
- package/dist/cjs/system/spacing.js +1490 -55
- package/dist/cjs/system/svg.js +1479 -30
- package/dist/cjs/system/theme.js +1494 -45
- package/dist/cjs/system/timing.js +1485 -43
- package/dist/cjs/system/typography.js +1480 -36
- package/dist/cjs/transforms/index.js +1506 -74
- package/dist/cjs/utils/color.js +10 -4
- package/dist/cjs/utils/index.js +1482 -36
- package/dist/cjs/utils/sequence.js +1477 -31
- package/dist/cjs/utils/sprite.js +10 -4
- package/dist/cjs/utils/var.js +1475 -26
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -241,32 +241,32 @@ var require_types = __commonJS({
|
|
|
241
241
|
__export2(types_exports, {
|
|
242
242
|
TYPES: () => TYPES,
|
|
243
243
|
is: () => is,
|
|
244
|
-
isArray: () =>
|
|
244
|
+
isArray: () => isArray7,
|
|
245
245
|
isBoolean: () => isBoolean,
|
|
246
246
|
isDate: () => isDate,
|
|
247
247
|
isDefined: () => isDefined2,
|
|
248
248
|
isFunction: () => isFunction2,
|
|
249
249
|
isNot: () => isNot,
|
|
250
250
|
isNull: () => isNull2,
|
|
251
|
-
isNumber: () =>
|
|
252
|
-
isObject: () =>
|
|
251
|
+
isNumber: () => isNumber2,
|
|
252
|
+
isObject: () => isObject6,
|
|
253
253
|
isObjectLike: () => isObjectLike3,
|
|
254
|
-
isString: () =>
|
|
254
|
+
isString: () => isString9,
|
|
255
255
|
isUndefined: () => isUndefined2
|
|
256
256
|
});
|
|
257
257
|
module2.exports = __toCommonJS2(types_exports);
|
|
258
258
|
var import_node = require_node();
|
|
259
|
-
var
|
|
259
|
+
var isObject6 = (arg) => {
|
|
260
260
|
if (arg === null)
|
|
261
261
|
return false;
|
|
262
262
|
return typeof arg === "object" && arg.constructor === Object;
|
|
263
263
|
};
|
|
264
|
-
var
|
|
265
|
-
var
|
|
264
|
+
var isString9 = (arg) => typeof arg === "string";
|
|
265
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
266
266
|
var isFunction2 = (arg) => typeof arg === "function";
|
|
267
267
|
var isBoolean = (arg) => arg === true || arg === false;
|
|
268
268
|
var isNull2 = (arg) => arg === null;
|
|
269
|
-
var
|
|
269
|
+
var isArray7 = (arg) => Array.isArray(arg);
|
|
270
270
|
var isDate = (d) => d instanceof Date;
|
|
271
271
|
var isObjectLike3 = (arg) => {
|
|
272
272
|
if (arg === null)
|
|
@@ -274,18 +274,18 @@ var require_types = __commonJS({
|
|
|
274
274
|
return typeof arg === "object";
|
|
275
275
|
};
|
|
276
276
|
var isDefined2 = (arg) => {
|
|
277
|
-
return
|
|
277
|
+
return isObject6(arg) || isObjectLike3(arg) || isString9(arg) || isNumber2(arg) || isFunction2(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
|
|
278
278
|
};
|
|
279
279
|
var isUndefined2 = (arg) => {
|
|
280
280
|
return arg === void 0;
|
|
281
281
|
};
|
|
282
282
|
var TYPES = {
|
|
283
283
|
boolean: isBoolean,
|
|
284
|
-
array:
|
|
285
|
-
object:
|
|
286
|
-
string:
|
|
284
|
+
array: isArray7,
|
|
285
|
+
object: isObject6,
|
|
286
|
+
string: isString9,
|
|
287
287
|
date: isDate,
|
|
288
|
-
number:
|
|
288
|
+
number: isNumber2,
|
|
289
289
|
null: isNull2,
|
|
290
290
|
function: isFunction2,
|
|
291
291
|
objectLike: isObjectLike3,
|
|
@@ -333,6 +333,7 @@ var require_array = __commonJS({
|
|
|
333
333
|
createNestedObject: () => createNestedObject,
|
|
334
334
|
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
335
335
|
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
336
|
+
getFrequencyInArray: () => getFrequencyInArray,
|
|
336
337
|
joinArrays: () => joinArrays,
|
|
337
338
|
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
338
339
|
mergeArray: () => mergeArray,
|
|
@@ -347,6 +348,11 @@ var require_array = __commonJS({
|
|
|
347
348
|
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
348
349
|
return arr2.every((val) => arr1.includes(val));
|
|
349
350
|
};
|
|
351
|
+
var getFrequencyInArray = (arr, value) => {
|
|
352
|
+
return arr.reduce((count, currentValue) => {
|
|
353
|
+
return currentValue === value ? count + 1 : count;
|
|
354
|
+
}, 0);
|
|
355
|
+
};
|
|
350
356
|
var removeFromArray = (arr, index) => {
|
|
351
357
|
if ((0, import_types.isString)(index))
|
|
352
358
|
index = parseInt(index);
|
|
@@ -413,7 +419,7 @@ var require_array = __commonJS({
|
|
|
413
419
|
newArray.splice(index, 1);
|
|
414
420
|
return newArray;
|
|
415
421
|
}
|
|
416
|
-
return arr
|
|
422
|
+
return arr;
|
|
417
423
|
};
|
|
418
424
|
var removeValueFromArrayAll = (arr, value) => {
|
|
419
425
|
return arr.filter((item) => item !== value);
|
|
@@ -761,7 +767,7 @@ var require_object = __commonJS({
|
|
|
761
767
|
continue;
|
|
762
768
|
const objProp = obj[prop];
|
|
763
769
|
if ((0, import_types.isString)(objProp)) {
|
|
764
|
-
if (objProp.includes("=>") || objProp.
|
|
770
|
+
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
765
771
|
try {
|
|
766
772
|
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
767
773
|
destringified[prop] = evalProp;
|
|
@@ -801,11 +807,11 @@ var require_object = __commonJS({
|
|
|
801
807
|
}
|
|
802
808
|
return destringified;
|
|
803
809
|
};
|
|
804
|
-
var stringToObject = (str, verbose) => {
|
|
810
|
+
var stringToObject = (str, opts = { verbose: true }) => {
|
|
805
811
|
try {
|
|
806
812
|
return import_globals3.window.eval("(" + str + ")");
|
|
807
813
|
} catch (e) {
|
|
808
|
-
if (verbose)
|
|
814
|
+
if (opts.verbose)
|
|
809
815
|
console.warn(e);
|
|
810
816
|
}
|
|
811
817
|
};
|
|
@@ -1379,6 +1385,1454 @@ var require_cjs2 = __commonJS({
|
|
|
1379
1385
|
}
|
|
1380
1386
|
});
|
|
1381
1387
|
|
|
1388
|
+
// ../utils/dist/cjs/index.js
|
|
1389
|
+
var require_cjs3 = __commonJS({
|
|
1390
|
+
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
1391
|
+
"use strict";
|
|
1392
|
+
var __create2 = Object.create;
|
|
1393
|
+
var __defProp2 = Object.defineProperty;
|
|
1394
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
1395
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
1396
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
1397
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1398
|
+
var __commonJS2 = (cb, mod) => function __require() {
|
|
1399
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
1400
|
+
};
|
|
1401
|
+
var __export2 = (target, all) => {
|
|
1402
|
+
for (var name in all)
|
|
1403
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
1404
|
+
};
|
|
1405
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
1406
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1407
|
+
for (let key of __getOwnPropNames2(from))
|
|
1408
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
1409
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
1410
|
+
}
|
|
1411
|
+
return to;
|
|
1412
|
+
};
|
|
1413
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1414
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
1415
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
1416
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1417
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1418
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
1419
|
+
mod
|
|
1420
|
+
));
|
|
1421
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
1422
|
+
var require_key2 = __commonJS2({
|
|
1423
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports2, module22) {
|
|
1424
|
+
"use strict";
|
|
1425
|
+
var __defProp22 = Object.defineProperty;
|
|
1426
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1427
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1428
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1429
|
+
var __export22 = (target, all) => {
|
|
1430
|
+
for (var name in all)
|
|
1431
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1432
|
+
};
|
|
1433
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1434
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1435
|
+
for (let key of __getOwnPropNames22(from))
|
|
1436
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1437
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1438
|
+
}
|
|
1439
|
+
return to;
|
|
1440
|
+
};
|
|
1441
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1442
|
+
var key_exports = {};
|
|
1443
|
+
__export22(key_exports, {
|
|
1444
|
+
createSnapshotId: () => createSnapshotId,
|
|
1445
|
+
generateKey: () => generateKey
|
|
1446
|
+
});
|
|
1447
|
+
module22.exports = __toCommonJS22(key_exports);
|
|
1448
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
1449
|
+
let index = 0;
|
|
1450
|
+
function newId() {
|
|
1451
|
+
index++;
|
|
1452
|
+
return index;
|
|
1453
|
+
}
|
|
1454
|
+
return newId;
|
|
1455
|
+
}();
|
|
1456
|
+
var createSnapshotId = generateKey;
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
var require_env2 = __commonJS2({
|
|
1460
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports2, module22) {
|
|
1461
|
+
"use strict";
|
|
1462
|
+
var __defProp22 = Object.defineProperty;
|
|
1463
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1464
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1465
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1466
|
+
var __export22 = (target, all) => {
|
|
1467
|
+
for (var name in all)
|
|
1468
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1469
|
+
};
|
|
1470
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1471
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1472
|
+
for (let key of __getOwnPropNames22(from))
|
|
1473
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1474
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1475
|
+
}
|
|
1476
|
+
return to;
|
|
1477
|
+
};
|
|
1478
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1479
|
+
var env_exports = {};
|
|
1480
|
+
__export22(env_exports, {
|
|
1481
|
+
NODE_ENV: () => NODE_ENV,
|
|
1482
|
+
getNev: () => getNev,
|
|
1483
|
+
isDevelopment: () => isDevelopment,
|
|
1484
|
+
isProduction: () => isProduction,
|
|
1485
|
+
isTest: () => isTest
|
|
1486
|
+
});
|
|
1487
|
+
module22.exports = __toCommonJS22(env_exports);
|
|
1488
|
+
var NODE_ENV = "development";
|
|
1489
|
+
var isProduction = (env = NODE_ENV) => env === "production" || env === "prod" || env !== "development" && env !== "dev" && env !== "test";
|
|
1490
|
+
var isTest = (env = NODE_ENV) => env === "test";
|
|
1491
|
+
var isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev";
|
|
1492
|
+
var getNev = (key, env = NODE_ENV) => env[key];
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
var require_globals2 = __commonJS2({
|
|
1496
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports2, module22) {
|
|
1497
|
+
"use strict";
|
|
1498
|
+
var __defProp22 = Object.defineProperty;
|
|
1499
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1500
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1501
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1502
|
+
var __export22 = (target, all) => {
|
|
1503
|
+
for (var name in all)
|
|
1504
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1505
|
+
};
|
|
1506
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1507
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1508
|
+
for (let key of __getOwnPropNames22(from))
|
|
1509
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1510
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1511
|
+
}
|
|
1512
|
+
return to;
|
|
1513
|
+
};
|
|
1514
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1515
|
+
var globals_exports = {};
|
|
1516
|
+
__export22(globals_exports, {
|
|
1517
|
+
document: () => document22,
|
|
1518
|
+
global: () => global,
|
|
1519
|
+
self: () => self,
|
|
1520
|
+
window: () => window2
|
|
1521
|
+
});
|
|
1522
|
+
module22.exports = __toCommonJS22(globals_exports);
|
|
1523
|
+
var global = globalThis;
|
|
1524
|
+
var self = globalThis;
|
|
1525
|
+
var window2 = globalThis;
|
|
1526
|
+
var document22 = window2.document;
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
var require_node2 = __commonJS2({
|
|
1530
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports2, module22) {
|
|
1531
|
+
"use strict";
|
|
1532
|
+
var __defProp22 = Object.defineProperty;
|
|
1533
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1534
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1535
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1536
|
+
var __export22 = (target, all) => {
|
|
1537
|
+
for (var name in all)
|
|
1538
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1539
|
+
};
|
|
1540
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1541
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1542
|
+
for (let key of __getOwnPropNames22(from))
|
|
1543
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1544
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1545
|
+
}
|
|
1546
|
+
return to;
|
|
1547
|
+
};
|
|
1548
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1549
|
+
var node_exports = {};
|
|
1550
|
+
__export22(node_exports, {
|
|
1551
|
+
isHtmlElement: () => isHtmlElement,
|
|
1552
|
+
isNode: () => isNode
|
|
1553
|
+
});
|
|
1554
|
+
module22.exports = __toCommonJS22(node_exports);
|
|
1555
|
+
var import_globals3 = require_globals2();
|
|
1556
|
+
var isNode = (obj) => {
|
|
1557
|
+
return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
|
|
1558
|
+
};
|
|
1559
|
+
var isHtmlElement = (obj) => {
|
|
1560
|
+
return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
var require_types2 = __commonJS2({
|
|
1565
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports2, module22) {
|
|
1566
|
+
"use strict";
|
|
1567
|
+
var __defProp22 = Object.defineProperty;
|
|
1568
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1569
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1570
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1571
|
+
var __export22 = (target, all) => {
|
|
1572
|
+
for (var name in all)
|
|
1573
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1574
|
+
};
|
|
1575
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1576
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1577
|
+
for (let key of __getOwnPropNames22(from))
|
|
1578
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1579
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1580
|
+
}
|
|
1581
|
+
return to;
|
|
1582
|
+
};
|
|
1583
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1584
|
+
var types_exports = {};
|
|
1585
|
+
__export22(types_exports, {
|
|
1586
|
+
TYPES: () => TYPES,
|
|
1587
|
+
is: () => is,
|
|
1588
|
+
isArray: () => isArray32,
|
|
1589
|
+
isBoolean: () => isBoolean,
|
|
1590
|
+
isDate: () => isDate,
|
|
1591
|
+
isDefined: () => isDefined2,
|
|
1592
|
+
isFunction: () => isFunction2,
|
|
1593
|
+
isNot: () => isNot,
|
|
1594
|
+
isNull: () => isNull2,
|
|
1595
|
+
isNumber: () => isNumber2,
|
|
1596
|
+
isObject: () => isObject32,
|
|
1597
|
+
isObjectLike: () => isObjectLike3,
|
|
1598
|
+
isString: () => isString22,
|
|
1599
|
+
isUndefined: () => isUndefined2
|
|
1600
|
+
});
|
|
1601
|
+
module22.exports = __toCommonJS22(types_exports);
|
|
1602
|
+
var import_node = require_node2();
|
|
1603
|
+
var isObject32 = (arg) => {
|
|
1604
|
+
if (arg === null)
|
|
1605
|
+
return false;
|
|
1606
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
1607
|
+
};
|
|
1608
|
+
var isString22 = (arg) => typeof arg === "string";
|
|
1609
|
+
var isNumber2 = (arg) => typeof arg === "number";
|
|
1610
|
+
var isFunction2 = (arg) => typeof arg === "function";
|
|
1611
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
1612
|
+
var isNull2 = (arg) => arg === null;
|
|
1613
|
+
var isArray32 = (arg) => Array.isArray(arg);
|
|
1614
|
+
var isDate = (d) => d instanceof Date;
|
|
1615
|
+
var isObjectLike3 = (arg) => {
|
|
1616
|
+
if (arg === null)
|
|
1617
|
+
return false;
|
|
1618
|
+
return typeof arg === "object";
|
|
1619
|
+
};
|
|
1620
|
+
var isDefined2 = (arg) => {
|
|
1621
|
+
return isObject32(arg) || isObjectLike3(arg) || isString22(arg) || isNumber2(arg) || isFunction2(arg) || isArray32(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
|
|
1622
|
+
};
|
|
1623
|
+
var isUndefined2 = (arg) => {
|
|
1624
|
+
return arg === void 0;
|
|
1625
|
+
};
|
|
1626
|
+
var TYPES = {
|
|
1627
|
+
boolean: isBoolean,
|
|
1628
|
+
array: isArray32,
|
|
1629
|
+
object: isObject32,
|
|
1630
|
+
string: isString22,
|
|
1631
|
+
date: isDate,
|
|
1632
|
+
number: isNumber2,
|
|
1633
|
+
null: isNull2,
|
|
1634
|
+
function: isFunction2,
|
|
1635
|
+
objectLike: isObjectLike3,
|
|
1636
|
+
node: import_node.isNode,
|
|
1637
|
+
htmlElement: import_node.isHtmlElement,
|
|
1638
|
+
defined: isDefined2
|
|
1639
|
+
};
|
|
1640
|
+
var is = (arg) => {
|
|
1641
|
+
return (...args) => {
|
|
1642
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
1643
|
+
};
|
|
1644
|
+
};
|
|
1645
|
+
var isNot = (arg) => {
|
|
1646
|
+
return (...args) => {
|
|
1647
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
1648
|
+
};
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1651
|
+
});
|
|
1652
|
+
var require_array2 = __commonJS2({
|
|
1653
|
+
"../../node_modules/@domql/utils/dist/cjs/array.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 array_exports = {};
|
|
1673
|
+
__export22(array_exports, {
|
|
1674
|
+
arrayContainsOtherArray: () => arrayContainsOtherArray,
|
|
1675
|
+
createNestedObject: () => createNestedObject,
|
|
1676
|
+
cutArrayAfterValue: () => cutArrayAfterValue,
|
|
1677
|
+
cutArrayBeforeValue: () => cutArrayBeforeValue,
|
|
1678
|
+
getFrequencyInArray: () => getFrequencyInArray,
|
|
1679
|
+
joinArrays: () => joinArrays,
|
|
1680
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
1681
|
+
mergeArray: () => mergeArray,
|
|
1682
|
+
removeFromArray: () => removeFromArray,
|
|
1683
|
+
removeValueFromArray: () => removeValueFromArray,
|
|
1684
|
+
removeValueFromArrayAll: () => removeValueFromArrayAll,
|
|
1685
|
+
swapItemsInArray: () => swapItemsInArray
|
|
1686
|
+
});
|
|
1687
|
+
module22.exports = __toCommonJS22(array_exports);
|
|
1688
|
+
var import_object = require_object2();
|
|
1689
|
+
var import_types = require_types2();
|
|
1690
|
+
var arrayContainsOtherArray = (arr1, arr2) => {
|
|
1691
|
+
return arr2.every((val) => arr1.includes(val));
|
|
1692
|
+
};
|
|
1693
|
+
var getFrequencyInArray = (arr, value) => {
|
|
1694
|
+
return arr.reduce((count, currentValue) => {
|
|
1695
|
+
return currentValue === value ? count + 1 : count;
|
|
1696
|
+
}, 0);
|
|
1697
|
+
};
|
|
1698
|
+
var removeFromArray = (arr, index) => {
|
|
1699
|
+
if ((0, import_types.isString)(index))
|
|
1700
|
+
index = parseInt(index);
|
|
1701
|
+
if ((0, import_types.isNumber)(index)) {
|
|
1702
|
+
if (index < 0 || index >= arr.length || isNaN(index)) {
|
|
1703
|
+
throw new Error("Invalid index");
|
|
1704
|
+
}
|
|
1705
|
+
arr.splice(index, 1);
|
|
1706
|
+
} else if ((0, import_types.isArray)(index)) {
|
|
1707
|
+
index.forEach((idx) => removeFromArray(arr, idx));
|
|
1708
|
+
} else {
|
|
1709
|
+
throw new Error("Invalid index");
|
|
1710
|
+
}
|
|
1711
|
+
return arr;
|
|
1712
|
+
};
|
|
1713
|
+
var swapItemsInArray = (arr, i, j) => {
|
|
1714
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1715
|
+
};
|
|
1716
|
+
var joinArrays = (...arrays) => {
|
|
1717
|
+
return [].concat(...arrays);
|
|
1718
|
+
};
|
|
1719
|
+
var mergeArray = (arr, excludeFrom = []) => {
|
|
1720
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
1721
|
+
};
|
|
1722
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
1723
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
|
1724
|
+
};
|
|
1725
|
+
var cutArrayBeforeValue = (arr, value) => {
|
|
1726
|
+
const index = arr.indexOf(value);
|
|
1727
|
+
if (index !== -1) {
|
|
1728
|
+
return arr.slice(0, index);
|
|
1729
|
+
}
|
|
1730
|
+
return arr;
|
|
1731
|
+
};
|
|
1732
|
+
var cutArrayAfterValue = (arr, value) => {
|
|
1733
|
+
if (!(0, import_types.isArray)(arr))
|
|
1734
|
+
return;
|
|
1735
|
+
const index = arr.indexOf(value);
|
|
1736
|
+
if (index !== -1) {
|
|
1737
|
+
return arr.slice(index + 1);
|
|
1738
|
+
}
|
|
1739
|
+
return arr;
|
|
1740
|
+
};
|
|
1741
|
+
var createNestedObject = (arr, lastValue) => {
|
|
1742
|
+
const nestedObject = {};
|
|
1743
|
+
if (arr.length === 0) {
|
|
1744
|
+
return lastValue;
|
|
1745
|
+
}
|
|
1746
|
+
arr.reduce((obj, value, index) => {
|
|
1747
|
+
if (!obj[value]) {
|
|
1748
|
+
obj[value] = {};
|
|
1749
|
+
}
|
|
1750
|
+
if (index === arr.length - 1 && lastValue) {
|
|
1751
|
+
obj[value] = lastValue;
|
|
1752
|
+
}
|
|
1753
|
+
return obj[value];
|
|
1754
|
+
}, nestedObject);
|
|
1755
|
+
return nestedObject;
|
|
1756
|
+
};
|
|
1757
|
+
var removeValueFromArray = (arr, value) => {
|
|
1758
|
+
const index = arr.indexOf(value);
|
|
1759
|
+
if (index > -1) {
|
|
1760
|
+
const newArray = [...arr];
|
|
1761
|
+
newArray.splice(index, 1);
|
|
1762
|
+
return newArray;
|
|
1763
|
+
}
|
|
1764
|
+
return arr;
|
|
1765
|
+
};
|
|
1766
|
+
var removeValueFromArrayAll = (arr, value) => {
|
|
1767
|
+
return arr.filter((item) => item !== value);
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
var require_string2 = __commonJS2({
|
|
1772
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
|
|
1773
|
+
"use strict";
|
|
1774
|
+
var __defProp22 = Object.defineProperty;
|
|
1775
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1776
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1777
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1778
|
+
var __export22 = (target, all) => {
|
|
1779
|
+
for (var name in all)
|
|
1780
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1781
|
+
};
|
|
1782
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1783
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1784
|
+
for (let key of __getOwnPropNames22(from))
|
|
1785
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1786
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1787
|
+
}
|
|
1788
|
+
return to;
|
|
1789
|
+
};
|
|
1790
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1791
|
+
var string_exports = {};
|
|
1792
|
+
__export22(string_exports, {
|
|
1793
|
+
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
1794
|
+
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
1795
|
+
stringIncludesAny: () => stringIncludesAny,
|
|
1796
|
+
trimStringFromSymbols: () => trimStringFromSymbols
|
|
1797
|
+
});
|
|
1798
|
+
module22.exports = __toCommonJS22(string_exports);
|
|
1799
|
+
var stringIncludesAny = (str, characters) => {
|
|
1800
|
+
for (const char of characters) {
|
|
1801
|
+
if (str.includes(char)) {
|
|
1802
|
+
return true;
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
return false;
|
|
1806
|
+
};
|
|
1807
|
+
var trimStringFromSymbols = (str, characters) => {
|
|
1808
|
+
const pattern = new RegExp(`[${characters.join("\\")}]`, "g");
|
|
1809
|
+
return str.replace(pattern, "");
|
|
1810
|
+
};
|
|
1811
|
+
var brackRegex = {
|
|
1812
|
+
2: /\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g,
|
|
1813
|
+
3: /\{\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}\}/g
|
|
1814
|
+
};
|
|
1815
|
+
var replaceLiteralsWithObjectFields = (str, state, options = {}) => {
|
|
1816
|
+
if (!str.includes(options.bracketsLength === 3 ? "{{{" : "{{"))
|
|
1817
|
+
return str;
|
|
1818
|
+
const reg = brackRegex[options.bracketsLength || 2];
|
|
1819
|
+
return str.replace(reg, (_, parentPath, variable) => {
|
|
1820
|
+
if (parentPath) {
|
|
1821
|
+
const parentLevels = parentPath.match(options.bracketsLength === 3 ? /\.\.\.\//g : /\.\.\//g).length;
|
|
1822
|
+
let parentState = state;
|
|
1823
|
+
for (let i = 0; i < parentLevels; i++) {
|
|
1824
|
+
parentState = parentState.parent;
|
|
1825
|
+
if (!parentState) {
|
|
1826
|
+
return "";
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
const value = parentState[variable.trim()];
|
|
1830
|
+
return value !== void 0 ? `${value}` : "";
|
|
1831
|
+
} else {
|
|
1832
|
+
const value = state[variable.trim()];
|
|
1833
|
+
return value !== void 0 ? `${value}` : "";
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
};
|
|
1837
|
+
var lowercaseFirstLetter = (inputString) => {
|
|
1838
|
+
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
});
|
|
1842
|
+
var require_object2 = __commonJS2({
|
|
1843
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports2, module22) {
|
|
1844
|
+
"use strict";
|
|
1845
|
+
var __defProp22 = Object.defineProperty;
|
|
1846
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
1847
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
1848
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
1849
|
+
var __export22 = (target, all) => {
|
|
1850
|
+
for (var name in all)
|
|
1851
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
1852
|
+
};
|
|
1853
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
1854
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1855
|
+
for (let key of __getOwnPropNames22(from))
|
|
1856
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
1857
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
1858
|
+
}
|
|
1859
|
+
return to;
|
|
1860
|
+
};
|
|
1861
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
1862
|
+
var object_exports = {};
|
|
1863
|
+
__export22(object_exports, {
|
|
1864
|
+
clone: () => clone,
|
|
1865
|
+
deepClone: () => deepClone2,
|
|
1866
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
1867
|
+
deepCloneWithExtend: () => deepCloneWithExtend,
|
|
1868
|
+
deepContains: () => deepContains,
|
|
1869
|
+
deepDestringify: () => deepDestringify,
|
|
1870
|
+
deepDiff: () => deepDiff,
|
|
1871
|
+
deepMerge: () => deepMerge3,
|
|
1872
|
+
deepStringify: () => deepStringify,
|
|
1873
|
+
detachFunctionsFromObject: () => detachFunctionsFromObject,
|
|
1874
|
+
diff: () => diff,
|
|
1875
|
+
diffArrays: () => diffArrays,
|
|
1876
|
+
diffObjects: () => diffObjects,
|
|
1877
|
+
exec: () => exec,
|
|
1878
|
+
flattenRecursive: () => flattenRecursive,
|
|
1879
|
+
hasOwnProperty: () => hasOwnProperty,
|
|
1880
|
+
isEmpty: () => isEmpty,
|
|
1881
|
+
isEmptyObject: () => isEmptyObject,
|
|
1882
|
+
isEqualDeep: () => isEqualDeep,
|
|
1883
|
+
makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
|
|
1884
|
+
map: () => map,
|
|
1885
|
+
merge: () => merge5,
|
|
1886
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
1887
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
1888
|
+
objectToString: () => objectToString,
|
|
1889
|
+
overwrite: () => overwrite,
|
|
1890
|
+
overwriteDeep: () => overwriteDeep2,
|
|
1891
|
+
overwriteShallow: () => overwriteShallow,
|
|
1892
|
+
removeFromObject: () => removeFromObject,
|
|
1893
|
+
stringToObject: () => stringToObject
|
|
1894
|
+
});
|
|
1895
|
+
module22.exports = __toCommonJS22(object_exports);
|
|
1896
|
+
var import_globals3 = require_globals2();
|
|
1897
|
+
var import_types = require_types2();
|
|
1898
|
+
var import_array = require_array2();
|
|
1899
|
+
var import_string = require_string2();
|
|
1900
|
+
var exec = (param, element, state, context) => {
|
|
1901
|
+
if ((0, import_types.isFunction)(param)) {
|
|
1902
|
+
return param(
|
|
1903
|
+
element,
|
|
1904
|
+
state || element.state,
|
|
1905
|
+
context || element.context
|
|
1906
|
+
);
|
|
1907
|
+
}
|
|
1908
|
+
return param;
|
|
1909
|
+
};
|
|
1910
|
+
var map = (obj, extention, element) => {
|
|
1911
|
+
for (const e in extention) {
|
|
1912
|
+
obj[e] = exec(extention[e], element);
|
|
1913
|
+
}
|
|
1914
|
+
};
|
|
1915
|
+
var merge5 = (element, obj, excludeFrom = []) => {
|
|
1916
|
+
for (const e in obj) {
|
|
1917
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
1918
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1919
|
+
continue;
|
|
1920
|
+
const elementProp = element[e];
|
|
1921
|
+
const objProp = obj[e];
|
|
1922
|
+
if (elementProp === void 0) {
|
|
1923
|
+
element[e] = objProp;
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
return element;
|
|
1927
|
+
};
|
|
1928
|
+
var deepMerge3 = (element, extend, excludeFrom = []) => {
|
|
1929
|
+
for (const e in extend) {
|
|
1930
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
1931
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
1932
|
+
continue;
|
|
1933
|
+
const elementProp = element[e];
|
|
1934
|
+
const extendProp = extend[e];
|
|
1935
|
+
if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
|
|
1936
|
+
deepMerge3(elementProp, extendProp, excludeFrom);
|
|
1937
|
+
} else if (elementProp === void 0) {
|
|
1938
|
+
element[e] = extendProp;
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
return element;
|
|
1942
|
+
};
|
|
1943
|
+
var clone = (obj, excludeFrom = []) => {
|
|
1944
|
+
const o = {};
|
|
1945
|
+
for (const prop in obj) {
|
|
1946
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1947
|
+
if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1948
|
+
continue;
|
|
1949
|
+
o[prop] = obj[prop];
|
|
1950
|
+
}
|
|
1951
|
+
return o;
|
|
1952
|
+
};
|
|
1953
|
+
var deepCloneExclude = (obj, excludeFrom = []) => {
|
|
1954
|
+
if ((0, import_types.isArray)(obj)) {
|
|
1955
|
+
return obj.map((x) => deepCloneExclude(x, excludeFrom));
|
|
1956
|
+
}
|
|
1957
|
+
const o = {};
|
|
1958
|
+
for (const k in obj) {
|
|
1959
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
|
|
1960
|
+
if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
|
|
1961
|
+
continue;
|
|
1962
|
+
let v = obj[k];
|
|
1963
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
1964
|
+
v = mergeArrayExclude(v, excludeFrom);
|
|
1965
|
+
}
|
|
1966
|
+
if ((0, import_types.isArray)(v)) {
|
|
1967
|
+
o[k] = v.map((x) => deepCloneExclude(x, excludeFrom));
|
|
1968
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
1969
|
+
o[k] = deepCloneExclude(v, excludeFrom);
|
|
1970
|
+
} else
|
|
1971
|
+
o[k] = v;
|
|
1972
|
+
}
|
|
1973
|
+
return o;
|
|
1974
|
+
};
|
|
1975
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
1976
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
|
|
1977
|
+
};
|
|
1978
|
+
var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
1979
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
1980
|
+
for (const prop in obj) {
|
|
1981
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1982
|
+
continue;
|
|
1983
|
+
if (prop === "__proto__")
|
|
1984
|
+
continue;
|
|
1985
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
1986
|
+
continue;
|
|
1987
|
+
let objProp = obj[prop];
|
|
1988
|
+
if (cleanUndefined && (0, import_types.isUndefined)(objProp))
|
|
1989
|
+
continue;
|
|
1990
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
1991
|
+
objProp = (0, import_array.mergeArray)(objProp);
|
|
1992
|
+
}
|
|
1993
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
1994
|
+
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
1995
|
+
} else
|
|
1996
|
+
o[prop] = objProp;
|
|
1997
|
+
}
|
|
1998
|
+
return o;
|
|
1999
|
+
};
|
|
2000
|
+
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
2001
|
+
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
2002
|
+
for (const prop in obj) {
|
|
2003
|
+
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2004
|
+
continue;
|
|
2005
|
+
const objProp = obj[prop];
|
|
2006
|
+
if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
|
|
2007
|
+
continue;
|
|
2008
|
+
if ((0, import_types.isObjectLike)(objProp)) {
|
|
2009
|
+
o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
|
|
2010
|
+
} else
|
|
2011
|
+
o[prop] = objProp;
|
|
2012
|
+
}
|
|
2013
|
+
return o;
|
|
2014
|
+
};
|
|
2015
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
2016
|
+
for (const prop in obj) {
|
|
2017
|
+
const objProp = obj[prop];
|
|
2018
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
2019
|
+
stringified[prop] = objProp.toString();
|
|
2020
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2021
|
+
stringified[prop] = {};
|
|
2022
|
+
deepStringify(objProp, stringified[prop]);
|
|
2023
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2024
|
+
stringified[prop] = [];
|
|
2025
|
+
objProp.forEach((v, i) => {
|
|
2026
|
+
if ((0, import_types.isObject)(v)) {
|
|
2027
|
+
stringified[prop][i] = {};
|
|
2028
|
+
deepStringify(v, stringified[prop][i]);
|
|
2029
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
2030
|
+
stringified[prop][i] = v.toString();
|
|
2031
|
+
} else {
|
|
2032
|
+
stringified[prop][i] = v;
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
} else {
|
|
2036
|
+
stringified[prop] = objProp;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
return stringified;
|
|
2040
|
+
};
|
|
2041
|
+
var objectToString = (obj, indent = 0) => {
|
|
2042
|
+
const spaces = " ".repeat(indent);
|
|
2043
|
+
let str = "{\n";
|
|
2044
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2045
|
+
const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["&", "*", "-", ":", "%", "{", "}", ">", "<", "@", ".", "/", "!", " "]);
|
|
2046
|
+
const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
|
|
2047
|
+
str += `${spaces} ${stringedKey}: `;
|
|
2048
|
+
if ((0, import_types.isArray)(value)) {
|
|
2049
|
+
str += "[\n";
|
|
2050
|
+
for (const element of value) {
|
|
2051
|
+
if ((0, import_types.isObject)(element) && element !== null) {
|
|
2052
|
+
str += `${spaces} ${objectToString(element, indent + 2)},
|
|
2053
|
+
`;
|
|
2054
|
+
} else if ((0, import_types.isString)(element)) {
|
|
2055
|
+
str += `${spaces} '${element}',
|
|
2056
|
+
`;
|
|
2057
|
+
} else {
|
|
2058
|
+
str += `${spaces} ${element},
|
|
2059
|
+
`;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
str += `${spaces} ]`;
|
|
2063
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
2064
|
+
str += objectToString(value, indent + 1);
|
|
2065
|
+
} else if ((0, import_types.isString)(value)) {
|
|
2066
|
+
str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
|
|
2067
|
+
} else {
|
|
2068
|
+
str += value;
|
|
2069
|
+
}
|
|
2070
|
+
str += ",\n";
|
|
2071
|
+
}
|
|
2072
|
+
str += `${spaces}}`;
|
|
2073
|
+
return str;
|
|
2074
|
+
};
|
|
2075
|
+
var detachFunctionsFromObject = (obj, detached = {}) => {
|
|
2076
|
+
for (const prop in obj) {
|
|
2077
|
+
const objProp = obj[prop];
|
|
2078
|
+
if ((0, import_types.isFunction)(objProp))
|
|
2079
|
+
continue;
|
|
2080
|
+
else if ((0, import_types.isObject)(objProp)) {
|
|
2081
|
+
detached[prop] = {};
|
|
2082
|
+
deepStringify(objProp, detached[prop]);
|
|
2083
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2084
|
+
detached[prop] = [];
|
|
2085
|
+
objProp.forEach((v, i) => {
|
|
2086
|
+
if ((0, import_types.isFunction)(v))
|
|
2087
|
+
return;
|
|
2088
|
+
if ((0, import_types.isObject)(v)) {
|
|
2089
|
+
detached[prop][i] = {};
|
|
2090
|
+
detachFunctionsFromObject(v, detached[prop][i]);
|
|
2091
|
+
} else {
|
|
2092
|
+
detached[prop][i] = v;
|
|
2093
|
+
}
|
|
2094
|
+
});
|
|
2095
|
+
} else {
|
|
2096
|
+
detached[prop] = objProp;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
return detached;
|
|
2100
|
+
};
|
|
2101
|
+
var deepDestringify = (obj, destringified = {}) => {
|
|
2102
|
+
for (const prop in obj) {
|
|
2103
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2104
|
+
if (!hasOwnProperty2)
|
|
2105
|
+
continue;
|
|
2106
|
+
const objProp = obj[prop];
|
|
2107
|
+
if ((0, import_types.isString)(objProp)) {
|
|
2108
|
+
if ((objProp.includes("=>") || objProp.startsWith("function") || objProp.startsWith("(")) && !objProp.startsWith("{") && !objProp.startsWith("[")) {
|
|
2109
|
+
try {
|
|
2110
|
+
const evalProp = import_globals3.window.eval(`(${objProp})`);
|
|
2111
|
+
destringified[prop] = evalProp;
|
|
2112
|
+
} catch (e) {
|
|
2113
|
+
if (e)
|
|
2114
|
+
destringified[prop] = objProp;
|
|
2115
|
+
}
|
|
2116
|
+
} else {
|
|
2117
|
+
destringified[prop] = objProp;
|
|
2118
|
+
}
|
|
2119
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
2120
|
+
destringified[prop] = [];
|
|
2121
|
+
objProp.forEach((arrProp) => {
|
|
2122
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
2123
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
2124
|
+
try {
|
|
2125
|
+
const evalProp = import_globals3.window.eval(`(${arrProp})`);
|
|
2126
|
+
destringified[prop].push(evalProp);
|
|
2127
|
+
} catch (e) {
|
|
2128
|
+
if (e)
|
|
2129
|
+
destringified[prop].push(arrProp);
|
|
2130
|
+
}
|
|
2131
|
+
} else {
|
|
2132
|
+
destringified[prop].push(arrProp);
|
|
2133
|
+
}
|
|
2134
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
2135
|
+
destringified[prop].push(deepDestringify(arrProp));
|
|
2136
|
+
} else {
|
|
2137
|
+
destringified[prop].push(arrProp);
|
|
2138
|
+
}
|
|
2139
|
+
});
|
|
2140
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
2141
|
+
destringified[prop] = deepDestringify(objProp, destringified[prop]);
|
|
2142
|
+
} else {
|
|
2143
|
+
destringified[prop] = objProp;
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
return destringified;
|
|
2147
|
+
};
|
|
2148
|
+
var stringToObject = (str, opts = { verbose: true }) => {
|
|
2149
|
+
try {
|
|
2150
|
+
return import_globals3.window.eval("(" + str + ")");
|
|
2151
|
+
} catch (e) {
|
|
2152
|
+
if (opts.verbose)
|
|
2153
|
+
console.warn(e);
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
var diffObjects = (original, objToDiff, cache) => {
|
|
2157
|
+
for (const e in objToDiff) {
|
|
2158
|
+
if (e === "ref")
|
|
2159
|
+
continue;
|
|
2160
|
+
const originalProp = original[e];
|
|
2161
|
+
const objToDiffProp = objToDiff[e];
|
|
2162
|
+
if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
|
|
2163
|
+
cache[e] = {};
|
|
2164
|
+
diff(originalProp, objToDiffProp, cache[e]);
|
|
2165
|
+
} else if (objToDiffProp !== void 0) {
|
|
2166
|
+
cache[e] = objToDiffProp;
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
return cache;
|
|
2170
|
+
};
|
|
2171
|
+
var diffArrays = (original, objToDiff, cache) => {
|
|
2172
|
+
if (original.length !== objToDiff.length) {
|
|
2173
|
+
cache = objToDiff;
|
|
2174
|
+
} else {
|
|
2175
|
+
const diffArr = [];
|
|
2176
|
+
for (let i = 0; i < original.length; i++) {
|
|
2177
|
+
const diffObj = diff(original[i], objToDiff[i]);
|
|
2178
|
+
if (Object.keys(diffObj).length > 0) {
|
|
2179
|
+
diffArr.push(diffObj);
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
if (diffArr.length > 0) {
|
|
2183
|
+
cache = diffArr;
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
return cache;
|
|
2187
|
+
};
|
|
2188
|
+
var diff = (original, objToDiff, cache = {}) => {
|
|
2189
|
+
if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
|
|
2190
|
+
cache = [];
|
|
2191
|
+
diffArrays(original, objToDiff, cache);
|
|
2192
|
+
} else {
|
|
2193
|
+
diffObjects(original, objToDiff, cache);
|
|
2194
|
+
}
|
|
2195
|
+
return cache;
|
|
2196
|
+
};
|
|
2197
|
+
var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
|
|
2198
|
+
var isEmpty = (o) => Object.keys(o).length === 0;
|
|
2199
|
+
var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
|
|
2200
|
+
var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
|
|
2201
|
+
var deepDiff = (lhs, rhs) => {
|
|
2202
|
+
if (lhs === rhs)
|
|
2203
|
+
return {};
|
|
2204
|
+
if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
|
|
2205
|
+
return rhs;
|
|
2206
|
+
const deletedValues = Object.keys(lhs).reduce((acc, key) => {
|
|
2207
|
+
if (!hasOwnProperty(rhs, key)) {
|
|
2208
|
+
acc[key] = void 0;
|
|
2209
|
+
}
|
|
2210
|
+
return acc;
|
|
2211
|
+
}, makeObjectWithoutPrototype());
|
|
2212
|
+
if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
|
|
2213
|
+
if (lhs.valueOf() === rhs.valueOf())
|
|
2214
|
+
return {};
|
|
2215
|
+
return rhs;
|
|
2216
|
+
}
|
|
2217
|
+
return Object.keys(rhs).reduce((acc, key) => {
|
|
2218
|
+
if (!hasOwnProperty(lhs, key)) {
|
|
2219
|
+
acc[key] = rhs[key];
|
|
2220
|
+
return acc;
|
|
2221
|
+
}
|
|
2222
|
+
const difference = diff(lhs[key], rhs[key]);
|
|
2223
|
+
if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
|
|
2224
|
+
return acc;
|
|
2225
|
+
}
|
|
2226
|
+
acc[key] = difference;
|
|
2227
|
+
return acc;
|
|
2228
|
+
}, deletedValues);
|
|
2229
|
+
};
|
|
2230
|
+
var overwrite = (element, params, excludeFrom = []) => {
|
|
2231
|
+
const { ref } = element;
|
|
2232
|
+
const changes = {};
|
|
2233
|
+
for (const e in params) {
|
|
2234
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2235
|
+
continue;
|
|
2236
|
+
const elementProp = element[e];
|
|
2237
|
+
const paramsProp = params[e];
|
|
2238
|
+
if (paramsProp) {
|
|
2239
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
2240
|
+
ref[e] = paramsProp;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
return changes;
|
|
2244
|
+
};
|
|
2245
|
+
var overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
2246
|
+
for (const e in params) {
|
|
2247
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2248
|
+
continue;
|
|
2249
|
+
obj[e] = params[e];
|
|
2250
|
+
}
|
|
2251
|
+
return obj;
|
|
2252
|
+
};
|
|
2253
|
+
var overwriteDeep2 = (obj, params, excludeFrom = []) => {
|
|
2254
|
+
for (const e in params) {
|
|
2255
|
+
if (e === "__proto__")
|
|
2256
|
+
continue;
|
|
2257
|
+
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2258
|
+
continue;
|
|
2259
|
+
const objProp = obj[e];
|
|
2260
|
+
const paramsProp = params[e];
|
|
2261
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
2262
|
+
overwriteDeep2(objProp, paramsProp);
|
|
2263
|
+
} else if (paramsProp !== void 0) {
|
|
2264
|
+
obj[e] = paramsProp;
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
return obj;
|
|
2268
|
+
};
|
|
2269
|
+
var mergeIfExisted = (a, b) => {
|
|
2270
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
2271
|
+
return deepMerge3(a, b);
|
|
2272
|
+
return a || b;
|
|
2273
|
+
};
|
|
2274
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
2275
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
2276
|
+
stack.push(objectized);
|
|
2277
|
+
const extendOfExtend = objectized[prop];
|
|
2278
|
+
if (extendOfExtend)
|
|
2279
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
2280
|
+
delete objectized[prop];
|
|
2281
|
+
return stack;
|
|
2282
|
+
};
|
|
2283
|
+
var isEqualDeep = (param, element, visited = /* @__PURE__ */ new Set()) => {
|
|
2284
|
+
if (typeof param !== "object" || typeof element !== "object" || param === null || element === null) {
|
|
2285
|
+
return param === element;
|
|
2286
|
+
}
|
|
2287
|
+
if (visited.has(param) || visited.has(element)) {
|
|
2288
|
+
return true;
|
|
2289
|
+
}
|
|
2290
|
+
visited.add(param);
|
|
2291
|
+
visited.add(element);
|
|
2292
|
+
const keysParam = Object.keys(param);
|
|
2293
|
+
const keysElement = Object.keys(element);
|
|
2294
|
+
if (keysParam.length !== keysElement.length) {
|
|
2295
|
+
return false;
|
|
2296
|
+
}
|
|
2297
|
+
for (const key of keysParam) {
|
|
2298
|
+
if (!keysElement.includes(key)) {
|
|
2299
|
+
return false;
|
|
2300
|
+
}
|
|
2301
|
+
const paramProp = param[key];
|
|
2302
|
+
const elementProp = element[key];
|
|
2303
|
+
if (!isEqualDeep(paramProp, elementProp, visited)) {
|
|
2304
|
+
return false;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
return true;
|
|
2308
|
+
};
|
|
2309
|
+
var deepContains = (obj1, obj2) => {
|
|
2310
|
+
if (typeof obj1 !== typeof obj2) {
|
|
2311
|
+
return false;
|
|
2312
|
+
}
|
|
2313
|
+
if ((0, import_types.isObjectLike)(obj1)) {
|
|
2314
|
+
if (Array.isArray(obj1) && Array.isArray(obj2)) {
|
|
2315
|
+
if (obj1.length !== obj2.length) {
|
|
2316
|
+
return false;
|
|
2317
|
+
}
|
|
2318
|
+
for (let i = 0; i < obj1.length; i++) {
|
|
2319
|
+
if (!deepContains(obj1[i], obj2[i])) {
|
|
2320
|
+
return false;
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
2324
|
+
for (const key in obj1) {
|
|
2325
|
+
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
2326
|
+
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
2327
|
+
return false;
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
} else {
|
|
2332
|
+
return obj2 === obj1;
|
|
2333
|
+
}
|
|
2334
|
+
return true;
|
|
2335
|
+
};
|
|
2336
|
+
var removeFromObject = (obj, props) => {
|
|
2337
|
+
if (props === void 0 || props === null)
|
|
2338
|
+
return obj;
|
|
2339
|
+
if ((0, import_types.is)(props)("string", "number")) {
|
|
2340
|
+
delete obj[props];
|
|
2341
|
+
} else if ((0, import_types.isArray)(props)) {
|
|
2342
|
+
props.forEach((prop) => delete obj[prop]);
|
|
2343
|
+
} else {
|
|
2344
|
+
throw new Error("Invalid input: props must be a string or an array of strings");
|
|
2345
|
+
}
|
|
2346
|
+
return obj;
|
|
2347
|
+
};
|
|
2348
|
+
}
|
|
2349
|
+
});
|
|
2350
|
+
var require_function2 = __commonJS2({
|
|
2351
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports2, module22) {
|
|
2352
|
+
"use strict";
|
|
2353
|
+
var __defProp22 = Object.defineProperty;
|
|
2354
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2355
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2356
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2357
|
+
var __export22 = (target, all) => {
|
|
2358
|
+
for (var name in all)
|
|
2359
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2360
|
+
};
|
|
2361
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2362
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2363
|
+
for (let key of __getOwnPropNames22(from))
|
|
2364
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2365
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2366
|
+
}
|
|
2367
|
+
return to;
|
|
2368
|
+
};
|
|
2369
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2370
|
+
var function_exports = {};
|
|
2371
|
+
__export22(function_exports, {
|
|
2372
|
+
debounce: () => debounce,
|
|
2373
|
+
debounceOnContext: () => debounceOnContext,
|
|
2374
|
+
isStringFunction: () => isStringFunction,
|
|
2375
|
+
memoize: () => memoize
|
|
2376
|
+
});
|
|
2377
|
+
module22.exports = __toCommonJS22(function_exports);
|
|
2378
|
+
function debounce(func, wait, immediate) {
|
|
2379
|
+
let timeout;
|
|
2380
|
+
return function() {
|
|
2381
|
+
const context = this;
|
|
2382
|
+
const args = arguments;
|
|
2383
|
+
const later = function() {
|
|
2384
|
+
timeout = null;
|
|
2385
|
+
if (!immediate)
|
|
2386
|
+
func.apply(context, args);
|
|
2387
|
+
};
|
|
2388
|
+
const callNow = immediate && !timeout;
|
|
2389
|
+
clearTimeout(timeout);
|
|
2390
|
+
timeout = setTimeout(later, wait);
|
|
2391
|
+
if (callNow)
|
|
2392
|
+
func.apply(context, args);
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
var debounceOnContext = (element, func, timeout = 300) => {
|
|
2396
|
+
let timer;
|
|
2397
|
+
return (...args) => {
|
|
2398
|
+
clearTimeout(timer);
|
|
2399
|
+
timer = setTimeout(() => {
|
|
2400
|
+
func.apply(element, args);
|
|
2401
|
+
}, timeout);
|
|
2402
|
+
};
|
|
2403
|
+
};
|
|
2404
|
+
var memoize = (fn) => {
|
|
2405
|
+
const cache = {};
|
|
2406
|
+
return (...args) => {
|
|
2407
|
+
const n = args[0];
|
|
2408
|
+
if (n in cache) {
|
|
2409
|
+
return cache[n];
|
|
2410
|
+
} else {
|
|
2411
|
+
const result = fn(n);
|
|
2412
|
+
cache[n] = result;
|
|
2413
|
+
return result;
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
};
|
|
2417
|
+
var isStringFunction = (inputString) => {
|
|
2418
|
+
const functionRegex = /^((function\s*\([^)]*\)\s*\{[^}]*\})|(\([^)]*\)\s*=>))/;
|
|
2419
|
+
return functionRegex.test(inputString);
|
|
2420
|
+
};
|
|
2421
|
+
}
|
|
2422
|
+
});
|
|
2423
|
+
var require_log2 = __commonJS2({
|
|
2424
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports2, module22) {
|
|
2425
|
+
"use strict";
|
|
2426
|
+
var __defProp22 = Object.defineProperty;
|
|
2427
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2428
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2429
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2430
|
+
var __export22 = (target, all) => {
|
|
2431
|
+
for (var name in all)
|
|
2432
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2433
|
+
};
|
|
2434
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2435
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2436
|
+
for (let key of __getOwnPropNames22(from))
|
|
2437
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2438
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2439
|
+
}
|
|
2440
|
+
return to;
|
|
2441
|
+
};
|
|
2442
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2443
|
+
var log_exports = {};
|
|
2444
|
+
__export22(log_exports, {
|
|
2445
|
+
logGroupIf: () => logGroupIf,
|
|
2446
|
+
logIf: () => logIf
|
|
2447
|
+
});
|
|
2448
|
+
module22.exports = __toCommonJS22(log_exports);
|
|
2449
|
+
var logIf = (bool, ...arg) => {
|
|
2450
|
+
if (bool)
|
|
2451
|
+
arg.map((v) => console.log(v));
|
|
2452
|
+
};
|
|
2453
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
2454
|
+
if (bool) {
|
|
2455
|
+
console.group(key);
|
|
2456
|
+
arg.map((v) => console.log(v));
|
|
2457
|
+
console.groupEnd(key);
|
|
2458
|
+
}
|
|
2459
|
+
};
|
|
2460
|
+
}
|
|
2461
|
+
});
|
|
2462
|
+
var require_cookie2 = __commonJS2({
|
|
2463
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports2, module22) {
|
|
2464
|
+
"use strict";
|
|
2465
|
+
var __defProp22 = Object.defineProperty;
|
|
2466
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2467
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2468
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2469
|
+
var __export22 = (target, all) => {
|
|
2470
|
+
for (var name in all)
|
|
2471
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2472
|
+
};
|
|
2473
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2474
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2475
|
+
for (let key of __getOwnPropNames22(from))
|
|
2476
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2477
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2478
|
+
}
|
|
2479
|
+
return to;
|
|
2480
|
+
};
|
|
2481
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2482
|
+
var cookie_exports = {};
|
|
2483
|
+
__export22(cookie_exports, {
|
|
2484
|
+
getCookie: () => getCookie,
|
|
2485
|
+
isMobile: () => isMobile,
|
|
2486
|
+
setCookie: () => setCookie
|
|
2487
|
+
});
|
|
2488
|
+
module22.exports = __toCommonJS22(cookie_exports);
|
|
2489
|
+
var import_types = require_types2();
|
|
2490
|
+
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
2491
|
+
var setCookie = (cname, cvalue, exdays = 365) => {
|
|
2492
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2493
|
+
return;
|
|
2494
|
+
const d = /* @__PURE__ */ new Date();
|
|
2495
|
+
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3);
|
|
2496
|
+
const expires = `expires=${d.toUTCString()}`;
|
|
2497
|
+
document.cookie = `${cname}=${cvalue};${expires};path=/`;
|
|
2498
|
+
};
|
|
2499
|
+
var getCookie = (cname) => {
|
|
2500
|
+
if ((0, import_types.isUndefined)(document) || (0, import_types.isUndefined)(document.cookie))
|
|
2501
|
+
return;
|
|
2502
|
+
const name = `${cname}=`;
|
|
2503
|
+
const decodedCookie = decodeURIComponent(document.cookie);
|
|
2504
|
+
const ca = decodedCookie.split(";");
|
|
2505
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2506
|
+
let c = ca[i];
|
|
2507
|
+
while (c.charAt(0) === " ")
|
|
2508
|
+
c = c.substring(1);
|
|
2509
|
+
if (c.indexOf(name) === 0)
|
|
2510
|
+
return c.substring(name.length, c.length);
|
|
2511
|
+
}
|
|
2512
|
+
return "";
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
});
|
|
2516
|
+
var require_tags2 = __commonJS2({
|
|
2517
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports2, module22) {
|
|
2518
|
+
"use strict";
|
|
2519
|
+
var __defProp22 = Object.defineProperty;
|
|
2520
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2521
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2522
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2523
|
+
var __export22 = (target, all) => {
|
|
2524
|
+
for (var name in all)
|
|
2525
|
+
__defProp22(target, name, { get: all[name], enumerable: true });
|
|
2526
|
+
};
|
|
2527
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2528
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2529
|
+
for (let key of __getOwnPropNames22(from))
|
|
2530
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2531
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2532
|
+
}
|
|
2533
|
+
return to;
|
|
2534
|
+
};
|
|
2535
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2536
|
+
var tags_exports = {};
|
|
2537
|
+
__export22(tags_exports, {
|
|
2538
|
+
HTML_TAGS: () => HTML_TAGS,
|
|
2539
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
2540
|
+
});
|
|
2541
|
+
module22.exports = __toCommonJS22(tags_exports);
|
|
2542
|
+
var HTML_TAGS = {
|
|
2543
|
+
root: [
|
|
2544
|
+
"body",
|
|
2545
|
+
"html"
|
|
2546
|
+
],
|
|
2547
|
+
head: [
|
|
2548
|
+
"title",
|
|
2549
|
+
"base",
|
|
2550
|
+
"meta",
|
|
2551
|
+
"style"
|
|
2552
|
+
],
|
|
2553
|
+
body: [
|
|
2554
|
+
"string",
|
|
2555
|
+
"fragment",
|
|
2556
|
+
"a",
|
|
2557
|
+
"abbr",
|
|
2558
|
+
"acronym",
|
|
2559
|
+
"address",
|
|
2560
|
+
"applet",
|
|
2561
|
+
"area",
|
|
2562
|
+
"article",
|
|
2563
|
+
"aside",
|
|
2564
|
+
"audio",
|
|
2565
|
+
"b",
|
|
2566
|
+
"basefont",
|
|
2567
|
+
"bdi",
|
|
2568
|
+
"bdo",
|
|
2569
|
+
"big",
|
|
2570
|
+
"blockquote",
|
|
2571
|
+
"br",
|
|
2572
|
+
"button",
|
|
2573
|
+
"canvas",
|
|
2574
|
+
"caption",
|
|
2575
|
+
"center",
|
|
2576
|
+
"cite",
|
|
2577
|
+
"code",
|
|
2578
|
+
"search",
|
|
2579
|
+
"col",
|
|
2580
|
+
"colgroup",
|
|
2581
|
+
"data",
|
|
2582
|
+
"datalist",
|
|
2583
|
+
"dd",
|
|
2584
|
+
"del",
|
|
2585
|
+
"details",
|
|
2586
|
+
"dfn",
|
|
2587
|
+
"dialog",
|
|
2588
|
+
"dir",
|
|
2589
|
+
"div",
|
|
2590
|
+
"dl",
|
|
2591
|
+
"dt",
|
|
2592
|
+
"em",
|
|
2593
|
+
"embed",
|
|
2594
|
+
"fieldset",
|
|
2595
|
+
"figcaption",
|
|
2596
|
+
"figure",
|
|
2597
|
+
"font",
|
|
2598
|
+
"footer",
|
|
2599
|
+
"form",
|
|
2600
|
+
"frame",
|
|
2601
|
+
"frameset",
|
|
2602
|
+
"h1",
|
|
2603
|
+
"h2",
|
|
2604
|
+
"h3",
|
|
2605
|
+
"h4",
|
|
2606
|
+
"h5",
|
|
2607
|
+
"h6",
|
|
2608
|
+
"head",
|
|
2609
|
+
"header",
|
|
2610
|
+
"hr",
|
|
2611
|
+
"i",
|
|
2612
|
+
"iframe",
|
|
2613
|
+
"img",
|
|
2614
|
+
"input",
|
|
2615
|
+
"ins",
|
|
2616
|
+
"kbd",
|
|
2617
|
+
"label",
|
|
2618
|
+
"legend",
|
|
2619
|
+
"li",
|
|
2620
|
+
"link",
|
|
2621
|
+
"main",
|
|
2622
|
+
"map",
|
|
2623
|
+
"mark",
|
|
2624
|
+
"meter",
|
|
2625
|
+
"nav",
|
|
2626
|
+
"noframes",
|
|
2627
|
+
"noscript",
|
|
2628
|
+
"object",
|
|
2629
|
+
"ol",
|
|
2630
|
+
"optgroup",
|
|
2631
|
+
"option",
|
|
2632
|
+
"output",
|
|
2633
|
+
"p",
|
|
2634
|
+
"param",
|
|
2635
|
+
"picture",
|
|
2636
|
+
"pre",
|
|
2637
|
+
"progress",
|
|
2638
|
+
"hgroup",
|
|
2639
|
+
"q",
|
|
2640
|
+
"rp",
|
|
2641
|
+
"rt",
|
|
2642
|
+
"ruby",
|
|
2643
|
+
"s",
|
|
2644
|
+
"samp",
|
|
2645
|
+
"script",
|
|
2646
|
+
"section",
|
|
2647
|
+
"select",
|
|
2648
|
+
"small",
|
|
2649
|
+
"source",
|
|
2650
|
+
"span",
|
|
2651
|
+
"strike",
|
|
2652
|
+
"strong",
|
|
2653
|
+
"sub",
|
|
2654
|
+
"summary",
|
|
2655
|
+
"sup",
|
|
2656
|
+
"table",
|
|
2657
|
+
"tbody",
|
|
2658
|
+
"td",
|
|
2659
|
+
"template",
|
|
2660
|
+
"hgroup",
|
|
2661
|
+
"textarea",
|
|
2662
|
+
"tfoot",
|
|
2663
|
+
"th",
|
|
2664
|
+
"thead",
|
|
2665
|
+
"time",
|
|
2666
|
+
"tr",
|
|
2667
|
+
"track",
|
|
2668
|
+
"tt",
|
|
2669
|
+
"u",
|
|
2670
|
+
"ul",
|
|
2671
|
+
"var",
|
|
2672
|
+
"video",
|
|
2673
|
+
"wbr",
|
|
2674
|
+
// SVG
|
|
2675
|
+
"svg",
|
|
2676
|
+
"path"
|
|
2677
|
+
]
|
|
2678
|
+
};
|
|
2679
|
+
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
2680
|
+
}
|
|
2681
|
+
});
|
|
2682
|
+
var require_cjs4 = __commonJS2({
|
|
2683
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports2, module22) {
|
|
2684
|
+
"use strict";
|
|
2685
|
+
var __defProp22 = Object.defineProperty;
|
|
2686
|
+
var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
|
|
2687
|
+
var __getOwnPropNames22 = Object.getOwnPropertyNames;
|
|
2688
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2689
|
+
var __copyProps22 = (to, from, except, desc) => {
|
|
2690
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
2691
|
+
for (let key of __getOwnPropNames22(from))
|
|
2692
|
+
if (!__hasOwnProp22.call(to, key) && key !== except)
|
|
2693
|
+
__defProp22(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc22(from, key)) || desc.enumerable });
|
|
2694
|
+
}
|
|
2695
|
+
return to;
|
|
2696
|
+
};
|
|
2697
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps22(target, mod, "default"), secondTarget && __copyProps22(secondTarget, mod, "default"));
|
|
2698
|
+
var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
|
|
2699
|
+
var utils_exports2 = {};
|
|
2700
|
+
module22.exports = __toCommonJS22(utils_exports2);
|
|
2701
|
+
__reExport(utils_exports2, require_key2(), module22.exports);
|
|
2702
|
+
__reExport(utils_exports2, require_env2(), module22.exports);
|
|
2703
|
+
__reExport(utils_exports2, require_types2(), module22.exports);
|
|
2704
|
+
__reExport(utils_exports2, require_object2(), module22.exports);
|
|
2705
|
+
__reExport(utils_exports2, require_function2(), module22.exports);
|
|
2706
|
+
__reExport(utils_exports2, require_array2(), module22.exports);
|
|
2707
|
+
__reExport(utils_exports2, require_node2(), module22.exports);
|
|
2708
|
+
__reExport(utils_exports2, require_log2(), module22.exports);
|
|
2709
|
+
__reExport(utils_exports2, require_string2(), module22.exports);
|
|
2710
|
+
__reExport(utils_exports2, require_globals2(), module22.exports);
|
|
2711
|
+
__reExport(utils_exports2, require_cookie2(), module22.exports);
|
|
2712
|
+
__reExport(utils_exports2, require_tags2(), module22.exports);
|
|
2713
|
+
}
|
|
2714
|
+
});
|
|
2715
|
+
var src_exports2 = {};
|
|
2716
|
+
__export2(src_exports2, {
|
|
2717
|
+
arrayzeValue: () => arrayzeValue3,
|
|
2718
|
+
copyStringToClipboard: () => copyStringToClipboard,
|
|
2719
|
+
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
2720
|
+
findClosestNumber: () => findClosestNumber,
|
|
2721
|
+
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
2722
|
+
formatDate: () => formatDate,
|
|
2723
|
+
loadJavascriptFile: () => loadJavascriptFile,
|
|
2724
|
+
removeChars: () => removeChars,
|
|
2725
|
+
toCamelCase: () => toCamelCase2,
|
|
2726
|
+
toDashCase: () => toDashCase2,
|
|
2727
|
+
toDescriptionCase: () => toDescriptionCase,
|
|
2728
|
+
toTitleCase: () => toTitleCase,
|
|
2729
|
+
toggleFullscreen: () => toggleFullscreen
|
|
2730
|
+
});
|
|
2731
|
+
module2.exports = __toCommonJS2(src_exports2);
|
|
2732
|
+
var import_utils27 = __toESM2(require_cjs4(), 1);
|
|
2733
|
+
var toggleFullscreen = (el) => {
|
|
2734
|
+
if (!document.fullscreenElement) {
|
|
2735
|
+
el.node.requestFullscreen().catch((err) => {
|
|
2736
|
+
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
2737
|
+
});
|
|
2738
|
+
} else {
|
|
2739
|
+
document.exitFullscreen();
|
|
2740
|
+
}
|
|
2741
|
+
};
|
|
2742
|
+
var import_utils28 = __toESM2(require_cjs4(), 1);
|
|
2743
|
+
var findClosestNumber = (number, arr) => {
|
|
2744
|
+
return ((0, import_utils28.isArray)(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
2745
|
+
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
2746
|
+
});
|
|
2747
|
+
};
|
|
2748
|
+
var findClosestNumberInFactory = (val, factory) => {
|
|
2749
|
+
val = parseFloat(val);
|
|
2750
|
+
if ((0, import_utils28.isObject)(factory))
|
|
2751
|
+
factory = Object.values(factory);
|
|
2752
|
+
return findClosestNumber(val, factory);
|
|
2753
|
+
};
|
|
2754
|
+
var formatDate = (timestamp) => {
|
|
2755
|
+
if (!timestamp)
|
|
2756
|
+
return "";
|
|
2757
|
+
const d = new Date(timestamp);
|
|
2758
|
+
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
2759
|
+
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
2760
|
+
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
2761
|
+
return `${da} ${mo}, ${ye}`;
|
|
2762
|
+
};
|
|
2763
|
+
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
2764
|
+
const fib = [0, 1];
|
|
2765
|
+
for (let i = 2; i <= n; i++) {
|
|
2766
|
+
fib[i] = fib[i - 1] + fib[i - 2];
|
|
2767
|
+
}
|
|
2768
|
+
return fib[n];
|
|
2769
|
+
};
|
|
2770
|
+
var loadJavascriptFile = (FILE_URL, async = true, doc = document, type = "text/javascript") => {
|
|
2771
|
+
return new Promise((resolve, reject) => {
|
|
2772
|
+
try {
|
|
2773
|
+
const scriptEle = doc.createElement("script");
|
|
2774
|
+
scriptEle.type = type;
|
|
2775
|
+
scriptEle.async = async;
|
|
2776
|
+
scriptEle.src = FILE_URL;
|
|
2777
|
+
scriptEle.addEventListener("load", (ev) => {
|
|
2778
|
+
resolve({
|
|
2779
|
+
status: true
|
|
2780
|
+
});
|
|
2781
|
+
});
|
|
2782
|
+
scriptEle.addEventListener("error", (ev) => {
|
|
2783
|
+
reject({
|
|
2784
|
+
status: false,
|
|
2785
|
+
message: `Failed to load the script ${FILE_URL}`
|
|
2786
|
+
});
|
|
2787
|
+
});
|
|
2788
|
+
doc.body.appendChild(scriptEle);
|
|
2789
|
+
} catch (error) {
|
|
2790
|
+
reject(error);
|
|
2791
|
+
}
|
|
2792
|
+
});
|
|
2793
|
+
};
|
|
2794
|
+
var copyStringToClipboard = (str) => {
|
|
2795
|
+
const el = document.createElement("textarea");
|
|
2796
|
+
el.value = str;
|
|
2797
|
+
el.setAttribute("readonly", "");
|
|
2798
|
+
el.style = { position: "absolute", left: "-9999px" };
|
|
2799
|
+
document.body.appendChild(el);
|
|
2800
|
+
el.select();
|
|
2801
|
+
document.execCommand("copy");
|
|
2802
|
+
document.body.removeChild(el);
|
|
2803
|
+
};
|
|
2804
|
+
var removeChars = (str) => {
|
|
2805
|
+
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
2806
|
+
};
|
|
2807
|
+
var toCamelCase2 = (str) => {
|
|
2808
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
2809
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
2810
|
+
}).replaceAll(/\s+/g, "");
|
|
2811
|
+
};
|
|
2812
|
+
var toTitleCase = (str) => str && str.replace(
|
|
2813
|
+
/\w\S*/g,
|
|
2814
|
+
(txt) => {
|
|
2815
|
+
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
2816
|
+
}
|
|
2817
|
+
);
|
|
2818
|
+
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
2819
|
+
var toDescriptionCase = (str = "") => {
|
|
2820
|
+
const result = str.replace(/([A-Z])/g, " $1");
|
|
2821
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
2822
|
+
};
|
|
2823
|
+
var arrayzeValue3 = (val) => {
|
|
2824
|
+
if ((0, import_utils27.isArray)(val))
|
|
2825
|
+
return val;
|
|
2826
|
+
if ((0, import_utils27.isString)(val))
|
|
2827
|
+
return val.split(" ");
|
|
2828
|
+
if ((0, import_utils27.isObject)(val))
|
|
2829
|
+
return Object.values(val);
|
|
2830
|
+
if ((0, import_utils27.isNumber)(val))
|
|
2831
|
+
return [val];
|
|
2832
|
+
};
|
|
2833
|
+
}
|
|
2834
|
+
});
|
|
2835
|
+
|
|
1382
2836
|
// src/index.js
|
|
1383
2837
|
var src_exports = {};
|
|
1384
2838
|
__export(src_exports, {
|
|
@@ -1766,34 +3220,11 @@ var getFontFaceString = (LIBRARY) => {
|
|
|
1766
3220
|
};
|
|
1767
3221
|
|
|
1768
3222
|
// src/utils/sequence.js
|
|
1769
|
-
var
|
|
1770
|
-
|
|
1771
|
-
// ../utils/src/index.js
|
|
1772
|
-
var import_utils3 = __toESM(require_cjs2());
|
|
1773
|
-
|
|
1774
|
-
// ../utils/src/scaling.js
|
|
1775
|
-
var import_utils2 = __toESM(require_cjs2());
|
|
1776
|
-
|
|
1777
|
-
// ../utils/src/index.js
|
|
1778
|
-
var toCamelCase = (str) => {
|
|
1779
|
-
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
1780
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
1781
|
-
}).replaceAll(/\s+/g, "");
|
|
1782
|
-
};
|
|
1783
|
-
var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
1784
|
-
var arrayzeValue = (val) => {
|
|
1785
|
-
if ((0, import_utils3.isArray)(val))
|
|
1786
|
-
return val;
|
|
1787
|
-
if ((0, import_utils3.isString)(val))
|
|
1788
|
-
return val.split(" ");
|
|
1789
|
-
if ((0, import_utils3.isObject)(val))
|
|
1790
|
-
return Object.values(val);
|
|
1791
|
-
if ((0, import_utils3.isNumber)(val))
|
|
1792
|
-
return [val];
|
|
1793
|
-
};
|
|
3223
|
+
var import_utils3 = __toESM(require_cjs2(), 1);
|
|
3224
|
+
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
1794
3225
|
|
|
1795
3226
|
// src/factory.js
|
|
1796
|
-
var
|
|
3227
|
+
var import_utils2 = __toESM(require_cjs2(), 1);
|
|
1797
3228
|
|
|
1798
3229
|
// src/defaultConfig/index.js
|
|
1799
3230
|
var defaultConfig_exports = {};
|
|
@@ -1998,13 +3429,13 @@ var CONFIG = {
|
|
|
1998
3429
|
CSS_VARS,
|
|
1999
3430
|
...defaultConfig_exports
|
|
2000
3431
|
};
|
|
2001
|
-
var cachedConfig = (0,
|
|
3432
|
+
var cachedConfig = (0, import_utils2.deepClone)(CONFIG);
|
|
2002
3433
|
var FACTORY = {
|
|
2003
3434
|
active: "0",
|
|
2004
3435
|
0: CONFIG
|
|
2005
3436
|
};
|
|
2006
3437
|
var activateConfig = (def) => {
|
|
2007
|
-
if ((0,
|
|
3438
|
+
if ((0, import_utils2.isDefined)(def)) {
|
|
2008
3439
|
FACTORY.active = def;
|
|
2009
3440
|
}
|
|
2010
3441
|
return FACTORY[def || FACTORY.active];
|
|
@@ -2013,10 +3444,10 @@ var getActiveConfig = (def) => {
|
|
|
2013
3444
|
return FACTORY[def || FACTORY.active];
|
|
2014
3445
|
};
|
|
2015
3446
|
var setActiveConfig = (newConfig) => {
|
|
2016
|
-
if (!(0,
|
|
3447
|
+
if (!(0, import_utils2.isObject)(newConfig))
|
|
2017
3448
|
return;
|
|
2018
3449
|
FACTORY.active = "1";
|
|
2019
|
-
FACTORY["1"] = (0,
|
|
3450
|
+
FACTORY["1"] = (0, import_utils2.deepMerge)(newConfig, (0, import_utils2.deepClone)(cachedConfig));
|
|
2020
3451
|
return newConfig;
|
|
2021
3452
|
};
|
|
2022
3453
|
|
|
@@ -2162,9 +3593,9 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
2162
3593
|
unit = UNIT2.default,
|
|
2163
3594
|
useVariable
|
|
2164
3595
|
} = sequenceProps;
|
|
2165
|
-
if ((0,
|
|
3596
|
+
if ((0, import_utils3.isString)(value) && value.slice(0, 2) === "--")
|
|
2166
3597
|
return `var(${value})`;
|
|
2167
|
-
const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
3598
|
+
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
2168
3599
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
2169
3600
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
2170
3601
|
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
@@ -2227,11 +3658,11 @@ var findHeadings = (propertyNames) => {
|
|
|
2227
3658
|
};
|
|
2228
3659
|
|
|
2229
3660
|
// src/utils/var.js
|
|
2230
|
-
var
|
|
3661
|
+
var import_utils5 = __toESM(require_cjs2(), 1);
|
|
2231
3662
|
var setVariables = (result, key) => {
|
|
2232
3663
|
const CONFIG2 = getActiveConfig();
|
|
2233
3664
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
2234
|
-
if ((0,
|
|
3665
|
+
if ((0, import_utils5.isObjectLike)(result.value)) {
|
|
2235
3666
|
} else {
|
|
2236
3667
|
CSS_VARS2[result.var] = result.value;
|
|
2237
3668
|
}
|
|
@@ -2306,7 +3737,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2306
3737
|
};
|
|
2307
3738
|
|
|
2308
3739
|
// src/utils/sprite.js
|
|
2309
|
-
var
|
|
3740
|
+
var import_utils6 = __toESM(require_cjs2(), 1);
|
|
2310
3741
|
var generateSprite = (icons) => {
|
|
2311
3742
|
const CONFIG2 = getActiveConfig();
|
|
2312
3743
|
let sprite = "";
|
|
@@ -2320,7 +3751,7 @@ var generateSprite = (icons) => {
|
|
|
2320
3751
|
return sprite;
|
|
2321
3752
|
};
|
|
2322
3753
|
var parseRootAttributes = (htmlString) => {
|
|
2323
|
-
if (!(0,
|
|
3754
|
+
if (!(0, import_utils6.isString)(htmlString)) {
|
|
2324
3755
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
2325
3756
|
}
|
|
2326
3757
|
const match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -2340,7 +3771,7 @@ var replaceIdsAndUrls = (code, key) => {
|
|
|
2340
3771
|
const urlRegex = /url\(#([^)]*)\)/g;
|
|
2341
3772
|
const matches = code.match(/id="([^"]*)"/g);
|
|
2342
3773
|
let replacedCode = code;
|
|
2343
|
-
if ((0,
|
|
3774
|
+
if ((0, import_utils6.isArray)(matches)) {
|
|
2344
3775
|
matches.forEach(() => {
|
|
2345
3776
|
const randomKey = Math.floor(Math.random() * 1e5);
|
|
2346
3777
|
replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
|
|
@@ -2399,10 +3830,10 @@ __export(system_exports, {
|
|
|
2399
3830
|
});
|
|
2400
3831
|
|
|
2401
3832
|
// src/system/color.js
|
|
2402
|
-
var
|
|
3833
|
+
var import_utils7 = __toESM(require_cjs2(), 1);
|
|
2403
3834
|
var getColor = (value, key, config) => {
|
|
2404
3835
|
const CONFIG2 = config || getActiveConfig();
|
|
2405
|
-
if (!(0,
|
|
3836
|
+
if (!(0, import_utils7.isString)(value)) {
|
|
2406
3837
|
if (CONFIG2.verbose)
|
|
2407
3838
|
console.warn(value, "- type for color is not valid");
|
|
2408
3839
|
return;
|
|
@@ -2411,7 +3842,7 @@ var getColor = (value, key, config) => {
|
|
|
2411
3842
|
return `var(${value})`;
|
|
2412
3843
|
if (key && value[key])
|
|
2413
3844
|
value = value[key];
|
|
2414
|
-
const [name, alpha, tone] = (0,
|
|
3845
|
+
const [name, alpha, tone] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
|
|
2415
3846
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
2416
3847
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
2417
3848
|
if (!val) {
|
|
@@ -2443,17 +3874,17 @@ var getMediaColor = (value, globalTheme, config) => {
|
|
|
2443
3874
|
const CONFIG2 = config || getActiveConfig();
|
|
2444
3875
|
if (!globalTheme)
|
|
2445
3876
|
globalTheme = CONFIG2.globalTheme;
|
|
2446
|
-
if (!(0,
|
|
3877
|
+
if (!(0, import_utils7.isString)(value)) {
|
|
2447
3878
|
if (CONFIG2.verbose)
|
|
2448
3879
|
console.warn(value, "- type for color is not valid");
|
|
2449
3880
|
return;
|
|
2450
3881
|
}
|
|
2451
3882
|
if (value.slice(0, 2) === "--")
|
|
2452
3883
|
return `var(${value})`;
|
|
2453
|
-
const [name] = (0,
|
|
3884
|
+
const [name] = (0, import_utils7.isArray)(value) ? value : value.split(" ");
|
|
2454
3885
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
2455
3886
|
const val = COLOR2[name] || GRADIENT2[name];
|
|
2456
|
-
const isObj = (0,
|
|
3887
|
+
const isObj = (0, import_utils7.isObject)(val);
|
|
2457
3888
|
if (isObj && val.value)
|
|
2458
3889
|
return getColor(value, `@${globalTheme}`, config);
|
|
2459
3890
|
else if (isObj) {
|
|
@@ -2476,7 +3907,7 @@ var getMediaColor = (value, globalTheme, config) => {
|
|
|
2476
3907
|
};
|
|
2477
3908
|
var setColor = (val, key, suffix) => {
|
|
2478
3909
|
const CONFIG2 = getActiveConfig();
|
|
2479
|
-
if ((0,
|
|
3910
|
+
if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--") {
|
|
2480
3911
|
val = getColor(val.slice(2));
|
|
2481
3912
|
if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
|
|
2482
3913
|
if (CONFIG2.verbose)
|
|
@@ -2484,13 +3915,13 @@ var setColor = (val, key, suffix) => {
|
|
|
2484
3915
|
val = val.split(" ")[0];
|
|
2485
3916
|
}
|
|
2486
3917
|
}
|
|
2487
|
-
if ((0,
|
|
3918
|
+
if ((0, import_utils7.isArray)(val)) {
|
|
2488
3919
|
return {
|
|
2489
3920
|
"@light": setColor(val[0], key, "light"),
|
|
2490
3921
|
"@dark": setColor(val[1], key, "dark")
|
|
2491
3922
|
};
|
|
2492
3923
|
}
|
|
2493
|
-
if ((0,
|
|
3924
|
+
if ((0, import_utils7.isObject)(val)) {
|
|
2494
3925
|
const obj = {};
|
|
2495
3926
|
for (const variant in val) {
|
|
2496
3927
|
obj[variant] = setColor(
|
|
@@ -2519,15 +3950,15 @@ var setColor = (val, key, suffix) => {
|
|
|
2519
3950
|
};
|
|
2520
3951
|
var setGradient = (val, key, suffix) => {
|
|
2521
3952
|
const CONFIG2 = getActiveConfig();
|
|
2522
|
-
if ((0,
|
|
3953
|
+
if ((0, import_utils7.isString)(val) && val.slice(0, 2) === "--")
|
|
2523
3954
|
val = getColor(val.slice(2));
|
|
2524
|
-
if ((0,
|
|
3955
|
+
if ((0, import_utils7.isArray)(val)) {
|
|
2525
3956
|
return {
|
|
2526
3957
|
"@light": setGradient(val[0], key, "light"),
|
|
2527
3958
|
"@dark": setGradient(val[0], key, "dark")
|
|
2528
3959
|
};
|
|
2529
3960
|
}
|
|
2530
|
-
if ((0,
|
|
3961
|
+
if ((0, import_utils7.isObject)(val)) {
|
|
2531
3962
|
const obj = {};
|
|
2532
3963
|
for (const variant in val)
|
|
2533
3964
|
obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -2544,7 +3975,7 @@ var setGradient = (val, key, suffix) => {
|
|
|
2544
3975
|
};
|
|
2545
3976
|
|
|
2546
3977
|
// src/system/theme.js
|
|
2547
|
-
var
|
|
3978
|
+
var import_utils9 = __toESM(require_cjs2(), 1);
|
|
2548
3979
|
var setThemeValue = (theme) => {
|
|
2549
3980
|
const value = {};
|
|
2550
3981
|
const { state, media, helpers, ...rest } = theme;
|
|
@@ -2567,7 +3998,7 @@ var getTheme = (value, modifier) => {
|
|
|
2567
3998
|
if (CONFIG2.useVariable)
|
|
2568
3999
|
return getMediaTheme(value, modifier);
|
|
2569
4000
|
const { THEME: THEME2 } = CONFIG2;
|
|
2570
|
-
if ((0,
|
|
4001
|
+
if ((0, import_utils9.isString)(value)) {
|
|
2571
4002
|
const [theme, subtheme] = value.split(" ");
|
|
2572
4003
|
const isOurTheme = THEME2[theme];
|
|
2573
4004
|
if (isOurTheme) {
|
|
@@ -2576,7 +4007,7 @@ var getTheme = (value, modifier) => {
|
|
|
2576
4007
|
value = [theme, subtheme || modifier];
|
|
2577
4008
|
}
|
|
2578
4009
|
}
|
|
2579
|
-
if ((0,
|
|
4010
|
+
if ((0, import_utils9.isObjectLike)(value) && value[1]) {
|
|
2580
4011
|
const themeName = value[0];
|
|
2581
4012
|
const subThemeName = value[1];
|
|
2582
4013
|
const { helpers, media, state } = THEME2[themeName];
|
|
@@ -2586,11 +4017,11 @@ var getTheme = (value, modifier) => {
|
|
|
2586
4017
|
return getThemeValue(helpers[subThemeName]);
|
|
2587
4018
|
if (state && state[subThemeName])
|
|
2588
4019
|
return getThemeValue(state[subThemeName]);
|
|
2589
|
-
} else if ((0,
|
|
4020
|
+
} else if ((0, import_utils9.isObject)(value))
|
|
2590
4021
|
return setThemeValue(value);
|
|
2591
4022
|
};
|
|
2592
4023
|
var setInverseTheme = (theme, variant, value) => {
|
|
2593
|
-
if ((0,
|
|
4024
|
+
if ((0, import_utils9.isObject)(variant)) {
|
|
2594
4025
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
2595
4026
|
} else if (variant === true) {
|
|
2596
4027
|
const { color, background } = value;
|
|
@@ -2605,7 +4036,7 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
2605
4036
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
2606
4037
|
const result = getTheme(variant);
|
|
2607
4038
|
themeValue[`&:${key}`] = result;
|
|
2608
|
-
if ((0,
|
|
4039
|
+
if ((0, import_utils9.isObject)(variant) && !variant.value)
|
|
2609
4040
|
variant.value = result;
|
|
2610
4041
|
};
|
|
2611
4042
|
var setSelectors = (theme, value) => {
|
|
@@ -2623,7 +4054,7 @@ var setSelectors = (theme, value) => {
|
|
|
2623
4054
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
2624
4055
|
const result = getTheme(variant);
|
|
2625
4056
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
2626
|
-
if ((0,
|
|
4057
|
+
if ((0, import_utils9.isObject)(variant) && !variant.value)
|
|
2627
4058
|
variant.value = result;
|
|
2628
4059
|
};
|
|
2629
4060
|
var setMedia = (theme, value) => {
|
|
@@ -2649,7 +4080,7 @@ var setHelpers = (theme, value) => {
|
|
|
2649
4080
|
const keys = Object.keys(helpers);
|
|
2650
4081
|
keys.map((key) => {
|
|
2651
4082
|
const helper = helpers[key];
|
|
2652
|
-
if ((0,
|
|
4083
|
+
if ((0, import_utils9.isString)(helper))
|
|
2653
4084
|
helpers[key] = CONFIG2.THEME[helper];
|
|
2654
4085
|
else
|
|
2655
4086
|
getThemeValue(helpers[key]);
|
|
@@ -2673,7 +4104,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
2673
4104
|
const CONFIG2 = getActiveConfig();
|
|
2674
4105
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
2675
4106
|
const theme = { value: val };
|
|
2676
|
-
if ((0,
|
|
4107
|
+
if ((0, import_utils9.isObjectLike)(val)) {
|
|
2677
4108
|
for (const param in val) {
|
|
2678
4109
|
const symb = param.slice(0, 1);
|
|
2679
4110
|
const value = val[param];
|
|
@@ -2701,7 +4132,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
2701
4132
|
};
|
|
2702
4133
|
}
|
|
2703
4134
|
}
|
|
2704
|
-
if ((0,
|
|
4135
|
+
if ((0, import_utils9.isString)(val) && val.slice(0, 2) === "--") {
|
|
2705
4136
|
const { THEME: THEME2 } = CONFIG2;
|
|
2706
4137
|
const value = THEME2[val.slice(2)];
|
|
2707
4138
|
const getReferenced = getMediaTheme(value, prefers);
|
|
@@ -2714,7 +4145,7 @@ var recursiveTheme = (val) => {
|
|
|
2714
4145
|
const obj = {};
|
|
2715
4146
|
for (const param in val) {
|
|
2716
4147
|
const symb = param.slice(0, 1);
|
|
2717
|
-
if ((0,
|
|
4148
|
+
if ((0, import_utils9.isObjectLike)(val[param])) {
|
|
2718
4149
|
if (symb === "@") {
|
|
2719
4150
|
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
2720
4151
|
const media = `@media screen and ${query}`;
|
|
@@ -2734,25 +4165,25 @@ var findModifierFromArray = (val, modifierArray) => {
|
|
|
2734
4165
|
return val;
|
|
2735
4166
|
};
|
|
2736
4167
|
var findModifier = (val, modifier) => {
|
|
2737
|
-
if ((0,
|
|
4168
|
+
if ((0, import_utils9.isArray)(modifier))
|
|
2738
4169
|
return findModifierFromArray(val, modifier);
|
|
2739
|
-
else if ((0,
|
|
4170
|
+
else if ((0, import_utils9.isString)(modifier) && val[modifier])
|
|
2740
4171
|
return val[modifier];
|
|
2741
4172
|
else
|
|
2742
4173
|
return val;
|
|
2743
4174
|
};
|
|
2744
4175
|
var getMediaTheme = (value, modifier) => {
|
|
2745
4176
|
const activeConfig = getActiveConfig();
|
|
2746
|
-
if ((0,
|
|
4177
|
+
if ((0, import_utils9.isString)(value) && value.slice(0, 2) === "--") {
|
|
2747
4178
|
value = getMediaTheme(value.slice(2));
|
|
2748
4179
|
}
|
|
2749
|
-
if (!value || !(0,
|
|
4180
|
+
if (!value || !(0, import_utils9.isString)(value)) {
|
|
2750
4181
|
if (activeConfig.verbose) {
|
|
2751
4182
|
console.warn(`${value} - Theme is not a string`);
|
|
2752
4183
|
}
|
|
2753
4184
|
return;
|
|
2754
4185
|
}
|
|
2755
|
-
const [themeName, ...themeModifiers] = (0,
|
|
4186
|
+
const [themeName, ...themeModifiers] = (0, import_utils9.isArray)(value) ? value : value.split(" ");
|
|
2756
4187
|
let themeValue = activeConfig.THEME[themeName];
|
|
2757
4188
|
if (themeValue && (themeModifiers || modifier)) {
|
|
2758
4189
|
themeValue = findModifier(themeValue, themeModifiers.length ? themeModifiers : modifier);
|
|
@@ -2762,10 +4193,11 @@ var getMediaTheme = (value, modifier) => {
|
|
|
2762
4193
|
};
|
|
2763
4194
|
|
|
2764
4195
|
// src/system/font.js
|
|
2765
|
-
var
|
|
4196
|
+
var import_utils10 = __toESM(require_cjs2(), 1);
|
|
4197
|
+
var import_utils11 = __toESM(require_cjs3(), 1);
|
|
2766
4198
|
var setFont = (val, key) => {
|
|
2767
4199
|
const CSSvar = `--font-${key}`;
|
|
2768
|
-
if (!val || (0,
|
|
4200
|
+
if (!val || (0, import_utils10.isArray)(val) && !val[0])
|
|
2769
4201
|
return;
|
|
2770
4202
|
const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
|
|
2771
4203
|
return { var: CSSvar, value: val, fontFace };
|
|
@@ -2781,15 +4213,15 @@ var setFontFamily = (val, key) => {
|
|
|
2781
4213
|
let { value, type } = val;
|
|
2782
4214
|
if (val.isDefault)
|
|
2783
4215
|
FONT_FAMILY2.default = key;
|
|
2784
|
-
if ((0,
|
|
2785
|
-
value = arrayzeValue(value);
|
|
4216
|
+
if ((0, import_utils10.isObject)(value))
|
|
4217
|
+
value = (0, import_utils11.arrayzeValue)(value);
|
|
2786
4218
|
const CSSvar = `--font-family-${key}`;
|
|
2787
4219
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
2788
4220
|
return { var: CSSvar, value: str, arr: value, type };
|
|
2789
4221
|
};
|
|
2790
4222
|
|
|
2791
4223
|
// src/system/typography.js
|
|
2792
|
-
var
|
|
4224
|
+
var import_utils13 = __toESM(require_cjs2(), 1);
|
|
2793
4225
|
var runThroughMedia = (FACTORY2) => {
|
|
2794
4226
|
const CONFIG2 = getActiveConfig();
|
|
2795
4227
|
const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
|
|
@@ -2809,7 +4241,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
2809
4241
|
h1Matches,
|
|
2810
4242
|
unit
|
|
2811
4243
|
} = FACTORY2;
|
|
2812
|
-
(0,
|
|
4244
|
+
(0, import_utils13.merge)(mediaValue, {
|
|
2813
4245
|
type,
|
|
2814
4246
|
base,
|
|
2815
4247
|
ratio,
|
|
@@ -2826,7 +4258,7 @@ var runThroughMedia = (FACTORY2) => {
|
|
|
2826
4258
|
applyMediaSequenceVars(FACTORY2, prop);
|
|
2827
4259
|
continue;
|
|
2828
4260
|
}
|
|
2829
|
-
(0,
|
|
4261
|
+
(0, import_utils13.merge)(mediaValue, {
|
|
2830
4262
|
sequence: {},
|
|
2831
4263
|
scales: {},
|
|
2832
4264
|
templates: {},
|
|
@@ -2874,7 +4306,8 @@ var getFontSizeByKey = (value) => {
|
|
|
2874
4306
|
};
|
|
2875
4307
|
|
|
2876
4308
|
// src/system/spacing.js
|
|
2877
|
-
var
|
|
4309
|
+
var import_utils15 = __toESM(require_cjs3(), 1);
|
|
4310
|
+
var import_utils16 = __toESM(require_cjs2(), 1);
|
|
2878
4311
|
var runThroughMedia2 = (FACTORY2) => {
|
|
2879
4312
|
for (const prop in FACTORY2) {
|
|
2880
4313
|
const mediaProps = FACTORY2[prop];
|
|
@@ -2890,7 +4323,7 @@ var runThroughMedia2 = (FACTORY2) => {
|
|
|
2890
4323
|
h1Matches,
|
|
2891
4324
|
unit
|
|
2892
4325
|
} = FACTORY2;
|
|
2893
|
-
(0,
|
|
4326
|
+
(0, import_utils16.merge)(mediaProps, {
|
|
2894
4327
|
type,
|
|
2895
4328
|
base,
|
|
2896
4329
|
ratio,
|
|
@@ -2924,11 +4357,11 @@ var getSequence = (sequenceProps) => {
|
|
|
2924
4357
|
};
|
|
2925
4358
|
var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
2926
4359
|
const sequence = getSequence(sequenceProps);
|
|
2927
|
-
if ((0,
|
|
4360
|
+
if ((0, import_utils16.isString)(value) && (value.includes("calc") || value.includes("var"))) {
|
|
2928
4361
|
return { [propertyName]: value };
|
|
2929
4362
|
}
|
|
2930
|
-
const stack = arrayzeValue(value);
|
|
2931
|
-
if (!(0,
|
|
4363
|
+
const stack = (0, import_utils15.arrayzeValue)(value);
|
|
4364
|
+
if (!(0, import_utils16.isArray)(stack))
|
|
2932
4365
|
return;
|
|
2933
4366
|
if (stack.length > 1) {
|
|
2934
4367
|
let suffix = "";
|
|
@@ -2963,7 +4396,7 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
2963
4396
|
let sequenceProps = SPACING2[spacingRatio];
|
|
2964
4397
|
if (!sequenceProps) {
|
|
2965
4398
|
const { type, base, range, subSequence } = SPACING2;
|
|
2966
|
-
sequenceProps = SPACING2[spacingRatio] = (0,
|
|
4399
|
+
sequenceProps = SPACING2[spacingRatio] = (0, import_utils16.merge)({
|
|
2967
4400
|
ratio: spacingRatio,
|
|
2968
4401
|
type: type + "-" + spacingRatio,
|
|
2969
4402
|
unit,
|
|
@@ -2986,16 +4419,16 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
2986
4419
|
};
|
|
2987
4420
|
|
|
2988
4421
|
// src/system/shadow.js
|
|
2989
|
-
var
|
|
4422
|
+
var import_utils18 = __toESM(require_cjs2(), 1);
|
|
2990
4423
|
var setShadow = (value, key, suffix, prefers) => {
|
|
2991
4424
|
const CONFIG2 = getActiveConfig();
|
|
2992
|
-
if ((0,
|
|
4425
|
+
if ((0, import_utils18.isArray)(value)) {
|
|
2993
4426
|
return {
|
|
2994
4427
|
"@light": setShadow(value[0], key, "light"),
|
|
2995
4428
|
"@dark": setShadow(value[1], key, "dark")
|
|
2996
4429
|
};
|
|
2997
4430
|
}
|
|
2998
|
-
if ((0,
|
|
4431
|
+
if ((0, import_utils18.isObject)(value)) {
|
|
2999
4432
|
const obj = {};
|
|
3000
4433
|
for (const variant in value) {
|
|
3001
4434
|
obj[variant] = setShadow(
|
|
@@ -3006,7 +4439,7 @@ var setShadow = (value, key, suffix, prefers) => {
|
|
|
3006
4439
|
}
|
|
3007
4440
|
return obj;
|
|
3008
4441
|
}
|
|
3009
|
-
if ((0,
|
|
4442
|
+
if ((0, import_utils18.isString)(value) && value.includes(",")) {
|
|
3010
4443
|
value = value.split(",").map((v) => {
|
|
3011
4444
|
v = v.trim();
|
|
3012
4445
|
if (v.startsWith("--"))
|
|
@@ -3034,17 +4467,17 @@ var getShadow = (value, globalTheme) => {
|
|
|
3034
4467
|
const CONFIG2 = getActiveConfig();
|
|
3035
4468
|
if (!globalTheme)
|
|
3036
4469
|
globalTheme = CONFIG2.globalTheme;
|
|
3037
|
-
if (!(0,
|
|
4470
|
+
if (!(0, import_utils18.isString)(value)) {
|
|
3038
4471
|
if (CONFIG2.verbose)
|
|
3039
4472
|
console.warn(value, "- type for color is not valid");
|
|
3040
4473
|
return;
|
|
3041
4474
|
}
|
|
3042
4475
|
if (value.slice(0, 2) === "--")
|
|
3043
4476
|
return `var(${value})`;
|
|
3044
|
-
const [name] = (0,
|
|
4477
|
+
const [name] = (0, import_utils18.isArray)(value) ? value : value.split(" ");
|
|
3045
4478
|
const { SHADOW: SHADOW2 } = CONFIG2;
|
|
3046
4479
|
const val = SHADOW2[name];
|
|
3047
|
-
const isObj = (0,
|
|
4480
|
+
const isObj = (0, import_utils18.isObject)(val);
|
|
3048
4481
|
if (!val) {
|
|
3049
4482
|
if (CONFIG2.verbose)
|
|
3050
4483
|
console.warn("Can't find color ", name);
|
|
@@ -3073,6 +4506,7 @@ var getShadow = (value, globalTheme) => {
|
|
|
3073
4506
|
};
|
|
3074
4507
|
|
|
3075
4508
|
// src/system/timing.js
|
|
4509
|
+
var import_utils19 = __toESM(require_cjs3(), 1);
|
|
3076
4510
|
var applyTimingSequence = () => {
|
|
3077
4511
|
const CONFIG2 = getActiveConfig();
|
|
3078
4512
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
@@ -3082,7 +4516,7 @@ var applyTimingSequence = () => {
|
|
|
3082
4516
|
var getTimingFunction = (value) => {
|
|
3083
4517
|
const CONFIG2 = getActiveConfig();
|
|
3084
4518
|
const { TIMING: TIMING2 } = CONFIG2;
|
|
3085
|
-
return TIMING2[value] || TIMING2[toCamelCase(value)] || value;
|
|
4519
|
+
return TIMING2[value] || TIMING2[(0, import_utils19.toCamelCase)(value)] || value;
|
|
3086
4520
|
};
|
|
3087
4521
|
var getTimingByKey = (value, property = "timing") => {
|
|
3088
4522
|
const CONFIG2 = getActiveConfig();
|
|
@@ -3095,11 +4529,11 @@ var getTimingByKey = (value, property = "timing") => {
|
|
|
3095
4529
|
};
|
|
3096
4530
|
|
|
3097
4531
|
// src/system/document.js
|
|
3098
|
-
var
|
|
4532
|
+
var import_utils21 = __toESM(require_cjs2(), 1);
|
|
3099
4533
|
var applyDocument = () => {
|
|
3100
4534
|
const CONFIG2 = getActiveConfig();
|
|
3101
4535
|
const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
3102
|
-
return (0,
|
|
4536
|
+
return (0, import_utils21.merge)(DOCUMENT2, {
|
|
3103
4537
|
theme: THEME2.document,
|
|
3104
4538
|
fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
|
|
3105
4539
|
fontSize: TYPOGRAPHY2.base,
|
|
@@ -3183,7 +4617,7 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
|
|
|
3183
4617
|
};
|
|
3184
4618
|
|
|
3185
4619
|
// src/system/reset.js
|
|
3186
|
-
var
|
|
4620
|
+
var import_utils24 = __toESM(require_cjs2(), 1);
|
|
3187
4621
|
var applyReset = (reset = {}) => {
|
|
3188
4622
|
const CONFIG2 = getActiveConfig();
|
|
3189
4623
|
const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
|
|
@@ -3205,8 +4639,8 @@ var applyReset = (reset = {}) => {
|
|
|
3205
4639
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
3206
4640
|
const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
|
|
3207
4641
|
if (RESET2.html)
|
|
3208
|
-
(0,
|
|
3209
|
-
return (0,
|
|
4642
|
+
(0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
|
|
4643
|
+
return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
|
|
3210
4644
|
html: {
|
|
3211
4645
|
position: "absolute",
|
|
3212
4646
|
// overflow: 'hidden',
|
|
@@ -3245,7 +4679,7 @@ var applyReset = (reset = {}) => {
|
|
|
3245
4679
|
};
|
|
3246
4680
|
|
|
3247
4681
|
// src/transforms/index.js
|
|
3248
|
-
var
|
|
4682
|
+
var import_utils25 = __toESM(require_cjs2(), 1);
|
|
3249
4683
|
var isBorderStyle = (str) => [
|
|
3250
4684
|
"none",
|
|
3251
4685
|
"hidden",
|
|
@@ -3317,7 +4751,7 @@ var transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
3317
4751
|
return v;
|
|
3318
4752
|
}).join(" ");
|
|
3319
4753
|
};
|
|
3320
|
-
var transfromGap = (gap) => (0,
|
|
4754
|
+
var transfromGap = (gap) => (0, import_utils25.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey(v, "gap").gap).join(" ");
|
|
3321
4755
|
var transformTransition = (transition) => {
|
|
3322
4756
|
const arr = transition.split(" ");
|
|
3323
4757
|
if (!arr.length)
|
|
@@ -3335,7 +4769,7 @@ var transformTransition = (transition) => {
|
|
|
3335
4769
|
}).join(" ");
|
|
3336
4770
|
};
|
|
3337
4771
|
var transformDuration = (duration, props, propertyName) => {
|
|
3338
|
-
if (!(0,
|
|
4772
|
+
if (!(0, import_utils25.isString)(duration))
|
|
3339
4773
|
return;
|
|
3340
4774
|
return duration.split(",").map((v) => getTimingByKey(v).timing || v).join(",");
|
|
3341
4775
|
};
|
|
@@ -3351,11 +4785,11 @@ var checkIfBoxSize = (propertyName) => {
|
|
|
3351
4785
|
};
|
|
3352
4786
|
var transformSize = (propertyName, val, props = {}, opts = {}) => {
|
|
3353
4787
|
let value = val || props[propertyName];
|
|
3354
|
-
if ((0,
|
|
4788
|
+
if ((0, import_utils25.isUndefined)(value) && (0, import_utils25.isNull)(value))
|
|
3355
4789
|
return;
|
|
3356
4790
|
const shouldScaleBoxSize = props.scaleBoxSize;
|
|
3357
4791
|
const isBoxSize = checkIfBoxSize(propertyName);
|
|
3358
|
-
if (!shouldScaleBoxSize && isBoxSize && (0,
|
|
4792
|
+
if (!shouldScaleBoxSize && isBoxSize && (0, import_utils25.isString)(value)) {
|
|
3359
4793
|
value = value.split(" ").map((v) => {
|
|
3360
4794
|
const isSingleLetter = v.length < 3 && /[A-Z]/.test(v);
|
|
3361
4795
|
const hasUnits = ["%", "vw", "vh", "ch"].some((unit) => value.includes(unit));
|
|
@@ -3377,9 +4811,9 @@ var transformSizeRatio = (propertyName, props) => {
|
|
|
3377
4811
|
};
|
|
3378
4812
|
|
|
3379
4813
|
// src/set.js
|
|
3380
|
-
var
|
|
4814
|
+
var import_utils26 = __toESM(require_cjs2(), 1);
|
|
3381
4815
|
var setCases = (val, key) => {
|
|
3382
|
-
if ((0,
|
|
4816
|
+
if ((0, import_utils26.isFunction)(val))
|
|
3383
4817
|
return val();
|
|
3384
4818
|
return val;
|
|
3385
4819
|
};
|