@harnessio/ui 1.8.1 → 1.9.0

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.
@@ -1,8 +1,8 @@
1
- import { isValidElement as W } from "react";
2
- const T = 6, Dt = (t) => (t ?? "").slice(0, T), Pt = (t, n = 2) => {
1
+ import { isValidElement as T } from "react";
2
+ const F = 6, xt = (t) => (t ?? "").slice(0, F), Pt = (t, n = 2) => {
3
3
  const r = t.split(" ").filter(Boolean).map((a) => a[0].toUpperCase()).join("");
4
4
  return n ? r.slice(0, n) : r;
5
- }, xt = (t) => {
5
+ }, It = (t) => {
6
6
  if (!(t != null && t.trim())) return { data: {}, metadata: {} };
7
7
  const n = t.split(",").map((a) => a.trim()).filter((a) => a.length > 0);
8
8
  if (n.length === 0) return { data: {}, metadata: {} };
@@ -18,15 +18,21 @@ const T = 6, Dt = (t) => (t ?? "").slice(0, T), Pt = (t, n = 2) => {
18
18
  } else
19
19
  e[a] = a, r[a] = !1;
20
20
  return { data: e, metadata: r };
21
- }, It = (t, n, e, r = !1) => {
21
+ }, Wt = (t, n, e, r = !1) => {
22
22
  const a = t === 1 ? n : e;
23
23
  return r ? `${t} ${a}` : a;
24
- };
25
- function Wt(t, n) {
24
+ }, D = ["B", "KB", "MB", "GB", "TB"];
25
+ function Tt(t) {
26
+ let n = Math.max(0, t), e = 0;
27
+ for (; n >= 1024 && e < D.length - 1; )
28
+ n /= 1024, e++;
29
+ return `${e === 0 ? Math.round(n) : Math.round(n * 10) / 10} ${D[e]}`;
30
+ }
31
+ function Ft(t, n) {
26
32
  const e = typeof t;
27
33
  return n.includes(e);
28
34
  }
29
- function Tt(t, n) {
35
+ function Ct(t, n) {
30
36
  const e = {}, r = { ...t };
31
37
  for (const a of n)
32
38
  a in t && (e[a] = t[a], delete r[a]);
@@ -36,13 +42,13 @@ function l(t) {
36
42
  const n = Object.prototype.toString.call(t);
37
43
  return t instanceof Date || typeof t == "object" && n === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || n === "[object Number]" || typeof t == "string" || n === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
38
44
  }
39
- function Ft(t, n) {
45
+ function kt(t, n) {
40
46
  return t instanceof Date ? new t.constructor(n) : new Date(n);
41
47
  }
42
- const Ct = 6048e5, kt = 864e5, Nt = 6e4, Rt = 36e5, At = 1e3, w = 43200, D = 1440;
43
- let F = {};
44
- function C() {
45
- return F;
48
+ const Nt = 6048e5, Rt = 864e5, At = 6e4, Ot = 36e5, Et = 1e3, w = 43200, x = 1440;
49
+ let C = {};
50
+ function k() {
51
+ return C;
46
52
  }
47
53
  function P(t) {
48
54
  const n = l(t), e = new Date(
@@ -62,34 +68,34 @@ function M(t, n) {
62
68
  const e = l(t), r = l(n), a = e.getTime() - r.getTime();
63
69
  return a < 0 ? -1 : a > 0 ? 1 : a;
64
70
  }
65
- function k(t, n) {
71
+ function N(t, n) {
66
72
  const e = l(t), r = l(n), a = e.getFullYear() - r.getFullYear(), s = e.getMonth() - r.getMonth();
67
73
  return a * 12 + s;
68
74
  }
69
- function N(t) {
75
+ function R(t) {
70
76
  return (n) => {
71
77
  const r = (t ? Math[t] : Math.trunc)(n);
72
78
  return r === 0 ? 0 : r;
73
79
  };
74
80
  }
75
- function R(t, n) {
81
+ function A(t, n) {
76
82
  return +l(t) - +l(n);
77
83
  }
78
- function A(t) {
84
+ function O(t) {
79
85
  const n = l(t);
80
86
  return n.setHours(23, 59, 59, 999), n;
81
87
  }
82
- function O(t) {
88
+ function E(t) {
83
89
  const n = l(t), e = n.getMonth();
84
90
  return n.setFullYear(n.getFullYear(), e + 1, 0), n.setHours(23, 59, 59, 999), n;
85
91
  }
86
- function E(t) {
92
+ function j(t) {
87
93
  const n = l(t);
88
- return +A(n) == +O(n);
94
+ return +O(n) == +E(n);
89
95
  }
90
- function j(t, n) {
96
+ function H(t, n) {
91
97
  const e = l(t), r = l(n), a = M(e, r), s = Math.abs(
92
- k(e, r)
98
+ N(e, r)
93
99
  );
94
100
  let i;
95
101
  if (s < 1)
@@ -97,15 +103,15 @@ function j(t, n) {
97
103
  else {
98
104
  e.getMonth() === 1 && e.getDate() > 27 && e.setDate(30), e.setMonth(e.getMonth() - a * s);
99
105
  let o = M(e, r) === -a;
100
- E(l(t)) && s === 1 && M(t, r) === 1 && (o = !1), i = a * (s - Number(o));
106
+ j(l(t)) && s === 1 && M(t, r) === 1 && (o = !1), i = a * (s - Number(o));
101
107
  }
102
108
  return i === 0 ? 0 : i;
103
109
  }
104
- function H(t, n, e) {
105
- const r = R(t, n) / 1e3;
106
- return N(e == null ? void 0 : e.roundingMethod)(r);
110
+ function X(t, n, e) {
111
+ const r = A(t, n) / 1e3;
112
+ return R(e == null ? void 0 : e.roundingMethod)(r);
107
113
  }
108
- const X = {
114
+ const z = {
109
115
  lessThanXSeconds: {
110
116
  one: "less than a second",
111
117
  other: "less than {{count}} seconds"
@@ -167,9 +173,9 @@ const X = {
167
173
  one: "almost 1 year",
168
174
  other: "almost {{count}} years"
169
175
  }
170
- }, z = (t, n, e) => {
176
+ }, L = (t, n, e) => {
171
177
  let r;
172
- const a = X[t];
178
+ const a = z[t];
173
179
  return typeof a == "string" ? r = a : n === 1 ? r = a.one : r = a.other.replace("{{count}}", n.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
174
180
  };
175
181
  function v(t) {
@@ -178,42 +184,42 @@ function v(t) {
178
184
  return t.formats[e] || t.formats[t.defaultWidth];
179
185
  };
180
186
  }
181
- const L = {
187
+ const Y = {
182
188
  full: "EEEE, MMMM do, y",
183
189
  long: "MMMM do, y",
184
190
  medium: "MMM d, y",
185
191
  short: "MM/dd/yyyy"
186
- }, Y = {
192
+ }, _ = {
187
193
  full: "h:mm:ss a zzzz",
188
194
  long: "h:mm:ss a z",
189
195
  medium: "h:mm:ss a",
190
196
  short: "h:mm a"
191
- }, _ = {
197
+ }, B = {
192
198
  full: "{{date}} 'at' {{time}}",
193
199
  long: "{{date}} 'at' {{time}}",
194
200
  medium: "{{date}}, {{time}}",
195
201
  short: "{{date}}, {{time}}"
196
202
  }, q = {
197
203
  date: v({
198
- formats: L,
204
+ formats: Y,
199
205
  defaultWidth: "full"
200
206
  }),
201
207
  time: v({
202
- formats: Y,
208
+ formats: _,
203
209
  defaultWidth: "full"
204
210
  }),
205
211
  dateTime: v({
206
- formats: _,
212
+ formats: B,
207
213
  defaultWidth: "full"
208
214
  })
209
- }, B = {
215
+ }, J = {
210
216
  lastWeek: "'last' eeee 'at' p",
211
217
  yesterday: "'yesterday at' p",
212
218
  today: "'today at' p",
213
219
  tomorrow: "'tomorrow at' p",
214
220
  nextWeek: "eeee 'at' p",
215
221
  other: "P"
216
- }, J = (t, n, e, r) => B[t];
222
+ }, U = (t, n, e, r) => J[t];
217
223
  function y(t) {
218
224
  return (n, e) => {
219
225
  const r = e != null && e.context ? String(e.context) : "standalone";
@@ -229,7 +235,7 @@ function y(t) {
229
235
  return a[s];
230
236
  };
231
237
  }
232
- const U = {
238
+ const $ = {
233
239
  narrow: ["B", "A"],
234
240
  abbreviated: ["BC", "AD"],
235
241
  wide: ["Before Christ", "Anno Domini"]
@@ -237,7 +243,7 @@ const U = {
237
243
  narrow: ["1", "2", "3", "4"],
238
244
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
239
245
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
240
- }, $ = {
246
+ }, Q = {
241
247
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
242
248
  abbreviated: [
243
249
  "Jan",
@@ -267,7 +273,7 @@ const U = {
267
273
  "November",
268
274
  "December"
269
275
  ]
270
- }, Q = {
276
+ }, G = {
271
277
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
272
278
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
273
279
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -280,7 +286,7 @@ const U = {
280
286
  "Friday",
281
287
  "Saturday"
282
288
  ]
283
- }, G = {
289
+ }, K = {
284
290
  narrow: {
285
291
  am: "a",
286
292
  pm: "p",
@@ -311,7 +317,7 @@ const U = {
311
317
  evening: "evening",
312
318
  night: "night"
313
319
  }
314
- }, K = {
320
+ }, Z = {
315
321
  narrow: {
316
322
  am: "a",
317
323
  pm: "p",
@@ -342,7 +348,7 @@ const U = {
342
348
  evening: "in the evening",
343
349
  night: "at night"
344
350
  }
345
- }, Z = (t, n) => {
351
+ }, tt = (t, n) => {
346
352
  const e = Number(t), r = e % 100;
347
353
  if (r > 20 || r < 10)
348
354
  switch (r % 10) {
@@ -354,10 +360,10 @@ const U = {
354
360
  return e + "rd";
355
361
  }
356
362
  return e + "th";
357
- }, tt = {
358
- ordinalNumber: Z,
363
+ }, et = {
364
+ ordinalNumber: tt,
359
365
  era: y({
360
- values: U,
366
+ values: $,
361
367
  defaultWidth: "wide"
362
368
  }),
363
369
  quarter: y({
@@ -366,17 +372,17 @@ const U = {
366
372
  argumentCallback: (t) => t - 1
367
373
  }),
368
374
  month: y({
369
- values: $,
375
+ values: Q,
370
376
  defaultWidth: "wide"
371
377
  }),
372
378
  day: y({
373
- values: Q,
379
+ values: G,
374
380
  defaultWidth: "wide"
375
381
  }),
376
382
  dayPeriod: y({
377
- values: G,
383
+ values: K,
378
384
  defaultWidth: "wide",
379
- formattingValues: K,
385
+ formattingValues: Z,
380
386
  defaultFormattingWidth: "wide"
381
387
  })
382
388
  };
@@ -385,9 +391,9 @@ function b(t) {
385
391
  const r = e.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = n.match(a);
386
392
  if (!s)
387
393
  return null;
388
- const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ? nt(o, (m) => m.test(i)) : (
394
+ const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ? at(o, (m) => m.test(i)) : (
389
395
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
390
- et(o, (m) => m.test(i))
396
+ nt(o, (m) => m.test(i))
391
397
  );
392
398
  let u;
393
399
  u = t.valueCallback ? t.valueCallback(c) : c, u = e.valueCallback ? (
@@ -398,17 +404,17 @@ function b(t) {
398
404
  return { value: u, rest: f };
399
405
  };
400
406
  }
401
- function et(t, n) {
407
+ function nt(t, n) {
402
408
  for (const e in t)
403
409
  if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
404
410
  return e;
405
411
  }
406
- function nt(t, n) {
412
+ function at(t, n) {
407
413
  for (let e = 0; e < t.length; e++)
408
414
  if (n(t[e]))
409
415
  return e;
410
416
  }
411
- function at(t) {
417
+ function rt(t) {
412
418
  return (n, e = {}) => {
413
419
  const r = n.match(t.matchPattern);
414
420
  if (!r) return null;
@@ -420,23 +426,23 @@ function at(t) {
420
426
  return { value: i, rest: o };
421
427
  };
422
428
  }
423
- const rt = /^(\d+)(th|st|nd|rd)?/i, ot = /\d+/i, it = {
429
+ const ot = /^(\d+)(th|st|nd|rd)?/i, it = /\d+/i, st = {
424
430
  narrow: /^(b|a)/i,
425
431
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
426
432
  wide: /^(before christ|before common era|anno domini|common era)/i
427
- }, st = {
428
- any: [/^b/i, /^(a|c)/i]
429
433
  }, ct = {
434
+ any: [/^b/i, /^(a|c)/i]
435
+ }, ut = {
430
436
  narrow: /^[1234]/i,
431
437
  abbreviated: /^q[1234]/i,
432
438
  wide: /^[1234](th|st|nd|rd)? quarter/i
433
- }, ut = {
434
- any: [/1/i, /2/i, /3/i, /4/i]
435
439
  }, dt = {
440
+ any: [/1/i, /2/i, /3/i, /4/i]
441
+ }, lt = {
436
442
  narrow: /^[jfmasond]/i,
437
443
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
438
444
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
439
- }, lt = {
445
+ }, ft = {
440
446
  narrow: [
441
447
  /^j/i,
442
448
  /^f/i,
@@ -465,18 +471,18 @@ const rt = /^(\d+)(th|st|nd|rd)?/i, ot = /\d+/i, it = {
465
471
  /^n/i,
466
472
  /^d/i
467
473
  ]
468
- }, ft = {
474
+ }, mt = {
469
475
  narrow: /^[smtwf]/i,
470
476
  short: /^(su|mo|tu|we|th|fr|sa)/i,
471
477
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
472
478
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
473
- }, mt = {
479
+ }, ht = {
474
480
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
475
481
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
476
- }, ht = {
482
+ }, gt = {
477
483
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
478
484
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
479
- }, gt = {
485
+ }, yt = {
480
486
  any: {
481
487
  am: /^a/i,
482
488
  pm: /^p/i,
@@ -487,57 +493,57 @@ const rt = /^(\d+)(th|st|nd|rd)?/i, ot = /\d+/i, it = {
487
493
  evening: /evening/i,
488
494
  night: /night/i
489
495
  }
490
- }, yt = {
491
- ordinalNumber: at({
492
- matchPattern: rt,
493
- parsePattern: ot,
496
+ }, bt = {
497
+ ordinalNumber: rt({
498
+ matchPattern: ot,
499
+ parsePattern: it,
494
500
  valueCallback: (t) => parseInt(t, 10)
495
501
  }),
496
502
  era: b({
497
- matchPatterns: it,
503
+ matchPatterns: st,
498
504
  defaultMatchWidth: "wide",
499
- parsePatterns: st,
505
+ parsePatterns: ct,
500
506
  defaultParseWidth: "any"
501
507
  }),
502
508
  quarter: b({
503
- matchPatterns: ct,
509
+ matchPatterns: ut,
504
510
  defaultMatchWidth: "wide",
505
- parsePatterns: ut,
511
+ parsePatterns: dt,
506
512
  defaultParseWidth: "any",
507
513
  valueCallback: (t) => t + 1
508
514
  }),
509
515
  month: b({
510
- matchPatterns: dt,
516
+ matchPatterns: lt,
511
517
  defaultMatchWidth: "wide",
512
- parsePatterns: lt,
518
+ parsePatterns: ft,
513
519
  defaultParseWidth: "any"
514
520
  }),
515
521
  day: b({
516
- matchPatterns: ft,
522
+ matchPatterns: mt,
517
523
  defaultMatchWidth: "wide",
518
- parsePatterns: mt,
524
+ parsePatterns: ht,
519
525
  defaultParseWidth: "any"
520
526
  }),
521
527
  dayPeriod: b({
522
- matchPatterns: ht,
528
+ matchPatterns: gt,
523
529
  defaultMatchWidth: "any",
524
- parsePatterns: gt,
530
+ parsePatterns: yt,
525
531
  defaultParseWidth: "any"
526
532
  })
527
- }, bt = {
533
+ }, wt = {
528
534
  code: "en-US",
529
- formatDistance: z,
535
+ formatDistance: L,
530
536
  formatLong: q,
531
- formatRelative: J,
532
- localize: tt,
533
- match: yt,
537
+ formatRelative: U,
538
+ localize: et,
539
+ match: bt,
534
540
  options: {
535
541
  weekStartsOn: 0,
536
542
  firstWeekContainsDate: 1
537
543
  }
538
544
  };
539
- function wt(t, n, e) {
540
- const r = C(), a = (e == null ? void 0 : e.locale) ?? r.locale ?? bt, s = 2520, i = M(t, n);
545
+ function Mt(t, n, e) {
546
+ const r = k(), a = (e == null ? void 0 : e.locale) ?? r.locale ?? wt, s = 2520, i = M(t, n);
541
547
  if (isNaN(i))
542
548
  throw new RangeError("Invalid time value");
543
549
  const o = Object.assign({}, e, {
@@ -546,7 +552,7 @@ function wt(t, n, e) {
546
552
  });
547
553
  let c, u;
548
554
  i > 0 ? (c = l(n), u = l(t)) : (c = l(t), u = l(n));
549
- const f = H(u, c), m = (P(u) - P(c)) / 1e3, d = Math.round((f - m) / 60);
555
+ const f = X(u, c), m = (P(u) - P(c)) / 1e3, d = Math.round((f - m) / 60);
550
556
  let h;
551
557
  if (d < 2)
552
558
  return e != null && e.includeSeconds ? f < 5 ? a.formatDistance("lessThanXSeconds", 5, o) : f < 10 ? a.formatDistance("lessThanXSeconds", 10, o) : f < 20 ? a.formatDistance("lessThanXSeconds", 20, o) : f < 40 ? a.formatDistance("halfAMinute", 0, o) : f < 60 ? a.formatDistance("lessThanXMinutes", 1, o) : a.formatDistance("xMinutes", 1, o) : d === 0 ? a.formatDistance("lessThanXMinutes", 1, o) : a.formatDistance("xMinutes", d, o);
@@ -554,19 +560,19 @@ function wt(t, n, e) {
554
560
  return a.formatDistance("xMinutes", d, o);
555
561
  if (d < 90)
556
562
  return a.formatDistance("aboutXHours", 1, o);
557
- if (d < D) {
563
+ if (d < x) {
558
564
  const g = Math.round(d / 60);
559
565
  return a.formatDistance("aboutXHours", g, o);
560
566
  } else {
561
567
  if (d < s)
562
568
  return a.formatDistance("xDays", 1, o);
563
569
  if (d < w) {
564
- const g = Math.round(d / D);
570
+ const g = Math.round(d / x);
565
571
  return a.formatDistance("xDays", g, o);
566
572
  } else if (d < w * 2)
567
573
  return h = Math.round(d / w), a.formatDistance("aboutXMonths", h, o);
568
574
  }
569
- if (h = j(u, c), h < 12) {
575
+ if (h = H(u, c), h < 12) {
570
576
  const g = Math.round(d / w);
571
577
  return a.formatDistance("xMonths", g, o);
572
578
  } else {
@@ -574,31 +580,31 @@ function wt(t, n, e) {
574
580
  return g < 3 ? a.formatDistance("aboutXYears", p, o) : g < 9 ? a.formatDistance("overXYears", p, o) : a.formatDistance("almostXYears", p + 1, o);
575
581
  }
576
582
  }
577
- const Ot = (t = 0, n = 0) => {
583
+ const jt = (t = 0, n = 0) => {
578
584
  if (t >= n) return "0s";
579
585
  const e = Math.floor((n - t) / 1e3), r = Math.floor(e / 3600), a = Math.floor(e % 3600 / 60), s = e % 60, i = [];
580
586
  return r > 0 && i.push(`${r}h`), a > 0 && i.push(`${a}m`), (s > 0 || i.length === 0) && i.push(`${s}s`), i.join(" ");
581
- }, Et = (t, n = "ms") => {
587
+ }, Ht = (t, n = "ms") => {
582
588
  if (!t) return "0s";
583
589
  let e, r = 0;
584
590
  if (n === "ms" ? (e = Math.floor(t / 1e3), e === 0 && (r = t)) : (e = Math.floor(t / 1e9), e === 0 && (r = t % 1e9 / 1e6)), e === 0)
585
591
  return r > 0 ? new Intl.NumberFormat().format(r) + "ms" : "0s";
586
592
  const a = Math.floor(e / 3600), s = Math.floor(e % 3600 / 60), i = e % 60, o = [];
587
593
  return a > 0 && o.push(new Intl.NumberFormat().format(a) + "h"), s > 0 && o.push(new Intl.NumberFormat().format(s) + "m"), i > 0 && o.push(new Intl.NumberFormat().format(i) + "s"), o.join(" ") || "0s";
588
- }, jt = (t) => new Intl.DateTimeFormat("en-GB", {
594
+ }, Xt = (t) => new Intl.DateTimeFormat("en-GB", {
589
595
  hour: "2-digit",
590
596
  minute: "2-digit",
591
597
  second: "2-digit",
592
598
  fractionalSecondDigits: 3,
593
599
  hour12: !1
594
- }).format(new Date(t)), Ht = (t) => t.toLocaleTimeString("en-US", {
600
+ }).format(new Date(t)), zt = (t) => t.toLocaleTimeString("en-US", {
595
601
  hour: "numeric",
596
602
  minute: "2-digit",
597
603
  hour12: !0
598
604
  }).toLowerCase();
599
- var x, I;
600
- const S = ((I = (x = Intl.NumberFormat()).resolvedOptions) == null ? void 0 : I.call(x).locale) || "en-US";
601
- function Xt(t, n = "medium") {
605
+ var I, W;
606
+ const S = ((W = (I = Intl.NumberFormat()).resolvedOptions) == null ? void 0 : W.call(I).locale) || "en-US";
607
+ function Lt(t, n = "medium") {
602
608
  if (!t) return "";
603
609
  try {
604
610
  return new Intl.DateTimeFormat(S, { dateStyle: n }).format(new Date(t));
@@ -606,18 +612,18 @@ function Xt(t, n = "medium") {
606
612
  return console.error(`Failed to format date: ${e}`), "";
607
613
  }
608
614
  }
609
- const zt = (t = 0, n = 0, e = !1) => {
615
+ const Yt = (t = 0, n = 0, e = !1) => {
610
616
  if (!t && !n) return "0 seconds";
611
- const r = wt(t, n, {
617
+ const r = Mt(t, n, {
612
618
  includeSeconds: !0,
613
619
  addSuffix: !1
614
620
  });
615
621
  return e ? r.split(" ").slice(0, 2).join(" ") : r;
616
622
  };
617
- function Lt(t) {
623
+ function _t(t) {
618
624
  return new Intl.NumberFormat(S).format(t);
619
625
  }
620
- const Yt = (t, n = S) => {
626
+ const Bt = (t, n = S) => {
621
627
  if (!t)
622
628
  return "";
623
629
  try {
@@ -648,13 +654,13 @@ const Yt = (t, n = S) => {
648
654
  } catch (e) {
649
655
  return console.warn("Intl API error:", e), "";
650
656
  }
651
- }, _t = (t) => {
652
- if (W(t)) {
657
+ }, qt = (t) => {
658
+ if (T(t)) {
653
659
  const n = t.type;
654
660
  if (typeof n != "string")
655
661
  return n.displayName;
656
662
  }
657
- }, qt = (t, n = 2) => {
663
+ }, Jt = (t, n = 2) => {
658
664
  let e = !1;
659
665
  const r = () => {
660
666
  requestAnimationFrame(() => {
@@ -664,13 +670,13 @@ const Yt = (t, n = S) => {
664
670
  return r(), () => {
665
671
  e = !0;
666
672
  };
667
- }, Bt = (t) => {
673
+ }, Ut = (t) => {
668
674
  const n = t.getRootNode();
669
675
  return {
670
676
  isShadowRoot: n instanceof ShadowRoot,
671
677
  activeEl: n instanceof ShadowRoot ? n.activeElement : document.activeElement
672
678
  };
673
- }, Mt = [
679
+ }, pt = [
674
680
  "direction",
675
681
  "boxSizing",
676
682
  "width",
@@ -702,15 +708,15 @@ const Yt = (t, n = S) => {
702
708
  "wordSpacing",
703
709
  "tabSize",
704
710
  "MozTabSize"
705
- ], pt = typeof window < "u" && "mozInnerScreenX" in window;
706
- function vt(t) {
711
+ ], vt = typeof window < "u" && "mozInnerScreenX" in window;
712
+ function St(t) {
707
713
  return {
708
714
  caretStartIndex: t.selectionStart || 0,
709
715
  caretEndIndex: t.selectionEnd || 0
710
716
  };
711
717
  }
712
- function Jt(t) {
713
- const n = t.value, { caretStartIndex: e } = vt(t);
718
+ function $t(t) {
719
+ const n = t.value, { caretStartIndex: e } = St(t);
714
720
  let r = e;
715
721
  for (; r > 0 && n[r - 1].match(/\S/); )
716
722
  r--;
@@ -719,7 +725,7 @@ function Jt(t) {
719
725
  a++;
720
726
  return n.substring(r, a);
721
727
  }
722
- function Ut(t, n) {
728
+ function Vt(t, n) {
723
729
  const e = t.value, r = t.selectionStart, a = /[\w@#]+/g;
724
730
  let s, i, o;
725
731
  for (; (s = a.exec(e)) !== null && (i = s.index, o = i + s[0].length, !(r >= i && r <= o)); )
@@ -732,14 +738,14 @@ function Ut(t, n) {
732
738
  );
733
739
  }
734
740
  }
735
- function Vt(t, n) {
741
+ function Qt(t, n) {
736
742
  var u;
737
743
  const e = document.querySelector("#input-textarea-caret-position-mirror-div");
738
744
  e && ((u = e.parentNode) == null || u.removeChild(e));
739
745
  const r = document.createElement("div");
740
746
  r.id = "input-textarea-caret-position-mirror-div", document.body.appendChild(r);
741
747
  const a = r.style, s = window.getComputedStyle(t), i = t.nodeName === "INPUT";
742
- a.whiteSpace = "pre-wrap", i || (a.wordWrap = "break-word"), a.position = "absolute", a.visibility = "hidden", Mt.forEach(function(f) {
748
+ a.whiteSpace = "pre-wrap", i || (a.wordWrap = "break-word"), a.position = "absolute", a.visibility = "hidden", pt.forEach(function(f) {
743
749
  if (i && f === "lineHeight")
744
750
  if (s.boxSizing === "border-box") {
745
751
  const m = parseInt(s.height), d = parseInt(s.paddingTop) + parseInt(s.paddingBottom) + parseInt(s.borderTopWidth) + parseInt(s.borderBottomWidth), h = d + parseInt(s.lineHeight);
@@ -748,7 +754,7 @@ function Vt(t, n) {
748
754
  a.lineHeight = s.height;
749
755
  else
750
756
  a[f] = s[f];
751
- }), pt ? t.scrollHeight > parseInt(s.height) && (a.overflowY = "scroll") : a.overflow = "hidden", r.textContent = t.value.substring(0, n), i && (r.textContent = r.textContent.replace(/\s/g, " "));
757
+ }), vt ? t.scrollHeight > parseInt(s.height) && (a.overflowY = "scroll") : a.overflow = "hidden", r.textContent = t.value.substring(0, n), i && (r.textContent = r.textContent.replace(/\s/g, " "));
752
758
  const o = document.createElement("span");
753
759
  o.textContent = t.value.substring(n) || "", r.appendChild(o);
754
760
  const c = {
@@ -759,41 +765,42 @@ function Vt(t, n) {
759
765
  return document.body.removeChild(r), c;
760
766
  }
761
767
  export {
762
- Et as A,
763
- Lt as B,
764
- Ht as C,
765
- jt as D,
766
- vt as E,
767
- Ot as F,
768
- Tt as G,
769
- zt as H,
768
+ Lt as A,
769
+ Ht as B,
770
+ _t as C,
771
+ zt as D,
772
+ Xt as E,
773
+ St as F,
774
+ jt as G,
775
+ Ct as H,
776
+ Yt as I,
770
777
  S as L,
771
- T,
778
+ F as T,
772
779
  P as a,
773
- kt as b,
774
- Ft as c,
775
- Nt as d,
776
- Ct as e,
777
- bt as f,
778
- C as g,
779
- At as h,
780
- Wt as i,
781
- Bt as j,
782
- qt as k,
783
- _t as l,
784
- Rt as m,
780
+ Rt as b,
781
+ kt as c,
782
+ At as d,
783
+ Nt as e,
784
+ wt as f,
785
+ k as g,
786
+ Et as h,
787
+ Ft as i,
788
+ Ut as j,
789
+ Jt as k,
790
+ qt as l,
791
+ Ot as m,
785
792
  Pt as n,
786
- Dt as o,
787
- O as p,
788
- k as q,
789
- xt as r,
790
- Yt as s,
793
+ xt as o,
794
+ E as p,
795
+ N as q,
796
+ It as r,
797
+ Bt as s,
791
798
  l as t,
792
- Jt as u,
793
- Vt as v,
794
- Ut as w,
795
- wt as x,
796
- It as y,
797
- Xt as z
799
+ Tt as u,
800
+ $t as v,
801
+ Qt as w,
802
+ Vt as x,
803
+ Mt as y,
804
+ Wt as z
798
805
  };
799
- //# sourceMappingURL=textarea-utils-Da1SLvaV.js.map
806
+ //# sourceMappingURL=textarea-utils-CWb0r4jC.js.map