@telia-ace/alliance-utilities 1.0.8 → 1.0.9-next.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/dist/index.js DELETED
@@ -1,2807 +0,0 @@
1
- var $n = Object.defineProperty;
2
- var Pn = (e, t, r) => t in e ? $n(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var Le = (e, t, r) => (Pn(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import mr from "fs";
5
- import X, { resolve as xt, dirname as kn, relative as Fn } from "path";
6
- import { pipeline as jn } from "stream/promises";
7
- var dr = /* @__PURE__ */ ((e) => (e[e.Done = 0] = "Done", e[e.NoWorkspaceName = 1] = "NoWorkspaceName", e[e.NoAppName = 2] = "NoAppName", e[e.AlreadyExists = 3] = "AlreadyExists", e[e.NoAppOrWorkspaceInCurrentDirectory = 4] = "NoAppOrWorkspaceInCurrentDirectory", e[e.UnrecognizedCommand = 5] = "UnrecognizedCommand", e[e.WorkspaceCreated = 6] = "WorkspaceCreated", e[e.AppCreated = 7] = "AppCreated", e[e.ServedStopped = 8] = "ServedStopped", e[e.WorkspaceNameInquiry = 9] = "WorkspaceNameInquiry", e[e.AppNameInquiry = 10] = "AppNameInquiry", e[e.ServerModeInquiry = 11] = "ServerModeInquiry", e[e.CreateWorkspaceDescription = 12] = "CreateWorkspaceDescription", e[e.CreateAppDescription = 13] = "CreateAppDescription", e[e.ServeDescription = 14] = "ServeDescription", e[e.BuildDescription = 15] = "BuildDescription", e[e.MissingTranslationKey = 16] = "MissingTranslationKey", e[e.OperationCancelled = 17] = "OperationCancelled", e[e.StopServerInstructions = 18] = "StopServerInstructions", e[e.TemplateLanguageInquiry = 19] = "TemplateLanguageInquiry", e[e.TemplateFrameworkInquiry = 20] = "TemplateFrameworkInquiry", e[e.DevServerPortDescription = 21] = "DevServerPortDescription", e[e.ApiGatewayPortDescription = 22] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 23] = "ApiServerModeDescription", e[e.DevServerOpenDescription = 24] = "DevServerOpenDescription", e[e.BuildWatchDescription = 25] = "BuildWatchDescription", e[e.CouldNotStartGatewayInDocker = 26] = "CouldNotStartGatewayInDocker", e[e.PullingLatestImage = 27] = "PullingLatestImage", e[e.AppEntryBuildOptionDescription = 28] = "AppEntryBuildOptionDescription", e[e.ManifestEntryBuildOptionDescription = 29] = "ManifestEntryBuildOptionDescription", e[e.BuildModeOptionDescription = 30] = "BuildModeOptionDescription", e[e.FetchPackageVersionError = 31] = "FetchPackageVersionError", e[e.DockerNotStartedOrInstalled = 32] = "DockerNotStartedOrInstalled", e[e.EnableDevAuthentication = 33] = "EnableDevAuthentication", e[e.NoAppNameFound = 34] = "NoAppNameFound", e[e.AppConfigurationPath = 35] = "AppConfigurationPath", e[e.ServerGatewayMode = 36] = "ServerGatewayMode", e[e.ServerProxyMode = 37] = "ServerProxyMode", e[e.ServerMode = 38] = "ServerMode", e[e.DevLoginUrl = 39] = "DevLoginUrl", e))(dr || {});
8
- const Dn = {
9
- [
10
- 0
11
- /* Done */
12
- ]: "Done",
13
- [
14
- 1
15
- /* NoWorkspaceName */
16
- ]: "No workspace name provided!",
17
- [
18
- 2
19
- /* NoAppName */
20
- ]: "No app name provided!",
21
- [
22
- 3
23
- /* AlreadyExists */
24
- ]: "File or directory '{0}' already exists!",
25
- [
26
- 4
27
- /* NoAppOrWorkspaceInCurrentDirectory */
28
- ]: "Could not find any app entry file at '{0}' or any apps under the alliance.apps property in '{1}'!",
29
- [
30
- 5
31
- /* UnrecognizedCommand */
32
- ]: "Unrecognized command(s) {0}!",
33
- [
34
- 6
35
- /* WorkspaceCreated */
36
- ]: "Workspace was created at path '{0}'!",
37
- [
38
- 7
39
- /* AppCreated */
40
- ]: "App was created at path '{0}'!",
41
- [
42
- 8
43
- /* ServedStopped */
44
- ]: "Server stopped.",
45
- [
46
- 12
47
- /* CreateWorkspaceDescription */
48
- ]: "Creates an Alliance Workspace in the current directory.",
49
- [
50
- 13
51
- /* CreateAppDescription */
52
- ]: "Creates an Alliance Application in the current directory or Alliance Workspace.",
53
- [
54
- 14
55
- /* ServeDescription */
56
- ]: "Starts a Alliance development server using the current directory package.json.",
57
- [
58
- 15
59
- /* BuildDescription */
60
- ]: "Builds an Alliance Application using Vite.",
61
- [
62
- 9
63
- /* WorkspaceNameInquiry */
64
- ]: "Enter the name of your workspace",
65
- [
66
- 11
67
- /* ServerModeInquiry */
68
- ]: "Which server mode do you want to use?",
69
- [
70
- 10
71
- /* AppNameInquiry */
72
- ]: "Enter the name of your app",
73
- [
74
- 16
75
- /* MissingTranslationKey */
76
- ]: "No translation key provided!",
77
- [
78
- 17
79
- /* OperationCancelled */
80
- ]: "Operation cancelled.",
81
- [
82
- 18
83
- /* StopServerInstructions */
84
- ]: `Press CTRL + C to stop the server.
85
- `,
86
- [
87
- 19
88
- /* TemplateLanguageInquiry */
89
- ]: "Select preferred language",
90
- [
91
- 20
92
- /* TemplateFrameworkInquiry */
93
- ]: "Select preferred framework template",
94
- [
95
- 21
96
- /* DevServerPortDescription */
97
- ]: "The port that the dev server should use.",
98
- [
99
- 22
100
- /* ApiGatewayPortDescription */
101
- ]: "The port that the api gateway should use.",
102
- [
103
- 23
104
- /* ApiServerModeDescription */
105
- ]: "Which components to start. [server|server-proxy|server-gateway].",
106
- [
107
- 24
108
- /* DevServerOpenDescription */
109
- ]: "Whether the dev server should automatically open in your browser or not.",
110
- [
111
- 25
112
- /* BuildWatchDescription */
113
- ]: "Whether the build should start watching and rebuild when files change or not.",
114
- [
115
- 26
116
- /* CouldNotStartGatewayInDocker */
117
- ]: "Could not start Docker container with Alliance gateway.",
118
- [
119
- 27
120
- /* PullingLatestImage */
121
- ]: "Pulling latest image...",
122
- [
123
- 28
124
- /* AppEntryBuildOptionDescription */
125
- ]: "The entry file for the app (./src/app).",
126
- [
127
- 29
128
- /* ManifestEntryBuildOptionDescription */
129
- ]: "The entry file for the app manifest (./src/manifest).",
130
- [
131
- 30
132
- /* BuildModeOptionDescription */
133
- ]: "Which mode to use when building the app. [production|development]",
134
- [
135
- 31
136
- /* FetchPackageVersionError */
137
- ]: "Failed to fetch package info from the NPM registry for package '${0}'!",
138
- [
139
- 32
140
- /* DockerNotStartedOrInstalled */
141
- ]: "Docker not started or not installed.",
142
- [
143
- 33
144
- /* EnableDevAuthentication */
145
- ]: "Whether user authentication should be enabled or not.",
146
- [
147
- 34
148
- /* NoAppNameFound */
149
- ]: "Could not find app name in manifest.",
150
- [
151
- 35
152
- /* AppConfigurationPath */
153
- ]: "The path to the app configuration file.",
154
- [
155
- 38
156
- /* ServerMode */
157
- ]: "Server",
158
- [
159
- 37
160
- /* ServerProxyMode */
161
- ]: "Server with proxy",
162
- [
163
- 36
164
- /* ServerGatewayMode */
165
- ]: "Server with gateway",
166
- [
167
- 39
168
- /* DevLoginUrl */
169
- ]: "Log in using http://localhost:{0}/-/dev/login"
170
- }, et = class {
171
- };
172
- let je = et;
173
- Le(je, "getTranslations", () => Dn), Le(je, "getTranslation", (t, ...r) => {
174
- const i = et.getTranslations()[t];
175
- if (!i)
176
- throw new Error(`Could not find text with given key '${t}'.`);
177
- return r.reduce(
178
- (a, u, y) => a.toString().replace(`{${y}}`, u.toString()),
179
- i
180
- ).toString();
181
- }), Le(je, "get", (t = dr.MissingTranslationKey, ...r) => et.getTranslation(t, ...r));
182
- var Ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
183
- function In(e) {
184
- if (e.__esModule)
185
- return e;
186
- var t = e.default;
187
- if (typeof t == "function") {
188
- var r = function n() {
189
- if (this instanceof n) {
190
- var i = [null];
191
- i.push.apply(i, arguments);
192
- var o = Function.bind.apply(t, i);
193
- return new o();
194
- }
195
- return t.apply(this, arguments);
196
- };
197
- r.prototype = t.prototype;
198
- } else
199
- r = {};
200
- return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(n) {
201
- var i = Object.getOwnPropertyDescriptor(e, n);
202
- Object.defineProperty(r, n, i.get ? i : {
203
- enumerable: !0,
204
- get: function() {
205
- return e[n];
206
- }
207
- });
208
- }), r;
209
- }
210
- var me = {}, q = {};
211
- q.fromCallback = function(e) {
212
- return Object.defineProperty(function(...t) {
213
- if (typeof t[t.length - 1] == "function")
214
- e.apply(this, t);
215
- else
216
- return new Promise((r, n) => {
217
- e.call(
218
- this,
219
- ...t,
220
- (i, o) => i != null ? n(i) : r(o)
221
- );
222
- });
223
- }, "name", { value: e.name });
224
- };
225
- q.fromPromise = function(e) {
226
- return Object.defineProperty(function(...t) {
227
- const r = t[t.length - 1];
228
- if (typeof r != "function")
229
- return e.apply(this, t);
230
- e.apply(this, t.slice(0, -1)).then((n) => r(null, n), r);
231
- }, "name", { value: e.name });
232
- };
233
- const Nn = {}, Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
234
- __proto__: null,
235
- default: Nn
236
- }, Symbol.toStringTag, { value: "Module" })), It = /* @__PURE__ */ In(Cn);
237
- var oe = It, Bn = process.cwd, xe = null, _n = process.env.GRACEFUL_FS_PLATFORM || process.platform;
238
- process.cwd = function() {
239
- return xe || (xe = Bn.call(process)), xe;
240
- };
241
- try {
242
- process.cwd();
243
- } catch {
244
- }
245
- if (typeof process.chdir == "function") {
246
- var qt = process.chdir;
247
- process.chdir = function(e) {
248
- xe = null, qt.call(process, e);
249
- }, Object.setPrototypeOf && Object.setPrototypeOf(process.chdir, qt);
250
- }
251
- var Mn = Rn;
252
- function Rn(e) {
253
- oe.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./) && t(e), e.lutimes || r(e), e.chown = o(e.chown), e.fchown = o(e.fchown), e.lchown = o(e.lchown), e.chmod = n(e.chmod), e.fchmod = n(e.fchmod), e.lchmod = n(e.lchmod), e.chownSync = a(e.chownSync), e.fchownSync = a(e.fchownSync), e.lchownSync = a(e.lchownSync), e.chmodSync = i(e.chmodSync), e.fchmodSync = i(e.fchmodSync), e.lchmodSync = i(e.lchmodSync), e.stat = u(e.stat), e.fstat = u(e.fstat), e.lstat = u(e.lstat), e.statSync = y(e.statSync), e.fstatSync = y(e.fstatSync), e.lstatSync = y(e.lstatSync), e.chmod && !e.lchmod && (e.lchmod = function(f, m, d) {
254
- d && process.nextTick(d);
255
- }, e.lchmodSync = function() {
256
- }), e.chown && !e.lchown && (e.lchown = function(f, m, d, h) {
257
- h && process.nextTick(h);
258
- }, e.lchownSync = function() {
259
- }), _n === "win32" && (e.rename = typeof e.rename != "function" ? e.rename : function(f) {
260
- function m(d, h, g) {
261
- var $ = Date.now(), F = 0;
262
- f(d, h, function I(W) {
263
- if (W && (W.code === "EACCES" || W.code === "EPERM" || W.code === "EBUSY") && Date.now() - $ < 6e4) {
264
- setTimeout(function() {
265
- e.stat(h, function(G, te) {
266
- G && G.code === "ENOENT" ? f(d, h, I) : g(W);
267
- });
268
- }, F), F < 100 && (F += 10);
269
- return;
270
- }
271
- g && g(W);
272
- });
273
- }
274
- return Object.setPrototypeOf && Object.setPrototypeOf(m, f), m;
275
- }(e.rename)), e.read = typeof e.read != "function" ? e.read : function(f) {
276
- function m(d, h, g, $, F, I) {
277
- var W;
278
- if (I && typeof I == "function") {
279
- var G = 0;
280
- W = function(te, ie, he) {
281
- if (te && te.code === "EAGAIN" && G < 10)
282
- return G++, f.call(e, d, h, g, $, F, W);
283
- I.apply(this, arguments);
284
- };
285
- }
286
- return f.call(e, d, h, g, $, F, W);
287
- }
288
- return Object.setPrototypeOf && Object.setPrototypeOf(m, f), m;
289
- }(e.read), e.readSync = typeof e.readSync != "function" ? e.readSync : function(f) {
290
- return function(m, d, h, g, $) {
291
- for (var F = 0; ; )
292
- try {
293
- return f.call(e, m, d, h, g, $);
294
- } catch (I) {
295
- if (I.code === "EAGAIN" && F < 10) {
296
- F++;
297
- continue;
298
- }
299
- throw I;
300
- }
301
- };
302
- }(e.readSync);
303
- function t(f) {
304
- f.lchmod = function(m, d, h) {
305
- f.open(
306
- m,
307
- oe.O_WRONLY | oe.O_SYMLINK,
308
- d,
309
- function(g, $) {
310
- if (g) {
311
- h && h(g);
312
- return;
313
- }
314
- f.fchmod($, d, function(F) {
315
- f.close($, function(I) {
316
- h && h(F || I);
317
- });
318
- });
319
- }
320
- );
321
- }, f.lchmodSync = function(m, d) {
322
- var h = f.openSync(m, oe.O_WRONLY | oe.O_SYMLINK, d), g = !0, $;
323
- try {
324
- $ = f.fchmodSync(h, d), g = !1;
325
- } finally {
326
- if (g)
327
- try {
328
- f.closeSync(h);
329
- } catch {
330
- }
331
- else
332
- f.closeSync(h);
333
- }
334
- return $;
335
- };
336
- }
337
- function r(f) {
338
- oe.hasOwnProperty("O_SYMLINK") && f.futimes ? (f.lutimes = function(m, d, h, g) {
339
- f.open(m, oe.O_SYMLINK, function($, F) {
340
- if ($) {
341
- g && g($);
342
- return;
343
- }
344
- f.futimes(F, d, h, function(I) {
345
- f.close(F, function(W) {
346
- g && g(I || W);
347
- });
348
- });
349
- });
350
- }, f.lutimesSync = function(m, d, h) {
351
- var g = f.openSync(m, oe.O_SYMLINK), $, F = !0;
352
- try {
353
- $ = f.futimesSync(g, d, h), F = !1;
354
- } finally {
355
- if (F)
356
- try {
357
- f.closeSync(g);
358
- } catch {
359
- }
360
- else
361
- f.closeSync(g);
362
- }
363
- return $;
364
- }) : f.futimes && (f.lutimes = function(m, d, h, g) {
365
- g && process.nextTick(g);
366
- }, f.lutimesSync = function() {
367
- });
368
- }
369
- function n(f) {
370
- return f && function(m, d, h) {
371
- return f.call(e, m, d, function(g) {
372
- S(g) && (g = null), h && h.apply(this, arguments);
373
- });
374
- };
375
- }
376
- function i(f) {
377
- return f && function(m, d) {
378
- try {
379
- return f.call(e, m, d);
380
- } catch (h) {
381
- if (!S(h))
382
- throw h;
383
- }
384
- };
385
- }
386
- function o(f) {
387
- return f && function(m, d, h, g) {
388
- return f.call(e, m, d, h, function($) {
389
- S($) && ($ = null), g && g.apply(this, arguments);
390
- });
391
- };
392
- }
393
- function a(f) {
394
- return f && function(m, d, h) {
395
- try {
396
- return f.call(e, m, d, h);
397
- } catch (g) {
398
- if (!S(g))
399
- throw g;
400
- }
401
- };
402
- }
403
- function u(f) {
404
- return f && function(m, d, h) {
405
- typeof d == "function" && (h = d, d = null);
406
- function g($, F) {
407
- F && (F.uid < 0 && (F.uid += 4294967296), F.gid < 0 && (F.gid += 4294967296)), h && h.apply(this, arguments);
408
- }
409
- return d ? f.call(e, m, d, g) : f.call(e, m, g);
410
- };
411
- }
412
- function y(f) {
413
- return f && function(m, d) {
414
- var h = d ? f.call(e, m, d) : f.call(e, m);
415
- return h && (h.uid < 0 && (h.uid += 4294967296), h.gid < 0 && (h.gid += 4294967296)), h;
416
- };
417
- }
418
- function S(f) {
419
- if (!f || f.code === "ENOSYS")
420
- return !0;
421
- var m = !process.getuid || process.getuid() !== 0;
422
- return !!(m && (f.code === "EINVAL" || f.code === "EPERM"));
423
- }
424
- }
425
- var Ht = It.Stream, Tn = Un;
426
- function Un(e) {
427
- return {
428
- ReadStream: t,
429
- WriteStream: r
430
- };
431
- function t(n, i) {
432
- if (!(this instanceof t))
433
- return new t(n, i);
434
- Ht.call(this);
435
- var o = this;
436
- this.path = n, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, i = i || {};
437
- for (var a = Object.keys(i), u = 0, y = a.length; u < y; u++) {
438
- var S = a[u];
439
- this[S] = i[S];
440
- }
441
- if (this.encoding && this.setEncoding(this.encoding), this.start !== void 0) {
442
- if (typeof this.start != "number")
443
- throw TypeError("start must be a Number");
444
- if (this.end === void 0)
445
- this.end = 1 / 0;
446
- else if (typeof this.end != "number")
447
- throw TypeError("end must be a Number");
448
- if (this.start > this.end)
449
- throw new Error("start must be <= end");
450
- this.pos = this.start;
451
- }
452
- if (this.fd !== null) {
453
- process.nextTick(function() {
454
- o._read();
455
- });
456
- return;
457
- }
458
- e.open(this.path, this.flags, this.mode, function(f, m) {
459
- if (f) {
460
- o.emit("error", f), o.readable = !1;
461
- return;
462
- }
463
- o.fd = m, o.emit("open", m), o._read();
464
- });
465
- }
466
- function r(n, i) {
467
- if (!(this instanceof r))
468
- return new r(n, i);
469
- Ht.call(this), this.path = n, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, i = i || {};
470
- for (var o = Object.keys(i), a = 0, u = o.length; a < u; a++) {
471
- var y = o[a];
472
- this[y] = i[y];
473
- }
474
- if (this.start !== void 0) {
475
- if (typeof this.start != "number")
476
- throw TypeError("start must be a Number");
477
- if (this.start < 0)
478
- throw new Error("start must be >= zero");
479
- this.pos = this.start;
480
- }
481
- this.busy = !1, this._queue = [], this.fd === null && (this._open = e.open, this._queue.push([this._open, this.path, this.flags, this.mode, void 0]), this.flush());
482
- }
483
- }
484
- var Wn = Gn, Ln = Object.getPrototypeOf || function(e) {
485
- return e.__proto__;
486
- };
487
- function Gn(e) {
488
- if (e === null || typeof e != "object")
489
- return e;
490
- if (e instanceof Object)
491
- var t = { __proto__: Ln(e) };
492
- else
493
- var t = /* @__PURE__ */ Object.create(null);
494
- return Object.getOwnPropertyNames(e).forEach(function(r) {
495
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r));
496
- }), t;
497
- }
498
- var Nt = {}, hr = {}, gr = function() {
499
- if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
500
- return !1;
501
- if (typeof Symbol.iterator == "symbol")
502
- return !0;
503
- var t = {}, r = Symbol("test"), n = Object(r);
504
- if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
505
- return !1;
506
- var i = 42;
507
- t[r] = i;
508
- for (r in t)
509
- return !1;
510
- if (typeof Object.keys == "function" && Object.keys(t).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(t).length !== 0)
511
- return !1;
512
- var o = Object.getOwnPropertySymbols(t);
513
- if (o.length !== 1 || o[0] !== r || !Object.prototype.propertyIsEnumerable.call(t, r))
514
- return !1;
515
- if (typeof Object.getOwnPropertyDescriptor == "function") {
516
- var a = Object.getOwnPropertyDescriptor(t, r);
517
- if (a.value !== i || a.enumerable !== !0)
518
- return !1;
519
- }
520
- return !0;
521
- }, Jn = gr, tt = function() {
522
- return Jn() && !!Symbol.toStringTag;
523
- }, Yt = typeof Symbol < "u" && Symbol, Vn = gr, zn = function() {
524
- return typeof Yt != "function" || typeof Symbol != "function" || typeof Yt("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Vn();
525
- }, xn = "Function.prototype.bind called on incompatible ", ct = Array.prototype.slice, qn = Object.prototype.toString, Hn = "[object Function]", Yn = function(t) {
526
- var r = this;
527
- if (typeof r != "function" || qn.call(r) !== Hn)
528
- throw new TypeError(xn + r);
529
- for (var n = ct.call(arguments, 1), i, o = function() {
530
- if (this instanceof i) {
531
- var f = r.apply(
532
- this,
533
- n.concat(ct.call(arguments))
534
- );
535
- return Object(f) === f ? f : this;
536
- } else
537
- return r.apply(
538
- t,
539
- n.concat(ct.call(arguments))
540
- );
541
- }, a = Math.max(0, r.length - n.length), u = [], y = 0; y < a; y++)
542
- u.push("$" + y);
543
- if (i = Function("binder", "return function (" + u.join(",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
544
- var S = function() {
545
- };
546
- S.prototype = r.prototype, i.prototype = new S(), S.prototype = null;
547
- }
548
- return i;
549
- }, Qn = Yn, Ct = Function.prototype.bind || Qn, Xn = Ct, Zn = Xn.call(Function.call, Object.prototype.hasOwnProperty), E, $e = SyntaxError, Sr = Function, Ae = TypeError, ut = function(e) {
550
- try {
551
- return Sr('"use strict"; return (' + e + ").constructor;")();
552
- } catch {
553
- }
554
- }, le = Object.getOwnPropertyDescriptor;
555
- if (le)
556
- try {
557
- le({}, "");
558
- } catch {
559
- le = null;
560
- }
561
- var ft = function() {
562
- throw new Ae();
563
- }, Kn = le ? function() {
564
- try {
565
- return arguments.callee, ft;
566
- } catch {
567
- try {
568
- return le(arguments, "callee").get;
569
- } catch {
570
- return ft;
571
- }
572
- }
573
- }() : ft, Se = zn(), re = Object.getPrototypeOf || function(e) {
574
- return e.__proto__;
575
- }, we = {}, ei = typeof Uint8Array > "u" ? E : re(Uint8Array), ye = {
576
- "%AggregateError%": typeof AggregateError > "u" ? E : AggregateError,
577
- "%Array%": Array,
578
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? E : ArrayBuffer,
579
- "%ArrayIteratorPrototype%": Se ? re([][Symbol.iterator]()) : E,
580
- "%AsyncFromSyncIteratorPrototype%": E,
581
- "%AsyncFunction%": we,
582
- "%AsyncGenerator%": we,
583
- "%AsyncGeneratorFunction%": we,
584
- "%AsyncIteratorPrototype%": we,
585
- "%Atomics%": typeof Atomics > "u" ? E : Atomics,
586
- "%BigInt%": typeof BigInt > "u" ? E : BigInt,
587
- "%BigInt64Array%": typeof BigInt64Array > "u" ? E : BigInt64Array,
588
- "%BigUint64Array%": typeof BigUint64Array > "u" ? E : BigUint64Array,
589
- "%Boolean%": Boolean,
590
- "%DataView%": typeof DataView > "u" ? E : DataView,
591
- "%Date%": Date,
592
- "%decodeURI%": decodeURI,
593
- "%decodeURIComponent%": decodeURIComponent,
594
- "%encodeURI%": encodeURI,
595
- "%encodeURIComponent%": encodeURIComponent,
596
- "%Error%": Error,
597
- "%eval%": eval,
598
- // eslint-disable-line no-eval
599
- "%EvalError%": EvalError,
600
- "%Float32Array%": typeof Float32Array > "u" ? E : Float32Array,
601
- "%Float64Array%": typeof Float64Array > "u" ? E : Float64Array,
602
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? E : FinalizationRegistry,
603
- "%Function%": Sr,
604
- "%GeneratorFunction%": we,
605
- "%Int8Array%": typeof Int8Array > "u" ? E : Int8Array,
606
- "%Int16Array%": typeof Int16Array > "u" ? E : Int16Array,
607
- "%Int32Array%": typeof Int32Array > "u" ? E : Int32Array,
608
- "%isFinite%": isFinite,
609
- "%isNaN%": isNaN,
610
- "%IteratorPrototype%": Se ? re(re([][Symbol.iterator]())) : E,
611
- "%JSON%": typeof JSON == "object" ? JSON : E,
612
- "%Map%": typeof Map > "u" ? E : Map,
613
- "%MapIteratorPrototype%": typeof Map > "u" || !Se ? E : re((/* @__PURE__ */ new Map())[Symbol.iterator]()),
614
- "%Math%": Math,
615
- "%Number%": Number,
616
- "%Object%": Object,
617
- "%parseFloat%": parseFloat,
618
- "%parseInt%": parseInt,
619
- "%Promise%": typeof Promise > "u" ? E : Promise,
620
- "%Proxy%": typeof Proxy > "u" ? E : Proxy,
621
- "%RangeError%": RangeError,
622
- "%ReferenceError%": ReferenceError,
623
- "%Reflect%": typeof Reflect > "u" ? E : Reflect,
624
- "%RegExp%": RegExp,
625
- "%Set%": typeof Set > "u" ? E : Set,
626
- "%SetIteratorPrototype%": typeof Set > "u" || !Se ? E : re((/* @__PURE__ */ new Set())[Symbol.iterator]()),
627
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? E : SharedArrayBuffer,
628
- "%String%": String,
629
- "%StringIteratorPrototype%": Se ? re(""[Symbol.iterator]()) : E,
630
- "%Symbol%": Se ? Symbol : E,
631
- "%SyntaxError%": $e,
632
- "%ThrowTypeError%": Kn,
633
- "%TypedArray%": ei,
634
- "%TypeError%": Ae,
635
- "%Uint8Array%": typeof Uint8Array > "u" ? E : Uint8Array,
636
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? E : Uint8ClampedArray,
637
- "%Uint16Array%": typeof Uint16Array > "u" ? E : Uint16Array,
638
- "%Uint32Array%": typeof Uint32Array > "u" ? E : Uint32Array,
639
- "%URIError%": URIError,
640
- "%WeakMap%": typeof WeakMap > "u" ? E : WeakMap,
641
- "%WeakRef%": typeof WeakRef > "u" ? E : WeakRef,
642
- "%WeakSet%": typeof WeakSet > "u" ? E : WeakSet
643
- };
644
- try {
645
- null.error;
646
- } catch (e) {
647
- var ti = re(re(e));
648
- ye["%Error.prototype%"] = ti;
649
- }
650
- var ri = function e(t) {
651
- var r;
652
- if (t === "%AsyncFunction%")
653
- r = ut("async function () {}");
654
- else if (t === "%GeneratorFunction%")
655
- r = ut("function* () {}");
656
- else if (t === "%AsyncGeneratorFunction%")
657
- r = ut("async function* () {}");
658
- else if (t === "%AsyncGenerator%") {
659
- var n = e("%AsyncGeneratorFunction%");
660
- n && (r = n.prototype);
661
- } else if (t === "%AsyncIteratorPrototype%") {
662
- var i = e("%AsyncGenerator%");
663
- i && (r = re(i.prototype));
664
- }
665
- return ye[t] = r, r;
666
- }, Qt = {
667
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
668
- "%ArrayPrototype%": ["Array", "prototype"],
669
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
670
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
671
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
672
- "%ArrayProto_values%": ["Array", "prototype", "values"],
673
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
674
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
675
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
676
- "%BooleanPrototype%": ["Boolean", "prototype"],
677
- "%DataViewPrototype%": ["DataView", "prototype"],
678
- "%DatePrototype%": ["Date", "prototype"],
679
- "%ErrorPrototype%": ["Error", "prototype"],
680
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
681
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
682
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
683
- "%FunctionPrototype%": ["Function", "prototype"],
684
- "%Generator%": ["GeneratorFunction", "prototype"],
685
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
686
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
687
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
688
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
689
- "%JSONParse%": ["JSON", "parse"],
690
- "%JSONStringify%": ["JSON", "stringify"],
691
- "%MapPrototype%": ["Map", "prototype"],
692
- "%NumberPrototype%": ["Number", "prototype"],
693
- "%ObjectPrototype%": ["Object", "prototype"],
694
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
695
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
696
- "%PromisePrototype%": ["Promise", "prototype"],
697
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
698
- "%Promise_all%": ["Promise", "all"],
699
- "%Promise_reject%": ["Promise", "reject"],
700
- "%Promise_resolve%": ["Promise", "resolve"],
701
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
702
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
703
- "%RegExpPrototype%": ["RegExp", "prototype"],
704
- "%SetPrototype%": ["Set", "prototype"],
705
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
706
- "%StringPrototype%": ["String", "prototype"],
707
- "%SymbolPrototype%": ["Symbol", "prototype"],
708
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
709
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
710
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
711
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
712
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
713
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
714
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
715
- "%URIErrorPrototype%": ["URIError", "prototype"],
716
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
717
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
718
- }, Me = Ct, Xe = Zn, ni = Me.call(Function.call, Array.prototype.concat), ii = Me.call(Function.apply, Array.prototype.splice), Xt = Me.call(Function.call, String.prototype.replace), Ze = Me.call(Function.call, String.prototype.slice), oi = Me.call(Function.call, RegExp.prototype.exec), ai = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ci = /\\(\\)?/g, ui = function(t) {
719
- var r = Ze(t, 0, 1), n = Ze(t, -1);
720
- if (r === "%" && n !== "%")
721
- throw new $e("invalid intrinsic syntax, expected closing `%`");
722
- if (n === "%" && r !== "%")
723
- throw new $e("invalid intrinsic syntax, expected opening `%`");
724
- var i = [];
725
- return Xt(t, ai, function(o, a, u, y) {
726
- i[i.length] = u ? Xt(y, ci, "$1") : a || o;
727
- }), i;
728
- }, fi = function(t, r) {
729
- var n = t, i;
730
- if (Xe(Qt, n) && (i = Qt[n], n = "%" + i[0] + "%"), Xe(ye, n)) {
731
- var o = ye[n];
732
- if (o === we && (o = ri(n)), typeof o > "u" && !r)
733
- throw new Ae("intrinsic " + t + " exists, but is not available. Please file an issue!");
734
- return {
735
- alias: i,
736
- name: n,
737
- value: o
738
- };
739
- }
740
- throw new $e("intrinsic " + t + " does not exist!");
741
- }, Bt = function(t, r) {
742
- if (typeof t != "string" || t.length === 0)
743
- throw new Ae("intrinsic name must be a non-empty string");
744
- if (arguments.length > 1 && typeof r != "boolean")
745
- throw new Ae('"allowMissing" argument must be a boolean');
746
- if (oi(/^%?[^%]*%?$/, t) === null)
747
- throw new $e("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
748
- var n = ui(t), i = n.length > 0 ? n[0] : "", o = fi("%" + i + "%", r), a = o.name, u = o.value, y = !1, S = o.alias;
749
- S && (i = S[0], ii(n, ni([0, 1], S)));
750
- for (var f = 1, m = !0; f < n.length; f += 1) {
751
- var d = n[f], h = Ze(d, 0, 1), g = Ze(d, -1);
752
- if ((h === '"' || h === "'" || h === "`" || g === '"' || g === "'" || g === "`") && h !== g)
753
- throw new $e("property names with quotes must have matching quotes");
754
- if ((d === "constructor" || !m) && (y = !0), i += "." + d, a = "%" + i + "%", Xe(ye, a))
755
- u = ye[a];
756
- else if (u != null) {
757
- if (!(d in u)) {
758
- if (!r)
759
- throw new Ae("base intrinsic for " + t + " exists, but the property is not available.");
760
- return;
761
- }
762
- if (le && f + 1 >= n.length) {
763
- var $ = le(u, d);
764
- m = !!$, m && "get" in $ && !("originalValue" in $.get) ? u = $.get : u = u[d];
765
- } else
766
- m = Xe(u, d), u = u[d];
767
- m && !y && (ye[a] = u);
768
- }
769
- }
770
- return u;
771
- }, bt = {}, si = {
772
- get exports() {
773
- return bt;
774
- },
775
- set exports(e) {
776
- bt = e;
777
- }
778
- };
779
- (function(e) {
780
- var t = Ct, r = Bt, n = r("%Function.prototype.apply%"), i = r("%Function.prototype.call%"), o = r("%Reflect.apply%", !0) || t.call(i, n), a = r("%Object.getOwnPropertyDescriptor%", !0), u = r("%Object.defineProperty%", !0), y = r("%Math.max%");
781
- if (u)
782
- try {
783
- u({}, "a", { value: 1 });
784
- } catch {
785
- u = null;
786
- }
787
- e.exports = function(m) {
788
- var d = o(t, i, arguments);
789
- if (a && u) {
790
- var h = a(d, "length");
791
- h.configurable && u(
792
- d,
793
- "length",
794
- { value: 1 + y(0, m.length - (arguments.length - 1)) }
795
- );
796
- }
797
- return d;
798
- };
799
- var S = function() {
800
- return o(t, n, arguments);
801
- };
802
- u ? u(e.exports, "apply", { value: S }) : e.exports.apply = S;
803
- })(si);
804
- var vr = Bt, wr = bt, li = wr(vr("String.prototype.indexOf")), _t = function(t, r) {
805
- var n = vr(t, !!r);
806
- return typeof n == "function" && li(t, ".prototype.") > -1 ? wr(n) : n;
807
- }, yi = tt(), pi = _t, At = pi("Object.prototype.toString"), rt = function(t) {
808
- return yi && t && typeof t == "object" && Symbol.toStringTag in t ? !1 : At(t) === "[object Arguments]";
809
- }, br = function(t) {
810
- return rt(t) ? !0 : t !== null && typeof t == "object" && typeof t.length == "number" && t.length >= 0 && At(t) !== "[object Array]" && At(t.callee) === "[object Function]";
811
- }, mi = function() {
812
- return rt(arguments);
813
- }();
814
- rt.isLegacyArguments = br;
815
- var di = mi ? rt : br, hi = Object.prototype.toString, gi = Function.prototype.toString, Si = /^\s*(?:function)?\*/, Ar = tt(), st = Object.getPrototypeOf, vi = function() {
816
- if (!Ar)
817
- return !1;
818
- try {
819
- return Function("return function*() {}")();
820
- } catch {
821
- }
822
- }, lt, wi = function(t) {
823
- if (typeof t != "function")
824
- return !1;
825
- if (Si.test(gi.call(t)))
826
- return !0;
827
- if (!Ar) {
828
- var r = hi.call(t);
829
- return r === "[object GeneratorFunction]";
830
- }
831
- if (!st)
832
- return !1;
833
- if (typeof lt > "u") {
834
- var n = vi();
835
- lt = n ? st(n) : !1;
836
- }
837
- return st(t) === lt;
838
- }, Or = Function.prototype.toString, be = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Ot, qe;
839
- if (typeof be == "function" && typeof Object.defineProperty == "function")
840
- try {
841
- Ot = Object.defineProperty({}, "length", {
842
- get: function() {
843
- throw qe;
844
- }
845
- }), qe = {}, be(function() {
846
- throw 42;
847
- }, null, Ot);
848
- } catch (e) {
849
- e !== qe && (be = null);
850
- }
851
- else
852
- be = null;
853
- var bi = /^\s*class\b/, Et = function(t) {
854
- try {
855
- var r = Or.call(t);
856
- return bi.test(r);
857
- } catch {
858
- return !1;
859
- }
860
- }, yt = function(t) {
861
- try {
862
- return Et(t) ? !1 : (Or.call(t), !0);
863
- } catch {
864
- return !1;
865
- }
866
- }, He = Object.prototype.toString, Ai = "[object Object]", Oi = "[object Function]", Ei = "[object GeneratorFunction]", $i = "[object HTMLAllCollection]", Pi = "[object HTML document.all class]", ki = "[object HTMLCollection]", Fi = typeof Symbol == "function" && !!Symbol.toStringTag, ji = !(0 in [,]), $t = function() {
867
- return !1;
868
- };
869
- if (typeof document == "object") {
870
- var Di = document.all;
871
- He.call(Di) === He.call(document.all) && ($t = function(t) {
872
- if ((ji || !t) && (typeof t > "u" || typeof t == "object"))
873
- try {
874
- var r = He.call(t);
875
- return (r === $i || r === Pi || r === ki || r === Ai) && t("") == null;
876
- } catch {
877
- }
878
- return !1;
879
- });
880
- }
881
- var Ii = be ? function(t) {
882
- if ($t(t))
883
- return !0;
884
- if (!t || typeof t != "function" && typeof t != "object")
885
- return !1;
886
- try {
887
- be(t, null, Ot);
888
- } catch (r) {
889
- if (r !== qe)
890
- return !1;
891
- }
892
- return !Et(t) && yt(t);
893
- } : function(t) {
894
- if ($t(t))
895
- return !0;
896
- if (!t || typeof t != "function" && typeof t != "object")
897
- return !1;
898
- if (Fi)
899
- return yt(t);
900
- if (Et(t))
901
- return !1;
902
- var r = He.call(t);
903
- return r !== Oi && r !== Ei && !/^\[object HTML/.test(r) ? !1 : yt(t);
904
- }, Ni = Ii, Ci = Object.prototype.toString, Er = Object.prototype.hasOwnProperty, Bi = function(t, r, n) {
905
- for (var i = 0, o = t.length; i < o; i++)
906
- Er.call(t, i) && (n == null ? r(t[i], i, t) : r.call(n, t[i], i, t));
907
- }, _i = function(t, r, n) {
908
- for (var i = 0, o = t.length; i < o; i++)
909
- n == null ? r(t.charAt(i), i, t) : r.call(n, t.charAt(i), i, t);
910
- }, Mi = function(t, r, n) {
911
- for (var i in t)
912
- Er.call(t, i) && (n == null ? r(t[i], i, t) : r.call(n, t[i], i, t));
913
- }, Ri = function(t, r, n) {
914
- if (!Ni(r))
915
- throw new TypeError("iterator must be a function");
916
- var i;
917
- arguments.length >= 3 && (i = n), Ci.call(t) === "[object Array]" ? Bi(t, r, i) : typeof t == "string" ? _i(t, r, i) : Mi(t, r, i);
918
- }, $r = Ri, pt = [
919
- "BigInt64Array",
920
- "BigUint64Array",
921
- "Float32Array",
922
- "Float64Array",
923
- "Int16Array",
924
- "Int32Array",
925
- "Int8Array",
926
- "Uint16Array",
927
- "Uint32Array",
928
- "Uint8Array",
929
- "Uint8ClampedArray"
930
- ], Ti = typeof globalThis > "u" ? Ee : globalThis, Pr = function() {
931
- for (var t = [], r = 0; r < pt.length; r++)
932
- typeof Ti[pt[r]] == "function" && (t[t.length] = pt[r]);
933
- return t;
934
- }, Ui = Bt, Ye = Ui("%Object.getOwnPropertyDescriptor%", !0);
935
- if (Ye)
936
- try {
937
- Ye([], "length");
938
- } catch {
939
- Ye = null;
940
- }
941
- var kr = Ye, Fr = $r, Wi = Pr, Mt = _t, Li = Mt("Object.prototype.toString"), jr = tt(), Qe = kr, Gi = typeof globalThis > "u" ? Ee : globalThis, Dr = Wi(), Ji = Mt("Array.prototype.indexOf", !0) || function(t, r) {
942
- for (var n = 0; n < t.length; n += 1)
943
- if (t[n] === r)
944
- return n;
945
- return -1;
946
- }, Vi = Mt("String.prototype.slice"), Ir = {}, mt = Object.getPrototypeOf;
947
- jr && Qe && mt && Fr(Dr, function(e) {
948
- var t = new Gi[e]();
949
- if (Symbol.toStringTag in t) {
950
- var r = mt(t), n = Qe(r, Symbol.toStringTag);
951
- if (!n) {
952
- var i = mt(r);
953
- n = Qe(i, Symbol.toStringTag);
954
- }
955
- Ir[e] = n.get;
956
- }
957
- });
958
- var zi = function(t) {
959
- var r = !1;
960
- return Fr(Ir, function(n, i) {
961
- if (!r)
962
- try {
963
- r = n.call(t) === i;
964
- } catch {
965
- }
966
- }), r;
967
- }, Nr = function(t) {
968
- if (!t || typeof t != "object")
969
- return !1;
970
- if (!jr || !(Symbol.toStringTag in t)) {
971
- var r = Vi(Li(t), 8, -1);
972
- return Ji(Dr, r) > -1;
973
- }
974
- return Qe ? zi(t) : !1;
975
- }, Cr = $r, xi = Pr, Br = _t, dt = kr, qi = Br("Object.prototype.toString"), _r = tt(), Zt = typeof globalThis > "u" ? Ee : globalThis, Hi = xi(), Yi = Br("String.prototype.slice"), Mr = {}, ht = Object.getPrototypeOf;
976
- _r && dt && ht && Cr(Hi, function(e) {
977
- if (typeof Zt[e] == "function") {
978
- var t = new Zt[e]();
979
- if (Symbol.toStringTag in t) {
980
- var r = ht(t), n = dt(r, Symbol.toStringTag);
981
- if (!n) {
982
- var i = ht(r);
983
- n = dt(i, Symbol.toStringTag);
984
- }
985
- Mr[e] = n.get;
986
- }
987
- }
988
- });
989
- var Qi = function(t) {
990
- var r = !1;
991
- return Cr(Mr, function(n, i) {
992
- if (!r)
993
- try {
994
- var o = n.call(t);
995
- o === i && (r = o);
996
- } catch {
997
- }
998
- }), r;
999
- }, Xi = Nr, Zi = function(t) {
1000
- return Xi(t) ? !_r || !(Symbol.toStringTag in t) ? Yi(qi(t), 8, -1) : Qi(t) : !1;
1001
- };
1002
- (function(e) {
1003
- var t = di, r = wi, n = Zi, i = Nr;
1004
- function o(l) {
1005
- return l.call.bind(l);
1006
- }
1007
- var a = typeof BigInt < "u", u = typeof Symbol < "u", y = o(Object.prototype.toString), S = o(Number.prototype.valueOf), f = o(String.prototype.valueOf), m = o(Boolean.prototype.valueOf);
1008
- if (a)
1009
- var d = o(BigInt.prototype.valueOf);
1010
- if (u)
1011
- var h = o(Symbol.prototype.valueOf);
1012
- function g(l, En) {
1013
- if (typeof l != "object")
1014
- return !1;
1015
- try {
1016
- return En(l), !0;
1017
- } catch {
1018
- return !1;
1019
- }
1020
- }
1021
- e.isArgumentsObject = t, e.isGeneratorFunction = r, e.isTypedArray = i;
1022
- function $(l) {
1023
- return typeof Promise < "u" && l instanceof Promise || l !== null && typeof l == "object" && typeof l.then == "function" && typeof l.catch == "function";
1024
- }
1025
- e.isPromise = $;
1026
- function F(l) {
1027
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(l) : i(l) || s(l);
1028
- }
1029
- e.isArrayBufferView = F;
1030
- function I(l) {
1031
- return n(l) === "Uint8Array";
1032
- }
1033
- e.isUint8Array = I;
1034
- function W(l) {
1035
- return n(l) === "Uint8ClampedArray";
1036
- }
1037
- e.isUint8ClampedArray = W;
1038
- function G(l) {
1039
- return n(l) === "Uint16Array";
1040
- }
1041
- e.isUint16Array = G;
1042
- function te(l) {
1043
- return n(l) === "Uint32Array";
1044
- }
1045
- e.isUint32Array = te;
1046
- function ie(l) {
1047
- return n(l) === "Int8Array";
1048
- }
1049
- e.isInt8Array = ie;
1050
- function he(l) {
1051
- return n(l) === "Int16Array";
1052
- }
1053
- e.isInt16Array = he;
1054
- function Z(l) {
1055
- return n(l) === "Int32Array";
1056
- }
1057
- e.isInt32Array = Z;
1058
- function K(l) {
1059
- return n(l) === "Float32Array";
1060
- }
1061
- e.isFloat32Array = K;
1062
- function v(l) {
1063
- return n(l) === "Float64Array";
1064
- }
1065
- e.isFloat64Array = v;
1066
- function A(l) {
1067
- return n(l) === "BigInt64Array";
1068
- }
1069
- e.isBigInt64Array = A;
1070
- function b(l) {
1071
- return n(l) === "BigUint64Array";
1072
- }
1073
- e.isBigUint64Array = b;
1074
- function _(l) {
1075
- return y(l) === "[object Map]";
1076
- }
1077
- _.working = typeof Map < "u" && _(/* @__PURE__ */ new Map());
1078
- function L(l) {
1079
- return typeof Map > "u" ? !1 : _.working ? _(l) : l instanceof Map;
1080
- }
1081
- e.isMap = L;
1082
- function M(l) {
1083
- return y(l) === "[object Set]";
1084
- }
1085
- M.working = typeof Set < "u" && M(/* @__PURE__ */ new Set());
1086
- function N(l) {
1087
- return typeof Set > "u" ? !1 : M.working ? M(l) : l instanceof Set;
1088
- }
1089
- e.isSet = N;
1090
- function C(l) {
1091
- return y(l) === "[object WeakMap]";
1092
- }
1093
- C.working = typeof WeakMap < "u" && C(/* @__PURE__ */ new WeakMap());
1094
- function D(l) {
1095
- return typeof WeakMap > "u" ? !1 : C.working ? C(l) : l instanceof WeakMap;
1096
- }
1097
- e.isWeakMap = D;
1098
- function T(l) {
1099
- return y(l) === "[object WeakSet]";
1100
- }
1101
- T.working = typeof WeakSet < "u" && T(/* @__PURE__ */ new WeakSet());
1102
- function P(l) {
1103
- return T(l);
1104
- }
1105
- e.isWeakSet = P;
1106
- function fe(l) {
1107
- return y(l) === "[object ArrayBuffer]";
1108
- }
1109
- fe.working = typeof ArrayBuffer < "u" && fe(new ArrayBuffer());
1110
- function Te(l) {
1111
- return typeof ArrayBuffer > "u" ? !1 : fe.working ? fe(l) : l instanceof ArrayBuffer;
1112
- }
1113
- e.isArrayBuffer = Te;
1114
- function c(l) {
1115
- return y(l) === "[object DataView]";
1116
- }
1117
- c.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && c(new DataView(new ArrayBuffer(1), 0, 1));
1118
- function s(l) {
1119
- return typeof DataView > "u" ? !1 : c.working ? c(l) : l instanceof DataView;
1120
- }
1121
- e.isDataView = s;
1122
- var p = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
1123
- function w(l) {
1124
- return y(l) === "[object SharedArrayBuffer]";
1125
- }
1126
- function j(l) {
1127
- return typeof p > "u" ? !1 : (typeof w.working > "u" && (w.working = w(new p())), w.working ? w(l) : l instanceof p);
1128
- }
1129
- e.isSharedArrayBuffer = j;
1130
- function B(l) {
1131
- return y(l) === "[object AsyncFunction]";
1132
- }
1133
- e.isAsyncFunction = B;
1134
- function O(l) {
1135
- return y(l) === "[object Map Iterator]";
1136
- }
1137
- e.isMapIterator = O;
1138
- function k(l) {
1139
- return y(l) === "[object Set Iterator]";
1140
- }
1141
- e.isSetIterator = k;
1142
- function R(l) {
1143
- return y(l) === "[object Generator]";
1144
- }
1145
- e.isGeneratorObject = R;
1146
- function H(l) {
1147
- return y(l) === "[object WebAssembly.Module]";
1148
- }
1149
- e.isWebAssemblyCompiledModule = H;
1150
- function se(l) {
1151
- return g(l, S);
1152
- }
1153
- e.isNumberObject = se;
1154
- function Ue(l) {
1155
- return g(l, f);
1156
- }
1157
- e.isStringObject = Ue;
1158
- function ge(l) {
1159
- return g(l, m);
1160
- }
1161
- e.isBooleanObject = ge;
1162
- function We(l) {
1163
- return a && g(l, d);
1164
- }
1165
- e.isBigIntObject = We;
1166
- function zt(l) {
1167
- return u && g(l, h);
1168
- }
1169
- e.isSymbolObject = zt;
1170
- function An(l) {
1171
- return se(l) || Ue(l) || ge(l) || We(l) || zt(l);
1172
- }
1173
- e.isBoxedPrimitive = An;
1174
- function On(l) {
1175
- return typeof Uint8Array < "u" && (Te(l) || j(l));
1176
- }
1177
- e.isAnyArrayBuffer = On, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(l) {
1178
- Object.defineProperty(e, l, {
1179
- enumerable: !1,
1180
- value: function() {
1181
- throw new Error(l + " is not supported in userland");
1182
- }
1183
- });
1184
- });
1185
- })(hr);
1186
- var Ki = function(t) {
1187
- return t && typeof t == "object" && typeof t.copy == "function" && typeof t.fill == "function" && typeof t.readUInt8 == "function";
1188
- }, Pt = {}, Kt = {
1189
- get exports() {
1190
- return Pt;
1191
- },
1192
- set exports(e) {
1193
- Pt = e;
1194
- }
1195
- };
1196
- typeof Object.create == "function" ? Kt.exports = function(t, r) {
1197
- r && (t.super_ = r, t.prototype = Object.create(r.prototype, {
1198
- constructor: {
1199
- value: t,
1200
- enumerable: !1,
1201
- writable: !0,
1202
- configurable: !0
1203
- }
1204
- }));
1205
- } : Kt.exports = function(t, r) {
1206
- if (r) {
1207
- t.super_ = r;
1208
- var n = function() {
1209
- };
1210
- n.prototype = r.prototype, t.prototype = new n(), t.prototype.constructor = t;
1211
- }
1212
- };
1213
- (function(e) {
1214
- var t = Object.getOwnPropertyDescriptors || function(s) {
1215
- for (var p = Object.keys(s), w = {}, j = 0; j < p.length; j++)
1216
- w[p[j]] = Object.getOwnPropertyDescriptor(s, p[j]);
1217
- return w;
1218
- }, r = /%[sdj%]/g;
1219
- e.format = function(c) {
1220
- if (!ie(c)) {
1221
- for (var s = [], p = 0; p < arguments.length; p++)
1222
- s.push(a(arguments[p]));
1223
- return s.join(" ");
1224
- }
1225
- for (var p = 1, w = arguments, j = w.length, B = String(c).replace(r, function(k) {
1226
- if (k === "%%")
1227
- return "%";
1228
- if (p >= j)
1229
- return k;
1230
- switch (k) {
1231
- case "%s":
1232
- return String(w[p++]);
1233
- case "%d":
1234
- return Number(w[p++]);
1235
- case "%j":
1236
- try {
1237
- return JSON.stringify(w[p++]);
1238
- } catch {
1239
- return "[Circular]";
1240
- }
1241
- default:
1242
- return k;
1243
- }
1244
- }), O = w[p]; p < j; O = w[++p])
1245
- W(O) || !v(O) ? B += " " + O : B += " " + a(O);
1246
- return B;
1247
- }, e.deprecate = function(c, s) {
1248
- if (typeof process < "u" && process.noDeprecation === !0)
1249
- return c;
1250
- if (typeof process > "u")
1251
- return function() {
1252
- return e.deprecate(c, s).apply(this, arguments);
1253
- };
1254
- var p = !1;
1255
- function w() {
1256
- if (!p) {
1257
- if (process.throwDeprecation)
1258
- throw new Error(s);
1259
- process.traceDeprecation ? console.trace(s) : console.error(s), p = !0;
1260
- }
1261
- return c.apply(this, arguments);
1262
- }
1263
- return w;
1264
- };
1265
- var n = {}, i = /^$/;
1266
- if (process.env.NODE_DEBUG) {
1267
- var o = process.env.NODE_DEBUG;
1268
- o = o.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), i = new RegExp("^" + o + "$", "i");
1269
- }
1270
- e.debuglog = function(c) {
1271
- if (c = c.toUpperCase(), !n[c])
1272
- if (i.test(c)) {
1273
- var s = process.pid;
1274
- n[c] = function() {
1275
- var p = e.format.apply(e, arguments);
1276
- console.error("%s %d: %s", c, s, p);
1277
- };
1278
- } else
1279
- n[c] = function() {
1280
- };
1281
- return n[c];
1282
- };
1283
- function a(c, s) {
1284
- var p = {
1285
- seen: [],
1286
- stylize: y
1287
- };
1288
- return arguments.length >= 3 && (p.depth = arguments[2]), arguments.length >= 4 && (p.colors = arguments[3]), I(s) ? p.showHidden = s : s && e._extend(p, s), Z(p.showHidden) && (p.showHidden = !1), Z(p.depth) && (p.depth = 2), Z(p.colors) && (p.colors = !1), Z(p.customInspect) && (p.customInspect = !0), p.colors && (p.stylize = u), f(p, c, p.depth);
1289
- }
1290
- e.inspect = a, a.colors = {
1291
- bold: [1, 22],
1292
- italic: [3, 23],
1293
- underline: [4, 24],
1294
- inverse: [7, 27],
1295
- white: [37, 39],
1296
- grey: [90, 39],
1297
- black: [30, 39],
1298
- blue: [34, 39],
1299
- cyan: [36, 39],
1300
- green: [32, 39],
1301
- magenta: [35, 39],
1302
- red: [31, 39],
1303
- yellow: [33, 39]
1304
- }, a.styles = {
1305
- special: "cyan",
1306
- number: "yellow",
1307
- boolean: "yellow",
1308
- undefined: "grey",
1309
- null: "bold",
1310
- string: "green",
1311
- date: "magenta",
1312
- // "name": intentionally not styling
1313
- regexp: "red"
1314
- };
1315
- function u(c, s) {
1316
- var p = a.styles[s];
1317
- return p ? "\x1B[" + a.colors[p][0] + "m" + c + "\x1B[" + a.colors[p][1] + "m" : c;
1318
- }
1319
- function y(c, s) {
1320
- return c;
1321
- }
1322
- function S(c) {
1323
- var s = {};
1324
- return c.forEach(function(p, w) {
1325
- s[p] = !0;
1326
- }), s;
1327
- }
1328
- function f(c, s, p) {
1329
- if (c.customInspect && s && _(s.inspect) && // Filter out the util module, it's inspect function is special
1330
- s.inspect !== e.inspect && // Also filter out any prototype objects using the circular check.
1331
- !(s.constructor && s.constructor.prototype === s)) {
1332
- var w = s.inspect(p, c);
1333
- return ie(w) || (w = f(c, w, p)), w;
1334
- }
1335
- var j = m(c, s);
1336
- if (j)
1337
- return j;
1338
- var B = Object.keys(s), O = S(B);
1339
- if (c.showHidden && (B = Object.getOwnPropertyNames(s)), b(s) && (B.indexOf("message") >= 0 || B.indexOf("description") >= 0))
1340
- return d(s);
1341
- if (B.length === 0) {
1342
- if (_(s)) {
1343
- var k = s.name ? ": " + s.name : "";
1344
- return c.stylize("[Function" + k + "]", "special");
1345
- }
1346
- if (K(s))
1347
- return c.stylize(RegExp.prototype.toString.call(s), "regexp");
1348
- if (A(s))
1349
- return c.stylize(Date.prototype.toString.call(s), "date");
1350
- if (b(s))
1351
- return d(s);
1352
- }
1353
- var R = "", H = !1, se = ["{", "}"];
1354
- if (F(s) && (H = !0, se = ["[", "]"]), _(s)) {
1355
- var Ue = s.name ? ": " + s.name : "";
1356
- R = " [Function" + Ue + "]";
1357
- }
1358
- if (K(s) && (R = " " + RegExp.prototype.toString.call(s)), A(s) && (R = " " + Date.prototype.toUTCString.call(s)), b(s) && (R = " " + d(s)), B.length === 0 && (!H || s.length == 0))
1359
- return se[0] + R + se[1];
1360
- if (p < 0)
1361
- return K(s) ? c.stylize(RegExp.prototype.toString.call(s), "regexp") : c.stylize("[Object]", "special");
1362
- c.seen.push(s);
1363
- var ge;
1364
- return H ? ge = h(c, s, p, O, B) : ge = B.map(function(We) {
1365
- return g(c, s, p, O, We, H);
1366
- }), c.seen.pop(), $(ge, R, se);
1367
- }
1368
- function m(c, s) {
1369
- if (Z(s))
1370
- return c.stylize("undefined", "undefined");
1371
- if (ie(s)) {
1372
- var p = "'" + JSON.stringify(s).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
1373
- return c.stylize(p, "string");
1374
- }
1375
- if (te(s))
1376
- return c.stylize("" + s, "number");
1377
- if (I(s))
1378
- return c.stylize("" + s, "boolean");
1379
- if (W(s))
1380
- return c.stylize("null", "null");
1381
- }
1382
- function d(c) {
1383
- return "[" + Error.prototype.toString.call(c) + "]";
1384
- }
1385
- function h(c, s, p, w, j) {
1386
- for (var B = [], O = 0, k = s.length; O < k; ++O)
1387
- T(s, String(O)) ? B.push(g(
1388
- c,
1389
- s,
1390
- p,
1391
- w,
1392
- String(O),
1393
- !0
1394
- )) : B.push("");
1395
- return j.forEach(function(R) {
1396
- R.match(/^\d+$/) || B.push(g(
1397
- c,
1398
- s,
1399
- p,
1400
- w,
1401
- R,
1402
- !0
1403
- ));
1404
- }), B;
1405
- }
1406
- function g(c, s, p, w, j, B) {
1407
- var O, k, R;
1408
- if (R = Object.getOwnPropertyDescriptor(s, j) || { value: s[j] }, R.get ? R.set ? k = c.stylize("[Getter/Setter]", "special") : k = c.stylize("[Getter]", "special") : R.set && (k = c.stylize("[Setter]", "special")), T(w, j) || (O = "[" + j + "]"), k || (c.seen.indexOf(R.value) < 0 ? (W(p) ? k = f(c, R.value, null) : k = f(c, R.value, p - 1), k.indexOf(`
1409
- `) > -1 && (B ? k = k.split(`
1410
- `).map(function(H) {
1411
- return " " + H;
1412
- }).join(`
1413
- `).slice(2) : k = `
1414
- ` + k.split(`
1415
- `).map(function(H) {
1416
- return " " + H;
1417
- }).join(`
1418
- `))) : k = c.stylize("[Circular]", "special")), Z(O)) {
1419
- if (B && j.match(/^\d+$/))
1420
- return k;
1421
- O = JSON.stringify("" + j), O.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (O = O.slice(1, -1), O = c.stylize(O, "name")) : (O = O.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), O = c.stylize(O, "string"));
1422
- }
1423
- return O + ": " + k;
1424
- }
1425
- function $(c, s, p) {
1426
- var w = c.reduce(function(j, B) {
1427
- return B.indexOf(`
1428
- `) >= 0, j + B.replace(/\u001b\[\d\d?m/g, "").length + 1;
1429
- }, 0);
1430
- return w > 60 ? p[0] + (s === "" ? "" : s + `
1431
- `) + " " + c.join(`,
1432
- `) + " " + p[1] : p[0] + s + " " + c.join(", ") + " " + p[1];
1433
- }
1434
- e.types = hr;
1435
- function F(c) {
1436
- return Array.isArray(c);
1437
- }
1438
- e.isArray = F;
1439
- function I(c) {
1440
- return typeof c == "boolean";
1441
- }
1442
- e.isBoolean = I;
1443
- function W(c) {
1444
- return c === null;
1445
- }
1446
- e.isNull = W;
1447
- function G(c) {
1448
- return c == null;
1449
- }
1450
- e.isNullOrUndefined = G;
1451
- function te(c) {
1452
- return typeof c == "number";
1453
- }
1454
- e.isNumber = te;
1455
- function ie(c) {
1456
- return typeof c == "string";
1457
- }
1458
- e.isString = ie;
1459
- function he(c) {
1460
- return typeof c == "symbol";
1461
- }
1462
- e.isSymbol = he;
1463
- function Z(c) {
1464
- return c === void 0;
1465
- }
1466
- e.isUndefined = Z;
1467
- function K(c) {
1468
- return v(c) && M(c) === "[object RegExp]";
1469
- }
1470
- e.isRegExp = K, e.types.isRegExp = K;
1471
- function v(c) {
1472
- return typeof c == "object" && c !== null;
1473
- }
1474
- e.isObject = v;
1475
- function A(c) {
1476
- return v(c) && M(c) === "[object Date]";
1477
- }
1478
- e.isDate = A, e.types.isDate = A;
1479
- function b(c) {
1480
- return v(c) && (M(c) === "[object Error]" || c instanceof Error);
1481
- }
1482
- e.isError = b, e.types.isNativeError = b;
1483
- function _(c) {
1484
- return typeof c == "function";
1485
- }
1486
- e.isFunction = _;
1487
- function L(c) {
1488
- return c === null || typeof c == "boolean" || typeof c == "number" || typeof c == "string" || typeof c == "symbol" || // ES6 symbol
1489
- typeof c > "u";
1490
- }
1491
- e.isPrimitive = L, e.isBuffer = Ki;
1492
- function M(c) {
1493
- return Object.prototype.toString.call(c);
1494
- }
1495
- function N(c) {
1496
- return c < 10 ? "0" + c.toString(10) : c.toString(10);
1497
- }
1498
- var C = [
1499
- "Jan",
1500
- "Feb",
1501
- "Mar",
1502
- "Apr",
1503
- "May",
1504
- "Jun",
1505
- "Jul",
1506
- "Aug",
1507
- "Sep",
1508
- "Oct",
1509
- "Nov",
1510
- "Dec"
1511
- ];
1512
- function D() {
1513
- var c = /* @__PURE__ */ new Date(), s = [
1514
- N(c.getHours()),
1515
- N(c.getMinutes()),
1516
- N(c.getSeconds())
1517
- ].join(":");
1518
- return [c.getDate(), C[c.getMonth()], s].join(" ");
1519
- }
1520
- e.log = function() {
1521
- console.log("%s - %s", D(), e.format.apply(e, arguments));
1522
- }, e.inherits = Pt, e._extend = function(c, s) {
1523
- if (!s || !v(s))
1524
- return c;
1525
- for (var p = Object.keys(s), w = p.length; w--; )
1526
- c[p[w]] = s[p[w]];
1527
- return c;
1528
- };
1529
- function T(c, s) {
1530
- return Object.prototype.hasOwnProperty.call(c, s);
1531
- }
1532
- var P = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
1533
- e.promisify = function(s) {
1534
- if (typeof s != "function")
1535
- throw new TypeError('The "original" argument must be of type Function');
1536
- if (P && s[P]) {
1537
- var p = s[P];
1538
- if (typeof p != "function")
1539
- throw new TypeError('The "util.promisify.custom" argument must be of type Function');
1540
- return Object.defineProperty(p, P, {
1541
- value: p,
1542
- enumerable: !1,
1543
- writable: !1,
1544
- configurable: !0
1545
- }), p;
1546
- }
1547
- function p() {
1548
- for (var w, j, B = new Promise(function(R, H) {
1549
- w = R, j = H;
1550
- }), O = [], k = 0; k < arguments.length; k++)
1551
- O.push(arguments[k]);
1552
- O.push(function(R, H) {
1553
- R ? j(R) : w(H);
1554
- });
1555
- try {
1556
- s.apply(this, O);
1557
- } catch (R) {
1558
- j(R);
1559
- }
1560
- return B;
1561
- }
1562
- return Object.setPrototypeOf(p, Object.getPrototypeOf(s)), P && Object.defineProperty(p, P, {
1563
- value: p,
1564
- enumerable: !1,
1565
- writable: !1,
1566
- configurable: !0
1567
- }), Object.defineProperties(
1568
- p,
1569
- t(s)
1570
- );
1571
- }, e.promisify.custom = P;
1572
- function fe(c, s) {
1573
- if (!c) {
1574
- var p = new Error("Promise was rejected with a falsy value");
1575
- p.reason = c, c = p;
1576
- }
1577
- return s(c);
1578
- }
1579
- function Te(c) {
1580
- if (typeof c != "function")
1581
- throw new TypeError('The "original" argument must be of type Function');
1582
- function s() {
1583
- for (var p = [], w = 0; w < arguments.length; w++)
1584
- p.push(arguments[w]);
1585
- var j = p.pop();
1586
- if (typeof j != "function")
1587
- throw new TypeError("The last argument must be of type Function");
1588
- var B = this, O = function() {
1589
- return j.apply(B, arguments);
1590
- };
1591
- c.apply(this, p).then(
1592
- function(k) {
1593
- process.nextTick(O.bind(null, null, k));
1594
- },
1595
- function(k) {
1596
- process.nextTick(fe.bind(null, k, O));
1597
- }
1598
- );
1599
- }
1600
- return Object.setPrototypeOf(s, Object.getPrototypeOf(c)), Object.defineProperties(
1601
- s,
1602
- t(c)
1603
- ), s;
1604
- }
1605
- e.callbackify = Te;
1606
- })(Nt);
1607
- var U = mr, eo = Mn, to = Tn, ro = Wn, Ge = Nt, V, Ke;
1608
- typeof Symbol == "function" && typeof Symbol.for == "function" ? (V = Symbol.for("graceful-fs.queue"), Ke = Symbol.for("graceful-fs.previous")) : (V = "___graceful-fs.queue", Ke = "___graceful-fs.previous");
1609
- function no() {
1610
- }
1611
- function Rr(e, t) {
1612
- Object.defineProperty(e, V, {
1613
- get: function() {
1614
- return t;
1615
- }
1616
- });
1617
- }
1618
- var pe = no;
1619
- Ge.debuglog ? pe = Ge.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (pe = function() {
1620
- var e = Ge.format.apply(Ge, arguments);
1621
- e = "GFS4: " + e.split(/\n/).join(`
1622
- GFS4: `), console.error(e);
1623
- });
1624
- if (!U[V]) {
1625
- var io = Ee[V] || [];
1626
- Rr(U, io), U.close = function(e) {
1627
- function t(r, n) {
1628
- return e.call(U, r, function(i) {
1629
- i || er(), typeof n == "function" && n.apply(this, arguments);
1630
- });
1631
- }
1632
- return Object.defineProperty(t, Ke, {
1633
- value: e
1634
- }), t;
1635
- }(U.close), U.closeSync = function(e) {
1636
- function t(r) {
1637
- e.apply(U, arguments), er();
1638
- }
1639
- return Object.defineProperty(t, Ke, {
1640
- value: e
1641
- }), t;
1642
- }(U.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
1643
- pe(U[V]), It.equal(U[V].length, 0);
1644
- });
1645
- }
1646
- Ee[V] || Rr(Ee, U[V]);
1647
- var Q = Rt(ro(U));
1648
- process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !U.__patched && (Q = Rt(U), U.__patched = !0);
1649
- function Rt(e) {
1650
- eo(e), e.gracefulify = Rt, e.createReadStream = ie, e.createWriteStream = he;
1651
- var t = e.readFile;
1652
- e.readFile = r;
1653
- function r(v, A, b) {
1654
- return typeof A == "function" && (b = A, A = null), _(v, A, b);
1655
- function _(L, M, N, C) {
1656
- return t(L, M, function(D) {
1657
- D && (D.code === "EMFILE" || D.code === "ENFILE") ? ve([_, [L, M, N], D, C || Date.now(), Date.now()]) : typeof N == "function" && N.apply(this, arguments);
1658
- });
1659
- }
1660
- }
1661
- var n = e.writeFile;
1662
- e.writeFile = i;
1663
- function i(v, A, b, _) {
1664
- return typeof b == "function" && (_ = b, b = null), L(v, A, b, _);
1665
- function L(M, N, C, D, T) {
1666
- return n(M, N, C, function(P) {
1667
- P && (P.code === "EMFILE" || P.code === "ENFILE") ? ve([L, [M, N, C, D], P, T || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments);
1668
- });
1669
- }
1670
- }
1671
- var o = e.appendFile;
1672
- o && (e.appendFile = a);
1673
- function a(v, A, b, _) {
1674
- return typeof b == "function" && (_ = b, b = null), L(v, A, b, _);
1675
- function L(M, N, C, D, T) {
1676
- return o(M, N, C, function(P) {
1677
- P && (P.code === "EMFILE" || P.code === "ENFILE") ? ve([L, [M, N, C, D], P, T || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments);
1678
- });
1679
- }
1680
- }
1681
- var u = e.copyFile;
1682
- u && (e.copyFile = y);
1683
- function y(v, A, b, _) {
1684
- return typeof b == "function" && (_ = b, b = 0), L(v, A, b, _);
1685
- function L(M, N, C, D, T) {
1686
- return u(M, N, C, function(P) {
1687
- P && (P.code === "EMFILE" || P.code === "ENFILE") ? ve([L, [M, N, C, D], P, T || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments);
1688
- });
1689
- }
1690
- }
1691
- var S = e.readdir;
1692
- e.readdir = m;
1693
- var f = /^v[0-5]\./;
1694
- function m(v, A, b) {
1695
- typeof A == "function" && (b = A, A = null);
1696
- var _ = f.test(process.version) ? function(N, C, D, T) {
1697
- return S(N, L(
1698
- N,
1699
- C,
1700
- D,
1701
- T
1702
- ));
1703
- } : function(N, C, D, T) {
1704
- return S(N, C, L(
1705
- N,
1706
- C,
1707
- D,
1708
- T
1709
- ));
1710
- };
1711
- return _(v, A, b);
1712
- function L(M, N, C, D) {
1713
- return function(T, P) {
1714
- T && (T.code === "EMFILE" || T.code === "ENFILE") ? ve([
1715
- _,
1716
- [M, N, C],
1717
- T,
1718
- D || Date.now(),
1719
- Date.now()
1720
- ]) : (P && P.sort && P.sort(), typeof C == "function" && C.call(this, T, P));
1721
- };
1722
- }
1723
- }
1724
- if (process.version.substr(0, 4) === "v0.8") {
1725
- var d = to(e);
1726
- I = d.ReadStream, G = d.WriteStream;
1727
- }
1728
- var h = e.ReadStream;
1729
- h && (I.prototype = Object.create(h.prototype), I.prototype.open = W);
1730
- var g = e.WriteStream;
1731
- g && (G.prototype = Object.create(g.prototype), G.prototype.open = te), Object.defineProperty(e, "ReadStream", {
1732
- get: function() {
1733
- return I;
1734
- },
1735
- set: function(v) {
1736
- I = v;
1737
- },
1738
- enumerable: !0,
1739
- configurable: !0
1740
- }), Object.defineProperty(e, "WriteStream", {
1741
- get: function() {
1742
- return G;
1743
- },
1744
- set: function(v) {
1745
- G = v;
1746
- },
1747
- enumerable: !0,
1748
- configurable: !0
1749
- });
1750
- var $ = I;
1751
- Object.defineProperty(e, "FileReadStream", {
1752
- get: function() {
1753
- return $;
1754
- },
1755
- set: function(v) {
1756
- $ = v;
1757
- },
1758
- enumerable: !0,
1759
- configurable: !0
1760
- });
1761
- var F = G;
1762
- Object.defineProperty(e, "FileWriteStream", {
1763
- get: function() {
1764
- return F;
1765
- },
1766
- set: function(v) {
1767
- F = v;
1768
- },
1769
- enumerable: !0,
1770
- configurable: !0
1771
- });
1772
- function I(v, A) {
1773
- return this instanceof I ? (h.apply(this, arguments), this) : I.apply(Object.create(I.prototype), arguments);
1774
- }
1775
- function W() {
1776
- var v = this;
1777
- K(v.path, v.flags, v.mode, function(A, b) {
1778
- A ? (v.autoClose && v.destroy(), v.emit("error", A)) : (v.fd = b, v.emit("open", b), v.read());
1779
- });
1780
- }
1781
- function G(v, A) {
1782
- return this instanceof G ? (g.apply(this, arguments), this) : G.apply(Object.create(G.prototype), arguments);
1783
- }
1784
- function te() {
1785
- var v = this;
1786
- K(v.path, v.flags, v.mode, function(A, b) {
1787
- A ? (v.destroy(), v.emit("error", A)) : (v.fd = b, v.emit("open", b));
1788
- });
1789
- }
1790
- function ie(v, A) {
1791
- return new e.ReadStream(v, A);
1792
- }
1793
- function he(v, A) {
1794
- return new e.WriteStream(v, A);
1795
- }
1796
- var Z = e.open;
1797
- e.open = K;
1798
- function K(v, A, b, _) {
1799
- return typeof b == "function" && (_ = b, b = null), L(v, A, b, _);
1800
- function L(M, N, C, D, T) {
1801
- return Z(M, N, C, function(P, fe) {
1802
- P && (P.code === "EMFILE" || P.code === "ENFILE") ? ve([L, [M, N, C, D], P, T || Date.now(), Date.now()]) : typeof D == "function" && D.apply(this, arguments);
1803
- });
1804
- }
1805
- }
1806
- return e;
1807
- }
1808
- function ve(e) {
1809
- pe("ENQUEUE", e[0].name, e[1]), U[V].push(e), Tt();
1810
- }
1811
- var Je;
1812
- function er() {
1813
- for (var e = Date.now(), t = 0; t < U[V].length; ++t)
1814
- U[V][t].length > 2 && (U[V][t][3] = e, U[V][t][4] = e);
1815
- Tt();
1816
- }
1817
- function Tt() {
1818
- if (clearTimeout(Je), Je = void 0, U[V].length !== 0) {
1819
- var e = U[V].shift(), t = e[0], r = e[1], n = e[2], i = e[3], o = e[4];
1820
- if (i === void 0)
1821
- pe("RETRY", t.name, r), t.apply(null, r);
1822
- else if (Date.now() - i >= 6e4) {
1823
- pe("TIMEOUT", t.name, r);
1824
- var a = r.pop();
1825
- typeof a == "function" && a.call(null, n);
1826
- } else {
1827
- var u = Date.now() - o, y = Math.max(o - i, 1), S = Math.min(y * 1.2, 100);
1828
- u >= S ? (pe("RETRY", t.name, r), t.apply(null, r.concat([i]))) : U[V].push(e);
1829
- }
1830
- Je === void 0 && (Je = setTimeout(Tt, 0));
1831
- }
1832
- }
1833
- (function(e) {
1834
- const t = q.fromCallback, r = Q, n = [
1835
- "access",
1836
- "appendFile",
1837
- "chmod",
1838
- "chown",
1839
- "close",
1840
- "copyFile",
1841
- "fchmod",
1842
- "fchown",
1843
- "fdatasync",
1844
- "fstat",
1845
- "fsync",
1846
- "ftruncate",
1847
- "futimes",
1848
- "lchmod",
1849
- "lchown",
1850
- "link",
1851
- "lstat",
1852
- "mkdir",
1853
- "mkdtemp",
1854
- "open",
1855
- "opendir",
1856
- "readdir",
1857
- "readFile",
1858
- "readlink",
1859
- "realpath",
1860
- "rename",
1861
- "rm",
1862
- "rmdir",
1863
- "stat",
1864
- "symlink",
1865
- "truncate",
1866
- "unlink",
1867
- "utimes",
1868
- "writeFile"
1869
- ].filter((i) => typeof r[i] == "function");
1870
- Object.assign(e, r), n.forEach((i) => {
1871
- e[i] = t(r[i]);
1872
- }), e.exists = function(i, o) {
1873
- return typeof o == "function" ? r.exists(i, o) : new Promise((a) => r.exists(i, a));
1874
- }, e.read = function(i, o, a, u, y, S) {
1875
- return typeof S == "function" ? r.read(i, o, a, u, y, S) : new Promise((f, m) => {
1876
- r.read(i, o, a, u, y, (d, h, g) => {
1877
- if (d)
1878
- return m(d);
1879
- f({ bytesRead: h, buffer: g });
1880
- });
1881
- });
1882
- }, e.write = function(i, o, ...a) {
1883
- return typeof a[a.length - 1] == "function" ? r.write(i, o, ...a) : new Promise((u, y) => {
1884
- r.write(i, o, ...a, (S, f, m) => {
1885
- if (S)
1886
- return y(S);
1887
- u({ bytesWritten: f, buffer: m });
1888
- });
1889
- });
1890
- }, e.readv = function(i, o, ...a) {
1891
- return typeof a[a.length - 1] == "function" ? r.readv(i, o, ...a) : new Promise((u, y) => {
1892
- r.readv(i, o, ...a, (S, f, m) => {
1893
- if (S)
1894
- return y(S);
1895
- u({ bytesRead: f, buffers: m });
1896
- });
1897
- });
1898
- }, e.writev = function(i, o, ...a) {
1899
- return typeof a[a.length - 1] == "function" ? r.writev(i, o, ...a) : new Promise((u, y) => {
1900
- r.writev(i, o, ...a, (S, f, m) => {
1901
- if (S)
1902
- return y(S);
1903
- u({ bytesWritten: f, buffers: m });
1904
- });
1905
- });
1906
- }, typeof r.realpath.native == "function" ? e.realpath.native = t(r.realpath.native) : process.emitWarning(
1907
- "fs.realpath.native is not a function. Is fs being monkey-patched?",
1908
- "Warning",
1909
- "fs-extra-WARN0003"
1910
- );
1911
- })(me);
1912
- var Ut = {}, Tr = {};
1913
- const oo = X;
1914
- Tr.checkPath = function(t) {
1915
- if (process.platform === "win32" && /[<>:"|?*]/.test(t.replace(oo.parse(t).root, ""))) {
1916
- const n = new Error(`Path contains invalid characters: ${t}`);
1917
- throw n.code = "EINVAL", n;
1918
- }
1919
- };
1920
- const Ur = me, { checkPath: Wr } = Tr, Lr = (e) => {
1921
- const t = { mode: 511 };
1922
- return typeof e == "number" ? e : { ...t, ...e }.mode;
1923
- };
1924
- Ut.makeDir = async (e, t) => (Wr(e), Ur.mkdir(e, {
1925
- mode: Lr(t),
1926
- recursive: !0
1927
- }));
1928
- Ut.makeDirSync = (e, t) => (Wr(e), Ur.mkdirSync(e, {
1929
- mode: Lr(t),
1930
- recursive: !0
1931
- }));
1932
- const ao = q.fromPromise, { makeDir: co, makeDirSync: gt } = Ut, St = ao(co);
1933
- var ne = {
1934
- mkdirs: St,
1935
- mkdirsSync: gt,
1936
- // alias
1937
- mkdirp: St,
1938
- mkdirpSync: gt,
1939
- ensureDir: St,
1940
- ensureDirSync: gt
1941
- };
1942
- const uo = q.fromPromise, Gr = me;
1943
- function fo(e) {
1944
- return Gr.access(e).then(() => !0).catch(() => !1);
1945
- }
1946
- var de = {
1947
- pathExists: uo(fo),
1948
- pathExistsSync: Gr.existsSync
1949
- };
1950
- const Oe = Q;
1951
- function so(e, t, r, n) {
1952
- Oe.open(e, "r+", (i, o) => {
1953
- if (i)
1954
- return n(i);
1955
- Oe.futimes(o, t, r, (a) => {
1956
- Oe.close(o, (u) => {
1957
- n && n(a || u);
1958
- });
1959
- });
1960
- });
1961
- }
1962
- function lo(e, t, r) {
1963
- const n = Oe.openSync(e, "r+");
1964
- return Oe.futimesSync(n, t, r), Oe.closeSync(n);
1965
- }
1966
- var Jr = {
1967
- utimesMillis: so,
1968
- utimesMillisSync: lo
1969
- };
1970
- const Pe = me, J = X, yo = Nt;
1971
- function po(e, t, r) {
1972
- const n = r.dereference ? (i) => Pe.stat(i, { bigint: !0 }) : (i) => Pe.lstat(i, { bigint: !0 });
1973
- return Promise.all([
1974
- n(e),
1975
- n(t).catch((i) => {
1976
- if (i.code === "ENOENT")
1977
- return null;
1978
- throw i;
1979
- })
1980
- ]).then(([i, o]) => ({ srcStat: i, destStat: o }));
1981
- }
1982
- function mo(e, t, r) {
1983
- let n;
1984
- const i = r.dereference ? (a) => Pe.statSync(a, { bigint: !0 }) : (a) => Pe.lstatSync(a, { bigint: !0 }), o = i(e);
1985
- try {
1986
- n = i(t);
1987
- } catch (a) {
1988
- if (a.code === "ENOENT")
1989
- return { srcStat: o, destStat: null };
1990
- throw a;
1991
- }
1992
- return { srcStat: o, destStat: n };
1993
- }
1994
- function ho(e, t, r, n, i) {
1995
- yo.callbackify(po)(e, t, n, (o, a) => {
1996
- if (o)
1997
- return i(o);
1998
- const { srcStat: u, destStat: y } = a;
1999
- if (y) {
2000
- if (Re(u, y)) {
2001
- const S = J.basename(e), f = J.basename(t);
2002
- return r === "move" && S !== f && S.toLowerCase() === f.toLowerCase() ? i(null, { srcStat: u, destStat: y, isChangingCase: !0 }) : i(new Error("Source and destination must not be the same."));
2003
- }
2004
- if (u.isDirectory() && !y.isDirectory())
2005
- return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));
2006
- if (!u.isDirectory() && y.isDirectory())
2007
- return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`));
2008
- }
2009
- return u.isDirectory() && Wt(e, t) ? i(new Error(nt(e, t, r))) : i(null, { srcStat: u, destStat: y });
2010
- });
2011
- }
2012
- function go(e, t, r, n) {
2013
- const { srcStat: i, destStat: o } = mo(e, t, n);
2014
- if (o) {
2015
- if (Re(i, o)) {
2016
- const a = J.basename(e), u = J.basename(t);
2017
- if (r === "move" && a !== u && a.toLowerCase() === u.toLowerCase())
2018
- return { srcStat: i, destStat: o, isChangingCase: !0 };
2019
- throw new Error("Source and destination must not be the same.");
2020
- }
2021
- if (i.isDirectory() && !o.isDirectory())
2022
- throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);
2023
- if (!i.isDirectory() && o.isDirectory())
2024
- throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`);
2025
- }
2026
- if (i.isDirectory() && Wt(e, t))
2027
- throw new Error(nt(e, t, r));
2028
- return { srcStat: i, destStat: o };
2029
- }
2030
- function Vr(e, t, r, n, i) {
2031
- const o = J.resolve(J.dirname(e)), a = J.resolve(J.dirname(r));
2032
- if (a === o || a === J.parse(a).root)
2033
- return i();
2034
- Pe.stat(a, { bigint: !0 }, (u, y) => u ? u.code === "ENOENT" ? i() : i(u) : Re(t, y) ? i(new Error(nt(e, r, n))) : Vr(e, t, a, n, i));
2035
- }
2036
- function zr(e, t, r, n) {
2037
- const i = J.resolve(J.dirname(e)), o = J.resolve(J.dirname(r));
2038
- if (o === i || o === J.parse(o).root)
2039
- return;
2040
- let a;
2041
- try {
2042
- a = Pe.statSync(o, { bigint: !0 });
2043
- } catch (u) {
2044
- if (u.code === "ENOENT")
2045
- return;
2046
- throw u;
2047
- }
2048
- if (Re(t, a))
2049
- throw new Error(nt(e, r, n));
2050
- return zr(e, t, o, n);
2051
- }
2052
- function Re(e, t) {
2053
- return t.ino && t.dev && t.ino === e.ino && t.dev === e.dev;
2054
- }
2055
- function Wt(e, t) {
2056
- const r = J.resolve(e).split(J.sep).filter((i) => i), n = J.resolve(t).split(J.sep).filter((i) => i);
2057
- return r.reduce((i, o, a) => i && n[a] === o, !0);
2058
- }
2059
- function nt(e, t, r) {
2060
- return `Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`;
2061
- }
2062
- var Fe = {
2063
- checkPaths: ho,
2064
- checkPathsSync: go,
2065
- checkParentPaths: Vr,
2066
- checkParentPathsSync: zr,
2067
- isSrcSubdir: Wt,
2068
- areIdentical: Re
2069
- };
2070
- const Y = Q, Ne = X, So = ne.mkdirs, vo = de.pathExists, wo = Jr.utimesMillis, Ce = Fe;
2071
- function bo(e, t, r, n) {
2072
- typeof r == "function" && !n ? (n = r, r = {}) : typeof r == "function" && (r = { filter: r }), n = n || function() {
2073
- }, r = r || {}, r.clobber = "clobber" in r ? !!r.clobber : !0, r.overwrite = "overwrite" in r ? !!r.overwrite : r.clobber, r.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
2074
- `Using the preserveTimestamps option in 32-bit node is not recommended;
2075
-
2076
- see https://github.com/jprichardson/node-fs-extra/issues/269`,
2077
- "Warning",
2078
- "fs-extra-WARN0001"
2079
- ), Ce.checkPaths(e, t, "copy", r, (i, o) => {
2080
- if (i)
2081
- return n(i);
2082
- const { srcStat: a, destStat: u } = o;
2083
- Ce.checkParentPaths(e, a, t, "copy", (y) => {
2084
- if (y)
2085
- return n(y);
2086
- xr(e, t, r, (S, f) => {
2087
- if (S)
2088
- return n(S);
2089
- if (!f)
2090
- return n();
2091
- Ao(u, e, t, r, n);
2092
- });
2093
- });
2094
- });
2095
- }
2096
- function Ao(e, t, r, n, i) {
2097
- const o = Ne.dirname(r);
2098
- vo(o, (a, u) => {
2099
- if (a)
2100
- return i(a);
2101
- if (u)
2102
- return kt(e, t, r, n, i);
2103
- So(o, (y) => y ? i(y) : kt(e, t, r, n, i));
2104
- });
2105
- }
2106
- function xr(e, t, r, n) {
2107
- if (!r.filter)
2108
- return n(null, !0);
2109
- Promise.resolve(r.filter(e, t)).then((i) => n(null, i), (i) => n(i));
2110
- }
2111
- function kt(e, t, r, n, i) {
2112
- (n.dereference ? Y.stat : Y.lstat)(t, (a, u) => a ? i(a) : u.isDirectory() ? jo(u, e, t, r, n, i) : u.isFile() || u.isCharacterDevice() || u.isBlockDevice() ? Oo(u, e, t, r, n, i) : u.isSymbolicLink() ? No(e, t, r, n, i) : u.isSocket() ? i(new Error(`Cannot copy a socket file: ${t}`)) : u.isFIFO() ? i(new Error(`Cannot copy a FIFO pipe: ${t}`)) : i(new Error(`Unknown file: ${t}`)));
2113
- }
2114
- function Oo(e, t, r, n, i, o) {
2115
- return t ? Eo(e, r, n, i, o) : qr(e, r, n, i, o);
2116
- }
2117
- function Eo(e, t, r, n, i) {
2118
- if (n.overwrite)
2119
- Y.unlink(r, (o) => o ? i(o) : qr(e, t, r, n, i));
2120
- else
2121
- return n.errorOnExist ? i(new Error(`'${r}' already exists`)) : i();
2122
- }
2123
- function qr(e, t, r, n, i) {
2124
- Y.copyFile(t, r, (o) => o ? i(o) : n.preserveTimestamps ? $o(e.mode, t, r, i) : it(r, e.mode, i));
2125
- }
2126
- function $o(e, t, r, n) {
2127
- return Po(e) ? ko(r, e, (i) => i ? n(i) : tr(e, t, r, n)) : tr(e, t, r, n);
2128
- }
2129
- function Po(e) {
2130
- return (e & 128) === 0;
2131
- }
2132
- function ko(e, t, r) {
2133
- return it(e, t | 128, r);
2134
- }
2135
- function tr(e, t, r, n) {
2136
- Fo(t, r, (i) => i ? n(i) : it(r, e, n));
2137
- }
2138
- function it(e, t, r) {
2139
- return Y.chmod(e, t, r);
2140
- }
2141
- function Fo(e, t, r) {
2142
- Y.stat(e, (n, i) => n ? r(n) : wo(t, i.atime, i.mtime, r));
2143
- }
2144
- function jo(e, t, r, n, i, o) {
2145
- return t ? Hr(r, n, i, o) : Do(e.mode, r, n, i, o);
2146
- }
2147
- function Do(e, t, r, n, i) {
2148
- Y.mkdir(r, (o) => {
2149
- if (o)
2150
- return i(o);
2151
- Hr(t, r, n, (a) => a ? i(a) : it(r, e, i));
2152
- });
2153
- }
2154
- function Hr(e, t, r, n) {
2155
- Y.readdir(e, (i, o) => i ? n(i) : Ft(o, e, t, r, n));
2156
- }
2157
- function Ft(e, t, r, n, i) {
2158
- const o = e.pop();
2159
- return o ? Io(e, o, t, r, n, i) : i();
2160
- }
2161
- function Io(e, t, r, n, i, o) {
2162
- const a = Ne.join(r, t), u = Ne.join(n, t);
2163
- xr(a, u, i, (y, S) => {
2164
- if (y)
2165
- return o(y);
2166
- if (!S)
2167
- return Ft(e, r, n, i, o);
2168
- Ce.checkPaths(a, u, "copy", i, (f, m) => {
2169
- if (f)
2170
- return o(f);
2171
- const { destStat: d } = m;
2172
- kt(d, a, u, i, (h) => h ? o(h) : Ft(e, r, n, i, o));
2173
- });
2174
- });
2175
- }
2176
- function No(e, t, r, n, i) {
2177
- Y.readlink(t, (o, a) => {
2178
- if (o)
2179
- return i(o);
2180
- if (n.dereference && (a = Ne.resolve(process.cwd(), a)), e)
2181
- Y.readlink(r, (u, y) => u ? u.code === "EINVAL" || u.code === "UNKNOWN" ? Y.symlink(a, r, i) : i(u) : (n.dereference && (y = Ne.resolve(process.cwd(), y)), Ce.isSrcSubdir(a, y) ? i(new Error(`Cannot copy '${a}' to a subdirectory of itself, '${y}'.`)) : Ce.isSrcSubdir(y, a) ? i(new Error(`Cannot overwrite '${y}' with '${a}'.`)) : Co(a, r, i)));
2182
- else
2183
- return Y.symlink(a, r, i);
2184
- });
2185
- }
2186
- function Co(e, t, r) {
2187
- Y.unlink(t, (n) => n ? r(n) : Y.symlink(e, t, r));
2188
- }
2189
- var Bo = bo;
2190
- const z = Q, Be = X, _o = ne.mkdirsSync, Mo = Jr.utimesMillisSync, _e = Fe;
2191
- function Ro(e, t, r) {
2192
- typeof r == "function" && (r = { filter: r }), r = r || {}, r.clobber = "clobber" in r ? !!r.clobber : !0, r.overwrite = "overwrite" in r ? !!r.overwrite : r.clobber, r.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
2193
- `Using the preserveTimestamps option in 32-bit node is not recommended;
2194
-
2195
- see https://github.com/jprichardson/node-fs-extra/issues/269`,
2196
- "Warning",
2197
- "fs-extra-WARN0002"
2198
- );
2199
- const { srcStat: n, destStat: i } = _e.checkPathsSync(e, t, "copy", r);
2200
- if (_e.checkParentPathsSync(e, n, t, "copy"), r.filter && !r.filter(e, t))
2201
- return;
2202
- const o = Be.dirname(t);
2203
- return z.existsSync(o) || _o(o), Yr(i, e, t, r);
2204
- }
2205
- function Yr(e, t, r, n) {
2206
- const o = (n.dereference ? z.statSync : z.lstatSync)(t);
2207
- if (o.isDirectory())
2208
- return Vo(o, e, t, r, n);
2209
- if (o.isFile() || o.isCharacterDevice() || o.isBlockDevice())
2210
- return To(o, e, t, r, n);
2211
- if (o.isSymbolicLink())
2212
- return qo(e, t, r, n);
2213
- throw o.isSocket() ? new Error(`Cannot copy a socket file: ${t}`) : o.isFIFO() ? new Error(`Cannot copy a FIFO pipe: ${t}`) : new Error(`Unknown file: ${t}`);
2214
- }
2215
- function To(e, t, r, n, i) {
2216
- return t ? Uo(e, r, n, i) : Qr(e, r, n, i);
2217
- }
2218
- function Uo(e, t, r, n) {
2219
- if (n.overwrite)
2220
- return z.unlinkSync(r), Qr(e, t, r, n);
2221
- if (n.errorOnExist)
2222
- throw new Error(`'${r}' already exists`);
2223
- }
2224
- function Qr(e, t, r, n) {
2225
- return z.copyFileSync(t, r), n.preserveTimestamps && Wo(e.mode, t, r), Lt(r, e.mode);
2226
- }
2227
- function Wo(e, t, r) {
2228
- return Lo(e) && Go(r, e), Jo(t, r);
2229
- }
2230
- function Lo(e) {
2231
- return (e & 128) === 0;
2232
- }
2233
- function Go(e, t) {
2234
- return Lt(e, t | 128);
2235
- }
2236
- function Lt(e, t) {
2237
- return z.chmodSync(e, t);
2238
- }
2239
- function Jo(e, t) {
2240
- const r = z.statSync(e);
2241
- return Mo(t, r.atime, r.mtime);
2242
- }
2243
- function Vo(e, t, r, n, i) {
2244
- return t ? Xr(r, n, i) : zo(e.mode, r, n, i);
2245
- }
2246
- function zo(e, t, r, n) {
2247
- return z.mkdirSync(r), Xr(t, r, n), Lt(r, e);
2248
- }
2249
- function Xr(e, t, r) {
2250
- z.readdirSync(e).forEach((n) => xo(n, e, t, r));
2251
- }
2252
- function xo(e, t, r, n) {
2253
- const i = Be.join(t, e), o = Be.join(r, e);
2254
- if (n.filter && !n.filter(i, o))
2255
- return;
2256
- const { destStat: a } = _e.checkPathsSync(i, o, "copy", n);
2257
- return Yr(a, i, o, n);
2258
- }
2259
- function qo(e, t, r, n) {
2260
- let i = z.readlinkSync(t);
2261
- if (n.dereference && (i = Be.resolve(process.cwd(), i)), e) {
2262
- let o;
2263
- try {
2264
- o = z.readlinkSync(r);
2265
- } catch (a) {
2266
- if (a.code === "EINVAL" || a.code === "UNKNOWN")
2267
- return z.symlinkSync(i, r);
2268
- throw a;
2269
- }
2270
- if (n.dereference && (o = Be.resolve(process.cwd(), o)), _e.isSrcSubdir(i, o))
2271
- throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);
2272
- if (_e.isSrcSubdir(o, i))
2273
- throw new Error(`Cannot overwrite '${o}' with '${i}'.`);
2274
- return Ho(i, r);
2275
- } else
2276
- return z.symlinkSync(i, r);
2277
- }
2278
- function Ho(e, t) {
2279
- return z.unlinkSync(t), z.symlinkSync(e, t);
2280
- }
2281
- var Yo = Ro;
2282
- const Qo = q.fromCallback;
2283
- var Gt = {
2284
- copy: Qo(Bo),
2285
- copySync: Yo
2286
- };
2287
- const Zr = Q, Xo = q.fromCallback;
2288
- function Zo(e, t) {
2289
- Zr.rm(e, { recursive: !0, force: !0 }, t);
2290
- }
2291
- function Ko(e) {
2292
- Zr.rmSync(e, { recursive: !0, force: !0 });
2293
- }
2294
- var ot = {
2295
- remove: Xo(Zo),
2296
- removeSync: Ko
2297
- };
2298
- const ea = q.fromPromise, Kr = me, en = X, tn = ne, rn = ot, rr = ea(async function(t) {
2299
- let r;
2300
- try {
2301
- r = await Kr.readdir(t);
2302
- } catch {
2303
- return tn.mkdirs(t);
2304
- }
2305
- return Promise.all(r.map((n) => rn.remove(en.join(t, n))));
2306
- });
2307
- function nr(e) {
2308
- let t;
2309
- try {
2310
- t = Kr.readdirSync(e);
2311
- } catch {
2312
- return tn.mkdirsSync(e);
2313
- }
2314
- t.forEach((r) => {
2315
- r = en.join(e, r), rn.removeSync(r);
2316
- });
2317
- }
2318
- var ta = {
2319
- emptyDirSync: nr,
2320
- emptydirSync: nr,
2321
- emptyDir: rr,
2322
- emptydir: rr
2323
- };
2324
- const ra = q.fromCallback, nn = X, ce = Q, on = ne;
2325
- function na(e, t) {
2326
- function r() {
2327
- ce.writeFile(e, "", (n) => {
2328
- if (n)
2329
- return t(n);
2330
- t();
2331
- });
2332
- }
2333
- ce.stat(e, (n, i) => {
2334
- if (!n && i.isFile())
2335
- return t();
2336
- const o = nn.dirname(e);
2337
- ce.stat(o, (a, u) => {
2338
- if (a)
2339
- return a.code === "ENOENT" ? on.mkdirs(o, (y) => {
2340
- if (y)
2341
- return t(y);
2342
- r();
2343
- }) : t(a);
2344
- u.isDirectory() ? r() : ce.readdir(o, (y) => {
2345
- if (y)
2346
- return t(y);
2347
- });
2348
- });
2349
- });
2350
- }
2351
- function ia(e) {
2352
- let t;
2353
- try {
2354
- t = ce.statSync(e);
2355
- } catch {
2356
- }
2357
- if (t && t.isFile())
2358
- return;
2359
- const r = nn.dirname(e);
2360
- try {
2361
- ce.statSync(r).isDirectory() || ce.readdirSync(r);
2362
- } catch (n) {
2363
- if (n && n.code === "ENOENT")
2364
- on.mkdirsSync(r);
2365
- else
2366
- throw n;
2367
- }
2368
- ce.writeFileSync(e, "");
2369
- }
2370
- var oa = {
2371
- createFile: ra(na),
2372
- createFileSync: ia
2373
- };
2374
- const aa = q.fromCallback, an = X, ae = Q, cn = ne, ca = de.pathExists, { areIdentical: un } = Fe;
2375
- function ua(e, t, r) {
2376
- function n(i, o) {
2377
- ae.link(i, o, (a) => {
2378
- if (a)
2379
- return r(a);
2380
- r(null);
2381
- });
2382
- }
2383
- ae.lstat(t, (i, o) => {
2384
- ae.lstat(e, (a, u) => {
2385
- if (a)
2386
- return a.message = a.message.replace("lstat", "ensureLink"), r(a);
2387
- if (o && un(u, o))
2388
- return r(null);
2389
- const y = an.dirname(t);
2390
- ca(y, (S, f) => {
2391
- if (S)
2392
- return r(S);
2393
- if (f)
2394
- return n(e, t);
2395
- cn.mkdirs(y, (m) => {
2396
- if (m)
2397
- return r(m);
2398
- n(e, t);
2399
- });
2400
- });
2401
- });
2402
- });
2403
- }
2404
- function fa(e, t) {
2405
- let r;
2406
- try {
2407
- r = ae.lstatSync(t);
2408
- } catch {
2409
- }
2410
- try {
2411
- const o = ae.lstatSync(e);
2412
- if (r && un(o, r))
2413
- return;
2414
- } catch (o) {
2415
- throw o.message = o.message.replace("lstat", "ensureLink"), o;
2416
- }
2417
- const n = an.dirname(t);
2418
- return ae.existsSync(n) || cn.mkdirsSync(n), ae.linkSync(e, t);
2419
- }
2420
- var sa = {
2421
- createLink: aa(ua),
2422
- createLinkSync: fa
2423
- };
2424
- const ue = X, De = Q, la = de.pathExists;
2425
- function ya(e, t, r) {
2426
- if (ue.isAbsolute(e))
2427
- return De.lstat(e, (n) => n ? (n.message = n.message.replace("lstat", "ensureSymlink"), r(n)) : r(null, {
2428
- toCwd: e,
2429
- toDst: e
2430
- }));
2431
- {
2432
- const n = ue.dirname(t), i = ue.join(n, e);
2433
- return la(i, (o, a) => o ? r(o) : a ? r(null, {
2434
- toCwd: i,
2435
- toDst: e
2436
- }) : De.lstat(e, (u) => u ? (u.message = u.message.replace("lstat", "ensureSymlink"), r(u)) : r(null, {
2437
- toCwd: e,
2438
- toDst: ue.relative(n, e)
2439
- })));
2440
- }
2441
- }
2442
- function pa(e, t) {
2443
- let r;
2444
- if (ue.isAbsolute(e)) {
2445
- if (r = De.existsSync(e), !r)
2446
- throw new Error("absolute srcpath does not exist");
2447
- return {
2448
- toCwd: e,
2449
- toDst: e
2450
- };
2451
- } else {
2452
- const n = ue.dirname(t), i = ue.join(n, e);
2453
- if (r = De.existsSync(i), r)
2454
- return {
2455
- toCwd: i,
2456
- toDst: e
2457
- };
2458
- if (r = De.existsSync(e), !r)
2459
- throw new Error("relative srcpath does not exist");
2460
- return {
2461
- toCwd: e,
2462
- toDst: ue.relative(n, e)
2463
- };
2464
- }
2465
- }
2466
- var ma = {
2467
- symlinkPaths: ya,
2468
- symlinkPathsSync: pa
2469
- };
2470
- const fn = Q;
2471
- function da(e, t, r) {
2472
- if (r = typeof t == "function" ? t : r, t = typeof t == "function" ? !1 : t, t)
2473
- return r(null, t);
2474
- fn.lstat(e, (n, i) => {
2475
- if (n)
2476
- return r(null, "file");
2477
- t = i && i.isDirectory() ? "dir" : "file", r(null, t);
2478
- });
2479
- }
2480
- function ha(e, t) {
2481
- let r;
2482
- if (t)
2483
- return t;
2484
- try {
2485
- r = fn.lstatSync(e);
2486
- } catch {
2487
- return "file";
2488
- }
2489
- return r && r.isDirectory() ? "dir" : "file";
2490
- }
2491
- var ga = {
2492
- symlinkType: da,
2493
- symlinkTypeSync: ha
2494
- };
2495
- const Sa = q.fromCallback, sn = X, ee = me, ln = ne, va = ln.mkdirs, wa = ln.mkdirsSync, yn = ma, ba = yn.symlinkPaths, Aa = yn.symlinkPathsSync, pn = ga, Oa = pn.symlinkType, Ea = pn.symlinkTypeSync, $a = de.pathExists, { areIdentical: mn } = Fe;
2496
- function Pa(e, t, r, n) {
2497
- n = typeof r == "function" ? r : n, r = typeof r == "function" ? !1 : r, ee.lstat(t, (i, o) => {
2498
- !i && o.isSymbolicLink() ? Promise.all([
2499
- ee.stat(e),
2500
- ee.stat(t)
2501
- ]).then(([a, u]) => {
2502
- if (mn(a, u))
2503
- return n(null);
2504
- ir(e, t, r, n);
2505
- }) : ir(e, t, r, n);
2506
- });
2507
- }
2508
- function ir(e, t, r, n) {
2509
- ba(e, t, (i, o) => {
2510
- if (i)
2511
- return n(i);
2512
- e = o.toDst, Oa(o.toCwd, r, (a, u) => {
2513
- if (a)
2514
- return n(a);
2515
- const y = sn.dirname(t);
2516
- $a(y, (S, f) => {
2517
- if (S)
2518
- return n(S);
2519
- if (f)
2520
- return ee.symlink(e, t, u, n);
2521
- va(y, (m) => {
2522
- if (m)
2523
- return n(m);
2524
- ee.symlink(e, t, u, n);
2525
- });
2526
- });
2527
- });
2528
- });
2529
- }
2530
- function ka(e, t, r) {
2531
- let n;
2532
- try {
2533
- n = ee.lstatSync(t);
2534
- } catch {
2535
- }
2536
- if (n && n.isSymbolicLink()) {
2537
- const u = ee.statSync(e), y = ee.statSync(t);
2538
- if (mn(u, y))
2539
- return;
2540
- }
2541
- const i = Aa(e, t);
2542
- e = i.toDst, r = Ea(i.toCwd, r);
2543
- const o = sn.dirname(t);
2544
- return ee.existsSync(o) || wa(o), ee.symlinkSync(e, t, r);
2545
- }
2546
- var Fa = {
2547
- createSymlink: Sa(Pa),
2548
- createSymlinkSync: ka
2549
- };
2550
- const { createFile: or, createFileSync: ar } = oa, { createLink: cr, createLinkSync: ur } = sa, { createSymlink: fr, createSymlinkSync: sr } = Fa;
2551
- var ja = {
2552
- // file
2553
- createFile: or,
2554
- createFileSync: ar,
2555
- ensureFile: or,
2556
- ensureFileSync: ar,
2557
- // link
2558
- createLink: cr,
2559
- createLinkSync: ur,
2560
- ensureLink: cr,
2561
- ensureLinkSync: ur,
2562
- // symlink
2563
- createSymlink: fr,
2564
- createSymlinkSync: sr,
2565
- ensureSymlink: fr,
2566
- ensureSymlinkSync: sr
2567
- };
2568
- function Da(e, { EOL: t = `
2569
- `, finalEOL: r = !0, replacer: n = null, spaces: i } = {}) {
2570
- const o = r ? t : "";
2571
- return JSON.stringify(e, n, i).replace(/\n/g, t) + o;
2572
- }
2573
- function Ia(e) {
2574
- return Buffer.isBuffer(e) && (e = e.toString("utf8")), e.replace(/^\uFEFF/, "");
2575
- }
2576
- var Jt = { stringify: Da, stripBom: Ia };
2577
- let ke;
2578
- try {
2579
- ke = Q;
2580
- } catch {
2581
- ke = mr;
2582
- }
2583
- const at = q, { stringify: dn, stripBom: hn } = Jt;
2584
- async function Na(e, t = {}) {
2585
- typeof t == "string" && (t = { encoding: t });
2586
- const r = t.fs || ke, n = "throws" in t ? t.throws : !0;
2587
- let i = await at.fromCallback(r.readFile)(e, t);
2588
- i = hn(i);
2589
- let o;
2590
- try {
2591
- o = JSON.parse(i, t ? t.reviver : null);
2592
- } catch (a) {
2593
- if (n)
2594
- throw a.message = `${e}: ${a.message}`, a;
2595
- return null;
2596
- }
2597
- return o;
2598
- }
2599
- const Ca = at.fromPromise(Na);
2600
- function Ba(e, t = {}) {
2601
- typeof t == "string" && (t = { encoding: t });
2602
- const r = t.fs || ke, n = "throws" in t ? t.throws : !0;
2603
- try {
2604
- let i = r.readFileSync(e, t);
2605
- return i = hn(i), JSON.parse(i, t.reviver);
2606
- } catch (i) {
2607
- if (n)
2608
- throw i.message = `${e}: ${i.message}`, i;
2609
- return null;
2610
- }
2611
- }
2612
- async function _a(e, t, r = {}) {
2613
- const n = r.fs || ke, i = dn(t, r);
2614
- await at.fromCallback(n.writeFile)(e, i, r);
2615
- }
2616
- const Ma = at.fromPromise(_a);
2617
- function Ra(e, t, r = {}) {
2618
- const n = r.fs || ke, i = dn(t, r);
2619
- return n.writeFileSync(e, i, r);
2620
- }
2621
- const Ta = {
2622
- readFile: Ca,
2623
- readFileSync: Ba,
2624
- writeFile: Ma,
2625
- writeFileSync: Ra
2626
- };
2627
- var Ua = Ta;
2628
- const Ve = Ua;
2629
- var Wa = {
2630
- // jsonfile exports
2631
- readJson: Ve.readFile,
2632
- readJsonSync: Ve.readFileSync,
2633
- writeJson: Ve.writeFile,
2634
- writeJsonSync: Ve.writeFileSync
2635
- };
2636
- const La = q.fromCallback, Ie = Q, gn = X, Sn = ne, Ga = de.pathExists;
2637
- function Ja(e, t, r, n) {
2638
- typeof r == "function" && (n = r, r = "utf8");
2639
- const i = gn.dirname(e);
2640
- Ga(i, (o, a) => {
2641
- if (o)
2642
- return n(o);
2643
- if (a)
2644
- return Ie.writeFile(e, t, r, n);
2645
- Sn.mkdirs(i, (u) => {
2646
- if (u)
2647
- return n(u);
2648
- Ie.writeFile(e, t, r, n);
2649
- });
2650
- });
2651
- }
2652
- function Va(e, ...t) {
2653
- const r = gn.dirname(e);
2654
- if (Ie.existsSync(r))
2655
- return Ie.writeFileSync(e, ...t);
2656
- Sn.mkdirsSync(r), Ie.writeFileSync(e, ...t);
2657
- }
2658
- var Vt = {
2659
- outputFile: La(Ja),
2660
- outputFileSync: Va
2661
- };
2662
- const { stringify: za } = Jt, { outputFile: xa } = Vt;
2663
- async function qa(e, t, r = {}) {
2664
- const n = za(t, r);
2665
- await xa(e, n, r);
2666
- }
2667
- var Ha = qa;
2668
- const { stringify: Ya } = Jt, { outputFileSync: Qa } = Vt;
2669
- function Xa(e, t, r) {
2670
- const n = Ya(t, r);
2671
- Qa(e, n, r);
2672
- }
2673
- var Za = Xa;
2674
- const Ka = q.fromPromise, x = Wa;
2675
- x.outputJson = Ka(Ha);
2676
- x.outputJsonSync = Za;
2677
- x.outputJSON = x.outputJson;
2678
- x.outputJSONSync = x.outputJsonSync;
2679
- x.writeJSON = x.writeJson;
2680
- x.writeJSONSync = x.writeJsonSync;
2681
- x.readJSON = x.readJson;
2682
- x.readJSONSync = x.readJsonSync;
2683
- var ec = x;
2684
- const tc = Q, jt = X, rc = Gt.copy, vn = ot.remove, nc = ne.mkdirp, ic = de.pathExists, lr = Fe;
2685
- function oc(e, t, r, n) {
2686
- typeof r == "function" && (n = r, r = {}), r = r || {};
2687
- const i = r.overwrite || r.clobber || !1;
2688
- lr.checkPaths(e, t, "move", r, (o, a) => {
2689
- if (o)
2690
- return n(o);
2691
- const { srcStat: u, isChangingCase: y = !1 } = a;
2692
- lr.checkParentPaths(e, u, t, "move", (S) => {
2693
- if (S)
2694
- return n(S);
2695
- if (ac(t))
2696
- return yr(e, t, i, y, n);
2697
- nc(jt.dirname(t), (f) => f ? n(f) : yr(e, t, i, y, n));
2698
- });
2699
- });
2700
- }
2701
- function ac(e) {
2702
- const t = jt.dirname(e);
2703
- return jt.parse(t).root === t;
2704
- }
2705
- function yr(e, t, r, n, i) {
2706
- if (n)
2707
- return vt(e, t, r, i);
2708
- if (r)
2709
- return vn(t, (o) => o ? i(o) : vt(e, t, r, i));
2710
- ic(t, (o, a) => o ? i(o) : a ? i(new Error("dest already exists.")) : vt(e, t, r, i));
2711
- }
2712
- function vt(e, t, r, n) {
2713
- tc.rename(e, t, (i) => i ? i.code !== "EXDEV" ? n(i) : cc(e, t, r, n) : n());
2714
- }
2715
- function cc(e, t, r, n) {
2716
- rc(e, t, {
2717
- overwrite: r,
2718
- errorOnExist: !0,
2719
- preserveTimestamps: !0
2720
- }, (o) => o ? n(o) : vn(e, n));
2721
- }
2722
- var uc = oc;
2723
- const wn = Q, Dt = X, fc = Gt.copySync, bn = ot.removeSync, sc = ne.mkdirpSync, pr = Fe;
2724
- function lc(e, t, r) {
2725
- r = r || {};
2726
- const n = r.overwrite || r.clobber || !1, { srcStat: i, isChangingCase: o = !1 } = pr.checkPathsSync(e, t, "move", r);
2727
- return pr.checkParentPathsSync(e, i, t, "move"), yc(t) || sc(Dt.dirname(t)), pc(e, t, n, o);
2728
- }
2729
- function yc(e) {
2730
- const t = Dt.dirname(e);
2731
- return Dt.parse(t).root === t;
2732
- }
2733
- function pc(e, t, r, n) {
2734
- if (n)
2735
- return wt(e, t, r);
2736
- if (r)
2737
- return bn(t), wt(e, t, r);
2738
- if (wn.existsSync(t))
2739
- throw new Error("dest already exists.");
2740
- return wt(e, t, r);
2741
- }
2742
- function wt(e, t, r) {
2743
- try {
2744
- wn.renameSync(e, t);
2745
- } catch (n) {
2746
- if (n.code !== "EXDEV")
2747
- throw n;
2748
- return mc(e, t, r);
2749
- }
2750
- }
2751
- function mc(e, t, r) {
2752
- return fc(e, t, {
2753
- overwrite: r,
2754
- errorOnExist: !0,
2755
- preserveTimestamps: !0
2756
- }), bn(e);
2757
- }
2758
- var dc = lc;
2759
- const hc = q.fromCallback;
2760
- var gc = {
2761
- move: hc(uc),
2762
- moveSync: dc
2763
- }, Sc = {
2764
- // Export promiseified graceful-fs:
2765
- ...me,
2766
- // Export extra methods:
2767
- ...Gt,
2768
- ...ta,
2769
- ...ja,
2770
- ...ec,
2771
- ...ne,
2772
- ...gc,
2773
- ...Vt,
2774
- ...de,
2775
- ...ot
2776
- };
2777
- const ze = Sc;
2778
- function Ec(e, t = !1) {
2779
- return {
2780
- name: "vite-plugin-css-import",
2781
- apply: "build",
2782
- enforce: "post",
2783
- writeBundle: async (r, n) => {
2784
- const i = Object.keys(n).filter((f) => f.endsWith(".css"));
2785
- if (!i.length)
2786
- return;
2787
- const o = xt(process.cwd(), `${e}-temp.js`), a = xt(process.cwd(), `${e}.js`), u = i.reduce((f, m) => {
2788
- if (t) {
2789
- const d = kn(a), h = Fn(d, m);
2790
- return `${f}import "${h.replaceAll("\\", "/")}";
2791
- `;
2792
- }
2793
- return `${f}import "./${m}";
2794
- `;
2795
- }, ""), y = ze.createWriteStream(o);
2796
- y.write(u, "utf8");
2797
- const S = ze.createReadStream(a);
2798
- await jn(S, y), await ze.remove(a), await ze.rename(o, a), y.end();
2799
- }
2800
- };
2801
- }
2802
- export {
2803
- je as Texts,
2804
- dr as TranslationsKey,
2805
- Ec as viteCssImportPlugin
2806
- };
2807
- //# sourceMappingURL=index.js.map