@harnessio/ui 0.5.38 → 0.5.40
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/components.d.ts +4 -1
- package/dist/components.js +1 -1
- package/dist/{index-uDAAzb4G.js → index-D0SEOfHL.js} +8527 -8498
- package/dist/{index-uDAAzb4G.js.map → index-D0SEOfHL.js.map} +1 -1
- package/dist/{index-TEMkwCmP.js → index-F1mc0sEF.js} +54 -52
- package/dist/{index-TEMkwCmP.js.map → index-F1mc0sEF.js.map} +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/tailwind.config.js +255 -216
- package/dist/tailwind.config.js.map +1 -1
- package/dist/{textarea-utils-BABZsh7u.js → textarea-utils-CquwOLUe.js} +149 -147
- package/dist/textarea-utils-CquwOLUe.js.map +1 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.js +31 -29
- package/package.json +1 -1
- package/dist/textarea-utils-BABZsh7u.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useCallback as W, isValidElement as
|
|
2
|
-
const
|
|
1
|
+
import { useCallback as W, isValidElement as T } from "react";
|
|
2
|
+
const F = 6, Pt = (t) => (t ?? "").slice(0, F), xt = (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
|
-
},
|
|
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,22 +18,22 @@ const Dt = (t, n = 2) => {
|
|
|
18
18
|
} else
|
|
19
19
|
e[a] = a, r[a] = !1;
|
|
20
20
|
return { data: e, metadata: r };
|
|
21
|
-
},
|
|
21
|
+
}, Wt = (t, n, e, r = !1) => {
|
|
22
22
|
const a = t === 1 ? n : e;
|
|
23
23
|
return r ? `${t} ${a}` : a;
|
|
24
24
|
};
|
|
25
|
-
function
|
|
25
|
+
function Tt(t, n) {
|
|
26
26
|
const e = typeof t;
|
|
27
27
|
return n.includes(e);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Ft(t, n) {
|
|
30
30
|
const e = {}, r = { ...t };
|
|
31
31
|
for (const a of n)
|
|
32
32
|
a in t && (e[a] = t[a], delete r[a]);
|
|
33
33
|
return { picked: e, rest: r };
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
35
|
+
const Ct = (t, n) => !t || !n ? {} : t, kt = (t, n) => !t || !n ? [] : t;
|
|
36
|
+
function Nt(t) {
|
|
37
37
|
return W(
|
|
38
38
|
(n) => {
|
|
39
39
|
t.forEach((e) => {
|
|
@@ -58,13 +58,13 @@ function l(t) {
|
|
|
58
58
|
const n = Object.prototype.toString.call(t);
|
|
59
59
|
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);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Rt(t, n) {
|
|
62
62
|
return t instanceof Date ? new t.constructor(n) : new Date(n);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
function
|
|
67
|
-
return
|
|
64
|
+
const At = 6048e5, Et = 864e5, Ot = 6e4, jt = 36e5, Ht = 1e3, w = 43200, D = 1440;
|
|
65
|
+
let C = {};
|
|
66
|
+
function k() {
|
|
67
|
+
return C;
|
|
68
68
|
}
|
|
69
69
|
function P(t) {
|
|
70
70
|
const n = l(t), e = new Date(
|
|
@@ -84,34 +84,34 @@ function p(t, n) {
|
|
|
84
84
|
const e = l(t), r = l(n), a = e.getTime() - r.getTime();
|
|
85
85
|
return a < 0 ? -1 : a > 0 ? 1 : a;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function N(t, n) {
|
|
88
88
|
const e = l(t), r = l(n), a = e.getFullYear() - r.getFullYear(), s = e.getMonth() - r.getMonth();
|
|
89
89
|
return a * 12 + s;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function R(t) {
|
|
92
92
|
return (n) => {
|
|
93
93
|
const r = (t ? Math[t] : Math.trunc)(n);
|
|
94
94
|
return r === 0 ? 0 : r;
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function A(t, n) {
|
|
98
98
|
return +l(t) - +l(n);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function E(t) {
|
|
101
101
|
const n = l(t);
|
|
102
102
|
return n.setHours(23, 59, 59, 999), n;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function O(t) {
|
|
105
105
|
const n = l(t), e = n.getMonth();
|
|
106
106
|
return n.setFullYear(n.getFullYear(), e + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function j(t) {
|
|
109
109
|
const n = l(t);
|
|
110
|
-
return +
|
|
110
|
+
return +E(n) == +O(n);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function H(t, n) {
|
|
113
113
|
const e = l(t), r = l(n), a = p(e, r), s = Math.abs(
|
|
114
|
-
|
|
114
|
+
N(e, r)
|
|
115
115
|
);
|
|
116
116
|
let i;
|
|
117
117
|
if (s < 1)
|
|
@@ -119,15 +119,15 @@ function j(t, n) {
|
|
|
119
119
|
else {
|
|
120
120
|
e.getMonth() === 1 && e.getDate() > 27 && e.setDate(30), e.setMonth(e.getMonth() - a * s);
|
|
121
121
|
let o = p(e, r) === -a;
|
|
122
|
-
|
|
122
|
+
j(l(t)) && s === 1 && p(t, r) === 1 && (o = !1), i = a * (s - Number(o));
|
|
123
123
|
}
|
|
124
124
|
return i === 0 ? 0 : i;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
const r =
|
|
128
|
-
return
|
|
126
|
+
function X(t, n, e) {
|
|
127
|
+
const r = A(t, n) / 1e3;
|
|
128
|
+
return R(e == null ? void 0 : e.roundingMethod)(r);
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const z = {
|
|
131
131
|
lessThanXSeconds: {
|
|
132
132
|
one: "less than a second",
|
|
133
133
|
other: "less than {{count}} seconds"
|
|
@@ -189,9 +189,9 @@ const X = {
|
|
|
189
189
|
one: "almost 1 year",
|
|
190
190
|
other: "almost {{count}} years"
|
|
191
191
|
}
|
|
192
|
-
},
|
|
192
|
+
}, L = (t, n, e) => {
|
|
193
193
|
let r;
|
|
194
|
-
const a =
|
|
194
|
+
const a = z[t];
|
|
195
195
|
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;
|
|
196
196
|
};
|
|
197
197
|
function v(t) {
|
|
@@ -200,42 +200,42 @@ function v(t) {
|
|
|
200
200
|
return t.formats[e] || t.formats[t.defaultWidth];
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const Y = {
|
|
204
204
|
full: "EEEE, MMMM do, y",
|
|
205
205
|
long: "MMMM do, y",
|
|
206
206
|
medium: "MMM d, y",
|
|
207
207
|
short: "MM/dd/yyyy"
|
|
208
|
-
},
|
|
208
|
+
}, _ = {
|
|
209
209
|
full: "h:mm:ss a zzzz",
|
|
210
210
|
long: "h:mm:ss a z",
|
|
211
211
|
medium: "h:mm:ss a",
|
|
212
212
|
short: "h:mm a"
|
|
213
|
-
},
|
|
213
|
+
}, q = {
|
|
214
214
|
full: "{{date}} 'at' {{time}}",
|
|
215
215
|
long: "{{date}} 'at' {{time}}",
|
|
216
216
|
medium: "{{date}}, {{time}}",
|
|
217
217
|
short: "{{date}}, {{time}}"
|
|
218
|
-
},
|
|
218
|
+
}, B = {
|
|
219
219
|
date: v({
|
|
220
|
-
formats:
|
|
220
|
+
formats: Y,
|
|
221
221
|
defaultWidth: "full"
|
|
222
222
|
}),
|
|
223
223
|
time: v({
|
|
224
|
-
formats:
|
|
224
|
+
formats: _,
|
|
225
225
|
defaultWidth: "full"
|
|
226
226
|
}),
|
|
227
227
|
dateTime: v({
|
|
228
|
-
formats:
|
|
228
|
+
formats: q,
|
|
229
229
|
defaultWidth: "full"
|
|
230
230
|
})
|
|
231
|
-
},
|
|
231
|
+
}, J = {
|
|
232
232
|
lastWeek: "'last' eeee 'at' p",
|
|
233
233
|
yesterday: "'yesterday at' p",
|
|
234
234
|
today: "'today at' p",
|
|
235
235
|
tomorrow: "'tomorrow at' p",
|
|
236
236
|
nextWeek: "eeee 'at' p",
|
|
237
237
|
other: "P"
|
|
238
|
-
},
|
|
238
|
+
}, U = (t, n, e, r) => J[t];
|
|
239
239
|
function y(t) {
|
|
240
240
|
return (n, e) => {
|
|
241
241
|
const r = e != null && e.context ? String(e.context) : "standalone";
|
|
@@ -251,15 +251,15 @@ function y(t) {
|
|
|
251
251
|
return a[s];
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
const
|
|
254
|
+
const V = {
|
|
255
255
|
narrow: ["B", "A"],
|
|
256
256
|
abbreviated: ["BC", "AD"],
|
|
257
257
|
wide: ["Before Christ", "Anno Domini"]
|
|
258
|
-
},
|
|
258
|
+
}, $ = {
|
|
259
259
|
narrow: ["1", "2", "3", "4"],
|
|
260
260
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
261
261
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
262
|
-
},
|
|
262
|
+
}, Q = {
|
|
263
263
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
264
264
|
abbreviated: [
|
|
265
265
|
"Jan",
|
|
@@ -289,7 +289,7 @@ const U = {
|
|
|
289
289
|
"November",
|
|
290
290
|
"December"
|
|
291
291
|
]
|
|
292
|
-
},
|
|
292
|
+
}, G = {
|
|
293
293
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
294
294
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
295
295
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -302,7 +302,7 @@ const U = {
|
|
|
302
302
|
"Friday",
|
|
303
303
|
"Saturday"
|
|
304
304
|
]
|
|
305
|
-
},
|
|
305
|
+
}, K = {
|
|
306
306
|
narrow: {
|
|
307
307
|
am: "a",
|
|
308
308
|
pm: "p",
|
|
@@ -333,7 +333,7 @@ const U = {
|
|
|
333
333
|
evening: "evening",
|
|
334
334
|
night: "night"
|
|
335
335
|
}
|
|
336
|
-
},
|
|
336
|
+
}, Z = {
|
|
337
337
|
narrow: {
|
|
338
338
|
am: "a",
|
|
339
339
|
pm: "p",
|
|
@@ -364,7 +364,7 @@ const U = {
|
|
|
364
364
|
evening: "in the evening",
|
|
365
365
|
night: "at night"
|
|
366
366
|
}
|
|
367
|
-
},
|
|
367
|
+
}, tt = (t, n) => {
|
|
368
368
|
const e = Number(t), r = e % 100;
|
|
369
369
|
if (r > 20 || r < 10)
|
|
370
370
|
switch (r % 10) {
|
|
@@ -376,29 +376,29 @@ const U = {
|
|
|
376
376
|
return e + "rd";
|
|
377
377
|
}
|
|
378
378
|
return e + "th";
|
|
379
|
-
},
|
|
380
|
-
ordinalNumber:
|
|
379
|
+
}, et = {
|
|
380
|
+
ordinalNumber: tt,
|
|
381
381
|
era: y({
|
|
382
|
-
values:
|
|
382
|
+
values: V,
|
|
383
383
|
defaultWidth: "wide"
|
|
384
384
|
}),
|
|
385
385
|
quarter: y({
|
|
386
|
-
values:
|
|
386
|
+
values: $,
|
|
387
387
|
defaultWidth: "wide",
|
|
388
388
|
argumentCallback: (t) => t - 1
|
|
389
389
|
}),
|
|
390
390
|
month: y({
|
|
391
|
-
values:
|
|
391
|
+
values: Q,
|
|
392
392
|
defaultWidth: "wide"
|
|
393
393
|
}),
|
|
394
394
|
day: y({
|
|
395
|
-
values:
|
|
395
|
+
values: G,
|
|
396
396
|
defaultWidth: "wide"
|
|
397
397
|
}),
|
|
398
398
|
dayPeriod: y({
|
|
399
|
-
values:
|
|
399
|
+
values: K,
|
|
400
400
|
defaultWidth: "wide",
|
|
401
|
-
formattingValues:
|
|
401
|
+
formattingValues: Z,
|
|
402
402
|
defaultFormattingWidth: "wide"
|
|
403
403
|
})
|
|
404
404
|
};
|
|
@@ -407,9 +407,9 @@ function b(t) {
|
|
|
407
407
|
const r = e.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = n.match(a);
|
|
408
408
|
if (!s)
|
|
409
409
|
return null;
|
|
410
|
-
const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ?
|
|
410
|
+
const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ? at(o, (m) => m.test(i)) : (
|
|
411
411
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
412
|
-
|
|
412
|
+
nt(o, (m) => m.test(i))
|
|
413
413
|
);
|
|
414
414
|
let u;
|
|
415
415
|
u = t.valueCallback ? t.valueCallback(c) : c, u = e.valueCallback ? (
|
|
@@ -420,17 +420,17 @@ function b(t) {
|
|
|
420
420
|
return { value: u, rest: f };
|
|
421
421
|
};
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function nt(t, n) {
|
|
424
424
|
for (const e in t)
|
|
425
425
|
if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
|
|
426
426
|
return e;
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function at(t, n) {
|
|
429
429
|
for (let e = 0; e < t.length; e++)
|
|
430
430
|
if (n(t[e]))
|
|
431
431
|
return e;
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function rt(t) {
|
|
434
434
|
return (n, e = {}) => {
|
|
435
435
|
const r = n.match(t.matchPattern);
|
|
436
436
|
if (!r) return null;
|
|
@@ -442,23 +442,23 @@ function at(t) {
|
|
|
442
442
|
return { value: i, rest: o };
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const ot = /^(\d+)(th|st|nd|rd)?/i, it = /\d+/i, st = {
|
|
446
446
|
narrow: /^(b|a)/i,
|
|
447
447
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
448
448
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
449
|
-
}, st = {
|
|
450
|
-
any: [/^b/i, /^(a|c)/i]
|
|
451
449
|
}, ct = {
|
|
450
|
+
any: [/^b/i, /^(a|c)/i]
|
|
451
|
+
}, ut = {
|
|
452
452
|
narrow: /^[1234]/i,
|
|
453
453
|
abbreviated: /^q[1234]/i,
|
|
454
454
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
455
|
-
}, ut = {
|
|
456
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
457
455
|
}, dt = {
|
|
456
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
457
|
+
}, lt = {
|
|
458
458
|
narrow: /^[jfmasond]/i,
|
|
459
459
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
460
460
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
461
|
-
},
|
|
461
|
+
}, ft = {
|
|
462
462
|
narrow: [
|
|
463
463
|
/^j/i,
|
|
464
464
|
/^f/i,
|
|
@@ -487,18 +487,18 @@ const rt = /^(\d+)(th|st|nd|rd)?/i, ot = /\d+/i, it = {
|
|
|
487
487
|
/^n/i,
|
|
488
488
|
/^d/i
|
|
489
489
|
]
|
|
490
|
-
},
|
|
490
|
+
}, mt = {
|
|
491
491
|
narrow: /^[smtwf]/i,
|
|
492
492
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
493
493
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
494
494
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
495
|
-
},
|
|
495
|
+
}, ht = {
|
|
496
496
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
497
497
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
498
|
-
},
|
|
498
|
+
}, gt = {
|
|
499
499
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
500
500
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
501
|
-
},
|
|
501
|
+
}, yt = {
|
|
502
502
|
any: {
|
|
503
503
|
am: /^a/i,
|
|
504
504
|
pm: /^p/i,
|
|
@@ -509,57 +509,57 @@ const rt = /^(\d+)(th|st|nd|rd)?/i, ot = /\d+/i, it = {
|
|
|
509
509
|
evening: /evening/i,
|
|
510
510
|
night: /night/i
|
|
511
511
|
}
|
|
512
|
-
},
|
|
513
|
-
ordinalNumber:
|
|
514
|
-
matchPattern:
|
|
515
|
-
parsePattern:
|
|
512
|
+
}, bt = {
|
|
513
|
+
ordinalNumber: rt({
|
|
514
|
+
matchPattern: ot,
|
|
515
|
+
parsePattern: it,
|
|
516
516
|
valueCallback: (t) => parseInt(t, 10)
|
|
517
517
|
}),
|
|
518
518
|
era: b({
|
|
519
|
-
matchPatterns:
|
|
519
|
+
matchPatterns: st,
|
|
520
520
|
defaultMatchWidth: "wide",
|
|
521
|
-
parsePatterns:
|
|
521
|
+
parsePatterns: ct,
|
|
522
522
|
defaultParseWidth: "any"
|
|
523
523
|
}),
|
|
524
524
|
quarter: b({
|
|
525
|
-
matchPatterns:
|
|
525
|
+
matchPatterns: ut,
|
|
526
526
|
defaultMatchWidth: "wide",
|
|
527
|
-
parsePatterns:
|
|
527
|
+
parsePatterns: dt,
|
|
528
528
|
defaultParseWidth: "any",
|
|
529
529
|
valueCallback: (t) => t + 1
|
|
530
530
|
}),
|
|
531
531
|
month: b({
|
|
532
|
-
matchPatterns:
|
|
532
|
+
matchPatterns: lt,
|
|
533
533
|
defaultMatchWidth: "wide",
|
|
534
|
-
parsePatterns:
|
|
534
|
+
parsePatterns: ft,
|
|
535
535
|
defaultParseWidth: "any"
|
|
536
536
|
}),
|
|
537
537
|
day: b({
|
|
538
|
-
matchPatterns:
|
|
538
|
+
matchPatterns: mt,
|
|
539
539
|
defaultMatchWidth: "wide",
|
|
540
|
-
parsePatterns:
|
|
540
|
+
parsePatterns: ht,
|
|
541
541
|
defaultParseWidth: "any"
|
|
542
542
|
}),
|
|
543
543
|
dayPeriod: b({
|
|
544
|
-
matchPatterns:
|
|
544
|
+
matchPatterns: gt,
|
|
545
545
|
defaultMatchWidth: "any",
|
|
546
|
-
parsePatterns:
|
|
546
|
+
parsePatterns: yt,
|
|
547
547
|
defaultParseWidth: "any"
|
|
548
548
|
})
|
|
549
|
-
},
|
|
549
|
+
}, wt = {
|
|
550
550
|
code: "en-US",
|
|
551
|
-
formatDistance:
|
|
552
|
-
formatLong:
|
|
553
|
-
formatRelative:
|
|
554
|
-
localize:
|
|
555
|
-
match:
|
|
551
|
+
formatDistance: L,
|
|
552
|
+
formatLong: B,
|
|
553
|
+
formatRelative: U,
|
|
554
|
+
localize: et,
|
|
555
|
+
match: bt,
|
|
556
556
|
options: {
|
|
557
557
|
weekStartsOn: 0,
|
|
558
558
|
firstWeekContainsDate: 1
|
|
559
559
|
}
|
|
560
560
|
};
|
|
561
|
-
function
|
|
562
|
-
const r =
|
|
561
|
+
function pt(t, n, e) {
|
|
562
|
+
const r = k(), a = (e == null ? void 0 : e.locale) ?? r.locale ?? wt, s = 2520, i = p(t, n);
|
|
563
563
|
if (isNaN(i))
|
|
564
564
|
throw new RangeError("Invalid time value");
|
|
565
565
|
const o = Object.assign({}, e, {
|
|
@@ -568,7 +568,7 @@ function wt(t, n, e) {
|
|
|
568
568
|
});
|
|
569
569
|
let c, u;
|
|
570
570
|
i > 0 ? (c = l(n), u = l(t)) : (c = l(t), u = l(n));
|
|
571
|
-
const f =
|
|
571
|
+
const f = X(u, c), m = (P(u) - P(c)) / 1e3, d = Math.round((f - m) / 60);
|
|
572
572
|
let h;
|
|
573
573
|
if (d < 2)
|
|
574
574
|
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);
|
|
@@ -588,7 +588,7 @@ function wt(t, n, e) {
|
|
|
588
588
|
} else if (d < w * 2)
|
|
589
589
|
return h = Math.round(d / w), a.formatDistance("aboutXMonths", h, o);
|
|
590
590
|
}
|
|
591
|
-
if (h =
|
|
591
|
+
if (h = H(u, c), h < 12) {
|
|
592
592
|
const g = Math.round(d / w);
|
|
593
593
|
return a.formatDistance("xMonths", g, o);
|
|
594
594
|
} else {
|
|
@@ -596,31 +596,31 @@ function wt(t, n, e) {
|
|
|
596
596
|
return g < 3 ? a.formatDistance("aboutXYears", M, o) : g < 9 ? a.formatDistance("overXYears", M, o) : a.formatDistance("almostXYears", M + 1, o);
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
const
|
|
599
|
+
const Xt = (t = 0, n = 0) => {
|
|
600
600
|
if (t >= n) return "0s";
|
|
601
601
|
const e = Math.floor((n - t) / 1e3), r = Math.floor(e / 3600), a = Math.floor(e % 3600 / 60), s = e % 60, i = [];
|
|
602
602
|
return r > 0 && i.push(`${r}h`), a > 0 && i.push(`${a}m`), (s > 0 || i.length === 0) && i.push(`${s}s`), i.join(" ");
|
|
603
|
-
},
|
|
603
|
+
}, zt = (t, n = "ms") => {
|
|
604
604
|
if (!t) return "0s";
|
|
605
605
|
let e, r = 0;
|
|
606
606
|
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)
|
|
607
607
|
return r > 0 ? new Intl.NumberFormat().format(r) + "ms" : "0s";
|
|
608
608
|
const a = Math.floor(e / 3600), s = Math.floor(e % 3600 / 60), i = e % 60, o = [];
|
|
609
609
|
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";
|
|
610
|
-
},
|
|
610
|
+
}, Lt = (t) => new Intl.DateTimeFormat("en-GB", {
|
|
611
611
|
hour: "2-digit",
|
|
612
612
|
minute: "2-digit",
|
|
613
613
|
second: "2-digit",
|
|
614
614
|
fractionalSecondDigits: 3,
|
|
615
615
|
hour12: !1
|
|
616
|
-
}).format(new Date(t)),
|
|
616
|
+
}).format(new Date(t)), Yt = (t) => t.toLocaleTimeString("en-US", {
|
|
617
617
|
hour: "numeric",
|
|
618
618
|
minute: "2-digit",
|
|
619
619
|
hour12: !0
|
|
620
620
|
}).toLowerCase();
|
|
621
621
|
var x, I;
|
|
622
622
|
const S = ((I = (x = Intl.NumberFormat()).resolvedOptions) == null ? void 0 : I.call(x).locale) || "en-US";
|
|
623
|
-
function
|
|
623
|
+
function _t(t, n = "medium") {
|
|
624
624
|
if (!t) return "";
|
|
625
625
|
try {
|
|
626
626
|
return new Intl.DateTimeFormat(S, { dateStyle: n }).format(new Date(t));
|
|
@@ -628,18 +628,18 @@ function Lt(t, n = "medium") {
|
|
|
628
628
|
return console.error(`Failed to format date: ${e}`), "";
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
const
|
|
631
|
+
const qt = (t = 0, n = 0, e = !1) => {
|
|
632
632
|
if (!t && !n) return "0 seconds";
|
|
633
|
-
const r =
|
|
633
|
+
const r = pt(t, n, {
|
|
634
634
|
includeSeconds: !0,
|
|
635
635
|
addSuffix: !1
|
|
636
636
|
});
|
|
637
637
|
return e ? r.split(" ").slice(0, 2).join(" ") : r;
|
|
638
638
|
};
|
|
639
|
-
function
|
|
639
|
+
function Bt(t) {
|
|
640
640
|
return new Intl.NumberFormat(S).format(t);
|
|
641
641
|
}
|
|
642
|
-
const
|
|
642
|
+
const Jt = (t, n = S) => {
|
|
643
643
|
if (!t)
|
|
644
644
|
return "";
|
|
645
645
|
try {
|
|
@@ -670,13 +670,13 @@ const qt = (t, n = S) => {
|
|
|
670
670
|
} catch (e) {
|
|
671
671
|
return console.warn("Intl API error:", e), "";
|
|
672
672
|
}
|
|
673
|
-
},
|
|
674
|
-
if (
|
|
673
|
+
}, Ut = (t) => {
|
|
674
|
+
if (T(t)) {
|
|
675
675
|
const n = t.type;
|
|
676
676
|
if (typeof n != "string")
|
|
677
677
|
return n.displayName;
|
|
678
678
|
}
|
|
679
|
-
},
|
|
679
|
+
}, Vt = (t, n = 2) => {
|
|
680
680
|
let e = !1;
|
|
681
681
|
const r = () => {
|
|
682
682
|
requestAnimationFrame(() => {
|
|
@@ -686,13 +686,13 @@ const qt = (t, n = S) => {
|
|
|
686
686
|
return r(), () => {
|
|
687
687
|
e = !0;
|
|
688
688
|
};
|
|
689
|
-
},
|
|
689
|
+
}, $t = (t) => {
|
|
690
690
|
const n = t.getRootNode();
|
|
691
691
|
return {
|
|
692
692
|
isShadowRoot: n instanceof ShadowRoot,
|
|
693
693
|
activeEl: n instanceof ShadowRoot ? n.activeElement : document.activeElement
|
|
694
694
|
};
|
|
695
|
-
},
|
|
695
|
+
}, Mt = [
|
|
696
696
|
"direction",
|
|
697
697
|
"boxSizing",
|
|
698
698
|
"width",
|
|
@@ -724,15 +724,15 @@ const qt = (t, n = S) => {
|
|
|
724
724
|
"wordSpacing",
|
|
725
725
|
"tabSize",
|
|
726
726
|
"MozTabSize"
|
|
727
|
-
],
|
|
728
|
-
function
|
|
727
|
+
], vt = typeof window < "u" && "mozInnerScreenX" in window;
|
|
728
|
+
function St(t) {
|
|
729
729
|
return {
|
|
730
730
|
caretStartIndex: t.selectionStart || 0,
|
|
731
731
|
caretEndIndex: t.selectionEnd || 0
|
|
732
732
|
};
|
|
733
733
|
}
|
|
734
|
-
function
|
|
735
|
-
const n = t.value, { caretStartIndex: e } =
|
|
734
|
+
function Qt(t) {
|
|
735
|
+
const n = t.value, { caretStartIndex: e } = St(t);
|
|
736
736
|
let r = e;
|
|
737
737
|
for (; r > 0 && n[r - 1].match(/\S/); )
|
|
738
738
|
r--;
|
|
@@ -741,7 +741,7 @@ function Vt(t) {
|
|
|
741
741
|
a++;
|
|
742
742
|
return n.substring(r, a);
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Gt(t, n) {
|
|
745
745
|
const e = t.value, r = t.selectionStart, a = /[\w@#]+/g;
|
|
746
746
|
let s, i, o;
|
|
747
747
|
for (; (s = a.exec(e)) !== null && (i = s.index, o = i + s[0].length, !(r >= i && r <= o)); )
|
|
@@ -754,14 +754,14 @@ function $t(t, n) {
|
|
|
754
754
|
);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Kt(t, n) {
|
|
758
758
|
var u;
|
|
759
759
|
const e = document.querySelector("#input-textarea-caret-position-mirror-div");
|
|
760
760
|
e && ((u = e.parentNode) == null || u.removeChild(e));
|
|
761
761
|
const r = document.createElement("div");
|
|
762
762
|
r.id = "input-textarea-caret-position-mirror-div", document.body.appendChild(r);
|
|
763
763
|
const a = r.style, s = window.getComputedStyle(t), i = t.nodeName === "INPUT";
|
|
764
|
-
a.whiteSpace = "pre-wrap", i || (a.wordWrap = "break-word"), a.position = "absolute", a.visibility = "hidden",
|
|
764
|
+
a.whiteSpace = "pre-wrap", i || (a.wordWrap = "break-word"), a.position = "absolute", a.visibility = "hidden", Mt.forEach(function(f) {
|
|
765
765
|
if (i && f === "lineHeight")
|
|
766
766
|
if (s.boxSizing === "border-box") {
|
|
767
767
|
const m = parseInt(s.height), d = parseInt(s.paddingTop) + parseInt(s.paddingBottom) + parseInt(s.borderTopWidth) + parseInt(s.borderBottomWidth), h = d + parseInt(s.lineHeight);
|
|
@@ -770,7 +770,7 @@ function Qt(t, n) {
|
|
|
770
770
|
a.lineHeight = s.height;
|
|
771
771
|
else
|
|
772
772
|
a[f] = s[f];
|
|
773
|
-
}),
|
|
773
|
+
}), 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, " "));
|
|
774
774
|
const o = document.createElement("span");
|
|
775
775
|
o.textContent = t.value.substring(n) || "", r.appendChild(o);
|
|
776
776
|
const c = {
|
|
@@ -781,42 +781,44 @@ function Qt(t, n) {
|
|
|
781
781
|
return document.body.removeChild(r), c;
|
|
782
782
|
}
|
|
783
783
|
export {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
784
|
+
pt as A,
|
|
785
|
+
Wt as B,
|
|
786
|
+
_t as C,
|
|
787
|
+
zt as D,
|
|
788
|
+
Bt as E,
|
|
789
|
+
Yt as F,
|
|
790
|
+
Lt as G,
|
|
791
|
+
St as H,
|
|
792
|
+
Xt as I,
|
|
793
|
+
Ft as J,
|
|
794
|
+
qt as K,
|
|
794
795
|
S as L,
|
|
796
|
+
F as T,
|
|
795
797
|
P as a,
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
798
|
+
At as b,
|
|
799
|
+
Rt as c,
|
|
800
|
+
jt as d,
|
|
801
|
+
wt as e,
|
|
800
802
|
Ot as f,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
803
|
+
k as g,
|
|
804
|
+
Ht as h,
|
|
805
|
+
Tt as i,
|
|
806
|
+
$t as j,
|
|
807
|
+
Vt as k,
|
|
808
|
+
Ut as l,
|
|
809
|
+
Et as m,
|
|
810
|
+
xt as n,
|
|
811
|
+
kt as o,
|
|
812
|
+
Pt as p,
|
|
813
|
+
O as q,
|
|
814
|
+
N as r,
|
|
815
|
+
It as s,
|
|
814
816
|
l as t,
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
817
|
+
Nt as u,
|
|
818
|
+
Jt as v,
|
|
819
|
+
Ct as w,
|
|
818
820
|
Qt as x,
|
|
819
|
-
|
|
820
|
-
|
|
821
|
+
Kt as y,
|
|
822
|
+
Gt as z
|
|
821
823
|
};
|
|
822
|
-
//# sourceMappingURL=textarea-utils-
|
|
824
|
+
//# sourceMappingURL=textarea-utils-CquwOLUe.js.map
|