@storm-software/tsup 0.2.86 → 0.2.88

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/options.cjs CHANGED
@@ -1107,8 +1107,691 @@ var getLogLevelLabel2 = (logLevel = LogLevel2.INFO) => {
1107
1107
  return LogLevelLabel2.INFO;
1108
1108
  };
1109
1109
 
1110
- // ../config-tools/dist/chunk-QKYARTIV.js
1111
- var import_formatDistanceToNow2 = require("date-fns/formatDistanceToNow");
1110
+ // ../config-tools/dist/chunk-SPHE3YEH.js
1111
+ var daysInYear = 365.2425;
1112
+ var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
1113
+ var minTime = -maxTime;
1114
+ var minutesInMonth = 43200;
1115
+ var minutesInDay = 1440;
1116
+ var secondsInHour = 3600;
1117
+ var secondsInDay = secondsInHour * 24;
1118
+ var secondsInWeek = secondsInDay * 7;
1119
+ var secondsInYear = secondsInDay * daysInYear;
1120
+ var secondsInMonth = secondsInYear / 12;
1121
+ var secondsInQuarter = secondsInMonth * 3;
1122
+ var constructFromSymbol = Symbol.for("constructDateFrom");
1123
+ function constructFrom(date, value) {
1124
+ if (typeof date === "function") return date(value);
1125
+ if (date && typeof date === "object" && constructFromSymbol in date)
1126
+ return date[constructFromSymbol](value);
1127
+ if (date instanceof Date) return new date.constructor(value);
1128
+ return new Date(value);
1129
+ }
1130
+ function constructNow(date) {
1131
+ return constructFrom(date, Date.now());
1132
+ }
1133
+ var formatDistanceLocale = {
1134
+ lessThanXSeconds: {
1135
+ one: "less than a second",
1136
+ other: "less than {{count}} seconds"
1137
+ },
1138
+ xSeconds: {
1139
+ one: "1 second",
1140
+ other: "{{count}} seconds"
1141
+ },
1142
+ halfAMinute: "half a minute",
1143
+ lessThanXMinutes: {
1144
+ one: "less than a minute",
1145
+ other: "less than {{count}} minutes"
1146
+ },
1147
+ xMinutes: {
1148
+ one: "1 minute",
1149
+ other: "{{count}} minutes"
1150
+ },
1151
+ aboutXHours: {
1152
+ one: "about 1 hour",
1153
+ other: "about {{count}} hours"
1154
+ },
1155
+ xHours: {
1156
+ one: "1 hour",
1157
+ other: "{{count}} hours"
1158
+ },
1159
+ xDays: {
1160
+ one: "1 day",
1161
+ other: "{{count}} days"
1162
+ },
1163
+ aboutXWeeks: {
1164
+ one: "about 1 week",
1165
+ other: "about {{count}} weeks"
1166
+ },
1167
+ xWeeks: {
1168
+ one: "1 week",
1169
+ other: "{{count}} weeks"
1170
+ },
1171
+ aboutXMonths: {
1172
+ one: "about 1 month",
1173
+ other: "about {{count}} months"
1174
+ },
1175
+ xMonths: {
1176
+ one: "1 month",
1177
+ other: "{{count}} months"
1178
+ },
1179
+ aboutXYears: {
1180
+ one: "about 1 year",
1181
+ other: "about {{count}} years"
1182
+ },
1183
+ xYears: {
1184
+ one: "1 year",
1185
+ other: "{{count}} years"
1186
+ },
1187
+ overXYears: {
1188
+ one: "over 1 year",
1189
+ other: "over {{count}} years"
1190
+ },
1191
+ almostXYears: {
1192
+ one: "almost 1 year",
1193
+ other: "almost {{count}} years"
1194
+ }
1195
+ };
1196
+ var formatDistance = (token, count, options) => {
1197
+ let result;
1198
+ const tokenValue = formatDistanceLocale[token];
1199
+ if (typeof tokenValue === "string") {
1200
+ result = tokenValue;
1201
+ } else if (count === 1) {
1202
+ result = tokenValue.one;
1203
+ } else {
1204
+ result = tokenValue.other.replace("{{count}}", count.toString());
1205
+ }
1206
+ if (options?.addSuffix) {
1207
+ if (options.comparison && options.comparison > 0) {
1208
+ return "in " + result;
1209
+ } else {
1210
+ return result + " ago";
1211
+ }
1212
+ }
1213
+ return result;
1214
+ };
1215
+ function buildFormatLongFn(args) {
1216
+ return (options = {}) => {
1217
+ const width = options.width ? String(options.width) : args.defaultWidth;
1218
+ const format2 = args.formats[width] || args.formats[args.defaultWidth];
1219
+ return format2;
1220
+ };
1221
+ }
1222
+ var dateFormats = {
1223
+ full: "EEEE, MMMM do, y",
1224
+ long: "MMMM do, y",
1225
+ medium: "MMM d, y",
1226
+ short: "MM/dd/yyyy"
1227
+ };
1228
+ var timeFormats = {
1229
+ full: "h:mm:ss a zzzz",
1230
+ long: "h:mm:ss a z",
1231
+ medium: "h:mm:ss a",
1232
+ short: "h:mm a"
1233
+ };
1234
+ var dateTimeFormats = {
1235
+ full: "{{date}} 'at' {{time}}",
1236
+ long: "{{date}} 'at' {{time}}",
1237
+ medium: "{{date}}, {{time}}",
1238
+ short: "{{date}}, {{time}}"
1239
+ };
1240
+ var formatLong = {
1241
+ date: buildFormatLongFn({
1242
+ formats: dateFormats,
1243
+ defaultWidth: "full"
1244
+ }),
1245
+ time: buildFormatLongFn({
1246
+ formats: timeFormats,
1247
+ defaultWidth: "full"
1248
+ }),
1249
+ dateTime: buildFormatLongFn({
1250
+ formats: dateTimeFormats,
1251
+ defaultWidth: "full"
1252
+ })
1253
+ };
1254
+ var formatRelativeLocale = {
1255
+ lastWeek: "'last' eeee 'at' p",
1256
+ yesterday: "'yesterday at' p",
1257
+ today: "'today at' p",
1258
+ tomorrow: "'tomorrow at' p",
1259
+ nextWeek: "eeee 'at' p",
1260
+ other: "P"
1261
+ };
1262
+ var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
1263
+ function buildLocalizeFn(args) {
1264
+ return (value, options) => {
1265
+ const context = options?.context ? String(options.context) : "standalone";
1266
+ let valuesArray;
1267
+ if (context === "formatting" && args.formattingValues) {
1268
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1269
+ const width = options?.width ? String(options.width) : defaultWidth;
1270
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1271
+ } else {
1272
+ const defaultWidth = args.defaultWidth;
1273
+ const width = options?.width ? String(options.width) : args.defaultWidth;
1274
+ valuesArray = args.values[width] || args.values[defaultWidth];
1275
+ }
1276
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
1277
+ return valuesArray[index];
1278
+ };
1279
+ }
1280
+ var eraValues = {
1281
+ narrow: ["B", "A"],
1282
+ abbreviated: ["BC", "AD"],
1283
+ wide: ["Before Christ", "Anno Domini"]
1284
+ };
1285
+ var quarterValues = {
1286
+ narrow: ["1", "2", "3", "4"],
1287
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1288
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1289
+ };
1290
+ var monthValues = {
1291
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1292
+ abbreviated: [
1293
+ "Jan",
1294
+ "Feb",
1295
+ "Mar",
1296
+ "Apr",
1297
+ "May",
1298
+ "Jun",
1299
+ "Jul",
1300
+ "Aug",
1301
+ "Sep",
1302
+ "Oct",
1303
+ "Nov",
1304
+ "Dec"
1305
+ ],
1306
+ wide: [
1307
+ "January",
1308
+ "February",
1309
+ "March",
1310
+ "April",
1311
+ "May",
1312
+ "June",
1313
+ "July",
1314
+ "August",
1315
+ "September",
1316
+ "October",
1317
+ "November",
1318
+ "December"
1319
+ ]
1320
+ };
1321
+ var dayValues = {
1322
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
1323
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1324
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1325
+ wide: [
1326
+ "Sunday",
1327
+ "Monday",
1328
+ "Tuesday",
1329
+ "Wednesday",
1330
+ "Thursday",
1331
+ "Friday",
1332
+ "Saturday"
1333
+ ]
1334
+ };
1335
+ var dayPeriodValues = {
1336
+ narrow: {
1337
+ am: "a",
1338
+ pm: "p",
1339
+ midnight: "mi",
1340
+ noon: "n",
1341
+ morning: "morning",
1342
+ afternoon: "afternoon",
1343
+ evening: "evening",
1344
+ night: "night"
1345
+ },
1346
+ abbreviated: {
1347
+ am: "AM",
1348
+ pm: "PM",
1349
+ midnight: "midnight",
1350
+ noon: "noon",
1351
+ morning: "morning",
1352
+ afternoon: "afternoon",
1353
+ evening: "evening",
1354
+ night: "night"
1355
+ },
1356
+ wide: {
1357
+ am: "a.m.",
1358
+ pm: "p.m.",
1359
+ midnight: "midnight",
1360
+ noon: "noon",
1361
+ morning: "morning",
1362
+ afternoon: "afternoon",
1363
+ evening: "evening",
1364
+ night: "night"
1365
+ }
1366
+ };
1367
+ var formattingDayPeriodValues = {
1368
+ narrow: {
1369
+ am: "a",
1370
+ pm: "p",
1371
+ midnight: "mi",
1372
+ noon: "n",
1373
+ morning: "in the morning",
1374
+ afternoon: "in the afternoon",
1375
+ evening: "in the evening",
1376
+ night: "at night"
1377
+ },
1378
+ abbreviated: {
1379
+ am: "AM",
1380
+ pm: "PM",
1381
+ midnight: "midnight",
1382
+ noon: "noon",
1383
+ morning: "in the morning",
1384
+ afternoon: "in the afternoon",
1385
+ evening: "in the evening",
1386
+ night: "at night"
1387
+ },
1388
+ wide: {
1389
+ am: "a.m.",
1390
+ pm: "p.m.",
1391
+ midnight: "midnight",
1392
+ noon: "noon",
1393
+ morning: "in the morning",
1394
+ afternoon: "in the afternoon",
1395
+ evening: "in the evening",
1396
+ night: "at night"
1397
+ }
1398
+ };
1399
+ var ordinalNumber = (dirtyNumber, _options) => {
1400
+ const number = Number(dirtyNumber);
1401
+ const rem100 = number % 100;
1402
+ if (rem100 > 20 || rem100 < 10) {
1403
+ switch (rem100 % 10) {
1404
+ case 1:
1405
+ return number + "st";
1406
+ case 2:
1407
+ return number + "nd";
1408
+ case 3:
1409
+ return number + "rd";
1410
+ }
1411
+ }
1412
+ return number + "th";
1413
+ };
1414
+ var localize = {
1415
+ ordinalNumber,
1416
+ era: buildLocalizeFn({
1417
+ values: eraValues,
1418
+ defaultWidth: "wide"
1419
+ }),
1420
+ quarter: buildLocalizeFn({
1421
+ values: quarterValues,
1422
+ defaultWidth: "wide",
1423
+ argumentCallback: (quarter) => quarter - 1
1424
+ }),
1425
+ month: buildLocalizeFn({
1426
+ values: monthValues,
1427
+ defaultWidth: "wide"
1428
+ }),
1429
+ day: buildLocalizeFn({
1430
+ values: dayValues,
1431
+ defaultWidth: "wide"
1432
+ }),
1433
+ dayPeriod: buildLocalizeFn({
1434
+ values: dayPeriodValues,
1435
+ defaultWidth: "wide",
1436
+ formattingValues: formattingDayPeriodValues,
1437
+ defaultFormattingWidth: "wide"
1438
+ })
1439
+ };
1440
+ function buildMatchFn(args) {
1441
+ return (string3, options = {}) => {
1442
+ const width = options.width;
1443
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1444
+ const matchResult = string3.match(matchPattern);
1445
+ if (!matchResult) {
1446
+ return null;
1447
+ }
1448
+ const matchedString = matchResult[0];
1449
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1450
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
1451
+ // [TODO] -- I challenge you to fix the type
1452
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString))
1453
+ );
1454
+ let value;
1455
+ value = args.valueCallback ? args.valueCallback(key) : key;
1456
+ value = options.valueCallback ? (
1457
+ // [TODO] -- I challenge you to fix the type
1458
+ options.valueCallback(value)
1459
+ ) : value;
1460
+ const rest = string3.slice(matchedString.length);
1461
+ return { value, rest };
1462
+ };
1463
+ }
1464
+ function findKey(object3, predicate) {
1465
+ for (const key in object3) {
1466
+ if (Object.prototype.hasOwnProperty.call(object3, key) && predicate(object3[key])) {
1467
+ return key;
1468
+ }
1469
+ }
1470
+ return void 0;
1471
+ }
1472
+ function findIndex(array3, predicate) {
1473
+ for (let key = 0; key < array3.length; key++) {
1474
+ if (predicate(array3[key])) {
1475
+ return key;
1476
+ }
1477
+ }
1478
+ return void 0;
1479
+ }
1480
+ function buildMatchPatternFn(args) {
1481
+ return (string3, options = {}) => {
1482
+ const matchResult = string3.match(args.matchPattern);
1483
+ if (!matchResult) return null;
1484
+ const matchedString = matchResult[0];
1485
+ const parseResult = string3.match(args.parsePattern);
1486
+ if (!parseResult) return null;
1487
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1488
+ value = options.valueCallback ? options.valueCallback(value) : value;
1489
+ const rest = string3.slice(matchedString.length);
1490
+ return { value, rest };
1491
+ };
1492
+ }
1493
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1494
+ var parseOrdinalNumberPattern = /\d+/i;
1495
+ var matchEraPatterns = {
1496
+ narrow: /^(b|a)/i,
1497
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1498
+ wide: /^(before christ|before common era|anno domini|common era)/i
1499
+ };
1500
+ var parseEraPatterns = {
1501
+ any: [/^b/i, /^(a|c)/i]
1502
+ };
1503
+ var matchQuarterPatterns = {
1504
+ narrow: /^[1234]/i,
1505
+ abbreviated: /^q[1234]/i,
1506
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1507
+ };
1508
+ var parseQuarterPatterns = {
1509
+ any: [/1/i, /2/i, /3/i, /4/i]
1510
+ };
1511
+ var matchMonthPatterns = {
1512
+ narrow: /^[jfmasond]/i,
1513
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1514
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1515
+ };
1516
+ var parseMonthPatterns = {
1517
+ narrow: [
1518
+ /^j/i,
1519
+ /^f/i,
1520
+ /^m/i,
1521
+ /^a/i,
1522
+ /^m/i,
1523
+ /^j/i,
1524
+ /^j/i,
1525
+ /^a/i,
1526
+ /^s/i,
1527
+ /^o/i,
1528
+ /^n/i,
1529
+ /^d/i
1530
+ ],
1531
+ any: [
1532
+ /^ja/i,
1533
+ /^f/i,
1534
+ /^mar/i,
1535
+ /^ap/i,
1536
+ /^may/i,
1537
+ /^jun/i,
1538
+ /^jul/i,
1539
+ /^au/i,
1540
+ /^s/i,
1541
+ /^o/i,
1542
+ /^n/i,
1543
+ /^d/i
1544
+ ]
1545
+ };
1546
+ var matchDayPatterns = {
1547
+ narrow: /^[smtwf]/i,
1548
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1549
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1550
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1551
+ };
1552
+ var parseDayPatterns = {
1553
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1554
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1555
+ };
1556
+ var matchDayPeriodPatterns = {
1557
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1558
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1559
+ };
1560
+ var parseDayPeriodPatterns = {
1561
+ any: {
1562
+ am: /^a/i,
1563
+ pm: /^p/i,
1564
+ midnight: /^mi/i,
1565
+ noon: /^no/i,
1566
+ morning: /morning/i,
1567
+ afternoon: /afternoon/i,
1568
+ evening: /evening/i,
1569
+ night: /night/i
1570
+ }
1571
+ };
1572
+ var match = {
1573
+ ordinalNumber: buildMatchPatternFn({
1574
+ matchPattern: matchOrdinalNumberPattern,
1575
+ parsePattern: parseOrdinalNumberPattern,
1576
+ valueCallback: (value) => parseInt(value, 10)
1577
+ }),
1578
+ era: buildMatchFn({
1579
+ matchPatterns: matchEraPatterns,
1580
+ defaultMatchWidth: "wide",
1581
+ parsePatterns: parseEraPatterns,
1582
+ defaultParseWidth: "any"
1583
+ }),
1584
+ quarter: buildMatchFn({
1585
+ matchPatterns: matchQuarterPatterns,
1586
+ defaultMatchWidth: "wide",
1587
+ parsePatterns: parseQuarterPatterns,
1588
+ defaultParseWidth: "any",
1589
+ valueCallback: (index) => index + 1
1590
+ }),
1591
+ month: buildMatchFn({
1592
+ matchPatterns: matchMonthPatterns,
1593
+ defaultMatchWidth: "wide",
1594
+ parsePatterns: parseMonthPatterns,
1595
+ defaultParseWidth: "any"
1596
+ }),
1597
+ day: buildMatchFn({
1598
+ matchPatterns: matchDayPatterns,
1599
+ defaultMatchWidth: "wide",
1600
+ parsePatterns: parseDayPatterns,
1601
+ defaultParseWidth: "any"
1602
+ }),
1603
+ dayPeriod: buildMatchFn({
1604
+ matchPatterns: matchDayPeriodPatterns,
1605
+ defaultMatchWidth: "any",
1606
+ parsePatterns: parseDayPeriodPatterns,
1607
+ defaultParseWidth: "any"
1608
+ })
1609
+ };
1610
+ var enUS = {
1611
+ code: "en-US",
1612
+ formatDistance,
1613
+ formatLong,
1614
+ formatRelative,
1615
+ localize,
1616
+ match,
1617
+ options: {
1618
+ weekStartsOn: 0,
1619
+ firstWeekContainsDate: 1
1620
+ }
1621
+ };
1622
+ var defaultOptions = {};
1623
+ function getDefaultOptions() {
1624
+ return defaultOptions;
1625
+ }
1626
+ function toDate(argument, context) {
1627
+ return constructFrom(context || argument, argument);
1628
+ }
1629
+ function getTimezoneOffsetInMilliseconds(date) {
1630
+ const _date = toDate(date);
1631
+ const utcDate = new Date(
1632
+ Date.UTC(
1633
+ _date.getFullYear(),
1634
+ _date.getMonth(),
1635
+ _date.getDate(),
1636
+ _date.getHours(),
1637
+ _date.getMinutes(),
1638
+ _date.getSeconds(),
1639
+ _date.getMilliseconds()
1640
+ )
1641
+ );
1642
+ utcDate.setUTCFullYear(_date.getFullYear());
1643
+ return +date - +utcDate;
1644
+ }
1645
+ function normalizeDates(context, ...dates) {
1646
+ const normalize = constructFrom.bind(
1647
+ null,
1648
+ context || dates.find((date) => typeof date === "object")
1649
+ );
1650
+ return dates.map(normalize);
1651
+ }
1652
+ function compareAsc(dateLeft, dateRight) {
1653
+ const diff = +toDate(dateLeft) - +toDate(dateRight);
1654
+ if (diff < 0) return -1;
1655
+ else if (diff > 0) return 1;
1656
+ return diff;
1657
+ }
1658
+ function differenceInCalendarMonths(laterDate, earlierDate, options) {
1659
+ const [laterDate_, earlierDate_] = normalizeDates(
1660
+ options?.in,
1661
+ laterDate,
1662
+ earlierDate
1663
+ );
1664
+ const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
1665
+ const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
1666
+ return yearsDiff * 12 + monthsDiff;
1667
+ }
1668
+ function endOfDay(date, options) {
1669
+ const _date = toDate(date, options?.in);
1670
+ _date.setHours(23, 59, 59, 999);
1671
+ return _date;
1672
+ }
1673
+ function endOfMonth(date, options) {
1674
+ const _date = toDate(date, options?.in);
1675
+ const month = _date.getMonth();
1676
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
1677
+ _date.setHours(23, 59, 59, 999);
1678
+ return _date;
1679
+ }
1680
+ function isLastDayOfMonth(date, options) {
1681
+ const _date = toDate(date, options?.in);
1682
+ return +endOfDay(_date, options) === +endOfMonth(_date, options);
1683
+ }
1684
+ function differenceInMonths(laterDate, earlierDate, options) {
1685
+ const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
1686
+ options?.in,
1687
+ laterDate,
1688
+ laterDate,
1689
+ earlierDate
1690
+ );
1691
+ const sign = compareAsc(workingLaterDate, earlierDate_);
1692
+ const difference = Math.abs(
1693
+ differenceInCalendarMonths(workingLaterDate, earlierDate_)
1694
+ );
1695
+ if (difference < 1) return 0;
1696
+ if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
1697
+ workingLaterDate.setDate(30);
1698
+ workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
1699
+ let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
1700
+ if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
1701
+ isLastMonthNotFull = false;
1702
+ }
1703
+ const result = sign * (difference - +isLastMonthNotFull);
1704
+ return result === 0 ? 0 : result;
1705
+ }
1706
+ function getRoundingMethod(method) {
1707
+ return (number) => {
1708
+ const round = method ? Math[method] : Math.trunc;
1709
+ const result = round(number);
1710
+ return result === 0 ? 0 : result;
1711
+ };
1712
+ }
1713
+ function differenceInMilliseconds(laterDate, earlierDate) {
1714
+ return +toDate(laterDate) - +toDate(earlierDate);
1715
+ }
1716
+ function differenceInSeconds(laterDate, earlierDate, options) {
1717
+ const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
1718
+ return getRoundingMethod(options?.roundingMethod)(diff);
1719
+ }
1720
+ function formatDistance2(laterDate, earlierDate, options) {
1721
+ const defaultOptions2 = getDefaultOptions();
1722
+ const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
1723
+ const minutesInAlmostTwoDays = 2520;
1724
+ const comparison = compareAsc(laterDate, earlierDate);
1725
+ if (isNaN(comparison)) throw new RangeError("Invalid time value");
1726
+ const localizeOptions = Object.assign({}, options, {
1727
+ addSuffix: options?.addSuffix,
1728
+ comparison
1729
+ });
1730
+ const [laterDate_, earlierDate_] = normalizeDates(
1731
+ options?.in,
1732
+ ...comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]
1733
+ );
1734
+ const seconds = differenceInSeconds(earlierDate_, laterDate_);
1735
+ const offsetInSeconds = (getTimezoneOffsetInMilliseconds(earlierDate_) - getTimezoneOffsetInMilliseconds(laterDate_)) / 1e3;
1736
+ const minutes = Math.round((seconds - offsetInSeconds) / 60);
1737
+ let months;
1738
+ if (minutes < 2) {
1739
+ if (options?.includeSeconds) {
1740
+ if (seconds < 5) {
1741
+ return locale.formatDistance("lessThanXSeconds", 5, localizeOptions);
1742
+ } else if (seconds < 10) {
1743
+ return locale.formatDistance("lessThanXSeconds", 10, localizeOptions);
1744
+ } else if (seconds < 20) {
1745
+ return locale.formatDistance("lessThanXSeconds", 20, localizeOptions);
1746
+ } else if (seconds < 40) {
1747
+ return locale.formatDistance("halfAMinute", 0, localizeOptions);
1748
+ } else if (seconds < 60) {
1749
+ return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
1750
+ } else {
1751
+ return locale.formatDistance("xMinutes", 1, localizeOptions);
1752
+ }
1753
+ } else {
1754
+ if (minutes === 0) {
1755
+ return locale.formatDistance("lessThanXMinutes", 1, localizeOptions);
1756
+ } else {
1757
+ return locale.formatDistance("xMinutes", minutes, localizeOptions);
1758
+ }
1759
+ }
1760
+ } else if (minutes < 45) {
1761
+ return locale.formatDistance("xMinutes", minutes, localizeOptions);
1762
+ } else if (minutes < 90) {
1763
+ return locale.formatDistance("aboutXHours", 1, localizeOptions);
1764
+ } else if (minutes < minutesInDay) {
1765
+ const hours = Math.round(minutes / 60);
1766
+ return locale.formatDistance("aboutXHours", hours, localizeOptions);
1767
+ } else if (minutes < minutesInAlmostTwoDays) {
1768
+ return locale.formatDistance("xDays", 1, localizeOptions);
1769
+ } else if (minutes < minutesInMonth) {
1770
+ const days = Math.round(minutes / minutesInDay);
1771
+ return locale.formatDistance("xDays", days, localizeOptions);
1772
+ } else if (minutes < minutesInMonth * 2) {
1773
+ months = Math.round(minutes / minutesInMonth);
1774
+ return locale.formatDistance("aboutXMonths", months, localizeOptions);
1775
+ }
1776
+ months = differenceInMonths(earlierDate_, laterDate_);
1777
+ if (months < 12) {
1778
+ const nearestMonth = Math.round(minutes / minutesInMonth);
1779
+ return locale.formatDistance("xMonths", nearestMonth, localizeOptions);
1780
+ } else {
1781
+ const monthsSinceStartOfYear = months % 12;
1782
+ const years = Math.trunc(months / 12);
1783
+ if (monthsSinceStartOfYear < 3) {
1784
+ return locale.formatDistance("aboutXYears", years, localizeOptions);
1785
+ } else if (monthsSinceStartOfYear < 9) {
1786
+ return locale.formatDistance("overXYears", years, localizeOptions);
1787
+ } else {
1788
+ return locale.formatDistance("almostXYears", years + 1, localizeOptions);
1789
+ }
1790
+ }
1791
+ }
1792
+ function formatDistanceToNow2(date, options) {
1793
+ return formatDistance2(date, constructNow(date), options);
1794
+ }
1112
1795
  var getLogFn = (logLevel = LogLevel2.INFO, config = {}, _chalk = getChalk()) => {
1113
1796
  const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
1114
1797
  const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel2.INFO;
@@ -1224,7 +1907,7 @@ var getStopwatch = (name) => {
1224
1907
  const start = /* @__PURE__ */ new Date();
1225
1908
  return () => {
1226
1909
  console.info(
1227
- `> \u23F1 The${name ? ` ${name}` : ""} process took ${(0, import_formatDistanceToNow2.formatDistanceToNow)(
1910
+ `> \u23F1 The${name ? ` ${name}` : ""} process took ${formatDistanceToNow2(
1228
1911
  start,
1229
1912
  {
1230
1913
  includeSeconds: true
@@ -1258,7 +1941,7 @@ var _isFunction = (value) => {
1258
1941
  }
1259
1942
  };
1260
1943
 
1261
- // ../config-tools/dist/chunk-ZGGNJYIH.js
1944
+ // ../config-tools/dist/chunk-ZFTN72CN.js
1262
1945
  var import_c122 = require("c12");
1263
1946
  var import_defu3 = __toESM(require("defu"), 1);
1264
1947
  var getConfigFileByName = async (fileName, filePath, options = {}) => {
@@ -2203,7 +2886,7 @@ var getBaseThemeColorsEnv = (prefix) => {
2203
2886
  };
2204
2887
  };
2205
2888
 
2206
- // ../config-tools/dist/chunk-RSTBLBBG.js
2889
+ // ../config-tools/dist/chunk-VOEYKXJ6.js
2207
2890
  var import_defu4 = __toESM(require("defu"), 1);
2208
2891
  var import_node_fs9 = require("fs");
2209
2892
  var _extension_cache = /* @__PURE__ */ new WeakMap();
@@ -2300,7 +2983,7 @@ ${formatLogMessage2(config)}`,
2300
2983
  return config;
2301
2984
  };
2302
2985
 
2303
- // ../config-tools/dist/chunk-ZVA3DOGV.js
2986
+ // ../config-tools/dist/chunk-T32OBFSH.js
2304
2987
  function getConfig(workspaceRoot, skipLogs = false) {
2305
2988
  return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
2306
2989
  }