@symbo.ls/scratch 2.27.0 → 2.27.10

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/index.js CHANGED
@@ -51,8 +51,8 @@ var require_cjs = __commonJS({
51
51
  return to;
52
52
  };
53
53
  var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
54
- var src_exports2 = {};
55
- __export2(src_exports2, {
54
+ var index_exports2 = {};
55
+ __export2(index_exports2, {
56
56
  arrayzeValue: () => arrayzeValue3,
57
57
  copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
58
58
  copyStringToClipboard: () => copyStringToClipboard,
@@ -73,12 +73,11 @@ var require_cjs = __commonJS({
73
73
  toTitleCase: () => toTitleCase,
74
74
  toggleFullscreen: () => toggleFullscreen
75
75
  });
76
- module2.exports = __toCommonJS2(src_exports2);
76
+ module2.exports = __toCommonJS2(index_exports2);
77
77
  var window22 = globalThis;
78
78
  var document22 = window22.document;
79
79
  var isObject2 = (arg) => {
80
- if (arg === null)
81
- return false;
80
+ if (arg === null) return false;
82
81
  return typeof arg === "object" && arg.constructor === Object;
83
82
  };
84
83
  var isString2 = (arg) => typeof arg === "string";
@@ -103,13 +102,11 @@ var require_cjs = __commonJS({
103
102
  };
104
103
  var findClosestNumberInFactory = (val, factory) => {
105
104
  val = parseFloat(val);
106
- if (isObject2(factory))
107
- factory = Object.values(factory);
105
+ if (isObject2(factory)) factory = Object.values(factory);
108
106
  return findClosestNumber(val, factory);
109
107
  };
110
108
  var formatDate = (timestamp) => {
111
- if (!timestamp)
112
- return "";
109
+ if (!timestamp) return "";
113
110
  const d = new Date(timestamp);
114
111
  const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
115
112
  const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
@@ -176,8 +173,7 @@ var require_cjs = __commonJS({
176
173
  scriptEle.type = type;
177
174
  scriptEle.text = xhr.responseText;
178
175
  doc.body.appendChild(scriptEle);
179
- if (typeof fallback === "function")
180
- fallback();
176
+ if (typeof fallback === "function") fallback();
181
177
  } else {
182
178
  throw new Error(`Failed to load the script ${FILE_URL}`);
183
179
  }
@@ -245,27 +241,22 @@ var require_cjs = __commonJS({
245
241
  );
246
242
  var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
247
243
  var toDescriptionCase = (str = "") => {
248
- if (typeof str !== "string")
249
- return;
244
+ if (typeof str !== "string") return;
250
245
  const result = str.replace(/([A-Z])/g, " $1");
251
246
  return result.charAt(0).toUpperCase() + result.slice(1);
252
247
  };
253
248
  var arrayzeValue3 = (val) => {
254
- if (isArray2(val))
255
- return val;
256
- if (isString2(val))
257
- return val.split(" ");
258
- if (isObject2(val))
259
- return Object.values(val);
260
- if (isNumber2(val))
261
- 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];
262
253
  };
263
254
  }
264
255
  });
265
256
 
266
257
  // src/index.js
267
- var src_exports = {};
268
- __export(src_exports, {
258
+ var index_exports = {};
259
+ __export(index_exports, {
269
260
  ANIMATION: () => ANIMATION,
270
261
  BREAKPOINTS: () => BREAKPOINTS,
271
262
  CASES: () => CASES,
@@ -391,7 +382,7 @@ __export(src_exports, {
391
382
  transformTransition: () => transformTransition,
392
383
  transfromGap: () => transfromGap
393
384
  });
394
- module.exports = __toCommonJS(src_exports);
385
+ module.exports = __toCommonJS(index_exports);
395
386
 
396
387
  // src/utils/index.js
397
388
  var utils_exports = {};
@@ -447,6 +438,11 @@ var isScalingUnit = (unit) => {
447
438
  return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
448
439
  };
449
440
 
441
+ // ../../../domql/packages/utils/dist/esm/env.js
442
+ var NODE_ENV = "development";
443
+ var isProduction = (env = NODE_ENV) => env === "production";
444
+ var isNotProduction = (env = NODE_ENV) => !isProduction(env);
445
+
450
446
  // ../../../domql/packages/utils/dist/esm/globals.js
451
447
  var window2 = globalThis;
452
448
  var document2 = window2.document;
@@ -458,8 +454,7 @@ var isDOMNode = (obj) => {
458
454
 
459
455
  // ../../../domql/packages/utils/dist/esm/types.js
460
456
  var isObject = (arg) => {
461
- if (arg === null)
462
- return false;
457
+ if (arg === null) return false;
463
458
  return typeof arg === "object" && arg.constructor === Object;
464
459
  };
465
460
  var isString = (arg) => typeof arg === "string";
@@ -470,8 +465,7 @@ var isNull = (arg) => arg === null;
470
465
  var isArray = (arg) => Array.isArray(arg);
471
466
  var isDate = (d) => d instanceof Date;
472
467
  var isObjectLike = (arg) => {
473
- if (arg === null)
474
- return false;
468
+ if (arg === null) return false;
475
469
  return typeof arg === "object";
476
470
  };
477
471
  var isDefined = (arg) => {
@@ -555,8 +549,7 @@ var deepClone = (obj, options = {}) => {
555
549
  const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
556
550
  visited.set(obj, clone2);
557
551
  for (const key in obj) {
558
- if (!Object.prototype.hasOwnProperty.call(obj, key))
559
- continue;
552
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
560
553
  if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
561
554
  continue;
562
555
  const value = obj[key];
@@ -590,14 +583,11 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
590
583
  if (!isObjectLike(obj) || !isObjectLike(params) || isDOMNode(obj) || isDOMNode(params)) {
591
584
  return params;
592
585
  }
593
- if (visited.has(obj))
594
- return visited.get(obj);
586
+ if (visited.has(obj)) return visited.get(obj);
595
587
  visited.set(obj, obj);
596
588
  for (const e in params) {
597
- if (!Object.hasOwnProperty.call(params, e))
598
- continue;
599
- if (excl.includes(e) || forcedExclude && e.startsWith("__"))
600
- continue;
589
+ if (!Object.hasOwnProperty.call(params, e)) continue;
590
+ if (excl.includes(e) || forcedExclude && e.startsWith("__")) continue;
601
591
  const objProp = obj[e];
602
592
  const paramsProp = params[e];
603
593
  if (isDOMNode(paramsProp)) {
@@ -615,12 +605,9 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
615
605
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
616
606
 
617
607
  // src/utils/color.js
618
- var ENV = "development";
619
608
  var colorStringToRgbaArray = (color) => {
620
- if (color === "")
621
- return [0, 0, 0, 0];
622
- if (color.toLowerCase() === "transparent")
623
- return [0, 0, 0, 0];
609
+ if (color === "") return [0, 0, 0, 0];
610
+ if (color.toLowerCase() === "transparent") return [0, 0, 0, 0];
624
611
  if (color[0] === "#") {
625
612
  if (color.length < 7) {
626
613
  color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
@@ -651,8 +638,7 @@ var colorStringToRgbaArray = (color) => {
651
638
  }
652
639
  }
653
640
  if (color.indexOf("rgb") === 0) {
654
- if (color.indexOf("rgba") === -1)
655
- color = `${color}, 1`;
641
+ if (color.indexOf("rgba") === -1) color = `${color}, 1`;
656
642
  return color.match(/[\.\d]+/g).map((a) => +a);
657
643
  }
658
644
  return [0, 0, 0, 0];
@@ -689,10 +675,7 @@ var mixTwoRgb = (colorA, colorB, range = 0.5) => {
689
675
  };
690
676
  var changeLightness = (delta, hsl) => {
691
677
  const [hue, saturation, lightness] = hsl;
692
- const newLightness = Math.max(
693
- 0,
694
- Math.min(100, lightness + parseFloat(delta))
695
- );
678
+ const newLightness = Math.max(0, Math.min(100, lightness + parseFloat(delta)));
696
679
  return [hue, saturation, newLightness];
697
680
  };
698
681
  var rgbToHSL = (r, g, b) => {
@@ -702,44 +685,32 @@ var rgbToHSL = (r, g, b) => {
702
685
  const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
703
686
  return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
704
687
  };
705
- var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
706
- Math.min(k - 3, 9 - k, 1),
707
- -1
708
- )) => [f(0), f(8), f(4)];
688
+ var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
709
689
  var getColorShade = (col, amt) => {
710
690
  const num = parseInt(col, 16);
711
691
  let r = (num >> 16) + amt;
712
- if (r > 255)
713
- r = 255;
714
- else if (r < 0)
715
- r = 0;
692
+ if (r > 255) r = 255;
693
+ else if (r < 0) r = 0;
716
694
  let b = (num >> 8 & 255) + amt;
717
- if (b > 255)
718
- b = 255;
719
- else if (b < 0)
720
- b = 0;
695
+ if (b > 255) b = 255;
696
+ else if (b < 0) b = 0;
721
697
  let g = (num & 255) + amt;
722
- if (g > 255)
723
- g = 255;
724
- else if (g < 0)
725
- g = 0;
698
+ if (g > 255) g = 255;
699
+ else if (g < 0) g = 0;
726
700
  return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
727
701
  };
728
702
  var mixTwoRgba = (colorA, colorB, range = 0.5) => {
729
703
  const arr = [];
730
704
  for (let i = 0; i < 4; i++) {
731
705
  const round = i === 3 ? (x) => x : Math.round;
732
- arr[i] = round(
733
- colorA[i] + (colorB[i] - colorA[i]) * range
734
- );
706
+ arr[i] = round(colorA[i] + (colorB[i] - colorA[i]) * range);
735
707
  }
736
708
  return `rgba(${arr})`;
737
709
  };
738
710
  var opacify = (color, opacity) => {
739
711
  const arr = colorStringToRgbaArray(color);
740
712
  if (!arr) {
741
- if (ENV === "testing" || ENV === "development")
742
- console.warn(color + " color is not rgba");
713
+ if (isNotProduction()) console.warn(color + " color is not rgba");
743
714
  return;
744
715
  }
745
716
  arr[3] = opacity;
@@ -748,10 +719,8 @@ var opacify = (color, opacity) => {
748
719
  var getRgbTone = (rgb, tone) => {
749
720
  if (isString(rgb) && rgb.includes("rgb"))
750
721
  rgb = colorStringToRgbaArray(rgb).join(", ");
751
- if (isString(rgb))
752
- rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
753
- if (isNumber(tone))
754
- tone += "";
722
+ if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
723
+ if (isNumber(tone)) tone += "";
755
724
  const toHex = rgbArrayToHex(rgb);
756
725
  const abs = tone.slice(0, 1);
757
726
  if (abs === "-" || abs === "+") {
@@ -768,21 +737,16 @@ var getRgbTone = (rgb, tone) => {
768
737
 
769
738
  // src/utils/theme.js
770
739
  var returnSubThemeOrDefault = (orig, theme) => {
771
- if (!orig)
772
- return;
773
- if (orig.themes && orig.themes[theme])
774
- return orig.themes[theme];
775
- if (orig[theme])
776
- return [orig, orig[theme]];
740
+ if (!orig) return;
741
+ if (orig.themes && orig.themes[theme]) return orig.themes[theme];
742
+ if (orig[theme]) return [orig, orig[theme]];
777
743
  return orig;
778
744
  };
779
745
 
780
746
  // src/utils/font.js
781
747
  var getDefaultOrFirstKey = (LIBRARY, key) => {
782
- if (LIBRARY[key])
783
- return LIBRARY[key].value;
784
- if (LIBRARY.default)
785
- return LIBRARY[LIBRARY.default].value;
748
+ if (LIBRARY[key]) return LIBRARY[key].value;
749
+ if (LIBRARY.default) return LIBRARY[LIBRARY.default].value;
786
750
  const hasValue = Object.keys(LIBRARY)[0];
787
751
  return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
788
752
  };
@@ -809,8 +773,7 @@ var getFontFace = (LIBRARY) => {
809
773
  };
810
774
  var getFontFaceEachString = (name, weights) => {
811
775
  const isArr = weights[0];
812
- if (isArr)
813
- return getFontFaceEach(name, weights).map(setInCustomFontMedia);
776
+ if (isArr) return getFontFaceEach(name, weights).map(setInCustomFontMedia);
814
777
  return setCustomFontMedia(name, weights.url);
815
778
  };
816
779
  var getFontFaceString = (LIBRARY) => {
@@ -1048,8 +1011,7 @@ var getActiveConfig = (def) => {
1048
1011
  return FACTORY[def || FACTORY.active] || CONFIG;
1049
1012
  };
1050
1013
  var setActiveConfig = (newConfig) => {
1051
- if (!isObject(newConfig))
1052
- return;
1014
+ if (!isObject(newConfig)) return;
1053
1015
  FACTORY.active = "1";
1054
1016
  FACTORY["1"] = deepMerge(newConfig, deepClone(cachedConfig));
1055
1017
  return newConfig;
@@ -1101,8 +1063,7 @@ var setSequenceValue = (props, sequenceProps) => {
1101
1063
  var setScalingVar = (key, sequenceProps) => {
1102
1064
  const { base, type, unit } = sequenceProps;
1103
1065
  const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
1104
- if (key === 0)
1105
- return defaultVal;
1066
+ if (key === 0) return defaultVal;
1106
1067
  const prefix = "--" + (type && type.replace(".", "-"));
1107
1068
  const ratioVar = `${prefix}-ratio`;
1108
1069
  if (key > 0) {
@@ -1139,10 +1100,8 @@ var generateSubSequence = (props, sequenceProps) => {
1139
1100
  const diffRounded = ~~next - ~~value;
1140
1101
  let arr;
1141
1102
  const [first, middle, second] = getSubratioDifference(value, ratio);
1142
- if (diffRounded > 16)
1143
- arr = [first, middle, second];
1144
- else
1145
- arr = [first, second];
1103
+ if (diffRounded > 16) arr = [first, middle, second];
1104
+ else arr = [first, second];
1146
1105
  arr.forEach((v, k) => {
1147
1106
  const scaling = ~~(v / base * 1e3) / 1e3;
1148
1107
  const newVar = variable + (k + 1);
@@ -1184,8 +1143,7 @@ var generateSequence = (sequenceProps) => {
1184
1143
  index: key
1185
1144
  };
1186
1145
  setSequenceValue(props, sequenceProps);
1187
- if (subSequence)
1188
- generateSubSequence(props, sequenceProps);
1146
+ if (subSequence) generateSubSequence(props, sequenceProps);
1189
1147
  }
1190
1148
  return sequenceProps;
1191
1149
  };
@@ -1235,13 +1193,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1235
1193
  unit = UNIT2.default,
1236
1194
  useVariable
1237
1195
  } = sequenceProps;
1238
- if (isString(value) && value.slice(0, 2) === "--")
1239
- return `var(${value})`;
1196
+ if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
1240
1197
  const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
1241
1198
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
1242
1199
  const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
1243
- 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)
1244
- return value;
1200
+ 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;
1245
1201
  const letterVal = value.toUpperCase();
1246
1202
  const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
1247
1203
  let absValue = isNegative ? letterVal.slice(1) : letterVal;
@@ -1265,8 +1221,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1265
1221
  return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1266
1222
  }
1267
1223
  if (!sequence[absValue] && absValue.length === 2) {
1268
- if (CONFIG2.verbose)
1269
- console.warn(absValue, "- value is not found because `subSequence` is set to false");
1224
+ if (CONFIG2.verbose) console.warn(absValue, "- value is not found because `subSequence` is set to false");
1270
1225
  absValue = absValue.slice(0, 1);
1271
1226
  }
1272
1227
  if (useVariable || CONFIG2.useVariable) {
@@ -1274,8 +1229,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1274
1229
  return isNegative ? `calc(${varValue2} * -1)` : varValue2;
1275
1230
  }
1276
1231
  const sequenceItem = sequence ? sequence[absValue] : null;
1277
- if (!sequenceItem)
1278
- return console.warn("can't find", sequence, absValue);
1232
+ if (!sequenceItem) return console.warn("can't find", sequence, absValue);
1279
1233
  if (unit === "ms" || unit === "s") {
1280
1234
  return isNegative + sequenceItem.val + unit;
1281
1235
  }
@@ -1284,12 +1238,10 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1284
1238
  var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
1285
1239
  if (typeof value !== "string") {
1286
1240
  const CONFIG2 = getActiveConfig();
1287
- if (CONFIG2.verbose)
1288
- console.warn(propertyName, value, "is not a string");
1241
+ if (CONFIG2.verbose) console.warn(propertyName, value, "is not a string");
1289
1242
  return { [propertyName]: value };
1290
1243
  }
1291
- if (value === "-" || value === "")
1292
- return {};
1244
+ if (value === "-" || value === "") return {};
1293
1245
  return { [propertyName]: getSequenceValue(value, sequenceProps) };
1294
1246
  };
1295
1247
  var findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index];
@@ -1357,39 +1309,32 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1357
1309
  const { mediaRegenerate } = FACTORY2;
1358
1310
  const { sequence, scales } = FACTORY2[media];
1359
1311
  const query = MEDIA2[mediaName];
1360
- if (!query && CONFIG2.verbose)
1361
- console.warn("Can't find media query ", query);
1312
+ if (!query && CONFIG2.verbose) console.warn("Can't find media query ", query);
1362
1313
  if (!mediaRegenerate) {
1363
1314
  let underMediaQuery = CSS_VARS2[`@media ${query}`];
1364
- if (!underMediaQuery)
1365
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1315
+ if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1366
1316
  applySequenceGlobalVars(underMediaQuery, FACTORY2[media], options);
1367
1317
  return;
1368
1318
  }
1369
1319
  for (const key in sequence) {
1370
1320
  const item = sequence[key];
1371
1321
  const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
1372
- if (!query && CONFIG2.verbose)
1373
- console.warn("Can't find query ", query);
1322
+ if (!query && CONFIG2.verbose) console.warn("Can't find query ", query);
1374
1323
  let underMediaQuery = CSS_VARS2[`@media ${query}`];
1375
- if (!underMediaQuery)
1376
- underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1324
+ if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
1377
1325
  underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
1378
1326
  CSS_VARS2[item.variable + "_" + mediaName] = value;
1379
1327
  }
1380
1328
  };
1381
1329
 
1382
1330
  // src/utils/sprite.js
1383
- var ENV2 = "development";
1384
- var isDev = ENV2 === "development" || ENV2 === "testing";
1331
+ var isDev = isNotProduction();
1385
1332
  var generateSprite = (icons) => {
1386
1333
  const CONFIG2 = getActiveConfig();
1387
1334
  let sprite = "";
1388
1335
  for (const key in icons) {
1389
- if (CONFIG2.__svg_cache[key])
1390
- continue;
1391
- else
1392
- CONFIG2.__svg_cache[key] = true;
1336
+ if (CONFIG2.__svg_cache[key]) continue;
1337
+ else CONFIG2.__svg_cache[key] = true;
1393
1338
  sprite += icons[key];
1394
1339
  }
1395
1340
  return sprite;
@@ -1397,8 +1342,7 @@ var generateSprite = (icons) => {
1397
1342
  var parseRootAttributes = (htmlString) => {
1398
1343
  const val = htmlString.default || htmlString;
1399
1344
  if (!isString(val)) {
1400
- if (isDev)
1401
- console.warn("parseRootAttributes:", val, "is not a string");
1345
+ if (isDev) console.warn("parseRootAttributes:", val, "is not a string");
1402
1346
  return;
1403
1347
  }
1404
1348
  const match = val.match(/<svg\s+(.*?)>/);
@@ -1406,7 +1350,9 @@ var parseRootAttributes = (htmlString) => {
1406
1350
  return {};
1407
1351
  }
1408
1352
  const attrString = match[1];
1409
- const attrs = attrString.match(/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm);
1353
+ const attrs = attrString.match(
1354
+ /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
1355
+ );
1410
1356
  return attrs.reduce((acc, attr) => {
1411
1357
  const [key, value] = attr.split("=");
1412
1358
  acc[key] = value.replace(/['"]/g, "");
@@ -1480,27 +1426,21 @@ __export(system_exports, {
1480
1426
  var getColor = (value, key, config) => {
1481
1427
  const CONFIG2 = config || getActiveConfig();
1482
1428
  if (!isString(value)) {
1483
- if (CONFIG2.verbose)
1484
- console.warn(value, "- type for color is not valid");
1429
+ if (CONFIG2.verbose) console.warn(value, "- type for color is not valid");
1485
1430
  return;
1486
1431
  }
1487
- if (value.slice(0, 2) === "--")
1488
- return `var(${value})`;
1489
- if (key && value[key])
1490
- value = value[key];
1432
+ if (value.slice(0, 2) === "--") return `var(${value})`;
1433
+ if (key && value[key]) value = value[key];
1491
1434
  const [name, alpha, tone] = isArray(value) ? value : value.split(" ");
1492
1435
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1493
1436
  let val = COLOR2[name] || GRADIENT2[name];
1494
1437
  if (!val) {
1495
- if (CONFIG2.verbose)
1496
- console.warn("Can't find color ", name);
1438
+ if (CONFIG2.verbose) console.warn("Can't find color ", name);
1497
1439
  return value;
1498
1440
  }
1499
1441
  if (key) {
1500
- if (val[key])
1501
- val = val[key];
1502
- else if (CONFIG2.verbose)
1503
- console.warn(value, " - does not have ", key);
1442
+ if (val[key]) val = val[key];
1443
+ else if (CONFIG2.verbose) console.warn(value, " - does not have ", key);
1504
1444
  }
1505
1445
  let rgb = val.rgb;
1506
1446
  if (!rgb) {
@@ -1510,32 +1450,25 @@ var getColor = (value, key, config) => {
1510
1450
  rgb = getRgbTone(rgb, tone);
1511
1451
  val[tone] = { rgb, var: `${val.var}-${tone}` };
1512
1452
  }
1513
- if (val[tone])
1514
- rgb = val[tone].rgb;
1515
- if (alpha)
1516
- return `rgba(${rgb}, ${alpha})`;
1453
+ if (val[tone]) rgb = val[tone].rgb;
1454
+ if (alpha) return `rgba(${rgb}, ${alpha})`;
1517
1455
  return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
1518
1456
  };
1519
1457
  var getMediaColor = (value, globalTheme, config) => {
1520
1458
  const CONFIG2 = config || getActiveConfig();
1521
- if (!globalTheme)
1522
- globalTheme = CONFIG2.globalTheme;
1459
+ if (!globalTheme) globalTheme = CONFIG2.globalTheme;
1523
1460
  if (!isString(value)) {
1524
- if (CONFIG2.verbose)
1525
- console.warn(value, "- type for color is not valid");
1461
+ if (CONFIG2.verbose) console.warn(value, "- type for color is not valid");
1526
1462
  return;
1527
1463
  }
1528
- if (value.slice(0, 2) === "--")
1529
- return `var(${value})`;
1464
+ if (value.slice(0, 2) === "--") return `var(${value})`;
1530
1465
  const [name] = isArray(value) ? value : value.split(" ");
1531
1466
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
1532
1467
  const val = COLOR2[name] || GRADIENT2[name];
1533
1468
  const isObj = isObject(val);
1534
- if (isObj && val.value)
1535
- return getColor(value, `@${globalTheme}`, config);
1469
+ if (isObj && val.value) return getColor(value, `@${globalTheme}`, config);
1536
1470
  else if (isObj) {
1537
- if (globalTheme)
1538
- return getColor(value, `@${globalTheme}`, config);
1471
+ if (globalTheme) return getColor(value, `@${globalTheme}`, config);
1539
1472
  else {
1540
1473
  const obj = {};
1541
1474
  for (const mediaName in val) {
@@ -1546,8 +1479,7 @@ var getMediaColor = (value, globalTheme, config) => {
1546
1479
  return obj;
1547
1480
  }
1548
1481
  } else {
1549
- if (CONFIG2.verbose)
1550
- console.warn("Can't find color", value);
1482
+ if (CONFIG2.verbose) console.warn("Can't find color", value);
1551
1483
  return value;
1552
1484
  }
1553
1485
  };
@@ -1556,8 +1488,7 @@ var setColor = (val, key, suffix) => {
1556
1488
  if (isString(val) && val.slice(0, 2) === "--") {
1557
1489
  val = getColor(val.slice(2));
1558
1490
  if (!(val.includes("rgb") || val.includes("var") || val.includes("#"))) {
1559
- if (CONFIG2.verbose)
1560
- console.warn(val, "- referred but does not exist");
1491
+ if (CONFIG2.verbose) console.warn(val, "- referred but does not exist");
1561
1492
  val = val.split(" ")[0];
1562
1493
  }
1563
1494
  }
@@ -1596,8 +1527,7 @@ var setColor = (val, key, suffix) => {
1596
1527
  };
1597
1528
  var setGradient = (val, key, suffix) => {
1598
1529
  const CONFIG2 = getActiveConfig();
1599
- if (isString(val) && val.slice(0, 2) === "--")
1600
- val = getColor(val.slice(2));
1530
+ if (isString(val) && val.slice(0, 2) === "--") val = getColor(val.slice(2));
1601
1531
  if (isArray(val)) {
1602
1532
  return {
1603
1533
  "@light": setGradient(val[0], key, "light"),
@@ -1606,8 +1536,7 @@ var setGradient = (val, key, suffix) => {
1606
1536
  }
1607
1537
  if (isObject(val)) {
1608
1538
  const obj = {};
1609
- for (const variant in val)
1610
- obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1539
+ for (const variant in val) obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
1611
1540
  return obj;
1612
1541
  }
1613
1542
  const CSSVar = `--gradient-${key}` + (suffix ? `-${suffix}` : "");
@@ -1633,22 +1562,19 @@ var setThemeValue = (theme) => {
1633
1562
  return value;
1634
1563
  };
1635
1564
  var getThemeValue = (theme) => {
1636
- if (theme.value)
1637
- return theme.value;
1565
+ if (theme.value) return theme.value;
1638
1566
  theme.value = setThemeValue(theme);
1639
1567
  return theme.value;
1640
1568
  };
1641
1569
  var getTheme = (value, modifier) => {
1642
1570
  const CONFIG2 = getActiveConfig();
1643
- if (CONFIG2.useVariable)
1644
- return getMediaTheme(value, modifier);
1571
+ if (CONFIG2.useVariable) return getMediaTheme(value, modifier);
1645
1572
  const { THEME: THEME2 } = CONFIG2;
1646
1573
  if (isString(value)) {
1647
1574
  const [theme, subtheme] = value.split(" ");
1648
1575
  const isOurTheme = THEME2[theme];
1649
1576
  if (isOurTheme) {
1650
- if (!subtheme && !modifier)
1651
- return getThemeValue(isOurTheme);
1577
+ if (!subtheme && !modifier) return getThemeValue(isOurTheme);
1652
1578
  value = [theme, subtheme || modifier];
1653
1579
  }
1654
1580
  }
@@ -1656,14 +1582,10 @@ var getTheme = (value, modifier) => {
1656
1582
  const themeName = value[0];
1657
1583
  const subThemeName = value[1];
1658
1584
  const { helpers, media, state } = THEME2[themeName];
1659
- if (media && media[subThemeName])
1660
- return getThemeValue(media[subThemeName]);
1661
- if (helpers && helpers[subThemeName])
1662
- return getThemeValue(helpers[subThemeName]);
1663
- if (state && state[subThemeName])
1664
- return getThemeValue(state[subThemeName]);
1665
- } else if (isObject(value))
1666
- return setThemeValue(value);
1585
+ if (media && media[subThemeName]) return getThemeValue(media[subThemeName]);
1586
+ if (helpers && helpers[subThemeName]) return getThemeValue(helpers[subThemeName]);
1587
+ if (state && state[subThemeName]) return getThemeValue(state[subThemeName]);
1588
+ } else if (isObject(value)) return setThemeValue(value);
1667
1589
  };
1668
1590
  var setInverseTheme = (theme, variant, value) => {
1669
1591
  if (isObject(variant)) {
@@ -1681,13 +1603,11 @@ var setInverseTheme = (theme, variant, value) => {
1681
1603
  var setPseudo = (theme, key, variant, themeValue) => {
1682
1604
  const result = getTheme(variant);
1683
1605
  themeValue[`&:${key}`] = result;
1684
- if (isObject(variant) && !variant.value)
1685
- variant.value = result;
1606
+ if (isObject(variant) && !variant.value) variant.value = result;
1686
1607
  };
1687
1608
  var setSelectors = (theme, value) => {
1688
1609
  const { state } = theme;
1689
- if (!state)
1690
- return;
1610
+ if (!state) return;
1691
1611
  const keys = Object.keys(state);
1692
1612
  keys.map((key) => {
1693
1613
  const variant = state[key];
@@ -1699,20 +1619,16 @@ var setSelectors = (theme, value) => {
1699
1619
  var setPrefersScheme = (theme, key, variant, themeValue) => {
1700
1620
  const result = getTheme(variant);
1701
1621
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
1702
- if (isObject(variant) && !variant.value)
1703
- variant.value = result;
1622
+ if (isObject(variant) && !variant.value) variant.value = result;
1704
1623
  };
1705
1624
  var setMedia = (theme, value) => {
1706
1625
  const { media } = theme;
1707
- if (!media)
1708
- return;
1626
+ if (!media) return;
1709
1627
  const keys = Object.keys(media);
1710
1628
  keys.map((key) => {
1711
1629
  const variant = media[key];
1712
- if (key === "dark" || key === "light")
1713
- setPrefersScheme(theme, key, variant, value);
1714
- if (key === "inverse")
1715
- setInverseTheme(theme, variant, value);
1630
+ if (key === "dark" || key === "light") setPrefersScheme(theme, key, variant, value);
1631
+ if (key === "inverse") setInverseTheme(theme, variant, value);
1716
1632
  return theme;
1717
1633
  });
1718
1634
  return theme;
@@ -1720,23 +1636,19 @@ var setMedia = (theme, value) => {
1720
1636
  var setHelpers = (theme, value) => {
1721
1637
  const CONFIG2 = getActiveConfig();
1722
1638
  const { helpers } = theme;
1723
- if (!helpers)
1724
- return;
1639
+ if (!helpers) return;
1725
1640
  const keys = Object.keys(helpers);
1726
1641
  keys.map((key) => {
1727
1642
  const helper = helpers[key];
1728
- if (isString(helper))
1729
- helpers[key] = CONFIG2.THEME[helper];
1730
- else
1731
- getThemeValue(helpers[key]);
1643
+ if (isString(helper)) helpers[key] = CONFIG2.THEME[helper];
1644
+ else getThemeValue(helpers[key]);
1732
1645
  return theme;
1733
1646
  });
1734
1647
  return theme;
1735
1648
  };
1736
1649
  var setTheme = (val, key) => {
1737
1650
  const CONFIG2 = getActiveConfig();
1738
- if (CONFIG2.useVariable)
1739
- return setMediaTheme(val, key);
1651
+ if (CONFIG2.useVariable) return setMediaTheme(val, key);
1740
1652
  const { state, media, helpers } = val;
1741
1653
  const value = setThemeValue(val, key);
1742
1654
  const CSSvar = `--theme-${key}`;
@@ -1798,24 +1710,19 @@ var recursiveTheme = (val) => {
1798
1710
  } else if (symb === ":") {
1799
1711
  obj[`&${param}`] = recursiveTheme(val[param]);
1800
1712
  }
1801
- } else
1802
- obj[param] = val[param];
1713
+ } else obj[param] = val[param];
1803
1714
  }
1804
1715
  return obj;
1805
1716
  };
1806
1717
  var findModifierFromArray = (val, modifierArray) => {
1807
1718
  const currentMod = modifierArray.shift();
1808
- if (val[currentMod])
1809
- return findModifierFromArray(val[currentMod], modifierArray);
1719
+ if (val[currentMod]) return findModifierFromArray(val[currentMod], modifierArray);
1810
1720
  return val;
1811
1721
  };
1812
1722
  var findModifier = (val, modifier) => {
1813
- if (isArray(modifier))
1814
- return findModifierFromArray(val, modifier);
1815
- else if (isString(modifier) && val[modifier])
1816
- return val[modifier];
1817
- else
1818
- return val;
1723
+ if (isArray(modifier)) return findModifierFromArray(val, modifier);
1724
+ else if (isString(modifier) && val[modifier]) return val[modifier];
1725
+ else return val;
1819
1726
  };
1820
1727
  var getMediaTheme = (value, modifier) => {
1821
1728
  const activeConfig = getActiveConfig();
@@ -1841,8 +1748,7 @@ var getMediaTheme = (value, modifier) => {
1841
1748
  var import_utils11 = __toESM(require_cjs(), 1);
1842
1749
  var setFont = (val, key) => {
1843
1750
  const CSSvar = `--font-${key}`;
1844
- if (!val || isArray(val) && !val[0])
1845
- return;
1751
+ if (!val || isArray(val) && !val[0]) return;
1846
1752
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
1847
1753
  return { var: CSSvar, value: val, fontFace };
1848
1754
  };
@@ -1855,10 +1761,8 @@ var setFontFamily = (val, key) => {
1855
1761
  const CONFIG2 = getActiveConfig();
1856
1762
  const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
1857
1763
  let { value, type } = val;
1858
- if (val.isDefault)
1859
- FONT_FAMILY2.default = key;
1860
- if (isObject(value))
1861
- value = (0, import_utils11.arrayzeValue)(value);
1764
+ if (val.isDefault) FONT_FAMILY2.default = key;
1765
+ if (isObject(value)) value = (0, import_utils11.arrayzeValue)(value);
1862
1766
  const CSSvar = `--font-family-${key}`;
1863
1767
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
1864
1768
  return { var: CSSvar, value: str, arr: value, type };
@@ -1871,19 +1775,10 @@ var runThroughMedia = (FACTORY2) => {
1871
1775
  for (const prop in FACTORY2) {
1872
1776
  const isPropMedia = prop.slice(0, 1) === "@";
1873
1777
  const mediaValue = FACTORY2[prop];
1874
- if (!isPropMedia)
1875
- continue;
1778
+ if (!isPropMedia) continue;
1876
1779
  const { mediaRegenerate } = FACTORY2;
1877
1780
  const mediaName = prop.slice(1);
1878
- const {
1879
- type,
1880
- base,
1881
- ratio,
1882
- range,
1883
- subSequence,
1884
- h1Matches,
1885
- unit
1886
- } = FACTORY2;
1781
+ const { type, base, ratio, range, subSequence, h1Matches, unit } = FACTORY2;
1887
1782
  merge(mediaValue, {
1888
1783
  type,
1889
1784
  base,
@@ -1913,7 +1808,7 @@ var runThroughMedia = (FACTORY2) => {
1913
1808
  }
1914
1809
  };
1915
1810
  var applyHeadings = (props) => {
1916
- var _a;
1811
+ var _a, _b;
1917
1812
  const CONFIG2 = getActiveConfig();
1918
1813
  if (props.h1Matches) {
1919
1814
  const unit = props.unit;
@@ -1922,10 +1817,8 @@ var applyHeadings = (props) => {
1922
1817
  for (const k in HEADINGS) {
1923
1818
  const headerName = `h${parseInt(k) + 1}`;
1924
1819
  const headerStyle = templates[headerName];
1925
- if (!HEADINGS[k])
1926
- continue;
1927
1820
  templates[headerName] = {
1928
- fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
1821
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${(_b = HEADINGS[k]) == null ? void 0 : _b.scaling}${unit}`,
1929
1822
  margin: headerStyle ? headerStyle.margin : 0,
1930
1823
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1931
1824
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -1945,11 +1838,7 @@ var applyTypographySequence = () => {
1945
1838
  var getFontSizeByKey = (value) => {
1946
1839
  const CONFIG2 = getActiveConfig();
1947
1840
  const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
1948
- return getSequenceValuePropertyPair(
1949
- value,
1950
- "fontSize",
1951
- TYPOGRAPHY2
1952
- );
1841
+ return getSequenceValuePropertyPair(value, "fontSize", TYPOGRAPHY2);
1953
1842
  };
1954
1843
 
1955
1844
  // src/system/spacing.js
@@ -1958,8 +1847,7 @@ var runThroughMedia2 = (FACTORY2) => {
1958
1847
  for (const prop in FACTORY2) {
1959
1848
  const mediaProps = FACTORY2[prop];
1960
1849
  const isMediaName = prop.slice(0, 1) === "@";
1961
- if (!isMediaName)
1962
- continue;
1850
+ if (!isMediaName) continue;
1963
1851
  const {
1964
1852
  type,
1965
1853
  base,
@@ -1996,8 +1884,7 @@ var applySpacingSequence = () => {
1996
1884
  var getSequence = (sequenceProps) => {
1997
1885
  const CONFIG2 = getActiveConfig();
1998
1886
  const { SPACING: SPACING2 } = CONFIG2;
1999
- if (!sequenceProps)
2000
- return SPACING2;
1887
+ if (!sequenceProps) return SPACING2;
2001
1888
  const hasGenerated = Object.keys(sequenceProps.sequence).length > 0;
2002
1889
  return hasGenerated ? sequenceProps : generateSequence(sequenceProps);
2003
1890
  };
@@ -2007,8 +1894,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
2007
1894
  return { [propertyName]: value };
2008
1895
  }
2009
1896
  const stack = (0, import_utils15.arrayzeValue)(value);
2010
- if (!isArray(stack))
2011
- return;
1897
+ if (!isArray(stack)) return;
2012
1898
  if (stack.length > 1) {
2013
1899
  let suffix = "";
2014
1900
  if (propertyName === "borderWidth") {
@@ -2087,15 +1973,11 @@ var setShadow = (value, key, suffix, prefers) => {
2087
1973
  if (isString(value) && value.includes(",")) {
2088
1974
  value = value.split(",").map((v) => {
2089
1975
  v = v.trim();
2090
- if (v.startsWith("--"))
2091
- return `var(${v})`;
2092
- if (getColor(v).length > 2)
2093
- return getColor(v);
2094
- if (v.includes("px") || v.slice(-2) === "em")
2095
- return v;
1976
+ if (v.startsWith("--")) return `var(${v})`;
1977
+ if (getColor(v).length > 2) return getColor(v);
1978
+ if (v.includes("px") || v.slice(-2) === "em") return v;
2096
1979
  const arr = v.split(" ");
2097
- if (!arr.length)
2098
- return v;
1980
+ if (!arr.length) return v;
2099
1981
  return arr.map((v2) => getSpacingByKey(v2, "shadow").shadow).join(" ");
2100
1982
  }).join(" ");
2101
1983
  }
@@ -2110,32 +1992,25 @@ var setShadow = (value, key, suffix, prefers) => {
2110
1992
  };
2111
1993
  var getShadow = (value, globalTheme) => {
2112
1994
  const CONFIG2 = getActiveConfig();
2113
- if (!globalTheme)
2114
- globalTheme = CONFIG2.globalTheme;
1995
+ if (!globalTheme) globalTheme = CONFIG2.globalTheme;
2115
1996
  if (!isString(value)) {
2116
- if (CONFIG2.verbose)
2117
- console.warn(value, "- type for color is not valid");
1997
+ if (CONFIG2.verbose) console.warn(value, "- type for color is not valid");
2118
1998
  return;
2119
1999
  }
2120
- if (value.slice(0, 2) === "--")
2121
- return `var(${value})`;
2000
+ if (value.slice(0, 2) === "--") return `var(${value})`;
2122
2001
  const [name] = isArray(value) ? value : value.split(" ");
2123
2002
  const { SHADOW: SHADOW2 } = CONFIG2;
2124
2003
  const val = SHADOW2[name];
2125
2004
  const isObj = isObject(val);
2126
2005
  if (!val) {
2127
- if (CONFIG2.verbose)
2128
- console.warn("Can't find color ", name);
2006
+ if (CONFIG2.verbose) console.warn("Can't find color ", name);
2129
2007
  return value;
2130
2008
  }
2131
2009
  if (globalTheme) {
2132
- if (val[globalTheme])
2133
- return val[globalTheme].value;
2134
- else if (CONFIG2.verbose)
2135
- console.warn(value, " - does not have ", globalTheme);
2010
+ if (val[globalTheme]) return val[globalTheme].value;
2011
+ else if (CONFIG2.verbose) console.warn(value, " - does not have ", globalTheme);
2136
2012
  }
2137
- if (isObj && val.value)
2138
- return val.value;
2013
+ if (isObj && val.value) return val.value;
2139
2014
  if (isObj) {
2140
2015
  const obj = {};
2141
2016
  for (const mediaName in val) {
@@ -2145,8 +2020,7 @@ var getShadow = (value, globalTheme) => {
2145
2020
  }
2146
2021
  return obj;
2147
2022
  }
2148
- if (CONFIG2.verbose)
2149
- console.warn("Can't find color", value);
2023
+ if (CONFIG2.verbose) console.warn("Can't find color", value);
2150
2024
  return value;
2151
2025
  };
2152
2026
 
@@ -2192,8 +2066,7 @@ var DEF_OPTIONS = {
2192
2066
  var setSVG = (val, key) => {
2193
2067
  const CONFIG2 = getActiveConfig();
2194
2068
  if (!val) {
2195
- if (CONFIG2.verbose)
2196
- console.warn("setSVG: val is not defined", key);
2069
+ if (CONFIG2.verbose) console.warn("setSVG: val is not defined", key);
2197
2070
  return;
2198
2071
  }
2199
2072
  if (CONFIG2.useSvgSprite) {
@@ -2204,8 +2077,7 @@ var setSVG = (val, key) => {
2204
2077
  var appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
2205
2078
  const CONFIG2 = getActiveConfig();
2206
2079
  const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.SVG;
2207
- for (const key in LIBRARY)
2208
- lib[key] = CONFIG2.SVG[key];
2080
+ for (const key in LIBRARY) lib[key] = CONFIG2.SVG[key];
2209
2081
  appendSVG(lib, options);
2210
2082
  };
2211
2083
  var setSvgIcon = (val, key) => {
@@ -2219,13 +2091,11 @@ var setSvgIcon = (val, key) => {
2219
2091
  var appendSvgIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
2220
2092
  const CONFIG2 = getActiveConfig();
2221
2093
  const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.ICONS;
2222
- for (const key in LIBRARY)
2223
- lib[key] = CONFIG2.ICONS[key];
2094
+ for (const key in LIBRARY) lib[key] = CONFIG2.ICONS[key];
2224
2095
  appendSVG(lib, options);
2225
2096
  };
2226
2097
  var createSVGSpriteElement = (options = { isRoot: true }) => {
2227
- if (!document2 || !document2.createElementNS)
2228
- return;
2098
+ if (!document2 || !document2.createElementNS) return;
2229
2099
  const svgElem = document2.createElementNS("http://www.w3.org/2000/svg", "svg");
2230
2100
  if (options.isRoot) {
2231
2101
  svgElem.setAttribute("aria-hidden", "true");
@@ -2281,8 +2151,7 @@ var applyReset = (reset = {}) => {
2281
2151
  }
2282
2152
  const { body, ...templates } = TYPOGRAPHY2.templates;
2283
2153
  const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
2284
- if (RESET2.html)
2285
- overwriteDeep(RESET2.html, globalTheme);
2154
+ if (RESET2.html) overwriteDeep(RESET2.html, globalTheme);
2286
2155
  return deepMerge(merge(RESET2, reset), {
2287
2156
  html: {
2288
2157
  position: "absolute",
@@ -2339,25 +2208,18 @@ var transformBorder = (border) => {
2339
2208
  const arr = border.split(", ");
2340
2209
  return arr.map((v) => {
2341
2210
  v = v.trim();
2342
- if (v.slice(0, 2) === "--")
2343
- return `var(${v})`;
2344
- else if (isBorderStyle(v))
2345
- return v || "solid";
2346
- else if (v.slice(-2) === "px" || v.slice(-2) === "em")
2347
- return v;
2348
- else if (getColor(v).length > 2)
2349
- return getColor(v);
2211
+ if (v.slice(0, 2) === "--") return `var(${v})`;
2212
+ else if (isBorderStyle(v)) return v || "solid";
2213
+ else if (v.slice(-2) === "px" || v.slice(-2) === "em") return v;
2214
+ else if (getColor(v).length > 2) return getColor(v);
2350
2215
  return getSpacingByKey(v, "border").border;
2351
2216
  }).join(" ");
2352
2217
  };
2353
2218
  var transformTextStroke = (stroke) => {
2354
2219
  return stroke.split(", ").map((v) => {
2355
- if (v.slice(0, 2) === "--")
2356
- return `var(${v})`;
2357
- if (v.includes("px"))
2358
- return v;
2359
- else if (getColor(v))
2360
- return getColor(v);
2220
+ if (v.slice(0, 2) === "--") return `var(${v})`;
2221
+ if (v.includes("px")) return v;
2222
+ else if (getColor(v)) return getColor(v);
2361
2223
  return v;
2362
2224
  }).join(" ");
2363
2225
  };
@@ -2365,64 +2227,52 @@ var transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme);
2365
2227
  var transformBoxShadow = (shadows, globalTheme) => shadows.split("|").map((shadow) => {
2366
2228
  return shadow.split(",").map((v) => {
2367
2229
  v = v.trim();
2368
- if (v.slice(0, 2) === "--")
2369
- return `var(${v})`;
2230
+ if (v.slice(0, 2) === "--") return `var(${v})`;
2370
2231
  if (getColor(v).length > 2) {
2371
2232
  const color = getMediaColor(v, globalTheme);
2372
- if (isObject(color))
2373
- return Object.values(color).filter((v2) => v2.includes(": " + globalTheme))[0];
2233
+ if (isObject(color)) return Object.values(color).filter((v2) => v2.includes(": " + globalTheme))[0];
2374
2234
  return color;
2375
2235
  }
2376
- if (v.includes("px") || v.slice(-2) === "em")
2377
- return v;
2236
+ if (v.includes("px") || v.slice(-2) === "em") return v;
2378
2237
  const arr = v.split(" ");
2379
- if (!arr.length)
2380
- return v;
2238
+ if (!arr.length) return v;
2381
2239
  return arr.map((v2) => getSpacingByKey(v2, "shadow").shadow).join(" ");
2382
2240
  }).join(" ");
2383
2241
  }).join(",");
2384
2242
  var transformBackgroundImage = (backgroundImage, globalTheme) => {
2385
2243
  const CONFIG2 = getActiveConfig();
2386
2244
  return backgroundImage.split(", ").map((v) => {
2387
- if (v.slice(0, 2) === "--")
2388
- return `var(${v})`;
2389
- if (v.includes("url") || v.includes("gradient"))
2390
- return v;
2245
+ if (v.slice(0, 2) === "--") return `var(${v})`;
2246
+ if (v.includes("url") || v.includes("gradient")) return v;
2391
2247
  else if (CONFIG2.GRADIENT[backgroundImage]) {
2392
2248
  return {
2393
2249
  backgroundImage: getMediaColor(backgroundImage, globalTheme || CONFIG2.globalTheme)
2394
2250
  };
2395
- } else if (v.includes("/") || v.startsWith("http") || v.includes("."))
2396
- return `url(${v})`;
2251
+ } else if (v.includes("/") || v.startsWith("http") || v.includes(".")) return `url(${v})`;
2397
2252
  return v;
2398
2253
  }).join(" ");
2399
2254
  };
2400
2255
  var transfromGap = (gap) => isString(gap) && gap.split(" ").map((v) => getSpacingByKey(v, "gap").gap).join(" ");
2401
2256
  var transformTransition = (transition) => {
2402
2257
  const arr = transition.split(" ");
2403
- if (!arr.length)
2404
- return transition;
2258
+ if (!arr.length) return transition;
2405
2259
  return arr.map((v) => {
2406
- if (v.slice(0, 2) === "--")
2407
- return `var(${v})`;
2260
+ if (v.slice(0, 2) === "--") return `var(${v})`;
2408
2261
  if (v.length < 3 || v.includes("ms")) {
2409
2262
  const mapWithSequence = getTimingByKey(v);
2410
2263
  return mapWithSequence.timing || v;
2411
2264
  }
2412
- if (getTimingFunction(v))
2413
- return getTimingFunction(v);
2265
+ if (getTimingFunction(v)) return getTimingFunction(v);
2414
2266
  return v;
2415
2267
  }).join(" ");
2416
2268
  };
2417
2269
  var transformDuration = (duration, props, propertyName) => {
2418
- if (!isString(duration))
2419
- return;
2270
+ if (!isString(duration)) return;
2420
2271
  return duration.split(",").map((v) => getTimingByKey(v).timing || v).join(",");
2421
2272
  };
2422
2273
  var splitTransition = (transition) => {
2423
2274
  const arr = transition.split(",");
2424
- if (!arr.length)
2425
- return;
2275
+ if (!arr.length) return;
2426
2276
  return arr.map(transformTransition).join(",");
2427
2277
  };
2428
2278
  var checkIfBoxSize = (propertyName) => {
@@ -2431,16 +2281,14 @@ var checkIfBoxSize = (propertyName) => {
2431
2281
  };
2432
2282
  var transformSize = (propertyName, val, props = {}, opts = {}) => {
2433
2283
  let value = val || props[propertyName];
2434
- if (isUndefined(value) && isNull(value))
2435
- return;
2284
+ if (isUndefined(value) && isNull(value)) return;
2436
2285
  const shouldScaleBoxSize = props.scaleBoxSize;
2437
2286
  const isBoxSize = checkIfBoxSize(propertyName);
2438
2287
  if (!shouldScaleBoxSize && isBoxSize && isString(value)) {
2439
2288
  value = value.split(" ").map((v) => {
2440
2289
  const isSingleLetter = v.length < 3 && /[A-Z]/.test(v);
2441
2290
  const hasUnits = ["%", "vw", "vh", "ch"].some((unit) => value.includes(unit));
2442
- if (isSingleLetter && !hasUnits)
2443
- return v + "_default";
2291
+ if (isSingleLetter && !hasUnits) return v + "_default";
2444
2292
  return v;
2445
2293
  }).join(" ");
2446
2294
  }
@@ -2458,8 +2306,7 @@ var transformSizeRatio = (propertyName, props) => {
2458
2306
 
2459
2307
  // src/set.js
2460
2308
  var setCases = (val, key) => {
2461
- if (isFunction(val))
2462
- return val();
2309
+ if (isFunction(val)) return val();
2463
2310
  return val;
2464
2311
  };
2465
2312
  var setSameValue = (val, key) => val;
@@ -2495,12 +2342,10 @@ var setValue = (FACTORY_NAME, value, key) => {
2495
2342
  FACTORY2[key] = result;
2496
2343
  return FACTORY2;
2497
2344
  } catch (error) {
2498
- if (CONFIG2.verbose)
2499
- console.warn("Error setting", factoryName, "value", value, key, error);
2345
+ if (CONFIG2.verbose) console.warn("Error setting", factoryName, "value", value, key, error);
2500
2346
  }
2501
2347
  }
2502
- if (CONFIG2.verbose)
2503
- console.warn("Can not find", factoryName, "method in scratch");
2348
+ if (CONFIG2.verbose) console.warn("Can not find", factoryName, "method in scratch");
2504
2349
  };
2505
2350
  var setEach = (factoryName, props) => {
2506
2351
  const CONFIG2 = getActiveConfig();
@@ -2510,8 +2355,7 @@ var setEach = (factoryName, props) => {
2510
2355
  try {
2511
2356
  return setValue(FACTORY_NAME, props[key], key);
2512
2357
  } catch (error) {
2513
- if (CONFIG2.verbose)
2514
- console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
2358
+ if (CONFIG2.verbose) console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
2515
2359
  }
2516
2360
  });
2517
2361
  return CONFIG2[FACTORY_NAME];
@@ -2536,57 +2380,43 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
2536
2380
  if (options.newConfig) {
2537
2381
  CONFIG2 = setActiveConfig(options.newConfig);
2538
2382
  }
2539
- if (verbose !== void 0)
2540
- CONFIG2.verbose = verbose;
2541
- if (useVariable !== void 0)
2542
- CONFIG2.useVariable = useVariable;
2543
- if (useReset !== void 0)
2544
- CONFIG2.useReset = useReset;
2545
- if (useFontImport !== void 0)
2546
- CONFIG2.useFontImport = useFontImport;
2547
- if (useSvgSprite !== void 0)
2548
- CONFIG2.useSvgSprite = useSvgSprite;
2549
- if (useIconSprite !== void 0)
2550
- CONFIG2.useIconSprite = useIconSprite;
2551
- if (useDocumentTheme !== void 0)
2552
- CONFIG2.useDocumentTheme = useDocumentTheme;
2553
- if (globalTheme !== void 0)
2554
- CONFIG2.globalTheme = globalTheme;
2555
- if (useDefaultConfig !== void 0)
2556
- CONFIG2.useDefaultConfig = useDefaultConfig;
2557
- if (SEMANTIC_ICONS2 !== void 0)
2558
- CONFIG2.SEMANTIC_ICONS = SEMANTIC_ICONS2;
2559
- if (CONFIG2.verbose)
2560
- console.log(CONFIG2);
2561
- if (!CONFIG2.__svg_cache)
2562
- CONFIG2.__svg_cache = {};
2383
+ if (verbose !== void 0) CONFIG2.verbose = verbose;
2384
+ if (useVariable !== void 0) CONFIG2.useVariable = useVariable;
2385
+ if (useReset !== void 0) CONFIG2.useReset = useReset;
2386
+ if (useFontImport !== void 0) CONFIG2.useFontImport = useFontImport;
2387
+ if (useSvgSprite !== void 0) CONFIG2.useSvgSprite = useSvgSprite;
2388
+ if (useIconSprite !== void 0) CONFIG2.useIconSprite = useIconSprite;
2389
+ if (useDocumentTheme !== void 0) CONFIG2.useDocumentTheme = useDocumentTheme;
2390
+ if (globalTheme !== void 0) CONFIG2.globalTheme = globalTheme;
2391
+ if (useDefaultConfig !== void 0) CONFIG2.useDefaultConfig = useDefaultConfig;
2392
+ if (SEMANTIC_ICONS2 !== void 0) CONFIG2.SEMANTIC_ICONS = SEMANTIC_ICONS2;
2393
+ if (CONFIG2.verbose) console.log(CONFIG2);
2394
+ if (!CONFIG2.__svg_cache) CONFIG2.__svg_cache = {};
2563
2395
  const keys = Object.keys(config);
2564
2396
  keys.map((key) => setEach(key, config[key]));
2565
2397
  if (config.TYPOGRAPHY) {
2566
2398
  try {
2567
2399
  applyTypographySequence();
2568
2400
  } catch (e) {
2569
- if (CONFIG2.verbose)
2570
- console.warn("Error applying typography sequence", e);
2401
+ if (CONFIG2.verbose) console.warn("Error applying typography sequence", e);
2571
2402
  }
2572
2403
  }
2573
2404
  if (config.SPACING) {
2574
2405
  try {
2575
2406
  applySpacingSequence();
2576
2407
  } catch (e) {
2577
- if (CONFIG2.verbose)
2578
- console.warn("Error applying typography sequence", e);
2408
+ if (CONFIG2.verbose) console.warn("Error applying typography sequence", e);
2579
2409
  }
2580
2410
  }
2581
2411
  if (config.TIMING) {
2582
2412
  try {
2583
2413
  applyTimingSequence();
2584
2414
  } catch (e) {
2585
- if (CONFIG2.verbose)
2586
- console.warn("Error applying typography sequence", e);
2415
+ if (CONFIG2.verbose) console.warn("Error applying typography sequence", e);
2587
2416
  }
2588
2417
  }
2589
2418
  applyDocument();
2590
2419
  applyReset();
2591
2420
  return CONFIG2;
2592
2421
  };
2422
+ // @preserve-env