@music-lyric-player/base 0.14.0 → 0.16.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.
- package/README.md +1 -0
- package/dist/index.comm.js +1 -1
- package/dist/index.comm.js.map +1 -1
- package/dist/index.ecma.d.ts +23 -5
- package/dist/index.ecma.js +1273 -824
- package/dist/index.ecma.js.map +1 -1
- package/package.json +3 -3
package/dist/index.ecma.js
CHANGED
|
@@ -1,191 +1,674 @@
|
|
|
1
|
-
import { freezeObjectDeep as
|
|
2
|
-
|
|
3
|
-
const Wt = or({
|
|
1
|
+
import { freezeObjectDeep as mr, ConfigManager as dr, Event as pr } from "@music-lyric-player/utils";
|
|
2
|
+
const Ht = mr({
|
|
4
3
|
driver: "animation",
|
|
5
4
|
bridgeActive: !0,
|
|
6
5
|
mergeWindow: 300,
|
|
6
|
+
mergeLimit: 3,
|
|
7
7
|
offset: {
|
|
8
8
|
global: 0,
|
|
9
9
|
useMeta: !0,
|
|
10
10
|
resetTempOnLyricChange: !0
|
|
11
11
|
}
|
|
12
|
-
}),
|
|
12
|
+
}), os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13
13
|
__proto__: null,
|
|
14
|
-
DEFAULT:
|
|
15
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
DEFAULT: Ht
|
|
15
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
16
|
+
var zt = /* @__PURE__ */ ((r) => (r.ChineseSimplified = "zh-hans", r.ChineseTraditional = "zh-hant", r.English = "en", r.Japanese = "ja", r.Korean = "ko", r.Russian = "ru", r.French = "fr", r.German = "de", r.Spanish = "es", r.Italian = "it", r.Portuguese = "pt", r))(zt || {});
|
|
17
|
+
class Er {
|
|
18
|
+
/**
|
|
19
|
+
* Language tag.
|
|
20
|
+
*/
|
|
21
|
+
tag;
|
|
22
|
+
/**
|
|
23
|
+
* Share within the lyric, ranging from 0 to 100.
|
|
24
|
+
* Recommended to be computed from word-level language counts.
|
|
25
|
+
*/
|
|
26
|
+
percent;
|
|
27
|
+
constructor(e = {}) {
|
|
28
|
+
this.tag = e.tag ?? "", this.percent = e.percent ?? 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
class Yt {
|
|
32
|
+
/**
|
|
33
|
+
* All languages with their shares.
|
|
34
|
+
*
|
|
35
|
+
* Shares are a snapshot filled by the language transform; stale after lines change.
|
|
36
|
+
*/
|
|
37
|
+
list;
|
|
38
|
+
constructor(e = {}) {
|
|
39
|
+
this.list = e.list ?? [];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Whether a language of the given tag is present.
|
|
43
|
+
*/
|
|
44
|
+
has(e) {
|
|
45
|
+
return this.list.some((t) => t.tag === e);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The language entry of the given tag.
|
|
49
|
+
*/
|
|
50
|
+
byType(e) {
|
|
51
|
+
return this.list.find((t) => t.tag === e);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The language with the highest share.
|
|
55
|
+
*/
|
|
56
|
+
get primary() {
|
|
57
|
+
let e;
|
|
58
|
+
for (let t = 0, n = this.list.length; t < n; t++)
|
|
59
|
+
(!e || this.list[t].percent > e.percent) && (e = this.list[t]);
|
|
60
|
+
return e;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
class Kt {
|
|
64
|
+
/**
|
|
65
|
+
* Start time in milliseconds.
|
|
66
|
+
*/
|
|
67
|
+
start;
|
|
68
|
+
/**
|
|
69
|
+
* End time in milliseconds.
|
|
70
|
+
*/
|
|
71
|
+
end;
|
|
72
|
+
constructor(e = 0, t = 0) {
|
|
73
|
+
this.start = e, this.end = t;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Duration in milliseconds, derived from end minus start.
|
|
77
|
+
*/
|
|
27
78
|
get duration() {
|
|
28
79
|
return this.end - this.start;
|
|
29
80
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
81
|
+
}
|
|
82
|
+
class gr {
|
|
83
|
+
/**
|
|
84
|
+
* Time range of the token.
|
|
85
|
+
*/
|
|
86
|
+
time;
|
|
87
|
+
/**
|
|
88
|
+
* Text content of the token.
|
|
89
|
+
*/
|
|
90
|
+
content;
|
|
91
|
+
constructor(e = {}) {
|
|
92
|
+
this.time = e.time, this.content = e.content ?? "";
|
|
36
93
|
}
|
|
37
94
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
95
|
+
class ze {
|
|
96
|
+
/**
|
|
97
|
+
* Time range of the item, independent from its words.
|
|
98
|
+
*/
|
|
99
|
+
time;
|
|
100
|
+
/**
|
|
101
|
+
* Tokens composing the item in order.
|
|
102
|
+
*/
|
|
103
|
+
words;
|
|
104
|
+
/**
|
|
105
|
+
* Language or transliteration scheme of this item.
|
|
106
|
+
* Should be set when multiple languages coexist, since line-level aggregation groups items by it.
|
|
107
|
+
*/
|
|
108
|
+
language;
|
|
109
|
+
constructor(e = {}) {
|
|
110
|
+
this.time = e.time, this.words = e.words ?? [], this.language = e.language;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Flat text joined from every word.
|
|
114
|
+
*
|
|
115
|
+
* Live: recomputed on each access.
|
|
116
|
+
*/
|
|
117
|
+
get content() {
|
|
118
|
+
let e = "";
|
|
119
|
+
for (let t = 0, n = this.words.length; t < n; t++)
|
|
120
|
+
e += this.words[t].content;
|
|
121
|
+
return e;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
class Rr extends ze {
|
|
125
|
+
/**
|
|
126
|
+
* Whether this ruby marks the start of a phrase.
|
|
127
|
+
*/
|
|
128
|
+
phraseStart;
|
|
129
|
+
constructor(e = {}) {
|
|
130
|
+
super(e), this.phraseStart = e.phraseStart ?? !1;
|
|
131
|
+
}
|
|
41
132
|
}
|
|
42
|
-
class
|
|
133
|
+
class vr extends ze {
|
|
134
|
+
/**
|
|
135
|
+
* Original annotation type name.
|
|
136
|
+
*/
|
|
137
|
+
key;
|
|
138
|
+
constructor(e = {}) {
|
|
139
|
+
super(e), this.key = e.key ?? "";
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
class Ir {
|
|
143
|
+
/**
|
|
144
|
+
* Ruby annotation such as furigana.
|
|
145
|
+
*/
|
|
146
|
+
ruby;
|
|
147
|
+
/**
|
|
148
|
+
* Romanized transliterations.
|
|
149
|
+
*/
|
|
150
|
+
romans;
|
|
151
|
+
/**
|
|
152
|
+
* Unknown annotations keyed by their original type name.
|
|
153
|
+
*/
|
|
154
|
+
unknowns;
|
|
155
|
+
constructor(e = {}) {
|
|
156
|
+
this.ruby = e.ruby, this.romans = e.romans, this.unknowns = e.unknowns;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
var k = /* @__PURE__ */ ((r) => (r.Normal = "Normal", r.Space = "Space", r))(k || {});
|
|
160
|
+
class $r {
|
|
161
|
+
/**
|
|
162
|
+
* Discriminant marking this as a normal word.
|
|
163
|
+
*/
|
|
43
164
|
type = "Normal";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Time range of the word.
|
|
167
|
+
*/
|
|
168
|
+
time;
|
|
169
|
+
/**
|
|
170
|
+
* Text content of the word.
|
|
171
|
+
*/
|
|
172
|
+
content;
|
|
173
|
+
/**
|
|
174
|
+
* Language of this word.
|
|
175
|
+
*/
|
|
176
|
+
language;
|
|
177
|
+
/**
|
|
178
|
+
* Annotations attached to this word.
|
|
179
|
+
*/
|
|
180
|
+
annotation;
|
|
181
|
+
/**
|
|
182
|
+
* Whether the word is stressed.
|
|
183
|
+
*/
|
|
184
|
+
stress;
|
|
185
|
+
constructor(e = {}) {
|
|
186
|
+
this.time = e.time, this.content = e.content ?? "", this.language = e.language, this.annotation = e.annotation, this.stress = e.stress ?? !1;
|
|
187
|
+
}
|
|
48
188
|
}
|
|
49
|
-
class
|
|
189
|
+
class Lr {
|
|
190
|
+
/**
|
|
191
|
+
* Discriminant marking this as a space.
|
|
192
|
+
*/
|
|
50
193
|
type = "Space";
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Number of consecutive space characters.
|
|
196
|
+
*/
|
|
197
|
+
count;
|
|
198
|
+
constructor(e = {}) {
|
|
199
|
+
this.count = e.count ?? 1;
|
|
200
|
+
}
|
|
57
201
|
}
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
202
|
+
var Zt = /* @__PURE__ */ ((r) => (r.Ruby = "Ruby", r.Roman = "Roman", r.Translate = "Translate", r.Unknown = "Unknown", r))(Zt || {});
|
|
203
|
+
const Tr = [
|
|
204
|
+
"Ruby",
|
|
205
|
+
"Roman",
|
|
206
|
+
"Unknown"
|
|
207
|
+
/* Unknown */
|
|
208
|
+
];
|
|
209
|
+
class Jt {
|
|
210
|
+
/**
|
|
211
|
+
* All annotation items in order.
|
|
212
|
+
*
|
|
213
|
+
* Derived items are a snapshot from `deriveLineAnnotation`; re-run it after words change.
|
|
214
|
+
*/
|
|
215
|
+
list;
|
|
216
|
+
constructor(e = {}) {
|
|
217
|
+
this.list = e.list ?? [];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Whether any item of a kind exists.
|
|
221
|
+
*/
|
|
222
|
+
has(e) {
|
|
223
|
+
return this.list.some((t) => t.kind === e);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* All items of a kind.
|
|
227
|
+
*/
|
|
228
|
+
all(e) {
|
|
229
|
+
return this.list.filter((t) => t.kind === e);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The first item of a kind, preferring a language match then falling back to the first.
|
|
233
|
+
*/
|
|
234
|
+
first(e, t) {
|
|
235
|
+
const n = this.all(e);
|
|
236
|
+
if (t !== void 0) {
|
|
237
|
+
const i = n.find((c) => c.language === t);
|
|
238
|
+
if (i)
|
|
239
|
+
return i;
|
|
240
|
+
}
|
|
241
|
+
return n[0];
|
|
242
|
+
}
|
|
63
243
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
244
|
+
const H = (r, e) => ({
|
|
245
|
+
derived: !1,
|
|
246
|
+
...e,
|
|
247
|
+
kind: r
|
|
248
|
+
}), se = (r, e, t, n) => {
|
|
249
|
+
const i = [];
|
|
250
|
+
for (let o = 0, h = r.length; o < h; o++) {
|
|
251
|
+
const a = r[o];
|
|
252
|
+
if (a.type === k.Space)
|
|
253
|
+
continue;
|
|
254
|
+
const l = e(a);
|
|
255
|
+
if (l)
|
|
256
|
+
for (const s of l) {
|
|
257
|
+
const u = t(s);
|
|
258
|
+
i.includes(u) || i.push(u);
|
|
259
|
+
}
|
|
69
260
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
261
|
+
const c = [];
|
|
262
|
+
for (const o of i) {
|
|
263
|
+
let h = "", a = 0, l, s = !1;
|
|
264
|
+
for (let u = 0, f = r.length; u < f; u++) {
|
|
265
|
+
const E = r[u];
|
|
266
|
+
if (E.type === k.Space) {
|
|
267
|
+
a += E.count;
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
const S = e(E)?.find((d) => t(d) === o);
|
|
271
|
+
S && (s && (h += " ".repeat(a)), h += S.content, l ??= S.language, a = 0, s = !0);
|
|
272
|
+
}
|
|
273
|
+
s && c.push(n(o, h, l));
|
|
274
|
+
}
|
|
275
|
+
return c;
|
|
276
|
+
}, Nr = (r) => {
|
|
277
|
+
const { words: e, annotation: t } = r;
|
|
278
|
+
for (const n of Tr) {
|
|
279
|
+
const i = t.list.some((o) => o.kind === n && !o.derived);
|
|
280
|
+
if (t.list = t.list.filter((o) => !(o.kind === n && o.derived)), i)
|
|
281
|
+
continue;
|
|
282
|
+
let c;
|
|
283
|
+
switch (n) {
|
|
284
|
+
case "Ruby":
|
|
285
|
+
c = se(
|
|
286
|
+
e,
|
|
287
|
+
(o) => {
|
|
288
|
+
const h = o.annotation?.ruby;
|
|
289
|
+
return h ? [h] : void 0;
|
|
290
|
+
},
|
|
291
|
+
() => "",
|
|
292
|
+
(o, h, a) => H("Ruby", { content: h, language: a, derived: !0 })
|
|
293
|
+
);
|
|
294
|
+
break;
|
|
295
|
+
case "Roman":
|
|
296
|
+
c = se(
|
|
297
|
+
e,
|
|
298
|
+
(o) => o.annotation?.romans,
|
|
299
|
+
(o) => o.language ?? "",
|
|
300
|
+
(o, h) => H("Roman", { content: h, language: o || void 0, derived: !0 })
|
|
301
|
+
);
|
|
302
|
+
break;
|
|
303
|
+
default:
|
|
304
|
+
c = se(
|
|
305
|
+
e,
|
|
306
|
+
(o) => o.annotation?.unknowns,
|
|
307
|
+
(o) => o.key,
|
|
308
|
+
(o, h, a) => H("Unknown", { content: h, language: a, key: o, derived: !0 })
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
t.list.push(...c);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
var Qt = /* @__PURE__ */ ((r) => (r.Normal = "Normal", r.Interlude = "Interlude", r))(Qt || {});
|
|
315
|
+
class er {
|
|
316
|
+
/**
|
|
317
|
+
* Time range of the line.
|
|
318
|
+
*/
|
|
319
|
+
time;
|
|
320
|
+
constructor(e = {}) {
|
|
321
|
+
this.time = e.time ?? new Kt();
|
|
76
322
|
}
|
|
77
323
|
}
|
|
78
|
-
class
|
|
324
|
+
class tr extends er {
|
|
325
|
+
/**
|
|
326
|
+
* Discriminant marking this as a normal line.
|
|
327
|
+
*/
|
|
79
328
|
type = "Normal";
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
329
|
+
/**
|
|
330
|
+
* Performing agent of this line.
|
|
331
|
+
*/
|
|
83
332
|
agent;
|
|
333
|
+
/**
|
|
334
|
+
* Words composing the line in order.
|
|
335
|
+
*/
|
|
336
|
+
words;
|
|
337
|
+
/**
|
|
338
|
+
* Annotations applied to the whole line, derived from words unless set explicitly.
|
|
339
|
+
*/
|
|
340
|
+
annotation;
|
|
341
|
+
constructor(e = {}) {
|
|
342
|
+
super(e), this.agent = e.agent, this.words = e.words ?? [], this.annotation = e.annotation ?? new Jt(), e.languages && (this.languages = e.languages);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Plain text of the line joined from every word.
|
|
346
|
+
*
|
|
347
|
+
* Live: recomputed from words on each access.
|
|
348
|
+
*/
|
|
349
|
+
get original() {
|
|
350
|
+
let e = "";
|
|
351
|
+
for (let t = 0, n = this.words.length; t < n; t++) {
|
|
352
|
+
const i = this.words[t];
|
|
353
|
+
e += i.type === k.Normal ? i.content : " ".repeat(i.count);
|
|
354
|
+
}
|
|
355
|
+
return e;
|
|
356
|
+
}
|
|
357
|
+
#e;
|
|
358
|
+
/**
|
|
359
|
+
* Language tags of this line: the explicit value, otherwise live-collected from words on each access.
|
|
360
|
+
*/
|
|
361
|
+
get languages() {
|
|
362
|
+
if (this.#e?.length)
|
|
363
|
+
return this.#e;
|
|
364
|
+
const e = /* @__PURE__ */ new Set();
|
|
365
|
+
for (let t = 0, n = this.words.length; t < n; t++) {
|
|
366
|
+
const i = this.words[t];
|
|
367
|
+
i.type === k.Normal && i.language && e.add(i.language);
|
|
368
|
+
}
|
|
369
|
+
return [...e];
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Override the words-derived languages with explicit tags.
|
|
373
|
+
*/
|
|
374
|
+
set languages(e) {
|
|
375
|
+
this.#e = e;
|
|
376
|
+
}
|
|
84
377
|
}
|
|
85
|
-
class
|
|
86
|
-
|
|
87
|
-
|
|
378
|
+
class Sr extends tr {
|
|
379
|
+
/**
|
|
380
|
+
* Background lines attached to this line.
|
|
381
|
+
*/
|
|
88
382
|
background;
|
|
383
|
+
constructor(e = {}) {
|
|
384
|
+
super(e), this.background = e.background;
|
|
385
|
+
}
|
|
89
386
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
type = "Offset";
|
|
96
|
-
content = 0;
|
|
97
|
-
}
|
|
98
|
-
class Rr extends F {
|
|
99
|
-
type = "Duration";
|
|
100
|
-
content = 0;
|
|
101
|
-
}
|
|
102
|
-
class vr extends F {
|
|
103
|
-
type = "Title";
|
|
104
|
-
content = "";
|
|
105
|
-
}
|
|
106
|
-
class Ir extends F {
|
|
107
|
-
type = "Singer";
|
|
108
|
-
content = "";
|
|
387
|
+
class Or extends er {
|
|
388
|
+
/**
|
|
389
|
+
* Discriminant marking this as an interlude line.
|
|
390
|
+
*/
|
|
391
|
+
type = "Interlude";
|
|
109
392
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
393
|
+
var rr = /* @__PURE__ */ ((r) => (r.Offset = "Offset", r.Duration = "Duration", r.Title = "Title", r.Singer = "Singer", r.Album = "Album", r.Creator = "Creator", r.Author = "Author", r.Isrc = "Isrc", r.Unknown = "Unknown", r))(rr || {});
|
|
394
|
+
const Ar = (r, e, t) => ({
|
|
395
|
+
type: r,
|
|
396
|
+
key: e,
|
|
397
|
+
value: t
|
|
398
|
+
});
|
|
399
|
+
class sr {
|
|
400
|
+
/**
|
|
401
|
+
* All meta entries in order.
|
|
402
|
+
*/
|
|
403
|
+
list;
|
|
404
|
+
constructor(e = {}) {
|
|
405
|
+
this.list = e.list ?? [];
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Whether any entry of a meta type exists.
|
|
409
|
+
*/
|
|
410
|
+
has(e) {
|
|
411
|
+
return this.list.some((t) => t.type === e);
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* All entries of a meta type.
|
|
415
|
+
*/
|
|
416
|
+
all(e) {
|
|
417
|
+
return this.list.filter((t) => t.type === e);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* The first entry of a meta type.
|
|
421
|
+
*/
|
|
422
|
+
first(e) {
|
|
423
|
+
return this.list.find((t) => t.type === e);
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* All entries with the given original key.
|
|
427
|
+
*/
|
|
428
|
+
byKey(e) {
|
|
429
|
+
return this.list.filter((t) => t.key === e);
|
|
430
|
+
}
|
|
113
431
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
432
|
+
var nr = /* @__PURE__ */ ((r) => (r.Person = "Person", r.Group = "Group", r.Other = "Other", r.Unknown = "Unknown", r))(nr || {});
|
|
433
|
+
class wr {
|
|
434
|
+
/**
|
|
435
|
+
* Unique identifier of the agent.
|
|
436
|
+
*/
|
|
437
|
+
id;
|
|
438
|
+
/**
|
|
439
|
+
* Performing type of the agent.
|
|
440
|
+
*/
|
|
441
|
+
type;
|
|
442
|
+
/**
|
|
443
|
+
* Number of lines performed by this agent.
|
|
444
|
+
*
|
|
445
|
+
* Snapshot filled by `calcAgentIndex` at parse time; stale after lines change.
|
|
446
|
+
*/
|
|
447
|
+
count;
|
|
448
|
+
/**
|
|
449
|
+
* Display names of the agent; a group may carry more than one.
|
|
450
|
+
*/
|
|
451
|
+
names;
|
|
452
|
+
constructor(e = {}) {
|
|
453
|
+
this.id = e.id ?? "", this.type = e.type ?? "Unknown", this.count = e.count ?? 0, this.names = e.names ?? [];
|
|
454
|
+
}
|
|
120
455
|
}
|
|
121
|
-
class
|
|
122
|
-
|
|
123
|
-
|
|
456
|
+
class yr {
|
|
457
|
+
/**
|
|
458
|
+
* Identifier of the referenced agent.
|
|
459
|
+
*/
|
|
460
|
+
id;
|
|
461
|
+
/**
|
|
462
|
+
* Index of this agent occurrence among all lines.
|
|
463
|
+
*
|
|
464
|
+
* Snapshot filled by `calcAgentIndex` at parse time.
|
|
465
|
+
*/
|
|
466
|
+
globalIndex;
|
|
467
|
+
/**
|
|
468
|
+
* Index of this agent occurrence within its block.
|
|
469
|
+
*
|
|
470
|
+
* Snapshot filled by `calcAgentIndex` at parse time.
|
|
471
|
+
*/
|
|
472
|
+
blockIndex;
|
|
473
|
+
constructor(e = {}) {
|
|
474
|
+
this.id = e.id ?? "", this.globalIndex = e.globalIndex ?? 0, this.blockIndex = e.blockIndex ?? 0;
|
|
475
|
+
}
|
|
124
476
|
}
|
|
125
|
-
class
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
477
|
+
class ir {
|
|
478
|
+
/**
|
|
479
|
+
* All agents in order.
|
|
480
|
+
*/
|
|
481
|
+
list;
|
|
482
|
+
constructor(e = {}) {
|
|
483
|
+
this.list = e.list ?? [];
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Whether any agent of a type exists.
|
|
487
|
+
*/
|
|
488
|
+
has(e) {
|
|
489
|
+
return this.list.some((t) => t.type === e);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* All agents of a type.
|
|
493
|
+
*/
|
|
494
|
+
all(e) {
|
|
495
|
+
return this.list.filter((t) => t.type === e);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* The agent with the given id, used to resolve a LineAgent reference.
|
|
499
|
+
*/
|
|
500
|
+
byId(e) {
|
|
501
|
+
return this.list.find((t) => t.id === e);
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* The agent performing the most lines.
|
|
505
|
+
*/
|
|
506
|
+
get primary() {
|
|
507
|
+
let e;
|
|
508
|
+
for (let t = 0, n = this.list.length; t < n; t++)
|
|
509
|
+
(!e || this.list[t].count > e.count) && (e = this.list[t]);
|
|
510
|
+
return e;
|
|
511
|
+
}
|
|
129
512
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
513
|
+
const ar = "0.9.0";
|
|
514
|
+
var or = /* @__PURE__ */ ((r) => (r.Invalid = "Invalid", r.Empty = "Empty", r.Normal = "Normal", r))(or || {}), lr = /* @__PURE__ */ ((r) => (r.None = "None", r.Line = "Line", r.Syllable = "Syllable", r))(lr || {});
|
|
515
|
+
class Cr {
|
|
516
|
+
/**
|
|
517
|
+
* Schema version of this data model.
|
|
518
|
+
*/
|
|
519
|
+
version = ar;
|
|
520
|
+
/**
|
|
521
|
+
* Overall classification of the lyric.
|
|
522
|
+
*/
|
|
523
|
+
type;
|
|
524
|
+
/**
|
|
525
|
+
* Timing precision of the lyric.
|
|
526
|
+
*/
|
|
527
|
+
timing;
|
|
528
|
+
/**
|
|
529
|
+
* Metadata of the lyric.
|
|
530
|
+
*/
|
|
531
|
+
meta;
|
|
532
|
+
/**
|
|
533
|
+
* Language distribution of the lyric.
|
|
534
|
+
*/
|
|
535
|
+
language;
|
|
536
|
+
/**
|
|
537
|
+
* Performing agents referenced by lines.
|
|
538
|
+
*/
|
|
539
|
+
agent;
|
|
540
|
+
/**
|
|
541
|
+
* Lyric lines in order.
|
|
542
|
+
*/
|
|
543
|
+
lines;
|
|
544
|
+
constructor(e = {}) {
|
|
545
|
+
this.type = e.type ?? "Invalid", this.timing = e.timing ?? "None", this.meta = e.meta ?? new sr(), this.language = e.language ?? new Yt(), this.agent = e.agent ?? new ir(), this.lines = e.lines ?? [];
|
|
546
|
+
}
|
|
148
547
|
}
|
|
149
548
|
const X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
150
549
|
__proto__: null,
|
|
151
|
-
Agent:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
Info:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
550
|
+
Agent: ir,
|
|
551
|
+
AgentItem: wr,
|
|
552
|
+
AgentType: nr,
|
|
553
|
+
Info: Cr,
|
|
554
|
+
InfoTiming: lr,
|
|
555
|
+
InfoType: or,
|
|
556
|
+
Language: Yt,
|
|
557
|
+
LanguageItem: Er,
|
|
558
|
+
LanguageType: zt,
|
|
559
|
+
LineAgent: yr,
|
|
560
|
+
LineAnnotation: Jt,
|
|
561
|
+
LineAnnotationKind: Zt,
|
|
562
|
+
LineInterlude: Or,
|
|
563
|
+
LineNormal: Sr,
|
|
564
|
+
LineNormalBase: tr,
|
|
565
|
+
LineType: Qt,
|
|
566
|
+
Meta: sr,
|
|
567
|
+
MetaType: rr,
|
|
568
|
+
Time: Kt,
|
|
569
|
+
Version: ar,
|
|
570
|
+
WordAnnotation: Ir,
|
|
571
|
+
WordAnnotationContent: gr,
|
|
572
|
+
WordAnnotationItem: ze,
|
|
573
|
+
WordNormal: $r,
|
|
574
|
+
WordRubyAnnotation: Rr,
|
|
575
|
+
WordSpace: Lr,
|
|
576
|
+
WordType: k,
|
|
577
|
+
WordUnknownAnnotation: vr,
|
|
578
|
+
createLineAnnotationItem: H,
|
|
579
|
+
createMetaItem: Ar,
|
|
580
|
+
deriveLineAnnotation: Nr
|
|
177
581
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
582
|
+
class Pr {
|
|
583
|
+
lines = [];
|
|
584
|
+
mergedEnd = [];
|
|
585
|
+
/**
|
|
586
|
+
* Raw deactivation time of a line: the later of its own end and the next line's start.
|
|
587
|
+
*
|
|
588
|
+
* The final line never deactivates, and out-of-range indices resolve to 0.
|
|
589
|
+
*/
|
|
590
|
+
getRawTime(e) {
|
|
591
|
+
const t = this.lines;
|
|
592
|
+
return e < 0 || e >= t.length ? 0 : e === t.length - 1 ? 1 / 0 : Math.max(t[e].time.end, t[e + 1].time.start);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Rebuild the merged end-time table from the given lines and merge settings.
|
|
596
|
+
*/
|
|
597
|
+
build(e, t, n) {
|
|
598
|
+
this.lines = e;
|
|
599
|
+
const i = e.length, c = new Array(i);
|
|
600
|
+
if (i === 0) {
|
|
601
|
+
this.mergedEnd = c;
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
const o = Math.max(0, t), h = n > 0 ? n : 1 / 0;
|
|
605
|
+
let a = this.getRawTime(i - 1);
|
|
606
|
+
c[i - 1] = a;
|
|
607
|
+
let l = 1;
|
|
608
|
+
for (let s = i - 2; s >= 0; s--) {
|
|
609
|
+
const u = this.getRawTime(s);
|
|
610
|
+
o > 0 && l < h && Math.abs(a - u) < o ? (c[s] = Math.max(u, c[s + 1]), l++) : (c[s] = u, l = 1), a = u;
|
|
611
|
+
}
|
|
612
|
+
this.mergedEnd = c;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Merged deactivation time of a line, falling back to the raw time when unbuilt.
|
|
616
|
+
*/
|
|
617
|
+
getMergedTime(e) {
|
|
618
|
+
const t = this.mergedEnd[e];
|
|
619
|
+
return t === void 0 ? this.getRawTime(e) : t;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
class qr {
|
|
623
|
+
temp = 0;
|
|
624
|
+
meta = 0;
|
|
625
|
+
setTemp(e) {
|
|
626
|
+
this.temp = Number.isFinite(e) ? e : 0;
|
|
627
|
+
}
|
|
628
|
+
resetTemp() {
|
|
629
|
+
this.temp = 0;
|
|
630
|
+
}
|
|
631
|
+
refreshFromMeta(e, t) {
|
|
632
|
+
if (!t) {
|
|
633
|
+
this.meta = 0;
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
const n = e.meta.first(X.MetaType.Offset)?.value;
|
|
637
|
+
this.meta = typeof n == "number" && Number.isFinite(n) ? n : 0;
|
|
638
|
+
}
|
|
639
|
+
resolve(e) {
|
|
640
|
+
const t = e + this.meta + this.temp;
|
|
641
|
+
return Number.isFinite(t) ? t : 0;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
class br {
|
|
645
|
+
frameId = null;
|
|
646
|
+
timerId = null;
|
|
647
|
+
schedule(e, t) {
|
|
648
|
+
switch (e) {
|
|
649
|
+
case "animation":
|
|
650
|
+
this.frameId = globalThis.requestAnimationFrame(t);
|
|
651
|
+
break;
|
|
652
|
+
case "timer":
|
|
653
|
+
this.timerId = globalThis.setTimeout(t, 16);
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
cancel() {
|
|
658
|
+
this.frameId !== null && (globalThis.cancelAnimationFrame(this.frameId), this.frameId = null), this.timerId !== null && (globalThis.clearTimeout(this.timerId), this.timerId = null);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
var W = { exports: {} }, ne, tt;
|
|
662
|
+
function z() {
|
|
663
|
+
if (tt) return ne;
|
|
181
664
|
tt = 1;
|
|
182
|
-
const
|
|
183
|
-
9007199254740991, n = 16, i =
|
|
184
|
-
return
|
|
185
|
-
MAX_LENGTH:
|
|
665
|
+
const r = "2.0.0", e = 256, t = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
666
|
+
9007199254740991, n = 16, i = e - 6;
|
|
667
|
+
return ne = {
|
|
668
|
+
MAX_LENGTH: e,
|
|
186
669
|
MAX_SAFE_COMPONENT_LENGTH: n,
|
|
187
670
|
MAX_SAFE_BUILD_LENGTH: i,
|
|
188
|
-
MAX_SAFE_INTEGER:
|
|
671
|
+
MAX_SAFE_INTEGER: t,
|
|
189
672
|
RELEASE_TYPES: [
|
|
190
673
|
"major",
|
|
191
674
|
"premajor",
|
|
@@ -195,96 +678,96 @@ function Y() {
|
|
|
195
678
|
"prepatch",
|
|
196
679
|
"prerelease"
|
|
197
680
|
],
|
|
198
|
-
SEMVER_SPEC_VERSION:
|
|
681
|
+
SEMVER_SPEC_VERSION: r,
|
|
199
682
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
200
683
|
FLAG_LOOSE: 2
|
|
201
|
-
},
|
|
684
|
+
}, ne;
|
|
202
685
|
}
|
|
203
|
-
var
|
|
204
|
-
function
|
|
205
|
-
return rt || (rt = 1,
|
|
206
|
-
}),
|
|
686
|
+
var ie, rt;
|
|
687
|
+
function Y() {
|
|
688
|
+
return rt || (rt = 1, ie = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
|
|
689
|
+
}), ie;
|
|
207
690
|
}
|
|
208
691
|
var st;
|
|
209
692
|
function B() {
|
|
210
|
-
return st || (st = 1, (function(
|
|
693
|
+
return st || (st = 1, (function(r, e) {
|
|
211
694
|
const {
|
|
212
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
695
|
+
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
213
696
|
MAX_SAFE_BUILD_LENGTH: n,
|
|
214
697
|
MAX_LENGTH: i
|
|
215
|
-
} =
|
|
216
|
-
|
|
217
|
-
const
|
|
698
|
+
} = z(), c = Y();
|
|
699
|
+
e = r.exports = {};
|
|
700
|
+
const o = e.re = [], h = e.safeRe = [], a = e.src = [], l = e.safeSrc = [], s = e.t = {};
|
|
218
701
|
let u = 0;
|
|
219
|
-
const f = "[a-zA-Z0-9-]",
|
|
702
|
+
const f = "[a-zA-Z0-9-]", E = [
|
|
220
703
|
["\\s", 1],
|
|
221
704
|
["\\d", i],
|
|
222
705
|
[f, n]
|
|
223
706
|
], S = (N) => {
|
|
224
|
-
for (const [A,
|
|
225
|
-
N = N.split(`${A}*`).join(`${A}{0,${
|
|
707
|
+
for (const [A, b] of E)
|
|
708
|
+
N = N.split(`${A}*`).join(`${A}{0,${b}}`).split(`${A}+`).join(`${A}{1,${b}}`);
|
|
226
709
|
return N;
|
|
227
|
-
},
|
|
228
|
-
const w = S(A),
|
|
229
|
-
c(N,
|
|
710
|
+
}, d = (N, A, b) => {
|
|
711
|
+
const w = S(A), G = u++;
|
|
712
|
+
c(N, G, A), s[N] = G, a[G] = A, l[G] = w, o[G] = new RegExp(A, b ? "g" : void 0), h[G] = new RegExp(w, b ? "g" : void 0);
|
|
230
713
|
};
|
|
231
|
-
|
|
232
|
-
})(
|
|
714
|
+
d("NUMERICIDENTIFIER", "0|[1-9]\\d*"), d("NUMERICIDENTIFIERLOOSE", "\\d+"), d("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), d("MAINVERSION", `(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`), d("MAINVERSIONLOOSE", `(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`), d("PRERELEASEIDENTIFIER", `(?:${a[s.NONNUMERICIDENTIFIER]}|${a[s.NUMERICIDENTIFIER]})`), d("PRERELEASEIDENTIFIERLOOSE", `(?:${a[s.NONNUMERICIDENTIFIER]}|${a[s.NUMERICIDENTIFIERLOOSE]})`), d("PRERELEASE", `(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`), d("PRERELEASELOOSE", `(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`), d("BUILDIDENTIFIER", `${f}+`), d("BUILD", `(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`), d("FULLPLAIN", `v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`), d("FULL", `^${a[s.FULLPLAIN]}$`), d("LOOSEPLAIN", `[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`), d("LOOSE", `^${a[s.LOOSEPLAIN]}$`), d("GTLT", "((?:<|>)?=?)"), d("XRANGEIDENTIFIERLOOSE", `${a[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), d("XRANGEIDENTIFIER", `${a[s.NUMERICIDENTIFIER]}|x|X|\\*`), d("XRANGEPLAIN", `[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`), d("XRANGEPLAINLOOSE", `[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`), d("XRANGE", `^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`), d("XRANGELOOSE", `^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`), d("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), d("COERCE", `${a[s.COERCEPLAIN]}(?:$|[^\\d])`), d("COERCEFULL", a[s.COERCEPLAIN] + `(?:${a[s.PRERELEASE]})?(?:${a[s.BUILD]})?(?:$|[^\\d])`), d("COERCERTL", a[s.COERCE], !0), d("COERCERTLFULL", a[s.COERCEFULL], !0), d("LONETILDE", "(?:~>?)"), d("TILDETRIM", `(\\s*)${a[s.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", d("TILDE", `^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`), d("TILDELOOSE", `^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`), d("LONECARET", "(?:\\^)"), d("CARETTRIM", `(\\s*)${a[s.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", d("CARET", `^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`), d("CARETLOOSE", `^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`), d("COMPARATORLOOSE", `^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`), d("COMPARATOR", `^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`), d("COMPARATORTRIM", `(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", d("HYPHENRANGE", `^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`), d("HYPHENRANGELOOSE", `^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`), d("STAR", "(<|>)?=?\\s*\\*"), d("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), d("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
715
|
+
})(W, W.exports)), W.exports;
|
|
233
716
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
236
|
-
if (nt) return
|
|
717
|
+
var ae, nt;
|
|
718
|
+
function Ye() {
|
|
719
|
+
if (nt) return ae;
|
|
237
720
|
nt = 1;
|
|
238
|
-
const
|
|
239
|
-
return
|
|
721
|
+
const r = Object.freeze({ loose: !0 }), e = Object.freeze({});
|
|
722
|
+
return ae = (n) => n ? typeof n != "object" ? r : n : e, ae;
|
|
240
723
|
}
|
|
241
|
-
var
|
|
242
|
-
function
|
|
243
|
-
if (it) return
|
|
724
|
+
var oe, it;
|
|
725
|
+
function cr() {
|
|
726
|
+
if (it) return oe;
|
|
244
727
|
it = 1;
|
|
245
|
-
const
|
|
728
|
+
const r = /^[0-9]+$/, e = (n, i) => {
|
|
246
729
|
if (typeof n == "number" && typeof i == "number")
|
|
247
730
|
return n === i ? 0 : n < i ? -1 : 1;
|
|
248
|
-
const c =
|
|
249
|
-
return c &&
|
|
731
|
+
const c = r.test(n), o = r.test(i);
|
|
732
|
+
return c && o && (n = +n, i = +i), n === i ? 0 : c && !o ? -1 : o && !c ? 1 : n < i ? -1 : 1;
|
|
250
733
|
};
|
|
251
|
-
return
|
|
252
|
-
compareIdentifiers:
|
|
253
|
-
rcompareIdentifiers: (n, i) =>
|
|
254
|
-
},
|
|
255
|
-
}
|
|
256
|
-
var
|
|
257
|
-
function
|
|
258
|
-
if (at) return
|
|
734
|
+
return oe = {
|
|
735
|
+
compareIdentifiers: e,
|
|
736
|
+
rcompareIdentifiers: (n, i) => e(i, n)
|
|
737
|
+
}, oe;
|
|
738
|
+
}
|
|
739
|
+
var le, at;
|
|
740
|
+
function D() {
|
|
741
|
+
if (at) return le;
|
|
259
742
|
at = 1;
|
|
260
|
-
const
|
|
743
|
+
const r = Y(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = z(), { safeRe: n, t: i } = B(), c = Ye(), { compareIdentifiers: o } = cr();
|
|
261
744
|
class h {
|
|
262
|
-
constructor(
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
265
|
-
return
|
|
266
|
-
|
|
267
|
-
} else if (typeof
|
|
268
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof
|
|
269
|
-
if (
|
|
745
|
+
constructor(l, s) {
|
|
746
|
+
if (s = c(s), l instanceof h) {
|
|
747
|
+
if (l.loose === !!s.loose && l.includePrerelease === !!s.includePrerelease)
|
|
748
|
+
return l;
|
|
749
|
+
l = l.version;
|
|
750
|
+
} else if (typeof l != "string")
|
|
751
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);
|
|
752
|
+
if (l.length > e)
|
|
270
753
|
throw new TypeError(
|
|
271
|
-
`version is longer than ${
|
|
754
|
+
`version is longer than ${e} characters`
|
|
272
755
|
);
|
|
273
|
-
|
|
274
|
-
const u =
|
|
756
|
+
r("SemVer", l, s), this.options = s, this.loose = !!s.loose, this.includePrerelease = !!s.includePrerelease;
|
|
757
|
+
const u = l.trim().match(s.loose ? n[i.LOOSE] : n[i.FULL]);
|
|
275
758
|
if (!u)
|
|
276
|
-
throw new TypeError(`Invalid Version: ${
|
|
277
|
-
if (this.raw =
|
|
759
|
+
throw new TypeError(`Invalid Version: ${l}`);
|
|
760
|
+
if (this.raw = l, this.major = +u[1], this.minor = +u[2], this.patch = +u[3], this.major > t || this.major < 0)
|
|
278
761
|
throw new TypeError("Invalid major version");
|
|
279
|
-
if (this.minor >
|
|
762
|
+
if (this.minor > t || this.minor < 0)
|
|
280
763
|
throw new TypeError("Invalid minor version");
|
|
281
|
-
if (this.patch >
|
|
764
|
+
if (this.patch > t || this.patch < 0)
|
|
282
765
|
throw new TypeError("Invalid patch version");
|
|
283
766
|
u[4] ? this.prerelease = u[4].split(".").map((f) => {
|
|
284
767
|
if (/^[0-9]+$/.test(f)) {
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
return
|
|
768
|
+
const E = +f;
|
|
769
|
+
if (E >= 0 && E < t)
|
|
770
|
+
return E;
|
|
288
771
|
}
|
|
289
772
|
return f;
|
|
290
773
|
}) : this.prerelease = [], this.build = u[5] ? u[5].split(".") : [], this.format();
|
|
@@ -295,28 +778,28 @@ function b() {
|
|
|
295
778
|
toString() {
|
|
296
779
|
return this.version;
|
|
297
780
|
}
|
|
298
|
-
compare(
|
|
299
|
-
if (
|
|
300
|
-
if (typeof
|
|
781
|
+
compare(l) {
|
|
782
|
+
if (r("SemVer.compare", this.version, this.options, l), !(l instanceof h)) {
|
|
783
|
+
if (typeof l == "string" && l === this.version)
|
|
301
784
|
return 0;
|
|
302
|
-
|
|
785
|
+
l = new h(l, this.options);
|
|
303
786
|
}
|
|
304
|
-
return
|
|
787
|
+
return l.version === this.version ? 0 : this.compareMain(l) || this.comparePre(l);
|
|
305
788
|
}
|
|
306
|
-
compareMain(
|
|
307
|
-
return
|
|
789
|
+
compareMain(l) {
|
|
790
|
+
return l instanceof h || (l = new h(l, this.options)), this.major < l.major ? -1 : this.major > l.major ? 1 : this.minor < l.minor ? -1 : this.minor > l.minor ? 1 : this.patch < l.patch ? -1 : this.patch > l.patch ? 1 : 0;
|
|
308
791
|
}
|
|
309
|
-
comparePre(
|
|
310
|
-
if (
|
|
792
|
+
comparePre(l) {
|
|
793
|
+
if (l instanceof h || (l = new h(l, this.options)), this.prerelease.length && !l.prerelease.length)
|
|
311
794
|
return -1;
|
|
312
|
-
if (!this.prerelease.length &&
|
|
795
|
+
if (!this.prerelease.length && l.prerelease.length)
|
|
313
796
|
return 1;
|
|
314
|
-
if (!this.prerelease.length && !
|
|
797
|
+
if (!this.prerelease.length && !l.prerelease.length)
|
|
315
798
|
return 0;
|
|
316
|
-
let
|
|
799
|
+
let s = 0;
|
|
317
800
|
do {
|
|
318
|
-
const u = this.prerelease[
|
|
319
|
-
if (
|
|
801
|
+
const u = this.prerelease[s], f = l.prerelease[s];
|
|
802
|
+
if (r("prerelease compare", s, u, f), u === void 0 && f === void 0)
|
|
320
803
|
return 0;
|
|
321
804
|
if (f === void 0)
|
|
322
805
|
return 1;
|
|
@@ -324,15 +807,15 @@ function b() {
|
|
|
324
807
|
return -1;
|
|
325
808
|
if (u === f)
|
|
326
809
|
continue;
|
|
327
|
-
return
|
|
328
|
-
} while (++
|
|
810
|
+
return o(u, f);
|
|
811
|
+
} while (++s);
|
|
329
812
|
}
|
|
330
|
-
compareBuild(
|
|
331
|
-
|
|
332
|
-
let
|
|
813
|
+
compareBuild(l) {
|
|
814
|
+
l instanceof h || (l = new h(l, this.options));
|
|
815
|
+
let s = 0;
|
|
333
816
|
do {
|
|
334
|
-
const u = this.build[
|
|
335
|
-
if (
|
|
817
|
+
const u = this.build[s], f = l.build[s];
|
|
818
|
+
if (r("build compare", s, u, f), u === void 0 && f === void 0)
|
|
336
819
|
return 0;
|
|
337
820
|
if (f === void 0)
|
|
338
821
|
return 1;
|
|
@@ -340,35 +823,35 @@ function b() {
|
|
|
340
823
|
return -1;
|
|
341
824
|
if (u === f)
|
|
342
825
|
continue;
|
|
343
|
-
return
|
|
344
|
-
} while (++
|
|
826
|
+
return o(u, f);
|
|
827
|
+
} while (++s);
|
|
345
828
|
}
|
|
346
829
|
// preminor will bump the version up to the next minor release, and immediately
|
|
347
830
|
// down to pre-release. premajor and prepatch work the same way.
|
|
348
|
-
inc(
|
|
349
|
-
if (
|
|
350
|
-
if (!
|
|
831
|
+
inc(l, s, u) {
|
|
832
|
+
if (l.startsWith("pre")) {
|
|
833
|
+
if (!s && u === !1)
|
|
351
834
|
throw new Error("invalid increment argument: identifier is empty");
|
|
352
|
-
if (
|
|
353
|
-
const f = `-${
|
|
354
|
-
if (!f || f[1] !==
|
|
355
|
-
throw new Error(`invalid identifier: ${
|
|
835
|
+
if (s) {
|
|
836
|
+
const f = `-${s}`.match(this.options.loose ? n[i.PRERELEASELOOSE] : n[i.PRERELEASE]);
|
|
837
|
+
if (!f || f[1] !== s)
|
|
838
|
+
throw new Error(`invalid identifier: ${s}`);
|
|
356
839
|
}
|
|
357
840
|
}
|
|
358
|
-
switch (
|
|
841
|
+
switch (l) {
|
|
359
842
|
case "premajor":
|
|
360
|
-
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre",
|
|
843
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", s, u);
|
|
361
844
|
break;
|
|
362
845
|
case "preminor":
|
|
363
|
-
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre",
|
|
846
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", s, u);
|
|
364
847
|
break;
|
|
365
848
|
case "prepatch":
|
|
366
|
-
this.prerelease.length = 0, this.inc("patch",
|
|
849
|
+
this.prerelease.length = 0, this.inc("patch", s, u), this.inc("pre", s, u);
|
|
367
850
|
break;
|
|
368
851
|
// If the input is a non-prerelease version, this acts the same as
|
|
369
852
|
// prepatch.
|
|
370
853
|
case "prerelease":
|
|
371
|
-
this.prerelease.length === 0 && this.inc("patch",
|
|
854
|
+
this.prerelease.length === 0 && this.inc("patch", s, u), this.inc("pre", s, u);
|
|
372
855
|
break;
|
|
373
856
|
case "release":
|
|
374
857
|
if (this.prerelease.length === 0)
|
|
@@ -391,328 +874,328 @@ function b() {
|
|
|
391
874
|
if (this.prerelease.length === 0)
|
|
392
875
|
this.prerelease = [f];
|
|
393
876
|
else {
|
|
394
|
-
let
|
|
395
|
-
for (; --
|
|
396
|
-
typeof this.prerelease[
|
|
397
|
-
if (
|
|
398
|
-
if (
|
|
877
|
+
let E = this.prerelease.length;
|
|
878
|
+
for (; --E >= 0; )
|
|
879
|
+
typeof this.prerelease[E] == "number" && (this.prerelease[E]++, E = -2);
|
|
880
|
+
if (E === -1) {
|
|
881
|
+
if (s === this.prerelease.join(".") && u === !1)
|
|
399
882
|
throw new Error("invalid increment argument: identifier already exists");
|
|
400
883
|
this.prerelease.push(f);
|
|
401
884
|
}
|
|
402
885
|
}
|
|
403
|
-
if (
|
|
404
|
-
let
|
|
405
|
-
u === !1 && (
|
|
886
|
+
if (s) {
|
|
887
|
+
let E = [s, f];
|
|
888
|
+
u === !1 && (E = [s]), o(this.prerelease[0], s) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = E) : this.prerelease = E;
|
|
406
889
|
}
|
|
407
890
|
break;
|
|
408
891
|
}
|
|
409
892
|
default:
|
|
410
|
-
throw new Error(`invalid increment argument: ${
|
|
893
|
+
throw new Error(`invalid increment argument: ${l}`);
|
|
411
894
|
}
|
|
412
895
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
413
896
|
}
|
|
414
897
|
}
|
|
415
|
-
return
|
|
898
|
+
return le = h, le;
|
|
416
899
|
}
|
|
417
|
-
var
|
|
418
|
-
function
|
|
419
|
-
if (ot) return
|
|
900
|
+
var ce, ot;
|
|
901
|
+
function j() {
|
|
902
|
+
if (ot) return ce;
|
|
420
903
|
ot = 1;
|
|
421
|
-
const
|
|
422
|
-
return
|
|
423
|
-
if (
|
|
424
|
-
return
|
|
904
|
+
const r = D();
|
|
905
|
+
return ce = (t, n, i = !1) => {
|
|
906
|
+
if (t instanceof r)
|
|
907
|
+
return t;
|
|
425
908
|
try {
|
|
426
|
-
return new t
|
|
909
|
+
return new r(t, n);
|
|
427
910
|
} catch (c) {
|
|
428
911
|
if (!i)
|
|
429
912
|
return null;
|
|
430
913
|
throw c;
|
|
431
914
|
}
|
|
432
|
-
},
|
|
915
|
+
}, ce;
|
|
433
916
|
}
|
|
434
|
-
var
|
|
435
|
-
function
|
|
436
|
-
if (lt) return
|
|
917
|
+
var ue, lt;
|
|
918
|
+
function Gr() {
|
|
919
|
+
if (lt) return ue;
|
|
437
920
|
lt = 1;
|
|
438
|
-
const
|
|
439
|
-
return
|
|
440
|
-
const i = t
|
|
921
|
+
const r = j();
|
|
922
|
+
return ue = (t, n) => {
|
|
923
|
+
const i = r(t, n);
|
|
441
924
|
return i ? i.version : null;
|
|
442
|
-
},
|
|
925
|
+
}, ue;
|
|
443
926
|
}
|
|
444
|
-
var
|
|
445
|
-
function
|
|
446
|
-
if (ct) return
|
|
927
|
+
var he, ct;
|
|
928
|
+
function xr() {
|
|
929
|
+
if (ct) return he;
|
|
447
930
|
ct = 1;
|
|
448
|
-
const
|
|
449
|
-
return
|
|
450
|
-
const i = t
|
|
931
|
+
const r = j();
|
|
932
|
+
return he = (t, n) => {
|
|
933
|
+
const i = r(t.trim().replace(/^[=v]+/, ""), n);
|
|
451
934
|
return i ? i.version : null;
|
|
452
|
-
},
|
|
935
|
+
}, he;
|
|
453
936
|
}
|
|
454
937
|
var fe, ut;
|
|
455
|
-
function
|
|
938
|
+
function Dr() {
|
|
456
939
|
if (ut) return fe;
|
|
457
940
|
ut = 1;
|
|
458
|
-
const
|
|
459
|
-
return fe = (
|
|
460
|
-
typeof i == "string" && (
|
|
941
|
+
const r = D();
|
|
942
|
+
return fe = (t, n, i, c, o) => {
|
|
943
|
+
typeof i == "string" && (o = c, c = i, i = void 0);
|
|
461
944
|
try {
|
|
462
|
-
return new
|
|
463
|
-
|
|
945
|
+
return new r(
|
|
946
|
+
t instanceof r ? t.version : t,
|
|
464
947
|
i
|
|
465
|
-
).inc(n, c,
|
|
948
|
+
).inc(n, c, o).version;
|
|
466
949
|
} catch {
|
|
467
950
|
return null;
|
|
468
951
|
}
|
|
469
952
|
}, fe;
|
|
470
953
|
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
473
|
-
if (
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
return
|
|
477
|
-
const i = t
|
|
478
|
-
if (
|
|
954
|
+
var me, ht;
|
|
955
|
+
function _r() {
|
|
956
|
+
if (ht) return me;
|
|
957
|
+
ht = 1;
|
|
958
|
+
const r = j();
|
|
959
|
+
return me = (t, n) => {
|
|
960
|
+
const i = r(t, null, !0), c = r(n, null, !0), o = i.compare(c);
|
|
961
|
+
if (o === 0)
|
|
479
962
|
return null;
|
|
480
|
-
const h =
|
|
481
|
-
if (!!
|
|
482
|
-
if (!
|
|
963
|
+
const h = o > 0, a = h ? i : c, l = h ? c : i, s = !!a.prerelease.length;
|
|
964
|
+
if (!!l.prerelease.length && !s) {
|
|
965
|
+
if (!l.patch && !l.minor)
|
|
483
966
|
return "major";
|
|
484
|
-
if (
|
|
485
|
-
return
|
|
967
|
+
if (l.compareMain(a) === 0)
|
|
968
|
+
return l.minor && !l.patch ? "minor" : "patch";
|
|
486
969
|
}
|
|
487
|
-
const f =
|
|
970
|
+
const f = s ? "pre" : "";
|
|
488
971
|
return i.major !== c.major ? f + "major" : i.minor !== c.minor ? f + "minor" : i.patch !== c.patch ? f + "patch" : "prerelease";
|
|
489
|
-
},
|
|
490
|
-
}
|
|
491
|
-
var de, ht;
|
|
492
|
-
function Cr() {
|
|
493
|
-
if (ht) return de;
|
|
494
|
-
ht = 1;
|
|
495
|
-
const t = b();
|
|
496
|
-
return de = (r, n) => new t(r, n).major, de;
|
|
972
|
+
}, me;
|
|
497
973
|
}
|
|
498
|
-
var
|
|
499
|
-
function
|
|
500
|
-
if (
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
return
|
|
974
|
+
var de, ft;
|
|
975
|
+
function Ur() {
|
|
976
|
+
if (ft) return de;
|
|
977
|
+
ft = 1;
|
|
978
|
+
const r = D();
|
|
979
|
+
return de = (t, n) => new r(t, n).major, de;
|
|
504
980
|
}
|
|
505
|
-
var
|
|
506
|
-
function
|
|
507
|
-
if (mt) return
|
|
981
|
+
var pe, mt;
|
|
982
|
+
function Fr() {
|
|
983
|
+
if (mt) return pe;
|
|
508
984
|
mt = 1;
|
|
509
|
-
const
|
|
510
|
-
return
|
|
985
|
+
const r = D();
|
|
986
|
+
return pe = (t, n) => new r(t, n).minor, pe;
|
|
511
987
|
}
|
|
512
|
-
var
|
|
513
|
-
function
|
|
514
|
-
if (
|
|
515
|
-
|
|
516
|
-
const
|
|
517
|
-
return
|
|
518
|
-
|
|
988
|
+
var Ee, dt;
|
|
989
|
+
function kr() {
|
|
990
|
+
if (dt) return Ee;
|
|
991
|
+
dt = 1;
|
|
992
|
+
const r = D();
|
|
993
|
+
return Ee = (t, n) => new r(t, n).patch, Ee;
|
|
994
|
+
}
|
|
995
|
+
var ge, pt;
|
|
996
|
+
function jr() {
|
|
997
|
+
if (pt) return ge;
|
|
998
|
+
pt = 1;
|
|
999
|
+
const r = j();
|
|
1000
|
+
return ge = (t, n) => {
|
|
1001
|
+
const i = r(t, n);
|
|
519
1002
|
return i && i.prerelease.length ? i.prerelease : null;
|
|
520
|
-
},
|
|
1003
|
+
}, ge;
|
|
521
1004
|
}
|
|
522
|
-
var Re,
|
|
1005
|
+
var Re, Et;
|
|
523
1006
|
function U() {
|
|
524
|
-
if (
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
return Re = (
|
|
1007
|
+
if (Et) return Re;
|
|
1008
|
+
Et = 1;
|
|
1009
|
+
const r = D();
|
|
1010
|
+
return Re = (t, n, i) => new r(t, i).compare(new r(n, i)), Re;
|
|
528
1011
|
}
|
|
529
|
-
var ve,
|
|
530
|
-
function
|
|
531
|
-
if (
|
|
1012
|
+
var ve, gt;
|
|
1013
|
+
function Mr() {
|
|
1014
|
+
if (gt) return ve;
|
|
1015
|
+
gt = 1;
|
|
1016
|
+
const r = U();
|
|
1017
|
+
return ve = (t, n, i) => r(n, t, i), ve;
|
|
1018
|
+
}
|
|
1019
|
+
var Ie, Rt;
|
|
1020
|
+
function Vr() {
|
|
1021
|
+
if (Rt) return Ie;
|
|
532
1022
|
Rt = 1;
|
|
533
|
-
const
|
|
534
|
-
return
|
|
1023
|
+
const r = U();
|
|
1024
|
+
return Ie = (t, n) => r(t, n, !0), Ie;
|
|
535
1025
|
}
|
|
536
|
-
var
|
|
537
|
-
function
|
|
538
|
-
if (vt) return
|
|
1026
|
+
var $e, vt;
|
|
1027
|
+
function Ke() {
|
|
1028
|
+
if (vt) return $e;
|
|
539
1029
|
vt = 1;
|
|
540
|
-
const
|
|
541
|
-
return
|
|
1030
|
+
const r = D();
|
|
1031
|
+
return $e = (t, n, i) => {
|
|
1032
|
+
const c = new r(t, i), o = new r(n, i);
|
|
1033
|
+
return c.compare(o) || c.compareBuild(o);
|
|
1034
|
+
}, $e;
|
|
542
1035
|
}
|
|
543
|
-
var
|
|
544
|
-
function
|
|
545
|
-
if (It) return
|
|
1036
|
+
var Le, It;
|
|
1037
|
+
function Xr() {
|
|
1038
|
+
if (It) return Le;
|
|
546
1039
|
It = 1;
|
|
547
|
-
const
|
|
548
|
-
return
|
|
549
|
-
const c = new t(r, i), l = new t(n, i);
|
|
550
|
-
return c.compare(l) || c.compareBuild(l);
|
|
551
|
-
}, ge;
|
|
552
|
-
}
|
|
553
|
-
var $e, gt;
|
|
554
|
-
function br() {
|
|
555
|
-
if (gt) return $e;
|
|
556
|
-
gt = 1;
|
|
557
|
-
const t = Je();
|
|
558
|
-
return $e = (r, n) => r.sort((i, c) => t(i, c, n)), $e;
|
|
1040
|
+
const r = Ke();
|
|
1041
|
+
return Le = (t, n) => t.sort((i, c) => r(i, c, n)), Le;
|
|
559
1042
|
}
|
|
560
|
-
var
|
|
561
|
-
function
|
|
562
|
-
if ($t) return
|
|
1043
|
+
var Te, $t;
|
|
1044
|
+
function Br() {
|
|
1045
|
+
if ($t) return Te;
|
|
563
1046
|
$t = 1;
|
|
564
|
-
const
|
|
565
|
-
return
|
|
1047
|
+
const r = Ke();
|
|
1048
|
+
return Te = (t, n) => t.sort((i, c) => r(c, i, n)), Te;
|
|
566
1049
|
}
|
|
567
|
-
var
|
|
568
|
-
function
|
|
569
|
-
if (Lt) return
|
|
1050
|
+
var Ne, Lt;
|
|
1051
|
+
function K() {
|
|
1052
|
+
if (Lt) return Ne;
|
|
570
1053
|
Lt = 1;
|
|
571
|
-
const
|
|
572
|
-
return
|
|
1054
|
+
const r = U();
|
|
1055
|
+
return Ne = (t, n, i) => r(t, n, i) > 0, Ne;
|
|
573
1056
|
}
|
|
574
|
-
var
|
|
575
|
-
function
|
|
576
|
-
if (Tt) return
|
|
1057
|
+
var Se, Tt;
|
|
1058
|
+
function Ze() {
|
|
1059
|
+
if (Tt) return Se;
|
|
577
1060
|
Tt = 1;
|
|
578
|
-
const
|
|
579
|
-
return
|
|
1061
|
+
const r = U();
|
|
1062
|
+
return Se = (t, n, i) => r(t, n, i) < 0, Se;
|
|
580
1063
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
583
|
-
if (Nt) return
|
|
1064
|
+
var Oe, Nt;
|
|
1065
|
+
function ur() {
|
|
1066
|
+
if (Nt) return Oe;
|
|
584
1067
|
Nt = 1;
|
|
585
|
-
const
|
|
586
|
-
return
|
|
1068
|
+
const r = U();
|
|
1069
|
+
return Oe = (t, n, i) => r(t, n, i) === 0, Oe;
|
|
587
1070
|
}
|
|
588
|
-
var
|
|
589
|
-
function
|
|
590
|
-
if (St) return
|
|
1071
|
+
var Ae, St;
|
|
1072
|
+
function hr() {
|
|
1073
|
+
if (St) return Ae;
|
|
591
1074
|
St = 1;
|
|
592
|
-
const
|
|
593
|
-
return
|
|
1075
|
+
const r = U();
|
|
1076
|
+
return Ae = (t, n, i) => r(t, n, i) !== 0, Ae;
|
|
594
1077
|
}
|
|
595
|
-
var
|
|
596
|
-
function
|
|
597
|
-
if (Ot) return
|
|
1078
|
+
var we, Ot;
|
|
1079
|
+
function Je() {
|
|
1080
|
+
if (Ot) return we;
|
|
598
1081
|
Ot = 1;
|
|
599
|
-
const
|
|
600
|
-
return
|
|
1082
|
+
const r = U();
|
|
1083
|
+
return we = (t, n, i) => r(t, n, i) >= 0, we;
|
|
601
1084
|
}
|
|
602
|
-
var
|
|
1085
|
+
var ye, At;
|
|
603
1086
|
function Qe() {
|
|
604
|
-
if (At) return
|
|
1087
|
+
if (At) return ye;
|
|
605
1088
|
At = 1;
|
|
606
|
-
const
|
|
607
|
-
return
|
|
1089
|
+
const r = U();
|
|
1090
|
+
return ye = (t, n, i) => r(t, n, i) <= 0, ye;
|
|
608
1091
|
}
|
|
609
|
-
var
|
|
610
|
-
function
|
|
611
|
-
if (wt) return
|
|
1092
|
+
var Ce, wt;
|
|
1093
|
+
function fr() {
|
|
1094
|
+
if (wt) return Ce;
|
|
612
1095
|
wt = 1;
|
|
613
|
-
const
|
|
614
|
-
return
|
|
615
|
-
switch (
|
|
1096
|
+
const r = ur(), e = hr(), t = K(), n = Je(), i = Ze(), c = Qe();
|
|
1097
|
+
return Ce = (h, a, l, s) => {
|
|
1098
|
+
switch (a) {
|
|
616
1099
|
case "===":
|
|
617
|
-
return typeof h == "object" && (h = h.version), typeof
|
|
1100
|
+
return typeof h == "object" && (h = h.version), typeof l == "object" && (l = l.version), h === l;
|
|
618
1101
|
case "!==":
|
|
619
|
-
return typeof h == "object" && (h = h.version), typeof
|
|
1102
|
+
return typeof h == "object" && (h = h.version), typeof l == "object" && (l = l.version), h !== l;
|
|
620
1103
|
case "":
|
|
621
1104
|
case "=":
|
|
622
1105
|
case "==":
|
|
623
|
-
return
|
|
1106
|
+
return r(h, l, s);
|
|
624
1107
|
case "!=":
|
|
625
|
-
return
|
|
1108
|
+
return e(h, l, s);
|
|
626
1109
|
case ">":
|
|
627
|
-
return
|
|
1110
|
+
return t(h, l, s);
|
|
628
1111
|
case ">=":
|
|
629
|
-
return n(h,
|
|
1112
|
+
return n(h, l, s);
|
|
630
1113
|
case "<":
|
|
631
|
-
return i(h,
|
|
1114
|
+
return i(h, l, s);
|
|
632
1115
|
case "<=":
|
|
633
|
-
return c(h,
|
|
1116
|
+
return c(h, l, s);
|
|
634
1117
|
default:
|
|
635
|
-
throw new TypeError(`Invalid operator: ${
|
|
1118
|
+
throw new TypeError(`Invalid operator: ${a}`);
|
|
636
1119
|
}
|
|
637
|
-
},
|
|
1120
|
+
}, Ce;
|
|
638
1121
|
}
|
|
639
|
-
var
|
|
640
|
-
function
|
|
641
|
-
if (yt) return
|
|
1122
|
+
var Pe, yt;
|
|
1123
|
+
function Wr() {
|
|
1124
|
+
if (yt) return Pe;
|
|
642
1125
|
yt = 1;
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
if (c instanceof
|
|
1126
|
+
const r = D(), e = j(), { safeRe: t, t: n } = B();
|
|
1127
|
+
return Pe = (c, o) => {
|
|
1128
|
+
if (c instanceof r)
|
|
646
1129
|
return c;
|
|
647
1130
|
if (typeof c == "number" && (c = String(c)), typeof c != "string")
|
|
648
1131
|
return null;
|
|
649
|
-
|
|
1132
|
+
o = o || {};
|
|
650
1133
|
let h = null;
|
|
651
|
-
if (!
|
|
652
|
-
h = c.match(
|
|
1134
|
+
if (!o.rtl)
|
|
1135
|
+
h = c.match(o.includePrerelease ? t[n.COERCEFULL] : t[n.COERCE]);
|
|
653
1136
|
else {
|
|
654
|
-
const
|
|
1137
|
+
const E = o.includePrerelease ? t[n.COERCERTLFULL] : t[n.COERCERTL];
|
|
655
1138
|
let S;
|
|
656
|
-
for (; (S =
|
|
657
|
-
(!h || S.index + S[0].length !== h.index + h[0].length) && (h = S),
|
|
658
|
-
|
|
1139
|
+
for (; (S = E.exec(c)) && (!h || h.index + h[0].length !== c.length); )
|
|
1140
|
+
(!h || S.index + S[0].length !== h.index + h[0].length) && (h = S), E.lastIndex = S.index + S[1].length + S[2].length;
|
|
1141
|
+
E.lastIndex = -1;
|
|
659
1142
|
}
|
|
660
1143
|
if (h === null)
|
|
661
1144
|
return null;
|
|
662
|
-
const
|
|
663
|
-
return
|
|
664
|
-
},
|
|
1145
|
+
const a = h[2], l = h[3] || "0", s = h[4] || "0", u = o.includePrerelease && h[5] ? `-${h[5]}` : "", f = o.includePrerelease && h[6] ? `+${h[6]}` : "";
|
|
1146
|
+
return e(`${a}.${l}.${s}${u}${f}`, o);
|
|
1147
|
+
}, Pe;
|
|
665
1148
|
}
|
|
666
1149
|
var qe, Ct;
|
|
667
|
-
function
|
|
1150
|
+
function Hr() {
|
|
668
1151
|
if (Ct) return qe;
|
|
669
1152
|
Ct = 1;
|
|
670
|
-
class
|
|
1153
|
+
class r {
|
|
671
1154
|
constructor() {
|
|
672
1155
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
673
1156
|
}
|
|
674
|
-
get(
|
|
675
|
-
const n = this.map.get(
|
|
1157
|
+
get(t) {
|
|
1158
|
+
const n = this.map.get(t);
|
|
676
1159
|
if (n !== void 0)
|
|
677
|
-
return this.map.delete(
|
|
1160
|
+
return this.map.delete(t), this.map.set(t, n), n;
|
|
678
1161
|
}
|
|
679
|
-
delete(
|
|
680
|
-
return this.map.delete(
|
|
1162
|
+
delete(t) {
|
|
1163
|
+
return this.map.delete(t);
|
|
681
1164
|
}
|
|
682
|
-
set(
|
|
683
|
-
if (!this.delete(
|
|
1165
|
+
set(t, n) {
|
|
1166
|
+
if (!this.delete(t) && n !== void 0) {
|
|
684
1167
|
if (this.map.size >= this.max) {
|
|
685
1168
|
const c = this.map.keys().next().value;
|
|
686
1169
|
this.delete(c);
|
|
687
1170
|
}
|
|
688
|
-
this.map.set(
|
|
1171
|
+
this.map.set(t, n);
|
|
689
1172
|
}
|
|
690
1173
|
return this;
|
|
691
1174
|
}
|
|
692
1175
|
}
|
|
693
|
-
return qe =
|
|
1176
|
+
return qe = r, qe;
|
|
694
1177
|
}
|
|
695
|
-
var
|
|
696
|
-
function
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
class
|
|
701
|
-
constructor(
|
|
702
|
-
if (
|
|
703
|
-
return
|
|
704
|
-
if (
|
|
705
|
-
return this.raw =
|
|
706
|
-
if (this.options =
|
|
1178
|
+
var be, Pt;
|
|
1179
|
+
function F() {
|
|
1180
|
+
if (Pt) return be;
|
|
1181
|
+
Pt = 1;
|
|
1182
|
+
const r = /\s+/g;
|
|
1183
|
+
class e {
|
|
1184
|
+
constructor(m, v) {
|
|
1185
|
+
if (v = i(v), m instanceof e)
|
|
1186
|
+
return m.loose === !!v.loose && m.includePrerelease === !!v.includePrerelease ? m : new e(m.raw, v);
|
|
1187
|
+
if (m instanceof c)
|
|
1188
|
+
return this.raw = m.value, this.set = [[m]], this.formatted = void 0, this;
|
|
1189
|
+
if (this.options = v, this.loose = !!v.loose, this.includePrerelease = !!v.includePrerelease, this.raw = m.trim().replace(r, " "), this.set = this.raw.split("||").map((g) => this.parseRange(g.trim())).filter((g) => g.length), !this.set.length)
|
|
707
1190
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
708
1191
|
if (this.set.length > 1) {
|
|
709
|
-
const
|
|
710
|
-
if (this.set = this.set.filter((
|
|
711
|
-
this.set = [
|
|
1192
|
+
const g = this.set[0];
|
|
1193
|
+
if (this.set = this.set.filter((I) => !d(I[0])), this.set.length === 0)
|
|
1194
|
+
this.set = [g];
|
|
712
1195
|
else if (this.set.length > 1) {
|
|
713
|
-
for (const
|
|
714
|
-
if (
|
|
715
|
-
this.set = [
|
|
1196
|
+
for (const I of this.set)
|
|
1197
|
+
if (I.length === 1 && N(I[0])) {
|
|
1198
|
+
this.set = [I];
|
|
716
1199
|
break;
|
|
717
1200
|
}
|
|
718
1201
|
}
|
|
@@ -722,11 +1205,11 @@ function j() {
|
|
|
722
1205
|
get range() {
|
|
723
1206
|
if (this.formatted === void 0) {
|
|
724
1207
|
this.formatted = "";
|
|
725
|
-
for (let
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
for (let
|
|
729
|
-
|
|
1208
|
+
for (let m = 0; m < this.set.length; m++) {
|
|
1209
|
+
m > 0 && (this.formatted += "||");
|
|
1210
|
+
const v = this.set[m];
|
|
1211
|
+
for (let g = 0; g < v.length; g++)
|
|
1212
|
+
g > 0 && (this.formatted += " "), this.formatted += v[g].toString().trim();
|
|
730
1213
|
}
|
|
731
1214
|
}
|
|
732
1215
|
return this.formatted;
|
|
@@ -737,335 +1220,335 @@ function j() {
|
|
|
737
1220
|
toString() {
|
|
738
1221
|
return this.range;
|
|
739
1222
|
}
|
|
740
|
-
parseRange(
|
|
741
|
-
const
|
|
742
|
-
if (
|
|
743
|
-
return
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
let O =
|
|
747
|
-
|
|
748
|
-
const T = /* @__PURE__ */ new Map(), y = O.map((
|
|
749
|
-
for (const
|
|
750
|
-
if (
|
|
751
|
-
return [
|
|
752
|
-
T.set(
|
|
1223
|
+
parseRange(m) {
|
|
1224
|
+
const g = ((this.options.includePrerelease && E) | (this.options.loose && S)) + ":" + m, I = n.get(g);
|
|
1225
|
+
if (I)
|
|
1226
|
+
return I;
|
|
1227
|
+
const R = this.options.loose, $ = R ? a[l.HYPHENRANGELOOSE] : a[l.HYPHENRANGE];
|
|
1228
|
+
m = m.replace($, te(this.options.includePrerelease)), o("hyphen replace", m), m = m.replace(a[l.COMPARATORTRIM], s), o("comparator trim", m), m = m.replace(a[l.TILDETRIM], u), o("tilde trim", m), m = m.replace(a[l.CARETTRIM], f), o("caret trim", m);
|
|
1229
|
+
let O = m.split(" ").map((P) => b(P, this.options)).join(" ").split(/\s+/).map((P) => ee(P, this.options));
|
|
1230
|
+
R && (O = O.filter((P) => (o("loose invalid filter", P, this.options), !!P.match(a[l.COMPARATORLOOSE])))), o("range list", O);
|
|
1231
|
+
const T = /* @__PURE__ */ new Map(), y = O.map((P) => new c(P, this.options));
|
|
1232
|
+
for (const P of y) {
|
|
1233
|
+
if (d(P))
|
|
1234
|
+
return [P];
|
|
1235
|
+
T.set(P.value, P);
|
|
753
1236
|
}
|
|
754
1237
|
T.size > 1 && T.has("") && T.delete("");
|
|
755
|
-
const
|
|
756
|
-
return n.set(
|
|
1238
|
+
const x = [...T.values()];
|
|
1239
|
+
return n.set(g, x), x;
|
|
757
1240
|
}
|
|
758
|
-
intersects(
|
|
759
|
-
if (!(
|
|
1241
|
+
intersects(m, v) {
|
|
1242
|
+
if (!(m instanceof e))
|
|
760
1243
|
throw new TypeError("a Range is required");
|
|
761
|
-
return this.set.some((
|
|
1244
|
+
return this.set.some((g) => A(g, v) && m.set.some((I) => A(I, v) && g.every((R) => I.every(($) => R.intersects($, v)))));
|
|
762
1245
|
}
|
|
763
1246
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
764
|
-
test(
|
|
765
|
-
if (!
|
|
1247
|
+
test(m) {
|
|
1248
|
+
if (!m)
|
|
766
1249
|
return !1;
|
|
767
|
-
if (typeof
|
|
1250
|
+
if (typeof m == "string")
|
|
768
1251
|
try {
|
|
769
|
-
|
|
1252
|
+
m = new h(m, this.options);
|
|
770
1253
|
} catch {
|
|
771
1254
|
return !1;
|
|
772
1255
|
}
|
|
773
|
-
for (let
|
|
774
|
-
if (re(this.set[
|
|
1256
|
+
for (let v = 0; v < this.set.length; v++)
|
|
1257
|
+
if (re(this.set[v], m, this.options))
|
|
775
1258
|
return !0;
|
|
776
1259
|
return !1;
|
|
777
1260
|
}
|
|
778
1261
|
}
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
safeRe:
|
|
782
|
-
t:
|
|
783
|
-
comparatorTrimReplace:
|
|
1262
|
+
be = e;
|
|
1263
|
+
const t = Hr(), n = new t(), i = Ye(), c = Z(), o = Y(), h = D(), {
|
|
1264
|
+
safeRe: a,
|
|
1265
|
+
t: l,
|
|
1266
|
+
comparatorTrimReplace: s,
|
|
784
1267
|
tildeTrimReplace: u,
|
|
785
1268
|
caretTrimReplace: f
|
|
786
|
-
} = B(), { FLAG_INCLUDE_PRERELEASE:
|
|
787
|
-
let
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
for (;
|
|
791
|
-
|
|
792
|
-
return
|
|
793
|
-
},
|
|
794
|
-
const
|
|
795
|
-
return
|
|
796
|
-
|
|
1269
|
+
} = B(), { FLAG_INCLUDE_PRERELEASE: E, FLAG_LOOSE: S } = z(), d = (p) => p.value === "<0.0.0-0", N = (p) => p.value === "", A = (p, m) => {
|
|
1270
|
+
let v = !0;
|
|
1271
|
+
const g = p.slice();
|
|
1272
|
+
let I = g.pop();
|
|
1273
|
+
for (; v && g.length; )
|
|
1274
|
+
v = g.every((R) => I.intersects(R, m)), I = g.pop();
|
|
1275
|
+
return v;
|
|
1276
|
+
}, b = (p, m) => (p = p.replace(a[l.BUILD], ""), o("comp", p, m), p = C(p, m), o("caret", p), p = G(p, m), o("tildes", p), p = L(p, m), o("xrange", p), p = Q(p, m), o("stars", p), p), w = (p) => !p || p.toLowerCase() === "x" || p === "*", G = (p, m) => p.trim().split(/\s+/).map((v) => _(v, m)).join(" "), _ = (p, m) => {
|
|
1277
|
+
const v = m.loose ? a[l.TILDELOOSE] : a[l.TILDE];
|
|
1278
|
+
return p.replace(v, (g, I, R, $, O) => {
|
|
1279
|
+
o("tilde", p, g, I, R, $, O);
|
|
797
1280
|
let T;
|
|
798
|
-
return w(
|
|
1281
|
+
return w(I) ? T = "" : w(R) ? T = `>=${I}.0.0 <${+I + 1}.0.0-0` : w($) ? T = `>=${I}.${R}.0 <${I}.${+R + 1}.0-0` : O ? (o("replaceTilde pr", O), T = `>=${I}.${R}.${$}-${O} <${I}.${+R + 1}.0-0`) : T = `>=${I}.${R}.${$} <${I}.${+R + 1}.0-0`, o("tilde return", T), T;
|
|
799
1282
|
});
|
|
800
|
-
}, C = (
|
|
801
|
-
|
|
802
|
-
const
|
|
803
|
-
return
|
|
804
|
-
|
|
1283
|
+
}, C = (p, m) => p.trim().split(/\s+/).map((v) => q(v, m)).join(" "), q = (p, m) => {
|
|
1284
|
+
o("caret", p, m);
|
|
1285
|
+
const v = m.loose ? a[l.CARETLOOSE] : a[l.CARET], g = m.includePrerelease ? "-0" : "";
|
|
1286
|
+
return p.replace(v, (I, R, $, O, T) => {
|
|
1287
|
+
o("caret", p, I, R, $, O, T);
|
|
805
1288
|
let y;
|
|
806
|
-
return w(
|
|
1289
|
+
return w(R) ? y = "" : w($) ? y = `>=${R}.0.0${g} <${+R + 1}.0.0-0` : w(O) ? R === "0" ? y = `>=${R}.${$}.0${g} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.0${g} <${+R + 1}.0.0-0` : T ? (o("replaceCaret pr", T), R === "0" ? $ === "0" ? y = `>=${R}.${$}.${O}-${T} <${R}.${$}.${+O + 1}-0` : y = `>=${R}.${$}.${O}-${T} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.${O}-${T} <${+R + 1}.0.0-0`) : (o("no pr"), R === "0" ? $ === "0" ? y = `>=${R}.${$}.${O}${g} <${R}.${$}.${+O + 1}-0` : y = `>=${R}.${$}.${O}${g} <${R}.${+$ + 1}.0-0` : y = `>=${R}.${$}.${O} <${+R + 1}.0.0-0`), o("caret return", y), y;
|
|
807
1290
|
});
|
|
808
|
-
}, L = (
|
|
809
|
-
|
|
810
|
-
const
|
|
811
|
-
return
|
|
812
|
-
|
|
813
|
-
const y = w(
|
|
814
|
-
return
|
|
1291
|
+
}, L = (p, m) => (o("replaceXRanges", p, m), p.split(/\s+/).map((v) => M(v, m)).join(" ")), M = (p, m) => {
|
|
1292
|
+
p = p.trim();
|
|
1293
|
+
const v = m.loose ? a[l.XRANGELOOSE] : a[l.XRANGE];
|
|
1294
|
+
return p.replace(v, (g, I, R, $, O, T) => {
|
|
1295
|
+
o("xRange", p, g, I, R, $, O, T);
|
|
1296
|
+
const y = w(R), x = y || w($), P = x || w(O), V = P;
|
|
1297
|
+
return I === "=" && V && (I = ""), T = m.includePrerelease ? "-0" : "", y ? I === ">" || I === "<" ? g = "<0.0.0-0" : g = "*" : I && V ? (x && ($ = 0), O = 0, I === ">" ? (I = ">=", x ? (R = +R + 1, $ = 0, O = 0) : ($ = +$ + 1, O = 0)) : I === "<=" && (I = "<", x ? R = +R + 1 : $ = +$ + 1), I === "<" && (T = "-0"), g = `${I + R}.${$}.${O}${T}`) : x ? g = `>=${R}.0.0${T} <${+R + 1}.0.0-0` : P && (g = `>=${R}.${$}.0${T} <${R}.${+$ + 1}.0-0`), o("xRange return", g), g;
|
|
815
1298
|
});
|
|
816
|
-
}, Q = (
|
|
817
|
-
for (let
|
|
818
|
-
if (!
|
|
1299
|
+
}, Q = (p, m) => (o("replaceStars", p, m), p.trim().replace(a[l.STAR], "")), ee = (p, m) => (o("replaceGTE0", p, m), p.trim().replace(a[m.includePrerelease ? l.GTE0PRE : l.GTE0], "")), te = (p) => (m, v, g, I, R, $, O, T, y, x, P, V) => (w(g) ? v = "" : w(I) ? v = `>=${g}.0.0${p ? "-0" : ""}` : w(R) ? v = `>=${g}.${I}.0${p ? "-0" : ""}` : $ ? v = `>=${v}` : v = `>=${v}${p ? "-0" : ""}`, w(y) ? T = "" : w(x) ? T = `<${+y + 1}.0.0-0` : w(P) ? T = `<${y}.${+x + 1}.0-0` : V ? T = `<=${y}.${x}.${P}-${V}` : p ? T = `<${y}.${x}.${+P + 1}-0` : T = `<=${T}`, `${v} ${T}`.trim()), re = (p, m, v) => {
|
|
1300
|
+
for (let g = 0; g < p.length; g++)
|
|
1301
|
+
if (!p[g].test(m))
|
|
819
1302
|
return !1;
|
|
820
|
-
if (
|
|
821
|
-
for (let
|
|
822
|
-
if (
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
1303
|
+
if (m.prerelease.length && !v.includePrerelease) {
|
|
1304
|
+
for (let g = 0; g < p.length; g++)
|
|
1305
|
+
if (o(p[g].semver), p[g].semver !== c.ANY && p[g].semver.prerelease.length > 0) {
|
|
1306
|
+
const I = p[g].semver;
|
|
1307
|
+
if (I.major === m.major && I.minor === m.minor && I.patch === m.patch)
|
|
825
1308
|
return !0;
|
|
826
1309
|
}
|
|
827
1310
|
return !1;
|
|
828
1311
|
}
|
|
829
1312
|
return !0;
|
|
830
1313
|
};
|
|
831
|
-
return
|
|
1314
|
+
return be;
|
|
832
1315
|
}
|
|
833
|
-
var Ge,
|
|
834
|
-
function
|
|
835
|
-
if (
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
class
|
|
1316
|
+
var Ge, qt;
|
|
1317
|
+
function Z() {
|
|
1318
|
+
if (qt) return Ge;
|
|
1319
|
+
qt = 1;
|
|
1320
|
+
const r = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1321
|
+
class e {
|
|
839
1322
|
static get ANY() {
|
|
840
|
-
return
|
|
1323
|
+
return r;
|
|
841
1324
|
}
|
|
842
|
-
constructor(
|
|
843
|
-
if (u =
|
|
844
|
-
if (
|
|
845
|
-
return
|
|
846
|
-
|
|
1325
|
+
constructor(s, u) {
|
|
1326
|
+
if (u = t(u), s instanceof e) {
|
|
1327
|
+
if (s.loose === !!u.loose)
|
|
1328
|
+
return s;
|
|
1329
|
+
s = s.value;
|
|
847
1330
|
}
|
|
848
|
-
|
|
1331
|
+
s = s.trim().split(/\s+/).join(" "), o("comparator", s, u), this.options = u, this.loose = !!u.loose, this.parse(s), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, o("comp", this);
|
|
849
1332
|
}
|
|
850
|
-
parse(
|
|
851
|
-
const u = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR], f =
|
|
1333
|
+
parse(s) {
|
|
1334
|
+
const u = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR], f = s.match(u);
|
|
852
1335
|
if (!f)
|
|
853
|
-
throw new TypeError(`Invalid comparator: ${
|
|
854
|
-
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver =
|
|
1336
|
+
throw new TypeError(`Invalid comparator: ${s}`);
|
|
1337
|
+
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new h(f[2], this.options.loose) : this.semver = r;
|
|
855
1338
|
}
|
|
856
1339
|
toString() {
|
|
857
1340
|
return this.value;
|
|
858
1341
|
}
|
|
859
|
-
test(
|
|
860
|
-
if (
|
|
1342
|
+
test(s) {
|
|
1343
|
+
if (o("Comparator.test", s, this.options.loose), this.semver === r || s === r)
|
|
861
1344
|
return !0;
|
|
862
|
-
if (typeof
|
|
1345
|
+
if (typeof s == "string")
|
|
863
1346
|
try {
|
|
864
|
-
|
|
1347
|
+
s = new h(s, this.options);
|
|
865
1348
|
} catch {
|
|
866
1349
|
return !1;
|
|
867
1350
|
}
|
|
868
|
-
return c(
|
|
1351
|
+
return c(s, this.operator, this.semver, this.options);
|
|
869
1352
|
}
|
|
870
|
-
intersects(
|
|
871
|
-
if (!(
|
|
1353
|
+
intersects(s, u) {
|
|
1354
|
+
if (!(s instanceof e))
|
|
872
1355
|
throw new TypeError("a Comparator is required");
|
|
873
|
-
return this.operator === "" ? this.value === "" ? !0 : new
|
|
1356
|
+
return this.operator === "" ? this.value === "" ? !0 : new a(s.value, u).test(this.value) : s.operator === "" ? s.value === "" ? !0 : new a(this.value, u).test(s.semver) : (u = t(u), u.includePrerelease && (this.value === "<0.0.0-0" || s.value === "<0.0.0-0") || !u.includePrerelease && (this.value.startsWith("<0.0.0") || s.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && s.operator.startsWith(">") || this.operator.startsWith("<") && s.operator.startsWith("<") || this.semver.version === s.semver.version && this.operator.includes("=") && s.operator.includes("=") || c(this.semver, "<", s.semver, u) && this.operator.startsWith(">") && s.operator.startsWith("<") || c(this.semver, ">", s.semver, u) && this.operator.startsWith("<") && s.operator.startsWith(">")));
|
|
874
1357
|
}
|
|
875
1358
|
}
|
|
876
|
-
Ge =
|
|
877
|
-
const
|
|
1359
|
+
Ge = e;
|
|
1360
|
+
const t = Ye(), { safeRe: n, t: i } = B(), c = fr(), o = Y(), h = D(), a = F();
|
|
878
1361
|
return Ge;
|
|
879
1362
|
}
|
|
880
|
-
var xe,
|
|
881
|
-
function
|
|
882
|
-
if (
|
|
883
|
-
|
|
884
|
-
const
|
|
885
|
-
return xe = (
|
|
1363
|
+
var xe, bt;
|
|
1364
|
+
function J() {
|
|
1365
|
+
if (bt) return xe;
|
|
1366
|
+
bt = 1;
|
|
1367
|
+
const r = F();
|
|
1368
|
+
return xe = (t, n, i) => {
|
|
886
1369
|
try {
|
|
887
|
-
n = new
|
|
1370
|
+
n = new r(n, i);
|
|
888
1371
|
} catch {
|
|
889
1372
|
return !1;
|
|
890
1373
|
}
|
|
891
|
-
return n.test(
|
|
1374
|
+
return n.test(t);
|
|
892
1375
|
}, xe;
|
|
893
1376
|
}
|
|
894
|
-
var De,
|
|
895
|
-
function
|
|
896
|
-
if (
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
return De = (
|
|
1377
|
+
var De, Gt;
|
|
1378
|
+
function zr() {
|
|
1379
|
+
if (Gt) return De;
|
|
1380
|
+
Gt = 1;
|
|
1381
|
+
const r = F();
|
|
1382
|
+
return De = (t, n) => new r(t, n).set.map((i) => i.map((c) => c.value).join(" ").trim().split(" ")), De;
|
|
900
1383
|
}
|
|
901
|
-
var
|
|
902
|
-
function
|
|
903
|
-
if (
|
|
904
|
-
|
|
905
|
-
const
|
|
906
|
-
return
|
|
907
|
-
let
|
|
1384
|
+
var _e, xt;
|
|
1385
|
+
function Yr() {
|
|
1386
|
+
if (xt) return _e;
|
|
1387
|
+
xt = 1;
|
|
1388
|
+
const r = D(), e = F();
|
|
1389
|
+
return _e = (n, i, c) => {
|
|
1390
|
+
let o = null, h = null, a = null;
|
|
908
1391
|
try {
|
|
909
|
-
|
|
1392
|
+
a = new e(i, c);
|
|
910
1393
|
} catch {
|
|
911
1394
|
return null;
|
|
912
1395
|
}
|
|
913
|
-
return n.forEach((
|
|
914
|
-
|
|
915
|
-
}),
|
|
916
|
-
},
|
|
1396
|
+
return n.forEach((l) => {
|
|
1397
|
+
a.test(l) && (!o || h.compare(l) === -1) && (o = l, h = new r(o, c));
|
|
1398
|
+
}), o;
|
|
1399
|
+
}, _e;
|
|
917
1400
|
}
|
|
918
|
-
var
|
|
919
|
-
function
|
|
920
|
-
if (
|
|
921
|
-
|
|
922
|
-
const
|
|
923
|
-
return
|
|
924
|
-
let
|
|
1401
|
+
var Ue, Dt;
|
|
1402
|
+
function Kr() {
|
|
1403
|
+
if (Dt) return Ue;
|
|
1404
|
+
Dt = 1;
|
|
1405
|
+
const r = D(), e = F();
|
|
1406
|
+
return Ue = (n, i, c) => {
|
|
1407
|
+
let o = null, h = null, a = null;
|
|
925
1408
|
try {
|
|
926
|
-
|
|
1409
|
+
a = new e(i, c);
|
|
927
1410
|
} catch {
|
|
928
1411
|
return null;
|
|
929
1412
|
}
|
|
930
|
-
return n.forEach((
|
|
931
|
-
|
|
932
|
-
}),
|
|
933
|
-
},
|
|
1413
|
+
return n.forEach((l) => {
|
|
1414
|
+
a.test(l) && (!o || h.compare(l) === 1) && (o = l, h = new r(o, c));
|
|
1415
|
+
}), o;
|
|
1416
|
+
}, Ue;
|
|
934
1417
|
}
|
|
935
|
-
var
|
|
936
|
-
function
|
|
937
|
-
if (_t) return
|
|
1418
|
+
var Fe, _t;
|
|
1419
|
+
function Zr() {
|
|
1420
|
+
if (_t) return Fe;
|
|
938
1421
|
_t = 1;
|
|
939
|
-
const
|
|
940
|
-
return
|
|
941
|
-
i = new
|
|
942
|
-
let
|
|
943
|
-
if (i.test(
|
|
944
|
-
return
|
|
945
|
-
|
|
1422
|
+
const r = D(), e = F(), t = K();
|
|
1423
|
+
return Fe = (i, c) => {
|
|
1424
|
+
i = new e(i, c);
|
|
1425
|
+
let o = new r("0.0.0");
|
|
1426
|
+
if (i.test(o) || (o = new r("0.0.0-0"), i.test(o)))
|
|
1427
|
+
return o;
|
|
1428
|
+
o = null;
|
|
946
1429
|
for (let h = 0; h < i.set.length; ++h) {
|
|
947
|
-
const
|
|
948
|
-
let
|
|
949
|
-
|
|
950
|
-
const u = new
|
|
951
|
-
switch (
|
|
1430
|
+
const a = i.set[h];
|
|
1431
|
+
let l = null;
|
|
1432
|
+
a.forEach((s) => {
|
|
1433
|
+
const u = new r(s.semver.version);
|
|
1434
|
+
switch (s.operator) {
|
|
952
1435
|
case ">":
|
|
953
1436
|
u.prerelease.length === 0 ? u.patch++ : u.prerelease.push(0), u.raw = u.format();
|
|
954
1437
|
/* fallthrough */
|
|
955
1438
|
case "":
|
|
956
1439
|
case ">=":
|
|
957
|
-
(!
|
|
1440
|
+
(!l || t(u, l)) && (l = u);
|
|
958
1441
|
break;
|
|
959
1442
|
case "<":
|
|
960
1443
|
case "<=":
|
|
961
1444
|
break;
|
|
962
1445
|
/* istanbul ignore next */
|
|
963
1446
|
default:
|
|
964
|
-
throw new Error(`Unexpected operation: ${
|
|
1447
|
+
throw new Error(`Unexpected operation: ${s.operator}`);
|
|
965
1448
|
}
|
|
966
|
-
}),
|
|
1449
|
+
}), l && (!o || t(o, l)) && (o = l);
|
|
967
1450
|
}
|
|
968
|
-
return
|
|
969
|
-
},
|
|
1451
|
+
return o && i.test(o) ? o : null;
|
|
1452
|
+
}, Fe;
|
|
970
1453
|
}
|
|
971
|
-
var
|
|
972
|
-
function
|
|
973
|
-
if (Ut) return
|
|
1454
|
+
var ke, Ut;
|
|
1455
|
+
function Jr() {
|
|
1456
|
+
if (Ut) return ke;
|
|
974
1457
|
Ut = 1;
|
|
975
|
-
const
|
|
976
|
-
return
|
|
1458
|
+
const r = F();
|
|
1459
|
+
return ke = (t, n) => {
|
|
977
1460
|
try {
|
|
978
|
-
return new t
|
|
1461
|
+
return new r(t, n).range || "*";
|
|
979
1462
|
} catch {
|
|
980
1463
|
return null;
|
|
981
1464
|
}
|
|
982
|
-
},
|
|
1465
|
+
}, ke;
|
|
983
1466
|
}
|
|
984
|
-
var
|
|
1467
|
+
var je, Ft;
|
|
985
1468
|
function et() {
|
|
986
|
-
if (
|
|
987
|
-
|
|
988
|
-
const
|
|
989
|
-
return
|
|
990
|
-
|
|
991
|
-
let S,
|
|
1469
|
+
if (Ft) return je;
|
|
1470
|
+
Ft = 1;
|
|
1471
|
+
const r = D(), e = Z(), { ANY: t } = e, n = F(), i = J(), c = K(), o = Ze(), h = Qe(), a = Je();
|
|
1472
|
+
return je = (s, u, f, E) => {
|
|
1473
|
+
s = new r(s, E), u = new n(u, E);
|
|
1474
|
+
let S, d, N, A, b;
|
|
992
1475
|
switch (f) {
|
|
993
1476
|
case ">":
|
|
994
|
-
S = c,
|
|
1477
|
+
S = c, d = h, N = o, A = ">", b = ">=";
|
|
995
1478
|
break;
|
|
996
1479
|
case "<":
|
|
997
|
-
S =
|
|
1480
|
+
S = o, d = a, N = c, A = "<", b = "<=";
|
|
998
1481
|
break;
|
|
999
1482
|
default:
|
|
1000
1483
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1001
1484
|
}
|
|
1002
|
-
if (i(
|
|
1485
|
+
if (i(s, u, E))
|
|
1003
1486
|
return !1;
|
|
1004
1487
|
for (let w = 0; w < u.set.length; ++w) {
|
|
1005
|
-
const
|
|
1488
|
+
const G = u.set[w];
|
|
1006
1489
|
let _ = null, C = null;
|
|
1007
|
-
if (
|
|
1008
|
-
|
|
1009
|
-
}), _.operator === A || _.operator ===
|
|
1490
|
+
if (G.forEach((q) => {
|
|
1491
|
+
q.semver === t && (q = new e(">=0.0.0")), _ = _ || q, C = C || q, S(q.semver, _.semver, E) ? _ = q : N(q.semver, C.semver, E) && (C = q);
|
|
1492
|
+
}), _.operator === A || _.operator === b || (!C.operator || C.operator === A) && d(s, C.semver))
|
|
1010
1493
|
return !1;
|
|
1011
|
-
if (C.operator ===
|
|
1494
|
+
if (C.operator === b && N(s, C.semver))
|
|
1012
1495
|
return !1;
|
|
1013
1496
|
}
|
|
1014
1497
|
return !0;
|
|
1015
|
-
},
|
|
1498
|
+
}, je;
|
|
1016
1499
|
}
|
|
1017
|
-
var Me,
|
|
1018
|
-
function
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1021
|
-
const
|
|
1022
|
-
return Me = (
|
|
1500
|
+
var Me, kt;
|
|
1501
|
+
function Qr() {
|
|
1502
|
+
if (kt) return Me;
|
|
1503
|
+
kt = 1;
|
|
1504
|
+
const r = et();
|
|
1505
|
+
return Me = (t, n, i) => r(t, n, ">", i), Me;
|
|
1023
1506
|
}
|
|
1024
|
-
var Ve,
|
|
1025
|
-
function
|
|
1026
|
-
if (
|
|
1507
|
+
var Ve, jt;
|
|
1508
|
+
function es() {
|
|
1509
|
+
if (jt) return Ve;
|
|
1510
|
+
jt = 1;
|
|
1511
|
+
const r = et();
|
|
1512
|
+
return Ve = (t, n, i) => r(t, n, "<", i), Ve;
|
|
1513
|
+
}
|
|
1514
|
+
var Xe, Mt;
|
|
1515
|
+
function ts() {
|
|
1516
|
+
if (Mt) return Xe;
|
|
1027
1517
|
Mt = 1;
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
1518
|
+
const r = F();
|
|
1519
|
+
return Xe = (t, n, i) => (t = new r(t, i), n = new r(n, i), t.intersects(n, i)), Xe;
|
|
1030
1520
|
}
|
|
1031
|
-
var
|
|
1032
|
-
function
|
|
1033
|
-
if (Vt) return
|
|
1521
|
+
var Be, Vt;
|
|
1522
|
+
function rs() {
|
|
1523
|
+
if (Vt) return Be;
|
|
1034
1524
|
Vt = 1;
|
|
1035
|
-
const
|
|
1036
|
-
return
|
|
1037
|
-
}
|
|
1038
|
-
var Xe, kt;
|
|
1039
|
-
function Yr() {
|
|
1040
|
-
if (kt) return Xe;
|
|
1041
|
-
kt = 1;
|
|
1042
|
-
const t = Z(), s = U();
|
|
1043
|
-
return Xe = (r, n, i) => {
|
|
1525
|
+
const r = J(), e = U();
|
|
1526
|
+
return Be = (t, n, i) => {
|
|
1044
1527
|
const c = [];
|
|
1045
|
-
let
|
|
1046
|
-
const
|
|
1047
|
-
for (const f of
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1051
|
-
for (const [f,
|
|
1052
|
-
f ===
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1055
|
-
},
|
|
1056
|
-
}
|
|
1057
|
-
var
|
|
1058
|
-
function
|
|
1059
|
-
if (Xt) return
|
|
1528
|
+
let o = null, h = null;
|
|
1529
|
+
const a = t.sort((f, E) => e(f, E, i));
|
|
1530
|
+
for (const f of a)
|
|
1531
|
+
r(f, n, i) ? (h = f, o || (o = f)) : (h && c.push([o, h]), h = null, o = null);
|
|
1532
|
+
o && c.push([o, null]);
|
|
1533
|
+
const l = [];
|
|
1534
|
+
for (const [f, E] of c)
|
|
1535
|
+
f === E ? l.push(f) : !E && f === a[0] ? l.push("*") : E ? f === a[0] ? l.push(`<=${E}`) : l.push(`${f} - ${E}`) : l.push(`>=${f}`);
|
|
1536
|
+
const s = l.join(" || "), u = typeof n.raw == "string" ? n.raw : String(n);
|
|
1537
|
+
return s.length < u.length ? s : n;
|
|
1538
|
+
}, Be;
|
|
1539
|
+
}
|
|
1540
|
+
var We, Xt;
|
|
1541
|
+
function ss() {
|
|
1542
|
+
if (Xt) return We;
|
|
1060
1543
|
Xt = 1;
|
|
1061
|
-
const
|
|
1544
|
+
const r = F(), e = Z(), { ANY: t } = e, n = J(), i = U(), c = (u, f, E = {}) => {
|
|
1062
1545
|
if (u === f)
|
|
1063
1546
|
return !0;
|
|
1064
|
-
u = new
|
|
1547
|
+
u = new r(u, E), f = new r(f, E);
|
|
1065
1548
|
let S = !1;
|
|
1066
|
-
e: for (const
|
|
1549
|
+
e: for (const d of u.set) {
|
|
1067
1550
|
for (const N of f.set) {
|
|
1068
|
-
const A =
|
|
1551
|
+
const A = a(d, N, E);
|
|
1069
1552
|
if (S = S || A !== null, A)
|
|
1070
1553
|
continue e;
|
|
1071
1554
|
}
|
|
@@ -1073,143 +1556,142 @@ function zr() {
|
|
|
1073
1556
|
return !1;
|
|
1074
1557
|
}
|
|
1075
1558
|
return !0;
|
|
1076
|
-
},
|
|
1559
|
+
}, o = [new e(">=0.0.0-0")], h = [new e(">=0.0.0")], a = (u, f, E) => {
|
|
1077
1560
|
if (u === f)
|
|
1078
1561
|
return !0;
|
|
1079
|
-
if (u.length === 1 && u[0].semver ===
|
|
1080
|
-
if (f.length === 1 && f[0].semver ===
|
|
1562
|
+
if (u.length === 1 && u[0].semver === t) {
|
|
1563
|
+
if (f.length === 1 && f[0].semver === t)
|
|
1081
1564
|
return !0;
|
|
1082
|
-
|
|
1565
|
+
E.includePrerelease ? u = o : u = h;
|
|
1083
1566
|
}
|
|
1084
|
-
if (f.length === 1 && f[0].semver ===
|
|
1085
|
-
if (
|
|
1567
|
+
if (f.length === 1 && f[0].semver === t) {
|
|
1568
|
+
if (E.includePrerelease)
|
|
1086
1569
|
return !0;
|
|
1087
1570
|
f = h;
|
|
1088
1571
|
}
|
|
1089
1572
|
const S = /* @__PURE__ */ new Set();
|
|
1090
|
-
let
|
|
1573
|
+
let d, N;
|
|
1091
1574
|
for (const L of u)
|
|
1092
|
-
L.operator === ">" || L.operator === ">=" ?
|
|
1575
|
+
L.operator === ">" || L.operator === ">=" ? d = l(d, L, E) : L.operator === "<" || L.operator === "<=" ? N = s(N, L, E) : S.add(L.semver);
|
|
1093
1576
|
if (S.size > 1)
|
|
1094
1577
|
return null;
|
|
1095
1578
|
let A;
|
|
1096
|
-
if (
|
|
1097
|
-
if (A = i(
|
|
1579
|
+
if (d && N) {
|
|
1580
|
+
if (A = i(d.semver, N.semver, E), A > 0)
|
|
1098
1581
|
return null;
|
|
1099
|
-
if (A === 0 && (
|
|
1582
|
+
if (A === 0 && (d.operator !== ">=" || N.operator !== "<="))
|
|
1100
1583
|
return null;
|
|
1101
1584
|
}
|
|
1102
1585
|
for (const L of S) {
|
|
1103
|
-
if (
|
|
1586
|
+
if (d && !n(L, String(d), E) || N && !n(L, String(N), E))
|
|
1104
1587
|
return null;
|
|
1105
|
-
for (const
|
|
1106
|
-
if (!n(L, String(
|
|
1588
|
+
for (const M of f)
|
|
1589
|
+
if (!n(L, String(M), E))
|
|
1107
1590
|
return !1;
|
|
1108
1591
|
return !0;
|
|
1109
1592
|
}
|
|
1110
|
-
let
|
|
1593
|
+
let b, w, G, _, C = N && !E.includePrerelease && N.semver.prerelease.length ? N.semver : !1, q = d && !E.includePrerelease && d.semver.prerelease.length ? d.semver : !1;
|
|
1111
1594
|
C && C.prerelease.length === 1 && N.operator === "<" && C.prerelease[0] === 0 && (C = !1);
|
|
1112
1595
|
for (const L of f) {
|
|
1113
|
-
if (_ = _ || L.operator === ">" || L.operator === ">=",
|
|
1114
|
-
if (
|
|
1115
|
-
if (
|
|
1596
|
+
if (_ = _ || L.operator === ">" || L.operator === ">=", G = G || L.operator === "<" || L.operator === "<=", d) {
|
|
1597
|
+
if (q && L.semver.prerelease && L.semver.prerelease.length && L.semver.major === q.major && L.semver.minor === q.minor && L.semver.patch === q.patch && (q = !1), L.operator === ">" || L.operator === ">=") {
|
|
1598
|
+
if (b = l(d, L, E), b === L && b !== d)
|
|
1116
1599
|
return !1;
|
|
1117
|
-
} else if (
|
|
1600
|
+
} else if (d.operator === ">=" && !n(d.semver, String(L), E))
|
|
1118
1601
|
return !1;
|
|
1119
1602
|
}
|
|
1120
1603
|
if (N) {
|
|
1121
1604
|
if (C && L.semver.prerelease && L.semver.prerelease.length && L.semver.major === C.major && L.semver.minor === C.minor && L.semver.patch === C.patch && (C = !1), L.operator === "<" || L.operator === "<=") {
|
|
1122
|
-
if (w =
|
|
1605
|
+
if (w = s(N, L, E), w === L && w !== N)
|
|
1123
1606
|
return !1;
|
|
1124
|
-
} else if (N.operator === "<=" && !n(N.semver, String(L),
|
|
1607
|
+
} else if (N.operator === "<=" && !n(N.semver, String(L), E))
|
|
1125
1608
|
return !1;
|
|
1126
1609
|
}
|
|
1127
|
-
if (!L.operator && (N ||
|
|
1610
|
+
if (!L.operator && (N || d) && A !== 0)
|
|
1128
1611
|
return !1;
|
|
1129
1612
|
}
|
|
1130
|
-
return !(
|
|
1131
|
-
},
|
|
1613
|
+
return !(d && G && !N && A !== 0 || N && _ && !d && A !== 0 || q || C);
|
|
1614
|
+
}, l = (u, f, E) => {
|
|
1132
1615
|
if (!u)
|
|
1133
1616
|
return f;
|
|
1134
|
-
const S = i(u.semver, f.semver,
|
|
1617
|
+
const S = i(u.semver, f.semver, E);
|
|
1135
1618
|
return S > 0 ? u : S < 0 || f.operator === ">" && u.operator === ">=" ? f : u;
|
|
1136
|
-
},
|
|
1619
|
+
}, s = (u, f, E) => {
|
|
1137
1620
|
if (!u)
|
|
1138
1621
|
return f;
|
|
1139
|
-
const S = i(u.semver, f.semver,
|
|
1622
|
+
const S = i(u.semver, f.semver, E);
|
|
1140
1623
|
return S < 0 ? u : S > 0 || f.operator === "<" && u.operator === "<=" ? f : u;
|
|
1141
1624
|
};
|
|
1142
|
-
return
|
|
1625
|
+
return We = c, We;
|
|
1143
1626
|
}
|
|
1144
1627
|
var He, Bt;
|
|
1145
|
-
function
|
|
1628
|
+
function ns() {
|
|
1146
1629
|
if (Bt) return He;
|
|
1147
1630
|
Bt = 1;
|
|
1148
|
-
const
|
|
1631
|
+
const r = B(), e = z(), t = D(), n = cr(), i = j(), c = Gr(), o = xr(), h = Dr(), a = _r(), l = Ur(), s = Fr(), u = kr(), f = jr(), E = U(), S = Mr(), d = Vr(), N = Ke(), A = Xr(), b = Br(), w = K(), G = Ze(), _ = ur(), C = hr(), q = Je(), L = Qe(), M = fr(), Q = Wr(), ee = Z(), te = F(), re = J(), p = zr(), m = Yr(), v = Kr(), g = Zr(), I = Jr(), R = et(), $ = Qr(), O = es(), T = ts(), y = rs(), x = ss();
|
|
1149
1632
|
return He = {
|
|
1150
1633
|
parse: i,
|
|
1151
1634
|
valid: c,
|
|
1152
|
-
clean:
|
|
1635
|
+
clean: o,
|
|
1153
1636
|
inc: h,
|
|
1154
|
-
diff:
|
|
1155
|
-
major:
|
|
1156
|
-
minor:
|
|
1637
|
+
diff: a,
|
|
1638
|
+
major: l,
|
|
1639
|
+
minor: s,
|
|
1157
1640
|
patch: u,
|
|
1158
1641
|
prerelease: f,
|
|
1159
|
-
compare:
|
|
1642
|
+
compare: E,
|
|
1160
1643
|
rcompare: S,
|
|
1161
|
-
compareLoose:
|
|
1644
|
+
compareLoose: d,
|
|
1162
1645
|
compareBuild: N,
|
|
1163
1646
|
sort: A,
|
|
1164
|
-
rsort:
|
|
1647
|
+
rsort: b,
|
|
1165
1648
|
gt: w,
|
|
1166
|
-
lt:
|
|
1649
|
+
lt: G,
|
|
1167
1650
|
eq: _,
|
|
1168
1651
|
neq: C,
|
|
1169
|
-
gte:
|
|
1652
|
+
gte: q,
|
|
1170
1653
|
lte: L,
|
|
1171
|
-
cmp:
|
|
1654
|
+
cmp: M,
|
|
1172
1655
|
coerce: Q,
|
|
1173
1656
|
Comparator: ee,
|
|
1174
1657
|
Range: te,
|
|
1175
1658
|
satisfies: re,
|
|
1176
|
-
toComparators:
|
|
1177
|
-
maxSatisfying:
|
|
1178
|
-
minSatisfying:
|
|
1179
|
-
minVersion:
|
|
1180
|
-
validRange:
|
|
1181
|
-
outside:
|
|
1659
|
+
toComparators: p,
|
|
1660
|
+
maxSatisfying: m,
|
|
1661
|
+
minSatisfying: v,
|
|
1662
|
+
minVersion: g,
|
|
1663
|
+
validRange: I,
|
|
1664
|
+
outside: R,
|
|
1182
1665
|
gtr: $,
|
|
1183
1666
|
ltr: O,
|
|
1184
1667
|
intersects: T,
|
|
1185
1668
|
simplifyRange: y,
|
|
1186
|
-
subset:
|
|
1187
|
-
SemVer:
|
|
1188
|
-
re:
|
|
1189
|
-
src:
|
|
1190
|
-
tokens:
|
|
1191
|
-
SEMVER_SPEC_VERSION:
|
|
1192
|
-
RELEASE_TYPES:
|
|
1669
|
+
subset: x,
|
|
1670
|
+
SemVer: t,
|
|
1671
|
+
re: r.re,
|
|
1672
|
+
src: r.src,
|
|
1673
|
+
tokens: r.t,
|
|
1674
|
+
SEMVER_SPEC_VERSION: e.SEMVER_SPEC_VERSION,
|
|
1675
|
+
RELEASE_TYPES: e.RELEASE_TYPES,
|
|
1193
1676
|
compareIdentifiers: n.compareIdentifiers,
|
|
1194
1677
|
rcompareIdentifiers: n.rcompareIdentifiers
|
|
1195
1678
|
}, He;
|
|
1196
1679
|
}
|
|
1197
|
-
var
|
|
1198
|
-
const
|
|
1199
|
-
class
|
|
1200
|
-
config = new
|
|
1201
|
-
event = new
|
|
1680
|
+
var is = ns();
|
|
1681
|
+
const Wt = `^${X.Version}`;
|
|
1682
|
+
class ls {
|
|
1683
|
+
config = new dr(Ht);
|
|
1684
|
+
event = new pr();
|
|
1202
1685
|
state;
|
|
1203
1686
|
active;
|
|
1204
1687
|
time;
|
|
1205
|
-
offset;
|
|
1206
1688
|
info;
|
|
1207
|
-
|
|
1689
|
+
merger = new Pr();
|
|
1690
|
+
offset = new qr();
|
|
1691
|
+
driver = new br();
|
|
1208
1692
|
constructor() {
|
|
1209
1693
|
this.state = {
|
|
1210
1694
|
playing: !1,
|
|
1211
|
-
frameId: null,
|
|
1212
|
-
timerId: null,
|
|
1213
1695
|
scanIndex: 0
|
|
1214
1696
|
}, this.active = {
|
|
1215
1697
|
lines: [],
|
|
@@ -1217,14 +1699,11 @@ class ts {
|
|
|
1217
1699
|
}, this.time = {
|
|
1218
1700
|
start: 0,
|
|
1219
1701
|
seek: 0
|
|
1220
|
-
}, this.offset = {
|
|
1221
|
-
temp: 0,
|
|
1222
|
-
meta: 0
|
|
1223
1702
|
}, this.info = new X.Info(), this.config.event.add("update", this.onConfigUpdate);
|
|
1224
1703
|
}
|
|
1225
|
-
onConfigUpdate = (
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1704
|
+
onConfigUpdate = (e) => {
|
|
1705
|
+
const t = e.has("offset.useMeta");
|
|
1706
|
+
t && this.offset.refreshFromMeta(this.info, this.config.current.offset.useMeta), (t || e.has("offset.global")) && this.handleSyncTime(), (e.has("mergeWindow") || e.has("mergeLimit")) && (this.handleBuildMergedLineEnd(), this.handleSyncTime());
|
|
1228
1707
|
};
|
|
1229
1708
|
// Get current playback time.
|
|
1230
1709
|
handleGetCurrentTime() {
|
|
@@ -1234,126 +1713,91 @@ class ts {
|
|
|
1234
1713
|
handleGetEffectiveTime() {
|
|
1235
1714
|
return this.handleGetCurrentTime() + this.currentOffset;
|
|
1236
1715
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
const r = this.info.metas.find((i) => i.type === X.MetaType.Offset)?.content, n = typeof r == "number" && Number.isFinite(r) ? r : 0;
|
|
1241
|
-
this.offset.meta = n;
|
|
1242
|
-
} else
|
|
1243
|
-
this.offset.meta = 0;
|
|
1244
|
-
}
|
|
1245
|
-
handleGetLineTime(s) {
|
|
1246
|
-
if (s < 0 || s >= this.info.lines.length)
|
|
1247
|
-
return 0;
|
|
1248
|
-
if (s === this.info.lines.length - 1)
|
|
1249
|
-
return 1 / 0;
|
|
1250
|
-
const r = this.info.lines[s], n = this.info.lines[s + 1];
|
|
1251
|
-
return Math.max(r.time.end, n.time.start);
|
|
1252
|
-
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Rebuild the merged line-end table from the current lyric and merge config.
|
|
1718
|
+
*/
|
|
1253
1719
|
handleBuildMergedLineEnd() {
|
|
1254
|
-
|
|
1255
|
-
if (s === 0) {
|
|
1256
|
-
this.mergedLineEnd = r;
|
|
1257
|
-
return;
|
|
1258
|
-
}
|
|
1259
|
-
const n = Math.max(0, this.config.current.mergeWindow);
|
|
1260
|
-
let i = this.handleGetLineTime(s - 1);
|
|
1261
|
-
r[s - 1] = i;
|
|
1262
|
-
for (let c = s - 2; c >= 0; c--) {
|
|
1263
|
-
const l = this.handleGetLineTime(c);
|
|
1264
|
-
n > 0 && Math.abs(i - l) < n ? r[c] = Math.max(l, r[c + 1]) : r[c] = l, i = l;
|
|
1265
|
-
}
|
|
1266
|
-
this.mergedLineEnd = r;
|
|
1267
|
-
}
|
|
1268
|
-
handleGetMergedLineTime(s) {
|
|
1269
|
-
const r = this.mergedLineEnd[s];
|
|
1270
|
-
return r === void 0 ? this.handleGetLineTime(s) : r;
|
|
1720
|
+
this.merger.build(this.info.lines, this.config.current.mergeWindow, this.config.current.mergeLimit);
|
|
1271
1721
|
}
|
|
1272
1722
|
handleGetActiveIndex() {
|
|
1273
1723
|
return this.active.index.length > 0 ? this.active.index[0] : -1;
|
|
1274
1724
|
}
|
|
1275
|
-
handleBridgeActive(
|
|
1276
|
-
if (!this.config.current.bridgeActive ||
|
|
1277
|
-
return { lines:
|
|
1278
|
-
const n =
|
|
1279
|
-
if (i - n + 1 ===
|
|
1280
|
-
return { lines:
|
|
1725
|
+
handleBridgeActive(e, t) {
|
|
1726
|
+
if (!this.config.current.bridgeActive || t.length < 2)
|
|
1727
|
+
return { lines: e, index: t };
|
|
1728
|
+
const n = t[0], i = t[t.length - 1];
|
|
1729
|
+
if (i - n + 1 === t.length)
|
|
1730
|
+
return { lines: e, index: t };
|
|
1281
1731
|
const c = /* @__PURE__ */ new Map();
|
|
1282
|
-
for (let
|
|
1283
|
-
c.set(
|
|
1284
|
-
const
|
|
1285
|
-
for (let
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1732
|
+
for (let a = 0; a < t.length; a++)
|
|
1733
|
+
c.set(t[a], e[a]);
|
|
1734
|
+
const o = [], h = [];
|
|
1735
|
+
for (let a = n; a <= i; a++) {
|
|
1736
|
+
const l = c.get(a) ?? this.info.lines[a];
|
|
1737
|
+
l && (o.push(l), h.push(a));
|
|
1288
1738
|
}
|
|
1289
|
-
return { lines:
|
|
1739
|
+
return { lines: o, index: h };
|
|
1290
1740
|
}
|
|
1291
|
-
handleEmitLinesUpdate(
|
|
1292
|
-
const
|
|
1293
|
-
this.event.emit("linesUpdate",
|
|
1741
|
+
handleEmitLinesUpdate(e) {
|
|
1742
|
+
const t = this.handleBridgeActive(this.active.lines, this.active.index);
|
|
1743
|
+
this.event.emit("linesUpdate", t.lines, t.index, this.handleGetActiveIndex(), e);
|
|
1294
1744
|
}
|
|
1295
|
-
handleSyncTime(
|
|
1296
|
-
if (!this.info.lines.length || (
|
|
1745
|
+
handleSyncTime(e) {
|
|
1746
|
+
if (!this.info.lines.length || (e === void 0 && (e = this.handleGetEffectiveTime()), !Number.isFinite(e)))
|
|
1297
1747
|
return;
|
|
1298
|
-
const
|
|
1748
|
+
const t = [], n = [];
|
|
1299
1749
|
let i = this.info.lines.length;
|
|
1300
1750
|
for (let c = 0; c < this.info.lines.length; c++) {
|
|
1301
|
-
const
|
|
1302
|
-
if (
|
|
1751
|
+
const o = this.info.lines[c];
|
|
1752
|
+
if (o.time.start > e) {
|
|
1303
1753
|
i = c;
|
|
1304
1754
|
break;
|
|
1305
1755
|
}
|
|
1306
|
-
this.
|
|
1756
|
+
this.merger.getMergedTime(c) > e && (t.push(o), n.push(c));
|
|
1307
1757
|
}
|
|
1308
|
-
this.state.scanIndex = i, this.active.lines =
|
|
1758
|
+
this.state.scanIndex = i, this.active.lines = t, this.active.index = n, this.handleEmitLinesUpdate(!0);
|
|
1309
1759
|
}
|
|
1310
|
-
handleUpdateActiveLines(
|
|
1311
|
-
let
|
|
1760
|
+
handleUpdateActiveLines(e) {
|
|
1761
|
+
let t = !1;
|
|
1312
1762
|
const n = [], i = [];
|
|
1313
1763
|
for (let c = 0; c < this.active.lines.length; c++) {
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1764
|
+
const o = this.active.lines[c], h = this.active.index[c];
|
|
1765
|
+
e >= this.merger.getMergedTime(h) ? t = !0 : (n.push(o), i.push(h));
|
|
1316
1766
|
}
|
|
1317
1767
|
for (; this.state.scanIndex < this.info.lines.length; ) {
|
|
1318
1768
|
const c = this.info.lines[this.state.scanIndex];
|
|
1319
|
-
if (
|
|
1320
|
-
|
|
1769
|
+
if (e >= c.time.start)
|
|
1770
|
+
e < this.merger.getMergedTime(this.state.scanIndex) && (n.push(c), i.push(this.state.scanIndex), t = !0), this.state.scanIndex++;
|
|
1321
1771
|
else
|
|
1322
1772
|
break;
|
|
1323
1773
|
}
|
|
1324
|
-
|
|
1774
|
+
t && (this.active.lines = n, this.active.index = i, this.handleEmitLinesUpdate(!1));
|
|
1325
1775
|
}
|
|
1326
1776
|
onTick = () => {
|
|
1327
1777
|
if (!this.state.playing)
|
|
1328
1778
|
return;
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1331
|
-
case "animation":
|
|
1332
|
-
this.state.frameId = globalThis.requestAnimationFrame(this.onTick);
|
|
1333
|
-
break;
|
|
1334
|
-
case "timer":
|
|
1335
|
-
this.state.timerId = globalThis.setTimeout(this.onTick, 16);
|
|
1336
|
-
break;
|
|
1337
|
-
}
|
|
1779
|
+
const e = this.handleGetEffectiveTime();
|
|
1780
|
+
this.handleUpdateActiveLines(e), this.driver.schedule(this.config.current.driver, this.onTick);
|
|
1338
1781
|
};
|
|
1339
|
-
updateLyric(
|
|
1340
|
-
if (!
|
|
1782
|
+
updateLyric(e) {
|
|
1783
|
+
if (!e)
|
|
1341
1784
|
return;
|
|
1342
|
-
let
|
|
1343
|
-
|
|
1785
|
+
let t = e;
|
|
1786
|
+
is.satisfies(e.version, Wt) || (console.warn(`[music-lyric-player] ignored lyric with incompatible version "${e.version}", expected "${Wt}"`), t = new X.Info()), this.pause(), this.info = t, this.handleBuildMergedLineEnd(), this.offset.refreshFromMeta(this.info, this.config.current.offset.useMeta), this.config.current.offset.resetTempOnLyricChange && this.offset.resetTemp(), this.active.lines = [], this.active.index = [], this.state.scanIndex = 0, this.time.seek = 0, this.event.emit("lyricUpdate", t), this.event.emit("linesUpdate", [], [], -1, !1);
|
|
1344
1787
|
}
|
|
1345
1788
|
/**
|
|
1346
1789
|
* Start playback
|
|
1790
|
+
*
|
|
1347
1791
|
* @param time Optional time in ms to seek to before starting playback. If not provided, playback will start from the current position.
|
|
1348
1792
|
*/
|
|
1349
|
-
play(
|
|
1350
|
-
this.pause(), typeof
|
|
1793
|
+
play(e) {
|
|
1794
|
+
this.pause(), typeof e == "number" && Number.isFinite(e) && (this.time.seek = e, this.handleSyncTime()), this.time.start = performance.now(), this.state.playing = !0, this.onTick(), this.event.emit("play", this.handleGetCurrentTime());
|
|
1351
1795
|
}
|
|
1352
1796
|
/**
|
|
1353
1797
|
* Pause playback
|
|
1354
1798
|
*/
|
|
1355
1799
|
pause() {
|
|
1356
|
-
this.state.playing && (this.time.seek = this.handleGetCurrentTime(), this.state.playing = !1, this.event.emit("pause", this.time.seek)), this.
|
|
1800
|
+
this.state.playing && (this.time.seek = this.handleGetCurrentTime(), this.state.playing = !1, this.event.emit("pause", this.time.seek)), this.driver.cancel();
|
|
1357
1801
|
}
|
|
1358
1802
|
/**
|
|
1359
1803
|
* Stop playback
|
|
@@ -1363,34 +1807,40 @@ class ts {
|
|
|
1363
1807
|
}
|
|
1364
1808
|
/**
|
|
1365
1809
|
* Update the temp offset in ms (the user's temporary adjustment).
|
|
1810
|
+
*
|
|
1366
1811
|
* Stacked on top of the global config offset and the lyric's meta offset, then resyncs immediately.
|
|
1812
|
+
*
|
|
1367
1813
|
* @param value temp offset in ms; non-finite values are treated as 0.
|
|
1368
1814
|
*/
|
|
1369
|
-
updateTempOffset(
|
|
1370
|
-
this.offset.
|
|
1815
|
+
updateTempOffset(e) {
|
|
1816
|
+
this.offset.setTemp(e), this.handleSyncTime();
|
|
1371
1817
|
}
|
|
1372
1818
|
/**
|
|
1373
1819
|
* Find all active lines at the given time (ms). Does not mutate internal state.
|
|
1820
|
+
*
|
|
1374
1821
|
* Assumes `info.lines` is sorted by `time.start` ascending.
|
|
1822
|
+
*
|
|
1375
1823
|
* @param time time in ms to find active lines for.
|
|
1376
1824
|
*/
|
|
1377
|
-
matchLinesWithTime(
|
|
1378
|
-
const
|
|
1825
|
+
matchLinesWithTime(e) {
|
|
1826
|
+
const t = e + this.currentOffset, n = [], i = [];
|
|
1379
1827
|
for (let c = 0; c < this.info.lines.length; c++) {
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1828
|
+
const o = this.info.lines[c];
|
|
1829
|
+
if (o.time.start > t)
|
|
1382
1830
|
break;
|
|
1383
|
-
this.
|
|
1831
|
+
this.merger.getMergedTime(c) > t && (n.push(o), i.push(c));
|
|
1384
1832
|
}
|
|
1385
1833
|
return this.handleBridgeActive(n, i);
|
|
1386
1834
|
}
|
|
1387
1835
|
/**
|
|
1388
1836
|
* Convert a content (lyric) time to the playback clock by removing the active offset.
|
|
1837
|
+
*
|
|
1389
1838
|
* Seeking playback to the returned time makes a line at `contentTime` become active.
|
|
1839
|
+
*
|
|
1390
1840
|
* @param contentTime content time in ms (e.g. a line's start).
|
|
1391
1841
|
*/
|
|
1392
|
-
convertContentTime(
|
|
1393
|
-
return
|
|
1842
|
+
convertContentTime(e) {
|
|
1843
|
+
return e - this.currentOffset;
|
|
1394
1844
|
}
|
|
1395
1845
|
/**
|
|
1396
1846
|
* Whether the player is currently playing.
|
|
@@ -1432,12 +1882,11 @@ class ts {
|
|
|
1432
1882
|
* The current effective lyric offset in ms (config offset + lyric meta offset + temp offset).
|
|
1433
1883
|
*/
|
|
1434
1884
|
get currentOffset() {
|
|
1435
|
-
|
|
1436
|
-
return Number.isFinite(s) ? s : 0;
|
|
1885
|
+
return this.offset.resolve(this.config.current.offset.global);
|
|
1437
1886
|
}
|
|
1438
1887
|
}
|
|
1439
1888
|
export {
|
|
1440
|
-
|
|
1441
|
-
|
|
1889
|
+
ls as BaseLyricPlayer,
|
|
1890
|
+
os as BaseLyricPlayerConfig
|
|
1442
1891
|
};
|
|
1443
1892
|
//# sourceMappingURL=index.ecma.js.map
|