@symbo.ls/scratch 2.11.522 → 3.0.1

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/set.js CHANGED
@@ -30,44 +30,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // ../../node_modules/@domql/globals/dist/cjs/index.js
34
- var require_cjs = __commonJS({
35
- "../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
36
- "use strict";
37
- var __defProp3 = Object.defineProperty;
38
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
41
- var __export2 = (target, all) => {
42
- for (var name in all)
43
- __defProp3(target, name, { get: all[name], enumerable: true });
44
- };
45
- var __copyProps2 = (to, from, except, desc) => {
46
- if (from && typeof from === "object" || typeof from === "function") {
47
- for (let key of __getOwnPropNames2(from))
48
- if (!__hasOwnProp3.call(to, key) && key !== except)
49
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
50
- }
51
- return to;
52
- };
53
- var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
54
- var globals_exports = {};
55
- __export2(globals_exports, {
56
- document: () => document5,
57
- global: () => global,
58
- self: () => self,
59
- window: () => window4
60
- });
61
- module2.exports = __toCommonJS2(globals_exports);
62
- var global = globalThis;
63
- var self = globalThis;
64
- var window4 = globalThis;
65
- var document5 = window4.document;
66
- }
67
- });
68
-
69
33
  // ../utils/dist/cjs/index.js
70
- var require_cjs2 = __commonJS({
34
+ var require_cjs = __commonJS({
71
35
  "../utils/dist/cjs/index.js"(exports, module2) {
72
36
  "use strict";
73
37
  var __defProp3 = Object.defineProperty;
@@ -87,8 +51,8 @@ var require_cjs2 = __commonJS({
87
51
  return to;
88
52
  };
89
53
  var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
90
- var src_exports = {};
91
- __export2(src_exports, {
54
+ var index_exports = {};
55
+ __export2(index_exports, {
92
56
  arrayzeValue: () => arrayzeValue3,
93
57
  copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
94
58
  copyStringToClipboard: () => copyStringToClipboard,
@@ -109,12 +73,11 @@ var require_cjs2 = __commonJS({
109
73
  toTitleCase: () => toTitleCase,
110
74
  toggleFullscreen: () => toggleFullscreen
111
75
  });
112
- module2.exports = __toCommonJS2(src_exports);
76
+ module2.exports = __toCommonJS2(index_exports);
113
77
  var window22 = globalThis;
114
78
  var document22 = window22.document;
115
79
  var isObject2 = (arg) => {
116
- if (arg === null)
117
- return false;
80
+ if (arg === null) return false;
118
81
  return typeof arg === "object" && arg.constructor === Object;
119
82
  };
120
83
  var isString2 = (arg) => typeof arg === "string";
@@ -139,13 +102,11 @@ var require_cjs2 = __commonJS({
139
102
  };
140
103
  var findClosestNumberInFactory = (val, factory) => {
141
104
  val = parseFloat(val);
142
- if (isObject2(factory))
143
- factory = Object.values(factory);
105
+ if (isObject2(factory)) factory = Object.values(factory);
144
106
  return findClosestNumber(val, factory);
145
107
  };
146
108
  var formatDate = (timestamp) => {
147
- if (!timestamp)
148
- return "";
109
+ if (!timestamp) return "";
149
110
  const d = new Date(timestamp);
150
111
  const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
151
112
  const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
@@ -212,8 +173,7 @@ var require_cjs2 = __commonJS({
212
173
  scriptEle.type = type;
213
174
  scriptEle.text = xhr.responseText;
214
175
  doc.body.appendChild(scriptEle);
215
- if (typeof fallback === "function")
216
- fallback();
176
+ if (typeof fallback === "function") fallback();
217
177
  } else {
218
178
  throw new Error(`Failed to load the script ${FILE_URL}`);
219
179
  }
@@ -281,20 +241,15 @@ var require_cjs2 = __commonJS({
281
241
  );
282
242
  var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
283
243
  var toDescriptionCase = (str = "") => {
284
- if (typeof str !== "string")
285
- return;
244
+ if (typeof str !== "string") return;
286
245
  const result = str.replace(/([A-Z])/g, " $1");
287
246
  return result.charAt(0).toUpperCase() + result.slice(1);
288
247
  };
289
248
  var arrayzeValue3 = (val) => {
290
- if (isArray2(val))
291
- return val;
292
- if (isString2(val))
293
- return val.split(" ");
294
- if (isObject2(val))
295
- return Object.values(val);
296
- if (isNumber2(val))
297
- return [val];
249
+ if (isArray2(val)) return val;
250
+ if (isString2(val)) return val.split(" ");
251
+ if (isObject2(val)) return Object.values(val);
252
+ if (isNumber2(val)) return [val];
298
253
  };
299
254
  }
300
255
  });
@@ -309,19 +264,18 @@ __export(set_exports, {
309
264
  });
310
265
  module.exports = __toCommonJS(set_exports);
311
266
 
312
- // ../../node_modules/@domql/utils/dist/esm/globals.js
267
+ // node_modules/@domql/utils/dist/esm/globals.js
313
268
  var window2 = globalThis;
314
269
  var document2 = window2.document;
315
270
 
316
- // ../../node_modules/@domql/utils/dist/esm/node.js
271
+ // node_modules/@domql/utils/dist/esm/node.js
317
272
  var isDOMNode = (obj) => {
318
273
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
319
274
  };
320
275
 
321
- // ../../node_modules/@domql/utils/dist/esm/types.js
276
+ // node_modules/@domql/utils/dist/esm/types.js
322
277
  var isObject = (arg) => {
323
- if (arg === null)
324
- return false;
278
+ if (arg === null) return false;
325
279
  return typeof arg === "object" && arg.constructor === Object;
326
280
  };
327
281
  var isString = (arg) => typeof arg === "string";
@@ -330,20 +284,19 @@ var isFunction = (arg) => typeof arg === "function";
330
284
  var isNull = (arg) => arg === null;
331
285
  var isArray = (arg) => Array.isArray(arg);
332
286
  var isObjectLike = (arg) => {
333
- if (arg === null)
334
- return false;
287
+ if (arg === null) return false;
335
288
  return typeof arg === "object";
336
289
  };
337
290
  var isUndefined = (arg) => {
338
291
  return arg === void 0;
339
292
  };
340
293
 
341
- // ../../node_modules/@domql/utils/dist/esm/array.js
294
+ // node_modules/@domql/utils/dist/esm/array.js
342
295
  var mergeArray = (arr, exclude = []) => {
343
296
  return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
344
297
  };
345
298
 
346
- // ../../node_modules/@domql/utils/dist/esm/object.js
299
+ // node_modules/@domql/utils/dist/esm/object.js
347
300
  var __defProp2 = Object.defineProperty;
348
301
  var __defProps = Object.defineProperties;
349
302
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -366,8 +319,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
366
319
  var merge = (element, obj, excludeFrom = []) => {
367
320
  for (const e in obj) {
368
321
  const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
369
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
370
- continue;
322
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
371
323
  const elementProp = element[e];
372
324
  const objProp = obj[e];
373
325
  if (elementProp === void 0) {
@@ -379,8 +331,7 @@ var merge = (element, obj, excludeFrom = []) => {
379
331
  var deepMerge = (element, extend, excludeFrom = []) => {
380
332
  for (const e in extend) {
381
333
  const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
382
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
383
- continue;
334
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
384
335
  const elementProp = element[e];
385
336
  const extendProp = extend[e];
386
337
  if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
@@ -409,13 +360,10 @@ var deepClone = (obj, options = {}) => {
409
360
  const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
410
361
  visited.set(obj, clone2);
411
362
  for (const key in obj) {
412
- if (!Object.prototype.hasOwnProperty.call(obj, key))
413
- continue;
414
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
415
- continue;
363
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
364
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
416
365
  const value = obj[key];
417
- if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
418
- continue;
366
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
419
367
  if (isDOMNode(value)) {
420
368
  clone2[key] = value;
421
369
  continue;
@@ -444,14 +392,11 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
444
392
  if (!isObjectLike(obj) || !isObjectLike(params) || isDOMNode(obj) || isDOMNode(params)) {
445
393
  return params;
446
394
  }
447
- if (visited.has(obj))
448
- return visited.get(obj);
395
+ if (visited.has(obj)) return visited.get(obj);
449
396
  visited.set(obj, obj);
450
397
  for (const e in params) {
451
- if (!Object.hasOwnProperty.call(params, e))
452
- continue;
453
- if (excl.includes(e) || forcedExclude && e.startsWith("__"))
454
- continue;
398
+ if (!Object.hasOwnProperty.call(params, e)) continue;
399
+ if (excl.includes(e) || forcedExclude && e.startsWith("__")) continue;
455
400
  const objProp = obj[e];
456
401
  const paramsProp = params[e];
457
402
  if (isDOMNode(paramsProp)) {
@@ -465,7 +410,7 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
465
410
  return obj;
466
411
  };
467
412
 
468
- // ../../node_modules/@domql/utils/dist/esm/cookie.js
413
+ // node_modules/@domql/utils/dist/esm/cookie.js
469
414
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
470
415
 
471
416
  // src/defaultConfig/index.js
@@ -689,8 +634,7 @@ var getActiveConfig = (def) => {
689
634
  return FACTORY[def || FACTORY.active] || CONFIG;
690
635
  };
691
636
  var setActiveConfig = (newConfig) => {
692
- if (!isObject(newConfig))
693
- return;
637
+ if (!isObject(newConfig)) return;
694
638
  FACTORY.active = "1";
695
639
  FACTORY["1"] = deepMerge(newConfig, deepClone(cachedConfig));
696
640
  return newConfig;
@@ -702,12 +646,9 @@ var isScalingUnit = (unit) => {
702
646
  };
703
647
 
704
648
  // src/utils/color.js
705
- var import_globals4 = __toESM(require_cjs(), 1);
706
649
  var colorStringToRgbaArray = (color) => {
707
- if (color === "")
708
- return [0, 0, 0, 0];
709
- if (color.toLowerCase() === "transparent")
710
- return [0, 0, 0, 0];
650
+ if (color === "") return [0, 0, 0, 0];
651
+ if (color.toLowerCase() === "transparent") return [0, 0, 0, 0];
711
652
  if (color[0] === "#") {
712
653
  if (color.length < 7) {
713
654
  color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
@@ -720,26 +661,25 @@ var colorStringToRgbaArray = (color) => {
720
661
  ];
721
662
  }
722
663
  if (color.indexOf("rgb") === -1) {
723
- if (import_globals4.document && import_globals4.window) {
724
- const elem = import_globals4.document.body.appendChild(import_globals4.document.createElement("fictum"));
664
+ if (document2 && window2) {
665
+ const elem = document2.body.appendChild(document2.createElement("fictum"));
725
666
  const flag = "rgb(1, 2, 3)";
726
667
  elem.style.color = flag;
727
668
  if (elem.style.color !== flag) {
728
- import_globals4.document.body.removeChild(elem);
669
+ document2.body.removeChild(elem);
729
670
  return;
730
671
  }
731
672
  elem.style.color = color;
732
673
  if (elem.style.color === flag || elem.style.color === "") {
733
- import_globals4.document.body.removeChild(elem);
674
+ document2.body.removeChild(elem);
734
675
  return [0, 0, 0, 0];
735
676
  }
736
- color = import_globals4.window.getComputedStyle(elem).color;
737
- import_globals4.document.body.removeChild(elem);
677
+ color = window2.getComputedStyle(elem).color;
678
+ document2.body.removeChild(elem);
738
679
  }
739
680
  }
740
681
  if (color.indexOf("rgb") === 0) {
741
- if (color.indexOf("rgba") === -1)
742
- color = `${color}, 1`;
682
+ if (color.indexOf("rgba") === -1) color = `${color}, 1`;
743
683
  return color.match(/[\.\d]+/g).map((a) => +a);
744
684
  }
745
685
  return [0, 0, 0, 0];
@@ -765,29 +705,20 @@ var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) %
765
705
  var getColorShade = (col, amt) => {
766
706
  const num = parseInt(col, 16);
767
707
  let r = (num >> 16) + amt;
768
- if (r > 255)
769
- r = 255;
770
- else if (r < 0)
771
- r = 0;
708
+ if (r > 255) r = 255;
709
+ else if (r < 0) r = 0;
772
710
  let b = (num >> 8 & 255) + amt;
773
- if (b > 255)
774
- b = 255;
775
- else if (b < 0)
776
- b = 0;
711
+ if (b > 255) b = 255;
712
+ else if (b < 0) b = 0;
777
713
  let g = (num & 255) + amt;
778
- if (g > 255)
779
- g = 255;
780
- else if (g < 0)
781
- g = 0;
714
+ if (g > 255) g = 255;
715
+ else if (g < 0) g = 0;
782
716
  return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
783
717
  };
784
718
  var getRgbTone = (rgb, tone) => {
785
- if (isString(rgb) && rgb.includes("rgb"))
786
- rgb = colorStringToRgbaArray(rgb).join(", ");
787
- if (isString(rgb))
788
- rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
789
- if (isNumber(tone))
790
- tone += "";
719
+ if (isString(rgb) && rgb.includes("rgb")) rgb = colorStringToRgbaArray(rgb).join(", ");
720
+ if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
721
+ if (isNumber(tone)) tone += "";
791
722
  const toHex = rgbArrayToHex(rgb);
792
723
  const abs = tone.slice(0, 1);
793
724
  if (abs === "-" || abs === "+") {
@@ -804,10 +735,8 @@ var getRgbTone = (rgb, tone) => {
804
735
 
805
736
  // src/utils/font.js
806
737
  var getDefaultOrFirstKey = (LIBRARY, key) => {
807
- if (LIBRARY[key])
808
- return LIBRARY[key].value;
809
- if (LIBRARY.default)
810
- return LIBRARY[LIBRARY.default].value;
738
+ if (LIBRARY[key]) return LIBRARY[key].value;
739
+ if (LIBRARY.default) return LIBRARY[LIBRARY.default].value;
811
740
  const hasValue = Object.keys(LIBRARY)[0];
812
741
  return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
813
742
  };
@@ -829,7 +758,7 @@ var getFontFaceEach = (name, weights) => {
829
758
  };
830
759
 
831
760
  // src/utils/sequence.js
832
- var import_utils4 = __toESM(require_cjs2(), 1);
761
+ var import_utils4 = __toESM(require_cjs(), 1);
833
762
  var numToLetterMap = {
834
763
  "-6": "U",
835
764
  "-5": "V",
@@ -875,8 +804,7 @@ var setSequenceValue = (props, sequenceProps) => {
875
804
  var setScalingVar = (key, sequenceProps) => {
876
805
  const { base, type, unit } = sequenceProps;
877
806
  const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
878
- if (key === 0)
879
- return defaultVal;
807
+ if (key === 0) return defaultVal;
880
808
  const prefix = "--" + (type && type.replace(".", "-"));
881
809
  const ratioVar = `${prefix}-ratio`;
882
810
  if (key > 0) {
@@ -913,10 +841,8 @@ var generateSubSequence = (props, sequenceProps) => {
913
841
  const diffRounded = ~~next - ~~value;
914
842
  let arr;
915
843
  const [first, middle, second] = getSubratioDifference(value, ratio);
916
- if (diffRounded > 16)
917
- arr = [first, middle, second];
918
- else
919
- arr = [first, second];
844
+ if (diffRounded > 16) arr = [first, middle, second];
845
+ else arr = [first, second];
920
846
  arr.forEach((v, k) => {
921
847
  const scaling = ~~(v / base * 1e3) / 1e3;
922
848
  const newVar = variable + (k + 1);
@@ -958,8 +884,7 @@ var generateSequence = (sequenceProps) => {
958
884
  index: key
959
885
  };
960
886
  setSequenceValue(props, sequenceProps);
961
- if (subSequence)
962
- generateSubSequence(props, sequenceProps);
887
+ if (subSequence) generateSubSequence(props, sequenceProps);
963
888
  }
964
889
  return sequenceProps;
965
890
  };
@@ -971,13 +896,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
971
896
  unit = UNIT2.default,
972
897
  useVariable
973
898
  } = sequenceProps;
974
- if (isString(value) && value.slice(0, 2) === "--")
975
- return `var(${value})`;
899
+ if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
976
900
  const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
977
901
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
978
902
  const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
979
- 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)
980
- return value;
903
+ 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) return value;
981
904
  const letterVal = value.toUpperCase();
982
905
  const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
983
906
  let absValue = isNegative ? letterVal.slice(1) : letterVal;
@@ -1001,8 +924,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1001
924
  return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1002
925
  }
1003
926
  if (!sequence[absValue] && absValue.length === 2) {
1004
- if (CONFIG2.verbose)
1005
- console.warn(absValue, "- value is not found because `subSequence` is set to false");
927
+ if (CONFIG2.verbose) console.warn(absValue, "- value is not found because `subSequence` is set to false");
1006
928
  absValue = absValue.slice(0, 1);
1007
929
  }
1008
930
  if (useVariable || CONFIG2.useVariable) {
@@ -1010,8 +932,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1010
932
  return isNegative ? `calc(${varValue2} * -1)` : varValue2;
1011
933
  }
1012
934
  const sequenceItem = sequence ? sequence[absValue] : null;
1013
- if (!sequenceItem)
1014
- return console.warn("can't find", sequence, absValue);
935
+ if (!sequenceItem) return console.warn("can't find", sequence, absValue);
1015
936
  if (unit === "ms" || unit === "s") {
1016
937
  return isNegative + sequenceItem.val + unit;
1017
938
  }
@@ -1020,12 +941,10 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1020
941
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
1021
942
  if (typeof value !== "string") {
1022
943
  const CONFIG2 = getActiveConfig();
1023
- if (CONFIG2.verbose)
1024
- console.warn(propertyName, value, "is not a string");
944
+ if (CONFIG2.verbose) console.warn(propertyName, value, "is not a string");
1025
945
  return { [propertyName]: value };
1026
946
  }
1027
- if (value === "-" || value === "")
1028
- return {};
947
+ if (value === "-" || value === "") return {};
1029
948
  return { [propertyName]: getSequenceValue(value, sequenceProps) };
1030
949
  };
1031
950
  var findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index];
@@ -1085,23 +1004,19 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1085
1004
  const { mediaRegenerate } = FACTORY2;
1086
1005
  const { sequence, scales } = FACTORY2[media];
1087
1006
  const query = MEDIA2[mediaName];
1088
- if (!query && CONFIG2.verbose)
1089
- console.warn("Can't find media query ", query);
1007
+ if (!query && CONFIG2.verbose) console.warn("Can't find media query ", query);
1090
1008
  if (!mediaRegenerate) {
1091
1009
  let underMediaQuery = CSS_VARS2[`@media ${query}`];
1092
- if (!underMediaQuery)
1093
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1010
+ if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1094
1011
  applySequenceGlobalVars(underMediaQuery, FACTORY2[media], options);
1095
1012
  return;
1096
1013
  }
1097
1014
  for (const key in sequence) {
1098
1015
  const item = sequence[key];
1099
1016
  const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
1100
- if (!query && CONFIG2.verbose)
1101
- console.warn("Can't find query ", query);
1017
+ if (!query && CONFIG2.verbose) console.warn("Can't find query ", query);
1102
1018
  let underMediaQuery = CSS_VARS2[`@media ${query}`];
1103
- if (!underMediaQuery)
1104
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1019
+ if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1105
1020
  underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
1106
1021
  CSS_VARS2[item.variable + "_" + mediaName] = value;
1107
1022
  }
@@ -1158,27 +1073,21 @@ var convertSvgToSymbol = (key, code) => {
1158
1073
  var getColor = (value, key, config) => {
1159
1074
  const CONFIG2 = config || getActiveConfig();
1160
1075
  if (!isString(value)) {
1161
- if (CONFIG2.verbose)
1162
- console.warn(value, "- type for color is not valid");
1076
+ if (CONFIG2.verbose) console.warn(value, "- type for color is not valid");
1163
1077
  return;
1164
1078
  }
1165
- if (value.slice(0, 2) === "--")
1166
- return `var(${value})`;
1167
- if (key && value[key])
1168
- value = value[key];
1079
+ if (value.slice(0, 2) === "--") return `var(${value})`;
1080
+ if (key && value[key]) value = value[key];
1169
1081
  const [name, alpha, tone] = isArray(value) ? value : value.split(" ");
1170
1082
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1171
1083
  let val = COLOR2[name] || GRADIENT2[name];
1172
1084
  if (!val) {
1173
- if (CONFIG2.verbose)
1174
- console.warn("Can't find color ", name);
1085
+ if (CONFIG2.verbose) console.warn("Can't find color ", name);
1175
1086
  return value;
1176
1087
  }
1177
1088
  if (key) {
1178
- if (val[key])
1179
- val = val[key];
1180
- else if (CONFIG2.verbose)
1181
- console.warn(value, " - does not have ", key);
1089
+ if (val[key]) val = val[key];
1090
+ else if (CONFIG2.verbose) console.warn(value, " - does not have ", key);
1182
1091
  }
1183
1092
  let rgb = val.rgb;
1184
1093
  if (!rgb) {
@@ -1188,10 +1097,8 @@ var getColor = (value, key, config) => {
1188
1097
  rgb = getRgbTone(rgb, tone);
1189
1098
  val[tone] = { rgb, var: `${val.var}-${tone}` };
1190
1099
  }
1191
- if (val[tone])
1192
- rgb = val[tone].rgb;
1193
- if (alpha)
1194
- return `rgba(${rgb}, ${alpha})`;
1100
+ if (val[tone]) rgb = val[tone].rgb;
1101
+ if (alpha) return `rgba(${rgb}, ${alpha})`;
1195
1102
  return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
1196
1103
  };
1197
1104
  var setColor = (val, key, suffix) => {
@@ -1199,8 +1106,7 @@ var setColor = (val, key, suffix) => {
1199
1106
  if (isString(val) && val.slice(0, 2) === "--") {
1200
1107
  val = getColor(val.slice(2));
1201
1108
  if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
1202
- if (CONFIG2.verbose)
1203
- console.warn(val, "- referred but does not exist");
1109
+ if (CONFIG2.verbose) console.warn(val, "- referred but does not exist");
1204
1110
  val = val.split(" ")[0];
1205
1111
  }
1206
1112
  }
@@ -1239,8 +1145,7 @@ var setColor = (val, key, suffix) => {
1239
1145
  };
1240
1146
  var setGradient = (val, key, suffix) => {
1241
1147
  const CONFIG2 = getActiveConfig();
1242
- if (isString(val) && val.slice(0, 2) === "--")
1243
- val = getColor(val.slice(2));
1148
+ if (isString(val) && val.slice(0, 2) === "--") val = getColor(val.slice(2));
1244
1149
  if (isArray(val)) {
1245
1150
  return {
1246
1151
  "@light": setGradient(val[0], key, "light"),
@@ -1249,8 +1154,7 @@ var setGradient = (val, key, suffix) => {
1249
1154
  }
1250
1155
  if (isObject(val)) {
1251
1156
  const obj = {};
1252
- for (const variant in val)
1253
- obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1157
+ for (const variant in val) obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1254
1158
  return obj;
1255
1159
  }
1256
1160
  const CSSVar = `--gradient-${key}` + (suffix ? `-${suffix}` : "");
@@ -1276,22 +1180,19 @@ var setThemeValue = (theme) => {
1276
1180
  return value;
1277
1181
  };
1278
1182
  var getThemeValue = (theme) => {
1279
- if (theme.value)
1280
- return theme.value;
1183
+ if (theme.value) return theme.value;
1281
1184
  theme.value = setThemeValue(theme);
1282
1185
  return theme.value;
1283
1186
  };
1284
1187
  var getTheme = (value, modifier) => {
1285
1188
  const CONFIG2 = getActiveConfig();
1286
- if (CONFIG2.useVariable)
1287
- return getMediaTheme(value, modifier);
1189
+ if (CONFIG2.useVariable) return getMediaTheme(value, modifier);
1288
1190
  const { THEME: THEME2 } = CONFIG2;
1289
1191
  if (isString(value)) {
1290
1192
  const [theme, subtheme] = value.split(" ");
1291
1193
  const isOurTheme = THEME2[theme];
1292
1194
  if (isOurTheme) {
1293
- if (!subtheme && !modifier)
1294
- return getThemeValue(isOurTheme);
1195
+ if (!subtheme && !modifier) return getThemeValue(isOurTheme);
1295
1196
  value = [theme, subtheme || modifier];
1296
1197
  }
1297
1198
  }
@@ -1299,14 +1200,10 @@ var getTheme = (value, modifier) => {
1299
1200
  const themeName = value[0];
1300
1201
  const subThemeName = value[1];
1301
1202
  const { helpers, media, state } = THEME2[themeName];
1302
- if (media && media[subThemeName])
1303
- return getThemeValue(media[subThemeName]);
1304
- if (helpers && helpers[subThemeName])
1305
- return getThemeValue(helpers[subThemeName]);
1306
- if (state && state[subThemeName])
1307
- return getThemeValue(state[subThemeName]);
1308
- } else if (isObject(value))
1309
- return setThemeValue(value);
1203
+ if (media && media[subThemeName]) return getThemeValue(media[subThemeName]);
1204
+ if (helpers && helpers[subThemeName]) return getThemeValue(helpers[subThemeName]);
1205
+ if (state && state[subThemeName]) return getThemeValue(state[subThemeName]);
1206
+ } else if (isObject(value)) return setThemeValue(value);
1310
1207
  };
1311
1208
  var setInverseTheme = (theme, variant, value) => {
1312
1209
  if (isObject(variant)) {
@@ -1324,13 +1221,11 @@ var setInverseTheme = (theme, variant, value) => {
1324
1221
  var setPseudo = (theme, key, variant, themeValue) => {
1325
1222
  const result = getTheme(variant);
1326
1223
  themeValue[`&:${key}`] = result;
1327
- if (isObject(variant) && !variant.value)
1328
- variant.value = result;
1224
+ if (isObject(variant) && !variant.value) variant.value = result;
1329
1225
  };
1330
1226
  var setSelectors = (theme, value) => {
1331
1227
  const { state } = theme;
1332
- if (!state)
1333
- return;
1228
+ if (!state) return;
1334
1229
  const keys = Object.keys(state);
1335
1230
  keys.map((key) => {
1336
1231
  const variant = state[key];
@@ -1342,20 +1237,16 @@ var setSelectors = (theme, value) => {
1342
1237
  var setPrefersScheme = (theme, key, variant, themeValue) => {
1343
1238
  const result = getTheme(variant);
1344
1239
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
1345
- if (isObject(variant) && !variant.value)
1346
- variant.value = result;
1240
+ if (isObject(variant) && !variant.value) variant.value = result;
1347
1241
  };
1348
1242
  var setMedia = (theme, value) => {
1349
1243
  const { media } = theme;
1350
- if (!media)
1351
- return;
1244
+ if (!media) return;
1352
1245
  const keys = Object.keys(media);
1353
1246
  keys.map((key) => {
1354
1247
  const variant = media[key];
1355
- if (key === "dark" || key === "light")
1356
- setPrefersScheme(theme, key, variant, value);
1357
- if (key === "inverse")
1358
- setInverseTheme(theme, variant, value);
1248
+ if (key === "dark" || key === "light") setPrefersScheme(theme, key, variant, value);
1249
+ if (key === "inverse") setInverseTheme(theme, variant, value);
1359
1250
  return theme;
1360
1251
  });
1361
1252
  return theme;
@@ -1363,23 +1254,19 @@ var setMedia = (theme, value) => {
1363
1254
  var setHelpers = (theme, value) => {
1364
1255
  const CONFIG2 = getActiveConfig();
1365
1256
  const { helpers } = theme;
1366
- if (!helpers)
1367
- return;
1257
+ if (!helpers) return;
1368
1258
  const keys = Object.keys(helpers);
1369
1259
  keys.map((key) => {
1370
1260
  const helper = helpers[key];
1371
- if (isString(helper))
1372
- helpers[key] = CONFIG2.THEME[helper];
1373
- else
1374
- getThemeValue(helpers[key]);
1261
+ if (isString(helper)) helpers[key] = CONFIG2.THEME[helper];
1262
+ else getThemeValue(helpers[key]);
1375
1263
  return theme;
1376
1264
  });
1377
1265
  return theme;
1378
1266
  };
1379
1267
  var setTheme = (val, key) => {
1380
1268
  const CONFIG2 = getActiveConfig();
1381
- if (CONFIG2.useVariable)
1382
- return setMediaTheme(val, key);
1269
+ if (CONFIG2.useVariable) return setMediaTheme(val, key);
1383
1270
  const { state, media, helpers } = val;
1384
1271
  const value = setThemeValue(val, key);
1385
1272
  const CSSvar = `--theme-${key}`;
@@ -1441,24 +1328,19 @@ var recursiveTheme = (val) => {
1441
1328
  } else if (symb === ":") {
1442
1329
  obj[`&${param}`] = recursiveTheme(val[param]);
1443
1330
  }
1444
- } else
1445
- obj[param] = val[param];
1331
+ } else obj[param] = val[param];
1446
1332
  }
1447
1333
  return obj;
1448
1334
  };
1449
1335
  var findModifierFromArray = (val, modifierArray) => {
1450
1336
  const currentMod = modifierArray.shift();
1451
- if (val[currentMod])
1452
- return findModifierFromArray(val[currentMod], modifierArray);
1337
+ if (val[currentMod]) return findModifierFromArray(val[currentMod], modifierArray);
1453
1338
  return val;
1454
1339
  };
1455
1340
  var findModifier = (val, modifier) => {
1456
- if (isArray(modifier))
1457
- return findModifierFromArray(val, modifier);
1458
- else if (isString(modifier) && val[modifier])
1459
- return val[modifier];
1460
- else
1461
- return val;
1341
+ if (isArray(modifier)) return findModifierFromArray(val, modifier);
1342
+ else if (isString(modifier) && val[modifier]) return val[modifier];
1343
+ else return val;
1462
1344
  };
1463
1345
  var getMediaTheme = (value, modifier) => {
1464
1346
  const activeConfig = getActiveConfig();
@@ -1481,11 +1363,10 @@ var getMediaTheme = (value, modifier) => {
1481
1363
  };
1482
1364
 
1483
1365
  // src/system/font.js
1484
- var import_utils11 = __toESM(require_cjs2(), 1);
1366
+ var import_utils11 = __toESM(require_cjs(), 1);
1485
1367
  var setFont = (val, key) => {
1486
1368
  const CSSvar = `--font-${key}`;
1487
- if (!val || isArray(val) && !val[0])
1488
- return;
1369
+ if (!val || isArray(val) && !val[0]) return;
1489
1370
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
1490
1371
  return { var: CSSvar, value: val, fontFace };
1491
1372
  };
@@ -1493,10 +1374,8 @@ var setFontFamily = (val, key) => {
1493
1374
  const CONFIG2 = getActiveConfig();
1494
1375
  const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
1495
1376
  let { value, type } = val;
1496
- if (val.isDefault)
1497
- FONT_FAMILY2.default = key;
1498
- if (isObject(value))
1499
- value = (0, import_utils11.arrayzeValue)(value);
1377
+ if (val.isDefault) FONT_FAMILY2.default = key;
1378
+ if (isObject(value)) value = (0, import_utils11.arrayzeValue)(value);
1500
1379
  const CSSvar = `--font-family-${key}`;
1501
1380
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
1502
1381
  return { var: CSSvar, value: str, arr: value, type };
@@ -1509,8 +1388,7 @@ var runThroughMedia = (FACTORY2) => {
1509
1388
  for (const prop in FACTORY2) {
1510
1389
  const isPropMedia = prop.slice(0, 1) === "@";
1511
1390
  const mediaValue = FACTORY2[prop];
1512
- if (!isPropMedia)
1513
- continue;
1391
+ if (!isPropMedia) continue;
1514
1392
  const { mediaRegenerate } = FACTORY2;
1515
1393
  const mediaName = prop.slice(1);
1516
1394
  const {
@@ -1579,13 +1457,12 @@ var applyTypographySequence = () => {
1579
1457
  };
1580
1458
 
1581
1459
  // src/system/spacing.js
1582
- var import_utils15 = __toESM(require_cjs2(), 1);
1460
+ var import_utils15 = __toESM(require_cjs(), 1);
1583
1461
  var runThroughMedia2 = (FACTORY2) => {
1584
1462
  for (const prop in FACTORY2) {
1585
1463
  const mediaProps = FACTORY2[prop];
1586
1464
  const isMediaName = prop.slice(0, 1) === "@";
1587
- if (!isMediaName)
1588
- continue;
1465
+ if (!isMediaName) continue;
1589
1466
  const {
1590
1467
  type,
1591
1468
  base,
@@ -1622,8 +1499,7 @@ var applySpacingSequence = () => {
1622
1499
  var getSequence = (sequenceProps) => {
1623
1500
  const CONFIG2 = getActiveConfig();
1624
1501
  const { SPACING: SPACING2 } = CONFIG2;
1625
- if (!sequenceProps)
1626
- return SPACING2;
1502
+ if (!sequenceProps) return SPACING2;
1627
1503
  const hasGenerated = Object.keys(sequenceProps.sequence).length > 0;
1628
1504
  return hasGenerated ? sequenceProps : generateSequence(sequenceProps);
1629
1505
  };
@@ -1633,8 +1509,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
1633
1509
  return { [propertyName]: value };
1634
1510
  }
1635
1511
  const stack = (0, import_utils15.arrayzeValue)(value);
1636
- if (!isArray(stack))
1637
- return;
1512
+ if (!isArray(stack)) return;
1638
1513
  if (stack.length > 1) {
1639
1514
  let suffix = "";
1640
1515
  if (propertyName === "borderWidth") {
@@ -1683,15 +1558,11 @@ var setShadow = (value, key, suffix, prefers) => {
1683
1558
  if (isString(value) && value.includes(",")) {
1684
1559
  value = value.split(",").map((v) => {
1685
1560
  v = v.trim();
1686
- if (v.startsWith("--"))
1687
- return `var(${v})`;
1688
- if (getColor(v).length > 2)
1689
- return getColor(v);
1690
- if (v.includes("px") || v.slice(-2) === "em")
1691
- return v;
1561
+ if (v.startsWith("--")) return `var(${v})`;
1562
+ if (getColor(v).length > 2) return getColor(v);
1563
+ if (v.includes("px") || v.slice(-2) === "em") return v;
1692
1564
  const arr = v.split(" ");
1693
- if (!arr.length)
1694
- return v;
1565
+ if (!arr.length) return v;
1695
1566
  return arr.map((v2) => getSpacingByKey(v2, "shadow").shadow).join(" ");
1696
1567
  }).join(" ");
1697
1568
  }
@@ -1706,7 +1577,7 @@ var setShadow = (value, key, suffix, prefers) => {
1706
1577
  };
1707
1578
 
1708
1579
  // src/system/timing.js
1709
- var import_utils19 = __toESM(require_cjs2(), 1);
1580
+ var import_utils19 = __toESM(require_cjs(), 1);
1710
1581
  var applyTimingSequence = () => {
1711
1582
  const CONFIG2 = getActiveConfig();
1712
1583
  const { TIMING: TIMING2 } = CONFIG2;
@@ -1727,12 +1598,10 @@ var applyDocument = () => {
1727
1598
  };
1728
1599
 
1729
1600
  // src/system/svg.js
1730
- var import_globals5 = __toESM(require_cjs(), 1);
1731
1601
  var setSVG = (val, key) => {
1732
1602
  const CONFIG2 = getActiveConfig();
1733
1603
  if (!val) {
1734
- if (CONFIG2.verbose)
1735
- console.warn("setSVG: val is not defined", key);
1604
+ if (CONFIG2.verbose) console.warn("setSVG: val is not defined", key);
1736
1605
  return;
1737
1606
  }
1738
1607
  if (CONFIG2.useSvgSprite) {
@@ -1770,8 +1639,7 @@ var applyReset = (reset = {}) => {
1770
1639
  }
1771
1640
  const { body, ...templates } = TYPOGRAPHY2.templates;
1772
1641
  const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
1773
- if (RESET2.html)
1774
- overwriteDeep(RESET2.html, globalTheme);
1642
+ if (RESET2.html) overwriteDeep(RESET2.html, globalTheme);
1775
1643
  return deepMerge(merge(RESET2, reset), {
1776
1644
  html: {
1777
1645
  position: "absolute",
@@ -1812,8 +1680,7 @@ var applyReset = (reset = {}) => {
1812
1680
 
1813
1681
  // src/set.js
1814
1682
  var setCases = (val, key) => {
1815
- if (isFunction(val))
1816
- return val();
1683
+ if (isFunction(val)) return val();
1817
1684
  return val;
1818
1685
  };
1819
1686
  var setSameValue = (val, key) => val;
@@ -1849,12 +1716,10 @@ var setValue = (FACTORY_NAME, value, key) => {
1849
1716
  FACTORY2[key] = result;
1850
1717
  return FACTORY2;
1851
1718
  } catch (error) {
1852
- if (CONFIG2.verbose)
1853
- console.warn("Error setting", factoryName, "value", value, key, error);
1719
+ if (CONFIG2.verbose) console.warn("Error setting", factoryName, "value", value, key, error);
1854
1720
  }
1855
1721
  }
1856
- if (CONFIG2.verbose)
1857
- console.warn("Can not find", factoryName, "method in scratch");
1722
+ if (CONFIG2.verbose) console.warn("Can not find", factoryName, "method in scratch");
1858
1723
  };
1859
1724
  var setEach = (factoryName, props) => {
1860
1725
  const CONFIG2 = getActiveConfig();
@@ -1883,38 +1748,23 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
1883
1748
  if (options.newConfig) {
1884
1749
  CONFIG2 = setActiveConfig(options.newConfig);
1885
1750
  }
1886
- if (verbose !== void 0)
1887
- CONFIG2.verbose = verbose;
1888
- if (useVariable !== void 0)
1889
- CONFIG2.useVariable = useVariable;
1890
- if (useReset !== void 0)
1891
- CONFIG2.useReset = useReset;
1892
- if (useFontImport !== void 0)
1893
- CONFIG2.useFontImport = useFontImport;
1894
- if (useSvgSprite !== void 0)
1895
- CONFIG2.useSvgSprite = useSvgSprite;
1896
- if (useIconSprite !== void 0)
1897
- CONFIG2.useIconSprite = useIconSprite;
1898
- if (useDocumentTheme !== void 0)
1899
- CONFIG2.useDocumentTheme = useDocumentTheme;
1900
- if (globalTheme !== void 0)
1901
- CONFIG2.globalTheme = globalTheme;
1902
- if (useDefaultConfig !== void 0)
1903
- CONFIG2.useDefaultConfig = useDefaultConfig;
1904
- if (SEMANTIC_ICONS2 !== void 0)
1905
- CONFIG2.SEMANTIC_ICONS = SEMANTIC_ICONS2;
1906
- if (CONFIG2.verbose)
1907
- console.log(CONFIG2);
1908
- if (!CONFIG2.__svg_cache)
1909
- CONFIG2.__svg_cache = {};
1751
+ if (verbose !== void 0) CONFIG2.verbose = verbose;
1752
+ if (useVariable !== void 0) CONFIG2.useVariable = useVariable;
1753
+ if (useReset !== void 0) CONFIG2.useReset = useReset;
1754
+ if (useFontImport !== void 0) CONFIG2.useFontImport = useFontImport;
1755
+ if (useSvgSprite !== void 0) CONFIG2.useSvgSprite = useSvgSprite;
1756
+ if (useIconSprite !== void 0) CONFIG2.useIconSprite = useIconSprite;
1757
+ if (useDocumentTheme !== void 0) CONFIG2.useDocumentTheme = useDocumentTheme;
1758
+ if (globalTheme !== void 0) CONFIG2.globalTheme = globalTheme;
1759
+ if (useDefaultConfig !== void 0) CONFIG2.useDefaultConfig = useDefaultConfig;
1760
+ if (SEMANTIC_ICONS2 !== void 0) CONFIG2.SEMANTIC_ICONS = SEMANTIC_ICONS2;
1761
+ if (CONFIG2.verbose) console.log(CONFIG2);
1762
+ if (!CONFIG2.__svg_cache) CONFIG2.__svg_cache = {};
1910
1763
  const keys = Object.keys(config);
1911
1764
  keys.map((key) => setEach(key, config[key]));
1912
- if (config.TYPOGRAPHY)
1913
- applyTypographySequence();
1914
- if (config.SPACING)
1915
- applySpacingSequence();
1916
- if (config.TIMING)
1917
- applyTimingSequence();
1765
+ if (config.TYPOGRAPHY) applyTypographySequence();
1766
+ if (config.SPACING) applySpacingSequence();
1767
+ if (config.TIMING) applyTimingSequence();
1918
1768
  applyDocument();
1919
1769
  applyReset();
1920
1770
  return CONFIG2;