.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-clangd / lib / index.js
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getProtoOf = Object.getPrototypeOf;
4 var __hasOwnProp = Object.prototype.hasOwnProperty;
5 var __getOwnPropNames = Object.getOwnPropertyNames;
6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7 var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
8 var __commonJS = (callback, module2) => () => {
9   if (!module2) {
10     module2 = {exports: {}};
11     callback(module2.exports, module2);
12   }
13   return module2.exports;
14 };
15 var __export = (target, all) => {
16   for (var name in all)
17     __defProp(target, name, {get: all[name], enumerable: true});
18 };
19 var __exportStar = (target, module2, desc) => {
20   if (module2 && typeof module2 === "object" || typeof module2 === "function") {
21     for (let key of __getOwnPropNames(module2))
22       if (!__hasOwnProp.call(target, key) && key !== "default")
23         __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
24   }
25   return target;
26 };
27 var __toModule = (module2) => {
28   if (module2 && module2.__esModule)
29     return module2;
30   return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", {value: module2, enumerable: true})), module2);
31 };
32
33 // node_modules/vscode-jsonrpc/lib/common/ral.js
34 var require_ral = __commonJS((exports2) => {
35   "use strict";
36   Object.defineProperty(exports2, "__esModule", {value: true});
37   var _ral;
38   function RAL() {
39     if (_ral === void 0) {
40       throw new Error(`No runtime abstraction layer installed`);
41     }
42     return _ral;
43   }
44   (function(RAL2) {
45     function install2(ral) {
46       if (ral === void 0) {
47         throw new Error(`No runtime abstraction layer provided`);
48       }
49       _ral = ral;
50     }
51     RAL2.install = install2;
52   })(RAL || (RAL = {}));
53   exports2.default = RAL;
54 });
55
56 // node_modules/vscode-jsonrpc/lib/common/disposable.js
57 var require_disposable = __commonJS((exports2) => {
58   "use strict";
59   Object.defineProperty(exports2, "__esModule", {value: true});
60   exports2.Disposable = void 0;
61   var Disposable3;
62   (function(Disposable4) {
63     function create(func) {
64       return {
65         dispose: func
66       };
67     }
68     Disposable4.create = create;
69   })(Disposable3 = exports2.Disposable || (exports2.Disposable = {}));
70 });
71
72 // node_modules/vscode-jsonrpc/lib/common/messageBuffer.js
73 var require_messageBuffer = __commonJS((exports2) => {
74   "use strict";
75   Object.defineProperty(exports2, "__esModule", {value: true});
76   exports2.AbstractMessageBuffer = void 0;
77   var CR = 13;
78   var LF = 10;
79   var CRLF = "\r\n";
80   var AbstractMessageBuffer = class {
81     constructor(encoding = "utf-8") {
82       this._encoding = encoding;
83       this._chunks = [];
84       this._totalLength = 0;
85     }
86     get encoding() {
87       return this._encoding;
88     }
89     append(chunk) {
90       const toAppend = typeof chunk === "string" ? this.fromString(chunk, this._encoding) : chunk;
91       this._chunks.push(toAppend);
92       this._totalLength += toAppend.byteLength;
93     }
94     tryReadHeaders() {
95       if (this._chunks.length === 0) {
96         return void 0;
97       }
98       let state = 0;
99       let chunkIndex = 0;
100       let offset = 0;
101       let chunkBytesRead = 0;
102       row:
103         while (chunkIndex < this._chunks.length) {
104           const chunk = this._chunks[chunkIndex];
105           offset = 0;
106           column:
107             while (offset < chunk.length) {
108               const value = chunk[offset];
109               switch (value) {
110                 case CR:
111                   switch (state) {
112                     case 0:
113                       state = 1;
114                       break;
115                     case 2:
116                       state = 3;
117                       break;
118                     default:
119                       state = 0;
120                   }
121                   break;
122                 case LF:
123                   switch (state) {
124                     case 1:
125                       state = 2;
126                       break;
127                     case 3:
128                       state = 4;
129                       offset++;
130                       break row;
131                     default:
132                       state = 0;
133                   }
134                   break;
135                 default:
136                   state = 0;
137               }
138               offset++;
139             }
140           chunkBytesRead += chunk.byteLength;
141           chunkIndex++;
142         }
143       if (state !== 4) {
144         return void 0;
145       }
146       const buffer = this._read(chunkBytesRead + offset);
147       const result = new Map();
148       const headers = this.toString(buffer, "ascii").split(CRLF);
149       if (headers.length < 2) {
150         return result;
151       }
152       for (let i = 0; i < headers.length - 2; i++) {
153         const header = headers[i];
154         const index = header.indexOf(":");
155         if (index === -1) {
156           throw new Error("Message header must separate key and value using :");
157         }
158         const key = header.substr(0, index);
159         const value = header.substr(index + 1).trim();
160         result.set(key, value);
161       }
162       return result;
163     }
164     tryReadBody(length) {
165       if (this._totalLength < length) {
166         return void 0;
167       }
168       return this._read(length);
169     }
170     get numberOfBytes() {
171       return this._totalLength;
172     }
173     _read(byteCount) {
174       if (byteCount === 0) {
175         return this.emptyBuffer();
176       }
177       if (byteCount > this._totalLength) {
178         throw new Error(`Cannot read so many bytes!`);
179       }
180       if (this._chunks[0].byteLength === byteCount) {
181         const chunk = this._chunks[0];
182         this._chunks.shift();
183         this._totalLength -= byteCount;
184         return this.asNative(chunk);
185       }
186       if (this._chunks[0].byteLength > byteCount) {
187         const chunk = this._chunks[0];
188         const result2 = this.asNative(chunk, byteCount);
189         this._chunks[0] = chunk.slice(byteCount);
190         this._totalLength -= byteCount;
191         return result2;
192       }
193       const result = this.allocNative(byteCount);
194       let resultOffset = 0;
195       let chunkIndex = 0;
196       while (byteCount > 0) {
197         const chunk = this._chunks[chunkIndex];
198         if (chunk.byteLength > byteCount) {
199           const chunkPart = chunk.slice(0, byteCount);
200           result.set(chunkPart, resultOffset);
201           resultOffset += byteCount;
202           this._chunks[chunkIndex] = chunk.slice(byteCount);
203           this._totalLength -= byteCount;
204           byteCount -= byteCount;
205         } else {
206           result.set(chunk, resultOffset);
207           resultOffset += chunk.byteLength;
208           this._chunks.shift();
209           this._totalLength -= chunk.byteLength;
210           byteCount -= chunk.byteLength;
211         }
212       }
213       return result;
214     }
215   };
216   exports2.AbstractMessageBuffer = AbstractMessageBuffer;
217 });
218
219 // node_modules/vscode-jsonrpc/lib/node/ril.js
220 var require_ril = __commonJS((exports2) => {
221   "use strict";
222   Object.defineProperty(exports2, "__esModule", {value: true});
223   var ral_1 = require_ral();
224   var util_1 = require("util");
225   var disposable_1 = require_disposable();
226   var messageBuffer_1 = require_messageBuffer();
227   var MessageBuffer = class extends messageBuffer_1.AbstractMessageBuffer {
228     constructor(encoding = "utf-8") {
229       super(encoding);
230     }
231     emptyBuffer() {
232       return MessageBuffer.emptyBuffer;
233     }
234     fromString(value, encoding) {
235       return Buffer.from(value, encoding);
236     }
237     toString(value, encoding) {
238       if (value instanceof Buffer) {
239         return value.toString(encoding);
240       } else {
241         return new util_1.TextDecoder(encoding).decode(value);
242       }
243     }
244     asNative(buffer, length) {
245       if (length === void 0) {
246         return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
247       } else {
248         return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);
249       }
250     }
251     allocNative(length) {
252       return Buffer.allocUnsafe(length);
253     }
254   };
255   MessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);
256   var ReadableStreamWrapper = class {
257     constructor(stream) {
258       this.stream = stream;
259     }
260     onClose(listener) {
261       this.stream.on("close", listener);
262       return disposable_1.Disposable.create(() => this.stream.off("close", listener));
263     }
264     onError(listener) {
265       this.stream.on("error", listener);
266       return disposable_1.Disposable.create(() => this.stream.off("error", listener));
267     }
268     onEnd(listener) {
269       this.stream.on("end", listener);
270       return disposable_1.Disposable.create(() => this.stream.off("end", listener));
271     }
272     onData(listener) {
273       this.stream.on("data", listener);
274       return disposable_1.Disposable.create(() => this.stream.off("data", listener));
275     }
276   };
277   var WritableStreamWrapper = class {
278     constructor(stream) {
279       this.stream = stream;
280     }
281     onClose(listener) {
282       this.stream.on("close", listener);
283       return disposable_1.Disposable.create(() => this.stream.off("close", listener));
284     }
285     onError(listener) {
286       this.stream.on("error", listener);
287       return disposable_1.Disposable.create(() => this.stream.off("error", listener));
288     }
289     onEnd(listener) {
290       this.stream.on("end", listener);
291       return disposable_1.Disposable.create(() => this.stream.off("end", listener));
292     }
293     write(data, encoding) {
294       return new Promise((resolve, reject) => {
295         const callback = (error) => {
296           if (error === void 0 || error === null) {
297             resolve();
298           } else {
299             reject(error);
300           }
301         };
302         if (typeof data === "string") {
303           this.stream.write(data, encoding, callback);
304         } else {
305           this.stream.write(data, callback);
306         }
307       });
308     }
309     end() {
310       this.stream.end();
311     }
312   };
313   var _ril = Object.freeze({
314     messageBuffer: Object.freeze({
315       create: (encoding) => new MessageBuffer(encoding)
316     }),
317     applicationJson: Object.freeze({
318       encoder: Object.freeze({
319         name: "application/json",
320         encode: (msg, options) => {
321           try {
322             return Promise.resolve(Buffer.from(JSON.stringify(msg, void 0, 0), options.charset));
323           } catch (err) {
324             return Promise.reject(err);
325           }
326         }
327       }),
328       decoder: Object.freeze({
329         name: "application/json",
330         decode: (buffer, options) => {
331           try {
332             if (buffer instanceof Buffer) {
333               return Promise.resolve(JSON.parse(buffer.toString(options.charset)));
334             } else {
335               return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));
336             }
337           } catch (err) {
338             return Promise.reject(err);
339           }
340         }
341       })
342     }),
343     stream: Object.freeze({
344       asReadableStream: (stream) => new ReadableStreamWrapper(stream),
345       asWritableStream: (stream) => new WritableStreamWrapper(stream)
346     }),
347     console,
348     timer: Object.freeze({
349       setTimeout(callback, ms, ...args) {
350         return setTimeout(callback, ms, ...args);
351       },
352       clearTimeout(handle) {
353         clearTimeout(handle);
354       },
355       setImmediate(callback, ...args) {
356         return setImmediate(callback, ...args);
357       },
358       clearImmediate(handle) {
359         clearImmediate(handle);
360       }
361     })
362   });
363   function RIL() {
364     return _ril;
365   }
366   (function(RIL2) {
367     function install2() {
368       ral_1.default.install(_ril);
369     }
370     RIL2.install = install2;
371   })(RIL || (RIL = {}));
372   exports2.default = RIL;
373 });
374
375 // node_modules/vscode-jsonrpc/lib/common/is.js
376 var require_is = __commonJS((exports2) => {
377   "use strict";
378   Object.defineProperty(exports2, "__esModule", {value: true});
379   exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
380   function boolean(value) {
381     return value === true || value === false;
382   }
383   exports2.boolean = boolean;
384   function string(value) {
385     return typeof value === "string" || value instanceof String;
386   }
387   exports2.string = string;
388   function number(value) {
389     return typeof value === "number" || value instanceof Number;
390   }
391   exports2.number = number;
392   function error(value) {
393     return value instanceof Error;
394   }
395   exports2.error = error;
396   function func(value) {
397     return typeof value === "function";
398   }
399   exports2.func = func;
400   function array(value) {
401     return Array.isArray(value);
402   }
403   exports2.array = array;
404   function stringArray(value) {
405     return array(value) && value.every((elem) => string(elem));
406   }
407   exports2.stringArray = stringArray;
408 });
409
410 // node_modules/vscode-jsonrpc/lib/common/messages.js
411 var require_messages = __commonJS((exports2) => {
412   "use strict";
413   Object.defineProperty(exports2, "__esModule", {value: true});
414   exports2.isResponseMessage = exports2.isNotificationMessage = exports2.isRequestMessage = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType = exports2.RequestType0 = exports2.AbstractMessageSignature = exports2.ParameterStructures = exports2.ResponseError = exports2.ErrorCodes = void 0;
415   var is = require_is();
416   var ErrorCodes;
417   (function(ErrorCodes2) {
418     ErrorCodes2.ParseError = -32700;
419     ErrorCodes2.InvalidRequest = -32600;
420     ErrorCodes2.MethodNotFound = -32601;
421     ErrorCodes2.InvalidParams = -32602;
422     ErrorCodes2.InternalError = -32603;
423     ErrorCodes2.jsonrpcReservedErrorRangeStart = -32099;
424     ErrorCodes2.serverErrorStart = ErrorCodes2.jsonrpcReservedErrorRangeStart;
425     ErrorCodes2.MessageWriteError = -32099;
426     ErrorCodes2.MessageReadError = -32098;
427     ErrorCodes2.ServerNotInitialized = -32002;
428     ErrorCodes2.UnknownErrorCode = -32001;
429     ErrorCodes2.jsonrpcReservedErrorRangeEnd = -32e3;
430     ErrorCodes2.serverErrorEnd = ErrorCodes2.jsonrpcReservedErrorRangeEnd;
431   })(ErrorCodes = exports2.ErrorCodes || (exports2.ErrorCodes = {}));
432   var ResponseError = class extends Error {
433     constructor(code, message, data) {
434       super(message);
435       this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
436       this.data = data;
437       Object.setPrototypeOf(this, ResponseError.prototype);
438     }
439     toJson() {
440       return {
441         code: this.code,
442         message: this.message,
443         data: this.data
444       };
445     }
446   };
447   exports2.ResponseError = ResponseError;
448   var ParameterStructures = class {
449     constructor(kind) {
450       this.kind = kind;
451     }
452     static is(value) {
453       return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;
454     }
455     toString() {
456       return this.kind;
457     }
458   };
459   exports2.ParameterStructures = ParameterStructures;
460   ParameterStructures.auto = new ParameterStructures("auto");
461   ParameterStructures.byPosition = new ParameterStructures("byPosition");
462   ParameterStructures.byName = new ParameterStructures("byName");
463   var AbstractMessageSignature = class {
464     constructor(method, numberOfParams) {
465       this.method = method;
466       this.numberOfParams = numberOfParams;
467     }
468     get parameterStructures() {
469       return ParameterStructures.auto;
470     }
471   };
472   exports2.AbstractMessageSignature = AbstractMessageSignature;
473   var RequestType0 = class extends AbstractMessageSignature {
474     constructor(method) {
475       super(method, 0);
476     }
477   };
478   exports2.RequestType0 = RequestType0;
479   var RequestType2 = class extends AbstractMessageSignature {
480     constructor(method, _parameterStructures = ParameterStructures.auto) {
481       super(method, 1);
482       this._parameterStructures = _parameterStructures;
483     }
484     get parameterStructures() {
485       return this._parameterStructures;
486     }
487   };
488   exports2.RequestType = RequestType2;
489   var RequestType1 = class extends AbstractMessageSignature {
490     constructor(method, _parameterStructures = ParameterStructures.auto) {
491       super(method, 1);
492       this._parameterStructures = _parameterStructures;
493     }
494     get parameterStructures() {
495       return this._parameterStructures;
496     }
497   };
498   exports2.RequestType1 = RequestType1;
499   var RequestType22 = class extends AbstractMessageSignature {
500     constructor(method) {
501       super(method, 2);
502     }
503   };
504   exports2.RequestType2 = RequestType22;
505   var RequestType3 = class extends AbstractMessageSignature {
506     constructor(method) {
507       super(method, 3);
508     }
509   };
510   exports2.RequestType3 = RequestType3;
511   var RequestType4 = class extends AbstractMessageSignature {
512     constructor(method) {
513       super(method, 4);
514     }
515   };
516   exports2.RequestType4 = RequestType4;
517   var RequestType5 = class extends AbstractMessageSignature {
518     constructor(method) {
519       super(method, 5);
520     }
521   };
522   exports2.RequestType5 = RequestType5;
523   var RequestType6 = class extends AbstractMessageSignature {
524     constructor(method) {
525       super(method, 6);
526     }
527   };
528   exports2.RequestType6 = RequestType6;
529   var RequestType7 = class extends AbstractMessageSignature {
530     constructor(method) {
531       super(method, 7);
532     }
533   };
534   exports2.RequestType7 = RequestType7;
535   var RequestType8 = class extends AbstractMessageSignature {
536     constructor(method) {
537       super(method, 8);
538     }
539   };
540   exports2.RequestType8 = RequestType8;
541   var RequestType9 = class extends AbstractMessageSignature {
542     constructor(method) {
543       super(method, 9);
544     }
545   };
546   exports2.RequestType9 = RequestType9;
547   var NotificationType2 = class extends AbstractMessageSignature {
548     constructor(method, _parameterStructures = ParameterStructures.auto) {
549       super(method, 1);
550       this._parameterStructures = _parameterStructures;
551     }
552     get parameterStructures() {
553       return this._parameterStructures;
554     }
555   };
556   exports2.NotificationType = NotificationType2;
557   var NotificationType0 = class extends AbstractMessageSignature {
558     constructor(method) {
559       super(method, 0);
560     }
561   };
562   exports2.NotificationType0 = NotificationType0;
563   var NotificationType1 = class extends AbstractMessageSignature {
564     constructor(method, _parameterStructures = ParameterStructures.auto) {
565       super(method, 1);
566       this._parameterStructures = _parameterStructures;
567     }
568     get parameterStructures() {
569       return this._parameterStructures;
570     }
571   };
572   exports2.NotificationType1 = NotificationType1;
573   var NotificationType22 = class extends AbstractMessageSignature {
574     constructor(method) {
575       super(method, 2);
576     }
577   };
578   exports2.NotificationType2 = NotificationType22;
579   var NotificationType3 = class extends AbstractMessageSignature {
580     constructor(method) {
581       super(method, 3);
582     }
583   };
584   exports2.NotificationType3 = NotificationType3;
585   var NotificationType4 = class extends AbstractMessageSignature {
586     constructor(method) {
587       super(method, 4);
588     }
589   };
590   exports2.NotificationType4 = NotificationType4;
591   var NotificationType5 = class extends AbstractMessageSignature {
592     constructor(method) {
593       super(method, 5);
594     }
595   };
596   exports2.NotificationType5 = NotificationType5;
597   var NotificationType6 = class extends AbstractMessageSignature {
598     constructor(method) {
599       super(method, 6);
600     }
601   };
602   exports2.NotificationType6 = NotificationType6;
603   var NotificationType7 = class extends AbstractMessageSignature {
604     constructor(method) {
605       super(method, 7);
606     }
607   };
608   exports2.NotificationType7 = NotificationType7;
609   var NotificationType8 = class extends AbstractMessageSignature {
610     constructor(method) {
611       super(method, 8);
612     }
613   };
614   exports2.NotificationType8 = NotificationType8;
615   var NotificationType9 = class extends AbstractMessageSignature {
616     constructor(method) {
617       super(method, 9);
618     }
619   };
620   exports2.NotificationType9 = NotificationType9;
621   function isRequestMessage(message) {
622     const candidate = message;
623     return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
624   }
625   exports2.isRequestMessage = isRequestMessage;
626   function isNotificationMessage(message) {
627     const candidate = message;
628     return candidate && is.string(candidate.method) && message.id === void 0;
629   }
630   exports2.isNotificationMessage = isNotificationMessage;
631   function isResponseMessage(message) {
632     const candidate = message;
633     return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
634   }
635   exports2.isResponseMessage = isResponseMessage;
636 });
637
638 // node_modules/vscode-jsonrpc/lib/common/events.js
639 var require_events = __commonJS((exports2) => {
640   "use strict";
641   Object.defineProperty(exports2, "__esModule", {value: true});
642   exports2.Emitter = exports2.Event = void 0;
643   var ral_1 = require_ral();
644   var Event3;
645   (function(Event4) {
646     const _disposable = {dispose() {
647     }};
648     Event4.None = function() {
649       return _disposable;
650     };
651   })(Event3 = exports2.Event || (exports2.Event = {}));
652   var CallbackList = class {
653     add(callback, context = null, bucket) {
654       if (!this._callbacks) {
655         this._callbacks = [];
656         this._contexts = [];
657       }
658       this._callbacks.push(callback);
659       this._contexts.push(context);
660       if (Array.isArray(bucket)) {
661         bucket.push({dispose: () => this.remove(callback, context)});
662       }
663     }
664     remove(callback, context = null) {
665       if (!this._callbacks) {
666         return;
667       }
668       let foundCallbackWithDifferentContext = false;
669       for (let i = 0, len = this._callbacks.length; i < len; i++) {
670         if (this._callbacks[i] === callback) {
671           if (this._contexts[i] === context) {
672             this._callbacks.splice(i, 1);
673             this._contexts.splice(i, 1);
674             return;
675           } else {
676             foundCallbackWithDifferentContext = true;
677           }
678         }
679       }
680       if (foundCallbackWithDifferentContext) {
681         throw new Error("When adding a listener with a context, you should remove it with the same context");
682       }
683     }
684     invoke(...args) {
685       if (!this._callbacks) {
686         return [];
687       }
688       const ret2 = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
689       for (let i = 0, len = callbacks.length; i < len; i++) {
690         try {
691           ret2.push(callbacks[i].apply(contexts[i], args));
692         } catch (e) {
693           ral_1.default().console.error(e);
694         }
695       }
696       return ret2;
697     }
698     isEmpty() {
699       return !this._callbacks || this._callbacks.length === 0;
700     }
701     dispose() {
702       this._callbacks = void 0;
703       this._contexts = void 0;
704     }
705   };
706   var Emitter = class {
707     constructor(_options) {
708       this._options = _options;
709     }
710     get event() {
711       if (!this._event) {
712         this._event = (listener, thisArgs, disposables) => {
713           if (!this._callbacks) {
714             this._callbacks = new CallbackList();
715           }
716           if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
717             this._options.onFirstListenerAdd(this);
718           }
719           this._callbacks.add(listener, thisArgs);
720           const result = {
721             dispose: () => {
722               if (!this._callbacks) {
723                 return;
724               }
725               this._callbacks.remove(listener, thisArgs);
726               result.dispose = Emitter._noop;
727               if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
728                 this._options.onLastListenerRemove(this);
729               }
730             }
731           };
732           if (Array.isArray(disposables)) {
733             disposables.push(result);
734           }
735           return result;
736         };
737       }
738       return this._event;
739     }
740     fire(event) {
741       if (this._callbacks) {
742         this._callbacks.invoke.call(this._callbacks, event);
743       }
744     }
745     dispose() {
746       if (this._callbacks) {
747         this._callbacks.dispose();
748         this._callbacks = void 0;
749       }
750     }
751   };
752   exports2.Emitter = Emitter;
753   Emitter._noop = function() {
754   };
755 });
756
757 // node_modules/vscode-jsonrpc/lib/common/cancellation.js
758 var require_cancellation = __commonJS((exports2) => {
759   "use strict";
760   Object.defineProperty(exports2, "__esModule", {value: true});
761   exports2.CancellationTokenSource = exports2.CancellationToken = void 0;
762   var ral_1 = require_ral();
763   var Is = require_is();
764   var events_1 = require_events();
765   var CancellationToken;
766   (function(CancellationToken2) {
767     CancellationToken2.None = Object.freeze({
768       isCancellationRequested: false,
769       onCancellationRequested: events_1.Event.None
770     });
771     CancellationToken2.Cancelled = Object.freeze({
772       isCancellationRequested: true,
773       onCancellationRequested: events_1.Event.None
774     });
775     function is(value) {
776       const candidate = value;
777       return candidate && (candidate === CancellationToken2.None || candidate === CancellationToken2.Cancelled || Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested);
778     }
779     CancellationToken2.is = is;
780   })(CancellationToken = exports2.CancellationToken || (exports2.CancellationToken = {}));
781   var shortcutEvent = Object.freeze(function(callback, context) {
782     const handle = ral_1.default().timer.setTimeout(callback.bind(context), 0);
783     return {dispose() {
784       ral_1.default().timer.clearTimeout(handle);
785     }};
786   });
787   var MutableToken = class {
788     constructor() {
789       this._isCancelled = false;
790     }
791     cancel() {
792       if (!this._isCancelled) {
793         this._isCancelled = true;
794         if (this._emitter) {
795           this._emitter.fire(void 0);
796           this.dispose();
797         }
798       }
799     }
800     get isCancellationRequested() {
801       return this._isCancelled;
802     }
803     get onCancellationRequested() {
804       if (this._isCancelled) {
805         return shortcutEvent;
806       }
807       if (!this._emitter) {
808         this._emitter = new events_1.Emitter();
809       }
810       return this._emitter.event;
811     }
812     dispose() {
813       if (this._emitter) {
814         this._emitter.dispose();
815         this._emitter = void 0;
816       }
817     }
818   };
819   var CancellationTokenSource = class {
820     get token() {
821       if (!this._token) {
822         this._token = new MutableToken();
823       }
824       return this._token;
825     }
826     cancel() {
827       if (!this._token) {
828         this._token = CancellationToken.Cancelled;
829       } else {
830         this._token.cancel();
831       }
832     }
833     dispose() {
834       if (!this._token) {
835         this._token = CancellationToken.None;
836       } else if (this._token instanceof MutableToken) {
837         this._token.dispose();
838       }
839     }
840   };
841   exports2.CancellationTokenSource = CancellationTokenSource;
842 });
843
844 // node_modules/vscode-jsonrpc/lib/common/messageReader.js
845 var require_messageReader = __commonJS((exports2) => {
846   "use strict";
847   Object.defineProperty(exports2, "__esModule", {value: true});
848   exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = void 0;
849   var ral_1 = require_ral();
850   var Is = require_is();
851   var events_1 = require_events();
852   var MessageReader;
853   (function(MessageReader2) {
854     function is(value) {
855       let candidate = value;
856       return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
857     }
858     MessageReader2.is = is;
859   })(MessageReader = exports2.MessageReader || (exports2.MessageReader = {}));
860   var AbstractMessageReader = class {
861     constructor() {
862       this.errorEmitter = new events_1.Emitter();
863       this.closeEmitter = new events_1.Emitter();
864       this.partialMessageEmitter = new events_1.Emitter();
865     }
866     dispose() {
867       this.errorEmitter.dispose();
868       this.closeEmitter.dispose();
869     }
870     get onError() {
871       return this.errorEmitter.event;
872     }
873     fireError(error) {
874       this.errorEmitter.fire(this.asError(error));
875     }
876     get onClose() {
877       return this.closeEmitter.event;
878     }
879     fireClose() {
880       this.closeEmitter.fire(void 0);
881     }
882     get onPartialMessage() {
883       return this.partialMessageEmitter.event;
884     }
885     firePartialMessage(info) {
886       this.partialMessageEmitter.fire(info);
887     }
888     asError(error) {
889       if (error instanceof Error) {
890         return error;
891       } else {
892         return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`);
893       }
894     }
895   };
896   exports2.AbstractMessageReader = AbstractMessageReader;
897   var ResolvedMessageReaderOptions;
898   (function(ResolvedMessageReaderOptions2) {
899     function fromOptions(options) {
900       var _a;
901       let charset;
902       let result;
903       let contentDecoder;
904       const contentDecoders = new Map();
905       let contentTypeDecoder;
906       const contentTypeDecoders = new Map();
907       if (options === void 0 || typeof options === "string") {
908         charset = options !== null && options !== void 0 ? options : "utf-8";
909       } else {
910         charset = (_a = options.charset) !== null && _a !== void 0 ? _a : "utf-8";
911         if (options.contentDecoder !== void 0) {
912           contentDecoder = options.contentDecoder;
913           contentDecoders.set(contentDecoder.name, contentDecoder);
914         }
915         if (options.contentDecoders !== void 0) {
916           for (const decoder of options.contentDecoders) {
917             contentDecoders.set(decoder.name, decoder);
918           }
919         }
920         if (options.contentTypeDecoder !== void 0) {
921           contentTypeDecoder = options.contentTypeDecoder;
922           contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
923         }
924         if (options.contentTypeDecoders !== void 0) {
925           for (const decoder of options.contentTypeDecoders) {
926             contentTypeDecoders.set(decoder.name, decoder);
927           }
928         }
929       }
930       if (contentTypeDecoder === void 0) {
931         contentTypeDecoder = ral_1.default().applicationJson.decoder;
932         contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
933       }
934       return {charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders};
935     }
936     ResolvedMessageReaderOptions2.fromOptions = fromOptions;
937   })(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));
938   var ReadableStreamMessageReader = class extends AbstractMessageReader {
939     constructor(readable, options) {
940       super();
941       this.readable = readable;
942       this.options = ResolvedMessageReaderOptions.fromOptions(options);
943       this.buffer = ral_1.default().messageBuffer.create(this.options.charset);
944       this._partialMessageTimeout = 1e4;
945       this.nextMessageLength = -1;
946       this.messageToken = 0;
947     }
948     set partialMessageTimeout(timeout) {
949       this._partialMessageTimeout = timeout;
950     }
951     get partialMessageTimeout() {
952       return this._partialMessageTimeout;
953     }
954     listen(callback) {
955       this.nextMessageLength = -1;
956       this.messageToken = 0;
957       this.partialMessageTimer = void 0;
958       this.callback = callback;
959       const result = this.readable.onData((data) => {
960         this.onData(data);
961       });
962       this.readable.onError((error) => this.fireError(error));
963       this.readable.onClose(() => this.fireClose());
964       return result;
965     }
966     onData(data) {
967       this.buffer.append(data);
968       while (true) {
969         if (this.nextMessageLength === -1) {
970           const headers = this.buffer.tryReadHeaders();
971           if (!headers) {
972             return;
973           }
974           const contentLength = headers.get("Content-Length");
975           if (!contentLength) {
976             throw new Error("Header must provide a Content-Length property.");
977           }
978           const length = parseInt(contentLength);
979           if (isNaN(length)) {
980             throw new Error("Content-Length value must be a number.");
981           }
982           this.nextMessageLength = length;
983         }
984         const body = this.buffer.tryReadBody(this.nextMessageLength);
985         if (body === void 0) {
986           this.setPartialMessageTimer();
987           return;
988         }
989         this.clearPartialMessageTimer();
990         this.nextMessageLength = -1;
991         let p;
992         if (this.options.contentDecoder !== void 0) {
993           p = this.options.contentDecoder.decode(body);
994         } else {
995           p = Promise.resolve(body);
996         }
997         p.then((value) => {
998           this.options.contentTypeDecoder.decode(value, this.options).then((msg) => {
999             this.callback(msg);
1000           }, (error) => {
1001             this.fireError(error);
1002           });
1003         }, (error) => {
1004           this.fireError(error);
1005         });
1006       }
1007     }
1008     clearPartialMessageTimer() {
1009       if (this.partialMessageTimer) {
1010         ral_1.default().timer.clearTimeout(this.partialMessageTimer);
1011         this.partialMessageTimer = void 0;
1012       }
1013     }
1014     setPartialMessageTimer() {
1015       this.clearPartialMessageTimer();
1016       if (this._partialMessageTimeout <= 0) {
1017         return;
1018       }
1019       this.partialMessageTimer = ral_1.default().timer.setTimeout((token, timeout) => {
1020         this.partialMessageTimer = void 0;
1021         if (token === this.messageToken) {
1022           this.firePartialMessage({messageToken: token, waitingTime: timeout});
1023           this.setPartialMessageTimer();
1024         }
1025       }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
1026     }
1027   };
1028   exports2.ReadableStreamMessageReader = ReadableStreamMessageReader;
1029 });
1030
1031 // node_modules/vscode-jsonrpc/lib/common/semaphore.js
1032 var require_semaphore = __commonJS((exports2) => {
1033   "use strict";
1034   Object.defineProperty(exports2, "__esModule", {value: true});
1035   exports2.Semaphore = void 0;
1036   var ral_1 = require_ral();
1037   var Semaphore = class {
1038     constructor(capacity = 1) {
1039       if (capacity <= 0) {
1040         throw new Error("Capacity must be greater than 0");
1041       }
1042       this._capacity = capacity;
1043       this._active = 0;
1044       this._waiting = [];
1045     }
1046     lock(thunk) {
1047       return new Promise((resolve, reject) => {
1048         this._waiting.push({thunk, resolve, reject});
1049         this.runNext();
1050       });
1051     }
1052     get active() {
1053       return this._active;
1054     }
1055     runNext() {
1056       if (this._waiting.length === 0 || this._active === this._capacity) {
1057         return;
1058       }
1059       ral_1.default().timer.setImmediate(() => this.doRunNext());
1060     }
1061     doRunNext() {
1062       if (this._waiting.length === 0 || this._active === this._capacity) {
1063         return;
1064       }
1065       const next = this._waiting.shift();
1066       this._active++;
1067       if (this._active > this._capacity) {
1068         throw new Error(`To many thunks active`);
1069       }
1070       try {
1071         const result = next.thunk();
1072         if (result instanceof Promise) {
1073           result.then((value) => {
1074             this._active--;
1075             next.resolve(value);
1076             this.runNext();
1077           }, (err) => {
1078             this._active--;
1079             next.reject(err);
1080             this.runNext();
1081           });
1082         } else {
1083           this._active--;
1084           next.resolve(result);
1085           this.runNext();
1086         }
1087       } catch (err) {
1088         this._active--;
1089         next.reject(err);
1090         this.runNext();
1091       }
1092     }
1093   };
1094   exports2.Semaphore = Semaphore;
1095 });
1096
1097 // node_modules/vscode-jsonrpc/lib/common/messageWriter.js
1098 var require_messageWriter = __commonJS((exports2) => {
1099   "use strict";
1100   Object.defineProperty(exports2, "__esModule", {value: true});
1101   exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = void 0;
1102   var ral_1 = require_ral();
1103   var Is = require_is();
1104   var semaphore_1 = require_semaphore();
1105   var events_1 = require_events();
1106   var ContentLength = "Content-Length: ";
1107   var CRLF = "\r\n";
1108   var MessageWriter;
1109   (function(MessageWriter2) {
1110     function is(value) {
1111       let candidate = value;
1112       return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && Is.func(candidate.onError) && Is.func(candidate.write);
1113     }
1114     MessageWriter2.is = is;
1115   })(MessageWriter = exports2.MessageWriter || (exports2.MessageWriter = {}));
1116   var AbstractMessageWriter = class {
1117     constructor() {
1118       this.errorEmitter = new events_1.Emitter();
1119       this.closeEmitter = new events_1.Emitter();
1120     }
1121     dispose() {
1122       this.errorEmitter.dispose();
1123       this.closeEmitter.dispose();
1124     }
1125     get onError() {
1126       return this.errorEmitter.event;
1127     }
1128     fireError(error, message, count) {
1129       this.errorEmitter.fire([this.asError(error), message, count]);
1130     }
1131     get onClose() {
1132       return this.closeEmitter.event;
1133     }
1134     fireClose() {
1135       this.closeEmitter.fire(void 0);
1136     }
1137     asError(error) {
1138       if (error instanceof Error) {
1139         return error;
1140       } else {
1141         return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`);
1142       }
1143     }
1144   };
1145   exports2.AbstractMessageWriter = AbstractMessageWriter;
1146   var ResolvedMessageWriterOptions;
1147   (function(ResolvedMessageWriterOptions2) {
1148     function fromOptions(options) {
1149       var _a, _b;
1150       if (options === void 0 || typeof options === "string") {
1151         return {charset: options !== null && options !== void 0 ? options : "utf-8", contentTypeEncoder: ral_1.default().applicationJson.encoder};
1152       } else {
1153         return {charset: (_a = options.charset) !== null && _a !== void 0 ? _a : "utf-8", contentEncoder: options.contentEncoder, contentTypeEncoder: (_b = options.contentTypeEncoder) !== null && _b !== void 0 ? _b : ral_1.default().applicationJson.encoder};
1154       }
1155     }
1156     ResolvedMessageWriterOptions2.fromOptions = fromOptions;
1157   })(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));
1158   var WriteableStreamMessageWriter = class extends AbstractMessageWriter {
1159     constructor(writable, options) {
1160       super();
1161       this.writable = writable;
1162       this.options = ResolvedMessageWriterOptions.fromOptions(options);
1163       this.errorCount = 0;
1164       this.writeSemaphore = new semaphore_1.Semaphore(1);
1165       this.writable.onError((error) => this.fireError(error));
1166       this.writable.onClose(() => this.fireClose());
1167     }
1168     async write(msg) {
1169       return this.writeSemaphore.lock(async () => {
1170         const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {
1171           if (this.options.contentEncoder !== void 0) {
1172             return this.options.contentEncoder.encode(buffer);
1173           } else {
1174             return buffer;
1175           }
1176         });
1177         return payload.then((buffer) => {
1178           const headers = [];
1179           headers.push(ContentLength, buffer.byteLength.toString(), CRLF);
1180           headers.push(CRLF);
1181           return this.doWrite(msg, headers, buffer);
1182         }, (error) => {
1183           this.fireError(error);
1184           throw error;
1185         });
1186       });
1187     }
1188     async doWrite(msg, headers, data) {
1189       try {
1190         await this.writable.write(headers.join(""), "ascii");
1191         return this.writable.write(data);
1192       } catch (error) {
1193         this.handleError(error, msg);
1194         return Promise.reject(error);
1195       }
1196     }
1197     handleError(error, msg) {
1198       this.errorCount++;
1199       this.fireError(error, msg, this.errorCount);
1200     }
1201     end() {
1202       this.writable.end();
1203     }
1204   };
1205   exports2.WriteableStreamMessageWriter = WriteableStreamMessageWriter;
1206 });
1207
1208 // node_modules/vscode-jsonrpc/lib/common/linkedMap.js
1209 var require_linkedMap = __commonJS((exports2) => {
1210   "use strict";
1211   Object.defineProperty(exports2, "__esModule", {value: true});
1212   exports2.LRUCache = exports2.LinkedMap = exports2.Touch = void 0;
1213   var Touch;
1214   (function(Touch2) {
1215     Touch2.None = 0;
1216     Touch2.First = 1;
1217     Touch2.AsOld = Touch2.First;
1218     Touch2.Last = 2;
1219     Touch2.AsNew = Touch2.Last;
1220   })(Touch = exports2.Touch || (exports2.Touch = {}));
1221   var LinkedMap = class {
1222     constructor() {
1223       this[Symbol.toStringTag] = "LinkedMap";
1224       this._map = new Map();
1225       this._head = void 0;
1226       this._tail = void 0;
1227       this._size = 0;
1228       this._state = 0;
1229     }
1230     clear() {
1231       this._map.clear();
1232       this._head = void 0;
1233       this._tail = void 0;
1234       this._size = 0;
1235       this._state++;
1236     }
1237     isEmpty() {
1238       return !this._head && !this._tail;
1239     }
1240     get size() {
1241       return this._size;
1242     }
1243     get first() {
1244       var _a;
1245       return (_a = this._head) === null || _a === void 0 ? void 0 : _a.value;
1246     }
1247     get last() {
1248       var _a;
1249       return (_a = this._tail) === null || _a === void 0 ? void 0 : _a.value;
1250     }
1251     has(key) {
1252       return this._map.has(key);
1253     }
1254     get(key, touch = Touch.None) {
1255       const item = this._map.get(key);
1256       if (!item) {
1257         return void 0;
1258       }
1259       if (touch !== Touch.None) {
1260         this.touch(item, touch);
1261       }
1262       return item.value;
1263     }
1264     set(key, value, touch = Touch.None) {
1265       let item = this._map.get(key);
1266       if (item) {
1267         item.value = value;
1268         if (touch !== Touch.None) {
1269           this.touch(item, touch);
1270         }
1271       } else {
1272         item = {key, value, next: void 0, previous: void 0};
1273         switch (touch) {
1274           case Touch.None:
1275             this.addItemLast(item);
1276             break;
1277           case Touch.First:
1278             this.addItemFirst(item);
1279             break;
1280           case Touch.Last:
1281             this.addItemLast(item);
1282             break;
1283           default:
1284             this.addItemLast(item);
1285             break;
1286         }
1287         this._map.set(key, item);
1288         this._size++;
1289       }
1290       return this;
1291     }
1292     delete(key) {
1293       return !!this.remove(key);
1294     }
1295     remove(key) {
1296       const item = this._map.get(key);
1297       if (!item) {
1298         return void 0;
1299       }
1300       this._map.delete(key);
1301       this.removeItem(item);
1302       this._size--;
1303       return item.value;
1304     }
1305     shift() {
1306       if (!this._head && !this._tail) {
1307         return void 0;
1308       }
1309       if (!this._head || !this._tail) {
1310         throw new Error("Invalid list");
1311       }
1312       const item = this._head;
1313       this._map.delete(item.key);
1314       this.removeItem(item);
1315       this._size--;
1316       return item.value;
1317     }
1318     forEach(callbackfn, thisArg) {
1319       const state = this._state;
1320       let current = this._head;
1321       while (current) {
1322         if (thisArg) {
1323           callbackfn.bind(thisArg)(current.value, current.key, this);
1324         } else {
1325           callbackfn(current.value, current.key, this);
1326         }
1327         if (this._state !== state) {
1328           throw new Error(`LinkedMap got modified during iteration.`);
1329         }
1330         current = current.next;
1331       }
1332     }
1333     keys() {
1334       const map = this;
1335       const state = this._state;
1336       let current = this._head;
1337       const iterator = {
1338         [Symbol.iterator]() {
1339           return iterator;
1340         },
1341         next() {
1342           if (map._state !== state) {
1343             throw new Error(`LinkedMap got modified during iteration.`);
1344           }
1345           if (current) {
1346             const result = {value: current.key, done: false};
1347             current = current.next;
1348             return result;
1349           } else {
1350             return {value: void 0, done: true};
1351           }
1352         }
1353       };
1354       return iterator;
1355     }
1356     values() {
1357       const map = this;
1358       const state = this._state;
1359       let current = this._head;
1360       const iterator = {
1361         [Symbol.iterator]() {
1362           return iterator;
1363         },
1364         next() {
1365           if (map._state !== state) {
1366             throw new Error(`LinkedMap got modified during iteration.`);
1367           }
1368           if (current) {
1369             const result = {value: current.value, done: false};
1370             current = current.next;
1371             return result;
1372           } else {
1373             return {value: void 0, done: true};
1374           }
1375         }
1376       };
1377       return iterator;
1378     }
1379     entries() {
1380       const map = this;
1381       const state = this._state;
1382       let current = this._head;
1383       const iterator = {
1384         [Symbol.iterator]() {
1385           return iterator;
1386         },
1387         next() {
1388           if (map._state !== state) {
1389             throw new Error(`LinkedMap got modified during iteration.`);
1390           }
1391           if (current) {
1392             const result = {value: [current.key, current.value], done: false};
1393             current = current.next;
1394             return result;
1395           } else {
1396             return {value: void 0, done: true};
1397           }
1398         }
1399       };
1400       return iterator;
1401     }
1402     [Symbol.iterator]() {
1403       return this.entries();
1404     }
1405     trimOld(newSize) {
1406       if (newSize >= this.size) {
1407         return;
1408       }
1409       if (newSize === 0) {
1410         this.clear();
1411         return;
1412       }
1413       let current = this._head;
1414       let currentSize = this.size;
1415       while (current && currentSize > newSize) {
1416         this._map.delete(current.key);
1417         current = current.next;
1418         currentSize--;
1419       }
1420       this._head = current;
1421       this._size = currentSize;
1422       if (current) {
1423         current.previous = void 0;
1424       }
1425       this._state++;
1426     }
1427     addItemFirst(item) {
1428       if (!this._head && !this._tail) {
1429         this._tail = item;
1430       } else if (!this._head) {
1431         throw new Error("Invalid list");
1432       } else {
1433         item.next = this._head;
1434         this._head.previous = item;
1435       }
1436       this._head = item;
1437       this._state++;
1438     }
1439     addItemLast(item) {
1440       if (!this._head && !this._tail) {
1441         this._head = item;
1442       } else if (!this._tail) {
1443         throw new Error("Invalid list");
1444       } else {
1445         item.previous = this._tail;
1446         this._tail.next = item;
1447       }
1448       this._tail = item;
1449       this._state++;
1450     }
1451     removeItem(item) {
1452       if (item === this._head && item === this._tail) {
1453         this._head = void 0;
1454         this._tail = void 0;
1455       } else if (item === this._head) {
1456         if (!item.next) {
1457           throw new Error("Invalid list");
1458         }
1459         item.next.previous = void 0;
1460         this._head = item.next;
1461       } else if (item === this._tail) {
1462         if (!item.previous) {
1463           throw new Error("Invalid list");
1464         }
1465         item.previous.next = void 0;
1466         this._tail = item.previous;
1467       } else {
1468         const next = item.next;
1469         const previous = item.previous;
1470         if (!next || !previous) {
1471           throw new Error("Invalid list");
1472         }
1473         next.previous = previous;
1474         previous.next = next;
1475       }
1476       item.next = void 0;
1477       item.previous = void 0;
1478       this._state++;
1479     }
1480     touch(item, touch) {
1481       if (!this._head || !this._tail) {
1482         throw new Error("Invalid list");
1483       }
1484       if (touch !== Touch.First && touch !== Touch.Last) {
1485         return;
1486       }
1487       if (touch === Touch.First) {
1488         if (item === this._head) {
1489           return;
1490         }
1491         const next = item.next;
1492         const previous = item.previous;
1493         if (item === this._tail) {
1494           previous.next = void 0;
1495           this._tail = previous;
1496         } else {
1497           next.previous = previous;
1498           previous.next = next;
1499         }
1500         item.previous = void 0;
1501         item.next = this._head;
1502         this._head.previous = item;
1503         this._head = item;
1504         this._state++;
1505       } else if (touch === Touch.Last) {
1506         if (item === this._tail) {
1507           return;
1508         }
1509         const next = item.next;
1510         const previous = item.previous;
1511         if (item === this._head) {
1512           next.previous = void 0;
1513           this._head = next;
1514         } else {
1515           next.previous = previous;
1516           previous.next = next;
1517         }
1518         item.next = void 0;
1519         item.previous = this._tail;
1520         this._tail.next = item;
1521         this._tail = item;
1522         this._state++;
1523       }
1524     }
1525     toJSON() {
1526       const data = [];
1527       this.forEach((value, key) => {
1528         data.push([key, value]);
1529       });
1530       return data;
1531     }
1532     fromJSON(data) {
1533       this.clear();
1534       for (const [key, value] of data) {
1535         this.set(key, value);
1536       }
1537     }
1538   };
1539   exports2.LinkedMap = LinkedMap;
1540   var LRUCache = class extends LinkedMap {
1541     constructor(limit, ratio = 1) {
1542       super();
1543       this._limit = limit;
1544       this._ratio = Math.min(Math.max(0, ratio), 1);
1545     }
1546     get limit() {
1547       return this._limit;
1548     }
1549     set limit(limit) {
1550       this._limit = limit;
1551       this.checkTrim();
1552     }
1553     get ratio() {
1554       return this._ratio;
1555     }
1556     set ratio(ratio) {
1557       this._ratio = Math.min(Math.max(0, ratio), 1);
1558       this.checkTrim();
1559     }
1560     get(key, touch = Touch.AsNew) {
1561       return super.get(key, touch);
1562     }
1563     peek(key) {
1564       return super.get(key, Touch.None);
1565     }
1566     set(key, value) {
1567       super.set(key, value, Touch.Last);
1568       this.checkTrim();
1569       return this;
1570     }
1571     checkTrim() {
1572       if (this.size > this._limit) {
1573         this.trimOld(Math.round(this._limit * this._ratio));
1574       }
1575     }
1576   };
1577   exports2.LRUCache = LRUCache;
1578 });
1579
1580 // node_modules/vscode-jsonrpc/lib/common/connection.js
1581 var require_connection = __commonJS((exports2) => {
1582   "use strict";
1583   Object.defineProperty(exports2, "__esModule", {value: true});
1584   exports2.createMessageConnection = exports2.ConnectionOptions = exports2.CancellationStrategy = exports2.CancellationSenderStrategy = exports2.CancellationReceiverStrategy = exports2.ConnectionStrategy = exports2.ConnectionError = exports2.ConnectionErrors = exports2.LogTraceNotification = exports2.SetTraceNotification = exports2.TraceFormat = exports2.Trace = exports2.NullLogger = exports2.ProgressType = void 0;
1585   var ral_1 = require_ral();
1586   var Is = require_is();
1587   var messages_1 = require_messages();
1588   var linkedMap_1 = require_linkedMap();
1589   var events_1 = require_events();
1590   var cancellation_1 = require_cancellation();
1591   var CancelNotification;
1592   (function(CancelNotification2) {
1593     CancelNotification2.type = new messages_1.NotificationType("$/cancelRequest");
1594   })(CancelNotification || (CancelNotification = {}));
1595   var ProgressNotification;
1596   (function(ProgressNotification2) {
1597     ProgressNotification2.type = new messages_1.NotificationType("$/progress");
1598   })(ProgressNotification || (ProgressNotification = {}));
1599   var ProgressType = class {
1600     constructor() {
1601     }
1602   };
1603   exports2.ProgressType = ProgressType;
1604   var StarRequestHandler;
1605   (function(StarRequestHandler2) {
1606     function is(value) {
1607       return Is.func(value);
1608     }
1609     StarRequestHandler2.is = is;
1610   })(StarRequestHandler || (StarRequestHandler = {}));
1611   exports2.NullLogger = Object.freeze({
1612     error: () => {
1613     },
1614     warn: () => {
1615     },
1616     info: () => {
1617     },
1618     log: () => {
1619     }
1620   });
1621   var Trace;
1622   (function(Trace2) {
1623     Trace2[Trace2["Off"] = 0] = "Off";
1624     Trace2[Trace2["Messages"] = 1] = "Messages";
1625     Trace2[Trace2["Verbose"] = 2] = "Verbose";
1626   })(Trace = exports2.Trace || (exports2.Trace = {}));
1627   (function(Trace2) {
1628     function fromString(value) {
1629       if (!Is.string(value)) {
1630         return Trace2.Off;
1631       }
1632       value = value.toLowerCase();
1633       switch (value) {
1634         case "off":
1635           return Trace2.Off;
1636         case "messages":
1637           return Trace2.Messages;
1638         case "verbose":
1639           return Trace2.Verbose;
1640         default:
1641           return Trace2.Off;
1642       }
1643     }
1644     Trace2.fromString = fromString;
1645     function toString(value) {
1646       switch (value) {
1647         case Trace2.Off:
1648           return "off";
1649         case Trace2.Messages:
1650           return "messages";
1651         case Trace2.Verbose:
1652           return "verbose";
1653         default:
1654           return "off";
1655       }
1656     }
1657     Trace2.toString = toString;
1658   })(Trace = exports2.Trace || (exports2.Trace = {}));
1659   var TraceFormat;
1660   (function(TraceFormat2) {
1661     TraceFormat2["Text"] = "text";
1662     TraceFormat2["JSON"] = "json";
1663   })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {}));
1664   (function(TraceFormat2) {
1665     function fromString(value) {
1666       value = value.toLowerCase();
1667       if (value === "json") {
1668         return TraceFormat2.JSON;
1669       } else {
1670         return TraceFormat2.Text;
1671       }
1672     }
1673     TraceFormat2.fromString = fromString;
1674   })(TraceFormat = exports2.TraceFormat || (exports2.TraceFormat = {}));
1675   var SetTraceNotification;
1676   (function(SetTraceNotification2) {
1677     SetTraceNotification2.type = new messages_1.NotificationType("$/setTrace");
1678   })(SetTraceNotification = exports2.SetTraceNotification || (exports2.SetTraceNotification = {}));
1679   var LogTraceNotification;
1680   (function(LogTraceNotification2) {
1681     LogTraceNotification2.type = new messages_1.NotificationType("$/logTrace");
1682   })(LogTraceNotification = exports2.LogTraceNotification || (exports2.LogTraceNotification = {}));
1683   var ConnectionErrors;
1684   (function(ConnectionErrors2) {
1685     ConnectionErrors2[ConnectionErrors2["Closed"] = 1] = "Closed";
1686     ConnectionErrors2[ConnectionErrors2["Disposed"] = 2] = "Disposed";
1687     ConnectionErrors2[ConnectionErrors2["AlreadyListening"] = 3] = "AlreadyListening";
1688   })(ConnectionErrors = exports2.ConnectionErrors || (exports2.ConnectionErrors = {}));
1689   var ConnectionError = class extends Error {
1690     constructor(code, message) {
1691       super(message);
1692       this.code = code;
1693       Object.setPrototypeOf(this, ConnectionError.prototype);
1694     }
1695   };
1696   exports2.ConnectionError = ConnectionError;
1697   var ConnectionStrategy;
1698   (function(ConnectionStrategy2) {
1699     function is(value) {
1700       const candidate = value;
1701       return candidate && Is.func(candidate.cancelUndispatched);
1702     }
1703     ConnectionStrategy2.is = is;
1704   })(ConnectionStrategy = exports2.ConnectionStrategy || (exports2.ConnectionStrategy = {}));
1705   var CancellationReceiverStrategy;
1706   (function(CancellationReceiverStrategy2) {
1707     CancellationReceiverStrategy2.Message = Object.freeze({
1708       createCancellationTokenSource(_) {
1709         return new cancellation_1.CancellationTokenSource();
1710       }
1711     });
1712     function is(value) {
1713       const candidate = value;
1714       return candidate && Is.func(candidate.createCancellationTokenSource);
1715     }
1716     CancellationReceiverStrategy2.is = is;
1717   })(CancellationReceiverStrategy = exports2.CancellationReceiverStrategy || (exports2.CancellationReceiverStrategy = {}));
1718   var CancellationSenderStrategy;
1719   (function(CancellationSenderStrategy2) {
1720     CancellationSenderStrategy2.Message = Object.freeze({
1721       sendCancellation(conn, id) {
1722         conn.sendNotification(CancelNotification.type, {id});
1723       },
1724       cleanup(_) {
1725       }
1726     });
1727     function is(value) {
1728       const candidate = value;
1729       return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup);
1730     }
1731     CancellationSenderStrategy2.is = is;
1732   })(CancellationSenderStrategy = exports2.CancellationSenderStrategy || (exports2.CancellationSenderStrategy = {}));
1733   var CancellationStrategy;
1734   (function(CancellationStrategy2) {
1735     CancellationStrategy2.Message = Object.freeze({
1736       receiver: CancellationReceiverStrategy.Message,
1737       sender: CancellationSenderStrategy.Message
1738     });
1739     function is(value) {
1740       const candidate = value;
1741       return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);
1742     }
1743     CancellationStrategy2.is = is;
1744   })(CancellationStrategy = exports2.CancellationStrategy || (exports2.CancellationStrategy = {}));
1745   var ConnectionOptions;
1746   (function(ConnectionOptions2) {
1747     function is(value) {
1748       const candidate = value;
1749       return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy));
1750     }
1751     ConnectionOptions2.is = is;
1752   })(ConnectionOptions = exports2.ConnectionOptions || (exports2.ConnectionOptions = {}));
1753   var ConnectionState;
1754   (function(ConnectionState2) {
1755     ConnectionState2[ConnectionState2["New"] = 1] = "New";
1756     ConnectionState2[ConnectionState2["Listening"] = 2] = "Listening";
1757     ConnectionState2[ConnectionState2["Closed"] = 3] = "Closed";
1758     ConnectionState2[ConnectionState2["Disposed"] = 4] = "Disposed";
1759   })(ConnectionState || (ConnectionState = {}));
1760   function createMessageConnection(messageReader, messageWriter, _logger, options) {
1761     const logger = _logger !== void 0 ? _logger : exports2.NullLogger;
1762     let sequenceNumber = 0;
1763     let notificationSquenceNumber = 0;
1764     let unknownResponseSquenceNumber = 0;
1765     const version = "2.0";
1766     let starRequestHandler = void 0;
1767     const requestHandlers = Object.create(null);
1768     let starNotificationHandler = void 0;
1769     const notificationHandlers = Object.create(null);
1770     const progressHandlers = new Map();
1771     let timer;
1772     let messageQueue = new linkedMap_1.LinkedMap();
1773     let responsePromises = Object.create(null);
1774     let requestTokens = Object.create(null);
1775     let trace = Trace.Off;
1776     let traceFormat = TraceFormat.Text;
1777     let tracer;
1778     let state = ConnectionState.New;
1779     const errorEmitter = new events_1.Emitter();
1780     const closeEmitter = new events_1.Emitter();
1781     const unhandledNotificationEmitter = new events_1.Emitter();
1782     const unhandledProgressEmitter = new events_1.Emitter();
1783     const disposeEmitter = new events_1.Emitter();
1784     const cancellationStrategy = options && options.cancellationStrategy ? options.cancellationStrategy : CancellationStrategy.Message;
1785     function createRequestQueueKey(id) {
1786       if (id === null) {
1787         throw new Error(`Can't send requests with id null since the response can't be correlated.`);
1788       }
1789       return "req-" + id.toString();
1790     }
1791     function createResponseQueueKey(id) {
1792       if (id === null) {
1793         return "res-unknown-" + (++unknownResponseSquenceNumber).toString();
1794       } else {
1795         return "res-" + id.toString();
1796       }
1797     }
1798     function createNotificationQueueKey() {
1799       return "not-" + (++notificationSquenceNumber).toString();
1800     }
1801     function addMessageToQueue(queue, message) {
1802       if (messages_1.isRequestMessage(message)) {
1803         queue.set(createRequestQueueKey(message.id), message);
1804       } else if (messages_1.isResponseMessage(message)) {
1805         queue.set(createResponseQueueKey(message.id), message);
1806       } else {
1807         queue.set(createNotificationQueueKey(), message);
1808       }
1809     }
1810     function cancelUndispatched(_message) {
1811       return void 0;
1812     }
1813     function isListening() {
1814       return state === ConnectionState.Listening;
1815     }
1816     function isClosed() {
1817       return state === ConnectionState.Closed;
1818     }
1819     function isDisposed() {
1820       return state === ConnectionState.Disposed;
1821     }
1822     function closeHandler() {
1823       if (state === ConnectionState.New || state === ConnectionState.Listening) {
1824         state = ConnectionState.Closed;
1825         closeEmitter.fire(void 0);
1826       }
1827     }
1828     function readErrorHandler(error) {
1829       errorEmitter.fire([error, void 0, void 0]);
1830     }
1831     function writeErrorHandler(data) {
1832       errorEmitter.fire(data);
1833     }
1834     messageReader.onClose(closeHandler);
1835     messageReader.onError(readErrorHandler);
1836     messageWriter.onClose(closeHandler);
1837     messageWriter.onError(writeErrorHandler);
1838     function triggerMessageQueue() {
1839       if (timer || messageQueue.size === 0) {
1840         return;
1841       }
1842       timer = ral_1.default().timer.setImmediate(() => {
1843         timer = void 0;
1844         processMessageQueue();
1845       });
1846     }
1847     function processMessageQueue() {
1848       if (messageQueue.size === 0) {
1849         return;
1850       }
1851       const message = messageQueue.shift();
1852       try {
1853         if (messages_1.isRequestMessage(message)) {
1854           handleRequest(message);
1855         } else if (messages_1.isNotificationMessage(message)) {
1856           handleNotification(message);
1857         } else if (messages_1.isResponseMessage(message)) {
1858           handleResponse(message);
1859         } else {
1860           handleInvalidMessage(message);
1861         }
1862       } finally {
1863         triggerMessageQueue();
1864       }
1865     }
1866     const callback = (message) => {
1867       try {
1868         if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) {
1869           const key = createRequestQueueKey(message.params.id);
1870           const toCancel = messageQueue.get(key);
1871           if (messages_1.isRequestMessage(toCancel)) {
1872             const strategy = options === null || options === void 0 ? void 0 : options.connectionStrategy;
1873             const response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
1874             if (response && (response.error !== void 0 || response.result !== void 0)) {
1875               messageQueue.delete(key);
1876               response.id = toCancel.id;
1877               traceSendingResponse(response, message.method, Date.now());
1878               messageWriter.write(response);
1879               return;
1880             }
1881           }
1882         }
1883         addMessageToQueue(messageQueue, message);
1884       } finally {
1885         triggerMessageQueue();
1886       }
1887     };
1888     function handleRequest(requestMessage) {
1889       if (isDisposed()) {
1890         return;
1891       }
1892       function reply(resultOrError, method, startTime2) {
1893         const message = {
1894           jsonrpc: version,
1895           id: requestMessage.id
1896         };
1897         if (resultOrError instanceof messages_1.ResponseError) {
1898           message.error = resultOrError.toJson();
1899         } else {
1900           message.result = resultOrError === void 0 ? null : resultOrError;
1901         }
1902         traceSendingResponse(message, method, startTime2);
1903         messageWriter.write(message);
1904       }
1905       function replyError(error, method, startTime2) {
1906         const message = {
1907           jsonrpc: version,
1908           id: requestMessage.id,
1909           error: error.toJson()
1910         };
1911         traceSendingResponse(message, method, startTime2);
1912         messageWriter.write(message);
1913       }
1914       function replySuccess(result, method, startTime2) {
1915         if (result === void 0) {
1916           result = null;
1917         }
1918         const message = {
1919           jsonrpc: version,
1920           id: requestMessage.id,
1921           result
1922         };
1923         traceSendingResponse(message, method, startTime2);
1924         messageWriter.write(message);
1925       }
1926       traceReceivedRequest(requestMessage);
1927       const element = requestHandlers[requestMessage.method];
1928       let type;
1929       let requestHandler;
1930       if (element) {
1931         type = element.type;
1932         requestHandler = element.handler;
1933       }
1934       const startTime = Date.now();
1935       if (requestHandler || starRequestHandler) {
1936         const tokenKey = String(requestMessage.id);
1937         const cancellationSource = cancellationStrategy.receiver.createCancellationTokenSource(tokenKey);
1938         requestTokens[tokenKey] = cancellationSource;
1939         try {
1940           let handlerResult;
1941           if (requestHandler) {
1942             if (requestMessage.params === void 0) {
1943               if (type !== void 0 && type.numberOfParams !== 0) {
1944                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but recevied none.`), requestMessage.method, startTime);
1945                 return;
1946               }
1947               handlerResult = requestHandler(cancellationSource.token);
1948             } else if (Array.isArray(requestMessage.params)) {
1949               if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byName) {
1950                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);
1951                 return;
1952               }
1953               handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);
1954             } else {
1955               if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
1956                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);
1957                 return;
1958               }
1959               handlerResult = requestHandler(requestMessage.params, cancellationSource.token);
1960             }
1961           } else if (starRequestHandler) {
1962             handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
1963           }
1964           const promise = handlerResult;
1965           if (!handlerResult) {
1966             delete requestTokens[tokenKey];
1967             replySuccess(handlerResult, requestMessage.method, startTime);
1968           } else if (promise.then) {
1969             promise.then((resultOrError) => {
1970               delete requestTokens[tokenKey];
1971               reply(resultOrError, requestMessage.method, startTime);
1972             }, (error) => {
1973               delete requestTokens[tokenKey];
1974               if (error instanceof messages_1.ResponseError) {
1975                 replyError(error, requestMessage.method, startTime);
1976               } else if (error && Is.string(error.message)) {
1977                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
1978               } else {
1979                 replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
1980               }
1981             });
1982           } else {
1983             delete requestTokens[tokenKey];
1984             reply(handlerResult, requestMessage.method, startTime);
1985           }
1986         } catch (error) {
1987           delete requestTokens[tokenKey];
1988           if (error instanceof messages_1.ResponseError) {
1989             reply(error, requestMessage.method, startTime);
1990           } else if (error && Is.string(error.message)) {
1991             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
1992           } else {
1993             replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
1994           }
1995         }
1996       } else {
1997         replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
1998       }
1999     }
2000     function handleResponse(responseMessage) {
2001       if (isDisposed()) {
2002         return;
2003       }
2004       if (responseMessage.id === null) {
2005         if (responseMessage.error) {
2006           logger.error(`Received response message without id: Error is: 
2007 ${JSON.stringify(responseMessage.error, void 0, 4)}`);
2008         } else {
2009           logger.error(`Received response message without id. No further error information provided.`);
2010         }
2011       } else {
2012         const key = String(responseMessage.id);
2013         const responsePromise = responsePromises[key];
2014         traceReceivedResponse(responseMessage, responsePromise);
2015         if (responsePromise) {
2016           delete responsePromises[key];
2017           try {
2018             if (responseMessage.error) {
2019               const error = responseMessage.error;
2020               responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
2021             } else if (responseMessage.result !== void 0) {
2022               responsePromise.resolve(responseMessage.result);
2023             } else {
2024               throw new Error("Should never happen.");
2025             }
2026           } catch (error) {
2027             if (error.message) {
2028               logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
2029             } else {
2030               logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
2031             }
2032           }
2033         }
2034       }
2035     }
2036     function handleNotification(message) {
2037       if (isDisposed()) {
2038         return;
2039       }
2040       let type = void 0;
2041       let notificationHandler;
2042       if (message.method === CancelNotification.type.method) {
2043         notificationHandler = (params) => {
2044           const id = params.id;
2045           const source = requestTokens[String(id)];
2046           if (source) {
2047             source.cancel();
2048           }
2049         };
2050       } else {
2051         const element = notificationHandlers[message.method];
2052         if (element) {
2053           notificationHandler = element.handler;
2054           type = element.type;
2055         }
2056       }
2057       if (notificationHandler || starNotificationHandler) {
2058         try {
2059           traceReceivedNotification(message);
2060           if (notificationHandler) {
2061             if (message.params === void 0) {
2062               if (type !== void 0) {
2063                 if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {
2064                   logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but recevied none.`);
2065                 }
2066               }
2067               notificationHandler();
2068             } else if (Array.isArray(message.params)) {
2069               if (type !== void 0) {
2070                 if (type.parameterStructures === messages_1.ParameterStructures.byName) {
2071                   logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);
2072                 }
2073                 if (type.numberOfParams !== message.params.length) {
2074                   logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${message.params.length} argumennts`);
2075                 }
2076               }
2077               notificationHandler(...message.params);
2078             } else {
2079               if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
2080                 logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);
2081               }
2082               notificationHandler(message.params);
2083             }
2084           } else if (starNotificationHandler) {
2085             starNotificationHandler(message.method, message.params);
2086           }
2087         } catch (error) {
2088           if (error.message) {
2089             logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
2090           } else {
2091             logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
2092           }
2093         }
2094       } else {
2095         unhandledNotificationEmitter.fire(message);
2096       }
2097     }
2098     function handleInvalidMessage(message) {
2099       if (!message) {
2100         logger.error("Received empty message.");
2101         return;
2102       }
2103       logger.error(`Received message which is neither a response nor a notification message:
2104 ${JSON.stringify(message, null, 4)}`);
2105       const responseMessage = message;
2106       if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
2107         const key = String(responseMessage.id);
2108         const responseHandler = responsePromises[key];
2109         if (responseHandler) {
2110           responseHandler.reject(new Error("The received response has neither a result nor an error property."));
2111         }
2112       }
2113     }
2114     function traceSendingRequest(message) {
2115       if (trace === Trace.Off || !tracer) {
2116         return;
2117       }
2118       if (traceFormat === TraceFormat.Text) {
2119         let data = void 0;
2120         if (trace === Trace.Verbose && message.params) {
2121           data = `Params: ${JSON.stringify(message.params, null, 4)}
2122
2123 `;
2124         }
2125         tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
2126       } else {
2127         logLSPMessage("send-request", message);
2128       }
2129     }
2130     function traceSendingNotification(message) {
2131       if (trace === Trace.Off || !tracer) {
2132         return;
2133       }
2134       if (traceFormat === TraceFormat.Text) {
2135         let data = void 0;
2136         if (trace === Trace.Verbose) {
2137           if (message.params) {
2138             data = `Params: ${JSON.stringify(message.params, null, 4)}
2139
2140 `;
2141           } else {
2142             data = "No parameters provided.\n\n";
2143           }
2144         }
2145         tracer.log(`Sending notification '${message.method}'.`, data);
2146       } else {
2147         logLSPMessage("send-notification", message);
2148       }
2149     }
2150     function traceSendingResponse(message, method, startTime) {
2151       if (trace === Trace.Off || !tracer) {
2152         return;
2153       }
2154       if (traceFormat === TraceFormat.Text) {
2155         let data = void 0;
2156         if (trace === Trace.Verbose) {
2157           if (message.error && message.error.data) {
2158             data = `Error data: ${JSON.stringify(message.error.data, null, 4)}
2159
2160 `;
2161           } else {
2162             if (message.result) {
2163               data = `Result: ${JSON.stringify(message.result, null, 4)}
2164
2165 `;
2166             } else if (message.error === void 0) {
2167               data = "No result returned.\n\n";
2168             }
2169           }
2170         }
2171         tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
2172       } else {
2173         logLSPMessage("send-response", message);
2174       }
2175     }
2176     function traceReceivedRequest(message) {
2177       if (trace === Trace.Off || !tracer) {
2178         return;
2179       }
2180       if (traceFormat === TraceFormat.Text) {
2181         let data = void 0;
2182         if (trace === Trace.Verbose && message.params) {
2183           data = `Params: ${JSON.stringify(message.params, null, 4)}
2184
2185 `;
2186         }
2187         tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
2188       } else {
2189         logLSPMessage("receive-request", message);
2190       }
2191     }
2192     function traceReceivedNotification(message) {
2193       if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
2194         return;
2195       }
2196       if (traceFormat === TraceFormat.Text) {
2197         let data = void 0;
2198         if (trace === Trace.Verbose) {
2199           if (message.params) {
2200             data = `Params: ${JSON.stringify(message.params, null, 4)}
2201
2202 `;
2203           } else {
2204             data = "No parameters provided.\n\n";
2205           }
2206         }
2207         tracer.log(`Received notification '${message.method}'.`, data);
2208       } else {
2209         logLSPMessage("receive-notification", message);
2210       }
2211     }
2212     function traceReceivedResponse(message, responsePromise) {
2213       if (trace === Trace.Off || !tracer) {
2214         return;
2215       }
2216       if (traceFormat === TraceFormat.Text) {
2217         let data = void 0;
2218         if (trace === Trace.Verbose) {
2219           if (message.error && message.error.data) {
2220             data = `Error data: ${JSON.stringify(message.error.data, null, 4)}
2221
2222 `;
2223           } else {
2224             if (message.result) {
2225               data = `Result: ${JSON.stringify(message.result, null, 4)}
2226
2227 `;
2228             } else if (message.error === void 0) {
2229               data = "No result returned.\n\n";
2230             }
2231           }
2232         }
2233         if (responsePromise) {
2234           const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : "";
2235           tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
2236         } else {
2237           tracer.log(`Received response ${message.id} without active response promise.`, data);
2238         }
2239       } else {
2240         logLSPMessage("receive-response", message);
2241       }
2242     }
2243     function logLSPMessage(type, message) {
2244       if (!tracer || trace === Trace.Off) {
2245         return;
2246       }
2247       const lspMessage = {
2248         isLSPMessage: true,
2249         type,
2250         message,
2251         timestamp: Date.now()
2252       };
2253       tracer.log(lspMessage);
2254     }
2255     function throwIfClosedOrDisposed() {
2256       if (isClosed()) {
2257         throw new ConnectionError(ConnectionErrors.Closed, "Connection is closed.");
2258       }
2259       if (isDisposed()) {
2260         throw new ConnectionError(ConnectionErrors.Disposed, "Connection is disposed.");
2261       }
2262     }
2263     function throwIfListening() {
2264       if (isListening()) {
2265         throw new ConnectionError(ConnectionErrors.AlreadyListening, "Connection is already listening");
2266       }
2267     }
2268     function throwIfNotListening() {
2269       if (!isListening()) {
2270         throw new Error("Call listen() first.");
2271       }
2272     }
2273     function undefinedToNull(param) {
2274       if (param === void 0) {
2275         return null;
2276       } else {
2277         return param;
2278       }
2279     }
2280     function nullToUndefined(param) {
2281       if (param === null) {
2282         return void 0;
2283       } else {
2284         return param;
2285       }
2286     }
2287     function isNamedParam(param) {
2288       return param !== void 0 && param !== null && !Array.isArray(param) && typeof param === "object";
2289     }
2290     function computeSingleParam(parameterStructures, param) {
2291       switch (parameterStructures) {
2292         case messages_1.ParameterStructures.auto:
2293           if (isNamedParam(param)) {
2294             return nullToUndefined(param);
2295           } else {
2296             return [undefinedToNull(param)];
2297           }
2298           break;
2299         case messages_1.ParameterStructures.byName:
2300           if (!isNamedParam(param)) {
2301             throw new Error(`Recevied parameters by name but param is not an object literal.`);
2302           }
2303           return nullToUndefined(param);
2304         case messages_1.ParameterStructures.byPosition:
2305           return [undefinedToNull(param)];
2306         default:
2307           throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);
2308       }
2309     }
2310     function computeMessageParams(type, params) {
2311       let result;
2312       const numberOfParams = type.numberOfParams;
2313       switch (numberOfParams) {
2314         case 0:
2315           result = void 0;
2316           break;
2317         case 1:
2318           result = computeSingleParam(type.parameterStructures, params[0]);
2319           break;
2320         default:
2321           result = [];
2322           for (let i = 0; i < params.length && i < numberOfParams; i++) {
2323             result.push(undefinedToNull(params[i]));
2324           }
2325           if (params.length < numberOfParams) {
2326             for (let i = params.length; i < numberOfParams; i++) {
2327               result.push(null);
2328             }
2329           }
2330           break;
2331       }
2332       return result;
2333     }
2334     const connection = {
2335       sendNotification: (type, ...args) => {
2336         throwIfClosedOrDisposed();
2337         let method;
2338         let messageParams;
2339         if (Is.string(type)) {
2340           method = type;
2341           const first = args[0];
2342           let paramStart = 0;
2343           let parameterStructures = messages_1.ParameterStructures.auto;
2344           if (messages_1.ParameterStructures.is(first)) {
2345             paramStart = 1;
2346             parameterStructures = first;
2347           }
2348           let paramEnd = args.length;
2349           const numberOfParams = paramEnd - paramStart;
2350           switch (numberOfParams) {
2351             case 0:
2352               messageParams = void 0;
2353               break;
2354             case 1:
2355               messageParams = computeSingleParam(parameterStructures, args[paramStart]);
2356               break;
2357             default:
2358               if (parameterStructures === messages_1.ParameterStructures.byName) {
2359                 throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' notification parameter structure.`);
2360               }
2361               messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
2362               break;
2363           }
2364         } else {
2365           const params = args;
2366           method = type.method;
2367           messageParams = computeMessageParams(type, params);
2368         }
2369         const notificationMessage = {
2370           jsonrpc: version,
2371           method,
2372           params: messageParams
2373         };
2374         traceSendingNotification(notificationMessage);
2375         messageWriter.write(notificationMessage);
2376       },
2377       onNotification: (type, handler) => {
2378         throwIfClosedOrDisposed();
2379         let method;
2380         if (Is.func(type)) {
2381           starNotificationHandler = type;
2382         } else if (handler) {
2383           if (Is.string(type)) {
2384             method = type;
2385             notificationHandlers[type] = {type: void 0, handler};
2386           } else {
2387             method = type.method;
2388             notificationHandlers[type.method] = {type, handler};
2389           }
2390         }
2391         return {
2392           dispose: () => {
2393             if (method !== void 0) {
2394               delete notificationHandlers[method];
2395             } else {
2396               starNotificationHandler = void 0;
2397             }
2398           }
2399         };
2400       },
2401       onProgress: (_type, token, handler) => {
2402         if (progressHandlers.has(token)) {
2403           throw new Error(`Progress handler for token ${token} already registered`);
2404         }
2405         progressHandlers.set(token, handler);
2406         return {
2407           dispose: () => {
2408             progressHandlers.delete(token);
2409           }
2410         };
2411       },
2412       sendProgress: (_type, token, value) => {
2413         connection.sendNotification(ProgressNotification.type, {token, value});
2414       },
2415       onUnhandledProgress: unhandledProgressEmitter.event,
2416       sendRequest: (type, ...args) => {
2417         throwIfClosedOrDisposed();
2418         throwIfNotListening();
2419         let method;
2420         let messageParams;
2421         let token = void 0;
2422         if (Is.string(type)) {
2423           method = type;
2424           const first = args[0];
2425           const last = args[args.length - 1];
2426           let paramStart = 0;
2427           let parameterStructures = messages_1.ParameterStructures.auto;
2428           if (messages_1.ParameterStructures.is(first)) {
2429             paramStart = 1;
2430             parameterStructures = first;
2431           }
2432           let paramEnd = args.length;
2433           if (cancellation_1.CancellationToken.is(last)) {
2434             paramEnd = paramEnd - 1;
2435             token = last;
2436           }
2437           const numberOfParams = paramEnd - paramStart;
2438           switch (numberOfParams) {
2439             case 0:
2440               messageParams = void 0;
2441               break;
2442             case 1:
2443               messageParams = computeSingleParam(parameterStructures, args[paramStart]);
2444               break;
2445             default:
2446               if (parameterStructures === messages_1.ParameterStructures.byName) {
2447                 throw new Error(`Recevied ${numberOfParams} parameters for 'by Name' request parameter structure.`);
2448               }
2449               messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
2450               break;
2451           }
2452         } else {
2453           const params = args;
2454           method = type.method;
2455           messageParams = computeMessageParams(type, params);
2456           const numberOfParams = type.numberOfParams;
2457           token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : void 0;
2458         }
2459         const id = sequenceNumber++;
2460         let disposable;
2461         if (token) {
2462           disposable = token.onCancellationRequested(() => {
2463             cancellationStrategy.sender.sendCancellation(connection, id);
2464           });
2465         }
2466         const result = new Promise((resolve, reject) => {
2467           const requestMessage = {
2468             jsonrpc: version,
2469             id,
2470             method,
2471             params: messageParams
2472           };
2473           const resolveWithCleanup = (r) => {
2474             resolve(r);
2475             cancellationStrategy.sender.cleanup(id);
2476             disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
2477           };
2478           const rejectWithCleanup = (r) => {
2479             reject(r);
2480             cancellationStrategy.sender.cleanup(id);
2481             disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
2482           };
2483           let responsePromise = {method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup};
2484           traceSendingRequest(requestMessage);
2485           try {
2486             messageWriter.write(requestMessage);
2487           } catch (e) {
2488             responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : "Unknown reason"));
2489             responsePromise = null;
2490           }
2491           if (responsePromise) {
2492             responsePromises[String(id)] = responsePromise;
2493           }
2494         });
2495         return result;
2496       },
2497       onRequest: (type, handler) => {
2498         throwIfClosedOrDisposed();
2499         let method = null;
2500         if (StarRequestHandler.is(type)) {
2501           method = void 0;
2502           starRequestHandler = type;
2503         } else if (Is.string(type)) {
2504           method = null;
2505           if (handler !== void 0) {
2506             method = type;
2507             requestHandlers[type] = {handler, type: void 0};
2508           }
2509         } else {
2510           if (handler !== void 0) {
2511             method = type.method;
2512             requestHandlers[type.method] = {type, handler};
2513           }
2514         }
2515         return {
2516           dispose: () => {
2517             if (method === null) {
2518               return;
2519             }
2520             if (method !== void 0) {
2521               delete requestHandlers[method];
2522             } else {
2523               starRequestHandler = void 0;
2524             }
2525           }
2526         };
2527       },
2528       trace: (_value, _tracer, sendNotificationOrTraceOptions) => {
2529         let _sendNotification = false;
2530         let _traceFormat = TraceFormat.Text;
2531         if (sendNotificationOrTraceOptions !== void 0) {
2532           if (Is.boolean(sendNotificationOrTraceOptions)) {
2533             _sendNotification = sendNotificationOrTraceOptions;
2534           } else {
2535             _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
2536             _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
2537           }
2538         }
2539         trace = _value;
2540         traceFormat = _traceFormat;
2541         if (trace === Trace.Off) {
2542           tracer = void 0;
2543         } else {
2544           tracer = _tracer;
2545         }
2546         if (_sendNotification && !isClosed() && !isDisposed()) {
2547           connection.sendNotification(SetTraceNotification.type, {value: Trace.toString(_value)});
2548         }
2549       },
2550       onError: errorEmitter.event,
2551       onClose: closeEmitter.event,
2552       onUnhandledNotification: unhandledNotificationEmitter.event,
2553       onDispose: disposeEmitter.event,
2554       end: () => {
2555         messageWriter.end();
2556       },
2557       dispose: () => {
2558         if (isDisposed()) {
2559           return;
2560         }
2561         state = ConnectionState.Disposed;
2562         disposeEmitter.fire(void 0);
2563         const error = new Error("Connection got disposed.");
2564         Object.keys(responsePromises).forEach((key) => {
2565           responsePromises[key].reject(error);
2566         });
2567         responsePromises = Object.create(null);
2568         requestTokens = Object.create(null);
2569         messageQueue = new linkedMap_1.LinkedMap();
2570         if (Is.func(messageWriter.dispose)) {
2571           messageWriter.dispose();
2572         }
2573         if (Is.func(messageReader.dispose)) {
2574           messageReader.dispose();
2575         }
2576       },
2577       listen: () => {
2578         throwIfClosedOrDisposed();
2579         throwIfListening();
2580         state = ConnectionState.Listening;
2581         messageReader.listen(callback);
2582       },
2583       inspect: () => {
2584         ral_1.default().console.log("inspect");
2585       }
2586     };
2587     connection.onNotification(LogTraceNotification.type, (params) => {
2588       if (trace === Trace.Off || !tracer) {
2589         return;
2590       }
2591       tracer.log(params.message, trace === Trace.Verbose ? params.verbose : void 0);
2592     });
2593     connection.onNotification(ProgressNotification.type, (params) => {
2594       const handler = progressHandlers.get(params.token);
2595       if (handler) {
2596         handler(params.value);
2597       } else {
2598         unhandledProgressEmitter.fire(params);
2599       }
2600     });
2601     return connection;
2602   }
2603   exports2.createMessageConnection = createMessageConnection;
2604 });
2605
2606 // node_modules/vscode-jsonrpc/lib/common/api.js
2607 var require_api = __commonJS((exports2) => {
2608   "use strict";
2609   Object.defineProperty(exports2, "__esModule", {value: true});
2610   exports2.CancellationSenderStrategy = exports2.CancellationReceiverStrategy = exports2.ConnectionError = exports2.ConnectionErrors = exports2.LogTraceNotification = exports2.SetTraceNotification = exports2.TraceFormat = exports2.Trace = exports2.ProgressType = exports2.createMessageConnection = exports2.NullLogger = exports2.ConnectionOptions = exports2.ConnectionStrategy = exports2.WriteableStreamMessageWriter = exports2.AbstractMessageWriter = exports2.MessageWriter = exports2.ReadableStreamMessageReader = exports2.AbstractMessageReader = exports2.MessageReader = exports2.CancellationToken = exports2.CancellationTokenSource = exports2.Emitter = exports2.Event = exports2.Disposable = exports2.ParameterStructures = exports2.NotificationType9 = exports2.NotificationType8 = exports2.NotificationType7 = exports2.NotificationType6 = exports2.NotificationType5 = exports2.NotificationType4 = exports2.NotificationType3 = exports2.NotificationType2 = exports2.NotificationType1 = exports2.NotificationType0 = exports2.NotificationType = exports2.ErrorCodes = exports2.ResponseError = exports2.RequestType9 = exports2.RequestType8 = exports2.RequestType7 = exports2.RequestType6 = exports2.RequestType5 = exports2.RequestType4 = exports2.RequestType3 = exports2.RequestType2 = exports2.RequestType1 = exports2.RequestType0 = exports2.RequestType = exports2.RAL = void 0;
2611   exports2.CancellationStrategy = void 0;
2612   var messages_1 = require_messages();
2613   Object.defineProperty(exports2, "RequestType", {enumerable: true, get: function() {
2614     return messages_1.RequestType;
2615   }});
2616   Object.defineProperty(exports2, "RequestType0", {enumerable: true, get: function() {
2617     return messages_1.RequestType0;
2618   }});
2619   Object.defineProperty(exports2, "RequestType1", {enumerable: true, get: function() {
2620     return messages_1.RequestType1;
2621   }});
2622   Object.defineProperty(exports2, "RequestType2", {enumerable: true, get: function() {
2623     return messages_1.RequestType2;
2624   }});
2625   Object.defineProperty(exports2, "RequestType3", {enumerable: true, get: function() {
2626     return messages_1.RequestType3;
2627   }});
2628   Object.defineProperty(exports2, "RequestType4", {enumerable: true, get: function() {
2629     return messages_1.RequestType4;
2630   }});
2631   Object.defineProperty(exports2, "RequestType5", {enumerable: true, get: function() {
2632     return messages_1.RequestType5;
2633   }});
2634   Object.defineProperty(exports2, "RequestType6", {enumerable: true, get: function() {
2635     return messages_1.RequestType6;
2636   }});
2637   Object.defineProperty(exports2, "RequestType7", {enumerable: true, get: function() {
2638     return messages_1.RequestType7;
2639   }});
2640   Object.defineProperty(exports2, "RequestType8", {enumerable: true, get: function() {
2641     return messages_1.RequestType8;
2642   }});
2643   Object.defineProperty(exports2, "RequestType9", {enumerable: true, get: function() {
2644     return messages_1.RequestType9;
2645   }});
2646   Object.defineProperty(exports2, "ResponseError", {enumerable: true, get: function() {
2647     return messages_1.ResponseError;
2648   }});
2649   Object.defineProperty(exports2, "ErrorCodes", {enumerable: true, get: function() {
2650     return messages_1.ErrorCodes;
2651   }});
2652   Object.defineProperty(exports2, "NotificationType", {enumerable: true, get: function() {
2653     return messages_1.NotificationType;
2654   }});
2655   Object.defineProperty(exports2, "NotificationType0", {enumerable: true, get: function() {
2656     return messages_1.NotificationType0;
2657   }});
2658   Object.defineProperty(exports2, "NotificationType1", {enumerable: true, get: function() {
2659     return messages_1.NotificationType1;
2660   }});
2661   Object.defineProperty(exports2, "NotificationType2", {enumerable: true, get: function() {
2662     return messages_1.NotificationType2;
2663   }});
2664   Object.defineProperty(exports2, "NotificationType3", {enumerable: true, get: function() {
2665     return messages_1.NotificationType3;
2666   }});
2667   Object.defineProperty(exports2, "NotificationType4", {enumerable: true, get: function() {
2668     return messages_1.NotificationType4;
2669   }});
2670   Object.defineProperty(exports2, "NotificationType5", {enumerable: true, get: function() {
2671     return messages_1.NotificationType5;
2672   }});
2673   Object.defineProperty(exports2, "NotificationType6", {enumerable: true, get: function() {
2674     return messages_1.NotificationType6;
2675   }});
2676   Object.defineProperty(exports2, "NotificationType7", {enumerable: true, get: function() {
2677     return messages_1.NotificationType7;
2678   }});
2679   Object.defineProperty(exports2, "NotificationType8", {enumerable: true, get: function() {
2680     return messages_1.NotificationType8;
2681   }});
2682   Object.defineProperty(exports2, "NotificationType9", {enumerable: true, get: function() {
2683     return messages_1.NotificationType9;
2684   }});
2685   Object.defineProperty(exports2, "ParameterStructures", {enumerable: true, get: function() {
2686     return messages_1.ParameterStructures;
2687   }});
2688   var disposable_1 = require_disposable();
2689   Object.defineProperty(exports2, "Disposable", {enumerable: true, get: function() {
2690     return disposable_1.Disposable;
2691   }});
2692   var events_1 = require_events();
2693   Object.defineProperty(exports2, "Event", {enumerable: true, get: function() {
2694     return events_1.Event;
2695   }});
2696   Object.defineProperty(exports2, "Emitter", {enumerable: true, get: function() {
2697     return events_1.Emitter;
2698   }});
2699   var cancellation_1 = require_cancellation();
2700   Object.defineProperty(exports2, "CancellationTokenSource", {enumerable: true, get: function() {
2701     return cancellation_1.CancellationTokenSource;
2702   }});
2703   Object.defineProperty(exports2, "CancellationToken", {enumerable: true, get: function() {
2704     return cancellation_1.CancellationToken;
2705   }});
2706   var messageReader_1 = require_messageReader();
2707   Object.defineProperty(exports2, "MessageReader", {enumerable: true, get: function() {
2708     return messageReader_1.MessageReader;
2709   }});
2710   Object.defineProperty(exports2, "AbstractMessageReader", {enumerable: true, get: function() {
2711     return messageReader_1.AbstractMessageReader;
2712   }});
2713   Object.defineProperty(exports2, "ReadableStreamMessageReader", {enumerable: true, get: function() {
2714     return messageReader_1.ReadableStreamMessageReader;
2715   }});
2716   var messageWriter_1 = require_messageWriter();
2717   Object.defineProperty(exports2, "MessageWriter", {enumerable: true, get: function() {
2718     return messageWriter_1.MessageWriter;
2719   }});
2720   Object.defineProperty(exports2, "AbstractMessageWriter", {enumerable: true, get: function() {
2721     return messageWriter_1.AbstractMessageWriter;
2722   }});
2723   Object.defineProperty(exports2, "WriteableStreamMessageWriter", {enumerable: true, get: function() {
2724     return messageWriter_1.WriteableStreamMessageWriter;
2725   }});
2726   var connection_1 = require_connection();
2727   Object.defineProperty(exports2, "ConnectionStrategy", {enumerable: true, get: function() {
2728     return connection_1.ConnectionStrategy;
2729   }});
2730   Object.defineProperty(exports2, "ConnectionOptions", {enumerable: true, get: function() {
2731     return connection_1.ConnectionOptions;
2732   }});
2733   Object.defineProperty(exports2, "NullLogger", {enumerable: true, get: function() {
2734     return connection_1.NullLogger;
2735   }});
2736   Object.defineProperty(exports2, "createMessageConnection", {enumerable: true, get: function() {
2737     return connection_1.createMessageConnection;
2738   }});
2739   Object.defineProperty(exports2, "ProgressType", {enumerable: true, get: function() {
2740     return connection_1.ProgressType;
2741   }});
2742   Object.defineProperty(exports2, "Trace", {enumerable: true, get: function() {
2743     return connection_1.Trace;
2744   }});
2745   Object.defineProperty(exports2, "TraceFormat", {enumerable: true, get: function() {
2746     return connection_1.TraceFormat;
2747   }});
2748   Object.defineProperty(exports2, "SetTraceNotification", {enumerable: true, get: function() {
2749     return connection_1.SetTraceNotification;
2750   }});
2751   Object.defineProperty(exports2, "LogTraceNotification", {enumerable: true, get: function() {
2752     return connection_1.LogTraceNotification;
2753   }});
2754   Object.defineProperty(exports2, "ConnectionErrors", {enumerable: true, get: function() {
2755     return connection_1.ConnectionErrors;
2756   }});
2757   Object.defineProperty(exports2, "ConnectionError", {enumerable: true, get: function() {
2758     return connection_1.ConnectionError;
2759   }});
2760   Object.defineProperty(exports2, "CancellationReceiverStrategy", {enumerable: true, get: function() {
2761     return connection_1.CancellationReceiverStrategy;
2762   }});
2763   Object.defineProperty(exports2, "CancellationSenderStrategy", {enumerable: true, get: function() {
2764     return connection_1.CancellationSenderStrategy;
2765   }});
2766   Object.defineProperty(exports2, "CancellationStrategy", {enumerable: true, get: function() {
2767     return connection_1.CancellationStrategy;
2768   }});
2769   var ral_1 = require_ral();
2770   exports2.RAL = ral_1.default;
2771 });
2772
2773 // node_modules/vscode-jsonrpc/lib/node/main.js
2774 var require_main = __commonJS((exports2) => {
2775   "use strict";
2776   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
2777     if (k2 === void 0)
2778       k2 = k;
2779     Object.defineProperty(o, k2, {enumerable: true, get: function() {
2780       return m[k];
2781     }});
2782   } : function(o, m, k, k2) {
2783     if (k2 === void 0)
2784       k2 = k;
2785     o[k2] = m[k];
2786   });
2787   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
2788     for (var p in m)
2789       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
2790         __createBinding(exports3, m, p);
2791   };
2792   Object.defineProperty(exports2, "__esModule", {value: true});
2793   exports2.createMessageConnection = exports2.createServerSocketTransport = exports2.createClientSocketTransport = exports2.createServerPipeTransport = exports2.createClientPipeTransport = exports2.generateRandomPipeName = exports2.StreamMessageWriter = exports2.StreamMessageReader = exports2.SocketMessageWriter = exports2.SocketMessageReader = exports2.IPCMessageWriter = exports2.IPCMessageReader = void 0;
2794   var ril_1 = require_ril();
2795   ril_1.default.install();
2796   var api_1 = require_api();
2797   var path = require("path");
2798   var os = require("os");
2799   var crypto_1 = require("crypto");
2800   var net_1 = require("net");
2801   __exportStar2(require_api(), exports2);
2802   var IPCMessageReader = class extends api_1.AbstractMessageReader {
2803     constructor(process2) {
2804       super();
2805       this.process = process2;
2806       let eventEmitter = this.process;
2807       eventEmitter.on("error", (error) => this.fireError(error));
2808       eventEmitter.on("close", () => this.fireClose());
2809     }
2810     listen(callback) {
2811       this.process.on("message", callback);
2812       return api_1.Disposable.create(() => this.process.off("message", callback));
2813     }
2814   };
2815   exports2.IPCMessageReader = IPCMessageReader;
2816   var IPCMessageWriter = class extends api_1.AbstractMessageWriter {
2817     constructor(process2) {
2818       super();
2819       this.process = process2;
2820       this.errorCount = 0;
2821       let eventEmitter = this.process;
2822       eventEmitter.on("error", (error) => this.fireError(error));
2823       eventEmitter.on("close", () => this.fireClose);
2824     }
2825     write(msg) {
2826       try {
2827         if (typeof this.process.send === "function") {
2828           this.process.send(msg, void 0, void 0, (error) => {
2829             if (error) {
2830               this.errorCount++;
2831               this.handleError(error, msg);
2832             } else {
2833               this.errorCount = 0;
2834             }
2835           });
2836         }
2837         return Promise.resolve();
2838       } catch (error) {
2839         this.handleError(error, msg);
2840         return Promise.reject(error);
2841       }
2842     }
2843     handleError(error, msg) {
2844       this.errorCount++;
2845       this.fireError(error, msg, this.errorCount);
2846     }
2847     end() {
2848     }
2849   };
2850   exports2.IPCMessageWriter = IPCMessageWriter;
2851   var SocketMessageReader = class extends api_1.ReadableStreamMessageReader {
2852     constructor(socket, encoding = "utf-8") {
2853       super(ril_1.default().stream.asReadableStream(socket), encoding);
2854     }
2855   };
2856   exports2.SocketMessageReader = SocketMessageReader;
2857   var SocketMessageWriter = class extends api_1.WriteableStreamMessageWriter {
2858     constructor(socket, options) {
2859       super(ril_1.default().stream.asWritableStream(socket), options);
2860       this.socket = socket;
2861     }
2862     dispose() {
2863       super.dispose();
2864       this.socket.destroy();
2865     }
2866   };
2867   exports2.SocketMessageWriter = SocketMessageWriter;
2868   var StreamMessageReader = class extends api_1.ReadableStreamMessageReader {
2869     constructor(readble, encoding) {
2870       super(ril_1.default().stream.asReadableStream(readble), encoding);
2871     }
2872   };
2873   exports2.StreamMessageReader = StreamMessageReader;
2874   var StreamMessageWriter = class extends api_1.WriteableStreamMessageWriter {
2875     constructor(writable, options) {
2876       super(ril_1.default().stream.asWritableStream(writable), options);
2877     }
2878   };
2879   exports2.StreamMessageWriter = StreamMessageWriter;
2880   var XDG_RUNTIME_DIR = process.env["XDG_RUNTIME_DIR"];
2881   var safeIpcPathLengths = new Map([
2882     ["linux", 107],
2883     ["darwin", 103]
2884   ]);
2885   function generateRandomPipeName() {
2886     const randomSuffix = crypto_1.randomBytes(21).toString("hex");
2887     if (process.platform === "win32") {
2888       return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
2889     }
2890     let result;
2891     if (XDG_RUNTIME_DIR) {
2892       result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
2893     } else {
2894       result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
2895     }
2896     const limit = safeIpcPathLengths.get(process.platform);
2897     if (limit !== void 0 && result.length >= limit) {
2898       ril_1.default().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
2899     }
2900     return result;
2901   }
2902   exports2.generateRandomPipeName = generateRandomPipeName;
2903   function createClientPipeTransport(pipeName, encoding = "utf-8") {
2904     let connectResolve;
2905     const connected = new Promise((resolve, _reject) => {
2906       connectResolve = resolve;
2907     });
2908     return new Promise((resolve, reject) => {
2909       let server = net_1.createServer((socket) => {
2910         server.close();
2911         connectResolve([
2912           new SocketMessageReader(socket, encoding),
2913           new SocketMessageWriter(socket, encoding)
2914         ]);
2915       });
2916       server.on("error", reject);
2917       server.listen(pipeName, () => {
2918         server.removeListener("error", reject);
2919         resolve({
2920           onConnected: () => {
2921             return connected;
2922           }
2923         });
2924       });
2925     });
2926   }
2927   exports2.createClientPipeTransport = createClientPipeTransport;
2928   function createServerPipeTransport(pipeName, encoding = "utf-8") {
2929     const socket = net_1.createConnection(pipeName);
2930     return [
2931       new SocketMessageReader(socket, encoding),
2932       new SocketMessageWriter(socket, encoding)
2933     ];
2934   }
2935   exports2.createServerPipeTransport = createServerPipeTransport;
2936   function createClientSocketTransport(port, encoding = "utf-8") {
2937     let connectResolve;
2938     const connected = new Promise((resolve, _reject) => {
2939       connectResolve = resolve;
2940     });
2941     return new Promise((resolve, reject) => {
2942       const server = net_1.createServer((socket) => {
2943         server.close();
2944         connectResolve([
2945           new SocketMessageReader(socket, encoding),
2946           new SocketMessageWriter(socket, encoding)
2947         ]);
2948       });
2949       server.on("error", reject);
2950       server.listen(port, "127.0.0.1", () => {
2951         server.removeListener("error", reject);
2952         resolve({
2953           onConnected: () => {
2954             return connected;
2955           }
2956         });
2957       });
2958     });
2959   }
2960   exports2.createClientSocketTransport = createClientSocketTransport;
2961   function createServerSocketTransport(port, encoding = "utf-8") {
2962     const socket = net_1.createConnection(port, "127.0.0.1");
2963     return [
2964       new SocketMessageReader(socket, encoding),
2965       new SocketMessageWriter(socket, encoding)
2966     ];
2967   }
2968   exports2.createServerSocketTransport = createServerSocketTransport;
2969   function isReadableStream(value) {
2970     const candidate = value;
2971     return candidate.read !== void 0 && candidate.addListener !== void 0;
2972   }
2973   function isWritableStream(value) {
2974     const candidate = value;
2975     return candidate.write !== void 0 && candidate.addListener !== void 0;
2976   }
2977   function createMessageConnection(input, output, logger, options) {
2978     if (!logger) {
2979       logger = api_1.NullLogger;
2980     }
2981     const reader = isReadableStream(input) ? new StreamMessageReader(input) : input;
2982     const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output;
2983     if (api_1.ConnectionStrategy.is(options)) {
2984       options = {connectionStrategy: options};
2985     }
2986     return api_1.createMessageConnection(reader, writer, logger, options);
2987   }
2988   exports2.createMessageConnection = createMessageConnection;
2989 });
2990
2991 // node_modules/vscode-jsonrpc/node.js
2992 var require_node = __commonJS((exports2, module2) => {
2993   "use strict";
2994   module2.exports = require_main();
2995 });
2996
2997 // node_modules/vscode-languageserver-types/lib/esm/main.js
2998 var require_main2 = __commonJS((exports2) => {
2999   __markAsModule(exports2);
3000   __export(exports2, {
3001     AnnotatedTextEdit: () => AnnotatedTextEdit,
3002     ChangeAnnotation: () => ChangeAnnotation,
3003     ChangeAnnotationIdentifier: () => ChangeAnnotationIdentifier,
3004     CodeAction: () => CodeAction,
3005     CodeActionContext: () => CodeActionContext,
3006     CodeActionKind: () => CodeActionKind,
3007     CodeDescription: () => CodeDescription,
3008     CodeLens: () => CodeLens,
3009     Color: () => Color,
3010     ColorInformation: () => ColorInformation,
3011     ColorPresentation: () => ColorPresentation,
3012     Command: () => Command,
3013     CompletionItem: () => CompletionItem,
3014     CompletionItemKind: () => CompletionItemKind,
3015     CompletionItemTag: () => CompletionItemTag,
3016     CompletionList: () => CompletionList,
3017     CreateFile: () => CreateFile,
3018     DeleteFile: () => DeleteFile,
3019     Diagnostic: () => Diagnostic,
3020     DiagnosticRelatedInformation: () => DiagnosticRelatedInformation,
3021     DiagnosticSeverity: () => DiagnosticSeverity,
3022     DiagnosticTag: () => DiagnosticTag,
3023     DocumentHighlight: () => DocumentHighlight,
3024     DocumentHighlightKind: () => DocumentHighlightKind,
3025     DocumentLink: () => DocumentLink,
3026     DocumentSymbol: () => DocumentSymbol,
3027     EOL: () => EOL,
3028     FoldingRange: () => FoldingRange,
3029     FoldingRangeKind: () => FoldingRangeKind,
3030     FormattingOptions: () => FormattingOptions,
3031     Hover: () => Hover,
3032     InsertReplaceEdit: () => InsertReplaceEdit,
3033     InsertTextFormat: () => InsertTextFormat,
3034     InsertTextMode: () => InsertTextMode,
3035     Location: () => Location,
3036     LocationLink: () => LocationLink,
3037     MarkedString: () => MarkedString,
3038     MarkupContent: () => MarkupContent,
3039     MarkupKind: () => MarkupKind,
3040     OptionalVersionedTextDocumentIdentifier: () => OptionalVersionedTextDocumentIdentifier,
3041     ParameterInformation: () => ParameterInformation,
3042     Position: () => Position,
3043     Range: () => Range3,
3044     RenameFile: () => RenameFile,
3045     SelectionRange: () => SelectionRange,
3046     SignatureInformation: () => SignatureInformation,
3047     SymbolInformation: () => SymbolInformation,
3048     SymbolKind: () => SymbolKind,
3049     SymbolTag: () => SymbolTag,
3050     TextDocument: () => TextDocument,
3051     TextDocumentEdit: () => TextDocumentEdit,
3052     TextDocumentIdentifier: () => TextDocumentIdentifier2,
3053     TextDocumentItem: () => TextDocumentItem,
3054     TextEdit: () => TextEdit,
3055     VersionedTextDocumentIdentifier: () => VersionedTextDocumentIdentifier2,
3056     WorkspaceChange: () => WorkspaceChange,
3057     WorkspaceEdit: () => WorkspaceEdit,
3058     integer: () => integer,
3059     uinteger: () => uinteger
3060   });
3061   "use strict";
3062   var integer;
3063   (function(integer2) {
3064     integer2.MIN_VALUE = -2147483648;
3065     integer2.MAX_VALUE = 2147483647;
3066   })(integer || (integer = {}));
3067   var uinteger;
3068   (function(uinteger2) {
3069     uinteger2.MIN_VALUE = 0;
3070     uinteger2.MAX_VALUE = 2147483647;
3071   })(uinteger || (uinteger = {}));
3072   var Position;
3073   (function(Position2) {
3074     function create(line, character) {
3075       if (line === Number.MAX_VALUE) {
3076         line = uinteger.MAX_VALUE;
3077       }
3078       if (character === Number.MAX_VALUE) {
3079         character = uinteger.MAX_VALUE;
3080       }
3081       return {line, character};
3082     }
3083     Position2.create = create;
3084     function is(value) {
3085       var candidate = value;
3086       return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
3087     }
3088     Position2.is = is;
3089   })(Position || (Position = {}));
3090   var Range3;
3091   (function(Range4) {
3092     function create(one, two, three, four) {
3093       if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
3094         return {start: Position.create(one, two), end: Position.create(three, four)};
3095       } else if (Position.is(one) && Position.is(two)) {
3096         return {start: one, end: two};
3097       } else {
3098         throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
3099       }
3100     }
3101     Range4.create = create;
3102     function is(value) {
3103       var candidate = value;
3104       return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
3105     }
3106     Range4.is = is;
3107   })(Range3 || (Range3 = {}));
3108   var Location;
3109   (function(Location2) {
3110     function create(uri, range) {
3111       return {uri, range};
3112     }
3113     Location2.create = create;
3114     function is(value) {
3115       var candidate = value;
3116       return Is.defined(candidate) && Range3.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
3117     }
3118     Location2.is = is;
3119   })(Location || (Location = {}));
3120   var LocationLink;
3121   (function(LocationLink2) {
3122     function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
3123       return {targetUri, targetRange, targetSelectionRange, originSelectionRange};
3124     }
3125     LocationLink2.create = create;
3126     function is(value) {
3127       var candidate = value;
3128       return Is.defined(candidate) && Range3.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range3.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range3.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
3129     }
3130     LocationLink2.is = is;
3131   })(LocationLink || (LocationLink = {}));
3132   var Color;
3133   (function(Color2) {
3134     function create(red, green, blue, alpha) {
3135       return {
3136         red,
3137         green,
3138         blue,
3139         alpha
3140       };
3141     }
3142     Color2.create = create;
3143     function is(value) {
3144       var candidate = value;
3145       return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
3146     }
3147     Color2.is = is;
3148   })(Color || (Color = {}));
3149   var ColorInformation;
3150   (function(ColorInformation2) {
3151     function create(range, color) {
3152       return {
3153         range,
3154         color
3155       };
3156     }
3157     ColorInformation2.create = create;
3158     function is(value) {
3159       var candidate = value;
3160       return Range3.is(candidate.range) && Color.is(candidate.color);
3161     }
3162     ColorInformation2.is = is;
3163   })(ColorInformation || (ColorInformation = {}));
3164   var ColorPresentation;
3165   (function(ColorPresentation2) {
3166     function create(label, textEdit, additionalTextEdits) {
3167       return {
3168         label,
3169         textEdit,
3170         additionalTextEdits
3171       };
3172     }
3173     ColorPresentation2.create = create;
3174     function is(value) {
3175       var candidate = value;
3176       return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
3177     }
3178     ColorPresentation2.is = is;
3179   })(ColorPresentation || (ColorPresentation = {}));
3180   var FoldingRangeKind;
3181   (function(FoldingRangeKind2) {
3182     FoldingRangeKind2["Comment"] = "comment";
3183     FoldingRangeKind2["Imports"] = "imports";
3184     FoldingRangeKind2["Region"] = "region";
3185   })(FoldingRangeKind || (FoldingRangeKind = {}));
3186   var FoldingRange;
3187   (function(FoldingRange2) {
3188     function create(startLine, endLine, startCharacter, endCharacter, kind) {
3189       var result = {
3190         startLine,
3191         endLine
3192       };
3193       if (Is.defined(startCharacter)) {
3194         result.startCharacter = startCharacter;
3195       }
3196       if (Is.defined(endCharacter)) {
3197         result.endCharacter = endCharacter;
3198       }
3199       if (Is.defined(kind)) {
3200         result.kind = kind;
3201       }
3202       return result;
3203     }
3204     FoldingRange2.create = create;
3205     function is(value) {
3206       var candidate = value;
3207       return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
3208     }
3209     FoldingRange2.is = is;
3210   })(FoldingRange || (FoldingRange = {}));
3211   var DiagnosticRelatedInformation;
3212   (function(DiagnosticRelatedInformation2) {
3213     function create(location, message) {
3214       return {
3215         location,
3216         message
3217       };
3218     }
3219     DiagnosticRelatedInformation2.create = create;
3220     function is(value) {
3221       var candidate = value;
3222       return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
3223     }
3224     DiagnosticRelatedInformation2.is = is;
3225   })(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
3226   var DiagnosticSeverity;
3227   (function(DiagnosticSeverity2) {
3228     DiagnosticSeverity2.Error = 1;
3229     DiagnosticSeverity2.Warning = 2;
3230     DiagnosticSeverity2.Information = 3;
3231     DiagnosticSeverity2.Hint = 4;
3232   })(DiagnosticSeverity || (DiagnosticSeverity = {}));
3233   var DiagnosticTag;
3234   (function(DiagnosticTag2) {
3235     DiagnosticTag2.Unnecessary = 1;
3236     DiagnosticTag2.Deprecated = 2;
3237   })(DiagnosticTag || (DiagnosticTag = {}));
3238   var CodeDescription;
3239   (function(CodeDescription2) {
3240     function is(value) {
3241       var candidate = value;
3242       return candidate !== void 0 && candidate !== null && Is.string(candidate.href);
3243     }
3244     CodeDescription2.is = is;
3245   })(CodeDescription || (CodeDescription = {}));
3246   var Diagnostic;
3247   (function(Diagnostic2) {
3248     function create(range, message, severity, code, source, relatedInformation) {
3249       var result = {range, message};
3250       if (Is.defined(severity)) {
3251         result.severity = severity;
3252       }
3253       if (Is.defined(code)) {
3254         result.code = code;
3255       }
3256       if (Is.defined(source)) {
3257         result.source = source;
3258       }
3259       if (Is.defined(relatedInformation)) {
3260         result.relatedInformation = relatedInformation;
3261       }
3262       return result;
3263     }
3264     Diagnostic2.create = create;
3265     function is(value) {
3266       var _a;
3267       var candidate = value;
3268       return Is.defined(candidate) && Range3.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
3269     }
3270     Diagnostic2.is = is;
3271   })(Diagnostic || (Diagnostic = {}));
3272   var Command;
3273   (function(Command2) {
3274     function create(title, command) {
3275       var args = [];
3276       for (var _i = 2; _i < arguments.length; _i++) {
3277         args[_i - 2] = arguments[_i];
3278       }
3279       var result = {title, command};
3280       if (Is.defined(args) && args.length > 0) {
3281         result.arguments = args;
3282       }
3283       return result;
3284     }
3285     Command2.create = create;
3286     function is(value) {
3287       var candidate = value;
3288       return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
3289     }
3290     Command2.is = is;
3291   })(Command || (Command = {}));
3292   var TextEdit;
3293   (function(TextEdit2) {
3294     function replace(range, newText) {
3295       return {range, newText};
3296     }
3297     TextEdit2.replace = replace;
3298     function insert(position, newText) {
3299       return {range: {start: position, end: position}, newText};
3300     }
3301     TextEdit2.insert = insert;
3302     function del(range) {
3303       return {range, newText: ""};
3304     }
3305     TextEdit2.del = del;
3306     function is(value) {
3307       var candidate = value;
3308       return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range3.is(candidate.range);
3309     }
3310     TextEdit2.is = is;
3311   })(TextEdit || (TextEdit = {}));
3312   var ChangeAnnotation;
3313   (function(ChangeAnnotation2) {
3314     function create(label, needsConfirmation, description) {
3315       var result = {label};
3316       if (needsConfirmation !== void 0) {
3317         result.needsConfirmation = needsConfirmation;
3318       }
3319       if (description !== void 0) {
3320         result.description = description;
3321       }
3322       return result;
3323     }
3324     ChangeAnnotation2.create = create;
3325     function is(value) {
3326       var candidate = value;
3327       return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
3328     }
3329     ChangeAnnotation2.is = is;
3330   })(ChangeAnnotation || (ChangeAnnotation = {}));
3331   var ChangeAnnotationIdentifier;
3332   (function(ChangeAnnotationIdentifier2) {
3333     function is(value) {
3334       var candidate = value;
3335       return typeof candidate === "string";
3336     }
3337     ChangeAnnotationIdentifier2.is = is;
3338   })(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
3339   var AnnotatedTextEdit;
3340   (function(AnnotatedTextEdit2) {
3341     function replace(range, newText, annotation) {
3342       return {range, newText, annotationId: annotation};
3343     }
3344     AnnotatedTextEdit2.replace = replace;
3345     function insert(position, newText, annotation) {
3346       return {range: {start: position, end: position}, newText, annotationId: annotation};
3347     }
3348     AnnotatedTextEdit2.insert = insert;
3349     function del(range, annotation) {
3350       return {range, newText: "", annotationId: annotation};
3351     }
3352     AnnotatedTextEdit2.del = del;
3353     function is(value) {
3354       var candidate = value;
3355       return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
3356     }
3357     AnnotatedTextEdit2.is = is;
3358   })(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
3359   var TextDocumentEdit;
3360   (function(TextDocumentEdit2) {
3361     function create(textDocument, edits) {
3362       return {textDocument, edits};
3363     }
3364     TextDocumentEdit2.create = create;
3365     function is(value) {
3366       var candidate = value;
3367       return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
3368     }
3369     TextDocumentEdit2.is = is;
3370   })(TextDocumentEdit || (TextDocumentEdit = {}));
3371   var CreateFile;
3372   (function(CreateFile2) {
3373     function create(uri, options, annotation) {
3374       var result = {
3375         kind: "create",
3376         uri
3377       };
3378       if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
3379         result.options = options;
3380       }
3381       if (annotation !== void 0) {
3382         result.annotationId = annotation;
3383       }
3384       return result;
3385     }
3386     CreateFile2.create = create;
3387     function is(value) {
3388       var candidate = value;
3389       return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
3390     }
3391     CreateFile2.is = is;
3392   })(CreateFile || (CreateFile = {}));
3393   var RenameFile;
3394   (function(RenameFile2) {
3395     function create(oldUri, newUri, options, annotation) {
3396       var result = {
3397         kind: "rename",
3398         oldUri,
3399         newUri
3400       };
3401       if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
3402         result.options = options;
3403       }
3404       if (annotation !== void 0) {
3405         result.annotationId = annotation;
3406       }
3407       return result;
3408     }
3409     RenameFile2.create = create;
3410     function is(value) {
3411       var candidate = value;
3412       return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
3413     }
3414     RenameFile2.is = is;
3415   })(RenameFile || (RenameFile = {}));
3416   var DeleteFile;
3417   (function(DeleteFile2) {
3418     function create(uri, options, annotation) {
3419       var result = {
3420         kind: "delete",
3421         uri
3422       };
3423       if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
3424         result.options = options;
3425       }
3426       if (annotation !== void 0) {
3427         result.annotationId = annotation;
3428       }
3429       return result;
3430     }
3431     DeleteFile2.create = create;
3432     function is(value) {
3433       var candidate = value;
3434       return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
3435     }
3436     DeleteFile2.is = is;
3437   })(DeleteFile || (DeleteFile = {}));
3438   var WorkspaceEdit;
3439   (function(WorkspaceEdit2) {
3440     function is(value) {
3441       var candidate = value;
3442       return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
3443         if (Is.string(change.kind)) {
3444           return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
3445         } else {
3446           return TextDocumentEdit.is(change);
3447         }
3448       }));
3449     }
3450     WorkspaceEdit2.is = is;
3451   })(WorkspaceEdit || (WorkspaceEdit = {}));
3452   var TextEditChangeImpl = function() {
3453     function TextEditChangeImpl2(edits, changeAnnotations) {
3454       this.edits = edits;
3455       this.changeAnnotations = changeAnnotations;
3456     }
3457     TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {
3458       var edit;
3459       var id;
3460       if (annotation === void 0) {
3461         edit = TextEdit.insert(position, newText);
3462       } else if (ChangeAnnotationIdentifier.is(annotation)) {
3463         id = annotation;
3464         edit = AnnotatedTextEdit.insert(position, newText, annotation);
3465       } else {
3466         this.assertChangeAnnotations(this.changeAnnotations);
3467         id = this.changeAnnotations.manage(annotation);
3468         edit = AnnotatedTextEdit.insert(position, newText, id);
3469       }
3470       this.edits.push(edit);
3471       if (id !== void 0) {
3472         return id;
3473       }
3474     };
3475     TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {
3476       var edit;
3477       var id;
3478       if (annotation === void 0) {
3479         edit = TextEdit.replace(range, newText);
3480       } else if (ChangeAnnotationIdentifier.is(annotation)) {
3481         id = annotation;
3482         edit = AnnotatedTextEdit.replace(range, newText, annotation);
3483       } else {
3484         this.assertChangeAnnotations(this.changeAnnotations);
3485         id = this.changeAnnotations.manage(annotation);
3486         edit = AnnotatedTextEdit.replace(range, newText, id);
3487       }
3488       this.edits.push(edit);
3489       if (id !== void 0) {
3490         return id;
3491       }
3492     };
3493     TextEditChangeImpl2.prototype.delete = function(range, annotation) {
3494       var edit;
3495       var id;
3496       if (annotation === void 0) {
3497         edit = TextEdit.del(range);
3498       } else if (ChangeAnnotationIdentifier.is(annotation)) {
3499         id = annotation;
3500         edit = AnnotatedTextEdit.del(range, annotation);
3501       } else {
3502         this.assertChangeAnnotations(this.changeAnnotations);
3503         id = this.changeAnnotations.manage(annotation);
3504         edit = AnnotatedTextEdit.del(range, id);
3505       }
3506       this.edits.push(edit);
3507       if (id !== void 0) {
3508         return id;
3509       }
3510     };
3511     TextEditChangeImpl2.prototype.add = function(edit) {
3512       this.edits.push(edit);
3513     };
3514     TextEditChangeImpl2.prototype.all = function() {
3515       return this.edits;
3516     };
3517     TextEditChangeImpl2.prototype.clear = function() {
3518       this.edits.splice(0, this.edits.length);
3519     };
3520     TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {
3521       if (value === void 0) {
3522         throw new Error("Text edit change is not configured to manage change annotations.");
3523       }
3524     };
3525     return TextEditChangeImpl2;
3526   }();
3527   var ChangeAnnotations = function() {
3528     function ChangeAnnotations2(annotations) {
3529       this._annotations = annotations === void 0 ? Object.create(null) : annotations;
3530       this._counter = 0;
3531       this._size = 0;
3532     }
3533     ChangeAnnotations2.prototype.all = function() {
3534       return this._annotations;
3535     };
3536     Object.defineProperty(ChangeAnnotations2.prototype, "size", {
3537       get: function() {
3538         return this._size;
3539       },
3540       enumerable: false,
3541       configurable: true
3542     });
3543     ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {
3544       var id;
3545       if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
3546         id = idOrAnnotation;
3547       } else {
3548         id = this.nextId();
3549         annotation = idOrAnnotation;
3550       }
3551       if (this._annotations[id] !== void 0) {
3552         throw new Error("Id " + id + " is already in use.");
3553       }
3554       if (annotation === void 0) {
3555         throw new Error("No annotation provided for id " + id);
3556       }
3557       this._annotations[id] = annotation;
3558       this._size++;
3559       return id;
3560     };
3561     ChangeAnnotations2.prototype.nextId = function() {
3562       this._counter++;
3563       return this._counter.toString();
3564     };
3565     return ChangeAnnotations2;
3566   }();
3567   var WorkspaceChange = function() {
3568     function WorkspaceChange2(workspaceEdit) {
3569       var _this = this;
3570       this._textEditChanges = Object.create(null);
3571       if (workspaceEdit !== void 0) {
3572         this._workspaceEdit = workspaceEdit;
3573         if (workspaceEdit.documentChanges) {
3574           this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
3575           workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3576           workspaceEdit.documentChanges.forEach(function(change) {
3577             if (TextDocumentEdit.is(change)) {
3578               var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
3579               _this._textEditChanges[change.textDocument.uri] = textEditChange;
3580             }
3581           });
3582         } else if (workspaceEdit.changes) {
3583           Object.keys(workspaceEdit.changes).forEach(function(key) {
3584             var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
3585             _this._textEditChanges[key] = textEditChange;
3586           });
3587         }
3588       } else {
3589         this._workspaceEdit = {};
3590       }
3591     }
3592     Object.defineProperty(WorkspaceChange2.prototype, "edit", {
3593       get: function() {
3594         this.initDocumentChanges();
3595         if (this._changeAnnotations !== void 0) {
3596           if (this._changeAnnotations.size === 0) {
3597             this._workspaceEdit.changeAnnotations = void 0;
3598           } else {
3599             this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3600           }
3601         }
3602         return this._workspaceEdit;
3603       },
3604       enumerable: false,
3605       configurable: true
3606     });
3607     WorkspaceChange2.prototype.getTextEditChange = function(key) {
3608       if (OptionalVersionedTextDocumentIdentifier.is(key)) {
3609         this.initDocumentChanges();
3610         if (this._workspaceEdit.documentChanges === void 0) {
3611           throw new Error("Workspace edit is not configured for document changes.");
3612         }
3613         var textDocument = {uri: key.uri, version: key.version};
3614         var result = this._textEditChanges[textDocument.uri];
3615         if (!result) {
3616           var edits = [];
3617           var textDocumentEdit = {
3618             textDocument,
3619             edits
3620           };
3621           this._workspaceEdit.documentChanges.push(textDocumentEdit);
3622           result = new TextEditChangeImpl(edits, this._changeAnnotations);
3623           this._textEditChanges[textDocument.uri] = result;
3624         }
3625         return result;
3626       } else {
3627         this.initChanges();
3628         if (this._workspaceEdit.changes === void 0) {
3629           throw new Error("Workspace edit is not configured for normal text edit changes.");
3630         }
3631         var result = this._textEditChanges[key];
3632         if (!result) {
3633           var edits = [];
3634           this._workspaceEdit.changes[key] = edits;
3635           result = new TextEditChangeImpl(edits);
3636           this._textEditChanges[key] = result;
3637         }
3638         return result;
3639       }
3640     };
3641     WorkspaceChange2.prototype.initDocumentChanges = function() {
3642       if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
3643         this._changeAnnotations = new ChangeAnnotations();
3644         this._workspaceEdit.documentChanges = [];
3645         this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
3646       }
3647     };
3648     WorkspaceChange2.prototype.initChanges = function() {
3649       if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
3650         this._workspaceEdit.changes = Object.create(null);
3651       }
3652     };
3653     WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {
3654       this.initDocumentChanges();
3655       if (this._workspaceEdit.documentChanges === void 0) {
3656         throw new Error("Workspace edit is not configured for document changes.");
3657       }
3658       var annotation;
3659       if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3660         annotation = optionsOrAnnotation;
3661       } else {
3662         options = optionsOrAnnotation;
3663       }
3664       var operation;
3665       var id;
3666       if (annotation === void 0) {
3667         operation = CreateFile.create(uri, options);
3668       } else {
3669         id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3670         operation = CreateFile.create(uri, options, id);
3671       }
3672       this._workspaceEdit.documentChanges.push(operation);
3673       if (id !== void 0) {
3674         return id;
3675       }
3676     };
3677     WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {
3678       this.initDocumentChanges();
3679       if (this._workspaceEdit.documentChanges === void 0) {
3680         throw new Error("Workspace edit is not configured for document changes.");
3681       }
3682       var annotation;
3683       if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3684         annotation = optionsOrAnnotation;
3685       } else {
3686         options = optionsOrAnnotation;
3687       }
3688       var operation;
3689       var id;
3690       if (annotation === void 0) {
3691         operation = RenameFile.create(oldUri, newUri, options);
3692       } else {
3693         id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3694         operation = RenameFile.create(oldUri, newUri, options, id);
3695       }
3696       this._workspaceEdit.documentChanges.push(operation);
3697       if (id !== void 0) {
3698         return id;
3699       }
3700     };
3701     WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {
3702       this.initDocumentChanges();
3703       if (this._workspaceEdit.documentChanges === void 0) {
3704         throw new Error("Workspace edit is not configured for document changes.");
3705       }
3706       var annotation;
3707       if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
3708         annotation = optionsOrAnnotation;
3709       } else {
3710         options = optionsOrAnnotation;
3711       }
3712       var operation;
3713       var id;
3714       if (annotation === void 0) {
3715         operation = DeleteFile.create(uri, options);
3716       } else {
3717         id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
3718         operation = DeleteFile.create(uri, options, id);
3719       }
3720       this._workspaceEdit.documentChanges.push(operation);
3721       if (id !== void 0) {
3722         return id;
3723       }
3724     };
3725     return WorkspaceChange2;
3726   }();
3727   var TextDocumentIdentifier2;
3728   (function(TextDocumentIdentifier3) {
3729     function create(uri) {
3730       return {uri};
3731     }
3732     TextDocumentIdentifier3.create = create;
3733     function is(value) {
3734       var candidate = value;
3735       return Is.defined(candidate) && Is.string(candidate.uri);
3736     }
3737     TextDocumentIdentifier3.is = is;
3738   })(TextDocumentIdentifier2 || (TextDocumentIdentifier2 = {}));
3739   var VersionedTextDocumentIdentifier2;
3740   (function(VersionedTextDocumentIdentifier3) {
3741     function create(uri, version) {
3742       return {uri, version};
3743     }
3744     VersionedTextDocumentIdentifier3.create = create;
3745     function is(value) {
3746       var candidate = value;
3747       return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
3748     }
3749     VersionedTextDocumentIdentifier3.is = is;
3750   })(VersionedTextDocumentIdentifier2 || (VersionedTextDocumentIdentifier2 = {}));
3751   var OptionalVersionedTextDocumentIdentifier;
3752   (function(OptionalVersionedTextDocumentIdentifier2) {
3753     function create(uri, version) {
3754       return {uri, version};
3755     }
3756     OptionalVersionedTextDocumentIdentifier2.create = create;
3757     function is(value) {
3758       var candidate = value;
3759       return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
3760     }
3761     OptionalVersionedTextDocumentIdentifier2.is = is;
3762   })(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
3763   var TextDocumentItem;
3764   (function(TextDocumentItem2) {
3765     function create(uri, languageId, version, text) {
3766       return {uri, languageId, version, text};
3767     }
3768     TextDocumentItem2.create = create;
3769     function is(value) {
3770       var candidate = value;
3771       return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
3772     }
3773     TextDocumentItem2.is = is;
3774   })(TextDocumentItem || (TextDocumentItem = {}));
3775   var MarkupKind;
3776   (function(MarkupKind2) {
3777     MarkupKind2.PlainText = "plaintext";
3778     MarkupKind2.Markdown = "markdown";
3779   })(MarkupKind || (MarkupKind = {}));
3780   (function(MarkupKind2) {
3781     function is(value) {
3782       var candidate = value;
3783       return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
3784     }
3785     MarkupKind2.is = is;
3786   })(MarkupKind || (MarkupKind = {}));
3787   var MarkupContent;
3788   (function(MarkupContent2) {
3789     function is(value) {
3790       var candidate = value;
3791       return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
3792     }
3793     MarkupContent2.is = is;
3794   })(MarkupContent || (MarkupContent = {}));
3795   var CompletionItemKind;
3796   (function(CompletionItemKind2) {
3797     CompletionItemKind2.Text = 1;
3798     CompletionItemKind2.Method = 2;
3799     CompletionItemKind2.Function = 3;
3800     CompletionItemKind2.Constructor = 4;
3801     CompletionItemKind2.Field = 5;
3802     CompletionItemKind2.Variable = 6;
3803     CompletionItemKind2.Class = 7;
3804     CompletionItemKind2.Interface = 8;
3805     CompletionItemKind2.Module = 9;
3806     CompletionItemKind2.Property = 10;
3807     CompletionItemKind2.Unit = 11;
3808     CompletionItemKind2.Value = 12;
3809     CompletionItemKind2.Enum = 13;
3810     CompletionItemKind2.Keyword = 14;
3811     CompletionItemKind2.Snippet = 15;
3812     CompletionItemKind2.Color = 16;
3813     CompletionItemKind2.File = 17;
3814     CompletionItemKind2.Reference = 18;
3815     CompletionItemKind2.Folder = 19;
3816     CompletionItemKind2.EnumMember = 20;
3817     CompletionItemKind2.Constant = 21;
3818     CompletionItemKind2.Struct = 22;
3819     CompletionItemKind2.Event = 23;
3820     CompletionItemKind2.Operator = 24;
3821     CompletionItemKind2.TypeParameter = 25;
3822   })(CompletionItemKind || (CompletionItemKind = {}));
3823   var InsertTextFormat;
3824   (function(InsertTextFormat2) {
3825     InsertTextFormat2.PlainText = 1;
3826     InsertTextFormat2.Snippet = 2;
3827   })(InsertTextFormat || (InsertTextFormat = {}));
3828   var CompletionItemTag;
3829   (function(CompletionItemTag2) {
3830     CompletionItemTag2.Deprecated = 1;
3831   })(CompletionItemTag || (CompletionItemTag = {}));
3832   var InsertReplaceEdit;
3833   (function(InsertReplaceEdit2) {
3834     function create(newText, insert, replace) {
3835       return {newText, insert, replace};
3836     }
3837     InsertReplaceEdit2.create = create;
3838     function is(value) {
3839       var candidate = value;
3840       return candidate && Is.string(candidate.newText) && Range3.is(candidate.insert) && Range3.is(candidate.replace);
3841     }
3842     InsertReplaceEdit2.is = is;
3843   })(InsertReplaceEdit || (InsertReplaceEdit = {}));
3844   var InsertTextMode;
3845   (function(InsertTextMode2) {
3846     InsertTextMode2.asIs = 1;
3847     InsertTextMode2.adjustIndentation = 2;
3848   })(InsertTextMode || (InsertTextMode = {}));
3849   var CompletionItem;
3850   (function(CompletionItem2) {
3851     function create(label) {
3852       return {label};
3853     }
3854     CompletionItem2.create = create;
3855   })(CompletionItem || (CompletionItem = {}));
3856   var CompletionList;
3857   (function(CompletionList2) {
3858     function create(items, isIncomplete) {
3859       return {items: items ? items : [], isIncomplete: !!isIncomplete};
3860     }
3861     CompletionList2.create = create;
3862   })(CompletionList || (CompletionList = {}));
3863   var MarkedString;
3864   (function(MarkedString2) {
3865     function fromPlainText(plainText) {
3866       return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
3867     }
3868     MarkedString2.fromPlainText = fromPlainText;
3869     function is(value) {
3870       var candidate = value;
3871       return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
3872     }
3873     MarkedString2.is = is;
3874   })(MarkedString || (MarkedString = {}));
3875   var Hover;
3876   (function(Hover2) {
3877     function is(value) {
3878       var candidate = value;
3879       return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range3.is(value.range));
3880     }
3881     Hover2.is = is;
3882   })(Hover || (Hover = {}));
3883   var ParameterInformation;
3884   (function(ParameterInformation2) {
3885     function create(label, documentation) {
3886       return documentation ? {label, documentation} : {label};
3887     }
3888     ParameterInformation2.create = create;
3889   })(ParameterInformation || (ParameterInformation = {}));
3890   var SignatureInformation;
3891   (function(SignatureInformation2) {
3892     function create(label, documentation) {
3893       var parameters = [];
3894       for (var _i = 2; _i < arguments.length; _i++) {
3895         parameters[_i - 2] = arguments[_i];
3896       }
3897       var result = {label};
3898       if (Is.defined(documentation)) {
3899         result.documentation = documentation;
3900       }
3901       if (Is.defined(parameters)) {
3902         result.parameters = parameters;
3903       } else {
3904         result.parameters = [];
3905       }
3906       return result;
3907     }
3908     SignatureInformation2.create = create;
3909   })(SignatureInformation || (SignatureInformation = {}));
3910   var DocumentHighlightKind;
3911   (function(DocumentHighlightKind2) {
3912     DocumentHighlightKind2.Text = 1;
3913     DocumentHighlightKind2.Read = 2;
3914     DocumentHighlightKind2.Write = 3;
3915   })(DocumentHighlightKind || (DocumentHighlightKind = {}));
3916   var DocumentHighlight;
3917   (function(DocumentHighlight2) {
3918     function create(range, kind) {
3919       var result = {range};
3920       if (Is.number(kind)) {
3921         result.kind = kind;
3922       }
3923       return result;
3924     }
3925     DocumentHighlight2.create = create;
3926   })(DocumentHighlight || (DocumentHighlight = {}));
3927   var SymbolKind;
3928   (function(SymbolKind2) {
3929     SymbolKind2.File = 1;
3930     SymbolKind2.Module = 2;
3931     SymbolKind2.Namespace = 3;
3932     SymbolKind2.Package = 4;
3933     SymbolKind2.Class = 5;
3934     SymbolKind2.Method = 6;
3935     SymbolKind2.Property = 7;
3936     SymbolKind2.Field = 8;
3937     SymbolKind2.Constructor = 9;
3938     SymbolKind2.Enum = 10;
3939     SymbolKind2.Interface = 11;
3940     SymbolKind2.Function = 12;
3941     SymbolKind2.Variable = 13;
3942     SymbolKind2.Constant = 14;
3943     SymbolKind2.String = 15;
3944     SymbolKind2.Number = 16;
3945     SymbolKind2.Boolean = 17;
3946     SymbolKind2.Array = 18;
3947     SymbolKind2.Object = 19;
3948     SymbolKind2.Key = 20;
3949     SymbolKind2.Null = 21;
3950     SymbolKind2.EnumMember = 22;
3951     SymbolKind2.Struct = 23;
3952     SymbolKind2.Event = 24;
3953     SymbolKind2.Operator = 25;
3954     SymbolKind2.TypeParameter = 26;
3955   })(SymbolKind || (SymbolKind = {}));
3956   var SymbolTag;
3957   (function(SymbolTag2) {
3958     SymbolTag2.Deprecated = 1;
3959   })(SymbolTag || (SymbolTag = {}));
3960   var SymbolInformation;
3961   (function(SymbolInformation2) {
3962     function create(name, kind, range, uri, containerName) {
3963       var result = {
3964         name,
3965         kind,
3966         location: {uri, range}
3967       };
3968       if (containerName) {
3969         result.containerName = containerName;
3970       }
3971       return result;
3972     }
3973     SymbolInformation2.create = create;
3974   })(SymbolInformation || (SymbolInformation = {}));
3975   var DocumentSymbol;
3976   (function(DocumentSymbol2) {
3977     function create(name, detail, kind, range, selectionRange, children) {
3978       var result = {
3979         name,
3980         detail,
3981         kind,
3982         range,
3983         selectionRange
3984       };
3985       if (children !== void 0) {
3986         result.children = children;
3987       }
3988       return result;
3989     }
3990     DocumentSymbol2.create = create;
3991     function is(value) {
3992       var candidate = value;
3993       return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range3.is(candidate.range) && Range3.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
3994     }
3995     DocumentSymbol2.is = is;
3996   })(DocumentSymbol || (DocumentSymbol = {}));
3997   var CodeActionKind;
3998   (function(CodeActionKind2) {
3999     CodeActionKind2.Empty = "";
4000     CodeActionKind2.QuickFix = "quickfix";
4001     CodeActionKind2.Refactor = "refactor";
4002     CodeActionKind2.RefactorExtract = "refactor.extract";
4003     CodeActionKind2.RefactorInline = "refactor.inline";
4004     CodeActionKind2.RefactorRewrite = "refactor.rewrite";
4005     CodeActionKind2.Source = "source";
4006     CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
4007     CodeActionKind2.SourceFixAll = "source.fixAll";
4008   })(CodeActionKind || (CodeActionKind = {}));
4009   var CodeActionContext;
4010   (function(CodeActionContext2) {
4011     function create(diagnostics, only) {
4012       var result = {diagnostics};
4013       if (only !== void 0 && only !== null) {
4014         result.only = only;
4015       }
4016       return result;
4017     }
4018     CodeActionContext2.create = create;
4019     function is(value) {
4020       var candidate = value;
4021       return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));
4022     }
4023     CodeActionContext2.is = is;
4024   })(CodeActionContext || (CodeActionContext = {}));
4025   var CodeAction;
4026   (function(CodeAction2) {
4027     function create(title, kindOrCommandOrEdit, kind) {
4028       var result = {title};
4029       var checkKind = true;
4030       if (typeof kindOrCommandOrEdit === "string") {
4031         checkKind = false;
4032         result.kind = kindOrCommandOrEdit;
4033       } else if (Command.is(kindOrCommandOrEdit)) {
4034         result.command = kindOrCommandOrEdit;
4035       } else {
4036         result.edit = kindOrCommandOrEdit;
4037       }
4038       if (checkKind && kind !== void 0) {
4039         result.kind = kind;
4040       }
4041       return result;
4042     }
4043     CodeAction2.create = create;
4044     function is(value) {
4045       var candidate = value;
4046       return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
4047     }
4048     CodeAction2.is = is;
4049   })(CodeAction || (CodeAction = {}));
4050   var CodeLens;
4051   (function(CodeLens2) {
4052     function create(range, data) {
4053       var result = {range};
4054       if (Is.defined(data)) {
4055         result.data = data;
4056       }
4057       return result;
4058     }
4059     CodeLens2.create = create;
4060     function is(value) {
4061       var candidate = value;
4062       return Is.defined(candidate) && Range3.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
4063     }
4064     CodeLens2.is = is;
4065   })(CodeLens || (CodeLens = {}));
4066   var FormattingOptions;
4067   (function(FormattingOptions2) {
4068     function create(tabSize, insertSpaces) {
4069       return {tabSize, insertSpaces};
4070     }
4071     FormattingOptions2.create = create;
4072     function is(value) {
4073       var candidate = value;
4074       return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
4075     }
4076     FormattingOptions2.is = is;
4077   })(FormattingOptions || (FormattingOptions = {}));
4078   var DocumentLink;
4079   (function(DocumentLink2) {
4080     function create(range, target, data) {
4081       return {range, target, data};
4082     }
4083     DocumentLink2.create = create;
4084     function is(value) {
4085       var candidate = value;
4086       return Is.defined(candidate) && Range3.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
4087     }
4088     DocumentLink2.is = is;
4089   })(DocumentLink || (DocumentLink = {}));
4090   var SelectionRange;
4091   (function(SelectionRange2) {
4092     function create(range, parent) {
4093       return {range, parent};
4094     }
4095     SelectionRange2.create = create;
4096     function is(value) {
4097       var candidate = value;
4098       return candidate !== void 0 && Range3.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
4099     }
4100     SelectionRange2.is = is;
4101   })(SelectionRange || (SelectionRange = {}));
4102   var EOL = ["\n", "\r\n", "\r"];
4103   var TextDocument;
4104   (function(TextDocument2) {
4105     function create(uri, languageId, version, content) {
4106       return new FullTextDocument(uri, languageId, version, content);
4107     }
4108     TextDocument2.create = create;
4109     function is(value) {
4110       var candidate = value;
4111       return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
4112     }
4113     TextDocument2.is = is;
4114     function applyEdits(document2, edits) {
4115       var text = document2.getText();
4116       var sortedEdits = mergeSort(edits, function(a, b) {
4117         var diff = a.range.start.line - b.range.start.line;
4118         if (diff === 0) {
4119           return a.range.start.character - b.range.start.character;
4120         }
4121         return diff;
4122       });
4123       var lastModifiedOffset = text.length;
4124       for (var i = sortedEdits.length - 1; i >= 0; i--) {
4125         var e = sortedEdits[i];
4126         var startOffset = document2.offsetAt(e.range.start);
4127         var endOffset = document2.offsetAt(e.range.end);
4128         if (endOffset <= lastModifiedOffset) {
4129           text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
4130         } else {
4131           throw new Error("Overlapping edit");
4132         }
4133         lastModifiedOffset = startOffset;
4134       }
4135       return text;
4136     }
4137     TextDocument2.applyEdits = applyEdits;
4138     function mergeSort(data, compare) {
4139       if (data.length <= 1) {
4140         return data;
4141       }
4142       var p = data.length / 2 | 0;
4143       var left = data.slice(0, p);
4144       var right = data.slice(p);
4145       mergeSort(left, compare);
4146       mergeSort(right, compare);
4147       var leftIdx = 0;
4148       var rightIdx = 0;
4149       var i = 0;
4150       while (leftIdx < left.length && rightIdx < right.length) {
4151         var ret2 = compare(left[leftIdx], right[rightIdx]);
4152         if (ret2 <= 0) {
4153           data[i++] = left[leftIdx++];
4154         } else {
4155           data[i++] = right[rightIdx++];
4156         }
4157       }
4158       while (leftIdx < left.length) {
4159         data[i++] = left[leftIdx++];
4160       }
4161       while (rightIdx < right.length) {
4162         data[i++] = right[rightIdx++];
4163       }
4164       return data;
4165     }
4166   })(TextDocument || (TextDocument = {}));
4167   var FullTextDocument = function() {
4168     function FullTextDocument2(uri, languageId, version, content) {
4169       this._uri = uri;
4170       this._languageId = languageId;
4171       this._version = version;
4172       this._content = content;
4173       this._lineOffsets = void 0;
4174     }
4175     Object.defineProperty(FullTextDocument2.prototype, "uri", {
4176       get: function() {
4177         return this._uri;
4178       },
4179       enumerable: false,
4180       configurable: true
4181     });
4182     Object.defineProperty(FullTextDocument2.prototype, "languageId", {
4183       get: function() {
4184         return this._languageId;
4185       },
4186       enumerable: false,
4187       configurable: true
4188     });
4189     Object.defineProperty(FullTextDocument2.prototype, "version", {
4190       get: function() {
4191         return this._version;
4192       },
4193       enumerable: false,
4194       configurable: true
4195     });
4196     FullTextDocument2.prototype.getText = function(range) {
4197       if (range) {
4198         var start = this.offsetAt(range.start);
4199         var end = this.offsetAt(range.end);
4200         return this._content.substring(start, end);
4201       }
4202       return this._content;
4203     };
4204     FullTextDocument2.prototype.update = function(event, version) {
4205       this._content = event.text;
4206       this._version = version;
4207       this._lineOffsets = void 0;
4208     };
4209     FullTextDocument2.prototype.getLineOffsets = function() {
4210       if (this._lineOffsets === void 0) {
4211         var lineOffsets = [];
4212         var text = this._content;
4213         var isLineStart = true;
4214         for (var i = 0; i < text.length; i++) {
4215           if (isLineStart) {
4216             lineOffsets.push(i);
4217             isLineStart = false;
4218           }
4219           var ch = text.charAt(i);
4220           isLineStart = ch === "\r" || ch === "\n";
4221           if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
4222             i++;
4223           }
4224         }
4225         if (isLineStart && text.length > 0) {
4226           lineOffsets.push(text.length);
4227         }
4228         this._lineOffsets = lineOffsets;
4229       }
4230       return this._lineOffsets;
4231     };
4232     FullTextDocument2.prototype.positionAt = function(offset) {
4233       offset = Math.max(Math.min(offset, this._content.length), 0);
4234       var lineOffsets = this.getLineOffsets();
4235       var low = 0, high = lineOffsets.length;
4236       if (high === 0) {
4237         return Position.create(0, offset);
4238       }
4239       while (low < high) {
4240         var mid = Math.floor((low + high) / 2);
4241         if (lineOffsets[mid] > offset) {
4242           high = mid;
4243         } else {
4244           low = mid + 1;
4245         }
4246       }
4247       var line = low - 1;
4248       return Position.create(line, offset - lineOffsets[line]);
4249     };
4250     FullTextDocument2.prototype.offsetAt = function(position) {
4251       var lineOffsets = this.getLineOffsets();
4252       if (position.line >= lineOffsets.length) {
4253         return this._content.length;
4254       } else if (position.line < 0) {
4255         return 0;
4256       }
4257       var lineOffset = lineOffsets[position.line];
4258       var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
4259       return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
4260     };
4261     Object.defineProperty(FullTextDocument2.prototype, "lineCount", {
4262       get: function() {
4263         return this.getLineOffsets().length;
4264       },
4265       enumerable: false,
4266       configurable: true
4267     });
4268     return FullTextDocument2;
4269   }();
4270   var Is;
4271   (function(Is2) {
4272     var toString = Object.prototype.toString;
4273     function defined(value) {
4274       return typeof value !== "undefined";
4275     }
4276     Is2.defined = defined;
4277     function undefined2(value) {
4278       return typeof value === "undefined";
4279     }
4280     Is2.undefined = undefined2;
4281     function boolean(value) {
4282       return value === true || value === false;
4283     }
4284     Is2.boolean = boolean;
4285     function string(value) {
4286       return toString.call(value) === "[object String]";
4287     }
4288     Is2.string = string;
4289     function number(value) {
4290       return toString.call(value) === "[object Number]";
4291     }
4292     Is2.number = number;
4293     function numberRange(value, min, max) {
4294       return toString.call(value) === "[object Number]" && min <= value && value <= max;
4295     }
4296     Is2.numberRange = numberRange;
4297     function integer2(value) {
4298       return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
4299     }
4300     Is2.integer = integer2;
4301     function uinteger2(value) {
4302       return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
4303     }
4304     Is2.uinteger = uinteger2;
4305     function func(value) {
4306       return toString.call(value) === "[object Function]";
4307     }
4308     Is2.func = func;
4309     function objectLiteral(value) {
4310       return value !== null && typeof value === "object";
4311     }
4312     Is2.objectLiteral = objectLiteral;
4313     function typedArray(value, check) {
4314       return Array.isArray(value) && value.every(check);
4315     }
4316     Is2.typedArray = typedArray;
4317   })(Is || (Is = {}));
4318 });
4319
4320 // node_modules/vscode-languageserver-protocol/lib/common/messages.js
4321 var require_messages2 = __commonJS((exports2) => {
4322   "use strict";
4323   Object.defineProperty(exports2, "__esModule", {value: true});
4324   exports2.ProtocolNotificationType = exports2.ProtocolNotificationType0 = exports2.ProtocolRequestType = exports2.ProtocolRequestType0 = exports2.RegistrationType = void 0;
4325   var vscode_jsonrpc_1 = require_main();
4326   var RegistrationType = class {
4327     constructor(method) {
4328       this.method = method;
4329     }
4330   };
4331   exports2.RegistrationType = RegistrationType;
4332   var ProtocolRequestType0 = class extends vscode_jsonrpc_1.RequestType0 {
4333     constructor(method) {
4334       super(method);
4335     }
4336   };
4337   exports2.ProtocolRequestType0 = ProtocolRequestType0;
4338   var ProtocolRequestType = class extends vscode_jsonrpc_1.RequestType {
4339     constructor(method) {
4340       super(method, vscode_jsonrpc_1.ParameterStructures.byName);
4341     }
4342   };
4343   exports2.ProtocolRequestType = ProtocolRequestType;
4344   var ProtocolNotificationType0 = class extends vscode_jsonrpc_1.NotificationType0 {
4345     constructor(method) {
4346       super(method);
4347     }
4348   };
4349   exports2.ProtocolNotificationType0 = ProtocolNotificationType0;
4350   var ProtocolNotificationType = class extends vscode_jsonrpc_1.NotificationType {
4351     constructor(method) {
4352       super(method, vscode_jsonrpc_1.ParameterStructures.byName);
4353     }
4354   };
4355   exports2.ProtocolNotificationType = ProtocolNotificationType;
4356 });
4357
4358 // node_modules/vscode-languageserver-protocol/lib/common/utils/is.js
4359 var require_is2 = __commonJS((exports2) => {
4360   "use strict";
4361   Object.defineProperty(exports2, "__esModule", {value: true});
4362   exports2.objectLiteral = exports2.typedArray = exports2.stringArray = exports2.array = exports2.func = exports2.error = exports2.number = exports2.string = exports2.boolean = void 0;
4363   function boolean(value) {
4364     return value === true || value === false;
4365   }
4366   exports2.boolean = boolean;
4367   function string(value) {
4368     return typeof value === "string" || value instanceof String;
4369   }
4370   exports2.string = string;
4371   function number(value) {
4372     return typeof value === "number" || value instanceof Number;
4373   }
4374   exports2.number = number;
4375   function error(value) {
4376     return value instanceof Error;
4377   }
4378   exports2.error = error;
4379   function func(value) {
4380     return typeof value === "function";
4381   }
4382   exports2.func = func;
4383   function array(value) {
4384     return Array.isArray(value);
4385   }
4386   exports2.array = array;
4387   function stringArray(value) {
4388     return array(value) && value.every((elem) => string(elem));
4389   }
4390   exports2.stringArray = stringArray;
4391   function typedArray(value, check) {
4392     return Array.isArray(value) && value.every(check);
4393   }
4394   exports2.typedArray = typedArray;
4395   function objectLiteral(value) {
4396     return value !== null && typeof value === "object";
4397   }
4398   exports2.objectLiteral = objectLiteral;
4399 });
4400
4401 // node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js
4402 var require_protocol_implementation = __commonJS((exports2) => {
4403   "use strict";
4404   Object.defineProperty(exports2, "__esModule", {value: true});
4405   exports2.ImplementationRequest = void 0;
4406   var messages_1 = require_messages2();
4407   var ImplementationRequest;
4408   (function(ImplementationRequest2) {
4409     ImplementationRequest2.method = "textDocument/implementation";
4410     ImplementationRequest2.type = new messages_1.ProtocolRequestType(ImplementationRequest2.method);
4411   })(ImplementationRequest = exports2.ImplementationRequest || (exports2.ImplementationRequest = {}));
4412 });
4413
4414 // node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js
4415 var require_protocol_typeDefinition = __commonJS((exports2) => {
4416   "use strict";
4417   Object.defineProperty(exports2, "__esModule", {value: true});
4418   exports2.TypeDefinitionRequest = void 0;
4419   var messages_1 = require_messages2();
4420   var TypeDefinitionRequest;
4421   (function(TypeDefinitionRequest2) {
4422     TypeDefinitionRequest2.method = "textDocument/typeDefinition";
4423     TypeDefinitionRequest2.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest2.method);
4424   })(TypeDefinitionRequest = exports2.TypeDefinitionRequest || (exports2.TypeDefinitionRequest = {}));
4425 });
4426
4427 // node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolders.js
4428 var require_protocol_workspaceFolders = __commonJS((exports2) => {
4429   "use strict";
4430   Object.defineProperty(exports2, "__esModule", {value: true});
4431   exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = void 0;
4432   var messages_1 = require_messages2();
4433   var WorkspaceFoldersRequest;
4434   (function(WorkspaceFoldersRequest2) {
4435     WorkspaceFoldersRequest2.type = new messages_1.ProtocolRequestType0("workspace/workspaceFolders");
4436   })(WorkspaceFoldersRequest = exports2.WorkspaceFoldersRequest || (exports2.WorkspaceFoldersRequest = {}));
4437   var DidChangeWorkspaceFoldersNotification;
4438   (function(DidChangeWorkspaceFoldersNotification2) {
4439     DidChangeWorkspaceFoldersNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWorkspaceFolders");
4440   })(DidChangeWorkspaceFoldersNotification = exports2.DidChangeWorkspaceFoldersNotification || (exports2.DidChangeWorkspaceFoldersNotification = {}));
4441 });
4442
4443 // node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js
4444 var require_protocol_configuration = __commonJS((exports2) => {
4445   "use strict";
4446   Object.defineProperty(exports2, "__esModule", {value: true});
4447   exports2.ConfigurationRequest = void 0;
4448   var messages_1 = require_messages2();
4449   var ConfigurationRequest;
4450   (function(ConfigurationRequest2) {
4451     ConfigurationRequest2.type = new messages_1.ProtocolRequestType("workspace/configuration");
4452   })(ConfigurationRequest = exports2.ConfigurationRequest || (exports2.ConfigurationRequest = {}));
4453 });
4454
4455 // node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js
4456 var require_protocol_colorProvider = __commonJS((exports2) => {
4457   "use strict";
4458   Object.defineProperty(exports2, "__esModule", {value: true});
4459   exports2.ColorPresentationRequest = exports2.DocumentColorRequest = void 0;
4460   var messages_1 = require_messages2();
4461   var DocumentColorRequest;
4462   (function(DocumentColorRequest2) {
4463     DocumentColorRequest2.method = "textDocument/documentColor";
4464     DocumentColorRequest2.type = new messages_1.ProtocolRequestType(DocumentColorRequest2.method);
4465   })(DocumentColorRequest = exports2.DocumentColorRequest || (exports2.DocumentColorRequest = {}));
4466   var ColorPresentationRequest;
4467   (function(ColorPresentationRequest2) {
4468     ColorPresentationRequest2.type = new messages_1.ProtocolRequestType("textDocument/colorPresentation");
4469   })(ColorPresentationRequest = exports2.ColorPresentationRequest || (exports2.ColorPresentationRequest = {}));
4470 });
4471
4472 // node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js
4473 var require_protocol_foldingRange = __commonJS((exports2) => {
4474   "use strict";
4475   Object.defineProperty(exports2, "__esModule", {value: true});
4476   exports2.FoldingRangeRequest = exports2.FoldingRangeKind = void 0;
4477   var messages_1 = require_messages2();
4478   var FoldingRangeKind;
4479   (function(FoldingRangeKind2) {
4480     FoldingRangeKind2["Comment"] = "comment";
4481     FoldingRangeKind2["Imports"] = "imports";
4482     FoldingRangeKind2["Region"] = "region";
4483   })(FoldingRangeKind = exports2.FoldingRangeKind || (exports2.FoldingRangeKind = {}));
4484   var FoldingRangeRequest;
4485   (function(FoldingRangeRequest2) {
4486     FoldingRangeRequest2.method = "textDocument/foldingRange";
4487     FoldingRangeRequest2.type = new messages_1.ProtocolRequestType(FoldingRangeRequest2.method);
4488   })(FoldingRangeRequest = exports2.FoldingRangeRequest || (exports2.FoldingRangeRequest = {}));
4489 });
4490
4491 // node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js
4492 var require_protocol_declaration = __commonJS((exports2) => {
4493   "use strict";
4494   Object.defineProperty(exports2, "__esModule", {value: true});
4495   exports2.DeclarationRequest = void 0;
4496   var messages_1 = require_messages2();
4497   var DeclarationRequest;
4498   (function(DeclarationRequest2) {
4499     DeclarationRequest2.method = "textDocument/declaration";
4500     DeclarationRequest2.type = new messages_1.ProtocolRequestType(DeclarationRequest2.method);
4501   })(DeclarationRequest = exports2.DeclarationRequest || (exports2.DeclarationRequest = {}));
4502 });
4503
4504 // node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js
4505 var require_protocol_selectionRange = __commonJS((exports2) => {
4506   "use strict";
4507   Object.defineProperty(exports2, "__esModule", {value: true});
4508   exports2.SelectionRangeRequest = void 0;
4509   var messages_1 = require_messages2();
4510   var SelectionRangeRequest;
4511   (function(SelectionRangeRequest2) {
4512     SelectionRangeRequest2.method = "textDocument/selectionRange";
4513     SelectionRangeRequest2.type = new messages_1.ProtocolRequestType(SelectionRangeRequest2.method);
4514   })(SelectionRangeRequest = exports2.SelectionRangeRequest || (exports2.SelectionRangeRequest = {}));
4515 });
4516
4517 // node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js
4518 var require_protocol_progress = __commonJS((exports2) => {
4519   "use strict";
4520   Object.defineProperty(exports2, "__esModule", {value: true});
4521   exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = void 0;
4522   var vscode_jsonrpc_1 = require_main();
4523   var messages_1 = require_messages2();
4524   var WorkDoneProgress;
4525   (function(WorkDoneProgress2) {
4526     WorkDoneProgress2.type = new vscode_jsonrpc_1.ProgressType();
4527     function is(value) {
4528       return value === WorkDoneProgress2.type;
4529     }
4530     WorkDoneProgress2.is = is;
4531   })(WorkDoneProgress = exports2.WorkDoneProgress || (exports2.WorkDoneProgress = {}));
4532   var WorkDoneProgressCreateRequest;
4533   (function(WorkDoneProgressCreateRequest2) {
4534     WorkDoneProgressCreateRequest2.type = new messages_1.ProtocolRequestType("window/workDoneProgress/create");
4535   })(WorkDoneProgressCreateRequest = exports2.WorkDoneProgressCreateRequest || (exports2.WorkDoneProgressCreateRequest = {}));
4536   var WorkDoneProgressCancelNotification;
4537   (function(WorkDoneProgressCancelNotification2) {
4538     WorkDoneProgressCancelNotification2.type = new messages_1.ProtocolNotificationType("window/workDoneProgress/cancel");
4539   })(WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCancelNotification || (exports2.WorkDoneProgressCancelNotification = {}));
4540 });
4541
4542 // node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js
4543 var require_protocol_callHierarchy = __commonJS((exports2) => {
4544   "use strict";
4545   Object.defineProperty(exports2, "__esModule", {value: true});
4546   exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.CallHierarchyPrepareRequest = void 0;
4547   var messages_1 = require_messages2();
4548   var CallHierarchyPrepareRequest;
4549   (function(CallHierarchyPrepareRequest2) {
4550     CallHierarchyPrepareRequest2.method = "textDocument/prepareCallHierarchy";
4551     CallHierarchyPrepareRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest2.method);
4552   })(CallHierarchyPrepareRequest = exports2.CallHierarchyPrepareRequest || (exports2.CallHierarchyPrepareRequest = {}));
4553   var CallHierarchyIncomingCallsRequest;
4554   (function(CallHierarchyIncomingCallsRequest2) {
4555     CallHierarchyIncomingCallsRequest2.method = "callHierarchy/incomingCalls";
4556     CallHierarchyIncomingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest2.method);
4557   })(CallHierarchyIncomingCallsRequest = exports2.CallHierarchyIncomingCallsRequest || (exports2.CallHierarchyIncomingCallsRequest = {}));
4558   var CallHierarchyOutgoingCallsRequest;
4559   (function(CallHierarchyOutgoingCallsRequest2) {
4560     CallHierarchyOutgoingCallsRequest2.method = "callHierarchy/outgoingCalls";
4561     CallHierarchyOutgoingCallsRequest2.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest2.method);
4562   })(CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyOutgoingCallsRequest || (exports2.CallHierarchyOutgoingCallsRequest = {}));
4563 });
4564
4565 // node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js
4566 var require_protocol_semanticTokens = __commonJS((exports2) => {
4567   "use strict";
4568   Object.defineProperty(exports2, "__esModule", {value: true});
4569   exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.SemanticTokensRegistrationType = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = void 0;
4570   var messages_1 = require_messages2();
4571   var SemanticTokenTypes;
4572   (function(SemanticTokenTypes2) {
4573     SemanticTokenTypes2["namespace"] = "namespace";
4574     SemanticTokenTypes2["type"] = "type";
4575     SemanticTokenTypes2["class"] = "class";
4576     SemanticTokenTypes2["enum"] = "enum";
4577     SemanticTokenTypes2["interface"] = "interface";
4578     SemanticTokenTypes2["struct"] = "struct";
4579     SemanticTokenTypes2["typeParameter"] = "typeParameter";
4580     SemanticTokenTypes2["parameter"] = "parameter";
4581     SemanticTokenTypes2["variable"] = "variable";
4582     SemanticTokenTypes2["property"] = "property";
4583     SemanticTokenTypes2["enumMember"] = "enumMember";
4584     SemanticTokenTypes2["event"] = "event";
4585     SemanticTokenTypes2["function"] = "function";
4586     SemanticTokenTypes2["method"] = "method";
4587     SemanticTokenTypes2["macro"] = "macro";
4588     SemanticTokenTypes2["keyword"] = "keyword";
4589     SemanticTokenTypes2["modifier"] = "modifier";
4590     SemanticTokenTypes2["comment"] = "comment";
4591     SemanticTokenTypes2["string"] = "string";
4592     SemanticTokenTypes2["number"] = "number";
4593     SemanticTokenTypes2["regexp"] = "regexp";
4594     SemanticTokenTypes2["operator"] = "operator";
4595   })(SemanticTokenTypes = exports2.SemanticTokenTypes || (exports2.SemanticTokenTypes = {}));
4596   var SemanticTokenModifiers;
4597   (function(SemanticTokenModifiers2) {
4598     SemanticTokenModifiers2["declaration"] = "declaration";
4599     SemanticTokenModifiers2["definition"] = "definition";
4600     SemanticTokenModifiers2["readonly"] = "readonly";
4601     SemanticTokenModifiers2["static"] = "static";
4602     SemanticTokenModifiers2["deprecated"] = "deprecated";
4603     SemanticTokenModifiers2["abstract"] = "abstract";
4604     SemanticTokenModifiers2["async"] = "async";
4605     SemanticTokenModifiers2["modification"] = "modification";
4606     SemanticTokenModifiers2["documentation"] = "documentation";
4607     SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary";
4608   })(SemanticTokenModifiers = exports2.SemanticTokenModifiers || (exports2.SemanticTokenModifiers = {}));
4609   var SemanticTokens;
4610   (function(SemanticTokens2) {
4611     function is(value) {
4612       const candidate = value;
4613       return candidate !== void 0 && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number");
4614     }
4615     SemanticTokens2.is = is;
4616   })(SemanticTokens = exports2.SemanticTokens || (exports2.SemanticTokens = {}));
4617   var TokenFormat;
4618   (function(TokenFormat2) {
4619     TokenFormat2.Relative = "relative";
4620   })(TokenFormat = exports2.TokenFormat || (exports2.TokenFormat = {}));
4621   var SemanticTokensRegistrationType;
4622   (function(SemanticTokensRegistrationType2) {
4623     SemanticTokensRegistrationType2.method = "textDocument/semanticTokens";
4624     SemanticTokensRegistrationType2.type = new messages_1.RegistrationType(SemanticTokensRegistrationType2.method);
4625   })(SemanticTokensRegistrationType = exports2.SemanticTokensRegistrationType || (exports2.SemanticTokensRegistrationType = {}));
4626   var SemanticTokensRequest;
4627   (function(SemanticTokensRequest2) {
4628     SemanticTokensRequest2.method = "textDocument/semanticTokens/full";
4629     SemanticTokensRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRequest2.method);
4630   })(SemanticTokensRequest = exports2.SemanticTokensRequest || (exports2.SemanticTokensRequest = {}));
4631   var SemanticTokensDeltaRequest;
4632   (function(SemanticTokensDeltaRequest2) {
4633     SemanticTokensDeltaRequest2.method = "textDocument/semanticTokens/full/delta";
4634     SemanticTokensDeltaRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest2.method);
4635   })(SemanticTokensDeltaRequest = exports2.SemanticTokensDeltaRequest || (exports2.SemanticTokensDeltaRequest = {}));
4636   var SemanticTokensRangeRequest;
4637   (function(SemanticTokensRangeRequest2) {
4638     SemanticTokensRangeRequest2.method = "textDocument/semanticTokens/range";
4639     SemanticTokensRangeRequest2.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest2.method);
4640   })(SemanticTokensRangeRequest = exports2.SemanticTokensRangeRequest || (exports2.SemanticTokensRangeRequest = {}));
4641   var SemanticTokensRefreshRequest;
4642   (function(SemanticTokensRefreshRequest2) {
4643     SemanticTokensRefreshRequest2.method = `workspace/semanticTokens/refresh`;
4644     SemanticTokensRefreshRequest2.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest2.method);
4645   })(SemanticTokensRefreshRequest = exports2.SemanticTokensRefreshRequest || (exports2.SemanticTokensRefreshRequest = {}));
4646 });
4647
4648 // node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js
4649 var require_protocol_showDocument = __commonJS((exports2) => {
4650   "use strict";
4651   Object.defineProperty(exports2, "__esModule", {value: true});
4652   exports2.ShowDocumentRequest = void 0;
4653   var messages_1 = require_messages2();
4654   var ShowDocumentRequest;
4655   (function(ShowDocumentRequest2) {
4656     ShowDocumentRequest2.method = "window/showDocument";
4657     ShowDocumentRequest2.type = new messages_1.ProtocolRequestType(ShowDocumentRequest2.method);
4658   })(ShowDocumentRequest = exports2.ShowDocumentRequest || (exports2.ShowDocumentRequest = {}));
4659 });
4660
4661 // node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js
4662 var require_protocol_linkedEditingRange = __commonJS((exports2) => {
4663   "use strict";
4664   Object.defineProperty(exports2, "__esModule", {value: true});
4665   exports2.LinkedEditingRangeRequest = void 0;
4666   var messages_1 = require_messages2();
4667   var LinkedEditingRangeRequest;
4668   (function(LinkedEditingRangeRequest2) {
4669     LinkedEditingRangeRequest2.method = "textDocument/linkedEditingRange";
4670     LinkedEditingRangeRequest2.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest2.method);
4671   })(LinkedEditingRangeRequest = exports2.LinkedEditingRangeRequest || (exports2.LinkedEditingRangeRequest = {}));
4672 });
4673
4674 // node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js
4675 var require_protocol_fileOperations = __commonJS((exports2) => {
4676   "use strict";
4677   Object.defineProperty(exports2, "__esModule", {value: true});
4678   exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.DidRenameFilesNotification = exports2.WillRenameFilesRequest = exports2.DidCreateFilesNotification = exports2.WillCreateFilesRequest = exports2.FileOperationPatternKind = void 0;
4679   var messages_1 = require_messages2();
4680   var FileOperationPatternKind;
4681   (function(FileOperationPatternKind2) {
4682     FileOperationPatternKind2.file = "file";
4683     FileOperationPatternKind2.folder = "folder";
4684   })(FileOperationPatternKind = exports2.FileOperationPatternKind || (exports2.FileOperationPatternKind = {}));
4685   var WillCreateFilesRequest;
4686   (function(WillCreateFilesRequest2) {
4687     WillCreateFilesRequest2.method = "workspace/willCreateFiles";
4688     WillCreateFilesRequest2.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest2.method);
4689   })(WillCreateFilesRequest = exports2.WillCreateFilesRequest || (exports2.WillCreateFilesRequest = {}));
4690   var DidCreateFilesNotification;
4691   (function(DidCreateFilesNotification2) {
4692     DidCreateFilesNotification2.method = "workspace/didCreateFiles";
4693     DidCreateFilesNotification2.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification2.method);
4694   })(DidCreateFilesNotification = exports2.DidCreateFilesNotification || (exports2.DidCreateFilesNotification = {}));
4695   var WillRenameFilesRequest;
4696   (function(WillRenameFilesRequest2) {
4697     WillRenameFilesRequest2.method = "workspace/willRenameFiles";
4698     WillRenameFilesRequest2.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest2.method);
4699   })(WillRenameFilesRequest = exports2.WillRenameFilesRequest || (exports2.WillRenameFilesRequest = {}));
4700   var DidRenameFilesNotification;
4701   (function(DidRenameFilesNotification2) {
4702     DidRenameFilesNotification2.method = "workspace/didRenameFiles";
4703     DidRenameFilesNotification2.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification2.method);
4704   })(DidRenameFilesNotification = exports2.DidRenameFilesNotification || (exports2.DidRenameFilesNotification = {}));
4705   var DidDeleteFilesNotification;
4706   (function(DidDeleteFilesNotification2) {
4707     DidDeleteFilesNotification2.method = "workspace/didDeleteFiles";
4708     DidDeleteFilesNotification2.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification2.method);
4709   })(DidDeleteFilesNotification = exports2.DidDeleteFilesNotification || (exports2.DidDeleteFilesNotification = {}));
4710   var WillDeleteFilesRequest;
4711   (function(WillDeleteFilesRequest2) {
4712     WillDeleteFilesRequest2.method = "workspace/willDeleteFiles";
4713     WillDeleteFilesRequest2.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest2.method);
4714   })(WillDeleteFilesRequest = exports2.WillDeleteFilesRequest || (exports2.WillDeleteFilesRequest = {}));
4715 });
4716
4717 // node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js
4718 var require_protocol_moniker = __commonJS((exports2) => {
4719   "use strict";
4720   Object.defineProperty(exports2, "__esModule", {value: true});
4721   exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = void 0;
4722   var messages_1 = require_messages2();
4723   var UniquenessLevel;
4724   (function(UniquenessLevel2) {
4725     UniquenessLevel2["document"] = "document";
4726     UniquenessLevel2["project"] = "project";
4727     UniquenessLevel2["group"] = "group";
4728     UniquenessLevel2["scheme"] = "scheme";
4729     UniquenessLevel2["global"] = "global";
4730   })(UniquenessLevel = exports2.UniquenessLevel || (exports2.UniquenessLevel = {}));
4731   var MonikerKind;
4732   (function(MonikerKind2) {
4733     MonikerKind2["import"] = "import";
4734     MonikerKind2["export"] = "export";
4735     MonikerKind2["local"] = "local";
4736   })(MonikerKind = exports2.MonikerKind || (exports2.MonikerKind = {}));
4737   var MonikerRequest;
4738   (function(MonikerRequest2) {
4739     MonikerRequest2.method = "textDocument/moniker";
4740     MonikerRequest2.type = new messages_1.ProtocolRequestType(MonikerRequest2.method);
4741   })(MonikerRequest = exports2.MonikerRequest || (exports2.MonikerRequest = {}));
4742 });
4743
4744 // node_modules/vscode-languageserver-protocol/lib/common/protocol.js
4745 var require_protocol = __commonJS((exports2) => {
4746   "use strict";
4747   Object.defineProperty(exports2, "__esModule", {value: true});
4748   exports2.DocumentLinkRequest = exports2.CodeLensRefreshRequest = exports2.CodeLensResolveRequest = exports2.CodeLensRequest = exports2.WorkspaceSymbolRequest = exports2.CodeActionResolveRequest = exports2.CodeActionRequest = exports2.DocumentSymbolRequest = exports2.DocumentHighlightRequest = exports2.ReferencesRequest = exports2.DefinitionRequest = exports2.SignatureHelpRequest = exports2.SignatureHelpTriggerKind = exports2.HoverRequest = exports2.CompletionResolveRequest = exports2.CompletionRequest = exports2.CompletionTriggerKind = exports2.PublishDiagnosticsNotification = exports2.WatchKind = exports2.FileChangeType = exports2.DidChangeWatchedFilesNotification = exports2.WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentNotification = exports2.TextDocumentSaveReason = exports2.DidSaveTextDocumentNotification = exports2.DidCloseTextDocumentNotification = exports2.DidChangeTextDocumentNotification = exports2.TextDocumentContentChangeEvent = exports2.DidOpenTextDocumentNotification = exports2.TextDocumentSyncKind = exports2.TelemetryEventNotification = exports2.LogMessageNotification = exports2.ShowMessageRequest = exports2.ShowMessageNotification = exports2.MessageType = exports2.DidChangeConfigurationNotification = exports2.ExitNotification = exports2.ShutdownRequest = exports2.InitializedNotification = exports2.InitializeError = exports2.InitializeRequest = exports2.WorkDoneProgressOptions = exports2.TextDocumentRegistrationOptions = exports2.StaticRegistrationOptions = exports2.FailureHandlingKind = exports2.ResourceOperationKind = exports2.UnregistrationRequest = exports2.RegistrationRequest = exports2.DocumentSelector = exports2.DocumentFilter = void 0;
4749   exports2.MonikerRequest = exports2.MonikerKind = exports2.UniquenessLevel = exports2.WillDeleteFilesRequest = exports2.DidDeleteFilesNotification = exports2.WillRenameFilesRequest = exports2.DidRenameFilesNotification = exports2.WillCreateFilesRequest = exports2.DidCreateFilesNotification = exports2.FileOperationPatternKind = exports2.LinkedEditingRangeRequest = exports2.ShowDocumentRequest = exports2.SemanticTokensRegistrationType = exports2.SemanticTokensRefreshRequest = exports2.SemanticTokensRangeRequest = exports2.SemanticTokensDeltaRequest = exports2.SemanticTokensRequest = exports2.TokenFormat = exports2.SemanticTokens = exports2.SemanticTokenModifiers = exports2.SemanticTokenTypes = exports2.CallHierarchyPrepareRequest = exports2.CallHierarchyOutgoingCallsRequest = exports2.CallHierarchyIncomingCallsRequest = exports2.WorkDoneProgressCancelNotification = exports2.WorkDoneProgressCreateRequest = exports2.WorkDoneProgress = exports2.SelectionRangeRequest = exports2.DeclarationRequest = exports2.FoldingRangeRequest = exports2.ColorPresentationRequest = exports2.DocumentColorRequest = exports2.ConfigurationRequest = exports2.DidChangeWorkspaceFoldersNotification = exports2.WorkspaceFoldersRequest = exports2.TypeDefinitionRequest = exports2.ImplementationRequest = exports2.ApplyWorkspaceEditRequest = exports2.ExecuteCommandRequest = exports2.PrepareRenameRequest = exports2.RenameRequest = exports2.PrepareSupportDefaultBehavior = exports2.DocumentOnTypeFormattingRequest = exports2.DocumentRangeFormattingRequest = exports2.DocumentFormattingRequest = exports2.DocumentLinkResolveRequest = void 0;
4750   var Is = require_is2();
4751   var messages_1 = require_messages2();
4752   var protocol_implementation_1 = require_protocol_implementation();
4753   Object.defineProperty(exports2, "ImplementationRequest", {enumerable: true, get: function() {
4754     return protocol_implementation_1.ImplementationRequest;
4755   }});
4756   var protocol_typeDefinition_1 = require_protocol_typeDefinition();
4757   Object.defineProperty(exports2, "TypeDefinitionRequest", {enumerable: true, get: function() {
4758     return protocol_typeDefinition_1.TypeDefinitionRequest;
4759   }});
4760   var protocol_workspaceFolders_1 = require_protocol_workspaceFolders();
4761   Object.defineProperty(exports2, "WorkspaceFoldersRequest", {enumerable: true, get: function() {
4762     return protocol_workspaceFolders_1.WorkspaceFoldersRequest;
4763   }});
4764   Object.defineProperty(exports2, "DidChangeWorkspaceFoldersNotification", {enumerable: true, get: function() {
4765     return protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification;
4766   }});
4767   var protocol_configuration_1 = require_protocol_configuration();
4768   Object.defineProperty(exports2, "ConfigurationRequest", {enumerable: true, get: function() {
4769     return protocol_configuration_1.ConfigurationRequest;
4770   }});
4771   var protocol_colorProvider_1 = require_protocol_colorProvider();
4772   Object.defineProperty(exports2, "DocumentColorRequest", {enumerable: true, get: function() {
4773     return protocol_colorProvider_1.DocumentColorRequest;
4774   }});
4775   Object.defineProperty(exports2, "ColorPresentationRequest", {enumerable: true, get: function() {
4776     return protocol_colorProvider_1.ColorPresentationRequest;
4777   }});
4778   var protocol_foldingRange_1 = require_protocol_foldingRange();
4779   Object.defineProperty(exports2, "FoldingRangeRequest", {enumerable: true, get: function() {
4780     return protocol_foldingRange_1.FoldingRangeRequest;
4781   }});
4782   var protocol_declaration_1 = require_protocol_declaration();
4783   Object.defineProperty(exports2, "DeclarationRequest", {enumerable: true, get: function() {
4784     return protocol_declaration_1.DeclarationRequest;
4785   }});
4786   var protocol_selectionRange_1 = require_protocol_selectionRange();
4787   Object.defineProperty(exports2, "SelectionRangeRequest", {enumerable: true, get: function() {
4788     return protocol_selectionRange_1.SelectionRangeRequest;
4789   }});
4790   var protocol_progress_1 = require_protocol_progress();
4791   Object.defineProperty(exports2, "WorkDoneProgress", {enumerable: true, get: function() {
4792     return protocol_progress_1.WorkDoneProgress;
4793   }});
4794   Object.defineProperty(exports2, "WorkDoneProgressCreateRequest", {enumerable: true, get: function() {
4795     return protocol_progress_1.WorkDoneProgressCreateRequest;
4796   }});
4797   Object.defineProperty(exports2, "WorkDoneProgressCancelNotification", {enumerable: true, get: function() {
4798     return protocol_progress_1.WorkDoneProgressCancelNotification;
4799   }});
4800   var protocol_callHierarchy_1 = require_protocol_callHierarchy();
4801   Object.defineProperty(exports2, "CallHierarchyIncomingCallsRequest", {enumerable: true, get: function() {
4802     return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest;
4803   }});
4804   Object.defineProperty(exports2, "CallHierarchyOutgoingCallsRequest", {enumerable: true, get: function() {
4805     return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest;
4806   }});
4807   Object.defineProperty(exports2, "CallHierarchyPrepareRequest", {enumerable: true, get: function() {
4808     return protocol_callHierarchy_1.CallHierarchyPrepareRequest;
4809   }});
4810   var protocol_semanticTokens_1 = require_protocol_semanticTokens();
4811   Object.defineProperty(exports2, "SemanticTokenTypes", {enumerable: true, get: function() {
4812     return protocol_semanticTokens_1.SemanticTokenTypes;
4813   }});
4814   Object.defineProperty(exports2, "SemanticTokenModifiers", {enumerable: true, get: function() {
4815     return protocol_semanticTokens_1.SemanticTokenModifiers;
4816   }});
4817   Object.defineProperty(exports2, "SemanticTokens", {enumerable: true, get: function() {
4818     return protocol_semanticTokens_1.SemanticTokens;
4819   }});
4820   Object.defineProperty(exports2, "TokenFormat", {enumerable: true, get: function() {
4821     return protocol_semanticTokens_1.TokenFormat;
4822   }});
4823   Object.defineProperty(exports2, "SemanticTokensRequest", {enumerable: true, get: function() {
4824     return protocol_semanticTokens_1.SemanticTokensRequest;
4825   }});
4826   Object.defineProperty(exports2, "SemanticTokensDeltaRequest", {enumerable: true, get: function() {
4827     return protocol_semanticTokens_1.SemanticTokensDeltaRequest;
4828   }});
4829   Object.defineProperty(exports2, "SemanticTokensRangeRequest", {enumerable: true, get: function() {
4830     return protocol_semanticTokens_1.SemanticTokensRangeRequest;
4831   }});
4832   Object.defineProperty(exports2, "SemanticTokensRefreshRequest", {enumerable: true, get: function() {
4833     return protocol_semanticTokens_1.SemanticTokensRefreshRequest;
4834   }});
4835   Object.defineProperty(exports2, "SemanticTokensRegistrationType", {enumerable: true, get: function() {
4836     return protocol_semanticTokens_1.SemanticTokensRegistrationType;
4837   }});
4838   var protocol_showDocument_1 = require_protocol_showDocument();
4839   Object.defineProperty(exports2, "ShowDocumentRequest", {enumerable: true, get: function() {
4840     return protocol_showDocument_1.ShowDocumentRequest;
4841   }});
4842   var protocol_linkedEditingRange_1 = require_protocol_linkedEditingRange();
4843   Object.defineProperty(exports2, "LinkedEditingRangeRequest", {enumerable: true, get: function() {
4844     return protocol_linkedEditingRange_1.LinkedEditingRangeRequest;
4845   }});
4846   var protocol_fileOperations_1 = require_protocol_fileOperations();
4847   Object.defineProperty(exports2, "FileOperationPatternKind", {enumerable: true, get: function() {
4848     return protocol_fileOperations_1.FileOperationPatternKind;
4849   }});
4850   Object.defineProperty(exports2, "DidCreateFilesNotification", {enumerable: true, get: function() {
4851     return protocol_fileOperations_1.DidCreateFilesNotification;
4852   }});
4853   Object.defineProperty(exports2, "WillCreateFilesRequest", {enumerable: true, get: function() {
4854     return protocol_fileOperations_1.WillCreateFilesRequest;
4855   }});
4856   Object.defineProperty(exports2, "DidRenameFilesNotification", {enumerable: true, get: function() {
4857     return protocol_fileOperations_1.DidRenameFilesNotification;
4858   }});
4859   Object.defineProperty(exports2, "WillRenameFilesRequest", {enumerable: true, get: function() {
4860     return protocol_fileOperations_1.WillRenameFilesRequest;
4861   }});
4862   Object.defineProperty(exports2, "DidDeleteFilesNotification", {enumerable: true, get: function() {
4863     return protocol_fileOperations_1.DidDeleteFilesNotification;
4864   }});
4865   Object.defineProperty(exports2, "WillDeleteFilesRequest", {enumerable: true, get: function() {
4866     return protocol_fileOperations_1.WillDeleteFilesRequest;
4867   }});
4868   var protocol_moniker_1 = require_protocol_moniker();
4869   Object.defineProperty(exports2, "UniquenessLevel", {enumerable: true, get: function() {
4870     return protocol_moniker_1.UniquenessLevel;
4871   }});
4872   Object.defineProperty(exports2, "MonikerKind", {enumerable: true, get: function() {
4873     return protocol_moniker_1.MonikerKind;
4874   }});
4875   Object.defineProperty(exports2, "MonikerRequest", {enumerable: true, get: function() {
4876     return protocol_moniker_1.MonikerRequest;
4877   }});
4878   var DocumentFilter;
4879   (function(DocumentFilter2) {
4880     function is(value) {
4881       const candidate = value;
4882       return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
4883     }
4884     DocumentFilter2.is = is;
4885   })(DocumentFilter = exports2.DocumentFilter || (exports2.DocumentFilter = {}));
4886   var DocumentSelector;
4887   (function(DocumentSelector2) {
4888     function is(value) {
4889       if (!Array.isArray(value)) {
4890         return false;
4891       }
4892       for (let elem of value) {
4893         if (!Is.string(elem) && !DocumentFilter.is(elem)) {
4894           return false;
4895         }
4896       }
4897       return true;
4898     }
4899     DocumentSelector2.is = is;
4900   })(DocumentSelector = exports2.DocumentSelector || (exports2.DocumentSelector = {}));
4901   var RegistrationRequest;
4902   (function(RegistrationRequest2) {
4903     RegistrationRequest2.type = new messages_1.ProtocolRequestType("client/registerCapability");
4904   })(RegistrationRequest = exports2.RegistrationRequest || (exports2.RegistrationRequest = {}));
4905   var UnregistrationRequest;
4906   (function(UnregistrationRequest2) {
4907     UnregistrationRequest2.type = new messages_1.ProtocolRequestType("client/unregisterCapability");
4908   })(UnregistrationRequest = exports2.UnregistrationRequest || (exports2.UnregistrationRequest = {}));
4909   var ResourceOperationKind;
4910   (function(ResourceOperationKind2) {
4911     ResourceOperationKind2.Create = "create";
4912     ResourceOperationKind2.Rename = "rename";
4913     ResourceOperationKind2.Delete = "delete";
4914   })(ResourceOperationKind = exports2.ResourceOperationKind || (exports2.ResourceOperationKind = {}));
4915   var FailureHandlingKind;
4916   (function(FailureHandlingKind2) {
4917     FailureHandlingKind2.Abort = "abort";
4918     FailureHandlingKind2.Transactional = "transactional";
4919     FailureHandlingKind2.TextOnlyTransactional = "textOnlyTransactional";
4920     FailureHandlingKind2.Undo = "undo";
4921   })(FailureHandlingKind = exports2.FailureHandlingKind || (exports2.FailureHandlingKind = {}));
4922   var StaticRegistrationOptions;
4923   (function(StaticRegistrationOptions2) {
4924     function hasId(value) {
4925       const candidate = value;
4926       return candidate && Is.string(candidate.id) && candidate.id.length > 0;
4927     }
4928     StaticRegistrationOptions2.hasId = hasId;
4929   })(StaticRegistrationOptions = exports2.StaticRegistrationOptions || (exports2.StaticRegistrationOptions = {}));
4930   var TextDocumentRegistrationOptions;
4931   (function(TextDocumentRegistrationOptions2) {
4932     function is(value) {
4933       const candidate = value;
4934       return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));
4935     }
4936     TextDocumentRegistrationOptions2.is = is;
4937   })(TextDocumentRegistrationOptions = exports2.TextDocumentRegistrationOptions || (exports2.TextDocumentRegistrationOptions = {}));
4938   var WorkDoneProgressOptions;
4939   (function(WorkDoneProgressOptions2) {
4940     function is(value) {
4941       const candidate = value;
4942       return Is.objectLiteral(candidate) && (candidate.workDoneProgress === void 0 || Is.boolean(candidate.workDoneProgress));
4943     }
4944     WorkDoneProgressOptions2.is = is;
4945     function hasWorkDoneProgress(value) {
4946       const candidate = value;
4947       return candidate && Is.boolean(candidate.workDoneProgress);
4948     }
4949     WorkDoneProgressOptions2.hasWorkDoneProgress = hasWorkDoneProgress;
4950   })(WorkDoneProgressOptions = exports2.WorkDoneProgressOptions || (exports2.WorkDoneProgressOptions = {}));
4951   var InitializeRequest;
4952   (function(InitializeRequest2) {
4953     InitializeRequest2.type = new messages_1.ProtocolRequestType("initialize");
4954   })(InitializeRequest = exports2.InitializeRequest || (exports2.InitializeRequest = {}));
4955   var InitializeError;
4956   (function(InitializeError2) {
4957     InitializeError2.unknownProtocolVersion = 1;
4958   })(InitializeError = exports2.InitializeError || (exports2.InitializeError = {}));
4959   var InitializedNotification;
4960   (function(InitializedNotification2) {
4961     InitializedNotification2.type = new messages_1.ProtocolNotificationType("initialized");
4962   })(InitializedNotification = exports2.InitializedNotification || (exports2.InitializedNotification = {}));
4963   var ShutdownRequest;
4964   (function(ShutdownRequest2) {
4965     ShutdownRequest2.type = new messages_1.ProtocolRequestType0("shutdown");
4966   })(ShutdownRequest = exports2.ShutdownRequest || (exports2.ShutdownRequest = {}));
4967   var ExitNotification;
4968   (function(ExitNotification2) {
4969     ExitNotification2.type = new messages_1.ProtocolNotificationType0("exit");
4970   })(ExitNotification = exports2.ExitNotification || (exports2.ExitNotification = {}));
4971   var DidChangeConfigurationNotification;
4972   (function(DidChangeConfigurationNotification2) {
4973     DidChangeConfigurationNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeConfiguration");
4974   })(DidChangeConfigurationNotification = exports2.DidChangeConfigurationNotification || (exports2.DidChangeConfigurationNotification = {}));
4975   var MessageType;
4976   (function(MessageType2) {
4977     MessageType2.Error = 1;
4978     MessageType2.Warning = 2;
4979     MessageType2.Info = 3;
4980     MessageType2.Log = 4;
4981   })(MessageType = exports2.MessageType || (exports2.MessageType = {}));
4982   var ShowMessageNotification;
4983   (function(ShowMessageNotification2) {
4984     ShowMessageNotification2.type = new messages_1.ProtocolNotificationType("window/showMessage");
4985   })(ShowMessageNotification = exports2.ShowMessageNotification || (exports2.ShowMessageNotification = {}));
4986   var ShowMessageRequest;
4987   (function(ShowMessageRequest2) {
4988     ShowMessageRequest2.type = new messages_1.ProtocolRequestType("window/showMessageRequest");
4989   })(ShowMessageRequest = exports2.ShowMessageRequest || (exports2.ShowMessageRequest = {}));
4990   var LogMessageNotification;
4991   (function(LogMessageNotification2) {
4992     LogMessageNotification2.type = new messages_1.ProtocolNotificationType("window/logMessage");
4993   })(LogMessageNotification = exports2.LogMessageNotification || (exports2.LogMessageNotification = {}));
4994   var TelemetryEventNotification;
4995   (function(TelemetryEventNotification2) {
4996     TelemetryEventNotification2.type = new messages_1.ProtocolNotificationType("telemetry/event");
4997   })(TelemetryEventNotification = exports2.TelemetryEventNotification || (exports2.TelemetryEventNotification = {}));
4998   var TextDocumentSyncKind;
4999   (function(TextDocumentSyncKind2) {
5000     TextDocumentSyncKind2.None = 0;
5001     TextDocumentSyncKind2.Full = 1;
5002     TextDocumentSyncKind2.Incremental = 2;
5003   })(TextDocumentSyncKind = exports2.TextDocumentSyncKind || (exports2.TextDocumentSyncKind = {}));
5004   var DidOpenTextDocumentNotification;
5005   (function(DidOpenTextDocumentNotification2) {
5006     DidOpenTextDocumentNotification2.method = "textDocument/didOpen";
5007     DidOpenTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification2.method);
5008   })(DidOpenTextDocumentNotification = exports2.DidOpenTextDocumentNotification || (exports2.DidOpenTextDocumentNotification = {}));
5009   var TextDocumentContentChangeEvent;
5010   (function(TextDocumentContentChangeEvent2) {
5011     function isIncremental(event) {
5012       let candidate = event;
5013       return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range !== void 0 && (candidate.rangeLength === void 0 || typeof candidate.rangeLength === "number");
5014     }
5015     TextDocumentContentChangeEvent2.isIncremental = isIncremental;
5016     function isFull(event) {
5017       let candidate = event;
5018       return candidate !== void 0 && candidate !== null && typeof candidate.text === "string" && candidate.range === void 0 && candidate.rangeLength === void 0;
5019     }
5020     TextDocumentContentChangeEvent2.isFull = isFull;
5021   })(TextDocumentContentChangeEvent = exports2.TextDocumentContentChangeEvent || (exports2.TextDocumentContentChangeEvent = {}));
5022   var DidChangeTextDocumentNotification;
5023   (function(DidChangeTextDocumentNotification2) {
5024     DidChangeTextDocumentNotification2.method = "textDocument/didChange";
5025     DidChangeTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification2.method);
5026   })(DidChangeTextDocumentNotification = exports2.DidChangeTextDocumentNotification || (exports2.DidChangeTextDocumentNotification = {}));
5027   var DidCloseTextDocumentNotification;
5028   (function(DidCloseTextDocumentNotification2) {
5029     DidCloseTextDocumentNotification2.method = "textDocument/didClose";
5030     DidCloseTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification2.method);
5031   })(DidCloseTextDocumentNotification = exports2.DidCloseTextDocumentNotification || (exports2.DidCloseTextDocumentNotification = {}));
5032   var DidSaveTextDocumentNotification;
5033   (function(DidSaveTextDocumentNotification2) {
5034     DidSaveTextDocumentNotification2.method = "textDocument/didSave";
5035     DidSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification2.method);
5036   })(DidSaveTextDocumentNotification = exports2.DidSaveTextDocumentNotification || (exports2.DidSaveTextDocumentNotification = {}));
5037   var TextDocumentSaveReason;
5038   (function(TextDocumentSaveReason2) {
5039     TextDocumentSaveReason2.Manual = 1;
5040     TextDocumentSaveReason2.AfterDelay = 2;
5041     TextDocumentSaveReason2.FocusOut = 3;
5042   })(TextDocumentSaveReason = exports2.TextDocumentSaveReason || (exports2.TextDocumentSaveReason = {}));
5043   var WillSaveTextDocumentNotification;
5044   (function(WillSaveTextDocumentNotification2) {
5045     WillSaveTextDocumentNotification2.method = "textDocument/willSave";
5046     WillSaveTextDocumentNotification2.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification2.method);
5047   })(WillSaveTextDocumentNotification = exports2.WillSaveTextDocumentNotification || (exports2.WillSaveTextDocumentNotification = {}));
5048   var WillSaveTextDocumentWaitUntilRequest;
5049   (function(WillSaveTextDocumentWaitUntilRequest2) {
5050     WillSaveTextDocumentWaitUntilRequest2.method = "textDocument/willSaveWaitUntil";
5051     WillSaveTextDocumentWaitUntilRequest2.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest2.method);
5052   })(WillSaveTextDocumentWaitUntilRequest = exports2.WillSaveTextDocumentWaitUntilRequest || (exports2.WillSaveTextDocumentWaitUntilRequest = {}));
5053   var DidChangeWatchedFilesNotification;
5054   (function(DidChangeWatchedFilesNotification2) {
5055     DidChangeWatchedFilesNotification2.type = new messages_1.ProtocolNotificationType("workspace/didChangeWatchedFiles");
5056   })(DidChangeWatchedFilesNotification = exports2.DidChangeWatchedFilesNotification || (exports2.DidChangeWatchedFilesNotification = {}));
5057   var FileChangeType;
5058   (function(FileChangeType2) {
5059     FileChangeType2.Created = 1;
5060     FileChangeType2.Changed = 2;
5061     FileChangeType2.Deleted = 3;
5062   })(FileChangeType = exports2.FileChangeType || (exports2.FileChangeType = {}));
5063   var WatchKind;
5064   (function(WatchKind2) {
5065     WatchKind2.Create = 1;
5066     WatchKind2.Change = 2;
5067     WatchKind2.Delete = 4;
5068   })(WatchKind = exports2.WatchKind || (exports2.WatchKind = {}));
5069   var PublishDiagnosticsNotification;
5070   (function(PublishDiagnosticsNotification2) {
5071     PublishDiagnosticsNotification2.type = new messages_1.ProtocolNotificationType("textDocument/publishDiagnostics");
5072   })(PublishDiagnosticsNotification = exports2.PublishDiagnosticsNotification || (exports2.PublishDiagnosticsNotification = {}));
5073   var CompletionTriggerKind;
5074   (function(CompletionTriggerKind2) {
5075     CompletionTriggerKind2.Invoked = 1;
5076     CompletionTriggerKind2.TriggerCharacter = 2;
5077     CompletionTriggerKind2.TriggerForIncompleteCompletions = 3;
5078   })(CompletionTriggerKind = exports2.CompletionTriggerKind || (exports2.CompletionTriggerKind = {}));
5079   var CompletionRequest;
5080   (function(CompletionRequest2) {
5081     CompletionRequest2.method = "textDocument/completion";
5082     CompletionRequest2.type = new messages_1.ProtocolRequestType(CompletionRequest2.method);
5083   })(CompletionRequest = exports2.CompletionRequest || (exports2.CompletionRequest = {}));
5084   var CompletionResolveRequest;
5085   (function(CompletionResolveRequest2) {
5086     CompletionResolveRequest2.method = "completionItem/resolve";
5087     CompletionResolveRequest2.type = new messages_1.ProtocolRequestType(CompletionResolveRequest2.method);
5088   })(CompletionResolveRequest = exports2.CompletionResolveRequest || (exports2.CompletionResolveRequest = {}));
5089   var HoverRequest;
5090   (function(HoverRequest2) {
5091     HoverRequest2.method = "textDocument/hover";
5092     HoverRequest2.type = new messages_1.ProtocolRequestType(HoverRequest2.method);
5093   })(HoverRequest = exports2.HoverRequest || (exports2.HoverRequest = {}));
5094   var SignatureHelpTriggerKind;
5095   (function(SignatureHelpTriggerKind2) {
5096     SignatureHelpTriggerKind2.Invoked = 1;
5097     SignatureHelpTriggerKind2.TriggerCharacter = 2;
5098     SignatureHelpTriggerKind2.ContentChange = 3;
5099   })(SignatureHelpTriggerKind = exports2.SignatureHelpTriggerKind || (exports2.SignatureHelpTriggerKind = {}));
5100   var SignatureHelpRequest;
5101   (function(SignatureHelpRequest2) {
5102     SignatureHelpRequest2.method = "textDocument/signatureHelp";
5103     SignatureHelpRequest2.type = new messages_1.ProtocolRequestType(SignatureHelpRequest2.method);
5104   })(SignatureHelpRequest = exports2.SignatureHelpRequest || (exports2.SignatureHelpRequest = {}));
5105   var DefinitionRequest;
5106   (function(DefinitionRequest2) {
5107     DefinitionRequest2.method = "textDocument/definition";
5108     DefinitionRequest2.type = new messages_1.ProtocolRequestType(DefinitionRequest2.method);
5109   })(DefinitionRequest = exports2.DefinitionRequest || (exports2.DefinitionRequest = {}));
5110   var ReferencesRequest;
5111   (function(ReferencesRequest2) {
5112     ReferencesRequest2.method = "textDocument/references";
5113     ReferencesRequest2.type = new messages_1.ProtocolRequestType(ReferencesRequest2.method);
5114   })(ReferencesRequest = exports2.ReferencesRequest || (exports2.ReferencesRequest = {}));
5115   var DocumentHighlightRequest;
5116   (function(DocumentHighlightRequest2) {
5117     DocumentHighlightRequest2.method = "textDocument/documentHighlight";
5118     DocumentHighlightRequest2.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest2.method);
5119   })(DocumentHighlightRequest = exports2.DocumentHighlightRequest || (exports2.DocumentHighlightRequest = {}));
5120   var DocumentSymbolRequest;
5121   (function(DocumentSymbolRequest2) {
5122     DocumentSymbolRequest2.method = "textDocument/documentSymbol";
5123     DocumentSymbolRequest2.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest2.method);
5124   })(DocumentSymbolRequest = exports2.DocumentSymbolRequest || (exports2.DocumentSymbolRequest = {}));
5125   var CodeActionRequest;
5126   (function(CodeActionRequest2) {
5127     CodeActionRequest2.method = "textDocument/codeAction";
5128     CodeActionRequest2.type = new messages_1.ProtocolRequestType(CodeActionRequest2.method);
5129   })(CodeActionRequest = exports2.CodeActionRequest || (exports2.CodeActionRequest = {}));
5130   var CodeActionResolveRequest;
5131   (function(CodeActionResolveRequest2) {
5132     CodeActionResolveRequest2.method = "codeAction/resolve";
5133     CodeActionResolveRequest2.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest2.method);
5134   })(CodeActionResolveRequest = exports2.CodeActionResolveRequest || (exports2.CodeActionResolveRequest = {}));
5135   var WorkspaceSymbolRequest;
5136   (function(WorkspaceSymbolRequest2) {
5137     WorkspaceSymbolRequest2.method = "workspace/symbol";
5138     WorkspaceSymbolRequest2.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest2.method);
5139   })(WorkspaceSymbolRequest = exports2.WorkspaceSymbolRequest || (exports2.WorkspaceSymbolRequest = {}));
5140   var CodeLensRequest;
5141   (function(CodeLensRequest2) {
5142     CodeLensRequest2.method = "textDocument/codeLens";
5143     CodeLensRequest2.type = new messages_1.ProtocolRequestType(CodeLensRequest2.method);
5144   })(CodeLensRequest = exports2.CodeLensRequest || (exports2.CodeLensRequest = {}));
5145   var CodeLensResolveRequest;
5146   (function(CodeLensResolveRequest2) {
5147     CodeLensResolveRequest2.method = "codeLens/resolve";
5148     CodeLensResolveRequest2.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest2.method);
5149   })(CodeLensResolveRequest = exports2.CodeLensResolveRequest || (exports2.CodeLensResolveRequest = {}));
5150   var CodeLensRefreshRequest;
5151   (function(CodeLensRefreshRequest2) {
5152     CodeLensRefreshRequest2.method = `workspace/codeLens/refresh`;
5153     CodeLensRefreshRequest2.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest2.method);
5154   })(CodeLensRefreshRequest = exports2.CodeLensRefreshRequest || (exports2.CodeLensRefreshRequest = {}));
5155   var DocumentLinkRequest;
5156   (function(DocumentLinkRequest2) {
5157     DocumentLinkRequest2.method = "textDocument/documentLink";
5158     DocumentLinkRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkRequest2.method);
5159   })(DocumentLinkRequest = exports2.DocumentLinkRequest || (exports2.DocumentLinkRequest = {}));
5160   var DocumentLinkResolveRequest;
5161   (function(DocumentLinkResolveRequest2) {
5162     DocumentLinkResolveRequest2.method = "documentLink/resolve";
5163     DocumentLinkResolveRequest2.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest2.method);
5164   })(DocumentLinkResolveRequest = exports2.DocumentLinkResolveRequest || (exports2.DocumentLinkResolveRequest = {}));
5165   var DocumentFormattingRequest;
5166   (function(DocumentFormattingRequest2) {
5167     DocumentFormattingRequest2.method = "textDocument/formatting";
5168     DocumentFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest2.method);
5169   })(DocumentFormattingRequest = exports2.DocumentFormattingRequest || (exports2.DocumentFormattingRequest = {}));
5170   var DocumentRangeFormattingRequest;
5171   (function(DocumentRangeFormattingRequest2) {
5172     DocumentRangeFormattingRequest2.method = "textDocument/rangeFormatting";
5173     DocumentRangeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest2.method);
5174   })(DocumentRangeFormattingRequest = exports2.DocumentRangeFormattingRequest || (exports2.DocumentRangeFormattingRequest = {}));
5175   var DocumentOnTypeFormattingRequest;
5176   (function(DocumentOnTypeFormattingRequest2) {
5177     DocumentOnTypeFormattingRequest2.method = "textDocument/onTypeFormatting";
5178     DocumentOnTypeFormattingRequest2.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest2.method);
5179   })(DocumentOnTypeFormattingRequest = exports2.DocumentOnTypeFormattingRequest || (exports2.DocumentOnTypeFormattingRequest = {}));
5180   var PrepareSupportDefaultBehavior;
5181   (function(PrepareSupportDefaultBehavior2) {
5182     PrepareSupportDefaultBehavior2.Identifier = 1;
5183   })(PrepareSupportDefaultBehavior = exports2.PrepareSupportDefaultBehavior || (exports2.PrepareSupportDefaultBehavior = {}));
5184   var RenameRequest;
5185   (function(RenameRequest2) {
5186     RenameRequest2.method = "textDocument/rename";
5187     RenameRequest2.type = new messages_1.ProtocolRequestType(RenameRequest2.method);
5188   })(RenameRequest = exports2.RenameRequest || (exports2.RenameRequest = {}));
5189   var PrepareRenameRequest;
5190   (function(PrepareRenameRequest2) {
5191     PrepareRenameRequest2.method = "textDocument/prepareRename";
5192     PrepareRenameRequest2.type = new messages_1.ProtocolRequestType(PrepareRenameRequest2.method);
5193   })(PrepareRenameRequest = exports2.PrepareRenameRequest || (exports2.PrepareRenameRequest = {}));
5194   var ExecuteCommandRequest;
5195   (function(ExecuteCommandRequest2) {
5196     ExecuteCommandRequest2.type = new messages_1.ProtocolRequestType("workspace/executeCommand");
5197   })(ExecuteCommandRequest = exports2.ExecuteCommandRequest || (exports2.ExecuteCommandRequest = {}));
5198   var ApplyWorkspaceEditRequest;
5199   (function(ApplyWorkspaceEditRequest2) {
5200     ApplyWorkspaceEditRequest2.type = new messages_1.ProtocolRequestType("workspace/applyEdit");
5201   })(ApplyWorkspaceEditRequest = exports2.ApplyWorkspaceEditRequest || (exports2.ApplyWorkspaceEditRequest = {}));
5202 });
5203
5204 // node_modules/vscode-languageserver-protocol/lib/common/connection.js
5205 var require_connection2 = __commonJS((exports2) => {
5206   "use strict";
5207   Object.defineProperty(exports2, "__esModule", {value: true});
5208   exports2.createProtocolConnection = void 0;
5209   var vscode_jsonrpc_1 = require_main();
5210   function createProtocolConnection(input, output, logger, options) {
5211     if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {
5212       options = {connectionStrategy: options};
5213     }
5214     return vscode_jsonrpc_1.createMessageConnection(input, output, logger, options);
5215   }
5216   exports2.createProtocolConnection = createProtocolConnection;
5217 });
5218
5219 // node_modules/vscode-languageserver-protocol/lib/common/api.js
5220 var require_api2 = __commonJS((exports2) => {
5221   "use strict";
5222   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
5223     if (k2 === void 0)
5224       k2 = k;
5225     Object.defineProperty(o, k2, {enumerable: true, get: function() {
5226       return m[k];
5227     }});
5228   } : function(o, m, k, k2) {
5229     if (k2 === void 0)
5230       k2 = k;
5231     o[k2] = m[k];
5232   });
5233   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
5234     for (var p in m)
5235       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
5236         __createBinding(exports3, m, p);
5237   };
5238   Object.defineProperty(exports2, "__esModule", {value: true});
5239   exports2.LSPErrorCodes = exports2.createProtocolConnection = void 0;
5240   __exportStar2(require_main(), exports2);
5241   __exportStar2(require_main2(), exports2);
5242   __exportStar2(require_messages2(), exports2);
5243   __exportStar2(require_protocol(), exports2);
5244   var connection_1 = require_connection2();
5245   Object.defineProperty(exports2, "createProtocolConnection", {enumerable: true, get: function() {
5246     return connection_1.createProtocolConnection;
5247   }});
5248   var LSPErrorCodes;
5249   (function(LSPErrorCodes2) {
5250     LSPErrorCodes2.lspReservedErrorRangeStart = -32899;
5251     LSPErrorCodes2.ContentModified = -32801;
5252     LSPErrorCodes2.RequestCancelled = -32800;
5253     LSPErrorCodes2.lspReservedErrorRangeEnd = -32800;
5254   })(LSPErrorCodes = exports2.LSPErrorCodes || (exports2.LSPErrorCodes = {}));
5255 });
5256
5257 // node_modules/vscode-languageserver-protocol/lib/node/main.js
5258 var require_main3 = __commonJS((exports2) => {
5259   "use strict";
5260   var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
5261     if (k2 === void 0)
5262       k2 = k;
5263     Object.defineProperty(o, k2, {enumerable: true, get: function() {
5264       return m[k];
5265     }});
5266   } : function(o, m, k, k2) {
5267     if (k2 === void 0)
5268       k2 = k;
5269     o[k2] = m[k];
5270   });
5271   var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
5272     for (var p in m)
5273       if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p))
5274         __createBinding(exports3, m, p);
5275   };
5276   Object.defineProperty(exports2, "__esModule", {value: true});
5277   exports2.createProtocolConnection = void 0;
5278   var node_1 = require_node();
5279   __exportStar2(require_node(), exports2);
5280   __exportStar2(require_api2(), exports2);
5281   function createProtocolConnection(input, output, logger, options) {
5282     return node_1.createMessageConnection(input, output, logger, options);
5283   }
5284   exports2.createProtocolConnection = createProtocolConnection;
5285 });
5286
5287 // node_modules/abort-controller/dist/abort-controller.mjs
5288 var require_abort_controller = __commonJS((exports2) => {
5289   __markAsModule(exports2);
5290   __export(exports2, {
5291     AbortController: () => AbortController,
5292     AbortSignal: () => AbortSignal,
5293     default: () => abort_controller_default
5294   });
5295   var AbortSignal = class extends EventTarget {
5296     constructor() {
5297       super();
5298       throw new TypeError("AbortSignal cannot be constructed directly");
5299     }
5300     get aborted() {
5301       const aborted = abortedFlags.get(this);
5302       if (typeof aborted !== "boolean") {
5303         throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
5304       }
5305       return aborted;
5306     }
5307   };
5308   defineEventAttribute(AbortSignal.prototype, "abort");
5309   function createAbortSignal() {
5310     const signal = Object.create(AbortSignal.prototype);
5311     EventTarget.call(signal);
5312     abortedFlags.set(signal, false);
5313     return signal;
5314   }
5315   function abortSignal(signal) {
5316     if (abortedFlags.get(signal) !== false) {
5317       return;
5318     }
5319     abortedFlags.set(signal, true);
5320     signal.dispatchEvent({type: "abort"});
5321   }
5322   var abortedFlags = new WeakMap();
5323   Object.defineProperties(AbortSignal.prototype, {
5324     aborted: {enumerable: true}
5325   });
5326   if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
5327     Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {
5328       configurable: true,
5329       value: "AbortSignal"
5330     });
5331   }
5332   var AbortController = class {
5333     constructor() {
5334       signals.set(this, createAbortSignal());
5335     }
5336     get signal() {
5337       return getSignal(this);
5338     }
5339     abort() {
5340       abortSignal(getSignal(this));
5341     }
5342   };
5343   var signals = new WeakMap();
5344   function getSignal(controller) {
5345     const signal = signals.get(controller);
5346     if (signal == null) {
5347       throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`);
5348     }
5349     return signal;
5350   }
5351   Object.defineProperties(AbortController.prototype, {
5352     signal: {enumerable: true},
5353     abort: {enumerable: true}
5354   });
5355   if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
5356     Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {
5357       configurable: true,
5358       value: "AbortController"
5359     });
5360   }
5361   var abort_controller_default = AbortController;
5362 });
5363
5364 // node_modules/node-fetch/lib/index.mjs
5365 var require_lib = __commonJS((exports2) => {
5366   __markAsModule(exports2);
5367   __export(exports2, {
5368     FetchError: () => FetchError,
5369     Headers: () => Headers,
5370     Request: () => Request,
5371     Response: () => Response,
5372     default: () => lib_default
5373   });
5374   var import_stream = __toModule(require("stream"));
5375   var import_http = __toModule(require("http"));
5376   var import_url = __toModule(require("url"));
5377   var import_https = __toModule(require("https"));
5378   var import_zlib = __toModule(require("zlib"));
5379   var Readable = import_stream.default.Readable;
5380   var BUFFER = Symbol("buffer");
5381   var TYPE = Symbol("type");
5382   var Blob = class {
5383     constructor() {
5384       this[TYPE] = "";
5385       const blobParts = arguments[0];
5386       const options = arguments[1];
5387       const buffers = [];
5388       let size = 0;
5389       if (blobParts) {
5390         const a = blobParts;
5391         const length = Number(a.length);
5392         for (let i = 0; i < length; i++) {
5393           const element = a[i];
5394           let buffer;
5395           if (element instanceof Buffer) {
5396             buffer = element;
5397           } else if (ArrayBuffer.isView(element)) {
5398             buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
5399           } else if (element instanceof ArrayBuffer) {
5400             buffer = Buffer.from(element);
5401           } else if (element instanceof Blob) {
5402             buffer = element[BUFFER];
5403           } else {
5404             buffer = Buffer.from(typeof element === "string" ? element : String(element));
5405           }
5406           size += buffer.length;
5407           buffers.push(buffer);
5408         }
5409       }
5410       this[BUFFER] = Buffer.concat(buffers);
5411       let type = options && options.type !== void 0 && String(options.type).toLowerCase();
5412       if (type && !/[^\u0020-\u007E]/.test(type)) {
5413         this[TYPE] = type;
5414       }
5415     }
5416     get size() {
5417       return this[BUFFER].length;
5418     }
5419     get type() {
5420       return this[TYPE];
5421     }
5422     text() {
5423       return Promise.resolve(this[BUFFER].toString());
5424     }
5425     arrayBuffer() {
5426       const buf = this[BUFFER];
5427       const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
5428       return Promise.resolve(ab);
5429     }
5430     stream() {
5431       const readable = new Readable();
5432       readable._read = function() {
5433       };
5434       readable.push(this[BUFFER]);
5435       readable.push(null);
5436       return readable;
5437     }
5438     toString() {
5439       return "[object Blob]";
5440     }
5441     slice() {
5442       const size = this.size;
5443       const start = arguments[0];
5444       const end = arguments[1];
5445       let relativeStart, relativeEnd;
5446       if (start === void 0) {
5447         relativeStart = 0;
5448       } else if (start < 0) {
5449         relativeStart = Math.max(size + start, 0);
5450       } else {
5451         relativeStart = Math.min(start, size);
5452       }
5453       if (end === void 0) {
5454         relativeEnd = size;
5455       } else if (end < 0) {
5456         relativeEnd = Math.max(size + end, 0);
5457       } else {
5458         relativeEnd = Math.min(end, size);
5459       }
5460       const span = Math.max(relativeEnd - relativeStart, 0);
5461       const buffer = this[BUFFER];
5462       const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
5463       const blob = new Blob([], {type: arguments[2]});
5464       blob[BUFFER] = slicedBuffer;
5465       return blob;
5466     }
5467   };
5468   Object.defineProperties(Blob.prototype, {
5469     size: {enumerable: true},
5470     type: {enumerable: true},
5471     slice: {enumerable: true}
5472   });
5473   Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
5474     value: "Blob",
5475     writable: false,
5476     enumerable: false,
5477     configurable: true
5478   });
5479   function FetchError(message, type, systemError) {
5480     Error.call(this, message);
5481     this.message = message;
5482     this.type = type;
5483     if (systemError) {
5484       this.code = this.errno = systemError.code;
5485     }
5486     Error.captureStackTrace(this, this.constructor);
5487   }
5488   FetchError.prototype = Object.create(Error.prototype);
5489   FetchError.prototype.constructor = FetchError;
5490   FetchError.prototype.name = "FetchError";
5491   var convert;
5492   try {
5493     convert = require("encoding").convert;
5494   } catch (e) {
5495   }
5496   var INTERNALS = Symbol("Body internals");
5497   var PassThrough = import_stream.default.PassThrough;
5498   function Body(body) {
5499     var _this = this;
5500     var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size;
5501     let size = _ref$size === void 0 ? 0 : _ref$size;
5502     var _ref$timeout = _ref.timeout;
5503     let timeout = _ref$timeout === void 0 ? 0 : _ref$timeout;
5504     if (body == null) {
5505       body = null;
5506     } else if (isURLSearchParams(body)) {
5507       body = Buffer.from(body.toString());
5508     } else if (isBlob(body))
5509       ;
5510     else if (Buffer.isBuffer(body))
5511       ;
5512     else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
5513       body = Buffer.from(body);
5514     } else if (ArrayBuffer.isView(body)) {
5515       body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
5516     } else if (body instanceof import_stream.default)
5517       ;
5518     else {
5519       body = Buffer.from(String(body));
5520     }
5521     this[INTERNALS] = {
5522       body,
5523       disturbed: false,
5524       error: null
5525     };
5526     this.size = size;
5527     this.timeout = timeout;
5528     if (body instanceof import_stream.default) {
5529       body.on("error", function(err) {
5530         const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err);
5531         _this[INTERNALS].error = error;
5532       });
5533     }
5534   }
5535   Body.prototype = {
5536     get body() {
5537       return this[INTERNALS].body;
5538     },
5539     get bodyUsed() {
5540       return this[INTERNALS].disturbed;
5541     },
5542     arrayBuffer() {
5543       return consumeBody.call(this).then(function(buf) {
5544         return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
5545       });
5546     },
5547     blob() {
5548       let ct = this.headers && this.headers.get("content-type") || "";
5549       return consumeBody.call(this).then(function(buf) {
5550         return Object.assign(new Blob([], {
5551           type: ct.toLowerCase()
5552         }), {
5553           [BUFFER]: buf
5554         });
5555       });
5556     },
5557     json() {
5558       var _this2 = this;
5559       return consumeBody.call(this).then(function(buffer) {
5560         try {
5561           return JSON.parse(buffer.toString());
5562         } catch (err) {
5563           return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json"));
5564         }
5565       });
5566     },
5567     text() {
5568       return consumeBody.call(this).then(function(buffer) {
5569         return buffer.toString();
5570       });
5571     },
5572     buffer() {
5573       return consumeBody.call(this);
5574     },
5575     textConverted() {
5576       var _this3 = this;
5577       return consumeBody.call(this).then(function(buffer) {
5578         return convertBody(buffer, _this3.headers);
5579       });
5580     }
5581   };
5582   Object.defineProperties(Body.prototype, {
5583     body: {enumerable: true},
5584     bodyUsed: {enumerable: true},
5585     arrayBuffer: {enumerable: true},
5586     blob: {enumerable: true},
5587     json: {enumerable: true},
5588     text: {enumerable: true}
5589   });
5590   Body.mixIn = function(proto) {
5591     for (const name of Object.getOwnPropertyNames(Body.prototype)) {
5592       if (!(name in proto)) {
5593         const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
5594         Object.defineProperty(proto, name, desc);
5595       }
5596     }
5597   };
5598   function consumeBody() {
5599     var _this4 = this;
5600     if (this[INTERNALS].disturbed) {
5601       return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
5602     }
5603     this[INTERNALS].disturbed = true;
5604     if (this[INTERNALS].error) {
5605       return Body.Promise.reject(this[INTERNALS].error);
5606     }
5607     let body = this.body;
5608     if (body === null) {
5609       return Body.Promise.resolve(Buffer.alloc(0));
5610     }
5611     if (isBlob(body)) {
5612       body = body.stream();
5613     }
5614     if (Buffer.isBuffer(body)) {
5615       return Body.Promise.resolve(body);
5616     }
5617     if (!(body instanceof import_stream.default)) {
5618       return Body.Promise.resolve(Buffer.alloc(0));
5619     }
5620     let accum = [];
5621     let accumBytes = 0;
5622     let abort = false;
5623     return new Body.Promise(function(resolve, reject) {
5624       let resTimeout;
5625       if (_this4.timeout) {
5626         resTimeout = setTimeout(function() {
5627           abort = true;
5628           reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout"));
5629         }, _this4.timeout);
5630       }
5631       body.on("error", function(err) {
5632         if (err.name === "AbortError") {
5633           abort = true;
5634           reject(err);
5635         } else {
5636           reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err));
5637         }
5638       });
5639       body.on("data", function(chunk) {
5640         if (abort || chunk === null) {
5641           return;
5642         }
5643         if (_this4.size && accumBytes + chunk.length > _this4.size) {
5644           abort = true;
5645           reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size"));
5646           return;
5647         }
5648         accumBytes += chunk.length;
5649         accum.push(chunk);
5650       });
5651       body.on("end", function() {
5652         if (abort) {
5653           return;
5654         }
5655         clearTimeout(resTimeout);
5656         try {
5657           resolve(Buffer.concat(accum, accumBytes));
5658         } catch (err) {
5659           reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
5660         }
5661       });
5662     });
5663   }
5664   function convertBody(buffer, headers) {
5665     if (typeof convert !== "function") {
5666       throw new Error("The package `encoding` must be installed to use the textConverted() function");
5667     }
5668     const ct = headers.get("content-type");
5669     let charset = "utf-8";
5670     let res, str;
5671     if (ct) {
5672       res = /charset=([^;]*)/i.exec(ct);
5673     }
5674     str = buffer.slice(0, 1024).toString();
5675     if (!res && str) {
5676       res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
5677     }
5678     if (!res && str) {
5679       res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
5680       if (!res) {
5681         res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
5682         if (res) {
5683           res.pop();
5684         }
5685       }
5686       if (res) {
5687         res = /charset=(.*)/i.exec(res.pop());
5688       }
5689     }
5690     if (!res && str) {
5691       res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
5692     }
5693     if (res) {
5694       charset = res.pop();
5695       if (charset === "gb2312" || charset === "gbk") {
5696         charset = "gb18030";
5697       }
5698     }
5699     return convert(buffer, "UTF-8", charset).toString();
5700   }
5701   function isURLSearchParams(obj) {
5702     if (typeof obj !== "object" || typeof obj.append !== "function" || typeof obj.delete !== "function" || typeof obj.get !== "function" || typeof obj.getAll !== "function" || typeof obj.has !== "function" || typeof obj.set !== "function") {
5703       return false;
5704     }
5705     return obj.constructor.name === "URLSearchParams" || Object.prototype.toString.call(obj) === "[object URLSearchParams]" || typeof obj.sort === "function";
5706   }
5707   function isBlob(obj) {
5708     return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
5709   }
5710   function clone(instance) {
5711     let p1, p2;
5712     let body = instance.body;
5713     if (instance.bodyUsed) {
5714       throw new Error("cannot clone body after it is used");
5715     }
5716     if (body instanceof import_stream.default && typeof body.getBoundary !== "function") {
5717       p1 = new PassThrough();
5718       p2 = new PassThrough();
5719       body.pipe(p1);
5720       body.pipe(p2);
5721       instance[INTERNALS].body = p1;
5722       body = p2;
5723     }
5724     return body;
5725   }
5726   function extractContentType(body) {
5727     if (body === null) {
5728       return null;
5729     } else if (typeof body === "string") {
5730       return "text/plain;charset=UTF-8";
5731     } else if (isURLSearchParams(body)) {
5732       return "application/x-www-form-urlencoded;charset=UTF-8";
5733     } else if (isBlob(body)) {
5734       return body.type || null;
5735     } else if (Buffer.isBuffer(body)) {
5736       return null;
5737     } else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
5738       return null;
5739     } else if (ArrayBuffer.isView(body)) {
5740       return null;
5741     } else if (typeof body.getBoundary === "function") {
5742       return `multipart/form-data;boundary=${body.getBoundary()}`;
5743     } else if (body instanceof import_stream.default) {
5744       return null;
5745     } else {
5746       return "text/plain;charset=UTF-8";
5747     }
5748   }
5749   function getTotalBytes(instance) {
5750     const body = instance.body;
5751     if (body === null) {
5752       return 0;
5753     } else if (isBlob(body)) {
5754       return body.size;
5755     } else if (Buffer.isBuffer(body)) {
5756       return body.length;
5757     } else if (body && typeof body.getLengthSync === "function") {
5758       if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || body.hasKnownLength && body.hasKnownLength()) {
5759         return body.getLengthSync();
5760       }
5761       return null;
5762     } else {
5763       return null;
5764     }
5765   }
5766   function writeToStream(dest, instance) {
5767     const body = instance.body;
5768     if (body === null) {
5769       dest.end();
5770     } else if (isBlob(body)) {
5771       body.stream().pipe(dest);
5772     } else if (Buffer.isBuffer(body)) {
5773       dest.write(body);
5774       dest.end();
5775     } else {
5776       body.pipe(dest);
5777     }
5778   }
5779   Body.Promise = global.Promise;
5780   var invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
5781   var invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
5782   function validateName(name) {
5783     name = `${name}`;
5784     if (invalidTokenRegex.test(name) || name === "") {
5785       throw new TypeError(`${name} is not a legal HTTP header name`);
5786     }
5787   }
5788   function validateValue(value) {
5789     value = `${value}`;
5790     if (invalidHeaderCharRegex.test(value)) {
5791       throw new TypeError(`${value} is not a legal HTTP header value`);
5792     }
5793   }
5794   function find(map, name) {
5795     name = name.toLowerCase();
5796     for (const key in map) {
5797       if (key.toLowerCase() === name) {
5798         return key;
5799       }
5800     }
5801     return void 0;
5802   }
5803   var MAP = Symbol("map");
5804   var Headers = class {
5805     constructor() {
5806       let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
5807       this[MAP] = Object.create(null);
5808       if (init instanceof Headers) {
5809         const rawHeaders = init.raw();
5810         const headerNames = Object.keys(rawHeaders);
5811         for (const headerName of headerNames) {
5812           for (const value of rawHeaders[headerName]) {
5813             this.append(headerName, value);
5814           }
5815         }
5816         return;
5817       }
5818       if (init == null)
5819         ;
5820       else if (typeof init === "object") {
5821         const method = init[Symbol.iterator];
5822         if (method != null) {
5823           if (typeof method !== "function") {
5824             throw new TypeError("Header pairs must be iterable");
5825           }
5826           const pairs = [];
5827           for (const pair of init) {
5828             if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") {
5829               throw new TypeError("Each header pair must be iterable");
5830             }
5831             pairs.push(Array.from(pair));
5832           }
5833           for (const pair of pairs) {
5834             if (pair.length !== 2) {
5835               throw new TypeError("Each header pair must be a name/value tuple");
5836             }
5837             this.append(pair[0], pair[1]);
5838           }
5839         } else {
5840           for (const key of Object.keys(init)) {
5841             const value = init[key];
5842             this.append(key, value);
5843           }
5844         }
5845       } else {
5846         throw new TypeError("Provided initializer must be an object");
5847       }
5848     }
5849     get(name) {
5850       name = `${name}`;
5851       validateName(name);
5852       const key = find(this[MAP], name);
5853       if (key === void 0) {
5854         return null;
5855       }
5856       return this[MAP][key].join(", ");
5857     }
5858     forEach(callback) {
5859       let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0;
5860       let pairs = getHeaders(this);
5861       let i = 0;
5862       while (i < pairs.length) {
5863         var _pairs$i = pairs[i];
5864         const name = _pairs$i[0], value = _pairs$i[1];
5865         callback.call(thisArg, value, name, this);
5866         pairs = getHeaders(this);
5867         i++;
5868       }
5869     }
5870     set(name, value) {
5871       name = `${name}`;
5872       value = `${value}`;
5873       validateName(name);
5874       validateValue(value);
5875       const key = find(this[MAP], name);
5876       this[MAP][key !== void 0 ? key : name] = [value];
5877     }
5878     append(name, value) {
5879       name = `${name}`;
5880       value = `${value}`;
5881       validateName(name);
5882       validateValue(value);
5883       const key = find(this[MAP], name);
5884       if (key !== void 0) {
5885         this[MAP][key].push(value);
5886       } else {
5887         this[MAP][name] = [value];
5888       }
5889     }
5890     has(name) {
5891       name = `${name}`;
5892       validateName(name);
5893       return find(this[MAP], name) !== void 0;
5894     }
5895     delete(name) {
5896       name = `${name}`;
5897       validateName(name);
5898       const key = find(this[MAP], name);
5899       if (key !== void 0) {
5900         delete this[MAP][key];
5901       }
5902     }
5903     raw() {
5904       return this[MAP];
5905     }
5906     keys() {
5907       return createHeadersIterator(this, "key");
5908     }
5909     values() {
5910       return createHeadersIterator(this, "value");
5911     }
5912     [Symbol.iterator]() {
5913       return createHeadersIterator(this, "key+value");
5914     }
5915   };
5916   Headers.prototype.entries = Headers.prototype[Symbol.iterator];
5917   Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
5918     value: "Headers",
5919     writable: false,
5920     enumerable: false,
5921     configurable: true
5922   });
5923   Object.defineProperties(Headers.prototype, {
5924     get: {enumerable: true},
5925     forEach: {enumerable: true},
5926     set: {enumerable: true},
5927     append: {enumerable: true},
5928     has: {enumerable: true},
5929     delete: {enumerable: true},
5930     keys: {enumerable: true},
5931     values: {enumerable: true},
5932     entries: {enumerable: true}
5933   });
5934   function getHeaders(headers) {
5935     let kind = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "key+value";
5936     const keys = Object.keys(headers[MAP]).sort();
5937     return keys.map(kind === "key" ? function(k) {
5938       return k.toLowerCase();
5939     } : kind === "value" ? function(k) {
5940       return headers[MAP][k].join(", ");
5941     } : function(k) {
5942       return [k.toLowerCase(), headers[MAP][k].join(", ")];
5943     });
5944   }
5945   var INTERNAL = Symbol("internal");
5946   function createHeadersIterator(target, kind) {
5947     const iterator = Object.create(HeadersIteratorPrototype);
5948     iterator[INTERNAL] = {
5949       target,
5950       kind,
5951       index: 0
5952     };
5953     return iterator;
5954   }
5955   var HeadersIteratorPrototype = Object.setPrototypeOf({
5956     next() {
5957       if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
5958         throw new TypeError("Value of `this` is not a HeadersIterator");
5959       }
5960       var _INTERNAL = this[INTERNAL];
5961       const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index;
5962       const values = getHeaders(target, kind);
5963       const len = values.length;
5964       if (index >= len) {
5965         return {
5966           value: void 0,
5967           done: true
5968         };
5969       }
5970       this[INTERNAL].index = index + 1;
5971       return {
5972         value: values[index],
5973         done: false
5974       };
5975     }
5976   }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
5977   Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
5978     value: "HeadersIterator",
5979     writable: false,
5980     enumerable: false,
5981     configurable: true
5982   });
5983   function exportNodeCompatibleHeaders(headers) {
5984     const obj = Object.assign({__proto__: null}, headers[MAP]);
5985     const hostHeaderKey = find(headers[MAP], "Host");
5986     if (hostHeaderKey !== void 0) {
5987       obj[hostHeaderKey] = obj[hostHeaderKey][0];
5988     }
5989     return obj;
5990   }
5991   function createHeadersLenient(obj) {
5992     const headers = new Headers();
5993     for (const name of Object.keys(obj)) {
5994       if (invalidTokenRegex.test(name)) {
5995         continue;
5996       }
5997       if (Array.isArray(obj[name])) {
5998         for (const val of obj[name]) {
5999           if (invalidHeaderCharRegex.test(val)) {
6000             continue;
6001           }
6002           if (headers[MAP][name] === void 0) {
6003             headers[MAP][name] = [val];
6004           } else {
6005             headers[MAP][name].push(val);
6006           }
6007         }
6008       } else if (!invalidHeaderCharRegex.test(obj[name])) {
6009         headers[MAP][name] = [obj[name]];
6010       }
6011     }
6012     return headers;
6013   }
6014   var INTERNALS$1 = Symbol("Response internals");
6015   var STATUS_CODES = import_http.default.STATUS_CODES;
6016   var Response = class {
6017     constructor() {
6018       let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
6019       let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6020       Body.call(this, body, opts);
6021       const status = opts.status || 200;
6022       const headers = new Headers(opts.headers);
6023       if (body != null && !headers.has("Content-Type")) {
6024         const contentType = extractContentType(body);
6025         if (contentType) {
6026           headers.append("Content-Type", contentType);
6027         }
6028       }
6029       this[INTERNALS$1] = {
6030         url: opts.url,
6031         status,
6032         statusText: opts.statusText || STATUS_CODES[status],
6033         headers,
6034         counter: opts.counter
6035       };
6036     }
6037     get url() {
6038       return this[INTERNALS$1].url || "";
6039     }
6040     get status() {
6041       return this[INTERNALS$1].status;
6042     }
6043     get ok() {
6044       return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
6045     }
6046     get redirected() {
6047       return this[INTERNALS$1].counter > 0;
6048     }
6049     get statusText() {
6050       return this[INTERNALS$1].statusText;
6051     }
6052     get headers() {
6053       return this[INTERNALS$1].headers;
6054     }
6055     clone() {
6056       return new Response(clone(this), {
6057         url: this.url,
6058         status: this.status,
6059         statusText: this.statusText,
6060         headers: this.headers,
6061         ok: this.ok,
6062         redirected: this.redirected
6063       });
6064     }
6065   };
6066   Body.mixIn(Response.prototype);
6067   Object.defineProperties(Response.prototype, {
6068     url: {enumerable: true},
6069     status: {enumerable: true},
6070     ok: {enumerable: true},
6071     redirected: {enumerable: true},
6072     statusText: {enumerable: true},
6073     headers: {enumerable: true},
6074     clone: {enumerable: true}
6075   });
6076   Object.defineProperty(Response.prototype, Symbol.toStringTag, {
6077     value: "Response",
6078     writable: false,
6079     enumerable: false,
6080     configurable: true
6081   });
6082   var INTERNALS$2 = Symbol("Request internals");
6083   var parse_url = import_url.default.parse;
6084   var format_url = import_url.default.format;
6085   var streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype;
6086   function isRequest(input) {
6087     return typeof input === "object" && typeof input[INTERNALS$2] === "object";
6088   }
6089   function isAbortSignal(signal) {
6090     const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal);
6091     return !!(proto && proto.constructor.name === "AbortSignal");
6092   }
6093   var Request = class {
6094     constructor(input) {
6095       let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6096       let parsedURL;
6097       if (!isRequest(input)) {
6098         if (input && input.href) {
6099           parsedURL = parse_url(input.href);
6100         } else {
6101           parsedURL = parse_url(`${input}`);
6102         }
6103         input = {};
6104       } else {
6105         parsedURL = parse_url(input.url);
6106       }
6107       let method = init.method || input.method || "GET";
6108       method = method.toUpperCase();
6109       if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
6110         throw new TypeError("Request with GET/HEAD method cannot have body");
6111       }
6112       let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
6113       Body.call(this, inputBody, {
6114         timeout: init.timeout || input.timeout || 0,
6115         size: init.size || input.size || 0
6116       });
6117       const headers = new Headers(init.headers || input.headers || {});
6118       if (inputBody != null && !headers.has("Content-Type")) {
6119         const contentType = extractContentType(inputBody);
6120         if (contentType) {
6121           headers.append("Content-Type", contentType);
6122         }
6123       }
6124       let signal = isRequest(input) ? input.signal : null;
6125       if ("signal" in init)
6126         signal = init.signal;
6127       if (signal != null && !isAbortSignal(signal)) {
6128         throw new TypeError("Expected signal to be an instanceof AbortSignal");
6129       }
6130       this[INTERNALS$2] = {
6131         method,
6132         redirect: init.redirect || input.redirect || "follow",
6133         headers,
6134         parsedURL,
6135         signal
6136       };
6137       this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20;
6138       this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true;
6139       this.counter = init.counter || input.counter || 0;
6140       this.agent = init.agent || input.agent;
6141     }
6142     get method() {
6143       return this[INTERNALS$2].method;
6144     }
6145     get url() {
6146       return format_url(this[INTERNALS$2].parsedURL);
6147     }
6148     get headers() {
6149       return this[INTERNALS$2].headers;
6150     }
6151     get redirect() {
6152       return this[INTERNALS$2].redirect;
6153     }
6154     get signal() {
6155       return this[INTERNALS$2].signal;
6156     }
6157     clone() {
6158       return new Request(this);
6159     }
6160   };
6161   Body.mixIn(Request.prototype);
6162   Object.defineProperty(Request.prototype, Symbol.toStringTag, {
6163     value: "Request",
6164     writable: false,
6165     enumerable: false,
6166     configurable: true
6167   });
6168   Object.defineProperties(Request.prototype, {
6169     method: {enumerable: true},
6170     url: {enumerable: true},
6171     headers: {enumerable: true},
6172     redirect: {enumerable: true},
6173     clone: {enumerable: true},
6174     signal: {enumerable: true}
6175   });
6176   function getNodeRequestOptions(request) {
6177     const parsedURL = request[INTERNALS$2].parsedURL;
6178     const headers = new Headers(request[INTERNALS$2].headers);
6179     if (!headers.has("Accept")) {
6180       headers.set("Accept", "*/*");
6181     }
6182     if (!parsedURL.protocol || !parsedURL.hostname) {
6183       throw new TypeError("Only absolute URLs are supported");
6184     }
6185     if (!/^https?:$/.test(parsedURL.protocol)) {
6186       throw new TypeError("Only HTTP(S) protocols are supported");
6187     }
6188     if (request.signal && request.body instanceof import_stream.default.Readable && !streamDestructionSupported) {
6189       throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");
6190     }
6191     let contentLengthValue = null;
6192     if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
6193       contentLengthValue = "0";
6194     }
6195     if (request.body != null) {
6196       const totalBytes = getTotalBytes(request);
6197       if (typeof totalBytes === "number") {
6198         contentLengthValue = String(totalBytes);
6199       }
6200     }
6201     if (contentLengthValue) {
6202       headers.set("Content-Length", contentLengthValue);
6203     }
6204     if (!headers.has("User-Agent")) {
6205       headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)");
6206     }
6207     if (request.compress && !headers.has("Accept-Encoding")) {
6208       headers.set("Accept-Encoding", "gzip,deflate");
6209     }
6210     let agent = request.agent;
6211     if (typeof agent === "function") {
6212       agent = agent(parsedURL);
6213     }
6214     if (!headers.has("Connection") && !agent) {
6215       headers.set("Connection", "close");
6216     }
6217     return Object.assign({}, parsedURL, {
6218       method: request.method,
6219       headers: exportNodeCompatibleHeaders(headers),
6220       agent
6221     });
6222   }
6223   function AbortError(message) {
6224     Error.call(this, message);
6225     this.type = "aborted";
6226     this.message = message;
6227     Error.captureStackTrace(this, this.constructor);
6228   }
6229   AbortError.prototype = Object.create(Error.prototype);
6230   AbortError.prototype.constructor = AbortError;
6231   AbortError.prototype.name = "AbortError";
6232   var PassThrough$1 = import_stream.default.PassThrough;
6233   var resolve_url = import_url.default.resolve;
6234   function fetch(url, opts) {
6235     if (!fetch.Promise) {
6236       throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
6237     }
6238     Body.Promise = fetch.Promise;
6239     return new fetch.Promise(function(resolve, reject) {
6240       const request = new Request(url, opts);
6241       const options = getNodeRequestOptions(request);
6242       const send = (options.protocol === "https:" ? import_https.default : import_http.default).request;
6243       const signal = request.signal;
6244       let response = null;
6245       const abort = function abort2() {
6246         let error = new AbortError("The user aborted a request.");
6247         reject(error);
6248         if (request.body && request.body instanceof import_stream.default.Readable) {
6249           request.body.destroy(error);
6250         }
6251         if (!response || !response.body)
6252           return;
6253         response.body.emit("error", error);
6254       };
6255       if (signal && signal.aborted) {
6256         abort();
6257         return;
6258       }
6259       const abortAndFinalize = function abortAndFinalize2() {
6260         abort();
6261         finalize();
6262       };
6263       const req = send(options);
6264       let reqTimeout;
6265       if (signal) {
6266         signal.addEventListener("abort", abortAndFinalize);
6267       }
6268       function finalize() {
6269         req.abort();
6270         if (signal)
6271           signal.removeEventListener("abort", abortAndFinalize);
6272         clearTimeout(reqTimeout);
6273       }
6274       if (request.timeout) {
6275         req.once("socket", function(socket) {
6276           reqTimeout = setTimeout(function() {
6277             reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout"));
6278             finalize();
6279           }, request.timeout);
6280         });
6281       }
6282       req.on("error", function(err) {
6283         reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err));
6284         finalize();
6285       });
6286       req.on("response", function(res) {
6287         clearTimeout(reqTimeout);
6288         const headers = createHeadersLenient(res.headers);
6289         if (fetch.isRedirect(res.statusCode)) {
6290           const location = headers.get("Location");
6291           const locationURL = location === null ? null : resolve_url(request.url, location);
6292           switch (request.redirect) {
6293             case "error":
6294               reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect"));
6295               finalize();
6296               return;
6297             case "manual":
6298               if (locationURL !== null) {
6299                 try {
6300                   headers.set("Location", locationURL);
6301                 } catch (err) {
6302                   reject(err);
6303                 }
6304               }
6305               break;
6306             case "follow":
6307               if (locationURL === null) {
6308                 break;
6309               }
6310               if (request.counter >= request.follow) {
6311                 reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect"));
6312                 finalize();
6313                 return;
6314               }
6315               const requestOpts = {
6316                 headers: new Headers(request.headers),
6317                 follow: request.follow,
6318                 counter: request.counter + 1,
6319                 agent: request.agent,
6320                 compress: request.compress,
6321                 method: request.method,
6322                 body: request.body,
6323                 signal: request.signal,
6324                 timeout: request.timeout,
6325                 size: request.size
6326               };
6327               if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
6328                 reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect"));
6329                 finalize();
6330                 return;
6331               }
6332               if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === "POST") {
6333                 requestOpts.method = "GET";
6334                 requestOpts.body = void 0;
6335                 requestOpts.headers.delete("content-length");
6336               }
6337               resolve(fetch(new Request(locationURL, requestOpts)));
6338               finalize();
6339               return;
6340           }
6341         }
6342         res.once("end", function() {
6343           if (signal)
6344             signal.removeEventListener("abort", abortAndFinalize);
6345         });
6346         let body = res.pipe(new PassThrough$1());
6347         const response_options = {
6348           url: request.url,
6349           status: res.statusCode,
6350           statusText: res.statusMessage,
6351           headers,
6352           size: request.size,
6353           timeout: request.timeout,
6354           counter: request.counter
6355         };
6356         const codings = headers.get("Content-Encoding");
6357         if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
6358           response = new Response(body, response_options);
6359           resolve(response);
6360           return;
6361         }
6362         const zlibOptions = {
6363           flush: import_zlib.default.Z_SYNC_FLUSH,
6364           finishFlush: import_zlib.default.Z_SYNC_FLUSH
6365         };
6366         if (codings == "gzip" || codings == "x-gzip") {
6367           body = body.pipe(import_zlib.default.createGunzip(zlibOptions));
6368           response = new Response(body, response_options);
6369           resolve(response);
6370           return;
6371         }
6372         if (codings == "deflate" || codings == "x-deflate") {
6373           const raw = res.pipe(new PassThrough$1());
6374           raw.once("data", function(chunk) {
6375             if ((chunk[0] & 15) === 8) {
6376               body = body.pipe(import_zlib.default.createInflate());
6377             } else {
6378               body = body.pipe(import_zlib.default.createInflateRaw());
6379             }
6380             response = new Response(body, response_options);
6381             resolve(response);
6382           });
6383           return;
6384         }
6385         if (codings == "br" && typeof import_zlib.default.createBrotliDecompress === "function") {
6386           body = body.pipe(import_zlib.default.createBrotliDecompress());
6387           response = new Response(body, response_options);
6388           resolve(response);
6389           return;
6390         }
6391         response = new Response(body, response_options);
6392         resolve(response);
6393       });
6394       writeToStream(req, request);
6395     });
6396   }
6397   fetch.isRedirect = function(code) {
6398     return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
6399   };
6400   fetch.Promise = global.Promise;
6401   var lib_default = fetch;
6402 });
6403
6404 // node_modules/picomatch/lib/constants.js
6405 var require_constants = __commonJS((exports2, module2) => {
6406   "use strict";
6407   var path = require("path");
6408   var WIN_SLASH = "\\\\/";
6409   var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
6410   var DOT_LITERAL = "\\.";
6411   var PLUS_LITERAL = "\\+";
6412   var QMARK_LITERAL = "\\?";
6413   var SLASH_LITERAL = "\\/";
6414   var ONE_CHAR = "(?=.)";
6415   var QMARK = "[^/]";
6416   var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
6417   var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
6418   var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
6419   var NO_DOT = `(?!${DOT_LITERAL})`;
6420   var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
6421   var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
6422   var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
6423   var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
6424   var STAR = `${QMARK}*?`;
6425   var POSIX_CHARS = {
6426     DOT_LITERAL,
6427     PLUS_LITERAL,
6428     QMARK_LITERAL,
6429     SLASH_LITERAL,
6430     ONE_CHAR,
6431     QMARK,
6432     END_ANCHOR,
6433     DOTS_SLASH,
6434     NO_DOT,
6435     NO_DOTS,
6436     NO_DOT_SLASH,
6437     NO_DOTS_SLASH,
6438     QMARK_NO_DOT,
6439     STAR,
6440     START_ANCHOR
6441   };
6442   var WINDOWS_CHARS = {
6443     ...POSIX_CHARS,
6444     SLASH_LITERAL: `[${WIN_SLASH}]`,
6445     QMARK: WIN_NO_SLASH,
6446     STAR: `${WIN_NO_SLASH}*?`,
6447     DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
6448     NO_DOT: `(?!${DOT_LITERAL})`,
6449     NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6450     NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
6451     NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
6452     QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
6453     START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
6454     END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
6455   };
6456   var POSIX_REGEX_SOURCE = {
6457     alnum: "a-zA-Z0-9",
6458     alpha: "a-zA-Z",
6459     ascii: "\\x00-\\x7F",
6460     blank: " \\t",
6461     cntrl: "\\x00-\\x1F\\x7F",
6462     digit: "0-9",
6463     graph: "\\x21-\\x7E",
6464     lower: "a-z",
6465     print: "\\x20-\\x7E ",
6466     punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
6467     space: " \\t\\r\\n\\v\\f",
6468     upper: "A-Z",
6469     word: "A-Za-z0-9_",
6470     xdigit: "A-Fa-f0-9"
6471   };
6472   module2.exports = {
6473     MAX_LENGTH: 1024 * 64,
6474     POSIX_REGEX_SOURCE,
6475     REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
6476     REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
6477     REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
6478     REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
6479     REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
6480     REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
6481     REPLACEMENTS: {
6482       "***": "*",
6483       "**/**": "**",
6484       "**/**/**": "**"
6485     },
6486     CHAR_0: 48,
6487     CHAR_9: 57,
6488     CHAR_UPPERCASE_A: 65,
6489     CHAR_LOWERCASE_A: 97,
6490     CHAR_UPPERCASE_Z: 90,
6491     CHAR_LOWERCASE_Z: 122,
6492     CHAR_LEFT_PARENTHESES: 40,
6493     CHAR_RIGHT_PARENTHESES: 41,
6494     CHAR_ASTERISK: 42,
6495     CHAR_AMPERSAND: 38,
6496     CHAR_AT: 64,
6497     CHAR_BACKWARD_SLASH: 92,
6498     CHAR_CARRIAGE_RETURN: 13,
6499     CHAR_CIRCUMFLEX_ACCENT: 94,
6500     CHAR_COLON: 58,
6501     CHAR_COMMA: 44,
6502     CHAR_DOT: 46,
6503     CHAR_DOUBLE_QUOTE: 34,
6504     CHAR_EQUAL: 61,
6505     CHAR_EXCLAMATION_MARK: 33,
6506     CHAR_FORM_FEED: 12,
6507     CHAR_FORWARD_SLASH: 47,
6508     CHAR_GRAVE_ACCENT: 96,
6509     CHAR_HASH: 35,
6510     CHAR_HYPHEN_MINUS: 45,
6511     CHAR_LEFT_ANGLE_BRACKET: 60,
6512     CHAR_LEFT_CURLY_BRACE: 123,
6513     CHAR_LEFT_SQUARE_BRACKET: 91,
6514     CHAR_LINE_FEED: 10,
6515     CHAR_NO_BREAK_SPACE: 160,
6516     CHAR_PERCENT: 37,
6517     CHAR_PLUS: 43,
6518     CHAR_QUESTION_MARK: 63,
6519     CHAR_RIGHT_ANGLE_BRACKET: 62,
6520     CHAR_RIGHT_CURLY_BRACE: 125,
6521     CHAR_RIGHT_SQUARE_BRACKET: 93,
6522     CHAR_SEMICOLON: 59,
6523     CHAR_SINGLE_QUOTE: 39,
6524     CHAR_SPACE: 32,
6525     CHAR_TAB: 9,
6526     CHAR_UNDERSCORE: 95,
6527     CHAR_VERTICAL_LINE: 124,
6528     CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
6529     SEP: path.sep,
6530     extglobChars(chars) {
6531       return {
6532         "!": {type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})`},
6533         "?": {type: "qmark", open: "(?:", close: ")?"},
6534         "+": {type: "plus", open: "(?:", close: ")+"},
6535         "*": {type: "star", open: "(?:", close: ")*"},
6536         "@": {type: "at", open: "(?:", close: ")"}
6537       };
6538     },
6539     globChars(win32) {
6540       return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
6541     }
6542   };
6543 });
6544
6545 // node_modules/picomatch/lib/utils.js
6546 var require_utils = __commonJS((exports2) => {
6547   "use strict";
6548   var path = require("path");
6549   var win32 = process.platform === "win32";
6550   var {
6551     REGEX_BACKSLASH,
6552     REGEX_REMOVE_BACKSLASH,
6553     REGEX_SPECIAL_CHARS,
6554     REGEX_SPECIAL_CHARS_GLOBAL
6555   } = require_constants();
6556   exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
6557   exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
6558   exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
6559   exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
6560   exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
6561   exports2.removeBackslashes = (str) => {
6562     return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
6563       return match === "\\" ? "" : match;
6564     });
6565   };
6566   exports2.supportsLookbehinds = () => {
6567     const segs = process.version.slice(1).split(".").map(Number);
6568     if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
6569       return true;
6570     }
6571     return false;
6572   };
6573   exports2.isWindows = (options) => {
6574     if (options && typeof options.windows === "boolean") {
6575       return options.windows;
6576     }
6577     return win32 === true || path.sep === "\\";
6578   };
6579   exports2.escapeLast = (input, char, lastIdx) => {
6580     const idx = input.lastIndexOf(char, lastIdx);
6581     if (idx === -1)
6582       return input;
6583     if (input[idx - 1] === "\\")
6584       return exports2.escapeLast(input, char, idx - 1);
6585     return `${input.slice(0, idx)}\\${input.slice(idx)}`;
6586   };
6587   exports2.removePrefix = (input, state = {}) => {
6588     let output = input;
6589     if (output.startsWith("./")) {
6590       output = output.slice(2);
6591       state.prefix = "./";
6592     }
6593     return output;
6594   };
6595   exports2.wrapOutput = (input, state = {}, options = {}) => {
6596     const prepend = options.contains ? "" : "^";
6597     const append = options.contains ? "" : "$";
6598     let output = `${prepend}(?:${input})${append}`;
6599     if (state.negated === true) {
6600       output = `(?:^(?!${output}).*$)`;
6601     }
6602     return output;
6603   };
6604 });
6605
6606 // node_modules/picomatch/lib/scan.js
6607 var require_scan = __commonJS((exports2, module2) => {
6608   "use strict";
6609   var utils = require_utils();
6610   var {
6611     CHAR_ASTERISK,
6612     CHAR_AT,
6613     CHAR_BACKWARD_SLASH,
6614     CHAR_COMMA,
6615     CHAR_DOT,
6616     CHAR_EXCLAMATION_MARK,
6617     CHAR_FORWARD_SLASH,
6618     CHAR_LEFT_CURLY_BRACE,
6619     CHAR_LEFT_PARENTHESES,
6620     CHAR_LEFT_SQUARE_BRACKET,
6621     CHAR_PLUS,
6622     CHAR_QUESTION_MARK,
6623     CHAR_RIGHT_CURLY_BRACE,
6624     CHAR_RIGHT_PARENTHESES,
6625     CHAR_RIGHT_SQUARE_BRACKET
6626   } = require_constants();
6627   var isPathSeparator = (code) => {
6628     return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
6629   };
6630   var depth = (token) => {
6631     if (token.isPrefix !== true) {
6632       token.depth = token.isGlobstar ? Infinity : 1;
6633     }
6634   };
6635   var scan = (input, options) => {
6636     const opts = options || {};
6637     const length = input.length - 1;
6638     const scanToEnd = opts.parts === true || opts.scanToEnd === true;
6639     const slashes = [];
6640     const tokens = [];
6641     const parts = [];
6642     let str = input;
6643     let index = -1;
6644     let start = 0;
6645     let lastIndex = 0;
6646     let isBrace = false;
6647     let isBracket = false;
6648     let isGlob = false;
6649     let isExtglob = false;
6650     let isGlobstar = false;
6651     let braceEscaped = false;
6652     let backslashes = false;
6653     let negated = false;
6654     let finished = false;
6655     let braces = 0;
6656     let prev;
6657     let code;
6658     let token = {value: "", depth: 0, isGlob: false};
6659     const eos = () => index >= length;
6660     const peek = () => str.charCodeAt(index + 1);
6661     const advance = () => {
6662       prev = code;
6663       return str.charCodeAt(++index);
6664     };
6665     while (index < length) {
6666       code = advance();
6667       let next;
6668       if (code === CHAR_BACKWARD_SLASH) {
6669         backslashes = token.backslashes = true;
6670         code = advance();
6671         if (code === CHAR_LEFT_CURLY_BRACE) {
6672           braceEscaped = true;
6673         }
6674         continue;
6675       }
6676       if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
6677         braces++;
6678         while (eos() !== true && (code = advance())) {
6679           if (code === CHAR_BACKWARD_SLASH) {
6680             backslashes = token.backslashes = true;
6681             advance();
6682             continue;
6683           }
6684           if (code === CHAR_LEFT_CURLY_BRACE) {
6685             braces++;
6686             continue;
6687           }
6688           if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
6689             isBrace = token.isBrace = true;
6690             isGlob = token.isGlob = true;
6691             finished = true;
6692             if (scanToEnd === true) {
6693               continue;
6694             }
6695             break;
6696           }
6697           if (braceEscaped !== true && code === CHAR_COMMA) {
6698             isBrace = token.isBrace = true;
6699             isGlob = token.isGlob = true;
6700             finished = true;
6701             if (scanToEnd === true) {
6702               continue;
6703             }
6704             break;
6705           }
6706           if (code === CHAR_RIGHT_CURLY_BRACE) {
6707             braces--;
6708             if (braces === 0) {
6709               braceEscaped = false;
6710               isBrace = token.isBrace = true;
6711               finished = true;
6712               break;
6713             }
6714           }
6715         }
6716         if (scanToEnd === true) {
6717           continue;
6718         }
6719         break;
6720       }
6721       if (code === CHAR_FORWARD_SLASH) {
6722         slashes.push(index);
6723         tokens.push(token);
6724         token = {value: "", depth: 0, isGlob: false};
6725         if (finished === true)
6726           continue;
6727         if (prev === CHAR_DOT && index === start + 1) {
6728           start += 2;
6729           continue;
6730         }
6731         lastIndex = index + 1;
6732         continue;
6733       }
6734       if (opts.noext !== true) {
6735         const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
6736         if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
6737           isGlob = token.isGlob = true;
6738           isExtglob = token.isExtglob = true;
6739           finished = true;
6740           if (scanToEnd === true) {
6741             while (eos() !== true && (code = advance())) {
6742               if (code === CHAR_BACKWARD_SLASH) {
6743                 backslashes = token.backslashes = true;
6744                 code = advance();
6745                 continue;
6746               }
6747               if (code === CHAR_RIGHT_PARENTHESES) {
6748                 isGlob = token.isGlob = true;
6749                 finished = true;
6750                 break;
6751               }
6752             }
6753             continue;
6754           }
6755           break;
6756         }
6757       }
6758       if (code === CHAR_ASTERISK) {
6759         if (prev === CHAR_ASTERISK)
6760           isGlobstar = token.isGlobstar = true;
6761         isGlob = token.isGlob = true;
6762         finished = true;
6763         if (scanToEnd === true) {
6764           continue;
6765         }
6766         break;
6767       }
6768       if (code === CHAR_QUESTION_MARK) {
6769         isGlob = token.isGlob = true;
6770         finished = true;
6771         if (scanToEnd === true) {
6772           continue;
6773         }
6774         break;
6775       }
6776       if (code === CHAR_LEFT_SQUARE_BRACKET) {
6777         while (eos() !== true && (next = advance())) {
6778           if (next === CHAR_BACKWARD_SLASH) {
6779             backslashes = token.backslashes = true;
6780             advance();
6781             continue;
6782           }
6783           if (next === CHAR_RIGHT_SQUARE_BRACKET) {
6784             isBracket = token.isBracket = true;
6785             isGlob = token.isGlob = true;
6786             finished = true;
6787             if (scanToEnd === true) {
6788               continue;
6789             }
6790             break;
6791           }
6792         }
6793       }
6794       if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
6795         negated = token.negated = true;
6796         start++;
6797         continue;
6798       }
6799       if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
6800         isGlob = token.isGlob = true;
6801         if (scanToEnd === true) {
6802           while (eos() !== true && (code = advance())) {
6803             if (code === CHAR_LEFT_PARENTHESES) {
6804               backslashes = token.backslashes = true;
6805               code = advance();
6806               continue;
6807             }
6808             if (code === CHAR_RIGHT_PARENTHESES) {
6809               finished = true;
6810               break;
6811             }
6812           }
6813           continue;
6814         }
6815         break;
6816       }
6817       if (isGlob === true) {
6818         finished = true;
6819         if (scanToEnd === true) {
6820           continue;
6821         }
6822         break;
6823       }
6824     }
6825     if (opts.noext === true) {
6826       isExtglob = false;
6827       isGlob = false;
6828     }
6829     let base = str;
6830     let prefix = "";
6831     let glob = "";
6832     if (start > 0) {
6833       prefix = str.slice(0, start);
6834       str = str.slice(start);
6835       lastIndex -= start;
6836     }
6837     if (base && isGlob === true && lastIndex > 0) {
6838       base = str.slice(0, lastIndex);
6839       glob = str.slice(lastIndex);
6840     } else if (isGlob === true) {
6841       base = "";
6842       glob = str;
6843     } else {
6844       base = str;
6845     }
6846     if (base && base !== "" && base !== "/" && base !== str) {
6847       if (isPathSeparator(base.charCodeAt(base.length - 1))) {
6848         base = base.slice(0, -1);
6849       }
6850     }
6851     if (opts.unescape === true) {
6852       if (glob)
6853         glob = utils.removeBackslashes(glob);
6854       if (base && backslashes === true) {
6855         base = utils.removeBackslashes(base);
6856       }
6857     }
6858     const state = {
6859       prefix,
6860       input,
6861       start,
6862       base,
6863       glob,
6864       isBrace,
6865       isBracket,
6866       isGlob,
6867       isExtglob,
6868       isGlobstar,
6869       negated
6870     };
6871     if (opts.tokens === true) {
6872       state.maxDepth = 0;
6873       if (!isPathSeparator(code)) {
6874         tokens.push(token);
6875       }
6876       state.tokens = tokens;
6877     }
6878     if (opts.parts === true || opts.tokens === true) {
6879       let prevIndex;
6880       for (let idx = 0; idx < slashes.length; idx++) {
6881         const n = prevIndex ? prevIndex + 1 : start;
6882         const i = slashes[idx];
6883         const value = input.slice(n, i);
6884         if (opts.tokens) {
6885           if (idx === 0 && start !== 0) {
6886             tokens[idx].isPrefix = true;
6887             tokens[idx].value = prefix;
6888           } else {
6889             tokens[idx].value = value;
6890           }
6891           depth(tokens[idx]);
6892           state.maxDepth += tokens[idx].depth;
6893         }
6894         if (idx !== 0 || value !== "") {
6895           parts.push(value);
6896         }
6897         prevIndex = i;
6898       }
6899       if (prevIndex && prevIndex + 1 < input.length) {
6900         const value = input.slice(prevIndex + 1);
6901         parts.push(value);
6902         if (opts.tokens) {
6903           tokens[tokens.length - 1].value = value;
6904           depth(tokens[tokens.length - 1]);
6905           state.maxDepth += tokens[tokens.length - 1].depth;
6906         }
6907       }
6908       state.slashes = slashes;
6909       state.parts = parts;
6910     }
6911     return state;
6912   };
6913   module2.exports = scan;
6914 });
6915
6916 // node_modules/picomatch/lib/parse.js
6917 var require_parse = __commonJS((exports2, module2) => {
6918   "use strict";
6919   var constants = require_constants();
6920   var utils = require_utils();
6921   var {
6922     MAX_LENGTH,
6923     POSIX_REGEX_SOURCE,
6924     REGEX_NON_SPECIAL_CHARS,
6925     REGEX_SPECIAL_CHARS_BACKREF,
6926     REPLACEMENTS
6927   } = constants;
6928   var expandRange = (args, options) => {
6929     if (typeof options.expandRange === "function") {
6930       return options.expandRange(...args, options);
6931     }
6932     args.sort();
6933     const value = `[${args.join("-")}]`;
6934     try {
6935       new RegExp(value);
6936     } catch (ex) {
6937       return args.map((v) => utils.escapeRegex(v)).join("..");
6938     }
6939     return value;
6940   };
6941   var syntaxError = (type, char) => {
6942     return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
6943   };
6944   var parse = (input, options) => {
6945     if (typeof input !== "string") {
6946       throw new TypeError("Expected a string");
6947     }
6948     input = REPLACEMENTS[input] || input;
6949     const opts = {...options};
6950     const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
6951     let len = input.length;
6952     if (len > max) {
6953       throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
6954     }
6955     const bos = {type: "bos", value: "", output: opts.prepend || ""};
6956     const tokens = [bos];
6957     const capture = opts.capture ? "" : "?:";
6958     const win32 = utils.isWindows(options);
6959     const PLATFORM_CHARS = constants.globChars(win32);
6960     const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
6961     const {
6962       DOT_LITERAL,
6963       PLUS_LITERAL,
6964       SLASH_LITERAL,
6965       ONE_CHAR,
6966       DOTS_SLASH,
6967       NO_DOT,
6968       NO_DOT_SLASH,
6969       NO_DOTS_SLASH,
6970       QMARK,
6971       QMARK_NO_DOT,
6972       STAR,
6973       START_ANCHOR
6974     } = PLATFORM_CHARS;
6975     const globstar = (opts2) => {
6976       return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
6977     };
6978     const nodot = opts.dot ? "" : NO_DOT;
6979     const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
6980     let star = opts.bash === true ? globstar(opts) : STAR;
6981     if (opts.capture) {
6982       star = `(${star})`;
6983     }
6984     if (typeof opts.noext === "boolean") {
6985       opts.noextglob = opts.noext;
6986     }
6987     const state = {
6988       input,
6989       index: -1,
6990       start: 0,
6991       dot: opts.dot === true,
6992       consumed: "",
6993       output: "",
6994       prefix: "",
6995       backtrack: false,
6996       negated: false,
6997       brackets: 0,
6998       braces: 0,
6999       parens: 0,
7000       quotes: 0,
7001       globstar: false,
7002       tokens
7003     };
7004     input = utils.removePrefix(input, state);
7005     len = input.length;
7006     const extglobs = [];
7007     const braces = [];
7008     const stack = [];
7009     let prev = bos;
7010     let value;
7011     const eos = () => state.index === len - 1;
7012     const peek = state.peek = (n = 1) => input[state.index + n];
7013     const advance = state.advance = () => input[++state.index];
7014     const remaining = () => input.slice(state.index + 1);
7015     const consume = (value2 = "", num = 0) => {
7016       state.consumed += value2;
7017       state.index += num;
7018     };
7019     const append = (token) => {
7020       state.output += token.output != null ? token.output : token.value;
7021       consume(token.value);
7022     };
7023     const negate = () => {
7024       let count = 1;
7025       while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
7026         advance();
7027         state.start++;
7028         count++;
7029       }
7030       if (count % 2 === 0) {
7031         return false;
7032       }
7033       state.negated = true;
7034       state.start++;
7035       return true;
7036     };
7037     const increment = (type) => {
7038       state[type]++;
7039       stack.push(type);
7040     };
7041     const decrement = (type) => {
7042       state[type]--;
7043       stack.pop();
7044     };
7045     const push = (tok) => {
7046       if (prev.type === "globstar") {
7047         const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
7048         const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
7049         if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
7050           state.output = state.output.slice(0, -prev.output.length);
7051           prev.type = "star";
7052           prev.value = "*";
7053           prev.output = star;
7054           state.output += prev.output;
7055         }
7056       }
7057       if (extglobs.length && tok.type !== "paren" && !EXTGLOB_CHARS[tok.value]) {
7058         extglobs[extglobs.length - 1].inner += tok.value;
7059       }
7060       if (tok.value || tok.output)
7061         append(tok);
7062       if (prev && prev.type === "text" && tok.type === "text") {
7063         prev.value += tok.value;
7064         prev.output = (prev.output || "") + tok.value;
7065         return;
7066       }
7067       tok.prev = prev;
7068       tokens.push(tok);
7069       prev = tok;
7070     };
7071     const extglobOpen = (type, value2) => {
7072       const token = {...EXTGLOB_CHARS[value2], conditions: 1, inner: ""};
7073       token.prev = prev;
7074       token.parens = state.parens;
7075       token.output = state.output;
7076       const output = (opts.capture ? "(" : "") + token.open;
7077       increment("parens");
7078       push({type, value: value2, output: state.output ? "" : ONE_CHAR});
7079       push({type: "paren", extglob: true, value: advance(), output});
7080       extglobs.push(token);
7081     };
7082     const extglobClose = (token) => {
7083       let output = token.close + (opts.capture ? ")" : "");
7084       if (token.type === "negate") {
7085         let extglobStar = star;
7086         if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
7087           extglobStar = globstar(opts);
7088         }
7089         if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
7090           output = token.close = `)$))${extglobStar}`;
7091         }
7092         if (token.prev.type === "bos" && eos()) {
7093           state.negatedExtglob = true;
7094         }
7095       }
7096       push({type: "paren", extglob: true, value, output});
7097       decrement("parens");
7098     };
7099     if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
7100       let backslashes = false;
7101       let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
7102         if (first === "\\") {
7103           backslashes = true;
7104           return m;
7105         }
7106         if (first === "?") {
7107           if (esc) {
7108             return esc + first + (rest ? QMARK.repeat(rest.length) : "");
7109           }
7110           if (index === 0) {
7111             return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
7112           }
7113           return QMARK.repeat(chars.length);
7114         }
7115         if (first === ".") {
7116           return DOT_LITERAL.repeat(chars.length);
7117         }
7118         if (first === "*") {
7119           if (esc) {
7120             return esc + first + (rest ? star : "");
7121           }
7122           return star;
7123         }
7124         return esc ? m : `\\${m}`;
7125       });
7126       if (backslashes === true) {
7127         if (opts.unescape === true) {
7128           output = output.replace(/\\/g, "");
7129         } else {
7130           output = output.replace(/\\+/g, (m) => {
7131             return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
7132           });
7133         }
7134       }
7135       if (output === input && opts.contains === true) {
7136         state.output = input;
7137         return state;
7138       }
7139       state.output = utils.wrapOutput(output, state, options);
7140       return state;
7141     }
7142     while (!eos()) {
7143       value = advance();
7144       if (value === "\0") {
7145         continue;
7146       }
7147       if (value === "\\") {
7148         const next = peek();
7149         if (next === "/" && opts.bash !== true) {
7150           continue;
7151         }
7152         if (next === "." || next === ";") {
7153           continue;
7154         }
7155         if (!next) {
7156           value += "\\";
7157           push({type: "text", value});
7158           continue;
7159         }
7160         const match = /^\\+/.exec(remaining());
7161         let slashes = 0;
7162         if (match && match[0].length > 2) {
7163           slashes = match[0].length;
7164           state.index += slashes;
7165           if (slashes % 2 !== 0) {
7166             value += "\\";
7167           }
7168         }
7169         if (opts.unescape === true) {
7170           value = advance() || "";
7171         } else {
7172           value += advance() || "";
7173         }
7174         if (state.brackets === 0) {
7175           push({type: "text", value});
7176           continue;
7177         }
7178       }
7179       if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
7180         if (opts.posix !== false && value === ":") {
7181           const inner = prev.value.slice(1);
7182           if (inner.includes("[")) {
7183             prev.posix = true;
7184             if (inner.includes(":")) {
7185               const idx = prev.value.lastIndexOf("[");
7186               const pre = prev.value.slice(0, idx);
7187               const rest2 = prev.value.slice(idx + 2);
7188               const posix = POSIX_REGEX_SOURCE[rest2];
7189               if (posix) {
7190                 prev.value = pre + posix;
7191                 state.backtrack = true;
7192                 advance();
7193                 if (!bos.output && tokens.indexOf(prev) === 1) {
7194                   bos.output = ONE_CHAR;
7195                 }
7196                 continue;
7197               }
7198             }
7199           }
7200         }
7201         if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
7202           value = `\\${value}`;
7203         }
7204         if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
7205           value = `\\${value}`;
7206         }
7207         if (opts.posix === true && value === "!" && prev.value === "[") {
7208           value = "^";
7209         }
7210         prev.value += value;
7211         append({value});
7212         continue;
7213       }
7214       if (state.quotes === 1 && value !== '"') {
7215         value = utils.escapeRegex(value);
7216         prev.value += value;
7217         append({value});
7218         continue;
7219       }
7220       if (value === '"') {
7221         state.quotes = state.quotes === 1 ? 0 : 1;
7222         if (opts.keepQuotes === true) {
7223           push({type: "text", value});
7224         }
7225         continue;
7226       }
7227       if (value === "(") {
7228         increment("parens");
7229         push({type: "paren", value});
7230         continue;
7231       }
7232       if (value === ")") {
7233         if (state.parens === 0 && opts.strictBrackets === true) {
7234           throw new SyntaxError(syntaxError("opening", "("));
7235         }
7236         const extglob = extglobs[extglobs.length - 1];
7237         if (extglob && state.parens === extglob.parens + 1) {
7238           extglobClose(extglobs.pop());
7239           continue;
7240         }
7241         push({type: "paren", value, output: state.parens ? ")" : "\\)"});
7242         decrement("parens");
7243         continue;
7244       }
7245       if (value === "[") {
7246         if (opts.nobracket === true || !remaining().includes("]")) {
7247           if (opts.nobracket !== true && opts.strictBrackets === true) {
7248             throw new SyntaxError(syntaxError("closing", "]"));
7249           }
7250           value = `\\${value}`;
7251         } else {
7252           increment("brackets");
7253         }
7254         push({type: "bracket", value});
7255         continue;
7256       }
7257       if (value === "]") {
7258         if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
7259           push({type: "text", value, output: `\\${value}`});
7260           continue;
7261         }
7262         if (state.brackets === 0) {
7263           if (opts.strictBrackets === true) {
7264             throw new SyntaxError(syntaxError("opening", "["));
7265           }
7266           push({type: "text", value, output: `\\${value}`});
7267           continue;
7268         }
7269         decrement("brackets");
7270         const prevValue = prev.value.slice(1);
7271         if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
7272           value = `/${value}`;
7273         }
7274         prev.value += value;
7275         append({value});
7276         if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
7277           continue;
7278         }
7279         const escaped = utils.escapeRegex(prev.value);
7280         state.output = state.output.slice(0, -prev.value.length);
7281         if (opts.literalBrackets === true) {
7282           state.output += escaped;
7283           prev.value = escaped;
7284           continue;
7285         }
7286         prev.value = `(${capture}${escaped}|${prev.value})`;
7287         state.output += prev.value;
7288         continue;
7289       }
7290       if (value === "{" && opts.nobrace !== true) {
7291         increment("braces");
7292         const open = {
7293           type: "brace",
7294           value,
7295           output: "(",
7296           outputIndex: state.output.length,
7297           tokensIndex: state.tokens.length
7298         };
7299         braces.push(open);
7300         push(open);
7301         continue;
7302       }
7303       if (value === "}") {
7304         const brace = braces[braces.length - 1];
7305         if (opts.nobrace === true || !brace) {
7306           push({type: "text", value, output: value});
7307           continue;
7308         }
7309         let output = ")";
7310         if (brace.dots === true) {
7311           const arr = tokens.slice();
7312           const range = [];
7313           for (let i = arr.length - 1; i >= 0; i--) {
7314             tokens.pop();
7315             if (arr[i].type === "brace") {
7316               break;
7317             }
7318             if (arr[i].type !== "dots") {
7319               range.unshift(arr[i].value);
7320             }
7321           }
7322           output = expandRange(range, opts);
7323           state.backtrack = true;
7324         }
7325         if (brace.comma !== true && brace.dots !== true) {
7326           const out = state.output.slice(0, brace.outputIndex);
7327           const toks = state.tokens.slice(brace.tokensIndex);
7328           brace.value = brace.output = "\\{";
7329           value = output = "\\}";
7330           state.output = out;
7331           for (const t of toks) {
7332             state.output += t.output || t.value;
7333           }
7334         }
7335         push({type: "brace", value, output});
7336         decrement("braces");
7337         braces.pop();
7338         continue;
7339       }
7340       if (value === "|") {
7341         if (extglobs.length > 0) {
7342           extglobs[extglobs.length - 1].conditions++;
7343         }
7344         push({type: "text", value});
7345         continue;
7346       }
7347       if (value === ",") {
7348         let output = value;
7349         const brace = braces[braces.length - 1];
7350         if (brace && stack[stack.length - 1] === "braces") {
7351           brace.comma = true;
7352           output = "|";
7353         }
7354         push({type: "comma", value, output});
7355         continue;
7356       }
7357       if (value === "/") {
7358         if (prev.type === "dot" && state.index === state.start + 1) {
7359           state.start = state.index + 1;
7360           state.consumed = "";
7361           state.output = "";
7362           tokens.pop();
7363           prev = bos;
7364           continue;
7365         }
7366         push({type: "slash", value, output: SLASH_LITERAL});
7367         continue;
7368       }
7369       if (value === ".") {
7370         if (state.braces > 0 && prev.type === "dot") {
7371           if (prev.value === ".")
7372             prev.output = DOT_LITERAL;
7373           const brace = braces[braces.length - 1];
7374           prev.type = "dots";
7375           prev.output += value;
7376           prev.value += value;
7377           brace.dots = true;
7378           continue;
7379         }
7380         if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
7381           push({type: "text", value, output: DOT_LITERAL});
7382           continue;
7383         }
7384         push({type: "dot", value, output: DOT_LITERAL});
7385         continue;
7386       }
7387       if (value === "?") {
7388         const isGroup = prev && prev.value === "(";
7389         if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7390           extglobOpen("qmark", value);
7391           continue;
7392         }
7393         if (prev && prev.type === "paren") {
7394           const next = peek();
7395           let output = value;
7396           if (next === "<" && !utils.supportsLookbehinds()) {
7397             throw new Error("Node.js v10 or higher is required for regex lookbehinds");
7398           }
7399           if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
7400             output = `\\${value}`;
7401           }
7402           push({type: "text", value, output});
7403           continue;
7404         }
7405         if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
7406           push({type: "qmark", value, output: QMARK_NO_DOT});
7407           continue;
7408         }
7409         push({type: "qmark", value, output: QMARK});
7410         continue;
7411       }
7412       if (value === "!") {
7413         if (opts.noextglob !== true && peek() === "(") {
7414           if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
7415             extglobOpen("negate", value);
7416             continue;
7417           }
7418         }
7419         if (opts.nonegate !== true && state.index === 0) {
7420           negate();
7421           continue;
7422         }
7423       }
7424       if (value === "+") {
7425         if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7426           extglobOpen("plus", value);
7427           continue;
7428         }
7429         if (prev && prev.value === "(" || opts.regex === false) {
7430           push({type: "plus", value, output: PLUS_LITERAL});
7431           continue;
7432         }
7433         if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
7434           push({type: "plus", value});
7435           continue;
7436         }
7437         push({type: "plus", value: PLUS_LITERAL});
7438         continue;
7439       }
7440       if (value === "@") {
7441         if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
7442           push({type: "at", extglob: true, value, output: ""});
7443           continue;
7444         }
7445         push({type: "text", value});
7446         continue;
7447       }
7448       if (value !== "*") {
7449         if (value === "$" || value === "^") {
7450           value = `\\${value}`;
7451         }
7452         const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
7453         if (match) {
7454           value += match[0];
7455           state.index += match[0].length;
7456         }
7457         push({type: "text", value});
7458         continue;
7459       }
7460       if (prev && (prev.type === "globstar" || prev.star === true)) {
7461         prev.type = "star";
7462         prev.star = true;
7463         prev.value += value;
7464         prev.output = star;
7465         state.backtrack = true;
7466         state.globstar = true;
7467         consume(value);
7468         continue;
7469       }
7470       let rest = remaining();
7471       if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
7472         extglobOpen("star", value);
7473         continue;
7474       }
7475       if (prev.type === "star") {
7476         if (opts.noglobstar === true) {
7477           consume(value);
7478           continue;
7479         }
7480         const prior = prev.prev;
7481         const before = prior.prev;
7482         const isStart = prior.type === "slash" || prior.type === "bos";
7483         const afterStar = before && (before.type === "star" || before.type === "globstar");
7484         if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
7485           push({type: "star", value, output: ""});
7486           continue;
7487         }
7488         const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
7489         const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
7490         if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
7491           push({type: "star", value, output: ""});
7492           continue;
7493         }
7494         while (rest.slice(0, 3) === "/**") {
7495           const after = input[state.index + 4];
7496           if (after && after !== "/") {
7497             break;
7498           }
7499           rest = rest.slice(3);
7500           consume("/**", 3);
7501         }
7502         if (prior.type === "bos" && eos()) {
7503           prev.type = "globstar";
7504           prev.value += value;
7505           prev.output = globstar(opts);
7506           state.output = prev.output;
7507           state.globstar = true;
7508           consume(value);
7509           continue;
7510         }
7511         if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
7512           state.output = state.output.slice(0, -(prior.output + prev.output).length);
7513           prior.output = `(?:${prior.output}`;
7514           prev.type = "globstar";
7515           prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
7516           prev.value += value;
7517           state.globstar = true;
7518           state.output += prior.output + prev.output;
7519           consume(value);
7520           continue;
7521         }
7522         if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
7523           const end = rest[1] !== void 0 ? "|$" : "";
7524           state.output = state.output.slice(0, -(prior.output + prev.output).length);
7525           prior.output = `(?:${prior.output}`;
7526           prev.type = "globstar";
7527           prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
7528           prev.value += value;
7529           state.output += prior.output + prev.output;
7530           state.globstar = true;
7531           consume(value + advance());
7532           push({type: "slash", value: "/", output: ""});
7533           continue;
7534         }
7535         if (prior.type === "bos" && rest[0] === "/") {
7536           prev.type = "globstar";
7537           prev.value += value;
7538           prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
7539           state.output = prev.output;
7540           state.globstar = true;
7541           consume(value + advance());
7542           push({type: "slash", value: "/", output: ""});
7543           continue;
7544         }
7545         state.output = state.output.slice(0, -prev.output.length);
7546         prev.type = "globstar";
7547         prev.output = globstar(opts);
7548         prev.value += value;
7549         state.output += prev.output;
7550         state.globstar = true;
7551         consume(value);
7552         continue;
7553       }
7554       const token = {type: "star", value, output: star};
7555       if (opts.bash === true) {
7556         token.output = ".*?";
7557         if (prev.type === "bos" || prev.type === "slash") {
7558           token.output = nodot + token.output;
7559         }
7560         push(token);
7561         continue;
7562       }
7563       if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
7564         token.output = value;
7565         push(token);
7566         continue;
7567       }
7568       if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
7569         if (prev.type === "dot") {
7570           state.output += NO_DOT_SLASH;
7571           prev.output += NO_DOT_SLASH;
7572         } else if (opts.dot === true) {
7573           state.output += NO_DOTS_SLASH;
7574           prev.output += NO_DOTS_SLASH;
7575         } else {
7576           state.output += nodot;
7577           prev.output += nodot;
7578         }
7579         if (peek() !== "*") {
7580           state.output += ONE_CHAR;
7581           prev.output += ONE_CHAR;
7582         }
7583       }
7584       push(token);
7585     }
7586     while (state.brackets > 0) {
7587       if (opts.strictBrackets === true)
7588         throw new SyntaxError(syntaxError("closing", "]"));
7589       state.output = utils.escapeLast(state.output, "[");
7590       decrement("brackets");
7591     }
7592     while (state.parens > 0) {
7593       if (opts.strictBrackets === true)
7594         throw new SyntaxError(syntaxError("closing", ")"));
7595       state.output = utils.escapeLast(state.output, "(");
7596       decrement("parens");
7597     }
7598     while (state.braces > 0) {
7599       if (opts.strictBrackets === true)
7600         throw new SyntaxError(syntaxError("closing", "}"));
7601       state.output = utils.escapeLast(state.output, "{");
7602       decrement("braces");
7603     }
7604     if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
7605       push({type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?`});
7606     }
7607     if (state.backtrack === true) {
7608       state.output = "";
7609       for (const token of state.tokens) {
7610         state.output += token.output != null ? token.output : token.value;
7611         if (token.suffix) {
7612           state.output += token.suffix;
7613         }
7614       }
7615     }
7616     return state;
7617   };
7618   parse.fastpaths = (input, options) => {
7619     const opts = {...options};
7620     const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
7621     const len = input.length;
7622     if (len > max) {
7623       throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
7624     }
7625     input = REPLACEMENTS[input] || input;
7626     const win32 = utils.isWindows(options);
7627     const {
7628       DOT_LITERAL,
7629       SLASH_LITERAL,
7630       ONE_CHAR,
7631       DOTS_SLASH,
7632       NO_DOT,
7633       NO_DOTS,
7634       NO_DOTS_SLASH,
7635       STAR,
7636       START_ANCHOR
7637     } = constants.globChars(win32);
7638     const nodot = opts.dot ? NO_DOTS : NO_DOT;
7639     const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
7640     const capture = opts.capture ? "" : "?:";
7641     const state = {negated: false, prefix: ""};
7642     let star = opts.bash === true ? ".*?" : STAR;
7643     if (opts.capture) {
7644       star = `(${star})`;
7645     }
7646     const globstar = (opts2) => {
7647       if (opts2.noglobstar === true)
7648         return star;
7649       return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
7650     };
7651     const create = (str) => {
7652       switch (str) {
7653         case "*":
7654           return `${nodot}${ONE_CHAR}${star}`;
7655         case ".*":
7656           return `${DOT_LITERAL}${ONE_CHAR}${star}`;
7657         case "*.*":
7658           return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
7659         case "*/*":
7660           return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
7661         case "**":
7662           return nodot + globstar(opts);
7663         case "**/*":
7664           return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
7665         case "**/*.*":
7666           return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
7667         case "**/.*":
7668           return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
7669         default: {
7670           const match = /^(.*?)\.(\w+)$/.exec(str);
7671           if (!match)
7672             return;
7673           const source2 = create(match[1]);
7674           if (!source2)
7675             return;
7676           return source2 + DOT_LITERAL + match[2];
7677         }
7678       }
7679     };
7680     const output = utils.removePrefix(input, state);
7681     let source = create(output);
7682     if (source && opts.strictSlashes !== true) {
7683       source += `${SLASH_LITERAL}?`;
7684     }
7685     return source;
7686   };
7687   module2.exports = parse;
7688 });
7689
7690 // node_modules/picomatch/lib/picomatch.js
7691 var require_picomatch = __commonJS((exports2, module2) => {
7692   "use strict";
7693   var path = require("path");
7694   var scan = require_scan();
7695   var parse = require_parse();
7696   var utils = require_utils();
7697   var constants = require_constants();
7698   var isObject3 = (val) => val && typeof val === "object" && !Array.isArray(val);
7699   var picomatch = (glob, options, returnState = false) => {
7700     if (Array.isArray(glob)) {
7701       const fns = glob.map((input) => picomatch(input, options, returnState));
7702       const arrayMatcher = (str) => {
7703         for (const isMatch of fns) {
7704           const state2 = isMatch(str);
7705           if (state2)
7706             return state2;
7707         }
7708         return false;
7709       };
7710       return arrayMatcher;
7711     }
7712     const isState = isObject3(glob) && glob.tokens && glob.input;
7713     if (glob === "" || typeof glob !== "string" && !isState) {
7714       throw new TypeError("Expected pattern to be a non-empty string");
7715     }
7716     const opts = options || {};
7717     const posix = utils.isWindows(options);
7718     const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
7719     const state = regex.state;
7720     delete regex.state;
7721     let isIgnored = () => false;
7722     if (opts.ignore) {
7723       const ignoreOpts = {...options, ignore: null, onMatch: null, onResult: null};
7724       isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
7725     }
7726     const matcher = (input, returnObject = false) => {
7727       const {isMatch, match, output} = picomatch.test(input, regex, options, {glob, posix});
7728       const result = {glob, state, regex, posix, input, output, match, isMatch};
7729       if (typeof opts.onResult === "function") {
7730         opts.onResult(result);
7731       }
7732       if (isMatch === false) {
7733         result.isMatch = false;
7734         return returnObject ? result : false;
7735       }
7736       if (isIgnored(input)) {
7737         if (typeof opts.onIgnore === "function") {
7738           opts.onIgnore(result);
7739         }
7740         result.isMatch = false;
7741         return returnObject ? result : false;
7742       }
7743       if (typeof opts.onMatch === "function") {
7744         opts.onMatch(result);
7745       }
7746       return returnObject ? result : true;
7747     };
7748     if (returnState) {
7749       matcher.state = state;
7750     }
7751     return matcher;
7752   };
7753   picomatch.test = (input, regex, options, {glob, posix} = {}) => {
7754     if (typeof input !== "string") {
7755       throw new TypeError("Expected input to be a string");
7756     }
7757     if (input === "") {
7758       return {isMatch: false, output: ""};
7759     }
7760     const opts = options || {};
7761     const format = opts.format || (posix ? utils.toPosixSlashes : null);
7762     let match = input === glob;
7763     let output = match && format ? format(input) : input;
7764     if (match === false) {
7765       output = format ? format(input) : input;
7766       match = output === glob;
7767     }
7768     if (match === false || opts.capture === true) {
7769       if (opts.matchBase === true || opts.basename === true) {
7770         match = picomatch.matchBase(input, regex, options, posix);
7771       } else {
7772         match = regex.exec(output);
7773       }
7774     }
7775     return {isMatch: Boolean(match), match, output};
7776   };
7777   picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
7778     const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
7779     return regex.test(path.basename(input));
7780   };
7781   picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
7782   picomatch.parse = (pattern, options) => {
7783     if (Array.isArray(pattern))
7784       return pattern.map((p) => picomatch.parse(p, options));
7785     return parse(pattern, {...options, fastpaths: false});
7786   };
7787   picomatch.scan = (input, options) => scan(input, options);
7788   picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
7789     if (returnOutput === true) {
7790       return parsed.output;
7791     }
7792     const opts = options || {};
7793     const prepend = opts.contains ? "" : "^";
7794     const append = opts.contains ? "" : "$";
7795     let source = `${prepend}(?:${parsed.output})${append}`;
7796     if (parsed && parsed.negated === true) {
7797       source = `^(?!${source}).*$`;
7798     }
7799     const regex = picomatch.toRegex(source, options);
7800     if (returnState === true) {
7801       regex.state = parsed;
7802     }
7803     return regex;
7804   };
7805   picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
7806     if (!input || typeof input !== "string") {
7807       throw new TypeError("Expected a non-empty string");
7808     }
7809     const opts = options || {};
7810     let parsed = {negated: false, fastpaths: true};
7811     let prefix = "";
7812     let output;
7813     if (input.startsWith("./")) {
7814       input = input.slice(2);
7815       prefix = parsed.prefix = "./";
7816     }
7817     if (opts.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
7818       output = parse.fastpaths(input, options);
7819     }
7820     if (output === void 0) {
7821       parsed = parse(input, options);
7822       parsed.prefix = prefix + (parsed.prefix || "");
7823     } else {
7824       parsed.output = output;
7825     }
7826     return picomatch.compileRe(parsed, options, returnOutput, returnState);
7827   };
7828   picomatch.toRegex = (source, options) => {
7829     try {
7830       const opts = options || {};
7831       return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
7832     } catch (err) {
7833       if (options && options.debug === true)
7834         throw err;
7835       return /$^/;
7836     }
7837   };
7838   picomatch.constants = constants;
7839   module2.exports = picomatch;
7840 });
7841
7842 // node_modules/picomatch/index.js
7843 var require_picomatch2 = __commonJS((exports2, module2) => {
7844   "use strict";
7845   module2.exports = require_picomatch();
7846 });
7847
7848 // node_modules/readdirp/index.js
7849 var require_readdirp = __commonJS((exports2, module2) => {
7850   "use strict";
7851   var fs = require("fs");
7852   var {Readable} = require("stream");
7853   var sysPath = require("path");
7854   var {promisify} = require("util");
7855   var picomatch = require_picomatch2();
7856   var readdir = promisify(fs.readdir);
7857   var stat = promisify(fs.stat);
7858   var lstat = promisify(fs.lstat);
7859   var realpath = promisify(fs.realpath);
7860   var BANG = "!";
7861   var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP"]);
7862   var FILE_TYPE = "files";
7863   var DIR_TYPE = "directories";
7864   var FILE_DIR_TYPE = "files_directories";
7865   var EVERYTHING_TYPE = "all";
7866   var ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
7867   var isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code);
7868   var normalizeFilter = (filter) => {
7869     if (filter === void 0)
7870       return;
7871     if (typeof filter === "function")
7872       return filter;
7873     if (typeof filter === "string") {
7874       const glob = picomatch(filter.trim());
7875       return (entry) => glob(entry.basename);
7876     }
7877     if (Array.isArray(filter)) {
7878       const positive = [];
7879       const negative = [];
7880       for (const item of filter) {
7881         const trimmed = item.trim();
7882         if (trimmed.charAt(0) === BANG) {
7883           negative.push(picomatch(trimmed.slice(1)));
7884         } else {
7885           positive.push(picomatch(trimmed));
7886         }
7887       }
7888       if (negative.length > 0) {
7889         if (positive.length > 0) {
7890           return (entry) => positive.some((f) => f(entry.basename)) && !negative.some((f) => f(entry.basename));
7891         }
7892         return (entry) => !negative.some((f) => f(entry.basename));
7893       }
7894       return (entry) => positive.some((f) => f(entry.basename));
7895     }
7896   };
7897   var ReaddirpStream = class extends Readable {
7898     static get defaultOptions() {
7899       return {
7900         root: ".",
7901         fileFilter: (path) => true,
7902         directoryFilter: (path) => true,
7903         type: FILE_TYPE,
7904         lstat: false,
7905         depth: 2147483648,
7906         alwaysStat: false
7907       };
7908     }
7909     constructor(options = {}) {
7910       super({
7911         objectMode: true,
7912         autoDestroy: true,
7913         highWaterMark: options.highWaterMark || 4096
7914       });
7915       const opts = {...ReaddirpStream.defaultOptions, ...options};
7916       const {root, type} = opts;
7917       this._fileFilter = normalizeFilter(opts.fileFilter);
7918       this._directoryFilter = normalizeFilter(opts.directoryFilter);
7919       const statMethod = opts.lstat ? lstat : stat;
7920       if (process.platform === "win32" && stat.length === 3) {
7921         this._stat = (path) => statMethod(path, {bigint: true});
7922       } else {
7923         this._stat = statMethod;
7924       }
7925       this._maxDepth = opts.depth;
7926       this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
7927       this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
7928       this._wantsEverything = type === EVERYTHING_TYPE;
7929       this._root = sysPath.resolve(root);
7930       this._isDirent = "Dirent" in fs && !opts.alwaysStat;
7931       this._statsProp = this._isDirent ? "dirent" : "stats";
7932       this._rdOptions = {encoding: "utf8", withFileTypes: this._isDirent};
7933       this.parents = [this._exploreDir(root, 1)];
7934       this.reading = false;
7935       this.parent = void 0;
7936     }
7937     async _read(batch) {
7938       if (this.reading)
7939         return;
7940       this.reading = true;
7941       try {
7942         while (!this.destroyed && batch > 0) {
7943           const {path, depth, files = []} = this.parent || {};
7944           if (files.length > 0) {
7945             const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path));
7946             for (const entry of await Promise.all(slice)) {
7947               if (this.destroyed)
7948                 return;
7949               const entryType = await this._getEntryType(entry);
7950               if (entryType === "directory" && this._directoryFilter(entry)) {
7951                 if (depth <= this._maxDepth) {
7952                   this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
7953                 }
7954                 if (this._wantsDir) {
7955                   this.push(entry);
7956                   batch--;
7957                 }
7958               } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
7959                 if (this._wantsFile) {
7960                   this.push(entry);
7961                   batch--;
7962                 }
7963               }
7964             }
7965           } else {
7966             const parent = this.parents.pop();
7967             if (!parent) {
7968               this.push(null);
7969               break;
7970             }
7971             this.parent = await parent;
7972             if (this.destroyed)
7973               return;
7974           }
7975         }
7976       } catch (error) {
7977         this.destroy(error);
7978       } finally {
7979         this.reading = false;
7980       }
7981     }
7982     async _exploreDir(path, depth) {
7983       let files;
7984       try {
7985         files = await readdir(path, this._rdOptions);
7986       } catch (error) {
7987         this._onError(error);
7988       }
7989       return {files, depth, path};
7990     }
7991     async _formatEntry(dirent, path) {
7992       let entry;
7993       try {
7994         const basename2 = this._isDirent ? dirent.name : dirent;
7995         const fullPath = sysPath.resolve(sysPath.join(path, basename2));
7996         entry = {path: sysPath.relative(this._root, fullPath), fullPath, basename: basename2};
7997         entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
7998       } catch (err) {
7999         this._onError(err);
8000       }
8001       return entry;
8002     }
8003     _onError(err) {
8004       if (isNormalFlowError(err) && !this.destroyed) {
8005         this.emit("warn", err);
8006       } else {
8007         this.destroy(err);
8008       }
8009     }
8010     async _getEntryType(entry) {
8011       const stats = entry && entry[this._statsProp];
8012       if (!stats) {
8013         return;
8014       }
8015       if (stats.isFile()) {
8016         return "file";
8017       }
8018       if (stats.isDirectory()) {
8019         return "directory";
8020       }
8021       if (stats && stats.isSymbolicLink()) {
8022         try {
8023           const entryRealPath = await realpath(entry.fullPath);
8024           const entryRealPathStats = await lstat(entryRealPath);
8025           if (entryRealPathStats.isFile()) {
8026             return "file";
8027           }
8028           if (entryRealPathStats.isDirectory()) {
8029             return "directory";
8030           }
8031         } catch (error) {
8032           this._onError(error);
8033         }
8034       }
8035     }
8036     _includeAsFile(entry) {
8037       const stats = entry && entry[this._statsProp];
8038       return stats && this._wantsEverything && !stats.isDirectory();
8039     }
8040   };
8041   var readdirp = (root, options = {}) => {
8042     let type = options.entryType || options.type;
8043     if (type === "both")
8044       type = FILE_DIR_TYPE;
8045     if (type)
8046       options.type = type;
8047     if (!root) {
8048       throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
8049     } else if (typeof root !== "string") {
8050       throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
8051     } else if (type && !ALL_TYPES.includes(type)) {
8052       throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
8053     }
8054     options.root = root;
8055     return new ReaddirpStream(options);
8056   };
8057   var readdirpPromise = (root, options = {}) => {
8058     return new Promise((resolve, reject) => {
8059       const files = [];
8060       readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
8061     });
8062   };
8063   readdirp.promise = readdirpPromise;
8064   readdirp.ReaddirpStream = ReaddirpStream;
8065   readdirp.default = readdirp;
8066   module2.exports = readdirp;
8067 });
8068
8069 // node_modules/fs.realpath/old.js
8070 var require_old = __commonJS((exports2) => {
8071   var pathModule = require("path");
8072   var isWindows = process.platform === "win32";
8073   var fs = require("fs");
8074   var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
8075   function rethrow() {
8076     var callback;
8077     if (DEBUG) {
8078       var backtrace = new Error();
8079       callback = debugCallback;
8080     } else
8081       callback = missingCallback;
8082     return callback;
8083     function debugCallback(err) {
8084       if (err) {
8085         backtrace.message = err.message;
8086         err = backtrace;
8087         missingCallback(err);
8088       }
8089     }
8090     function missingCallback(err) {
8091       if (err) {
8092         if (process.throwDeprecation)
8093           throw err;
8094         else if (!process.noDeprecation) {
8095           var msg = "fs: missing callback " + (err.stack || err.message);
8096           if (process.traceDeprecation)
8097             console.trace(msg);
8098           else
8099             console.error(msg);
8100         }
8101       }
8102     }
8103   }
8104   function maybeCallback(cb) {
8105     return typeof cb === "function" ? cb : rethrow();
8106   }
8107   var normalize = pathModule.normalize;
8108   if (isWindows) {
8109     nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
8110   } else {
8111     nextPartRe = /(.*?)(?:[\/]+|$)/g;
8112   }
8113   var nextPartRe;
8114   if (isWindows) {
8115     splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
8116   } else {
8117     splitRootRe = /^[\/]*/;
8118   }
8119   var splitRootRe;
8120   exports2.realpathSync = function realpathSync(p, cache) {
8121     p = pathModule.resolve(p);
8122     if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
8123       return cache[p];
8124     }
8125     var original = p, seenLinks = {}, knownHard = {};
8126     var pos;
8127     var current;
8128     var base;
8129     var previous;
8130     start();
8131     function start() {
8132       var m = splitRootRe.exec(p);
8133       pos = m[0].length;
8134       current = m[0];
8135       base = m[0];
8136       previous = "";
8137       if (isWindows && !knownHard[base]) {
8138         fs.lstatSync(base);
8139         knownHard[base] = true;
8140       }
8141     }
8142     while (pos < p.length) {
8143       nextPartRe.lastIndex = pos;
8144       var result = nextPartRe.exec(p);
8145       previous = current;
8146       current += result[0];
8147       base = previous + result[1];
8148       pos = nextPartRe.lastIndex;
8149       if (knownHard[base] || cache && cache[base] === base) {
8150         continue;
8151       }
8152       var resolvedLink;
8153       if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
8154         resolvedLink = cache[base];
8155       } else {
8156         var stat = fs.lstatSync(base);
8157         if (!stat.isSymbolicLink()) {
8158           knownHard[base] = true;
8159           if (cache)
8160             cache[base] = base;
8161           continue;
8162         }
8163         var linkTarget = null;
8164         if (!isWindows) {
8165           var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
8166           if (seenLinks.hasOwnProperty(id)) {
8167             linkTarget = seenLinks[id];
8168           }
8169         }
8170         if (linkTarget === null) {
8171           fs.statSync(base);
8172           linkTarget = fs.readlinkSync(base);
8173         }
8174         resolvedLink = pathModule.resolve(previous, linkTarget);
8175         if (cache)
8176           cache[base] = resolvedLink;
8177         if (!isWindows)
8178           seenLinks[id] = linkTarget;
8179       }
8180       p = pathModule.resolve(resolvedLink, p.slice(pos));
8181       start();
8182     }
8183     if (cache)
8184       cache[original] = p;
8185     return p;
8186   };
8187   exports2.realpath = function realpath(p, cache, cb) {
8188     if (typeof cb !== "function") {
8189       cb = maybeCallback(cache);
8190       cache = null;
8191     }
8192     p = pathModule.resolve(p);
8193     if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
8194       return process.nextTick(cb.bind(null, null, cache[p]));
8195     }
8196     var original = p, seenLinks = {}, knownHard = {};
8197     var pos;
8198     var current;
8199     var base;
8200     var previous;
8201     start();
8202     function start() {
8203       var m = splitRootRe.exec(p);
8204       pos = m[0].length;
8205       current = m[0];
8206       base = m[0];
8207       previous = "";
8208       if (isWindows && !knownHard[base]) {
8209         fs.lstat(base, function(err) {
8210           if (err)
8211             return cb(err);
8212           knownHard[base] = true;
8213           LOOP();
8214         });
8215       } else {
8216         process.nextTick(LOOP);
8217       }
8218     }
8219     function LOOP() {
8220       if (pos >= p.length) {
8221         if (cache)
8222           cache[original] = p;
8223         return cb(null, p);
8224       }
8225       nextPartRe.lastIndex = pos;
8226       var result = nextPartRe.exec(p);
8227       previous = current;
8228       current += result[0];
8229       base = previous + result[1];
8230       pos = nextPartRe.lastIndex;
8231       if (knownHard[base] || cache && cache[base] === base) {
8232         return process.nextTick(LOOP);
8233       }
8234       if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
8235         return gotResolvedLink(cache[base]);
8236       }
8237       return fs.lstat(base, gotStat);
8238     }
8239     function gotStat(err, stat) {
8240       if (err)
8241         return cb(err);
8242       if (!stat.isSymbolicLink()) {
8243         knownHard[base] = true;
8244         if (cache)
8245           cache[base] = base;
8246         return process.nextTick(LOOP);
8247       }
8248       if (!isWindows) {
8249         var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
8250         if (seenLinks.hasOwnProperty(id)) {
8251           return gotTarget(null, seenLinks[id], base);
8252         }
8253       }
8254       fs.stat(base, function(err2) {
8255         if (err2)
8256           return cb(err2);
8257         fs.readlink(base, function(err3, target) {
8258           if (!isWindows)
8259             seenLinks[id] = target;
8260           gotTarget(err3, target);
8261         });
8262       });
8263     }
8264     function gotTarget(err, target, base2) {
8265       if (err)
8266         return cb(err);
8267       var resolvedLink = pathModule.resolve(previous, target);
8268       if (cache)
8269         cache[base2] = resolvedLink;
8270       gotResolvedLink(resolvedLink);
8271     }
8272     function gotResolvedLink(resolvedLink) {
8273       p = pathModule.resolve(resolvedLink, p.slice(pos));
8274       start();
8275     }
8276   };
8277 });
8278
8279 // node_modules/fs.realpath/index.js
8280 var require_fs = __commonJS((exports2, module2) => {
8281   module2.exports = realpath;
8282   realpath.realpath = realpath;
8283   realpath.sync = realpathSync;
8284   realpath.realpathSync = realpathSync;
8285   realpath.monkeypatch = monkeypatch;
8286   realpath.unmonkeypatch = unmonkeypatch;
8287   var fs = require("fs");
8288   var origRealpath = fs.realpath;
8289   var origRealpathSync = fs.realpathSync;
8290   var version = process.version;
8291   var ok = /^v[0-5]\./.test(version);
8292   var old = require_old();
8293   function newError(er) {
8294     return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
8295   }
8296   function realpath(p, cache, cb) {
8297     if (ok) {
8298       return origRealpath(p, cache, cb);
8299     }
8300     if (typeof cache === "function") {
8301       cb = cache;
8302       cache = null;
8303     }
8304     origRealpath(p, cache, function(er, result) {
8305       if (newError(er)) {
8306         old.realpath(p, cache, cb);
8307       } else {
8308         cb(er, result);
8309       }
8310     });
8311   }
8312   function realpathSync(p, cache) {
8313     if (ok) {
8314       return origRealpathSync(p, cache);
8315     }
8316     try {
8317       return origRealpathSync(p, cache);
8318     } catch (er) {
8319       if (newError(er)) {
8320         return old.realpathSync(p, cache);
8321       } else {
8322         throw er;
8323       }
8324     }
8325   }
8326   function monkeypatch() {
8327     fs.realpath = realpath;
8328     fs.realpathSync = realpathSync;
8329   }
8330   function unmonkeypatch() {
8331     fs.realpath = origRealpath;
8332     fs.realpathSync = origRealpathSync;
8333   }
8334 });
8335
8336 // node_modules/concat-map/index.js
8337 var require_concat_map = __commonJS((exports2, module2) => {
8338   module2.exports = function(xs, fn) {
8339     var res = [];
8340     for (var i = 0; i < xs.length; i++) {
8341       var x = fn(xs[i], i);
8342       if (isArray(x))
8343         res.push.apply(res, x);
8344       else
8345         res.push(x);
8346     }
8347     return res;
8348   };
8349   var isArray = Array.isArray || function(xs) {
8350     return Object.prototype.toString.call(xs) === "[object Array]";
8351   };
8352 });
8353
8354 // node_modules/balanced-match/index.js
8355 var require_balanced_match = __commonJS((exports2, module2) => {
8356   "use strict";
8357   module2.exports = balanced;
8358   function balanced(a, b, str) {
8359     if (a instanceof RegExp)
8360       a = maybeMatch(a, str);
8361     if (b instanceof RegExp)
8362       b = maybeMatch(b, str);
8363     var r = range(a, b, str);
8364     return r && {
8365       start: r[0],
8366       end: r[1],
8367       pre: str.slice(0, r[0]),
8368       body: str.slice(r[0] + a.length, r[1]),
8369       post: str.slice(r[1] + b.length)
8370     };
8371   }
8372   function maybeMatch(reg, str) {
8373     var m = str.match(reg);
8374     return m ? m[0] : null;
8375   }
8376   balanced.range = range;
8377   function range(a, b, str) {
8378     var begs, beg, left, right, result;
8379     var ai = str.indexOf(a);
8380     var bi = str.indexOf(b, ai + 1);
8381     var i = ai;
8382     if (ai >= 0 && bi > 0) {
8383       begs = [];
8384       left = str.length;
8385       while (i >= 0 && !result) {
8386         if (i == ai) {
8387           begs.push(i);
8388           ai = str.indexOf(a, i + 1);
8389         } else if (begs.length == 1) {
8390           result = [begs.pop(), bi];
8391         } else {
8392           beg = begs.pop();
8393           if (beg < left) {
8394             left = beg;
8395             right = bi;
8396           }
8397           bi = str.indexOf(b, i + 1);
8398         }
8399         i = ai < bi && ai >= 0 ? ai : bi;
8400       }
8401       if (begs.length) {
8402         result = [left, right];
8403       }
8404     }
8405     return result;
8406   }
8407 });
8408
8409 // node_modules/brace-expansion/index.js
8410 var require_brace_expansion = __commonJS((exports2, module2) => {
8411   var concatMap = require_concat_map();
8412   var balanced = require_balanced_match();
8413   module2.exports = expandTop;
8414   var escSlash = "\0SLASH" + Math.random() + "\0";
8415   var escOpen = "\0OPEN" + Math.random() + "\0";
8416   var escClose = "\0CLOSE" + Math.random() + "\0";
8417   var escComma = "\0COMMA" + Math.random() + "\0";
8418   var escPeriod = "\0PERIOD" + Math.random() + "\0";
8419   function numeric(str) {
8420     return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
8421   }
8422   function escapeBraces(str) {
8423     return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
8424   }
8425   function unescapeBraces(str) {
8426     return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
8427   }
8428   function parseCommaParts(str) {
8429     if (!str)
8430       return [""];
8431     var parts = [];
8432     var m = balanced("{", "}", str);
8433     if (!m)
8434       return str.split(",");
8435     var pre = m.pre;
8436     var body = m.body;
8437     var post = m.post;
8438     var p = pre.split(",");
8439     p[p.length - 1] += "{" + body + "}";
8440     var postParts = parseCommaParts(post);
8441     if (post.length) {
8442       p[p.length - 1] += postParts.shift();
8443       p.push.apply(p, postParts);
8444     }
8445     parts.push.apply(parts, p);
8446     return parts;
8447   }
8448   function expandTop(str) {
8449     if (!str)
8450       return [];
8451     if (str.substr(0, 2) === "{}") {
8452       str = "\\{\\}" + str.substr(2);
8453     }
8454     return expand(escapeBraces(str), true).map(unescapeBraces);
8455   }
8456   function embrace(str) {
8457     return "{" + str + "}";
8458   }
8459   function isPadded(el) {
8460     return /^-?0\d/.test(el);
8461   }
8462   function lte(i, y) {
8463     return i <= y;
8464   }
8465   function gte(i, y) {
8466     return i >= y;
8467   }
8468   function expand(str, isTop) {
8469     var expansions = [];
8470     var m = balanced("{", "}", str);
8471     if (!m || /\$$/.test(m.pre))
8472       return [str];
8473     var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
8474     var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
8475     var isSequence = isNumericSequence || isAlphaSequence;
8476     var isOptions = m.body.indexOf(",") >= 0;
8477     if (!isSequence && !isOptions) {
8478       if (m.post.match(/,.*\}/)) {
8479         str = m.pre + "{" + m.body + escClose + m.post;
8480         return expand(str);
8481       }
8482       return [str];
8483     }
8484     var n;
8485     if (isSequence) {
8486       n = m.body.split(/\.\./);
8487     } else {
8488       n = parseCommaParts(m.body);
8489       if (n.length === 1) {
8490         n = expand(n[0], false).map(embrace);
8491         if (n.length === 1) {
8492           var post = m.post.length ? expand(m.post, false) : [""];
8493           return post.map(function(p) {
8494             return m.pre + n[0] + p;
8495           });
8496         }
8497       }
8498     }
8499     var pre = m.pre;
8500     var post = m.post.length ? expand(m.post, false) : [""];
8501     var N;
8502     if (isSequence) {
8503       var x = numeric(n[0]);
8504       var y = numeric(n[1]);
8505       var width = Math.max(n[0].length, n[1].length);
8506       var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
8507       var test = lte;
8508       var reverse = y < x;
8509       if (reverse) {
8510         incr *= -1;
8511         test = gte;
8512       }
8513       var pad = n.some(isPadded);
8514       N = [];
8515       for (var i = x; test(i, y); i += incr) {
8516         var c;
8517         if (isAlphaSequence) {
8518           c = String.fromCharCode(i);
8519           if (c === "\\")
8520             c = "";
8521         } else {
8522           c = String(i);
8523           if (pad) {
8524             var need = width - c.length;
8525             if (need > 0) {
8526               var z = new Array(need + 1).join("0");
8527               if (i < 0)
8528                 c = "-" + z + c.slice(1);
8529               else
8530                 c = z + c;
8531             }
8532           }
8533         }
8534         N.push(c);
8535       }
8536     } else {
8537       N = concatMap(n, function(el) {
8538         return expand(el, false);
8539       });
8540     }
8541     for (var j = 0; j < N.length; j++) {
8542       for (var k = 0; k < post.length; k++) {
8543         var expansion = pre + N[j] + post[k];
8544         if (!isTop || isSequence || expansion)
8545           expansions.push(expansion);
8546       }
8547     }
8548     return expansions;
8549   }
8550 });
8551
8552 // node_modules/minimatch/minimatch.js
8553 var require_minimatch = __commonJS((exports2, module2) => {
8554   module2.exports = minimatch;
8555   minimatch.Minimatch = Minimatch;
8556   var path = {sep: "/"};
8557   try {
8558     path = require("path");
8559   } catch (er) {
8560   }
8561   var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
8562   var expand = require_brace_expansion();
8563   var plTypes = {
8564     "!": {open: "(?:(?!(?:", close: "))[^/]*?)"},
8565     "?": {open: "(?:", close: ")?"},
8566     "+": {open: "(?:", close: ")+"},
8567     "*": {open: "(?:", close: ")*"},
8568     "@": {open: "(?:", close: ")"}
8569   };
8570   var qmark = "[^/]";
8571   var star = qmark + "*?";
8572   var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
8573   var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
8574   var reSpecials = charSet("().*{}+?[]^$\\!");
8575   function charSet(s) {
8576     return s.split("").reduce(function(set, c) {
8577       set[c] = true;
8578       return set;
8579     }, {});
8580   }
8581   var slashSplit = /\/+/;
8582   minimatch.filter = filter;
8583   function filter(pattern, options) {
8584     options = options || {};
8585     return function(p, i, list) {
8586       return minimatch(p, pattern, options);
8587     };
8588   }
8589   function ext(a, b) {
8590     a = a || {};
8591     b = b || {};
8592     var t = {};
8593     Object.keys(b).forEach(function(k) {
8594       t[k] = b[k];
8595     });
8596     Object.keys(a).forEach(function(k) {
8597       t[k] = a[k];
8598     });
8599     return t;
8600   }
8601   minimatch.defaults = function(def) {
8602     if (!def || !Object.keys(def).length)
8603       return minimatch;
8604     var orig = minimatch;
8605     var m = function minimatch2(p, pattern, options) {
8606       return orig.minimatch(p, pattern, ext(def, options));
8607     };
8608     m.Minimatch = function Minimatch2(pattern, options) {
8609       return new orig.Minimatch(pattern, ext(def, options));
8610     };
8611     return m;
8612   };
8613   Minimatch.defaults = function(def) {
8614     if (!def || !Object.keys(def).length)
8615       return Minimatch;
8616     return minimatch.defaults(def).Minimatch;
8617   };
8618   function minimatch(p, pattern, options) {
8619     if (typeof pattern !== "string") {
8620       throw new TypeError("glob pattern string required");
8621     }
8622     if (!options)
8623       options = {};
8624     if (!options.nocomment && pattern.charAt(0) === "#") {
8625       return false;
8626     }
8627     if (pattern.trim() === "")
8628       return p === "";
8629     return new Minimatch(pattern, options).match(p);
8630   }
8631   function Minimatch(pattern, options) {
8632     if (!(this instanceof Minimatch)) {
8633       return new Minimatch(pattern, options);
8634     }
8635     if (typeof pattern !== "string") {
8636       throw new TypeError("glob pattern string required");
8637     }
8638     if (!options)
8639       options = {};
8640     pattern = pattern.trim();
8641     if (path.sep !== "/") {
8642       pattern = pattern.split(path.sep).join("/");
8643     }
8644     this.options = options;
8645     this.set = [];
8646     this.pattern = pattern;
8647     this.regexp = null;
8648     this.negate = false;
8649     this.comment = false;
8650     this.empty = false;
8651     this.make();
8652   }
8653   Minimatch.prototype.debug = function() {
8654   };
8655   Minimatch.prototype.make = make;
8656   function make() {
8657     if (this._made)
8658       return;
8659     var pattern = this.pattern;
8660     var options = this.options;
8661     if (!options.nocomment && pattern.charAt(0) === "#") {
8662       this.comment = true;
8663       return;
8664     }
8665     if (!pattern) {
8666       this.empty = true;
8667       return;
8668     }
8669     this.parseNegate();
8670     var set = this.globSet = this.braceExpand();
8671     if (options.debug)
8672       this.debug = console.error;
8673     this.debug(this.pattern, set);
8674     set = this.globParts = set.map(function(s) {
8675       return s.split(slashSplit);
8676     });
8677     this.debug(this.pattern, set);
8678     set = set.map(function(s, si, set2) {
8679       return s.map(this.parse, this);
8680     }, this);
8681     this.debug(this.pattern, set);
8682     set = set.filter(function(s) {
8683       return s.indexOf(false) === -1;
8684     });
8685     this.debug(this.pattern, set);
8686     this.set = set;
8687   }
8688   Minimatch.prototype.parseNegate = parseNegate;
8689   function parseNegate() {
8690     var pattern = this.pattern;
8691     var negate = false;
8692     var options = this.options;
8693     var negateOffset = 0;
8694     if (options.nonegate)
8695       return;
8696     for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
8697       negate = !negate;
8698       negateOffset++;
8699     }
8700     if (negateOffset)
8701       this.pattern = pattern.substr(negateOffset);
8702     this.negate = negate;
8703   }
8704   minimatch.braceExpand = function(pattern, options) {
8705     return braceExpand(pattern, options);
8706   };
8707   Minimatch.prototype.braceExpand = braceExpand;
8708   function braceExpand(pattern, options) {
8709     if (!options) {
8710       if (this instanceof Minimatch) {
8711         options = this.options;
8712       } else {
8713         options = {};
8714       }
8715     }
8716     pattern = typeof pattern === "undefined" ? this.pattern : pattern;
8717     if (typeof pattern === "undefined") {
8718       throw new TypeError("undefined pattern");
8719     }
8720     if (options.nobrace || !pattern.match(/\{.*\}/)) {
8721       return [pattern];
8722     }
8723     return expand(pattern);
8724   }
8725   Minimatch.prototype.parse = parse;
8726   var SUBPARSE = {};
8727   function parse(pattern, isSub) {
8728     if (pattern.length > 1024 * 64) {
8729       throw new TypeError("pattern is too long");
8730     }
8731     var options = this.options;
8732     if (!options.noglobstar && pattern === "**")
8733       return GLOBSTAR;
8734     if (pattern === "")
8735       return "";
8736     var re = "";
8737     var hasMagic = !!options.nocase;
8738     var escaping = false;
8739     var patternListStack = [];
8740     var negativeLists = [];
8741     var stateChar;
8742     var inClass = false;
8743     var reClassStart = -1;
8744     var classStart = -1;
8745     var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
8746     var self2 = this;
8747     function clearStateChar() {
8748       if (stateChar) {
8749         switch (stateChar) {
8750           case "*":
8751             re += star;
8752             hasMagic = true;
8753             break;
8754           case "?":
8755             re += qmark;
8756             hasMagic = true;
8757             break;
8758           default:
8759             re += "\\" + stateChar;
8760             break;
8761         }
8762         self2.debug("clearStateChar %j %j", stateChar, re);
8763         stateChar = false;
8764       }
8765     }
8766     for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
8767       this.debug("%s    %s %s %j", pattern, i, re, c);
8768       if (escaping && reSpecials[c]) {
8769         re += "\\" + c;
8770         escaping = false;
8771         continue;
8772       }
8773       switch (c) {
8774         case "/":
8775           return false;
8776         case "\\":
8777           clearStateChar();
8778           escaping = true;
8779           continue;
8780         case "?":
8781         case "*":
8782         case "+":
8783         case "@":
8784         case "!":
8785           this.debug("%s        %s %s %j <-- stateChar", pattern, i, re, c);
8786           if (inClass) {
8787             this.debug("  in class");
8788             if (c === "!" && i === classStart + 1)
8789               c = "^";
8790             re += c;
8791             continue;
8792           }
8793           self2.debug("call clearStateChar %j", stateChar);
8794           clearStateChar();
8795           stateChar = c;
8796           if (options.noext)
8797             clearStateChar();
8798           continue;
8799         case "(":
8800           if (inClass) {
8801             re += "(";
8802             continue;
8803           }
8804           if (!stateChar) {
8805             re += "\\(";
8806             continue;
8807           }
8808           patternListStack.push({
8809             type: stateChar,
8810             start: i - 1,
8811             reStart: re.length,
8812             open: plTypes[stateChar].open,
8813             close: plTypes[stateChar].close
8814           });
8815           re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
8816           this.debug("plType %j %j", stateChar, re);
8817           stateChar = false;
8818           continue;
8819         case ")":
8820           if (inClass || !patternListStack.length) {
8821             re += "\\)";
8822             continue;
8823           }
8824           clearStateChar();
8825           hasMagic = true;
8826           var pl = patternListStack.pop();
8827           re += pl.close;
8828           if (pl.type === "!") {
8829             negativeLists.push(pl);
8830           }
8831           pl.reEnd = re.length;
8832           continue;
8833         case "|":
8834           if (inClass || !patternListStack.length || escaping) {
8835             re += "\\|";
8836             escaping = false;
8837             continue;
8838           }
8839           clearStateChar();
8840           re += "|";
8841           continue;
8842         case "[":
8843           clearStateChar();
8844           if (inClass) {
8845             re += "\\" + c;
8846             continue;
8847           }
8848           inClass = true;
8849           classStart = i;
8850           reClassStart = re.length;
8851           re += c;
8852           continue;
8853         case "]":
8854           if (i === classStart + 1 || !inClass) {
8855             re += "\\" + c;
8856             escaping = false;
8857             continue;
8858           }
8859           if (inClass) {
8860             var cs = pattern.substring(classStart + 1, i);
8861             try {
8862               RegExp("[" + cs + "]");
8863             } catch (er) {
8864               var sp = this.parse(cs, SUBPARSE);
8865               re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
8866               hasMagic = hasMagic || sp[1];
8867               inClass = false;
8868               continue;
8869             }
8870           }
8871           hasMagic = true;
8872           inClass = false;
8873           re += c;
8874           continue;
8875         default:
8876           clearStateChar();
8877           if (escaping) {
8878             escaping = false;
8879           } else if (reSpecials[c] && !(c === "^" && inClass)) {
8880             re += "\\";
8881           }
8882           re += c;
8883       }
8884     }
8885     if (inClass) {
8886       cs = pattern.substr(classStart + 1);
8887       sp = this.parse(cs, SUBPARSE);
8888       re = re.substr(0, reClassStart) + "\\[" + sp[0];
8889       hasMagic = hasMagic || sp[1];
8890     }
8891     for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
8892       var tail = re.slice(pl.reStart + pl.open.length);
8893       this.debug("setting tail", re, pl);
8894       tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_, $1, $2) {
8895         if (!$2) {
8896           $2 = "\\";
8897         }
8898         return $1 + $1 + $2 + "|";
8899       });
8900       this.debug("tail=%j\n   %s", tail, tail, pl, re);
8901       var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
8902       hasMagic = true;
8903       re = re.slice(0, pl.reStart) + t + "\\(" + tail;
8904     }
8905     clearStateChar();
8906     if (escaping) {
8907       re += "\\\\";
8908     }
8909     var addPatternStart = false;
8910     switch (re.charAt(0)) {
8911       case ".":
8912       case "[":
8913       case "(":
8914         addPatternStart = true;
8915     }
8916     for (var n = negativeLists.length - 1; n > -1; n--) {
8917       var nl = negativeLists[n];
8918       var nlBefore = re.slice(0, nl.reStart);
8919       var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
8920       var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
8921       var nlAfter = re.slice(nl.reEnd);
8922       nlLast += nlAfter;
8923       var openParensBefore = nlBefore.split("(").length - 1;
8924       var cleanAfter = nlAfter;
8925       for (i = 0; i < openParensBefore; i++) {
8926         cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
8927       }
8928       nlAfter = cleanAfter;
8929       var dollar = "";
8930       if (nlAfter === "" && isSub !== SUBPARSE) {
8931         dollar = "$";
8932       }
8933       var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
8934       re = newRe;
8935     }
8936     if (re !== "" && hasMagic) {
8937       re = "(?=.)" + re;
8938     }
8939     if (addPatternStart) {
8940       re = patternStart + re;
8941     }
8942     if (isSub === SUBPARSE) {
8943       return [re, hasMagic];
8944     }
8945     if (!hasMagic) {
8946       return globUnescape(pattern);
8947     }
8948     var flags = options.nocase ? "i" : "";
8949     try {
8950       var regExp = new RegExp("^" + re + "$", flags);
8951     } catch (er) {
8952       return new RegExp("$.");
8953     }
8954     regExp._glob = pattern;
8955     regExp._src = re;
8956     return regExp;
8957   }
8958   minimatch.makeRe = function(pattern, options) {
8959     return new Minimatch(pattern, options || {}).makeRe();
8960   };
8961   Minimatch.prototype.makeRe = makeRe;
8962   function makeRe() {
8963     if (this.regexp || this.regexp === false)
8964       return this.regexp;
8965     var set = this.set;
8966     if (!set.length) {
8967       this.regexp = false;
8968       return this.regexp;
8969     }
8970     var options = this.options;
8971     var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
8972     var flags = options.nocase ? "i" : "";
8973     var re = set.map(function(pattern) {
8974       return pattern.map(function(p) {
8975         return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
8976       }).join("\\/");
8977     }).join("|");
8978     re = "^(?:" + re + ")$";
8979     if (this.negate)
8980       re = "^(?!" + re + ").*$";
8981     try {
8982       this.regexp = new RegExp(re, flags);
8983     } catch (ex) {
8984       this.regexp = false;
8985     }
8986     return this.regexp;
8987   }
8988   minimatch.match = function(list, pattern, options) {
8989     options = options || {};
8990     var mm = new Minimatch(pattern, options);
8991     list = list.filter(function(f) {
8992       return mm.match(f);
8993     });
8994     if (mm.options.nonull && !list.length) {
8995       list.push(pattern);
8996     }
8997     return list;
8998   };
8999   Minimatch.prototype.match = match;
9000   function match(f, partial) {
9001     this.debug("match", f, this.pattern);
9002     if (this.comment)
9003       return false;
9004     if (this.empty)
9005       return f === "";
9006     if (f === "/" && partial)
9007       return true;
9008     var options = this.options;
9009     if (path.sep !== "/") {
9010       f = f.split(path.sep).join("/");
9011     }
9012     f = f.split(slashSplit);
9013     this.debug(this.pattern, "split", f);
9014     var set = this.set;
9015     this.debug(this.pattern, "set", set);
9016     var filename;
9017     var i;
9018     for (i = f.length - 1; i >= 0; i--) {
9019       filename = f[i];
9020       if (filename)
9021         break;
9022     }
9023     for (i = 0; i < set.length; i++) {
9024       var pattern = set[i];
9025       var file = f;
9026       if (options.matchBase && pattern.length === 1) {
9027         file = [filename];
9028       }
9029       var hit = this.matchOne(file, pattern, partial);
9030       if (hit) {
9031         if (options.flipNegate)
9032           return true;
9033         return !this.negate;
9034       }
9035     }
9036     if (options.flipNegate)
9037       return false;
9038     return this.negate;
9039   }
9040   Minimatch.prototype.matchOne = function(file, pattern, partial) {
9041     var options = this.options;
9042     this.debug("matchOne", {this: this, file, pattern});
9043     this.debug("matchOne", file.length, pattern.length);
9044     for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
9045       this.debug("matchOne loop");
9046       var p = pattern[pi];
9047       var f = file[fi];
9048       this.debug(pattern, p, f);
9049       if (p === false)
9050         return false;
9051       if (p === GLOBSTAR) {
9052         this.debug("GLOBSTAR", [pattern, p, f]);
9053         var fr = fi;
9054         var pr = pi + 1;
9055         if (pr === pl) {
9056           this.debug("** at the end");
9057           for (; fi < fl; fi++) {
9058             if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
9059               return false;
9060           }
9061           return true;
9062         }
9063         while (fr < fl) {
9064           var swallowee = file[fr];
9065           this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
9066           if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
9067             this.debug("globstar found match!", fr, fl, swallowee);
9068             return true;
9069           } else {
9070             if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
9071               this.debug("dot detected!", file, fr, pattern, pr);
9072               break;
9073             }
9074             this.debug("globstar swallow a segment, and continue");
9075             fr++;
9076           }
9077         }
9078         if (partial) {
9079           this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
9080           if (fr === fl)
9081             return true;
9082         }
9083         return false;
9084       }
9085       var hit;
9086       if (typeof p === "string") {
9087         if (options.nocase) {
9088           hit = f.toLowerCase() === p.toLowerCase();
9089         } else {
9090           hit = f === p;
9091         }
9092         this.debug("string match", p, f, hit);
9093       } else {
9094         hit = f.match(p);
9095         this.debug("pattern match", p, f, hit);
9096       }
9097       if (!hit)
9098         return false;
9099     }
9100     if (fi === fl && pi === pl) {
9101       return true;
9102     } else if (fi === fl) {
9103       return partial;
9104     } else if (pi === pl) {
9105       var emptyFileEnd = fi === fl - 1 && file[fi] === "";
9106       return emptyFileEnd;
9107     }
9108     throw new Error("wtf?");
9109   };
9110   function globUnescape(s) {
9111     return s.replace(/\\(.)/g, "$1");
9112   }
9113   function regExpEscape(s) {
9114     return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
9115   }
9116 });
9117
9118 // node_modules/inherits/inherits_browser.js
9119 var require_inherits_browser = __commonJS((exports2, module2) => {
9120   if (typeof Object.create === "function") {
9121     module2.exports = function inherits2(ctor, superCtor) {
9122       if (superCtor) {
9123         ctor.super_ = superCtor;
9124         ctor.prototype = Object.create(superCtor.prototype, {
9125           constructor: {
9126             value: ctor,
9127             enumerable: false,
9128             writable: true,
9129             configurable: true
9130           }
9131         });
9132       }
9133     };
9134   } else {
9135     module2.exports = function inherits2(ctor, superCtor) {
9136       if (superCtor) {
9137         ctor.super_ = superCtor;
9138         var TempCtor = function() {
9139         };
9140         TempCtor.prototype = superCtor.prototype;
9141         ctor.prototype = new TempCtor();
9142         ctor.prototype.constructor = ctor;
9143       }
9144     };
9145   }
9146 });
9147
9148 // node_modules/inherits/inherits.js
9149 var require_inherits = __commonJS((exports2, module2) => {
9150   try {
9151     util = require("util");
9152     if (typeof util.inherits !== "function")
9153       throw "";
9154     module2.exports = util.inherits;
9155   } catch (e) {
9156     module2.exports = require_inherits_browser();
9157   }
9158   var util;
9159 });
9160
9161 // node_modules/path-is-absolute/index.js
9162 var require_path_is_absolute = __commonJS((exports2, module2) => {
9163   "use strict";
9164   function posix(path) {
9165     return path.charAt(0) === "/";
9166   }
9167   function win32(path) {
9168     var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
9169     var result = splitDeviceRe.exec(path);
9170     var device = result[1] || "";
9171     var isUnc = Boolean(device && device.charAt(1) !== ":");
9172     return Boolean(result[2] || isUnc);
9173   }
9174   module2.exports = process.platform === "win32" ? win32 : posix;
9175   module2.exports.posix = posix;
9176   module2.exports.win32 = win32;
9177 });
9178
9179 // node_modules/glob/common.js
9180 var require_common = __commonJS((exports2) => {
9181   exports2.alphasort = alphasort;
9182   exports2.alphasorti = alphasorti;
9183   exports2.setopts = setopts;
9184   exports2.ownProp = ownProp;
9185   exports2.makeAbs = makeAbs;
9186   exports2.finish = finish;
9187   exports2.mark = mark;
9188   exports2.isIgnored = isIgnored;
9189   exports2.childrenIgnored = childrenIgnored;
9190   function ownProp(obj, field) {
9191     return Object.prototype.hasOwnProperty.call(obj, field);
9192   }
9193   var path = require("path");
9194   var minimatch = require_minimatch();
9195   var isAbsolute = require_path_is_absolute();
9196   var Minimatch = minimatch.Minimatch;
9197   function alphasorti(a, b) {
9198     return a.toLowerCase().localeCompare(b.toLowerCase());
9199   }
9200   function alphasort(a, b) {
9201     return a.localeCompare(b);
9202   }
9203   function setupIgnores(self2, options) {
9204     self2.ignore = options.ignore || [];
9205     if (!Array.isArray(self2.ignore))
9206       self2.ignore = [self2.ignore];
9207     if (self2.ignore.length) {
9208       self2.ignore = self2.ignore.map(ignoreMap);
9209     }
9210   }
9211   function ignoreMap(pattern) {
9212     var gmatcher = null;
9213     if (pattern.slice(-3) === "/**") {
9214       var gpattern = pattern.replace(/(\/\*\*)+$/, "");
9215       gmatcher = new Minimatch(gpattern, {dot: true});
9216     }
9217     return {
9218       matcher: new Minimatch(pattern, {dot: true}),
9219       gmatcher
9220     };
9221   }
9222   function setopts(self2, pattern, options) {
9223     if (!options)
9224       options = {};
9225     if (options.matchBase && pattern.indexOf("/") === -1) {
9226       if (options.noglobstar) {
9227         throw new Error("base matching requires globstar");
9228       }
9229       pattern = "**/" + pattern;
9230     }
9231     self2.silent = !!options.silent;
9232     self2.pattern = pattern;
9233     self2.strict = options.strict !== false;
9234     self2.realpath = !!options.realpath;
9235     self2.realpathCache = options.realpathCache || Object.create(null);
9236     self2.follow = !!options.follow;
9237     self2.dot = !!options.dot;
9238     self2.mark = !!options.mark;
9239     self2.nodir = !!options.nodir;
9240     if (self2.nodir)
9241       self2.mark = true;
9242     self2.sync = !!options.sync;
9243     self2.nounique = !!options.nounique;
9244     self2.nonull = !!options.nonull;
9245     self2.nosort = !!options.nosort;
9246     self2.nocase = !!options.nocase;
9247     self2.stat = !!options.stat;
9248     self2.noprocess = !!options.noprocess;
9249     self2.absolute = !!options.absolute;
9250     self2.maxLength = options.maxLength || Infinity;
9251     self2.cache = options.cache || Object.create(null);
9252     self2.statCache = options.statCache || Object.create(null);
9253     self2.symlinks = options.symlinks || Object.create(null);
9254     setupIgnores(self2, options);
9255     self2.changedCwd = false;
9256     var cwd = process.cwd();
9257     if (!ownProp(options, "cwd"))
9258       self2.cwd = cwd;
9259     else {
9260       self2.cwd = path.resolve(options.cwd);
9261       self2.changedCwd = self2.cwd !== cwd;
9262     }
9263     self2.root = options.root || path.resolve(self2.cwd, "/");
9264     self2.root = path.resolve(self2.root);
9265     if (process.platform === "win32")
9266       self2.root = self2.root.replace(/\\/g, "/");
9267     self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
9268     if (process.platform === "win32")
9269       self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
9270     self2.nomount = !!options.nomount;
9271     options.nonegate = true;
9272     options.nocomment = true;
9273     self2.minimatch = new Minimatch(pattern, options);
9274     self2.options = self2.minimatch.options;
9275   }
9276   function finish(self2) {
9277     var nou = self2.nounique;
9278     var all = nou ? [] : Object.create(null);
9279     for (var i = 0, l = self2.matches.length; i < l; i++) {
9280       var matches = self2.matches[i];
9281       if (!matches || Object.keys(matches).length === 0) {
9282         if (self2.nonull) {
9283           var literal = self2.minimatch.globSet[i];
9284           if (nou)
9285             all.push(literal);
9286           else
9287             all[literal] = true;
9288         }
9289       } else {
9290         var m = Object.keys(matches);
9291         if (nou)
9292           all.push.apply(all, m);
9293         else
9294           m.forEach(function(m2) {
9295             all[m2] = true;
9296           });
9297       }
9298     }
9299     if (!nou)
9300       all = Object.keys(all);
9301     if (!self2.nosort)
9302       all = all.sort(self2.nocase ? alphasorti : alphasort);
9303     if (self2.mark) {
9304       for (var i = 0; i < all.length; i++) {
9305         all[i] = self2._mark(all[i]);
9306       }
9307       if (self2.nodir) {
9308         all = all.filter(function(e) {
9309           var notDir = !/\/$/.test(e);
9310           var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
9311           if (notDir && c)
9312             notDir = c !== "DIR" && !Array.isArray(c);
9313           return notDir;
9314         });
9315       }
9316     }
9317     if (self2.ignore.length)
9318       all = all.filter(function(m2) {
9319         return !isIgnored(self2, m2);
9320       });
9321     self2.found = all;
9322   }
9323   function mark(self2, p) {
9324     var abs = makeAbs(self2, p);
9325     var c = self2.cache[abs];
9326     var m = p;
9327     if (c) {
9328       var isDir = c === "DIR" || Array.isArray(c);
9329       var slash = p.slice(-1) === "/";
9330       if (isDir && !slash)
9331         m += "/";
9332       else if (!isDir && slash)
9333         m = m.slice(0, -1);
9334       if (m !== p) {
9335         var mabs = makeAbs(self2, m);
9336         self2.statCache[mabs] = self2.statCache[abs];
9337         self2.cache[mabs] = self2.cache[abs];
9338       }
9339     }
9340     return m;
9341   }
9342   function makeAbs(self2, f) {
9343     var abs = f;
9344     if (f.charAt(0) === "/") {
9345       abs = path.join(self2.root, f);
9346     } else if (isAbsolute(f) || f === "") {
9347       abs = f;
9348     } else if (self2.changedCwd) {
9349       abs = path.resolve(self2.cwd, f);
9350     } else {
9351       abs = path.resolve(f);
9352     }
9353     if (process.platform === "win32")
9354       abs = abs.replace(/\\/g, "/");
9355     return abs;
9356   }
9357   function isIgnored(self2, path2) {
9358     if (!self2.ignore.length)
9359       return false;
9360     return self2.ignore.some(function(item) {
9361       return item.matcher.match(path2) || !!(item.gmatcher && item.gmatcher.match(path2));
9362     });
9363   }
9364   function childrenIgnored(self2, path2) {
9365     if (!self2.ignore.length)
9366       return false;
9367     return self2.ignore.some(function(item) {
9368       return !!(item.gmatcher && item.gmatcher.match(path2));
9369     });
9370   }
9371 });
9372
9373 // node_modules/glob/sync.js
9374 var require_sync = __commonJS((exports2, module2) => {
9375   module2.exports = globSync;
9376   globSync.GlobSync = GlobSync;
9377   var fs = require("fs");
9378   var rp = require_fs();
9379   var minimatch = require_minimatch();
9380   var Minimatch = minimatch.Minimatch;
9381   var Glob = require_glob().Glob;
9382   var util = require("util");
9383   var path = require("path");
9384   var assert = require("assert");
9385   var isAbsolute = require_path_is_absolute();
9386   var common2 = require_common();
9387   var alphasort = common2.alphasort;
9388   var alphasorti = common2.alphasorti;
9389   var setopts = common2.setopts;
9390   var ownProp = common2.ownProp;
9391   var childrenIgnored = common2.childrenIgnored;
9392   var isIgnored = common2.isIgnored;
9393   function globSync(pattern, options) {
9394     if (typeof options === "function" || arguments.length === 3)
9395       throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
9396     return new GlobSync(pattern, options).found;
9397   }
9398   function GlobSync(pattern, options) {
9399     if (!pattern)
9400       throw new Error("must provide pattern");
9401     if (typeof options === "function" || arguments.length === 3)
9402       throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
9403     if (!(this instanceof GlobSync))
9404       return new GlobSync(pattern, options);
9405     setopts(this, pattern, options);
9406     if (this.noprocess)
9407       return this;
9408     var n = this.minimatch.set.length;
9409     this.matches = new Array(n);
9410     for (var i = 0; i < n; i++) {
9411       this._process(this.minimatch.set[i], i, false);
9412     }
9413     this._finish();
9414   }
9415   GlobSync.prototype._finish = function() {
9416     assert(this instanceof GlobSync);
9417     if (this.realpath) {
9418       var self2 = this;
9419       this.matches.forEach(function(matchset, index) {
9420         var set = self2.matches[index] = Object.create(null);
9421         for (var p in matchset) {
9422           try {
9423             p = self2._makeAbs(p);
9424             var real = rp.realpathSync(p, self2.realpathCache);
9425             set[real] = true;
9426           } catch (er) {
9427             if (er.syscall === "stat")
9428               set[self2._makeAbs(p)] = true;
9429             else
9430               throw er;
9431           }
9432         }
9433       });
9434     }
9435     common2.finish(this);
9436   };
9437   GlobSync.prototype._process = function(pattern, index, inGlobStar) {
9438     assert(this instanceof GlobSync);
9439     var n = 0;
9440     while (typeof pattern[n] === "string") {
9441       n++;
9442     }
9443     var prefix;
9444     switch (n) {
9445       case pattern.length:
9446         this._processSimple(pattern.join("/"), index);
9447         return;
9448       case 0:
9449         prefix = null;
9450         break;
9451       default:
9452         prefix = pattern.slice(0, n).join("/");
9453         break;
9454     }
9455     var remain = pattern.slice(n);
9456     var read;
9457     if (prefix === null)
9458       read = ".";
9459     else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
9460       if (!prefix || !isAbsolute(prefix))
9461         prefix = "/" + prefix;
9462       read = prefix;
9463     } else
9464       read = prefix;
9465     var abs = this._makeAbs(read);
9466     if (childrenIgnored(this, read))
9467       return;
9468     var isGlobStar = remain[0] === minimatch.GLOBSTAR;
9469     if (isGlobStar)
9470       this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
9471     else
9472       this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
9473   };
9474   GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar) {
9475     var entries = this._readdir(abs, inGlobStar);
9476     if (!entries)
9477       return;
9478     var pn = remain[0];
9479     var negate = !!this.minimatch.negate;
9480     var rawGlob = pn._glob;
9481     var dotOk = this.dot || rawGlob.charAt(0) === ".";
9482     var matchedEntries = [];
9483     for (var i = 0; i < entries.length; i++) {
9484       var e = entries[i];
9485       if (e.charAt(0) !== "." || dotOk) {
9486         var m;
9487         if (negate && !prefix) {
9488           m = !e.match(pn);
9489         } else {
9490           m = e.match(pn);
9491         }
9492         if (m)
9493           matchedEntries.push(e);
9494       }
9495     }
9496     var len = matchedEntries.length;
9497     if (len === 0)
9498       return;
9499     if (remain.length === 1 && !this.mark && !this.stat) {
9500       if (!this.matches[index])
9501         this.matches[index] = Object.create(null);
9502       for (var i = 0; i < len; i++) {
9503         var e = matchedEntries[i];
9504         if (prefix) {
9505           if (prefix.slice(-1) !== "/")
9506             e = prefix + "/" + e;
9507           else
9508             e = prefix + e;
9509         }
9510         if (e.charAt(0) === "/" && !this.nomount) {
9511           e = path.join(this.root, e);
9512         }
9513         this._emitMatch(index, e);
9514       }
9515       return;
9516     }
9517     remain.shift();
9518     for (var i = 0; i < len; i++) {
9519       var e = matchedEntries[i];
9520       var newPattern;
9521       if (prefix)
9522         newPattern = [prefix, e];
9523       else
9524         newPattern = [e];
9525       this._process(newPattern.concat(remain), index, inGlobStar);
9526     }
9527   };
9528   GlobSync.prototype._emitMatch = function(index, e) {
9529     if (isIgnored(this, e))
9530       return;
9531     var abs = this._makeAbs(e);
9532     if (this.mark)
9533       e = this._mark(e);
9534     if (this.absolute) {
9535       e = abs;
9536     }
9537     if (this.matches[index][e])
9538       return;
9539     if (this.nodir) {
9540       var c = this.cache[abs];
9541       if (c === "DIR" || Array.isArray(c))
9542         return;
9543     }
9544     this.matches[index][e] = true;
9545     if (this.stat)
9546       this._stat(e);
9547   };
9548   GlobSync.prototype._readdirInGlobStar = function(abs) {
9549     if (this.follow)
9550       return this._readdir(abs, false);
9551     var entries;
9552     var lstat;
9553     var stat;
9554     try {
9555       lstat = fs.lstatSync(abs);
9556     } catch (er) {
9557       if (er.code === "ENOENT") {
9558         return null;
9559       }
9560     }
9561     var isSym = lstat && lstat.isSymbolicLink();
9562     this.symlinks[abs] = isSym;
9563     if (!isSym && lstat && !lstat.isDirectory())
9564       this.cache[abs] = "FILE";
9565     else
9566       entries = this._readdir(abs, false);
9567     return entries;
9568   };
9569   GlobSync.prototype._readdir = function(abs, inGlobStar) {
9570     var entries;
9571     if (inGlobStar && !ownProp(this.symlinks, abs))
9572       return this._readdirInGlobStar(abs);
9573     if (ownProp(this.cache, abs)) {
9574       var c = this.cache[abs];
9575       if (!c || c === "FILE")
9576         return null;
9577       if (Array.isArray(c))
9578         return c;
9579     }
9580     try {
9581       return this._readdirEntries(abs, fs.readdirSync(abs));
9582     } catch (er) {
9583       this._readdirError(abs, er);
9584       return null;
9585     }
9586   };
9587   GlobSync.prototype._readdirEntries = function(abs, entries) {
9588     if (!this.mark && !this.stat) {
9589       for (var i = 0; i < entries.length; i++) {
9590         var e = entries[i];
9591         if (abs === "/")
9592           e = abs + e;
9593         else
9594           e = abs + "/" + e;
9595         this.cache[e] = true;
9596       }
9597     }
9598     this.cache[abs] = entries;
9599     return entries;
9600   };
9601   GlobSync.prototype._readdirError = function(f, er) {
9602     switch (er.code) {
9603       case "ENOTSUP":
9604       case "ENOTDIR":
9605         var abs = this._makeAbs(f);
9606         this.cache[abs] = "FILE";
9607         if (abs === this.cwdAbs) {
9608           var error = new Error(er.code + " invalid cwd " + this.cwd);
9609           error.path = this.cwd;
9610           error.code = er.code;
9611           throw error;
9612         }
9613         break;
9614       case "ENOENT":
9615       case "ELOOP":
9616       case "ENAMETOOLONG":
9617       case "UNKNOWN":
9618         this.cache[this._makeAbs(f)] = false;
9619         break;
9620       default:
9621         this.cache[this._makeAbs(f)] = false;
9622         if (this.strict)
9623           throw er;
9624         if (!this.silent)
9625           console.error("glob error", er);
9626         break;
9627     }
9628   };
9629   GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar) {
9630     var entries = this._readdir(abs, inGlobStar);
9631     if (!entries)
9632       return;
9633     var remainWithoutGlobStar = remain.slice(1);
9634     var gspref = prefix ? [prefix] : [];
9635     var noGlobStar = gspref.concat(remainWithoutGlobStar);
9636     this._process(noGlobStar, index, false);
9637     var len = entries.length;
9638     var isSym = this.symlinks[abs];
9639     if (isSym && inGlobStar)
9640       return;
9641     for (var i = 0; i < len; i++) {
9642       var e = entries[i];
9643       if (e.charAt(0) === "." && !this.dot)
9644         continue;
9645       var instead = gspref.concat(entries[i], remainWithoutGlobStar);
9646       this._process(instead, index, true);
9647       var below = gspref.concat(entries[i], remain);
9648       this._process(below, index, true);
9649     }
9650   };
9651   GlobSync.prototype._processSimple = function(prefix, index) {
9652     var exists = this._stat(prefix);
9653     if (!this.matches[index])
9654       this.matches[index] = Object.create(null);
9655     if (!exists)
9656       return;
9657     if (prefix && isAbsolute(prefix) && !this.nomount) {
9658       var trail = /[\/\\]$/.test(prefix);
9659       if (prefix.charAt(0) === "/") {
9660         prefix = path.join(this.root, prefix);
9661       } else {
9662         prefix = path.resolve(this.root, prefix);
9663         if (trail)
9664           prefix += "/";
9665       }
9666     }
9667     if (process.platform === "win32")
9668       prefix = prefix.replace(/\\/g, "/");
9669     this._emitMatch(index, prefix);
9670   };
9671   GlobSync.prototype._stat = function(f) {
9672     var abs = this._makeAbs(f);
9673     var needDir = f.slice(-1) === "/";
9674     if (f.length > this.maxLength)
9675       return false;
9676     if (!this.stat && ownProp(this.cache, abs)) {
9677       var c = this.cache[abs];
9678       if (Array.isArray(c))
9679         c = "DIR";
9680       if (!needDir || c === "DIR")
9681         return c;
9682       if (needDir && c === "FILE")
9683         return false;
9684     }
9685     var exists;
9686     var stat = this.statCache[abs];
9687     if (!stat) {
9688       var lstat;
9689       try {
9690         lstat = fs.lstatSync(abs);
9691       } catch (er) {
9692         if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
9693           this.statCache[abs] = false;
9694           return false;
9695         }
9696       }
9697       if (lstat && lstat.isSymbolicLink()) {
9698         try {
9699           stat = fs.statSync(abs);
9700         } catch (er) {
9701           stat = lstat;
9702         }
9703       } else {
9704         stat = lstat;
9705       }
9706     }
9707     this.statCache[abs] = stat;
9708     var c = true;
9709     if (stat)
9710       c = stat.isDirectory() ? "DIR" : "FILE";
9711     this.cache[abs] = this.cache[abs] || c;
9712     if (needDir && c === "FILE")
9713       return false;
9714     return c;
9715   };
9716   GlobSync.prototype._mark = function(p) {
9717     return common2.mark(this, p);
9718   };
9719   GlobSync.prototype._makeAbs = function(f) {
9720     return common2.makeAbs(this, f);
9721   };
9722 });
9723
9724 // node_modules/wrappy/wrappy.js
9725 var require_wrappy = __commonJS((exports2, module2) => {
9726   module2.exports = wrappy;
9727   function wrappy(fn, cb) {
9728     if (fn && cb)
9729       return wrappy(fn)(cb);
9730     if (typeof fn !== "function")
9731       throw new TypeError("need wrapper function");
9732     Object.keys(fn).forEach(function(k) {
9733       wrapper[k] = fn[k];
9734     });
9735     return wrapper;
9736     function wrapper() {
9737       var args = new Array(arguments.length);
9738       for (var i = 0; i < args.length; i++) {
9739         args[i] = arguments[i];
9740       }
9741       var ret2 = fn.apply(this, args);
9742       var cb2 = args[args.length - 1];
9743       if (typeof ret2 === "function" && ret2 !== cb2) {
9744         Object.keys(cb2).forEach(function(k) {
9745           ret2[k] = cb2[k];
9746         });
9747       }
9748       return ret2;
9749     }
9750   }
9751 });
9752
9753 // node_modules/once/once.js
9754 var require_once = __commonJS((exports2, module2) => {
9755   var wrappy = require_wrappy();
9756   module2.exports = wrappy(once);
9757   module2.exports.strict = wrappy(onceStrict);
9758   once.proto = once(function() {
9759     Object.defineProperty(Function.prototype, "once", {
9760       value: function() {
9761         return once(this);
9762       },
9763       configurable: true
9764     });
9765     Object.defineProperty(Function.prototype, "onceStrict", {
9766       value: function() {
9767         return onceStrict(this);
9768       },
9769       configurable: true
9770     });
9771   });
9772   function once(fn) {
9773     var f = function() {
9774       if (f.called)
9775         return f.value;
9776       f.called = true;
9777       return f.value = fn.apply(this, arguments);
9778     };
9779     f.called = false;
9780     return f;
9781   }
9782   function onceStrict(fn) {
9783     var f = function() {
9784       if (f.called)
9785         throw new Error(f.onceError);
9786       f.called = true;
9787       return f.value = fn.apply(this, arguments);
9788     };
9789     var name = fn.name || "Function wrapped with `once`";
9790     f.onceError = name + " shouldn't be called more than once";
9791     f.called = false;
9792     return f;
9793   }
9794 });
9795
9796 // node_modules/inflight/inflight.js
9797 var require_inflight = __commonJS((exports2, module2) => {
9798   var wrappy = require_wrappy();
9799   var reqs = Object.create(null);
9800   var once = require_once();
9801   module2.exports = wrappy(inflight);
9802   function inflight(key, cb) {
9803     if (reqs[key]) {
9804       reqs[key].push(cb);
9805       return null;
9806     } else {
9807       reqs[key] = [cb];
9808       return makeres(key);
9809     }
9810   }
9811   function makeres(key) {
9812     return once(function RES() {
9813       var cbs = reqs[key];
9814       var len = cbs.length;
9815       var args = slice(arguments);
9816       try {
9817         for (var i = 0; i < len; i++) {
9818           cbs[i].apply(null, args);
9819         }
9820       } finally {
9821         if (cbs.length > len) {
9822           cbs.splice(0, len);
9823           process.nextTick(function() {
9824             RES.apply(null, args);
9825           });
9826         } else {
9827           delete reqs[key];
9828         }
9829       }
9830     });
9831   }
9832   function slice(args) {
9833     var length = args.length;
9834     var array = [];
9835     for (var i = 0; i < length; i++)
9836       array[i] = args[i];
9837     return array;
9838   }
9839 });
9840
9841 // node_modules/glob/glob.js
9842 var require_glob = __commonJS((exports2, module2) => {
9843   module2.exports = glob;
9844   var fs = require("fs");
9845   var rp = require_fs();
9846   var minimatch = require_minimatch();
9847   var Minimatch = minimatch.Minimatch;
9848   var inherits2 = require_inherits();
9849   var EE = require("events").EventEmitter;
9850   var path = require("path");
9851   var assert = require("assert");
9852   var isAbsolute = require_path_is_absolute();
9853   var globSync = require_sync();
9854   var common2 = require_common();
9855   var alphasort = common2.alphasort;
9856   var alphasorti = common2.alphasorti;
9857   var setopts = common2.setopts;
9858   var ownProp = common2.ownProp;
9859   var inflight = require_inflight();
9860   var util = require("util");
9861   var childrenIgnored = common2.childrenIgnored;
9862   var isIgnored = common2.isIgnored;
9863   var once = require_once();
9864   function glob(pattern, options, cb) {
9865     if (typeof options === "function")
9866       cb = options, options = {};
9867     if (!options)
9868       options = {};
9869     if (options.sync) {
9870       if (cb)
9871         throw new TypeError("callback provided to sync glob");
9872       return globSync(pattern, options);
9873     }
9874     return new Glob(pattern, options, cb);
9875   }
9876   glob.sync = globSync;
9877   var GlobSync = glob.GlobSync = globSync.GlobSync;
9878   glob.glob = glob;
9879   function extend(origin, add) {
9880     if (add === null || typeof add !== "object") {
9881       return origin;
9882     }
9883     var keys = Object.keys(add);
9884     var i = keys.length;
9885     while (i--) {
9886       origin[keys[i]] = add[keys[i]];
9887     }
9888     return origin;
9889   }
9890   glob.hasMagic = function(pattern, options_) {
9891     var options = extend({}, options_);
9892     options.noprocess = true;
9893     var g = new Glob(pattern, options);
9894     var set = g.minimatch.set;
9895     if (!pattern)
9896       return false;
9897     if (set.length > 1)
9898       return true;
9899     for (var j = 0; j < set[0].length; j++) {
9900       if (typeof set[0][j] !== "string")
9901         return true;
9902     }
9903     return false;
9904   };
9905   glob.Glob = Glob;
9906   inherits2(Glob, EE);
9907   function Glob(pattern, options, cb) {
9908     if (typeof options === "function") {
9909       cb = options;
9910       options = null;
9911     }
9912     if (options && options.sync) {
9913       if (cb)
9914         throw new TypeError("callback provided to sync glob");
9915       return new GlobSync(pattern, options);
9916     }
9917     if (!(this instanceof Glob))
9918       return new Glob(pattern, options, cb);
9919     setopts(this, pattern, options);
9920     this._didRealPath = false;
9921     var n = this.minimatch.set.length;
9922     this.matches = new Array(n);
9923     if (typeof cb === "function") {
9924       cb = once(cb);
9925       this.on("error", cb);
9926       this.on("end", function(matches) {
9927         cb(null, matches);
9928       });
9929     }
9930     var self2 = this;
9931     this._processing = 0;
9932     this._emitQueue = [];
9933     this._processQueue = [];
9934     this.paused = false;
9935     if (this.noprocess)
9936       return this;
9937     if (n === 0)
9938       return done();
9939     var sync = true;
9940     for (var i = 0; i < n; i++) {
9941       this._process(this.minimatch.set[i], i, false, done);
9942     }
9943     sync = false;
9944     function done() {
9945       --self2._processing;
9946       if (self2._processing <= 0) {
9947         if (sync) {
9948           process.nextTick(function() {
9949             self2._finish();
9950           });
9951         } else {
9952           self2._finish();
9953         }
9954       }
9955     }
9956   }
9957   Glob.prototype._finish = function() {
9958     assert(this instanceof Glob);
9959     if (this.aborted)
9960       return;
9961     if (this.realpath && !this._didRealpath)
9962       return this._realpath();
9963     common2.finish(this);
9964     this.emit("end", this.found);
9965   };
9966   Glob.prototype._realpath = function() {
9967     if (this._didRealpath)
9968       return;
9969     this._didRealpath = true;
9970     var n = this.matches.length;
9971     if (n === 0)
9972       return this._finish();
9973     var self2 = this;
9974     for (var i = 0; i < this.matches.length; i++)
9975       this._realpathSet(i, next);
9976     function next() {
9977       if (--n === 0)
9978         self2._finish();
9979     }
9980   };
9981   Glob.prototype._realpathSet = function(index, cb) {
9982     var matchset = this.matches[index];
9983     if (!matchset)
9984       return cb();
9985     var found = Object.keys(matchset);
9986     var self2 = this;
9987     var n = found.length;
9988     if (n === 0)
9989       return cb();
9990     var set = this.matches[index] = Object.create(null);
9991     found.forEach(function(p, i) {
9992       p = self2._makeAbs(p);
9993       rp.realpath(p, self2.realpathCache, function(er, real) {
9994         if (!er)
9995           set[real] = true;
9996         else if (er.syscall === "stat")
9997           set[p] = true;
9998         else
9999           self2.emit("error", er);
10000         if (--n === 0) {
10001           self2.matches[index] = set;
10002           cb();
10003         }
10004       });
10005     });
10006   };
10007   Glob.prototype._mark = function(p) {
10008     return common2.mark(this, p);
10009   };
10010   Glob.prototype._makeAbs = function(f) {
10011     return common2.makeAbs(this, f);
10012   };
10013   Glob.prototype.abort = function() {
10014     this.aborted = true;
10015     this.emit("abort");
10016   };
10017   Glob.prototype.pause = function() {
10018     if (!this.paused) {
10019       this.paused = true;
10020       this.emit("pause");
10021     }
10022   };
10023   Glob.prototype.resume = function() {
10024     if (this.paused) {
10025       this.emit("resume");
10026       this.paused = false;
10027       if (this._emitQueue.length) {
10028         var eq = this._emitQueue.slice(0);
10029         this._emitQueue.length = 0;
10030         for (var i = 0; i < eq.length; i++) {
10031           var e = eq[i];
10032           this._emitMatch(e[0], e[1]);
10033         }
10034       }
10035       if (this._processQueue.length) {
10036         var pq = this._processQueue.slice(0);
10037         this._processQueue.length = 0;
10038         for (var i = 0; i < pq.length; i++) {
10039           var p = pq[i];
10040           this._processing--;
10041           this._process(p[0], p[1], p[2], p[3]);
10042         }
10043       }
10044     }
10045   };
10046   Glob.prototype._process = function(pattern, index, inGlobStar, cb) {
10047     assert(this instanceof Glob);
10048     assert(typeof cb === "function");
10049     if (this.aborted)
10050       return;
10051     this._processing++;
10052     if (this.paused) {
10053       this._processQueue.push([pattern, index, inGlobStar, cb]);
10054       return;
10055     }
10056     var n = 0;
10057     while (typeof pattern[n] === "string") {
10058       n++;
10059     }
10060     var prefix;
10061     switch (n) {
10062       case pattern.length:
10063         this._processSimple(pattern.join("/"), index, cb);
10064         return;
10065       case 0:
10066         prefix = null;
10067         break;
10068       default:
10069         prefix = pattern.slice(0, n).join("/");
10070         break;
10071     }
10072     var remain = pattern.slice(n);
10073     var read;
10074     if (prefix === null)
10075       read = ".";
10076     else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
10077       if (!prefix || !isAbsolute(prefix))
10078         prefix = "/" + prefix;
10079       read = prefix;
10080     } else
10081       read = prefix;
10082     var abs = this._makeAbs(read);
10083     if (childrenIgnored(this, read))
10084       return cb();
10085     var isGlobStar = remain[0] === minimatch.GLOBSTAR;
10086     if (isGlobStar)
10087       this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
10088     else
10089       this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
10090   };
10091   Glob.prototype._processReaddir = function(prefix, read, abs, remain, index, inGlobStar, cb) {
10092     var self2 = this;
10093     this._readdir(abs, inGlobStar, function(er, entries) {
10094       return self2._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
10095     });
10096   };
10097   Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
10098     if (!entries)
10099       return cb();
10100     var pn = remain[0];
10101     var negate = !!this.minimatch.negate;
10102     var rawGlob = pn._glob;
10103     var dotOk = this.dot || rawGlob.charAt(0) === ".";
10104     var matchedEntries = [];
10105     for (var i = 0; i < entries.length; i++) {
10106       var e = entries[i];
10107       if (e.charAt(0) !== "." || dotOk) {
10108         var m;
10109         if (negate && !prefix) {
10110           m = !e.match(pn);
10111         } else {
10112           m = e.match(pn);
10113         }
10114         if (m)
10115           matchedEntries.push(e);
10116       }
10117     }
10118     var len = matchedEntries.length;
10119     if (len === 0)
10120       return cb();
10121     if (remain.length === 1 && !this.mark && !this.stat) {
10122       if (!this.matches[index])
10123         this.matches[index] = Object.create(null);
10124       for (var i = 0; i < len; i++) {
10125         var e = matchedEntries[i];
10126         if (prefix) {
10127           if (prefix !== "/")
10128             e = prefix + "/" + e;
10129           else
10130             e = prefix + e;
10131         }
10132         if (e.charAt(0) === "/" && !this.nomount) {
10133           e = path.join(this.root, e);
10134         }
10135         this._emitMatch(index, e);
10136       }
10137       return cb();
10138     }
10139     remain.shift();
10140     for (var i = 0; i < len; i++) {
10141       var e = matchedEntries[i];
10142       var newPattern;
10143       if (prefix) {
10144         if (prefix !== "/")
10145           e = prefix + "/" + e;
10146         else
10147           e = prefix + e;
10148       }
10149       this._process([e].concat(remain), index, inGlobStar, cb);
10150     }
10151     cb();
10152   };
10153   Glob.prototype._emitMatch = function(index, e) {
10154     if (this.aborted)
10155       return;
10156     if (isIgnored(this, e))
10157       return;
10158     if (this.paused) {
10159       this._emitQueue.push([index, e]);
10160       return;
10161     }
10162     var abs = isAbsolute(e) ? e : this._makeAbs(e);
10163     if (this.mark)
10164       e = this._mark(e);
10165     if (this.absolute)
10166       e = abs;
10167     if (this.matches[index][e])
10168       return;
10169     if (this.nodir) {
10170       var c = this.cache[abs];
10171       if (c === "DIR" || Array.isArray(c))
10172         return;
10173     }
10174     this.matches[index][e] = true;
10175     var st = this.statCache[abs];
10176     if (st)
10177       this.emit("stat", e, st);
10178     this.emit("match", e);
10179   };
10180   Glob.prototype._readdirInGlobStar = function(abs, cb) {
10181     if (this.aborted)
10182       return;
10183     if (this.follow)
10184       return this._readdir(abs, false, cb);
10185     var lstatkey = "lstat\0" + abs;
10186     var self2 = this;
10187     var lstatcb = inflight(lstatkey, lstatcb_);
10188     if (lstatcb)
10189       fs.lstat(abs, lstatcb);
10190     function lstatcb_(er, lstat) {
10191       if (er && er.code === "ENOENT")
10192         return cb();
10193       var isSym = lstat && lstat.isSymbolicLink();
10194       self2.symlinks[abs] = isSym;
10195       if (!isSym && lstat && !lstat.isDirectory()) {
10196         self2.cache[abs] = "FILE";
10197         cb();
10198       } else
10199         self2._readdir(abs, false, cb);
10200     }
10201   };
10202   Glob.prototype._readdir = function(abs, inGlobStar, cb) {
10203     if (this.aborted)
10204       return;
10205     cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
10206     if (!cb)
10207       return;
10208     if (inGlobStar && !ownProp(this.symlinks, abs))
10209       return this._readdirInGlobStar(abs, cb);
10210     if (ownProp(this.cache, abs)) {
10211       var c = this.cache[abs];
10212       if (!c || c === "FILE")
10213         return cb();
10214       if (Array.isArray(c))
10215         return cb(null, c);
10216     }
10217     var self2 = this;
10218     fs.readdir(abs, readdirCb(this, abs, cb));
10219   };
10220   function readdirCb(self2, abs, cb) {
10221     return function(er, entries) {
10222       if (er)
10223         self2._readdirError(abs, er, cb);
10224       else
10225         self2._readdirEntries(abs, entries, cb);
10226     };
10227   }
10228   Glob.prototype._readdirEntries = function(abs, entries, cb) {
10229     if (this.aborted)
10230       return;
10231     if (!this.mark && !this.stat) {
10232       for (var i = 0; i < entries.length; i++) {
10233         var e = entries[i];
10234         if (abs === "/")
10235           e = abs + e;
10236         else
10237           e = abs + "/" + e;
10238         this.cache[e] = true;
10239       }
10240     }
10241     this.cache[abs] = entries;
10242     return cb(null, entries);
10243   };
10244   Glob.prototype._readdirError = function(f, er, cb) {
10245     if (this.aborted)
10246       return;
10247     switch (er.code) {
10248       case "ENOTSUP":
10249       case "ENOTDIR":
10250         var abs = this._makeAbs(f);
10251         this.cache[abs] = "FILE";
10252         if (abs === this.cwdAbs) {
10253           var error = new Error(er.code + " invalid cwd " + this.cwd);
10254           error.path = this.cwd;
10255           error.code = er.code;
10256           this.emit("error", error);
10257           this.abort();
10258         }
10259         break;
10260       case "ENOENT":
10261       case "ELOOP":
10262       case "ENAMETOOLONG":
10263       case "UNKNOWN":
10264         this.cache[this._makeAbs(f)] = false;
10265         break;
10266       default:
10267         this.cache[this._makeAbs(f)] = false;
10268         if (this.strict) {
10269           this.emit("error", er);
10270           this.abort();
10271         }
10272         if (!this.silent)
10273           console.error("glob error", er);
10274         break;
10275     }
10276     return cb();
10277   };
10278   Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index, inGlobStar, cb) {
10279     var self2 = this;
10280     this._readdir(abs, inGlobStar, function(er, entries) {
10281       self2._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
10282     });
10283   };
10284   Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index, inGlobStar, entries, cb) {
10285     if (!entries)
10286       return cb();
10287     var remainWithoutGlobStar = remain.slice(1);
10288     var gspref = prefix ? [prefix] : [];
10289     var noGlobStar = gspref.concat(remainWithoutGlobStar);
10290     this._process(noGlobStar, index, false, cb);
10291     var isSym = this.symlinks[abs];
10292     var len = entries.length;
10293     if (isSym && inGlobStar)
10294       return cb();
10295     for (var i = 0; i < len; i++) {
10296       var e = entries[i];
10297       if (e.charAt(0) === "." && !this.dot)
10298         continue;
10299       var instead = gspref.concat(entries[i], remainWithoutGlobStar);
10300       this._process(instead, index, true, cb);
10301       var below = gspref.concat(entries[i], remain);
10302       this._process(below, index, true, cb);
10303     }
10304     cb();
10305   };
10306   Glob.prototype._processSimple = function(prefix, index, cb) {
10307     var self2 = this;
10308     this._stat(prefix, function(er, exists) {
10309       self2._processSimple2(prefix, index, er, exists, cb);
10310     });
10311   };
10312   Glob.prototype._processSimple2 = function(prefix, index, er, exists, cb) {
10313     if (!this.matches[index])
10314       this.matches[index] = Object.create(null);
10315     if (!exists)
10316       return cb();
10317     if (prefix && isAbsolute(prefix) && !this.nomount) {
10318       var trail = /[\/\\]$/.test(prefix);
10319       if (prefix.charAt(0) === "/") {
10320         prefix = path.join(this.root, prefix);
10321       } else {
10322         prefix = path.resolve(this.root, prefix);
10323         if (trail)
10324           prefix += "/";
10325       }
10326     }
10327     if (process.platform === "win32")
10328       prefix = prefix.replace(/\\/g, "/");
10329     this._emitMatch(index, prefix);
10330     cb();
10331   };
10332   Glob.prototype._stat = function(f, cb) {
10333     var abs = this._makeAbs(f);
10334     var needDir = f.slice(-1) === "/";
10335     if (f.length > this.maxLength)
10336       return cb();
10337     if (!this.stat && ownProp(this.cache, abs)) {
10338       var c = this.cache[abs];
10339       if (Array.isArray(c))
10340         c = "DIR";
10341       if (!needDir || c === "DIR")
10342         return cb(null, c);
10343       if (needDir && c === "FILE")
10344         return cb();
10345     }
10346     var exists;
10347     var stat = this.statCache[abs];
10348     if (stat !== void 0) {
10349       if (stat === false)
10350         return cb(null, stat);
10351       else {
10352         var type = stat.isDirectory() ? "DIR" : "FILE";
10353         if (needDir && type === "FILE")
10354           return cb();
10355         else
10356           return cb(null, type, stat);
10357       }
10358     }
10359     var self2 = this;
10360     var statcb = inflight("stat\0" + abs, lstatcb_);
10361     if (statcb)
10362       fs.lstat(abs, statcb);
10363     function lstatcb_(er, lstat) {
10364       if (lstat && lstat.isSymbolicLink()) {
10365         return fs.stat(abs, function(er2, stat2) {
10366           if (er2)
10367             self2._stat2(f, abs, null, lstat, cb);
10368           else
10369             self2._stat2(f, abs, er2, stat2, cb);
10370         });
10371       } else {
10372         self2._stat2(f, abs, er, lstat, cb);
10373       }
10374     }
10375   };
10376   Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
10377     if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
10378       this.statCache[abs] = false;
10379       return cb();
10380     }
10381     var needDir = f.slice(-1) === "/";
10382     this.statCache[abs] = stat;
10383     if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
10384       return cb(null, false, stat);
10385     var c = true;
10386     if (stat)
10387       c = stat.isDirectory() ? "DIR" : "FILE";
10388     this.cache[abs] = this.cache[abs] || c;
10389     if (needDir && c === "FILE")
10390       return cb();
10391     return cb(null, c, stat);
10392   };
10393 });
10394
10395 // node_modules/rimraf/rimraf.js
10396 var require_rimraf = __commonJS((exports2, module2) => {
10397   var assert = require("assert");
10398   var path = require("path");
10399   var fs = require("fs");
10400   var glob = void 0;
10401   try {
10402     glob = require_glob();
10403   } catch (_err) {
10404   }
10405   var defaultGlobOpts = {
10406     nosort: true,
10407     silent: true
10408   };
10409   var timeout = 0;
10410   var isWindows = process.platform === "win32";
10411   var defaults = (options) => {
10412     const methods = [
10413       "unlink",
10414       "chmod",
10415       "stat",
10416       "lstat",
10417       "rmdir",
10418       "readdir"
10419     ];
10420     methods.forEach((m) => {
10421       options[m] = options[m] || fs[m];
10422       m = m + "Sync";
10423       options[m] = options[m] || fs[m];
10424     });
10425     options.maxBusyTries = options.maxBusyTries || 3;
10426     options.emfileWait = options.emfileWait || 1e3;
10427     if (options.glob === false) {
10428       options.disableGlob = true;
10429     }
10430     if (options.disableGlob !== true && glob === void 0) {
10431       throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
10432     }
10433     options.disableGlob = options.disableGlob || false;
10434     options.glob = options.glob || defaultGlobOpts;
10435   };
10436   var rimraf = (p, options, cb) => {
10437     if (typeof options === "function") {
10438       cb = options;
10439       options = {};
10440     }
10441     assert(p, "rimraf: missing path");
10442     assert.equal(typeof p, "string", "rimraf: path should be a string");
10443     assert.equal(typeof cb, "function", "rimraf: callback function required");
10444     assert(options, "rimraf: invalid options argument provided");
10445     assert.equal(typeof options, "object", "rimraf: options should be object");
10446     defaults(options);
10447     let busyTries = 0;
10448     let errState = null;
10449     let n = 0;
10450     const next = (er) => {
10451       errState = errState || er;
10452       if (--n === 0)
10453         cb(errState);
10454     };
10455     const afterGlob = (er, results) => {
10456       if (er)
10457         return cb(er);
10458       n = results.length;
10459       if (n === 0)
10460         return cb();
10461       results.forEach((p2) => {
10462         const CB = (er2) => {
10463           if (er2) {
10464             if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
10465               busyTries++;
10466               return setTimeout(() => rimraf_(p2, options, CB), busyTries * 100);
10467             }
10468             if (er2.code === "EMFILE" && timeout < options.emfileWait) {
10469               return setTimeout(() => rimraf_(p2, options, CB), timeout++);
10470             }
10471             if (er2.code === "ENOENT")
10472               er2 = null;
10473           }
10474           timeout = 0;
10475           next(er2);
10476         };
10477         rimraf_(p2, options, CB);
10478       });
10479     };
10480     if (options.disableGlob || !glob.hasMagic(p))
10481       return afterGlob(null, [p]);
10482     options.lstat(p, (er, stat) => {
10483       if (!er)
10484         return afterGlob(null, [p]);
10485       glob(p, options.glob, afterGlob);
10486     });
10487   };
10488   var rimraf_ = (p, options, cb) => {
10489     assert(p);
10490     assert(options);
10491     assert(typeof cb === "function");
10492     options.lstat(p, (er, st) => {
10493       if (er && er.code === "ENOENT")
10494         return cb(null);
10495       if (er && er.code === "EPERM" && isWindows)
10496         fixWinEPERM(p, options, er, cb);
10497       if (st && st.isDirectory())
10498         return rmdir(p, options, er, cb);
10499       options.unlink(p, (er2) => {
10500         if (er2) {
10501           if (er2.code === "ENOENT")
10502             return cb(null);
10503           if (er2.code === "EPERM")
10504             return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
10505           if (er2.code === "EISDIR")
10506             return rmdir(p, options, er2, cb);
10507         }
10508         return cb(er2);
10509       });
10510     });
10511   };
10512   var fixWinEPERM = (p, options, er, cb) => {
10513     assert(p);
10514     assert(options);
10515     assert(typeof cb === "function");
10516     options.chmod(p, 438, (er2) => {
10517       if (er2)
10518         cb(er2.code === "ENOENT" ? null : er);
10519       else
10520         options.stat(p, (er3, stats) => {
10521           if (er3)
10522             cb(er3.code === "ENOENT" ? null : er);
10523           else if (stats.isDirectory())
10524             rmdir(p, options, er, cb);
10525           else
10526             options.unlink(p, cb);
10527         });
10528     });
10529   };
10530   var fixWinEPERMSync = (p, options, er) => {
10531     assert(p);
10532     assert(options);
10533     try {
10534       options.chmodSync(p, 438);
10535     } catch (er2) {
10536       if (er2.code === "ENOENT")
10537         return;
10538       else
10539         throw er;
10540     }
10541     let stats;
10542     try {
10543       stats = options.statSync(p);
10544     } catch (er3) {
10545       if (er3.code === "ENOENT")
10546         return;
10547       else
10548         throw er;
10549     }
10550     if (stats.isDirectory())
10551       rmdirSync(p, options, er);
10552     else
10553       options.unlinkSync(p);
10554   };
10555   var rmdir = (p, options, originalEr, cb) => {
10556     assert(p);
10557     assert(options);
10558     assert(typeof cb === "function");
10559     options.rmdir(p, (er) => {
10560       if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
10561         rmkids(p, options, cb);
10562       else if (er && er.code === "ENOTDIR")
10563         cb(originalEr);
10564       else
10565         cb(er);
10566     });
10567   };
10568   var rmkids = (p, options, cb) => {
10569     assert(p);
10570     assert(options);
10571     assert(typeof cb === "function");
10572     options.readdir(p, (er, files) => {
10573       if (er)
10574         return cb(er);
10575       let n = files.length;
10576       if (n === 0)
10577         return options.rmdir(p, cb);
10578       let errState;
10579       files.forEach((f) => {
10580         rimraf(path.join(p, f), options, (er2) => {
10581           if (errState)
10582             return;
10583           if (er2)
10584             return cb(errState = er2);
10585           if (--n === 0)
10586             options.rmdir(p, cb);
10587         });
10588       });
10589     });
10590   };
10591   var rimrafSync = (p, options) => {
10592     options = options || {};
10593     defaults(options);
10594     assert(p, "rimraf: missing path");
10595     assert.equal(typeof p, "string", "rimraf: path should be a string");
10596     assert(options, "rimraf: missing options");
10597     assert.equal(typeof options, "object", "rimraf: options should be object");
10598     let results;
10599     if (options.disableGlob || !glob.hasMagic(p)) {
10600       results = [p];
10601     } else {
10602       try {
10603         options.lstatSync(p);
10604         results = [p];
10605       } catch (er) {
10606         results = glob.sync(p, options.glob);
10607       }
10608     }
10609     if (!results.length)
10610       return;
10611     for (let i = 0; i < results.length; i++) {
10612       const p2 = results[i];
10613       let st;
10614       try {
10615         st = options.lstatSync(p2);
10616       } catch (er) {
10617         if (er.code === "ENOENT")
10618           return;
10619         if (er.code === "EPERM" && isWindows)
10620           fixWinEPERMSync(p2, options, er);
10621       }
10622       try {
10623         if (st && st.isDirectory())
10624           rmdirSync(p2, options, null);
10625         else
10626           options.unlinkSync(p2);
10627       } catch (er) {
10628         if (er.code === "ENOENT")
10629           return;
10630         if (er.code === "EPERM")
10631           return isWindows ? fixWinEPERMSync(p2, options, er) : rmdirSync(p2, options, er);
10632         if (er.code !== "EISDIR")
10633           throw er;
10634         rmdirSync(p2, options, er);
10635       }
10636     }
10637   };
10638   var rmdirSync = (p, options, originalEr) => {
10639     assert(p);
10640     assert(options);
10641     try {
10642       options.rmdirSync(p);
10643     } catch (er) {
10644       if (er.code === "ENOENT")
10645         return;
10646       if (er.code === "ENOTDIR")
10647         throw originalEr;
10648       if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
10649         rmkidsSync(p, options);
10650     }
10651   };
10652   var rmkidsSync = (p, options) => {
10653     assert(p);
10654     assert(options);
10655     options.readdirSync(p).forEach((f) => rimrafSync(path.join(p, f), options));
10656     const retries = isWindows ? 100 : 1;
10657     let i = 0;
10658     do {
10659       let threw = true;
10660       try {
10661         const ret2 = options.rmdirSync(p, options);
10662         threw = false;
10663         return ret2;
10664       } finally {
10665         if (++i < retries && threw)
10666           continue;
10667       }
10668     } while (true);
10669   };
10670   module2.exports = rimraf;
10671   rimraf.sync = rimrafSync;
10672 });
10673
10674 // node_modules/semver/internal/constants.js
10675 var require_constants2 = __commonJS((exports2, module2) => {
10676   var SEMVER_SPEC_VERSION = "2.0.0";
10677   var MAX_LENGTH = 256;
10678   var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
10679   var MAX_SAFE_COMPONENT_LENGTH = 16;
10680   module2.exports = {
10681     SEMVER_SPEC_VERSION,
10682     MAX_LENGTH,
10683     MAX_SAFE_INTEGER,
10684     MAX_SAFE_COMPONENT_LENGTH
10685   };
10686 });
10687
10688 // node_modules/semver/internal/debug.js
10689 var require_debug = __commonJS((exports2, module2) => {
10690   var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
10691   };
10692   module2.exports = debug;
10693 });
10694
10695 // node_modules/semver/internal/re.js
10696 var require_re = __commonJS((exports2, module2) => {
10697   var {MAX_SAFE_COMPONENT_LENGTH} = require_constants2();
10698   var debug = require_debug();
10699   exports2 = module2.exports = {};
10700   var re = exports2.re = [];
10701   var src = exports2.src = [];
10702   var t = exports2.t = {};
10703   var R = 0;
10704   var createToken = (name, value, isGlobal) => {
10705     const index = R++;
10706     debug(index, value);
10707     t[name] = index;
10708     src[index] = value;
10709     re[index] = new RegExp(value, isGlobal ? "g" : void 0);
10710   };
10711   createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
10712   createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+");
10713   createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
10714   createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
10715   createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
10716   createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
10717   createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
10718   createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
10719   createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
10720   createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
10721   createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
10722   createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
10723   createToken("FULL", `^${src[t.FULLPLAIN]}$`);
10724   createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
10725   createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
10726   createToken("GTLT", "((?:<|>)?=?)");
10727   createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
10728   createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
10729   createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
10730   createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
10731   createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
10732   createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
10733   createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
10734   createToken("COERCERTL", src[t.COERCE], true);
10735   createToken("LONETILDE", "(?:~>?)");
10736   createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
10737   exports2.tildeTrimReplace = "$1~";
10738   createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
10739   createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
10740   createToken("LONECARET", "(?:\\^)");
10741   createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
10742   exports2.caretTrimReplace = "$1^";
10743   createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
10744   createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
10745   createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
10746   createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
10747   createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
10748   exports2.comparatorTrimReplace = "$1$2$3";
10749   createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
10750   createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
10751   createToken("STAR", "(<|>)?=?\\s*\\*");
10752   createToken("GTE0", "^\\s*>=\\s*0.0.0\\s*$");
10753   createToken("GTE0PRE", "^\\s*>=\\s*0.0.0-0\\s*$");
10754 });
10755
10756 // node_modules/semver/internal/parse-options.js
10757 var require_parse_options = __commonJS((exports2, module2) => {
10758   var opts = ["includePrerelease", "loose", "rtl"];
10759   var parseOptions = (options) => !options ? {} : typeof options !== "object" ? {loose: true} : opts.filter((k) => options[k]).reduce((options2, k) => {
10760     options2[k] = true;
10761     return options2;
10762   }, {});
10763   module2.exports = parseOptions;
10764 });
10765
10766 // node_modules/semver/internal/identifiers.js
10767 var require_identifiers = __commonJS((exports2, module2) => {
10768   var numeric = /^[0-9]+$/;
10769   var compareIdentifiers = (a, b) => {
10770     const anum = numeric.test(a);
10771     const bnum = numeric.test(b);
10772     if (anum && bnum) {
10773       a = +a;
10774       b = +b;
10775     }
10776     return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
10777   };
10778   var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
10779   module2.exports = {
10780     compareIdentifiers,
10781     rcompareIdentifiers
10782   };
10783 });
10784
10785 // node_modules/semver/classes/semver.js
10786 var require_semver = __commonJS((exports2, module2) => {
10787   var debug = require_debug();
10788   var {MAX_LENGTH, MAX_SAFE_INTEGER} = require_constants2();
10789   var {re, t} = require_re();
10790   var parseOptions = require_parse_options();
10791   var {compareIdentifiers} = require_identifiers();
10792   var SemVer = class {
10793     constructor(version, options) {
10794       options = parseOptions(options);
10795       if (version instanceof SemVer) {
10796         if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
10797           return version;
10798         } else {
10799           version = version.version;
10800         }
10801       } else if (typeof version !== "string") {
10802         throw new TypeError(`Invalid Version: ${version}`);
10803       }
10804       if (version.length > MAX_LENGTH) {
10805         throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
10806       }
10807       debug("SemVer", version, options);
10808       this.options = options;
10809       this.loose = !!options.loose;
10810       this.includePrerelease = !!options.includePrerelease;
10811       const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
10812       if (!m) {
10813         throw new TypeError(`Invalid Version: ${version}`);
10814       }
10815       this.raw = version;
10816       this.major = +m[1];
10817       this.minor = +m[2];
10818       this.patch = +m[3];
10819       if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
10820         throw new TypeError("Invalid major version");
10821       }
10822       if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
10823         throw new TypeError("Invalid minor version");
10824       }
10825       if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
10826         throw new TypeError("Invalid patch version");
10827       }
10828       if (!m[4]) {
10829         this.prerelease = [];
10830       } else {
10831         this.prerelease = m[4].split(".").map((id) => {
10832           if (/^[0-9]+$/.test(id)) {
10833             const num = +id;
10834             if (num >= 0 && num < MAX_SAFE_INTEGER) {
10835               return num;
10836             }
10837           }
10838           return id;
10839         });
10840       }
10841       this.build = m[5] ? m[5].split(".") : [];
10842       this.format();
10843     }
10844     format() {
10845       this.version = `${this.major}.${this.minor}.${this.patch}`;
10846       if (this.prerelease.length) {
10847         this.version += `-${this.prerelease.join(".")}`;
10848       }
10849       return this.version;
10850     }
10851     toString() {
10852       return this.version;
10853     }
10854     compare(other) {
10855       debug("SemVer.compare", this.version, this.options, other);
10856       if (!(other instanceof SemVer)) {
10857         if (typeof other === "string" && other === this.version) {
10858           return 0;
10859         }
10860         other = new SemVer(other, this.options);
10861       }
10862       if (other.version === this.version) {
10863         return 0;
10864       }
10865       return this.compareMain(other) || this.comparePre(other);
10866     }
10867     compareMain(other) {
10868       if (!(other instanceof SemVer)) {
10869         other = new SemVer(other, this.options);
10870       }
10871       return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
10872     }
10873     comparePre(other) {
10874       if (!(other instanceof SemVer)) {
10875         other = new SemVer(other, this.options);
10876       }
10877       if (this.prerelease.length && !other.prerelease.length) {
10878         return -1;
10879       } else if (!this.prerelease.length && other.prerelease.length) {
10880         return 1;
10881       } else if (!this.prerelease.length && !other.prerelease.length) {
10882         return 0;
10883       }
10884       let i = 0;
10885       do {
10886         const a = this.prerelease[i];
10887         const b = other.prerelease[i];
10888         debug("prerelease compare", i, a, b);
10889         if (a === void 0 && b === void 0) {
10890           return 0;
10891         } else if (b === void 0) {
10892           return 1;
10893         } else if (a === void 0) {
10894           return -1;
10895         } else if (a === b) {
10896           continue;
10897         } else {
10898           return compareIdentifiers(a, b);
10899         }
10900       } while (++i);
10901     }
10902     compareBuild(other) {
10903       if (!(other instanceof SemVer)) {
10904         other = new SemVer(other, this.options);
10905       }
10906       let i = 0;
10907       do {
10908         const a = this.build[i];
10909         const b = other.build[i];
10910         debug("prerelease compare", i, a, b);
10911         if (a === void 0 && b === void 0) {
10912           return 0;
10913         } else if (b === void 0) {
10914           return 1;
10915         } else if (a === void 0) {
10916           return -1;
10917         } else if (a === b) {
10918           continue;
10919         } else {
10920           return compareIdentifiers(a, b);
10921         }
10922       } while (++i);
10923     }
10924     inc(release, identifier) {
10925       switch (release) {
10926         case "premajor":
10927           this.prerelease.length = 0;
10928           this.patch = 0;
10929           this.minor = 0;
10930           this.major++;
10931           this.inc("pre", identifier);
10932           break;
10933         case "preminor":
10934           this.prerelease.length = 0;
10935           this.patch = 0;
10936           this.minor++;
10937           this.inc("pre", identifier);
10938           break;
10939         case "prepatch":
10940           this.prerelease.length = 0;
10941           this.inc("patch", identifier);
10942           this.inc("pre", identifier);
10943           break;
10944         case "prerelease":
10945           if (this.prerelease.length === 0) {
10946             this.inc("patch", identifier);
10947           }
10948           this.inc("pre", identifier);
10949           break;
10950         case "major":
10951           if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
10952             this.major++;
10953           }
10954           this.minor = 0;
10955           this.patch = 0;
10956           this.prerelease = [];
10957           break;
10958         case "minor":
10959           if (this.patch !== 0 || this.prerelease.length === 0) {
10960             this.minor++;
10961           }
10962           this.patch = 0;
10963           this.prerelease = [];
10964           break;
10965         case "patch":
10966           if (this.prerelease.length === 0) {
10967             this.patch++;
10968           }
10969           this.prerelease = [];
10970           break;
10971         case "pre":
10972           if (this.prerelease.length === 0) {
10973             this.prerelease = [0];
10974           } else {
10975             let i = this.prerelease.length;
10976             while (--i >= 0) {
10977               if (typeof this.prerelease[i] === "number") {
10978                 this.prerelease[i]++;
10979                 i = -2;
10980               }
10981             }
10982             if (i === -1) {
10983               this.prerelease.push(0);
10984             }
10985           }
10986           if (identifier) {
10987             if (this.prerelease[0] === identifier) {
10988               if (isNaN(this.prerelease[1])) {
10989                 this.prerelease = [identifier, 0];
10990               }
10991             } else {
10992               this.prerelease = [identifier, 0];
10993             }
10994           }
10995           break;
10996         default:
10997           throw new Error(`invalid increment argument: ${release}`);
10998       }
10999       this.format();
11000       this.raw = this.version;
11001       return this;
11002     }
11003   };
11004   module2.exports = SemVer;
11005 });
11006
11007 // node_modules/semver/functions/parse.js
11008 var require_parse2 = __commonJS((exports2, module2) => {
11009   var {MAX_LENGTH} = require_constants2();
11010   var {re, t} = require_re();
11011   var SemVer = require_semver();
11012   var parseOptions = require_parse_options();
11013   var parse = (version, options) => {
11014     options = parseOptions(options);
11015     if (version instanceof SemVer) {
11016       return version;
11017     }
11018     if (typeof version !== "string") {
11019       return null;
11020     }
11021     if (version.length > MAX_LENGTH) {
11022       return null;
11023     }
11024     const r = options.loose ? re[t.LOOSE] : re[t.FULL];
11025     if (!r.test(version)) {
11026       return null;
11027     }
11028     try {
11029       return new SemVer(version, options);
11030     } catch (er) {
11031       return null;
11032     }
11033   };
11034   module2.exports = parse;
11035 });
11036
11037 // node_modules/semver/functions/valid.js
11038 var require_valid = __commonJS((exports2, module2) => {
11039   var parse = require_parse2();
11040   var valid = (version, options) => {
11041     const v = parse(version, options);
11042     return v ? v.version : null;
11043   };
11044   module2.exports = valid;
11045 });
11046
11047 // node_modules/semver/functions/clean.js
11048 var require_clean = __commonJS((exports2, module2) => {
11049   var parse = require_parse2();
11050   var clean = (version, options) => {
11051     const s = parse(version.trim().replace(/^[=v]+/, ""), options);
11052     return s ? s.version : null;
11053   };
11054   module2.exports = clean;
11055 });
11056
11057 // node_modules/semver/functions/inc.js
11058 var require_inc = __commonJS((exports2, module2) => {
11059   var SemVer = require_semver();
11060   var inc = (version, release, options, identifier) => {
11061     if (typeof options === "string") {
11062       identifier = options;
11063       options = void 0;
11064     }
11065     try {
11066       return new SemVer(version, options).inc(release, identifier).version;
11067     } catch (er) {
11068       return null;
11069     }
11070   };
11071   module2.exports = inc;
11072 });
11073
11074 // node_modules/semver/functions/compare.js
11075 var require_compare = __commonJS((exports2, module2) => {
11076   var SemVer = require_semver();
11077   var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
11078   module2.exports = compare;
11079 });
11080
11081 // node_modules/semver/functions/eq.js
11082 var require_eq = __commonJS((exports2, module2) => {
11083   var compare = require_compare();
11084   var eq = (a, b, loose) => compare(a, b, loose) === 0;
11085   module2.exports = eq;
11086 });
11087
11088 // node_modules/semver/functions/diff.js
11089 var require_diff = __commonJS((exports2, module2) => {
11090   var parse = require_parse2();
11091   var eq = require_eq();
11092   var diff = (version1, version2) => {
11093     if (eq(version1, version2)) {
11094       return null;
11095     } else {
11096       const v1 = parse(version1);
11097       const v2 = parse(version2);
11098       const hasPre = v1.prerelease.length || v2.prerelease.length;
11099       const prefix = hasPre ? "pre" : "";
11100       const defaultResult = hasPre ? "prerelease" : "";
11101       for (const key in v1) {
11102         if (key === "major" || key === "minor" || key === "patch") {
11103           if (v1[key] !== v2[key]) {
11104             return prefix + key;
11105           }
11106         }
11107       }
11108       return defaultResult;
11109     }
11110   };
11111   module2.exports = diff;
11112 });
11113
11114 // node_modules/semver/functions/major.js
11115 var require_major = __commonJS((exports2, module2) => {
11116   var SemVer = require_semver();
11117   var major = (a, loose) => new SemVer(a, loose).major;
11118   module2.exports = major;
11119 });
11120
11121 // node_modules/semver/functions/minor.js
11122 var require_minor = __commonJS((exports2, module2) => {
11123   var SemVer = require_semver();
11124   var minor = (a, loose) => new SemVer(a, loose).minor;
11125   module2.exports = minor;
11126 });
11127
11128 // node_modules/semver/functions/patch.js
11129 var require_patch = __commonJS((exports2, module2) => {
11130   var SemVer = require_semver();
11131   var patch = (a, loose) => new SemVer(a, loose).patch;
11132   module2.exports = patch;
11133 });
11134
11135 // node_modules/semver/functions/prerelease.js
11136 var require_prerelease = __commonJS((exports2, module2) => {
11137   var parse = require_parse2();
11138   var prerelease = (version, options) => {
11139     const parsed = parse(version, options);
11140     return parsed && parsed.prerelease.length ? parsed.prerelease : null;
11141   };
11142   module2.exports = prerelease;
11143 });
11144
11145 // node_modules/semver/functions/rcompare.js
11146 var require_rcompare = __commonJS((exports2, module2) => {
11147   var compare = require_compare();
11148   var rcompare = (a, b, loose) => compare(b, a, loose);
11149   module2.exports = rcompare;
11150 });
11151
11152 // node_modules/semver/functions/compare-loose.js
11153 var require_compare_loose = __commonJS((exports2, module2) => {
11154   var compare = require_compare();
11155   var compareLoose = (a, b) => compare(a, b, true);
11156   module2.exports = compareLoose;
11157 });
11158
11159 // node_modules/semver/functions/compare-build.js
11160 var require_compare_build = __commonJS((exports2, module2) => {
11161   var SemVer = require_semver();
11162   var compareBuild = (a, b, loose) => {
11163     const versionA = new SemVer(a, loose);
11164     const versionB = new SemVer(b, loose);
11165     return versionA.compare(versionB) || versionA.compareBuild(versionB);
11166   };
11167   module2.exports = compareBuild;
11168 });
11169
11170 // node_modules/semver/functions/sort.js
11171 var require_sort = __commonJS((exports2, module2) => {
11172   var compareBuild = require_compare_build();
11173   var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
11174   module2.exports = sort;
11175 });
11176
11177 // node_modules/semver/functions/rsort.js
11178 var require_rsort = __commonJS((exports2, module2) => {
11179   var compareBuild = require_compare_build();
11180   var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
11181   module2.exports = rsort;
11182 });
11183
11184 // node_modules/semver/functions/gt.js
11185 var require_gt = __commonJS((exports2, module2) => {
11186   var compare = require_compare();
11187   var gt = (a, b, loose) => compare(a, b, loose) > 0;
11188   module2.exports = gt;
11189 });
11190
11191 // node_modules/semver/functions/lt.js
11192 var require_lt = __commonJS((exports2, module2) => {
11193   var compare = require_compare();
11194   var lt = (a, b, loose) => compare(a, b, loose) < 0;
11195   module2.exports = lt;
11196 });
11197
11198 // node_modules/semver/functions/neq.js
11199 var require_neq = __commonJS((exports2, module2) => {
11200   var compare = require_compare();
11201   var neq = (a, b, loose) => compare(a, b, loose) !== 0;
11202   module2.exports = neq;
11203 });
11204
11205 // node_modules/semver/functions/gte.js
11206 var require_gte = __commonJS((exports2, module2) => {
11207   var compare = require_compare();
11208   var gte = (a, b, loose) => compare(a, b, loose) >= 0;
11209   module2.exports = gte;
11210 });
11211
11212 // node_modules/semver/functions/lte.js
11213 var require_lte = __commonJS((exports2, module2) => {
11214   var compare = require_compare();
11215   var lte = (a, b, loose) => compare(a, b, loose) <= 0;
11216   module2.exports = lte;
11217 });
11218
11219 // node_modules/semver/functions/cmp.js
11220 var require_cmp = __commonJS((exports2, module2) => {
11221   var eq = require_eq();
11222   var neq = require_neq();
11223   var gt = require_gt();
11224   var gte = require_gte();
11225   var lt = require_lt();
11226   var lte = require_lte();
11227   var cmp = (a, op, b, loose) => {
11228     switch (op) {
11229       case "===":
11230         if (typeof a === "object")
11231           a = a.version;
11232         if (typeof b === "object")
11233           b = b.version;
11234         return a === b;
11235       case "!==":
11236         if (typeof a === "object")
11237           a = a.version;
11238         if (typeof b === "object")
11239           b = b.version;
11240         return a !== b;
11241       case "":
11242       case "=":
11243       case "==":
11244         return eq(a, b, loose);
11245       case "!=":
11246         return neq(a, b, loose);
11247       case ">":
11248         return gt(a, b, loose);
11249       case ">=":
11250         return gte(a, b, loose);
11251       case "<":
11252         return lt(a, b, loose);
11253       case "<=":
11254         return lte(a, b, loose);
11255       default:
11256         throw new TypeError(`Invalid operator: ${op}`);
11257     }
11258   };
11259   module2.exports = cmp;
11260 });
11261
11262 // node_modules/semver/functions/coerce.js
11263 var require_coerce = __commonJS((exports2, module2) => {
11264   var SemVer = require_semver();
11265   var parse = require_parse2();
11266   var {re, t} = require_re();
11267   var coerce = (version, options) => {
11268     if (version instanceof SemVer) {
11269       return version;
11270     }
11271     if (typeof version === "number") {
11272       version = String(version);
11273     }
11274     if (typeof version !== "string") {
11275       return null;
11276     }
11277     options = options || {};
11278     let match = null;
11279     if (!options.rtl) {
11280       match = version.match(re[t.COERCE]);
11281     } else {
11282       let next;
11283       while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
11284         if (!match || next.index + next[0].length !== match.index + match[0].length) {
11285           match = next;
11286         }
11287         re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
11288       }
11289       re[t.COERCERTL].lastIndex = -1;
11290     }
11291     if (match === null)
11292       return null;
11293     return parse(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
11294   };
11295   module2.exports = coerce;
11296 });
11297
11298 // node_modules/yallist/iterator.js
11299 var require_iterator = __commonJS((exports2, module2) => {
11300   "use strict";
11301   module2.exports = function(Yallist) {
11302     Yallist.prototype[Symbol.iterator] = function* () {
11303       for (let walker = this.head; walker; walker = walker.next) {
11304         yield walker.value;
11305       }
11306     };
11307   };
11308 });
11309
11310 // node_modules/yallist/yallist.js
11311 var require_yallist = __commonJS((exports2, module2) => {
11312   "use strict";
11313   module2.exports = Yallist;
11314   Yallist.Node = Node;
11315   Yallist.create = Yallist;
11316   function Yallist(list) {
11317     var self2 = this;
11318     if (!(self2 instanceof Yallist)) {
11319       self2 = new Yallist();
11320     }
11321     self2.tail = null;
11322     self2.head = null;
11323     self2.length = 0;
11324     if (list && typeof list.forEach === "function") {
11325       list.forEach(function(item) {
11326         self2.push(item);
11327       });
11328     } else if (arguments.length > 0) {
11329       for (var i = 0, l = arguments.length; i < l; i++) {
11330         self2.push(arguments[i]);
11331       }
11332     }
11333     return self2;
11334   }
11335   Yallist.prototype.removeNode = function(node) {
11336     if (node.list !== this) {
11337       throw new Error("removing node which does not belong to this list");
11338     }
11339     var next = node.next;
11340     var prev = node.prev;
11341     if (next) {
11342       next.prev = prev;
11343     }
11344     if (prev) {
11345       prev.next = next;
11346     }
11347     if (node === this.head) {
11348       this.head = next;
11349     }
11350     if (node === this.tail) {
11351       this.tail = prev;
11352     }
11353     node.list.length--;
11354     node.next = null;
11355     node.prev = null;
11356     node.list = null;
11357     return next;
11358   };
11359   Yallist.prototype.unshiftNode = function(node) {
11360     if (node === this.head) {
11361       return;
11362     }
11363     if (node.list) {
11364       node.list.removeNode(node);
11365     }
11366     var head = this.head;
11367     node.list = this;
11368     node.next = head;
11369     if (head) {
11370       head.prev = node;
11371     }
11372     this.head = node;
11373     if (!this.tail) {
11374       this.tail = node;
11375     }
11376     this.length++;
11377   };
11378   Yallist.prototype.pushNode = function(node) {
11379     if (node === this.tail) {
11380       return;
11381     }
11382     if (node.list) {
11383       node.list.removeNode(node);
11384     }
11385     var tail = this.tail;
11386     node.list = this;
11387     node.prev = tail;
11388     if (tail) {
11389       tail.next = node;
11390     }
11391     this.tail = node;
11392     if (!this.head) {
11393       this.head = node;
11394     }
11395     this.length++;
11396   };
11397   Yallist.prototype.push = function() {
11398     for (var i = 0, l = arguments.length; i < l; i++) {
11399       push(this, arguments[i]);
11400     }
11401     return this.length;
11402   };
11403   Yallist.prototype.unshift = function() {
11404     for (var i = 0, l = arguments.length; i < l; i++) {
11405       unshift(this, arguments[i]);
11406     }
11407     return this.length;
11408   };
11409   Yallist.prototype.pop = function() {
11410     if (!this.tail) {
11411       return void 0;
11412     }
11413     var res = this.tail.value;
11414     this.tail = this.tail.prev;
11415     if (this.tail) {
11416       this.tail.next = null;
11417     } else {
11418       this.head = null;
11419     }
11420     this.length--;
11421     return res;
11422   };
11423   Yallist.prototype.shift = function() {
11424     if (!this.head) {
11425       return void 0;
11426     }
11427     var res = this.head.value;
11428     this.head = this.head.next;
11429     if (this.head) {
11430       this.head.prev = null;
11431     } else {
11432       this.tail = null;
11433     }
11434     this.length--;
11435     return res;
11436   };
11437   Yallist.prototype.forEach = function(fn, thisp) {
11438     thisp = thisp || this;
11439     for (var walker = this.head, i = 0; walker !== null; i++) {
11440       fn.call(thisp, walker.value, i, this);
11441       walker = walker.next;
11442     }
11443   };
11444   Yallist.prototype.forEachReverse = function(fn, thisp) {
11445     thisp = thisp || this;
11446     for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
11447       fn.call(thisp, walker.value, i, this);
11448       walker = walker.prev;
11449     }
11450   };
11451   Yallist.prototype.get = function(n) {
11452     for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
11453       walker = walker.next;
11454     }
11455     if (i === n && walker !== null) {
11456       return walker.value;
11457     }
11458   };
11459   Yallist.prototype.getReverse = function(n) {
11460     for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
11461       walker = walker.prev;
11462     }
11463     if (i === n && walker !== null) {
11464       return walker.value;
11465     }
11466   };
11467   Yallist.prototype.map = function(fn, thisp) {
11468     thisp = thisp || this;
11469     var res = new Yallist();
11470     for (var walker = this.head; walker !== null; ) {
11471       res.push(fn.call(thisp, walker.value, this));
11472       walker = walker.next;
11473     }
11474     return res;
11475   };
11476   Yallist.prototype.mapReverse = function(fn, thisp) {
11477     thisp = thisp || this;
11478     var res = new Yallist();
11479     for (var walker = this.tail; walker !== null; ) {
11480       res.push(fn.call(thisp, walker.value, this));
11481       walker = walker.prev;
11482     }
11483     return res;
11484   };
11485   Yallist.prototype.reduce = function(fn, initial) {
11486     var acc;
11487     var walker = this.head;
11488     if (arguments.length > 1) {
11489       acc = initial;
11490     } else if (this.head) {
11491       walker = this.head.next;
11492       acc = this.head.value;
11493     } else {
11494       throw new TypeError("Reduce of empty list with no initial value");
11495     }
11496     for (var i = 0; walker !== null; i++) {
11497       acc = fn(acc, walker.value, i);
11498       walker = walker.next;
11499     }
11500     return acc;
11501   };
11502   Yallist.prototype.reduceReverse = function(fn, initial) {
11503     var acc;
11504     var walker = this.tail;
11505     if (arguments.length > 1) {
11506       acc = initial;
11507     } else if (this.tail) {
11508       walker = this.tail.prev;
11509       acc = this.tail.value;
11510     } else {
11511       throw new TypeError("Reduce of empty list with no initial value");
11512     }
11513     for (var i = this.length - 1; walker !== null; i--) {
11514       acc = fn(acc, walker.value, i);
11515       walker = walker.prev;
11516     }
11517     return acc;
11518   };
11519   Yallist.prototype.toArray = function() {
11520     var arr = new Array(this.length);
11521     for (var i = 0, walker = this.head; walker !== null; i++) {
11522       arr[i] = walker.value;
11523       walker = walker.next;
11524     }
11525     return arr;
11526   };
11527   Yallist.prototype.toArrayReverse = function() {
11528     var arr = new Array(this.length);
11529     for (var i = 0, walker = this.tail; walker !== null; i++) {
11530       arr[i] = walker.value;
11531       walker = walker.prev;
11532     }
11533     return arr;
11534   };
11535   Yallist.prototype.slice = function(from, to) {
11536     to = to || this.length;
11537     if (to < 0) {
11538       to += this.length;
11539     }
11540     from = from || 0;
11541     if (from < 0) {
11542       from += this.length;
11543     }
11544     var ret2 = new Yallist();
11545     if (to < from || to < 0) {
11546       return ret2;
11547     }
11548     if (from < 0) {
11549       from = 0;
11550     }
11551     if (to > this.length) {
11552       to = this.length;
11553     }
11554     for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
11555       walker = walker.next;
11556     }
11557     for (; walker !== null && i < to; i++, walker = walker.next) {
11558       ret2.push(walker.value);
11559     }
11560     return ret2;
11561   };
11562   Yallist.prototype.sliceReverse = function(from, to) {
11563     to = to || this.length;
11564     if (to < 0) {
11565       to += this.length;
11566     }
11567     from = from || 0;
11568     if (from < 0) {
11569       from += this.length;
11570     }
11571     var ret2 = new Yallist();
11572     if (to < from || to < 0) {
11573       return ret2;
11574     }
11575     if (from < 0) {
11576       from = 0;
11577     }
11578     if (to > this.length) {
11579       to = this.length;
11580     }
11581     for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
11582       walker = walker.prev;
11583     }
11584     for (; walker !== null && i > from; i--, walker = walker.prev) {
11585       ret2.push(walker.value);
11586     }
11587     return ret2;
11588   };
11589   Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
11590     if (start > this.length) {
11591       start = this.length - 1;
11592     }
11593     if (start < 0) {
11594       start = this.length + start;
11595     }
11596     for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
11597       walker = walker.next;
11598     }
11599     var ret2 = [];
11600     for (var i = 0; walker && i < deleteCount; i++) {
11601       ret2.push(walker.value);
11602       walker = this.removeNode(walker);
11603     }
11604     if (walker === null) {
11605       walker = this.tail;
11606     }
11607     if (walker !== this.head && walker !== this.tail) {
11608       walker = walker.prev;
11609     }
11610     for (var i = 0; i < nodes.length; i++) {
11611       walker = insert(this, walker, nodes[i]);
11612     }
11613     return ret2;
11614   };
11615   Yallist.prototype.reverse = function() {
11616     var head = this.head;
11617     var tail = this.tail;
11618     for (var walker = head; walker !== null; walker = walker.prev) {
11619       var p = walker.prev;
11620       walker.prev = walker.next;
11621       walker.next = p;
11622     }
11623     this.head = tail;
11624     this.tail = head;
11625     return this;
11626   };
11627   function insert(self2, node, value) {
11628     var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2);
11629     if (inserted.next === null) {
11630       self2.tail = inserted;
11631     }
11632     if (inserted.prev === null) {
11633       self2.head = inserted;
11634     }
11635     self2.length++;
11636     return inserted;
11637   }
11638   function push(self2, item) {
11639     self2.tail = new Node(item, self2.tail, null, self2);
11640     if (!self2.head) {
11641       self2.head = self2.tail;
11642     }
11643     self2.length++;
11644   }
11645   function unshift(self2, item) {
11646     self2.head = new Node(item, null, self2.head, self2);
11647     if (!self2.tail) {
11648       self2.tail = self2.head;
11649     }
11650     self2.length++;
11651   }
11652   function Node(value, prev, next, list) {
11653     if (!(this instanceof Node)) {
11654       return new Node(value, prev, next, list);
11655     }
11656     this.list = list;
11657     this.value = value;
11658     if (prev) {
11659       prev.next = this;
11660       this.prev = prev;
11661     } else {
11662       this.prev = null;
11663     }
11664     if (next) {
11665       next.prev = this;
11666       this.next = next;
11667     } else {
11668       this.next = null;
11669     }
11670   }
11671   try {
11672     require_iterator()(Yallist);
11673   } catch (er) {
11674   }
11675 });
11676
11677 // node_modules/lru-cache/index.js
11678 var require_lru_cache = __commonJS((exports2, module2) => {
11679   "use strict";
11680   var Yallist = require_yallist();
11681   var MAX = Symbol("max");
11682   var LENGTH = Symbol("length");
11683   var LENGTH_CALCULATOR = Symbol("lengthCalculator");
11684   var ALLOW_STALE = Symbol("allowStale");
11685   var MAX_AGE = Symbol("maxAge");
11686   var DISPOSE = Symbol("dispose");
11687   var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
11688   var LRU_LIST = Symbol("lruList");
11689   var CACHE = Symbol("cache");
11690   var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
11691   var naiveLength = () => 1;
11692   var LRUCache = class {
11693     constructor(options) {
11694       if (typeof options === "number")
11695         options = {max: options};
11696       if (!options)
11697         options = {};
11698       if (options.max && (typeof options.max !== "number" || options.max < 0))
11699         throw new TypeError("max must be a non-negative number");
11700       const max = this[MAX] = options.max || Infinity;
11701       const lc = options.length || naiveLength;
11702       this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
11703       this[ALLOW_STALE] = options.stale || false;
11704       if (options.maxAge && typeof options.maxAge !== "number")
11705         throw new TypeError("maxAge must be a number");
11706       this[MAX_AGE] = options.maxAge || 0;
11707       this[DISPOSE] = options.dispose;
11708       this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
11709       this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
11710       this.reset();
11711     }
11712     set max(mL) {
11713       if (typeof mL !== "number" || mL < 0)
11714         throw new TypeError("max must be a non-negative number");
11715       this[MAX] = mL || Infinity;
11716       trim(this);
11717     }
11718     get max() {
11719       return this[MAX];
11720     }
11721     set allowStale(allowStale) {
11722       this[ALLOW_STALE] = !!allowStale;
11723     }
11724     get allowStale() {
11725       return this[ALLOW_STALE];
11726     }
11727     set maxAge(mA) {
11728       if (typeof mA !== "number")
11729         throw new TypeError("maxAge must be a non-negative number");
11730       this[MAX_AGE] = mA;
11731       trim(this);
11732     }
11733     get maxAge() {
11734       return this[MAX_AGE];
11735     }
11736     set lengthCalculator(lC) {
11737       if (typeof lC !== "function")
11738         lC = naiveLength;
11739       if (lC !== this[LENGTH_CALCULATOR]) {
11740         this[LENGTH_CALCULATOR] = lC;
11741         this[LENGTH] = 0;
11742         this[LRU_LIST].forEach((hit) => {
11743           hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
11744           this[LENGTH] += hit.length;
11745         });
11746       }
11747       trim(this);
11748     }
11749     get lengthCalculator() {
11750       return this[LENGTH_CALCULATOR];
11751     }
11752     get length() {
11753       return this[LENGTH];
11754     }
11755     get itemCount() {
11756       return this[LRU_LIST].length;
11757     }
11758     rforEach(fn, thisp) {
11759       thisp = thisp || this;
11760       for (let walker = this[LRU_LIST].tail; walker !== null; ) {
11761         const prev = walker.prev;
11762         forEachStep(this, fn, walker, thisp);
11763         walker = prev;
11764       }
11765     }
11766     forEach(fn, thisp) {
11767       thisp = thisp || this;
11768       for (let walker = this[LRU_LIST].head; walker !== null; ) {
11769         const next = walker.next;
11770         forEachStep(this, fn, walker, thisp);
11771         walker = next;
11772       }
11773     }
11774     keys() {
11775       return this[LRU_LIST].toArray().map((k) => k.key);
11776     }
11777     values() {
11778       return this[LRU_LIST].toArray().map((k) => k.value);
11779     }
11780     reset() {
11781       if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
11782         this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
11783       }
11784       this[CACHE] = new Map();
11785       this[LRU_LIST] = new Yallist();
11786       this[LENGTH] = 0;
11787     }
11788     dump() {
11789       return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
11790         k: hit.key,
11791         v: hit.value,
11792         e: hit.now + (hit.maxAge || 0)
11793       }).toArray().filter((h) => h);
11794     }
11795     dumpLru() {
11796       return this[LRU_LIST];
11797     }
11798     set(key, value, maxAge) {
11799       maxAge = maxAge || this[MAX_AGE];
11800       if (maxAge && typeof maxAge !== "number")
11801         throw new TypeError("maxAge must be a number");
11802       const now = maxAge ? Date.now() : 0;
11803       const len = this[LENGTH_CALCULATOR](value, key);
11804       if (this[CACHE].has(key)) {
11805         if (len > this[MAX]) {
11806           del(this, this[CACHE].get(key));
11807           return false;
11808         }
11809         const node = this[CACHE].get(key);
11810         const item = node.value;
11811         if (this[DISPOSE]) {
11812           if (!this[NO_DISPOSE_ON_SET])
11813             this[DISPOSE](key, item.value);
11814         }
11815         item.now = now;
11816         item.maxAge = maxAge;
11817         item.value = value;
11818         this[LENGTH] += len - item.length;
11819         item.length = len;
11820         this.get(key);
11821         trim(this);
11822         return true;
11823       }
11824       const hit = new Entry(key, value, len, now, maxAge);
11825       if (hit.length > this[MAX]) {
11826         if (this[DISPOSE])
11827           this[DISPOSE](key, value);
11828         return false;
11829       }
11830       this[LENGTH] += hit.length;
11831       this[LRU_LIST].unshift(hit);
11832       this[CACHE].set(key, this[LRU_LIST].head);
11833       trim(this);
11834       return true;
11835     }
11836     has(key) {
11837       if (!this[CACHE].has(key))
11838         return false;
11839       const hit = this[CACHE].get(key).value;
11840       return !isStale(this, hit);
11841     }
11842     get(key) {
11843       return get(this, key, true);
11844     }
11845     peek(key) {
11846       return get(this, key, false);
11847     }
11848     pop() {
11849       const node = this[LRU_LIST].tail;
11850       if (!node)
11851         return null;
11852       del(this, node);
11853       return node.value;
11854     }
11855     del(key) {
11856       del(this, this[CACHE].get(key));
11857     }
11858     load(arr) {
11859       this.reset();
11860       const now = Date.now();
11861       for (let l = arr.length - 1; l >= 0; l--) {
11862         const hit = arr[l];
11863         const expiresAt = hit.e || 0;
11864         if (expiresAt === 0)
11865           this.set(hit.k, hit.v);
11866         else {
11867           const maxAge = expiresAt - now;
11868           if (maxAge > 0) {
11869             this.set(hit.k, hit.v, maxAge);
11870           }
11871         }
11872       }
11873     }
11874     prune() {
11875       this[CACHE].forEach((value, key) => get(this, key, false));
11876     }
11877   };
11878   var get = (self2, key, doUse) => {
11879     const node = self2[CACHE].get(key);
11880     if (node) {
11881       const hit = node.value;
11882       if (isStale(self2, hit)) {
11883         del(self2, node);
11884         if (!self2[ALLOW_STALE])
11885           return void 0;
11886       } else {
11887         if (doUse) {
11888           if (self2[UPDATE_AGE_ON_GET])
11889             node.value.now = Date.now();
11890           self2[LRU_LIST].unshiftNode(node);
11891         }
11892       }
11893       return hit.value;
11894     }
11895   };
11896   var isStale = (self2, hit) => {
11897     if (!hit || !hit.maxAge && !self2[MAX_AGE])
11898       return false;
11899     const diff = Date.now() - hit.now;
11900     return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE];
11901   };
11902   var trim = (self2) => {
11903     if (self2[LENGTH] > self2[MAX]) {
11904       for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
11905         const prev = walker.prev;
11906         del(self2, walker);
11907         walker = prev;
11908       }
11909     }
11910   };
11911   var del = (self2, node) => {
11912     if (node) {
11913       const hit = node.value;
11914       if (self2[DISPOSE])
11915         self2[DISPOSE](hit.key, hit.value);
11916       self2[LENGTH] -= hit.length;
11917       self2[CACHE].delete(hit.key);
11918       self2[LRU_LIST].removeNode(node);
11919     }
11920   };
11921   var Entry = class {
11922     constructor(key, value, length, now, maxAge) {
11923       this.key = key;
11924       this.value = value;
11925       this.length = length;
11926       this.now = now;
11927       this.maxAge = maxAge || 0;
11928     }
11929   };
11930   var forEachStep = (self2, fn, node, thisp) => {
11931     let hit = node.value;
11932     if (isStale(self2, hit)) {
11933       del(self2, node);
11934       if (!self2[ALLOW_STALE])
11935         hit = void 0;
11936     }
11937     if (hit)
11938       fn.call(thisp, hit.value, hit.key, self2);
11939   };
11940   module2.exports = LRUCache;
11941 });
11942
11943 // node_modules/semver/classes/range.js
11944 var require_range = __commonJS((exports2, module2) => {
11945   var Range3 = class {
11946     constructor(range, options) {
11947       options = parseOptions(options);
11948       if (range instanceof Range3) {
11949         if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
11950           return range;
11951         } else {
11952           return new Range3(range.raw, options);
11953         }
11954       }
11955       if (range instanceof Comparator) {
11956         this.raw = range.value;
11957         this.set = [[range]];
11958         this.format();
11959         return this;
11960       }
11961       this.options = options;
11962       this.loose = !!options.loose;
11963       this.includePrerelease = !!options.includePrerelease;
11964       this.raw = range;
11965       this.set = range.split(/\s*\|\|\s*/).map((range2) => this.parseRange(range2.trim())).filter((c) => c.length);
11966       if (!this.set.length) {
11967         throw new TypeError(`Invalid SemVer Range: ${range}`);
11968       }
11969       if (this.set.length > 1) {
11970         const first = this.set[0];
11971         this.set = this.set.filter((c) => !isNullSet(c[0]));
11972         if (this.set.length === 0)
11973           this.set = [first];
11974         else if (this.set.length > 1) {
11975           for (const c of this.set) {
11976             if (c.length === 1 && isAny(c[0])) {
11977               this.set = [c];
11978               break;
11979             }
11980           }
11981         }
11982       }
11983       this.format();
11984     }
11985     format() {
11986       this.range = this.set.map((comps) => {
11987         return comps.join(" ").trim();
11988       }).join("||").trim();
11989       return this.range;
11990     }
11991     toString() {
11992       return this.range;
11993     }
11994     parseRange(range) {
11995       range = range.trim();
11996       const memoOpts = Object.keys(this.options).join(",");
11997       const memoKey = `parseRange:${memoOpts}:${range}`;
11998       const cached = cache.get(memoKey);
11999       if (cached)
12000         return cached;
12001       const loose = this.options.loose;
12002       const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
12003       range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
12004       debug("hyphen replace", range);
12005       range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
12006       debug("comparator trim", range, re[t.COMPARATORTRIM]);
12007       range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
12008       range = range.replace(re[t.CARETTRIM], caretTrimReplace);
12009       range = range.split(/\s+/).join(" ");
12010       const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
12011       const rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)).filter(this.options.loose ? (comp) => !!comp.match(compRe) : () => true).map((comp) => new Comparator(comp, this.options));
12012       const l = rangeList.length;
12013       const rangeMap = new Map();
12014       for (const comp of rangeList) {
12015         if (isNullSet(comp))
12016           return [comp];
12017         rangeMap.set(comp.value, comp);
12018       }
12019       if (rangeMap.size > 1 && rangeMap.has(""))
12020         rangeMap.delete("");
12021       const result = [...rangeMap.values()];
12022       cache.set(memoKey, result);
12023       return result;
12024     }
12025     intersects(range, options) {
12026       if (!(range instanceof Range3)) {
12027         throw new TypeError("a Range is required");
12028       }
12029       return this.set.some((thisComparators) => {
12030         return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
12031           return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
12032             return rangeComparators.every((rangeComparator) => {
12033               return thisComparator.intersects(rangeComparator, options);
12034             });
12035           });
12036         });
12037       });
12038     }
12039     test(version) {
12040       if (!version) {
12041         return false;
12042       }
12043       if (typeof version === "string") {
12044         try {
12045           version = new SemVer(version, this.options);
12046         } catch (er) {
12047           return false;
12048         }
12049       }
12050       for (let i = 0; i < this.set.length; i++) {
12051         if (testSet(this.set[i], version, this.options)) {
12052           return true;
12053         }
12054       }
12055       return false;
12056     }
12057   };
12058   module2.exports = Range3;
12059   var LRU = require_lru_cache();
12060   var cache = new LRU({max: 1e3});
12061   var parseOptions = require_parse_options();
12062   var Comparator = require_comparator();
12063   var debug = require_debug();
12064   var SemVer = require_semver();
12065   var {
12066     re,
12067     t,
12068     comparatorTrimReplace,
12069     tildeTrimReplace,
12070     caretTrimReplace
12071   } = require_re();
12072   var isNullSet = (c) => c.value === "<0.0.0-0";
12073   var isAny = (c) => c.value === "";
12074   var isSatisfiable = (comparators, options) => {
12075     let result = true;
12076     const remainingComparators = comparators.slice();
12077     let testComparator = remainingComparators.pop();
12078     while (result && remainingComparators.length) {
12079       result = remainingComparators.every((otherComparator) => {
12080         return testComparator.intersects(otherComparator, options);
12081       });
12082       testComparator = remainingComparators.pop();
12083     }
12084     return result;
12085   };
12086   var parseComparator = (comp, options) => {
12087     debug("comp", comp, options);
12088     comp = replaceCarets(comp, options);
12089     debug("caret", comp);
12090     comp = replaceTildes(comp, options);
12091     debug("tildes", comp);
12092     comp = replaceXRanges(comp, options);
12093     debug("xrange", comp);
12094     comp = replaceStars(comp, options);
12095     debug("stars", comp);
12096     return comp;
12097   };
12098   var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
12099   var replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp2) => {
12100     return replaceTilde(comp2, options);
12101   }).join(" ");
12102   var replaceTilde = (comp, options) => {
12103     const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
12104     return comp.replace(r, (_, M, m, p, pr) => {
12105       debug("tilde", comp, _, M, m, p, pr);
12106       let ret2;
12107       if (isX(M)) {
12108         ret2 = "";
12109       } else if (isX(m)) {
12110         ret2 = `>=${M}.0.0 <${+M + 1}.0.0-0`;
12111       } else if (isX(p)) {
12112         ret2 = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
12113       } else if (pr) {
12114         debug("replaceTilde pr", pr);
12115         ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
12116       } else {
12117         ret2 = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
12118       }
12119       debug("tilde return", ret2);
12120       return ret2;
12121     });
12122   };
12123   var replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp2) => {
12124     return replaceCaret(comp2, options);
12125   }).join(" ");
12126   var replaceCaret = (comp, options) => {
12127     debug("caret", comp, options);
12128     const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
12129     const z = options.includePrerelease ? "-0" : "";
12130     return comp.replace(r, (_, M, m, p, pr) => {
12131       debug("caret", comp, _, M, m, p, pr);
12132       let ret2;
12133       if (isX(M)) {
12134         ret2 = "";
12135       } else if (isX(m)) {
12136         ret2 = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
12137       } else if (isX(p)) {
12138         if (M === "0") {
12139           ret2 = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
12140         } else {
12141           ret2 = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
12142         }
12143       } else if (pr) {
12144         debug("replaceCaret pr", pr);
12145         if (M === "0") {
12146           if (m === "0") {
12147             ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
12148           } else {
12149             ret2 = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
12150           }
12151         } else {
12152           ret2 = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
12153         }
12154       } else {
12155         debug("no pr");
12156         if (M === "0") {
12157           if (m === "0") {
12158             ret2 = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
12159           } else {
12160             ret2 = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
12161           }
12162         } else {
12163           ret2 = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
12164         }
12165       }
12166       debug("caret return", ret2);
12167       return ret2;
12168     });
12169   };
12170   var replaceXRanges = (comp, options) => {
12171     debug("replaceXRanges", comp, options);
12172     return comp.split(/\s+/).map((comp2) => {
12173       return replaceXRange(comp2, options);
12174     }).join(" ");
12175   };
12176   var replaceXRange = (comp, options) => {
12177     comp = comp.trim();
12178     const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
12179     return comp.replace(r, (ret2, gtlt, M, m, p, pr) => {
12180       debug("xRange", comp, ret2, gtlt, M, m, p, pr);
12181       const xM = isX(M);
12182       const xm = xM || isX(m);
12183       const xp = xm || isX(p);
12184       const anyX = xp;
12185       if (gtlt === "=" && anyX) {
12186         gtlt = "";
12187       }
12188       pr = options.includePrerelease ? "-0" : "";
12189       if (xM) {
12190         if (gtlt === ">" || gtlt === "<") {
12191           ret2 = "<0.0.0-0";
12192         } else {
12193           ret2 = "*";
12194         }
12195       } else if (gtlt && anyX) {
12196         if (xm) {
12197           m = 0;
12198         }
12199         p = 0;
12200         if (gtlt === ">") {
12201           gtlt = ">=";
12202           if (xm) {
12203             M = +M + 1;
12204             m = 0;
12205             p = 0;
12206           } else {
12207             m = +m + 1;
12208             p = 0;
12209           }
12210         } else if (gtlt === "<=") {
12211           gtlt = "<";
12212           if (xm) {
12213             M = +M + 1;
12214           } else {
12215             m = +m + 1;
12216           }
12217         }
12218         if (gtlt === "<")
12219           pr = "-0";
12220         ret2 = `${gtlt + M}.${m}.${p}${pr}`;
12221       } else if (xm) {
12222         ret2 = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
12223       } else if (xp) {
12224         ret2 = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
12225       }
12226       debug("xRange return", ret2);
12227       return ret2;
12228     });
12229   };
12230   var replaceStars = (comp, options) => {
12231     debug("replaceStars", comp, options);
12232     return comp.trim().replace(re[t.STAR], "");
12233   };
12234   var replaceGTE0 = (comp, options) => {
12235     debug("replaceGTE0", comp, options);
12236     return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
12237   };
12238   var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
12239     if (isX(fM)) {
12240       from = "";
12241     } else if (isX(fm)) {
12242       from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
12243     } else if (isX(fp)) {
12244       from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
12245     } else if (fpr) {
12246       from = `>=${from}`;
12247     } else {
12248       from = `>=${from}${incPr ? "-0" : ""}`;
12249     }
12250     if (isX(tM)) {
12251       to = "";
12252     } else if (isX(tm)) {
12253       to = `<${+tM + 1}.0.0-0`;
12254     } else if (isX(tp)) {
12255       to = `<${tM}.${+tm + 1}.0-0`;
12256     } else if (tpr) {
12257       to = `<=${tM}.${tm}.${tp}-${tpr}`;
12258     } else if (incPr) {
12259       to = `<${tM}.${tm}.${+tp + 1}-0`;
12260     } else {
12261       to = `<=${to}`;
12262     }
12263     return `${from} ${to}`.trim();
12264   };
12265   var testSet = (set, version, options) => {
12266     for (let i = 0; i < set.length; i++) {
12267       if (!set[i].test(version)) {
12268         return false;
12269       }
12270     }
12271     if (version.prerelease.length && !options.includePrerelease) {
12272       for (let i = 0; i < set.length; i++) {
12273         debug(set[i].semver);
12274         if (set[i].semver === Comparator.ANY) {
12275           continue;
12276         }
12277         if (set[i].semver.prerelease.length > 0) {
12278           const allowed = set[i].semver;
12279           if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
12280             return true;
12281           }
12282         }
12283       }
12284       return false;
12285     }
12286     return true;
12287   };
12288 });
12289
12290 // node_modules/semver/classes/comparator.js
12291 var require_comparator = __commonJS((exports2, module2) => {
12292   var ANY = Symbol("SemVer ANY");
12293   var Comparator = class {
12294     static get ANY() {
12295       return ANY;
12296     }
12297     constructor(comp, options) {
12298       options = parseOptions(options);
12299       if (comp instanceof Comparator) {
12300         if (comp.loose === !!options.loose) {
12301           return comp;
12302         } else {
12303           comp = comp.value;
12304         }
12305       }
12306       debug("comparator", comp, options);
12307       this.options = options;
12308       this.loose = !!options.loose;
12309       this.parse(comp);
12310       if (this.semver === ANY) {
12311         this.value = "";
12312       } else {
12313         this.value = this.operator + this.semver.version;
12314       }
12315       debug("comp", this);
12316     }
12317     parse(comp) {
12318       const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
12319       const m = comp.match(r);
12320       if (!m) {
12321         throw new TypeError(`Invalid comparator: ${comp}`);
12322       }
12323       this.operator = m[1] !== void 0 ? m[1] : "";
12324       if (this.operator === "=") {
12325         this.operator = "";
12326       }
12327       if (!m[2]) {
12328         this.semver = ANY;
12329       } else {
12330         this.semver = new SemVer(m[2], this.options.loose);
12331       }
12332     }
12333     toString() {
12334       return this.value;
12335     }
12336     test(version) {
12337       debug("Comparator.test", version, this.options.loose);
12338       if (this.semver === ANY || version === ANY) {
12339         return true;
12340       }
12341       if (typeof version === "string") {
12342         try {
12343           version = new SemVer(version, this.options);
12344         } catch (er) {
12345           return false;
12346         }
12347       }
12348       return cmp(version, this.operator, this.semver, this.options);
12349     }
12350     intersects(comp, options) {
12351       if (!(comp instanceof Comparator)) {
12352         throw new TypeError("a Comparator is required");
12353       }
12354       if (!options || typeof options !== "object") {
12355         options = {
12356           loose: !!options,
12357           includePrerelease: false
12358         };
12359       }
12360       if (this.operator === "") {
12361         if (this.value === "") {
12362           return true;
12363         }
12364         return new Range3(comp.value, options).test(this.value);
12365       } else if (comp.operator === "") {
12366         if (comp.value === "") {
12367           return true;
12368         }
12369         return new Range3(this.value, options).test(comp.semver);
12370       }
12371       const sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp.operator === ">=" || comp.operator === ">");
12372       const sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp.operator === "<=" || comp.operator === "<");
12373       const sameSemVer = this.semver.version === comp.semver.version;
12374       const differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp.operator === ">=" || comp.operator === "<=");
12375       const oppositeDirectionsLessThan = cmp(this.semver, "<", comp.semver, options) && (this.operator === ">=" || this.operator === ">") && (comp.operator === "<=" || comp.operator === "<");
12376       const oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp.semver, options) && (this.operator === "<=" || this.operator === "<") && (comp.operator === ">=" || comp.operator === ">");
12377       return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
12378     }
12379   };
12380   module2.exports = Comparator;
12381   var parseOptions = require_parse_options();
12382   var {re, t} = require_re();
12383   var cmp = require_cmp();
12384   var debug = require_debug();
12385   var SemVer = require_semver();
12386   var Range3 = require_range();
12387 });
12388
12389 // node_modules/semver/functions/satisfies.js
12390 var require_satisfies = __commonJS((exports2, module2) => {
12391   var Range3 = require_range();
12392   var satisfies = (version, range, options) => {
12393     try {
12394       range = new Range3(range, options);
12395     } catch (er) {
12396       return false;
12397     }
12398     return range.test(version);
12399   };
12400   module2.exports = satisfies;
12401 });
12402
12403 // node_modules/semver/ranges/to-comparators.js
12404 var require_to_comparators = __commonJS((exports2, module2) => {
12405   var Range3 = require_range();
12406   var toComparators = (range, options) => new Range3(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
12407   module2.exports = toComparators;
12408 });
12409
12410 // node_modules/semver/ranges/max-satisfying.js
12411 var require_max_satisfying = __commonJS((exports2, module2) => {
12412   var SemVer = require_semver();
12413   var Range3 = require_range();
12414   var maxSatisfying = (versions, range, options) => {
12415     let max = null;
12416     let maxSV = null;
12417     let rangeObj = null;
12418     try {
12419       rangeObj = new Range3(range, options);
12420     } catch (er) {
12421       return null;
12422     }
12423     versions.forEach((v) => {
12424       if (rangeObj.test(v)) {
12425         if (!max || maxSV.compare(v) === -1) {
12426           max = v;
12427           maxSV = new SemVer(max, options);
12428         }
12429       }
12430     });
12431     return max;
12432   };
12433   module2.exports = maxSatisfying;
12434 });
12435
12436 // node_modules/semver/ranges/min-satisfying.js
12437 var require_min_satisfying = __commonJS((exports2, module2) => {
12438   var SemVer = require_semver();
12439   var Range3 = require_range();
12440   var minSatisfying = (versions, range, options) => {
12441     let min = null;
12442     let minSV = null;
12443     let rangeObj = null;
12444     try {
12445       rangeObj = new Range3(range, options);
12446     } catch (er) {
12447       return null;
12448     }
12449     versions.forEach((v) => {
12450       if (rangeObj.test(v)) {
12451         if (!min || minSV.compare(v) === 1) {
12452           min = v;
12453           minSV = new SemVer(min, options);
12454         }
12455       }
12456     });
12457     return min;
12458   };
12459   module2.exports = minSatisfying;
12460 });
12461
12462 // node_modules/semver/ranges/min-version.js
12463 var require_min_version = __commonJS((exports2, module2) => {
12464   var SemVer = require_semver();
12465   var Range3 = require_range();
12466   var gt = require_gt();
12467   var minVersion = (range, loose) => {
12468     range = new Range3(range, loose);
12469     let minver = new SemVer("0.0.0");
12470     if (range.test(minver)) {
12471       return minver;
12472     }
12473     minver = new SemVer("0.0.0-0");
12474     if (range.test(minver)) {
12475       return minver;
12476     }
12477     minver = null;
12478     for (let i = 0; i < range.set.length; ++i) {
12479       const comparators = range.set[i];
12480       let setMin = null;
12481       comparators.forEach((comparator) => {
12482         const compver = new SemVer(comparator.semver.version);
12483         switch (comparator.operator) {
12484           case ">":
12485             if (compver.prerelease.length === 0) {
12486               compver.patch++;
12487             } else {
12488               compver.prerelease.push(0);
12489             }
12490             compver.raw = compver.format();
12491           case "":
12492           case ">=":
12493             if (!setMin || gt(compver, setMin)) {
12494               setMin = compver;
12495             }
12496             break;
12497           case "<":
12498           case "<=":
12499             break;
12500           default:
12501             throw new Error(`Unexpected operation: ${comparator.operator}`);
12502         }
12503       });
12504       if (setMin && (!minver || gt(minver, setMin)))
12505         minver = setMin;
12506     }
12507     if (minver && range.test(minver)) {
12508       return minver;
12509     }
12510     return null;
12511   };
12512   module2.exports = minVersion;
12513 });
12514
12515 // node_modules/semver/ranges/valid.js
12516 var require_valid2 = __commonJS((exports2, module2) => {
12517   var Range3 = require_range();
12518   var validRange = (range, options) => {
12519     try {
12520       return new Range3(range, options).range || "*";
12521     } catch (er) {
12522       return null;
12523     }
12524   };
12525   module2.exports = validRange;
12526 });
12527
12528 // node_modules/semver/ranges/outside.js
12529 var require_outside = __commonJS((exports2, module2) => {
12530   var SemVer = require_semver();
12531   var Comparator = require_comparator();
12532   var {ANY} = Comparator;
12533   var Range3 = require_range();
12534   var satisfies = require_satisfies();
12535   var gt = require_gt();
12536   var lt = require_lt();
12537   var lte = require_lte();
12538   var gte = require_gte();
12539   var outside = (version, range, hilo, options) => {
12540     version = new SemVer(version, options);
12541     range = new Range3(range, options);
12542     let gtfn, ltefn, ltfn, comp, ecomp;
12543     switch (hilo) {
12544       case ">":
12545         gtfn = gt;
12546         ltefn = lte;
12547         ltfn = lt;
12548         comp = ">";
12549         ecomp = ">=";
12550         break;
12551       case "<":
12552         gtfn = lt;
12553         ltefn = gte;
12554         ltfn = gt;
12555         comp = "<";
12556         ecomp = "<=";
12557         break;
12558       default:
12559         throw new TypeError('Must provide a hilo val of "<" or ">"');
12560     }
12561     if (satisfies(version, range, options)) {
12562       return false;
12563     }
12564     for (let i = 0; i < range.set.length; ++i) {
12565       const comparators = range.set[i];
12566       let high = null;
12567       let low = null;
12568       comparators.forEach((comparator) => {
12569         if (comparator.semver === ANY) {
12570           comparator = new Comparator(">=0.0.0");
12571         }
12572         high = high || comparator;
12573         low = low || comparator;
12574         if (gtfn(comparator.semver, high.semver, options)) {
12575           high = comparator;
12576         } else if (ltfn(comparator.semver, low.semver, options)) {
12577           low = comparator;
12578         }
12579       });
12580       if (high.operator === comp || high.operator === ecomp) {
12581         return false;
12582       }
12583       if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
12584         return false;
12585       } else if (low.operator === ecomp && ltfn(version, low.semver)) {
12586         return false;
12587       }
12588     }
12589     return true;
12590   };
12591   module2.exports = outside;
12592 });
12593
12594 // node_modules/semver/ranges/gtr.js
12595 var require_gtr = __commonJS((exports2, module2) => {
12596   var outside = require_outside();
12597   var gtr = (version, range, options) => outside(version, range, ">", options);
12598   module2.exports = gtr;
12599 });
12600
12601 // node_modules/semver/ranges/ltr.js
12602 var require_ltr = __commonJS((exports2, module2) => {
12603   var outside = require_outside();
12604   var ltr = (version, range, options) => outside(version, range, "<", options);
12605   module2.exports = ltr;
12606 });
12607
12608 // node_modules/semver/ranges/intersects.js
12609 var require_intersects = __commonJS((exports2, module2) => {
12610   var Range3 = require_range();
12611   var intersects = (r1, r2, options) => {
12612     r1 = new Range3(r1, options);
12613     r2 = new Range3(r2, options);
12614     return r1.intersects(r2);
12615   };
12616   module2.exports = intersects;
12617 });
12618
12619 // node_modules/semver/ranges/simplify.js
12620 var require_simplify = __commonJS((exports2, module2) => {
12621   var satisfies = require_satisfies();
12622   var compare = require_compare();
12623   module2.exports = (versions, range, options) => {
12624     const set = [];
12625     let min = null;
12626     let prev = null;
12627     const v = versions.sort((a, b) => compare(a, b, options));
12628     for (const version of v) {
12629       const included = satisfies(version, range, options);
12630       if (included) {
12631         prev = version;
12632         if (!min)
12633           min = version;
12634       } else {
12635         if (prev) {
12636           set.push([min, prev]);
12637         }
12638         prev = null;
12639         min = null;
12640       }
12641     }
12642     if (min)
12643       set.push([min, null]);
12644     const ranges = [];
12645     for (const [min2, max] of set) {
12646       if (min2 === max)
12647         ranges.push(min2);
12648       else if (!max && min2 === v[0])
12649         ranges.push("*");
12650       else if (!max)
12651         ranges.push(`>=${min2}`);
12652       else if (min2 === v[0])
12653         ranges.push(`<=${max}`);
12654       else
12655         ranges.push(`${min2} - ${max}`);
12656     }
12657     const simplified = ranges.join(" || ");
12658     const original = typeof range.raw === "string" ? range.raw : String(range);
12659     return simplified.length < original.length ? simplified : range;
12660   };
12661 });
12662
12663 // node_modules/semver/ranges/subset.js
12664 var require_subset = __commonJS((exports2, module2) => {
12665   var Range3 = require_range();
12666   var {ANY} = require_comparator();
12667   var satisfies = require_satisfies();
12668   var compare = require_compare();
12669   var subset = (sub, dom, options) => {
12670     if (sub === dom)
12671       return true;
12672     sub = new Range3(sub, options);
12673     dom = new Range3(dom, options);
12674     let sawNonNull = false;
12675     OUTER:
12676       for (const simpleSub of sub.set) {
12677         for (const simpleDom of dom.set) {
12678           const isSub = simpleSubset(simpleSub, simpleDom, options);
12679           sawNonNull = sawNonNull || isSub !== null;
12680           if (isSub)
12681             continue OUTER;
12682         }
12683         if (sawNonNull)
12684           return false;
12685       }
12686     return true;
12687   };
12688   var simpleSubset = (sub, dom, options) => {
12689     if (sub === dom)
12690       return true;
12691     if (sub.length === 1 && sub[0].semver === ANY)
12692       return dom.length === 1 && dom[0].semver === ANY;
12693     const eqSet = new Set();
12694     let gt, lt;
12695     for (const c of sub) {
12696       if (c.operator === ">" || c.operator === ">=")
12697         gt = higherGT(gt, c, options);
12698       else if (c.operator === "<" || c.operator === "<=")
12699         lt = lowerLT(lt, c, options);
12700       else
12701         eqSet.add(c.semver);
12702     }
12703     if (eqSet.size > 1)
12704       return null;
12705     let gtltComp;
12706     if (gt && lt) {
12707       gtltComp = compare(gt.semver, lt.semver, options);
12708       if (gtltComp > 0)
12709         return null;
12710       else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<="))
12711         return null;
12712     }
12713     for (const eq of eqSet) {
12714       if (gt && !satisfies(eq, String(gt), options))
12715         return null;
12716       if (lt && !satisfies(eq, String(lt), options))
12717         return null;
12718       for (const c of dom) {
12719         if (!satisfies(eq, String(c), options))
12720           return false;
12721       }
12722       return true;
12723     }
12724     let higher, lower;
12725     let hasDomLT, hasDomGT;
12726     for (const c of dom) {
12727       hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
12728       hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
12729       if (gt) {
12730         if (c.operator === ">" || c.operator === ">=") {
12731           higher = higherGT(gt, c, options);
12732           if (higher === c && higher !== gt)
12733             return false;
12734         } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options))
12735           return false;
12736       }
12737       if (lt) {
12738         if (c.operator === "<" || c.operator === "<=") {
12739           lower = lowerLT(lt, c, options);
12740           if (lower === c && lower !== lt)
12741             return false;
12742         } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options))
12743           return false;
12744       }
12745       if (!c.operator && (lt || gt) && gtltComp !== 0)
12746         return false;
12747     }
12748     if (gt && hasDomLT && !lt && gtltComp !== 0)
12749       return false;
12750     if (lt && hasDomGT && !gt && gtltComp !== 0)
12751       return false;
12752     return true;
12753   };
12754   var higherGT = (a, b, options) => {
12755     if (!a)
12756       return b;
12757     const comp = compare(a.semver, b.semver, options);
12758     return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
12759   };
12760   var lowerLT = (a, b, options) => {
12761     if (!a)
12762       return b;
12763     const comp = compare(a.semver, b.semver, options);
12764     return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
12765   };
12766   module2.exports = subset;
12767 });
12768
12769 // node_modules/semver/index.js
12770 var require_semver2 = __commonJS((exports2, module2) => {
12771   var internalRe = require_re();
12772   module2.exports = {
12773     re: internalRe.re,
12774     src: internalRe.src,
12775     tokens: internalRe.t,
12776     SEMVER_SPEC_VERSION: require_constants2().SEMVER_SPEC_VERSION,
12777     SemVer: require_semver(),
12778     compareIdentifiers: require_identifiers().compareIdentifiers,
12779     rcompareIdentifiers: require_identifiers().rcompareIdentifiers,
12780     parse: require_parse2(),
12781     valid: require_valid(),
12782     clean: require_clean(),
12783     inc: require_inc(),
12784     diff: require_diff(),
12785     major: require_major(),
12786     minor: require_minor(),
12787     patch: require_patch(),
12788     prerelease: require_prerelease(),
12789     compare: require_compare(),
12790     rcompare: require_rcompare(),
12791     compareLoose: require_compare_loose(),
12792     compareBuild: require_compare_build(),
12793     sort: require_sort(),
12794     rsort: require_rsort(),
12795     gt: require_gt(),
12796     lt: require_lt(),
12797     eq: require_eq(),
12798     neq: require_neq(),
12799     gte: require_gte(),
12800     lte: require_lte(),
12801     cmp: require_cmp(),
12802     coerce: require_coerce(),
12803     Comparator: require_comparator(),
12804     Range: require_range(),
12805     satisfies: require_satisfies(),
12806     toComparators: require_to_comparators(),
12807     maxSatisfying: require_max_satisfying(),
12808     minSatisfying: require_min_satisfying(),
12809     minVersion: require_min_version(),
12810     validRange: require_valid2(),
12811     outside: require_outside(),
12812     gtr: require_gtr(),
12813     ltr: require_ltr(),
12814     intersects: require_intersects(),
12815     simplifyRange: require_simplify(),
12816     subset: require_subset()
12817   };
12818 });
12819
12820 // node_modules/listenercount/index.js
12821 var require_listenercount = __commonJS((exports2, module2) => {
12822   "use strict";
12823   var listenerCount = require("events").listenerCount;
12824   listenerCount = listenerCount || function(ee, event) {
12825     var listeners = ee && ee._events && ee._events[event];
12826     if (Array.isArray(listeners)) {
12827       return listeners.length;
12828     } else if (typeof listeners === "function") {
12829       return 1;
12830     } else {
12831       return 0;
12832     }
12833   };
12834   module2.exports = listenerCount;
12835 });
12836
12837 // node_modules/buffer-indexof-polyfill/index.js
12838 var require_buffer_indexof_polyfill = __commonJS(() => {
12839   "use strict";
12840   if (!Buffer.prototype.indexOf) {
12841     Buffer.prototype.indexOf = function(value, offset) {
12842       offset = offset || 0;
12843       if (typeof value === "string" || value instanceof String) {
12844         value = new Buffer(value);
12845       } else if (typeof value === "number" || value instanceof Number) {
12846         value = new Buffer([value]);
12847       }
12848       var len = value.length;
12849       for (var i = offset; i <= this.length - len; i++) {
12850         var mismatch = false;
12851         for (var j = 0; j < len; j++) {
12852           if (this[i + j] != value[j]) {
12853             mismatch = true;
12854             break;
12855           }
12856         }
12857         if (!mismatch) {
12858           return i;
12859         }
12860       }
12861       return -1;
12862     };
12863   }
12864   function bufferLastIndexOf(value, offset) {
12865     if (typeof value === "string" || value instanceof String) {
12866       value = new Buffer(value);
12867     } else if (typeof value === "number" || value instanceof Number) {
12868       value = new Buffer([value]);
12869     }
12870     var len = value.length;
12871     offset = offset || this.length - len;
12872     for (var i = offset; i >= 0; i--) {
12873       var mismatch = false;
12874       for (var j = 0; j < len; j++) {
12875         if (this[i + j] != value[j]) {
12876           mismatch = true;
12877           break;
12878         }
12879       }
12880       if (!mismatch) {
12881         return i;
12882       }
12883     }
12884     return -1;
12885   }
12886   if (Buffer.prototype.lastIndexOf) {
12887     if (new Buffer("ABC").lastIndexOf("ABC") === -1)
12888       Buffer.prototype.lastIndexOf = bufferLastIndexOf;
12889   } else {
12890     Buffer.prototype.lastIndexOf = bufferLastIndexOf;
12891   }
12892 });
12893
12894 // node_modules/setimmediate/setImmediate.js
12895 var require_setImmediate = __commonJS((exports2) => {
12896   (function(global2, undefined2) {
12897     "use strict";
12898     if (global2.setImmediate) {
12899       return;
12900     }
12901     var nextHandle = 1;
12902     var tasksByHandle = {};
12903     var currentlyRunningATask = false;
12904     var doc = global2.document;
12905     var registerImmediate;
12906     function setImmediate2(callback) {
12907       if (typeof callback !== "function") {
12908         callback = new Function("" + callback);
12909       }
12910       var args = new Array(arguments.length - 1);
12911       for (var i = 0; i < args.length; i++) {
12912         args[i] = arguments[i + 1];
12913       }
12914       var task = {callback, args};
12915       tasksByHandle[nextHandle] = task;
12916       registerImmediate(nextHandle);
12917       return nextHandle++;
12918     }
12919     function clearImmediate2(handle) {
12920       delete tasksByHandle[handle];
12921     }
12922     function run(task) {
12923       var callback = task.callback;
12924       var args = task.args;
12925       switch (args.length) {
12926         case 0:
12927           callback();
12928           break;
12929         case 1:
12930           callback(args[0]);
12931           break;
12932         case 2:
12933           callback(args[0], args[1]);
12934           break;
12935         case 3:
12936           callback(args[0], args[1], args[2]);
12937           break;
12938         default:
12939           callback.apply(undefined2, args);
12940           break;
12941       }
12942     }
12943     function runIfPresent(handle) {
12944       if (currentlyRunningATask) {
12945         setTimeout(runIfPresent, 0, handle);
12946       } else {
12947         var task = tasksByHandle[handle];
12948         if (task) {
12949           currentlyRunningATask = true;
12950           try {
12951             run(task);
12952           } finally {
12953             clearImmediate2(handle);
12954             currentlyRunningATask = false;
12955           }
12956         }
12957       }
12958     }
12959     function installNextTickImplementation() {
12960       registerImmediate = function(handle) {
12961         process.nextTick(function() {
12962           runIfPresent(handle);
12963         });
12964       };
12965     }
12966     function canUsePostMessage() {
12967       if (global2.postMessage && !global2.importScripts) {
12968         var postMessageIsAsynchronous = true;
12969         var oldOnMessage = global2.onmessage;
12970         global2.onmessage = function() {
12971           postMessageIsAsynchronous = false;
12972         };
12973         global2.postMessage("", "*");
12974         global2.onmessage = oldOnMessage;
12975         return postMessageIsAsynchronous;
12976       }
12977     }
12978     function installPostMessageImplementation() {
12979       var messagePrefix = "setImmediate$" + Math.random() + "$";
12980       var onGlobalMessage = function(event) {
12981         if (event.source === global2 && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
12982           runIfPresent(+event.data.slice(messagePrefix.length));
12983         }
12984       };
12985       if (global2.addEventListener) {
12986         global2.addEventListener("message", onGlobalMessage, false);
12987       } else {
12988         global2.attachEvent("onmessage", onGlobalMessage);
12989       }
12990       registerImmediate = function(handle) {
12991         global2.postMessage(messagePrefix + handle, "*");
12992       };
12993     }
12994     function installMessageChannelImplementation() {
12995       var channel = new MessageChannel();
12996       channel.port1.onmessage = function(event) {
12997         var handle = event.data;
12998         runIfPresent(handle);
12999       };
13000       registerImmediate = function(handle) {
13001         channel.port2.postMessage(handle);
13002       };
13003     }
13004     function installReadyStateChangeImplementation() {
13005       var html = doc.documentElement;
13006       registerImmediate = function(handle) {
13007         var script = doc.createElement("script");
13008         script.onreadystatechange = function() {
13009           runIfPresent(handle);
13010           script.onreadystatechange = null;
13011           html.removeChild(script);
13012           script = null;
13013         };
13014         html.appendChild(script);
13015       };
13016     }
13017     function installSetTimeoutImplementation() {
13018       registerImmediate = function(handle) {
13019         setTimeout(runIfPresent, 0, handle);
13020       };
13021     }
13022     var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global2);
13023     attachTo = attachTo && attachTo.setTimeout ? attachTo : global2;
13024     if ({}.toString.call(global2.process) === "[object process]") {
13025       installNextTickImplementation();
13026     } else if (canUsePostMessage()) {
13027       installPostMessageImplementation();
13028     } else if (global2.MessageChannel) {
13029       installMessageChannelImplementation();
13030     } else if (doc && "onreadystatechange" in doc.createElement("script")) {
13031       installReadyStateChangeImplementation();
13032     } else {
13033       installSetTimeoutImplementation();
13034     }
13035     attachTo.setImmediate = setImmediate2;
13036     attachTo.clearImmediate = clearImmediate2;
13037   })(typeof self === "undefined" ? typeof global === "undefined" ? exports2 : global : self);
13038 });
13039
13040 // node_modules/traverse/index.js
13041 var require_traverse = __commonJS((exports2, module2) => {
13042   module2.exports = Traverse;
13043   function Traverse(obj) {
13044     if (!(this instanceof Traverse))
13045       return new Traverse(obj);
13046     this.value = obj;
13047   }
13048   Traverse.prototype.get = function(ps) {
13049     var node = this.value;
13050     for (var i = 0; i < ps.length; i++) {
13051       var key = ps[i];
13052       if (!Object.hasOwnProperty.call(node, key)) {
13053         node = void 0;
13054         break;
13055       }
13056       node = node[key];
13057     }
13058     return node;
13059   };
13060   Traverse.prototype.set = function(ps, value) {
13061     var node = this.value;
13062     for (var i = 0; i < ps.length - 1; i++) {
13063       var key = ps[i];
13064       if (!Object.hasOwnProperty.call(node, key))
13065         node[key] = {};
13066       node = node[key];
13067     }
13068     node[ps[i]] = value;
13069     return value;
13070   };
13071   Traverse.prototype.map = function(cb) {
13072     return walk(this.value, cb, true);
13073   };
13074   Traverse.prototype.forEach = function(cb) {
13075     this.value = walk(this.value, cb, false);
13076     return this.value;
13077   };
13078   Traverse.prototype.reduce = function(cb, init) {
13079     var skip = arguments.length === 1;
13080     var acc = skip ? this.value : init;
13081     this.forEach(function(x) {
13082       if (!this.isRoot || !skip) {
13083         acc = cb.call(this, acc, x);
13084       }
13085     });
13086     return acc;
13087   };
13088   Traverse.prototype.deepEqual = function(obj) {
13089     if (arguments.length !== 1) {
13090       throw new Error("deepEqual requires exactly one object to compare against");
13091     }
13092     var equal = true;
13093     var node = obj;
13094     this.forEach(function(y) {
13095       var notEqual = function() {
13096         equal = false;
13097         return void 0;
13098       }.bind(this);
13099       if (!this.isRoot) {
13100         if (typeof node !== "object")
13101           return notEqual();
13102         node = node[this.key];
13103       }
13104       var x = node;
13105       this.post(function() {
13106         node = x;
13107       });
13108       var toS = function(o) {
13109         return Object.prototype.toString.call(o);
13110       };
13111       if (this.circular) {
13112         if (Traverse(obj).get(this.circular.path) !== x)
13113           notEqual();
13114       } else if (typeof x !== typeof y) {
13115         notEqual();
13116       } else if (x === null || y === null || x === void 0 || y === void 0) {
13117         if (x !== y)
13118           notEqual();
13119       } else if (x.__proto__ !== y.__proto__) {
13120         notEqual();
13121       } else if (x === y) {
13122       } else if (typeof x === "function") {
13123         if (x instanceof RegExp) {
13124           if (x.toString() != y.toString())
13125             notEqual();
13126         } else if (x !== y)
13127           notEqual();
13128       } else if (typeof x === "object") {
13129         if (toS(y) === "[object Arguments]" || toS(x) === "[object Arguments]") {
13130           if (toS(x) !== toS(y)) {
13131             notEqual();
13132           }
13133         } else if (x instanceof Date || y instanceof Date) {
13134           if (!(x instanceof Date) || !(y instanceof Date) || x.getTime() !== y.getTime()) {
13135             notEqual();
13136           }
13137         } else {
13138           var kx = Object.keys(x);
13139           var ky = Object.keys(y);
13140           if (kx.length !== ky.length)
13141             return notEqual();
13142           for (var i = 0; i < kx.length; i++) {
13143             var k = kx[i];
13144             if (!Object.hasOwnProperty.call(y, k)) {
13145               notEqual();
13146             }
13147           }
13148         }
13149       }
13150     });
13151     return equal;
13152   };
13153   Traverse.prototype.paths = function() {
13154     var acc = [];
13155     this.forEach(function(x) {
13156       acc.push(this.path);
13157     });
13158     return acc;
13159   };
13160   Traverse.prototype.nodes = function() {
13161     var acc = [];
13162     this.forEach(function(x) {
13163       acc.push(this.node);
13164     });
13165     return acc;
13166   };
13167   Traverse.prototype.clone = function() {
13168     var parents = [], nodes = [];
13169     return function clone(src) {
13170       for (var i = 0; i < parents.length; i++) {
13171         if (parents[i] === src) {
13172           return nodes[i];
13173         }
13174       }
13175       if (typeof src === "object" && src !== null) {
13176         var dst = copy(src);
13177         parents.push(src);
13178         nodes.push(dst);
13179         Object.keys(src).forEach(function(key) {
13180           dst[key] = clone(src[key]);
13181         });
13182         parents.pop();
13183         nodes.pop();
13184         return dst;
13185       } else {
13186         return src;
13187       }
13188     }(this.value);
13189   };
13190   function walk(root, cb, immutable) {
13191     var path = [];
13192     var parents = [];
13193     var alive = true;
13194     return function walker(node_) {
13195       var node = immutable ? copy(node_) : node_;
13196       var modifiers = {};
13197       var state = {
13198         node,
13199         node_,
13200         path: [].concat(path),
13201         parent: parents.slice(-1)[0],
13202         key: path.slice(-1)[0],
13203         isRoot: path.length === 0,
13204         level: path.length,
13205         circular: null,
13206         update: function(x) {
13207           if (!state.isRoot) {
13208             state.parent.node[state.key] = x;
13209           }
13210           state.node = x;
13211         },
13212         delete: function() {
13213           delete state.parent.node[state.key];
13214         },
13215         remove: function() {
13216           if (Array.isArray(state.parent.node)) {
13217             state.parent.node.splice(state.key, 1);
13218           } else {
13219             delete state.parent.node[state.key];
13220           }
13221         },
13222         before: function(f) {
13223           modifiers.before = f;
13224         },
13225         after: function(f) {
13226           modifiers.after = f;
13227         },
13228         pre: function(f) {
13229           modifiers.pre = f;
13230         },
13231         post: function(f) {
13232           modifiers.post = f;
13233         },
13234         stop: function() {
13235           alive = false;
13236         }
13237       };
13238       if (!alive)
13239         return state;
13240       if (typeof node === "object" && node !== null) {
13241         state.isLeaf = Object.keys(node).length == 0;
13242         for (var i = 0; i < parents.length; i++) {
13243           if (parents[i].node_ === node_) {
13244             state.circular = parents[i];
13245             break;
13246           }
13247         }
13248       } else {
13249         state.isLeaf = true;
13250       }
13251       state.notLeaf = !state.isLeaf;
13252       state.notRoot = !state.isRoot;
13253       var ret2 = cb.call(state, state.node);
13254       if (ret2 !== void 0 && state.update)
13255         state.update(ret2);
13256       if (modifiers.before)
13257         modifiers.before.call(state, state.node);
13258       if (typeof state.node == "object" && state.node !== null && !state.circular) {
13259         parents.push(state);
13260         var keys = Object.keys(state.node);
13261         keys.forEach(function(key, i2) {
13262           path.push(key);
13263           if (modifiers.pre)
13264             modifiers.pre.call(state, state.node[key], key);
13265           var child = walker(state.node[key]);
13266           if (immutable && Object.hasOwnProperty.call(state.node, key)) {
13267             state.node[key] = child.node;
13268           }
13269           child.isLast = i2 == keys.length - 1;
13270           child.isFirst = i2 == 0;
13271           if (modifiers.post)
13272             modifiers.post.call(state, child);
13273           path.pop();
13274         });
13275         parents.pop();
13276       }
13277       if (modifiers.after)
13278         modifiers.after.call(state, state.node);
13279       return state;
13280     }(root).node;
13281   }
13282   Object.keys(Traverse.prototype).forEach(function(key) {
13283     Traverse[key] = function(obj) {
13284       var args = [].slice.call(arguments, 1);
13285       var t = Traverse(obj);
13286       return t[key].apply(t, args);
13287     };
13288   });
13289   function copy(src) {
13290     if (typeof src === "object" && src !== null) {
13291       var dst;
13292       if (Array.isArray(src)) {
13293         dst = [];
13294       } else if (src instanceof Date) {
13295         dst = new Date(src);
13296       } else if (src instanceof Boolean) {
13297         dst = new Boolean(src);
13298       } else if (src instanceof Number) {
13299         dst = new Number(src);
13300       } else if (src instanceof String) {
13301         dst = new String(src);
13302       } else {
13303         dst = Object.create(Object.getPrototypeOf(src));
13304       }
13305       Object.keys(src).forEach(function(key) {
13306         dst[key] = src[key];
13307       });
13308       return dst;
13309     } else
13310       return src;
13311   }
13312 });
13313
13314 // node_modules/chainsaw/index.js
13315 var require_chainsaw = __commonJS((exports2, module2) => {
13316   var Traverse = require_traverse();
13317   var EventEmitter = require("events").EventEmitter;
13318   module2.exports = Chainsaw;
13319   function Chainsaw(builder) {
13320     var saw = Chainsaw.saw(builder, {});
13321     var r = builder.call(saw.handlers, saw);
13322     if (r !== void 0)
13323       saw.handlers = r;
13324     saw.record();
13325     return saw.chain();
13326   }
13327   Chainsaw.light = function ChainsawLight(builder) {
13328     var saw = Chainsaw.saw(builder, {});
13329     var r = builder.call(saw.handlers, saw);
13330     if (r !== void 0)
13331       saw.handlers = r;
13332     return saw.chain();
13333   };
13334   Chainsaw.saw = function(builder, handlers) {
13335     var saw = new EventEmitter();
13336     saw.handlers = handlers;
13337     saw.actions = [];
13338     saw.chain = function() {
13339       var ch = Traverse(saw.handlers).map(function(node) {
13340         if (this.isRoot)
13341           return node;
13342         var ps = this.path;
13343         if (typeof node === "function") {
13344           this.update(function() {
13345             saw.actions.push({
13346               path: ps,
13347               args: [].slice.call(arguments)
13348             });
13349             return ch;
13350           });
13351         }
13352       });
13353       process.nextTick(function() {
13354         saw.emit("begin");
13355         saw.next();
13356       });
13357       return ch;
13358     };
13359     saw.pop = function() {
13360       return saw.actions.shift();
13361     };
13362     saw.next = function() {
13363       var action = saw.pop();
13364       if (!action) {
13365         saw.emit("end");
13366       } else if (!action.trap) {
13367         var node = saw.handlers;
13368         action.path.forEach(function(key) {
13369           node = node[key];
13370         });
13371         node.apply(saw.handlers, action.args);
13372       }
13373     };
13374     saw.nest = function(cb) {
13375       var args = [].slice.call(arguments, 1);
13376       var autonext = true;
13377       if (typeof cb === "boolean") {
13378         var autonext = cb;
13379         cb = args.shift();
13380       }
13381       var s = Chainsaw.saw(builder, {});
13382       var r = builder.call(s.handlers, s);
13383       if (r !== void 0)
13384         s.handlers = r;
13385       if (typeof saw.step !== "undefined") {
13386         s.record();
13387       }
13388       cb.apply(s.chain(), args);
13389       if (autonext !== false)
13390         s.on("end", saw.next);
13391     };
13392     saw.record = function() {
13393       upgradeChainsaw(saw);
13394     };
13395     ["trap", "down", "jump"].forEach(function(method) {
13396       saw[method] = function() {
13397         throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.");
13398       };
13399     });
13400     return saw;
13401   };
13402   function upgradeChainsaw(saw) {
13403     saw.step = 0;
13404     saw.pop = function() {
13405       return saw.actions[saw.step++];
13406     };
13407     saw.trap = function(name, cb) {
13408       var ps = Array.isArray(name) ? name : [name];
13409       saw.actions.push({
13410         path: ps,
13411         step: saw.step,
13412         cb,
13413         trap: true
13414       });
13415     };
13416     saw.down = function(name) {
13417       var ps = (Array.isArray(name) ? name : [name]).join("/");
13418       var i = saw.actions.slice(saw.step).map(function(x) {
13419         if (x.trap && x.step <= saw.step)
13420           return false;
13421         return x.path.join("/") == ps;
13422       }).indexOf(true);
13423       if (i >= 0)
13424         saw.step += i;
13425       else
13426         saw.step = saw.actions.length;
13427       var act = saw.actions[saw.step - 1];
13428       if (act && act.trap) {
13429         saw.step = act.step;
13430         act.cb();
13431       } else
13432         saw.next();
13433     };
13434     saw.jump = function(step) {
13435       saw.step = step;
13436       saw.next();
13437     };
13438   }
13439 });
13440
13441 // node_modules/buffers/index.js
13442 var require_buffers = __commonJS((exports2, module2) => {
13443   module2.exports = Buffers;
13444   function Buffers(bufs) {
13445     if (!(this instanceof Buffers))
13446       return new Buffers(bufs);
13447     this.buffers = bufs || [];
13448     this.length = this.buffers.reduce(function(size, buf) {
13449       return size + buf.length;
13450     }, 0);
13451   }
13452   Buffers.prototype.push = function() {
13453     for (var i = 0; i < arguments.length; i++) {
13454       if (!Buffer.isBuffer(arguments[i])) {
13455         throw new TypeError("Tried to push a non-buffer");
13456       }
13457     }
13458     for (var i = 0; i < arguments.length; i++) {
13459       var buf = arguments[i];
13460       this.buffers.push(buf);
13461       this.length += buf.length;
13462     }
13463     return this.length;
13464   };
13465   Buffers.prototype.unshift = function() {
13466     for (var i = 0; i < arguments.length; i++) {
13467       if (!Buffer.isBuffer(arguments[i])) {
13468         throw new TypeError("Tried to unshift a non-buffer");
13469       }
13470     }
13471     for (var i = 0; i < arguments.length; i++) {
13472       var buf = arguments[i];
13473       this.buffers.unshift(buf);
13474       this.length += buf.length;
13475     }
13476     return this.length;
13477   };
13478   Buffers.prototype.copy = function(dst, dStart, start, end) {
13479     return this.slice(start, end).copy(dst, dStart, 0, end - start);
13480   };
13481   Buffers.prototype.splice = function(i, howMany) {
13482     var buffers = this.buffers;
13483     var index = i >= 0 ? i : this.length - i;
13484     var reps = [].slice.call(arguments, 2);
13485     if (howMany === void 0) {
13486       howMany = this.length - index;
13487     } else if (howMany > this.length - index) {
13488       howMany = this.length - index;
13489     }
13490     for (var i = 0; i < reps.length; i++) {
13491       this.length += reps[i].length;
13492     }
13493     var removed = new Buffers();
13494     var bytes = 0;
13495     var startBytes = 0;
13496     for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index; ii++) {
13497       startBytes += buffers[ii].length;
13498     }
13499     if (index - startBytes > 0) {
13500       var start = index - startBytes;
13501       if (start + howMany < buffers[ii].length) {
13502         removed.push(buffers[ii].slice(start, start + howMany));
13503         var orig = buffers[ii];
13504         var buf0 = new Buffer(start);
13505         for (var i = 0; i < start; i++) {
13506           buf0[i] = orig[i];
13507         }
13508         var buf1 = new Buffer(orig.length - start - howMany);
13509         for (var i = start + howMany; i < orig.length; i++) {
13510           buf1[i - howMany - start] = orig[i];
13511         }
13512         if (reps.length > 0) {
13513           var reps_ = reps.slice();
13514           reps_.unshift(buf0);
13515           reps_.push(buf1);
13516           buffers.splice.apply(buffers, [ii, 1].concat(reps_));
13517           ii += reps_.length;
13518           reps = [];
13519         } else {
13520           buffers.splice(ii, 1, buf0, buf1);
13521           ii += 2;
13522         }
13523       } else {
13524         removed.push(buffers[ii].slice(start));
13525         buffers[ii] = buffers[ii].slice(0, start);
13526         ii++;
13527       }
13528     }
13529     if (reps.length > 0) {
13530       buffers.splice.apply(buffers, [ii, 0].concat(reps));
13531       ii += reps.length;
13532     }
13533     while (removed.length < howMany) {
13534       var buf = buffers[ii];
13535       var len = buf.length;
13536       var take = Math.min(len, howMany - removed.length);
13537       if (take === len) {
13538         removed.push(buf);
13539         buffers.splice(ii, 1);
13540       } else {
13541         removed.push(buf.slice(0, take));
13542         buffers[ii] = buffers[ii].slice(take);
13543       }
13544     }
13545     this.length -= removed.length;
13546     return removed;
13547   };
13548   Buffers.prototype.slice = function(i, j) {
13549     var buffers = this.buffers;
13550     if (j === void 0)
13551       j = this.length;
13552     if (i === void 0)
13553       i = 0;
13554     if (j > this.length)
13555       j = this.length;
13556     var startBytes = 0;
13557     for (var si = 0; si < buffers.length && startBytes + buffers[si].length <= i; si++) {
13558       startBytes += buffers[si].length;
13559     }
13560     var target = new Buffer(j - i);
13561     var ti = 0;
13562     for (var ii = si; ti < j - i && ii < buffers.length; ii++) {
13563       var len = buffers[ii].length;
13564       var start = ti === 0 ? i - startBytes : 0;
13565       var end = ti + len >= j - i ? Math.min(start + (j - i) - ti, len) : len;
13566       buffers[ii].copy(target, ti, start, end);
13567       ti += end - start;
13568     }
13569     return target;
13570   };
13571   Buffers.prototype.pos = function(i) {
13572     if (i < 0 || i >= this.length)
13573       throw new Error("oob");
13574     var l = i, bi = 0, bu = null;
13575     for (; ; ) {
13576       bu = this.buffers[bi];
13577       if (l < bu.length) {
13578         return {buf: bi, offset: l};
13579       } else {
13580         l -= bu.length;
13581       }
13582       bi++;
13583     }
13584   };
13585   Buffers.prototype.get = function get(i) {
13586     var pos = this.pos(i);
13587     return this.buffers[pos.buf].get(pos.offset);
13588   };
13589   Buffers.prototype.set = function set(i, b) {
13590     var pos = this.pos(i);
13591     return this.buffers[pos.buf].set(pos.offset, b);
13592   };
13593   Buffers.prototype.indexOf = function(needle, offset) {
13594     if (typeof needle === "string") {
13595       needle = new Buffer(needle);
13596     } else if (needle instanceof Buffer) {
13597     } else {
13598       throw new Error("Invalid type for a search string");
13599     }
13600     if (!needle.length) {
13601       return 0;
13602     }
13603     if (!this.length) {
13604       return -1;
13605     }
13606     var i = 0, j = 0, match = 0, mstart, pos = 0;
13607     if (offset) {
13608       var p = this.pos(offset);
13609       i = p.buf;
13610       j = p.offset;
13611       pos = offset;
13612     }
13613     for (; ; ) {
13614       while (j >= this.buffers[i].length) {
13615         j = 0;
13616         i++;
13617         if (i >= this.buffers.length) {
13618           return -1;
13619         }
13620       }
13621       var char = this.buffers[i][j];
13622       if (char == needle[match]) {
13623         if (match == 0) {
13624           mstart = {
13625             i,
13626             j,
13627             pos
13628           };
13629         }
13630         match++;
13631         if (match == needle.length) {
13632           return mstart.pos;
13633         }
13634       } else if (match != 0) {
13635         i = mstart.i;
13636         j = mstart.j;
13637         pos = mstart.pos;
13638         match = 0;
13639       }
13640       j++;
13641       pos++;
13642     }
13643   };
13644   Buffers.prototype.toBuffer = function() {
13645     return this.slice();
13646   };
13647   Buffers.prototype.toString = function(encoding, start, end) {
13648     return this.slice(start, end).toString(encoding);
13649   };
13650 });
13651
13652 // node_modules/binary/lib/vars.js
13653 var require_vars = __commonJS((exports2, module2) => {
13654   module2.exports = function(store) {
13655     function getset(name, value) {
13656       var node = vars.store;
13657       var keys = name.split(".");
13658       keys.slice(0, -1).forEach(function(k) {
13659         if (node[k] === void 0)
13660           node[k] = {};
13661         node = node[k];
13662       });
13663       var key = keys[keys.length - 1];
13664       if (arguments.length == 1) {
13665         return node[key];
13666       } else {
13667         return node[key] = value;
13668       }
13669     }
13670     var vars = {
13671       get: function(name) {
13672         return getset(name);
13673       },
13674       set: function(name, value) {
13675         return getset(name, value);
13676       },
13677       store: store || {}
13678     };
13679     return vars;
13680   };
13681 });
13682
13683 // node_modules/binary/index.js
13684 var require_binary = __commonJS((exports2, module2) => {
13685   var Chainsaw = require_chainsaw();
13686   var EventEmitter = require("events").EventEmitter;
13687   var Buffers = require_buffers();
13688   var Vars = require_vars();
13689   var Stream = require("stream").Stream;
13690   exports2 = module2.exports = function(bufOrEm, eventName) {
13691     if (Buffer.isBuffer(bufOrEm)) {
13692       return exports2.parse(bufOrEm);
13693     }
13694     var s = exports2.stream();
13695     if (bufOrEm && bufOrEm.pipe) {
13696       bufOrEm.pipe(s);
13697     } else if (bufOrEm) {
13698       bufOrEm.on(eventName || "data", function(buf) {
13699         s.write(buf);
13700       });
13701       bufOrEm.on("end", function() {
13702         s.end();
13703       });
13704     }
13705     return s;
13706   };
13707   exports2.stream = function(input) {
13708     if (input)
13709       return exports2.apply(null, arguments);
13710     var pending = null;
13711     function getBytes(bytes, cb, skip) {
13712       pending = {
13713         bytes,
13714         skip,
13715         cb: function(buf) {
13716           pending = null;
13717           cb(buf);
13718         }
13719       };
13720       dispatch();
13721     }
13722     var offset = null;
13723     function dispatch() {
13724       if (!pending) {
13725         if (caughtEnd)
13726           done = true;
13727         return;
13728       }
13729       if (typeof pending === "function") {
13730         pending();
13731       } else {
13732         var bytes = offset + pending.bytes;
13733         if (buffers.length >= bytes) {
13734           var buf;
13735           if (offset == null) {
13736             buf = buffers.splice(0, bytes);
13737             if (!pending.skip) {
13738               buf = buf.slice();
13739             }
13740           } else {
13741             if (!pending.skip) {
13742               buf = buffers.slice(offset, bytes);
13743             }
13744             offset = bytes;
13745           }
13746           if (pending.skip) {
13747             pending.cb();
13748           } else {
13749             pending.cb(buf);
13750           }
13751         }
13752       }
13753     }
13754     function builder(saw) {
13755       function next() {
13756         if (!done)
13757           saw.next();
13758       }
13759       var self2 = words(function(bytes, cb) {
13760         return function(name) {
13761           getBytes(bytes, function(buf) {
13762             vars.set(name, cb(buf));
13763             next();
13764           });
13765         };
13766       });
13767       self2.tap = function(cb) {
13768         saw.nest(cb, vars.store);
13769       };
13770       self2.into = function(key, cb) {
13771         if (!vars.get(key))
13772           vars.set(key, {});
13773         var parent = vars;
13774         vars = Vars(parent.get(key));
13775         saw.nest(function() {
13776           cb.apply(this, arguments);
13777           this.tap(function() {
13778             vars = parent;
13779           });
13780         }, vars.store);
13781       };
13782       self2.flush = function() {
13783         vars.store = {};
13784         next();
13785       };
13786       self2.loop = function(cb) {
13787         var end = false;
13788         saw.nest(false, function loop() {
13789           this.vars = vars.store;
13790           cb.call(this, function() {
13791             end = true;
13792             next();
13793           }, vars.store);
13794           this.tap(function() {
13795             if (end)
13796               saw.next();
13797             else
13798               loop.call(this);
13799           }.bind(this));
13800         }, vars.store);
13801       };
13802       self2.buffer = function(name, bytes) {
13803         if (typeof bytes === "string") {
13804           bytes = vars.get(bytes);
13805         }
13806         getBytes(bytes, function(buf) {
13807           vars.set(name, buf);
13808           next();
13809         });
13810       };
13811       self2.skip = function(bytes) {
13812         if (typeof bytes === "string") {
13813           bytes = vars.get(bytes);
13814         }
13815         getBytes(bytes, function() {
13816           next();
13817         });
13818       };
13819       self2.scan = function find(name, search) {
13820         if (typeof search === "string") {
13821           search = new Buffer(search);
13822         } else if (!Buffer.isBuffer(search)) {
13823           throw new Error("search must be a Buffer or a string");
13824         }
13825         var taken = 0;
13826         pending = function() {
13827           var pos = buffers.indexOf(search, offset + taken);
13828           var i = pos - offset - taken;
13829           if (pos !== -1) {
13830             pending = null;
13831             if (offset != null) {
13832               vars.set(name, buffers.slice(offset, offset + taken + i));
13833               offset += taken + i + search.length;
13834             } else {
13835               vars.set(name, buffers.slice(0, taken + i));
13836               buffers.splice(0, taken + i + search.length);
13837             }
13838             next();
13839             dispatch();
13840           } else {
13841             i = Math.max(buffers.length - search.length - offset - taken, 0);
13842           }
13843           taken += i;
13844         };
13845         dispatch();
13846       };
13847       self2.peek = function(cb) {
13848         offset = 0;
13849         saw.nest(function() {
13850           cb.call(this, vars.store);
13851           this.tap(function() {
13852             offset = null;
13853           });
13854         });
13855       };
13856       return self2;
13857     }
13858     ;
13859     var stream = Chainsaw.light(builder);
13860     stream.writable = true;
13861     var buffers = Buffers();
13862     stream.write = function(buf) {
13863       buffers.push(buf);
13864       dispatch();
13865     };
13866     var vars = Vars();
13867     var done = false, caughtEnd = false;
13868     stream.end = function() {
13869       caughtEnd = true;
13870     };
13871     stream.pipe = Stream.prototype.pipe;
13872     Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) {
13873       stream[name] = EventEmitter.prototype[name];
13874     });
13875     return stream;
13876   };
13877   exports2.parse = function parse(buffer) {
13878     var self2 = words(function(bytes, cb) {
13879       return function(name) {
13880         if (offset + bytes <= buffer.length) {
13881           var buf = buffer.slice(offset, offset + bytes);
13882           offset += bytes;
13883           vars.set(name, cb(buf));
13884         } else {
13885           vars.set(name, null);
13886         }
13887         return self2;
13888       };
13889     });
13890     var offset = 0;
13891     var vars = Vars();
13892     self2.vars = vars.store;
13893     self2.tap = function(cb) {
13894       cb.call(self2, vars.store);
13895       return self2;
13896     };
13897     self2.into = function(key, cb) {
13898       if (!vars.get(key)) {
13899         vars.set(key, {});
13900       }
13901       var parent = vars;
13902       vars = Vars(parent.get(key));
13903       cb.call(self2, vars.store);
13904       vars = parent;
13905       return self2;
13906     };
13907     self2.loop = function(cb) {
13908       var end = false;
13909       var ender = function() {
13910         end = true;
13911       };
13912       while (end === false) {
13913         cb.call(self2, ender, vars.store);
13914       }
13915       return self2;
13916     };
13917     self2.buffer = function(name, size) {
13918       if (typeof size === "string") {
13919         size = vars.get(size);
13920       }
13921       var buf = buffer.slice(offset, Math.min(buffer.length, offset + size));
13922       offset += size;
13923       vars.set(name, buf);
13924       return self2;
13925     };
13926     self2.skip = function(bytes) {
13927       if (typeof bytes === "string") {
13928         bytes = vars.get(bytes);
13929       }
13930       offset += bytes;
13931       return self2;
13932     };
13933     self2.scan = function(name, search) {
13934       if (typeof search === "string") {
13935         search = new Buffer(search);
13936       } else if (!Buffer.isBuffer(search)) {
13937         throw new Error("search must be a Buffer or a string");
13938       }
13939       vars.set(name, null);
13940       for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) {
13941         for (var j = 0; j < search.length && buffer[offset + i + j] === search[j]; j++)
13942           ;
13943         if (j === search.length)
13944           break;
13945       }
13946       vars.set(name, buffer.slice(offset, offset + i));
13947       offset += i + search.length;
13948       return self2;
13949     };
13950     self2.peek = function(cb) {
13951       var was = offset;
13952       cb.call(self2, vars.store);
13953       offset = was;
13954       return self2;
13955     };
13956     self2.flush = function() {
13957       vars.store = {};
13958       return self2;
13959     };
13960     self2.eof = function() {
13961       return offset >= buffer.length;
13962     };
13963     return self2;
13964   };
13965   function decodeLEu(bytes) {
13966     var acc = 0;
13967     for (var i = 0; i < bytes.length; i++) {
13968       acc += Math.pow(256, i) * bytes[i];
13969     }
13970     return acc;
13971   }
13972   function decodeBEu(bytes) {
13973     var acc = 0;
13974     for (var i = 0; i < bytes.length; i++) {
13975       acc += Math.pow(256, bytes.length - i - 1) * bytes[i];
13976     }
13977     return acc;
13978   }
13979   function decodeBEs(bytes) {
13980     var val = decodeBEu(bytes);
13981     if ((bytes[0] & 128) == 128) {
13982       val -= Math.pow(256, bytes.length);
13983     }
13984     return val;
13985   }
13986   function decodeLEs(bytes) {
13987     var val = decodeLEu(bytes);
13988     if ((bytes[bytes.length - 1] & 128) == 128) {
13989       val -= Math.pow(256, bytes.length);
13990     }
13991     return val;
13992   }
13993   function words(decode) {
13994     var self2 = {};
13995     [1, 2, 4, 8].forEach(function(bytes) {
13996       var bits = bytes * 8;
13997       self2["word" + bits + "le"] = self2["word" + bits + "lu"] = decode(bytes, decodeLEu);
13998       self2["word" + bits + "ls"] = decode(bytes, decodeLEs);
13999       self2["word" + bits + "be"] = self2["word" + bits + "bu"] = decode(bytes, decodeBEu);
14000       self2["word" + bits + "bs"] = decode(bytes, decodeBEs);
14001     });
14002     self2.word8 = self2.word8u = self2.word8be;
14003     self2.word8s = self2.word8bs;
14004     return self2;
14005   }
14006 });
14007
14008 // node_modules/bluebird/js/release/es5.js
14009 var require_es5 = __commonJS((exports2, module2) => {
14010   var isES5 = function() {
14011     "use strict";
14012     return this === void 0;
14013   }();
14014   if (isES5) {
14015     module2.exports = {
14016       freeze: Object.freeze,
14017       defineProperty: Object.defineProperty,
14018       getDescriptor: Object.getOwnPropertyDescriptor,
14019       keys: Object.keys,
14020       names: Object.getOwnPropertyNames,
14021       getPrototypeOf: Object.getPrototypeOf,
14022       isArray: Array.isArray,
14023       isES5,
14024       propertyIsWritable: function(obj, prop) {
14025         var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
14026         return !!(!descriptor || descriptor.writable || descriptor.set);
14027       }
14028     };
14029   } else {
14030     has = {}.hasOwnProperty;
14031     str = {}.toString;
14032     proto = {}.constructor.prototype;
14033     ObjectKeys = function(o) {
14034       var ret2 = [];
14035       for (var key in o) {
14036         if (has.call(o, key)) {
14037           ret2.push(key);
14038         }
14039       }
14040       return ret2;
14041     };
14042     ObjectGetDescriptor = function(o, key) {
14043       return {value: o[key]};
14044     };
14045     ObjectDefineProperty = function(o, key, desc) {
14046       o[key] = desc.value;
14047       return o;
14048     };
14049     ObjectFreeze = function(obj) {
14050       return obj;
14051     };
14052     ObjectGetPrototypeOf = function(obj) {
14053       try {
14054         return Object(obj).constructor.prototype;
14055       } catch (e) {
14056         return proto;
14057       }
14058     };
14059     ArrayIsArray = function(obj) {
14060       try {
14061         return str.call(obj) === "[object Array]";
14062       } catch (e) {
14063         return false;
14064       }
14065     };
14066     module2.exports = {
14067       isArray: ArrayIsArray,
14068       keys: ObjectKeys,
14069       names: ObjectKeys,
14070       defineProperty: ObjectDefineProperty,
14071       getDescriptor: ObjectGetDescriptor,
14072       freeze: ObjectFreeze,
14073       getPrototypeOf: ObjectGetPrototypeOf,
14074       isES5,
14075       propertyIsWritable: function() {
14076         return true;
14077       }
14078     };
14079   }
14080   var has;
14081   var str;
14082   var proto;
14083   var ObjectKeys;
14084   var ObjectGetDescriptor;
14085   var ObjectDefineProperty;
14086   var ObjectFreeze;
14087   var ObjectGetPrototypeOf;
14088   var ArrayIsArray;
14089 });
14090
14091 // node_modules/bluebird/js/release/util.js
14092 var require_util = __commonJS((exports, module) => {
14093   "use strict";
14094   var es5 = require_es5();
14095   var canEvaluate = typeof navigator == "undefined";
14096   var errorObj = {e: {}};
14097   var tryCatchTarget;
14098   var globalObject = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : exports !== void 0 ? exports : null;
14099   function tryCatcher() {
14100     try {
14101       var target = tryCatchTarget;
14102       tryCatchTarget = null;
14103       return target.apply(this, arguments);
14104     } catch (e) {
14105       errorObj.e = e;
14106       return errorObj;
14107     }
14108   }
14109   function tryCatch(fn) {
14110     tryCatchTarget = fn;
14111     return tryCatcher;
14112   }
14113   var inherits = function(Child, Parent) {
14114     var hasProp = {}.hasOwnProperty;
14115     function T() {
14116       this.constructor = Child;
14117       this.constructor$ = Parent;
14118       for (var propertyName in Parent.prototype) {
14119         if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length - 1) !== "$") {
14120           this[propertyName + "$"] = Parent.prototype[propertyName];
14121         }
14122       }
14123     }
14124     T.prototype = Parent.prototype;
14125     Child.prototype = new T();
14126     return Child.prototype;
14127   };
14128   function isPrimitive(val) {
14129     return val == null || val === true || val === false || typeof val === "string" || typeof val === "number";
14130   }
14131   function isObject(value) {
14132     return typeof value === "function" || typeof value === "object" && value !== null;
14133   }
14134   function maybeWrapAsError(maybeError) {
14135     if (!isPrimitive(maybeError))
14136       return maybeError;
14137     return new Error(safeToString(maybeError));
14138   }
14139   function withAppended(target, appendee) {
14140     var len = target.length;
14141     var ret2 = new Array(len + 1);
14142     var i;
14143     for (i = 0; i < len; ++i) {
14144       ret2[i] = target[i];
14145     }
14146     ret2[i] = appendee;
14147     return ret2;
14148   }
14149   function getDataPropertyOrDefault(obj, key, defaultValue) {
14150     if (es5.isES5) {
14151       var desc = Object.getOwnPropertyDescriptor(obj, key);
14152       if (desc != null) {
14153         return desc.get == null && desc.set == null ? desc.value : defaultValue;
14154       }
14155     } else {
14156       return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0;
14157     }
14158   }
14159   function notEnumerableProp(obj, name, value) {
14160     if (isPrimitive(obj))
14161       return obj;
14162     var descriptor = {
14163       value,
14164       configurable: true,
14165       enumerable: false,
14166       writable: true
14167     };
14168     es5.defineProperty(obj, name, descriptor);
14169     return obj;
14170   }
14171   function thrower(r) {
14172     throw r;
14173   }
14174   var inheritedDataKeys = function() {
14175     var excludedPrototypes = [
14176       Array.prototype,
14177       Object.prototype,
14178       Function.prototype
14179     ];
14180     var isExcludedProto = function(val) {
14181       for (var i = 0; i < excludedPrototypes.length; ++i) {
14182         if (excludedPrototypes[i] === val) {
14183           return true;
14184         }
14185       }
14186       return false;
14187     };
14188     if (es5.isES5) {
14189       var getKeys = Object.getOwnPropertyNames;
14190       return function(obj) {
14191         var ret2 = [];
14192         var visitedKeys = Object.create(null);
14193         while (obj != null && !isExcludedProto(obj)) {
14194           var keys;
14195           try {
14196             keys = getKeys(obj);
14197           } catch (e) {
14198             return ret2;
14199           }
14200           for (var i = 0; i < keys.length; ++i) {
14201             var key = keys[i];
14202             if (visitedKeys[key])
14203               continue;
14204             visitedKeys[key] = true;
14205             var desc = Object.getOwnPropertyDescriptor(obj, key);
14206             if (desc != null && desc.get == null && desc.set == null) {
14207               ret2.push(key);
14208             }
14209           }
14210           obj = es5.getPrototypeOf(obj);
14211         }
14212         return ret2;
14213       };
14214     } else {
14215       var hasProp = {}.hasOwnProperty;
14216       return function(obj) {
14217         if (isExcludedProto(obj))
14218           return [];
14219         var ret2 = [];
14220         enumeration:
14221           for (var key in obj) {
14222             if (hasProp.call(obj, key)) {
14223               ret2.push(key);
14224             } else {
14225               for (var i = 0; i < excludedPrototypes.length; ++i) {
14226                 if (hasProp.call(excludedPrototypes[i], key)) {
14227                   continue enumeration;
14228                 }
14229               }
14230               ret2.push(key);
14231             }
14232           }
14233         return ret2;
14234       };
14235     }
14236   }();
14237   var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
14238   function isClass(fn) {
14239     try {
14240       if (typeof fn === "function") {
14241         var keys = es5.names(fn.prototype);
14242         var hasMethods = es5.isES5 && keys.length > 1;
14243         var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor");
14244         var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;
14245         if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) {
14246           return true;
14247         }
14248       }
14249       return false;
14250     } catch (e) {
14251       return false;
14252     }
14253   }
14254   function toFastProperties(obj) {
14255     function FakeConstructor() {
14256     }
14257     FakeConstructor.prototype = obj;
14258     var l = 8;
14259     while (l--)
14260       new FakeConstructor();
14261     return obj;
14262     eval(obj);
14263   }
14264   var rident = /^[a-z$_][a-z$_0-9]*$/i;
14265   function isIdentifier(str) {
14266     return rident.test(str);
14267   }
14268   function filledRange(count, prefix, suffix) {
14269     var ret2 = new Array(count);
14270     for (var i = 0; i < count; ++i) {
14271       ret2[i] = prefix + i + suffix;
14272     }
14273     return ret2;
14274   }
14275   function safeToString(obj) {
14276     try {
14277       return obj + "";
14278     } catch (e) {
14279       return "[no string representation]";
14280     }
14281   }
14282   function isError(obj) {
14283     return obj !== null && typeof obj === "object" && typeof obj.message === "string" && typeof obj.name === "string";
14284   }
14285   function markAsOriginatingFromRejection(e) {
14286     try {
14287       notEnumerableProp(e, "isOperational", true);
14288     } catch (ignore) {
14289     }
14290   }
14291   function originatesFromRejection(e) {
14292     if (e == null)
14293       return false;
14294     return e instanceof Error["__BluebirdErrorTypes__"].OperationalError || e["isOperational"] === true;
14295   }
14296   function canAttachTrace(obj) {
14297     return isError(obj) && es5.propertyIsWritable(obj, "stack");
14298   }
14299   var ensureErrorObject = function() {
14300     if (!("stack" in new Error())) {
14301       return function(value) {
14302         if (canAttachTrace(value))
14303           return value;
14304         try {
14305           throw new Error(safeToString(value));
14306         } catch (err) {
14307           return err;
14308         }
14309       };
14310     } else {
14311       return function(value) {
14312         if (canAttachTrace(value))
14313           return value;
14314         return new Error(safeToString(value));
14315       };
14316     }
14317   }();
14318   function classString(obj) {
14319     return {}.toString.call(obj);
14320   }
14321   function copyDescriptors(from, to, filter) {
14322     var keys = es5.names(from);
14323     for (var i = 0; i < keys.length; ++i) {
14324       var key = keys[i];
14325       if (filter(key)) {
14326         try {
14327           es5.defineProperty(to, key, es5.getDescriptor(from, key));
14328         } catch (ignore) {
14329         }
14330       }
14331     }
14332   }
14333   var asArray = function(v) {
14334     if (es5.isArray(v)) {
14335       return v;
14336     }
14337     return null;
14338   };
14339   if (typeof Symbol !== "undefined" && Symbol.iterator) {
14340     ArrayFrom = typeof Array.from === "function" ? function(v) {
14341       return Array.from(v);
14342     } : function(v) {
14343       var ret2 = [];
14344       var it = v[Symbol.iterator]();
14345       var itResult;
14346       while (!(itResult = it.next()).done) {
14347         ret2.push(itResult.value);
14348       }
14349       return ret2;
14350     };
14351     asArray = function(v) {
14352       if (es5.isArray(v)) {
14353         return v;
14354       } else if (v != null && typeof v[Symbol.iterator] === "function") {
14355         return ArrayFrom(v);
14356       }
14357       return null;
14358     };
14359   }
14360   var ArrayFrom;
14361   var isNode = typeof process !== "undefined" && classString(process).toLowerCase() === "[object process]";
14362   var hasEnvVariables = typeof process !== "undefined" && typeof process.env !== "undefined";
14363   function env(key) {
14364     return hasEnvVariables ? process.env[key] : void 0;
14365   }
14366   function getNativePromise() {
14367     if (typeof Promise === "function") {
14368       try {
14369         var promise = new Promise(function() {
14370         });
14371         if ({}.toString.call(promise) === "[object Promise]") {
14372           return Promise;
14373         }
14374       } catch (e) {
14375       }
14376     }
14377   }
14378   function domainBind(self2, cb) {
14379     return self2.bind(cb);
14380   }
14381   var ret = {
14382     isClass,
14383     isIdentifier,
14384     inheritedDataKeys,
14385     getDataPropertyOrDefault,
14386     thrower,
14387     isArray: es5.isArray,
14388     asArray,
14389     notEnumerableProp,
14390     isPrimitive,
14391     isObject,
14392     isError,
14393     canEvaluate,
14394     errorObj,
14395     tryCatch,
14396     inherits,
14397     withAppended,
14398     maybeWrapAsError,
14399     toFastProperties,
14400     filledRange,
14401     toString: safeToString,
14402     canAttachTrace,
14403     ensureErrorObject,
14404     originatesFromRejection,
14405     markAsOriginatingFromRejection,
14406     classString,
14407     copyDescriptors,
14408     hasDevTools: typeof chrome !== "undefined" && chrome && typeof chrome.loadTimes === "function",
14409     isNode,
14410     hasEnvVariables,
14411     env,
14412     global: globalObject,
14413     getNativePromise,
14414     domainBind
14415   };
14416   ret.isRecentNode = ret.isNode && function() {
14417     var version = process.versions.node.split(".").map(Number);
14418     return version[0] === 0 && version[1] > 10 || version[0] > 0;
14419   }();
14420   if (ret.isNode)
14421     ret.toFastProperties(process);
14422   try {
14423     throw new Error();
14424   } catch (e) {
14425     ret.lastLineError = e;
14426   }
14427   module.exports = ret;
14428 });
14429
14430 // node_modules/bluebird/js/release/schedule.js
14431 var require_schedule = __commonJS((exports2, module2) => {
14432   "use strict";
14433   var util = require_util();
14434   var schedule;
14435   var noAsyncScheduler = function() {
14436     throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");
14437   };
14438   var NativePromise = util.getNativePromise();
14439   if (util.isNode && typeof MutationObserver === "undefined") {
14440     GlobalSetImmediate = global.setImmediate;
14441     ProcessNextTick = process.nextTick;
14442     schedule = util.isRecentNode ? function(fn) {
14443       GlobalSetImmediate.call(global, fn);
14444     } : function(fn) {
14445       ProcessNextTick.call(process, fn);
14446     };
14447   } else if (typeof NativePromise === "function" && typeof NativePromise.resolve === "function") {
14448     nativePromise = NativePromise.resolve();
14449     schedule = function(fn) {
14450       nativePromise.then(fn);
14451     };
14452   } else if (typeof MutationObserver !== "undefined" && !(typeof window !== "undefined" && window.navigator && (window.navigator.standalone || window.cordova))) {
14453     schedule = function() {
14454       var div = document.createElement("div");
14455       var opts = {attributes: true};
14456       var toggleScheduled = false;
14457       var div2 = document.createElement("div");
14458       var o2 = new MutationObserver(function() {
14459         div.classList.toggle("foo");
14460         toggleScheduled = false;
14461       });
14462       o2.observe(div2, opts);
14463       var scheduleToggle = function() {
14464         if (toggleScheduled)
14465           return;
14466         toggleScheduled = true;
14467         div2.classList.toggle("foo");
14468       };
14469       return function schedule2(fn) {
14470         var o = new MutationObserver(function() {
14471           o.disconnect();
14472           fn();
14473         });
14474         o.observe(div, opts);
14475         scheduleToggle();
14476       };
14477     }();
14478   } else if (typeof setImmediate !== "undefined") {
14479     schedule = function(fn) {
14480       setImmediate(fn);
14481     };
14482   } else if (typeof setTimeout !== "undefined") {
14483     schedule = function(fn) {
14484       setTimeout(fn, 0);
14485     };
14486   } else {
14487     schedule = noAsyncScheduler;
14488   }
14489   var GlobalSetImmediate;
14490   var ProcessNextTick;
14491   var nativePromise;
14492   module2.exports = schedule;
14493 });
14494
14495 // node_modules/bluebird/js/release/queue.js
14496 var require_queue = __commonJS((exports2, module2) => {
14497   "use strict";
14498   function arrayMove(src, srcIndex, dst, dstIndex, len) {
14499     for (var j = 0; j < len; ++j) {
14500       dst[j + dstIndex] = src[j + srcIndex];
14501       src[j + srcIndex] = void 0;
14502     }
14503   }
14504   function Queue(capacity) {
14505     this._capacity = capacity;
14506     this._length = 0;
14507     this._front = 0;
14508   }
14509   Queue.prototype._willBeOverCapacity = function(size) {
14510     return this._capacity < size;
14511   };
14512   Queue.prototype._pushOne = function(arg) {
14513     var length = this.length();
14514     this._checkCapacity(length + 1);
14515     var i = this._front + length & this._capacity - 1;
14516     this[i] = arg;
14517     this._length = length + 1;
14518   };
14519   Queue.prototype.push = function(fn, receiver, arg) {
14520     var length = this.length() + 3;
14521     if (this._willBeOverCapacity(length)) {
14522       this._pushOne(fn);
14523       this._pushOne(receiver);
14524       this._pushOne(arg);
14525       return;
14526     }
14527     var j = this._front + length - 3;
14528     this._checkCapacity(length);
14529     var wrapMask = this._capacity - 1;
14530     this[j + 0 & wrapMask] = fn;
14531     this[j + 1 & wrapMask] = receiver;
14532     this[j + 2 & wrapMask] = arg;
14533     this._length = length;
14534   };
14535   Queue.prototype.shift = function() {
14536     var front = this._front, ret2 = this[front];
14537     this[front] = void 0;
14538     this._front = front + 1 & this._capacity - 1;
14539     this._length--;
14540     return ret2;
14541   };
14542   Queue.prototype.length = function() {
14543     return this._length;
14544   };
14545   Queue.prototype._checkCapacity = function(size) {
14546     if (this._capacity < size) {
14547       this._resizeTo(this._capacity << 1);
14548     }
14549   };
14550   Queue.prototype._resizeTo = function(capacity) {
14551     var oldCapacity = this._capacity;
14552     this._capacity = capacity;
14553     var front = this._front;
14554     var length = this._length;
14555     var moveItemsCount = front + length & oldCapacity - 1;
14556     arrayMove(this, 0, this, oldCapacity, moveItemsCount);
14557   };
14558   module2.exports = Queue;
14559 });
14560
14561 // node_modules/bluebird/js/release/async.js
14562 var require_async = __commonJS((exports2, module2) => {
14563   "use strict";
14564   var firstLineError;
14565   try {
14566     throw new Error();
14567   } catch (e) {
14568     firstLineError = e;
14569   }
14570   var schedule = require_schedule();
14571   var Queue = require_queue();
14572   var util = require_util();
14573   function Async() {
14574     this._customScheduler = false;
14575     this._isTickUsed = false;
14576     this._lateQueue = new Queue(16);
14577     this._normalQueue = new Queue(16);
14578     this._haveDrainedQueues = false;
14579     this._trampolineEnabled = true;
14580     var self2 = this;
14581     this.drainQueues = function() {
14582       self2._drainQueues();
14583     };
14584     this._schedule = schedule;
14585   }
14586   Async.prototype.setScheduler = function(fn) {
14587     var prev = this._schedule;
14588     this._schedule = fn;
14589     this._customScheduler = true;
14590     return prev;
14591   };
14592   Async.prototype.hasCustomScheduler = function() {
14593     return this._customScheduler;
14594   };
14595   Async.prototype.enableTrampoline = function() {
14596     this._trampolineEnabled = true;
14597   };
14598   Async.prototype.disableTrampolineIfNecessary = function() {
14599     if (util.hasDevTools) {
14600       this._trampolineEnabled = false;
14601     }
14602   };
14603   Async.prototype.haveItemsQueued = function() {
14604     return this._isTickUsed || this._haveDrainedQueues;
14605   };
14606   Async.prototype.fatalError = function(e, isNode2) {
14607     if (isNode2) {
14608       process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n");
14609       process.exit(2);
14610     } else {
14611       this.throwLater(e);
14612     }
14613   };
14614   Async.prototype.throwLater = function(fn, arg) {
14615     if (arguments.length === 1) {
14616       arg = fn;
14617       fn = function() {
14618         throw arg;
14619       };
14620     }
14621     if (typeof setTimeout !== "undefined") {
14622       setTimeout(function() {
14623         fn(arg);
14624       }, 0);
14625     } else
14626       try {
14627         this._schedule(function() {
14628           fn(arg);
14629         });
14630       } catch (e) {
14631         throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");
14632       }
14633   };
14634   function AsyncInvokeLater(fn, receiver, arg) {
14635     this._lateQueue.push(fn, receiver, arg);
14636     this._queueTick();
14637   }
14638   function AsyncInvoke(fn, receiver, arg) {
14639     this._normalQueue.push(fn, receiver, arg);
14640     this._queueTick();
14641   }
14642   function AsyncSettlePromises(promise) {
14643     this._normalQueue._pushOne(promise);
14644     this._queueTick();
14645   }
14646   if (!util.hasDevTools) {
14647     Async.prototype.invokeLater = AsyncInvokeLater;
14648     Async.prototype.invoke = AsyncInvoke;
14649     Async.prototype.settlePromises = AsyncSettlePromises;
14650   } else {
14651     Async.prototype.invokeLater = function(fn, receiver, arg) {
14652       if (this._trampolineEnabled) {
14653         AsyncInvokeLater.call(this, fn, receiver, arg);
14654       } else {
14655         this._schedule(function() {
14656           setTimeout(function() {
14657             fn.call(receiver, arg);
14658           }, 100);
14659         });
14660       }
14661     };
14662     Async.prototype.invoke = function(fn, receiver, arg) {
14663       if (this._trampolineEnabled) {
14664         AsyncInvoke.call(this, fn, receiver, arg);
14665       } else {
14666         this._schedule(function() {
14667           fn.call(receiver, arg);
14668         });
14669       }
14670     };
14671     Async.prototype.settlePromises = function(promise) {
14672       if (this._trampolineEnabled) {
14673         AsyncSettlePromises.call(this, promise);
14674       } else {
14675         this._schedule(function() {
14676           promise._settlePromises();
14677         });
14678       }
14679     };
14680   }
14681   Async.prototype._drainQueue = function(queue) {
14682     while (queue.length() > 0) {
14683       var fn = queue.shift();
14684       if (typeof fn !== "function") {
14685         fn._settlePromises();
14686         continue;
14687       }
14688       var receiver = queue.shift();
14689       var arg = queue.shift();
14690       fn.call(receiver, arg);
14691     }
14692   };
14693   Async.prototype._drainQueues = function() {
14694     this._drainQueue(this._normalQueue);
14695     this._reset();
14696     this._haveDrainedQueues = true;
14697     this._drainQueue(this._lateQueue);
14698   };
14699   Async.prototype._queueTick = function() {
14700     if (!this._isTickUsed) {
14701       this._isTickUsed = true;
14702       this._schedule(this.drainQueues);
14703     }
14704   };
14705   Async.prototype._reset = function() {
14706     this._isTickUsed = false;
14707   };
14708   module2.exports = Async;
14709   module2.exports.firstLineError = firstLineError;
14710 });
14711
14712 // node_modules/bluebird/js/release/errors.js
14713 var require_errors = __commonJS((exports2, module2) => {
14714   "use strict";
14715   var es52 = require_es5();
14716   var Objectfreeze = es52.freeze;
14717   var util = require_util();
14718   var inherits2 = util.inherits;
14719   var notEnumerableProp2 = util.notEnumerableProp;
14720   function subError(nameProperty, defaultMessage) {
14721     function SubError(message) {
14722       if (!(this instanceof SubError))
14723         return new SubError(message);
14724       notEnumerableProp2(this, "message", typeof message === "string" ? message : defaultMessage);
14725       notEnumerableProp2(this, "name", nameProperty);
14726       if (Error.captureStackTrace) {
14727         Error.captureStackTrace(this, this.constructor);
14728       } else {
14729         Error.call(this);
14730       }
14731     }
14732     inherits2(SubError, Error);
14733     return SubError;
14734   }
14735   var _TypeError;
14736   var _RangeError;
14737   var Warning = subError("Warning", "warning");
14738   var CancellationError = subError("CancellationError", "cancellation error");
14739   var TimeoutError = subError("TimeoutError", "timeout error");
14740   var AggregateError = subError("AggregateError", "aggregate error");
14741   try {
14742     _TypeError = TypeError;
14743     _RangeError = RangeError;
14744   } catch (e) {
14745     _TypeError = subError("TypeError", "type error");
14746     _RangeError = subError("RangeError", "range error");
14747   }
14748   var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");
14749   for (var i = 0; i < methods.length; ++i) {
14750     if (typeof Array.prototype[methods[i]] === "function") {
14751       AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];
14752     }
14753   }
14754   es52.defineProperty(AggregateError.prototype, "length", {
14755     value: 0,
14756     configurable: false,
14757     writable: true,
14758     enumerable: true
14759   });
14760   AggregateError.prototype["isOperational"] = true;
14761   var level = 0;
14762   AggregateError.prototype.toString = function() {
14763     var indent = Array(level * 4 + 1).join(" ");
14764     var ret2 = "\n" + indent + "AggregateError of:\n";
14765     level++;
14766     indent = Array(level * 4 + 1).join(" ");
14767     for (var i2 = 0; i2 < this.length; ++i2) {
14768       var str = this[i2] === this ? "[Circular AggregateError]" : this[i2] + "";
14769       var lines = str.split("\n");
14770       for (var j = 0; j < lines.length; ++j) {
14771         lines[j] = indent + lines[j];
14772       }
14773       str = lines.join("\n");
14774       ret2 += str + "\n";
14775     }
14776     level--;
14777     return ret2;
14778   };
14779   function OperationalError(message) {
14780     if (!(this instanceof OperationalError))
14781       return new OperationalError(message);
14782     notEnumerableProp2(this, "name", "OperationalError");
14783     notEnumerableProp2(this, "message", message);
14784     this.cause = message;
14785     this["isOperational"] = true;
14786     if (message instanceof Error) {
14787       notEnumerableProp2(this, "message", message.message);
14788       notEnumerableProp2(this, "stack", message.stack);
14789     } else if (Error.captureStackTrace) {
14790       Error.captureStackTrace(this, this.constructor);
14791     }
14792   }
14793   inherits2(OperationalError, Error);
14794   var errorTypes = Error["__BluebirdErrorTypes__"];
14795   if (!errorTypes) {
14796     errorTypes = Objectfreeze({
14797       CancellationError,
14798       TimeoutError,
14799       OperationalError,
14800       RejectionError: OperationalError,
14801       AggregateError
14802     });
14803     es52.defineProperty(Error, "__BluebirdErrorTypes__", {
14804       value: errorTypes,
14805       writable: false,
14806       enumerable: false,
14807       configurable: false
14808     });
14809   }
14810   module2.exports = {
14811     Error,
14812     TypeError: _TypeError,
14813     RangeError: _RangeError,
14814     CancellationError: errorTypes.CancellationError,
14815     OperationalError: errorTypes.OperationalError,
14816     TimeoutError: errorTypes.TimeoutError,
14817     AggregateError: errorTypes.AggregateError,
14818     Warning
14819   };
14820 });
14821
14822 // node_modules/bluebird/js/release/thenables.js
14823 var require_thenables = __commonJS((exports2, module2) => {
14824   "use strict";
14825   module2.exports = function(Promise2, INTERNAL) {
14826     var util = require_util();
14827     var errorObj2 = util.errorObj;
14828     var isObject3 = util.isObject;
14829     function tryConvertToPromise(obj, context) {
14830       if (isObject3(obj)) {
14831         if (obj instanceof Promise2)
14832           return obj;
14833         var then = getThen(obj);
14834         if (then === errorObj2) {
14835           if (context)
14836             context._pushContext();
14837           var ret2 = Promise2.reject(then.e);
14838           if (context)
14839             context._popContext();
14840           return ret2;
14841         } else if (typeof then === "function") {
14842           if (isAnyBluebirdPromise(obj)) {
14843             var ret2 = new Promise2(INTERNAL);
14844             obj._then(ret2._fulfill, ret2._reject, void 0, ret2, null);
14845             return ret2;
14846           }
14847           return doThenable(obj, then, context);
14848         }
14849       }
14850       return obj;
14851     }
14852     function doGetThen(obj) {
14853       return obj.then;
14854     }
14855     function getThen(obj) {
14856       try {
14857         return doGetThen(obj);
14858       } catch (e) {
14859         errorObj2.e = e;
14860         return errorObj2;
14861       }
14862     }
14863     var hasProp = {}.hasOwnProperty;
14864     function isAnyBluebirdPromise(obj) {
14865       try {
14866         return hasProp.call(obj, "_promise0");
14867       } catch (e) {
14868         return false;
14869       }
14870     }
14871     function doThenable(x, then, context) {
14872       var promise = new Promise2(INTERNAL);
14873       var ret2 = promise;
14874       if (context)
14875         context._pushContext();
14876       promise._captureStackTrace();
14877       if (context)
14878         context._popContext();
14879       var synchronous = true;
14880       var result = util.tryCatch(then).call(x, resolve, reject);
14881       synchronous = false;
14882       if (promise && result === errorObj2) {
14883         promise._rejectCallback(result.e, true, true);
14884         promise = null;
14885       }
14886       function resolve(value) {
14887         if (!promise)
14888           return;
14889         promise._resolveCallback(value);
14890         promise = null;
14891       }
14892       function reject(reason) {
14893         if (!promise)
14894           return;
14895         promise._rejectCallback(reason, synchronous, true);
14896         promise = null;
14897       }
14898       return ret2;
14899     }
14900     return tryConvertToPromise;
14901   };
14902 });
14903
14904 // node_modules/bluebird/js/release/promise_array.js
14905 var require_promise_array = __commonJS((exports2, module2) => {
14906   "use strict";
14907   module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) {
14908     var util = require_util();
14909     var isArray = util.isArray;
14910     function toResolutionValue(val) {
14911       switch (val) {
14912         case -2:
14913           return [];
14914         case -3:
14915           return {};
14916       }
14917     }
14918     function PromiseArray(values) {
14919       var promise = this._promise = new Promise2(INTERNAL);
14920       if (values instanceof Promise2) {
14921         promise._propagateFrom(values, 3);
14922       }
14923       promise._setOnCancel(this);
14924       this._values = values;
14925       this._length = 0;
14926       this._totalResolved = 0;
14927       this._init(void 0, -2);
14928     }
14929     util.inherits(PromiseArray, Proxyable);
14930     PromiseArray.prototype.length = function() {
14931       return this._length;
14932     };
14933     PromiseArray.prototype.promise = function() {
14934       return this._promise;
14935     };
14936     PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
14937       var values = tryConvertToPromise(this._values, this._promise);
14938       if (values instanceof Promise2) {
14939         values = values._target();
14940         var bitField = values._bitField;
14941         ;
14942         this._values = values;
14943         if ((bitField & 50397184) === 0) {
14944           this._promise._setAsyncGuaranteed();
14945           return values._then(init, this._reject, void 0, this, resolveValueIfEmpty);
14946         } else if ((bitField & 33554432) !== 0) {
14947           values = values._value();
14948         } else if ((bitField & 16777216) !== 0) {
14949           return this._reject(values._reason());
14950         } else {
14951           return this._cancel();
14952         }
14953       }
14954       values = util.asArray(values);
14955       if (values === null) {
14956         var err = apiRejection("expecting an array or an iterable object but got " + util.classString(values)).reason();
14957         this._promise._rejectCallback(err, false);
14958         return;
14959       }
14960       if (values.length === 0) {
14961         if (resolveValueIfEmpty === -5) {
14962           this._resolveEmptyArray();
14963         } else {
14964           this._resolve(toResolutionValue(resolveValueIfEmpty));
14965         }
14966         return;
14967       }
14968       this._iterate(values);
14969     };
14970     PromiseArray.prototype._iterate = function(values) {
14971       var len = this.getActualLength(values.length);
14972       this._length = len;
14973       this._values = this.shouldCopyValues() ? new Array(len) : this._values;
14974       var result = this._promise;
14975       var isResolved = false;
14976       var bitField = null;
14977       for (var i = 0; i < len; ++i) {
14978         var maybePromise = tryConvertToPromise(values[i], result);
14979         if (maybePromise instanceof Promise2) {
14980           maybePromise = maybePromise._target();
14981           bitField = maybePromise._bitField;
14982         } else {
14983           bitField = null;
14984         }
14985         if (isResolved) {
14986           if (bitField !== null) {
14987             maybePromise.suppressUnhandledRejections();
14988           }
14989         } else if (bitField !== null) {
14990           if ((bitField & 50397184) === 0) {
14991             maybePromise._proxy(this, i);
14992             this._values[i] = maybePromise;
14993           } else if ((bitField & 33554432) !== 0) {
14994             isResolved = this._promiseFulfilled(maybePromise._value(), i);
14995           } else if ((bitField & 16777216) !== 0) {
14996             isResolved = this._promiseRejected(maybePromise._reason(), i);
14997           } else {
14998             isResolved = this._promiseCancelled(i);
14999           }
15000         } else {
15001           isResolved = this._promiseFulfilled(maybePromise, i);
15002         }
15003       }
15004       if (!isResolved)
15005         result._setAsyncGuaranteed();
15006     };
15007     PromiseArray.prototype._isResolved = function() {
15008       return this._values === null;
15009     };
15010     PromiseArray.prototype._resolve = function(value) {
15011       this._values = null;
15012       this._promise._fulfill(value);
15013     };
15014     PromiseArray.prototype._cancel = function() {
15015       if (this._isResolved() || !this._promise._isCancellable())
15016         return;
15017       this._values = null;
15018       this._promise._cancel();
15019     };
15020     PromiseArray.prototype._reject = function(reason) {
15021       this._values = null;
15022       this._promise._rejectCallback(reason, false);
15023     };
15024     PromiseArray.prototype._promiseFulfilled = function(value, index) {
15025       this._values[index] = value;
15026       var totalResolved = ++this._totalResolved;
15027       if (totalResolved >= this._length) {
15028         this._resolve(this._values);
15029         return true;
15030       }
15031       return false;
15032     };
15033     PromiseArray.prototype._promiseCancelled = function() {
15034       this._cancel();
15035       return true;
15036     };
15037     PromiseArray.prototype._promiseRejected = function(reason) {
15038       this._totalResolved++;
15039       this._reject(reason);
15040       return true;
15041     };
15042     PromiseArray.prototype._resultCancelled = function() {
15043       if (this._isResolved())
15044         return;
15045       var values = this._values;
15046       this._cancel();
15047       if (values instanceof Promise2) {
15048         values.cancel();
15049       } else {
15050         for (var i = 0; i < values.length; ++i) {
15051           if (values[i] instanceof Promise2) {
15052             values[i].cancel();
15053           }
15054         }
15055       }
15056     };
15057     PromiseArray.prototype.shouldCopyValues = function() {
15058       return true;
15059     };
15060     PromiseArray.prototype.getActualLength = function(len) {
15061       return len;
15062     };
15063     return PromiseArray;
15064   };
15065 });
15066
15067 // node_modules/bluebird/js/release/context.js
15068 var require_context = __commonJS((exports2, module2) => {
15069   "use strict";
15070   module2.exports = function(Promise2) {
15071     var longStackTraces = false;
15072     var contextStack = [];
15073     Promise2.prototype._promiseCreated = function() {
15074     };
15075     Promise2.prototype._pushContext = function() {
15076     };
15077     Promise2.prototype._popContext = function() {
15078       return null;
15079     };
15080     Promise2._peekContext = Promise2.prototype._peekContext = function() {
15081     };
15082     function Context() {
15083       this._trace = new Context.CapturedTrace(peekContext());
15084     }
15085     Context.prototype._pushContext = function() {
15086       if (this._trace !== void 0) {
15087         this._trace._promiseCreated = null;
15088         contextStack.push(this._trace);
15089       }
15090     };
15091     Context.prototype._popContext = function() {
15092       if (this._trace !== void 0) {
15093         var trace = contextStack.pop();
15094         var ret2 = trace._promiseCreated;
15095         trace._promiseCreated = null;
15096         return ret2;
15097       }
15098       return null;
15099     };
15100     function createContext() {
15101       if (longStackTraces)
15102         return new Context();
15103     }
15104     function peekContext() {
15105       var lastIndex = contextStack.length - 1;
15106       if (lastIndex >= 0) {
15107         return contextStack[lastIndex];
15108       }
15109       return void 0;
15110     }
15111     Context.CapturedTrace = null;
15112     Context.create = createContext;
15113     Context.deactivateLongStackTraces = function() {
15114     };
15115     Context.activateLongStackTraces = function() {
15116       var Promise_pushContext = Promise2.prototype._pushContext;
15117       var Promise_popContext = Promise2.prototype._popContext;
15118       var Promise_PeekContext = Promise2._peekContext;
15119       var Promise_peekContext = Promise2.prototype._peekContext;
15120       var Promise_promiseCreated = Promise2.prototype._promiseCreated;
15121       Context.deactivateLongStackTraces = function() {
15122         Promise2.prototype._pushContext = Promise_pushContext;
15123         Promise2.prototype._popContext = Promise_popContext;
15124         Promise2._peekContext = Promise_PeekContext;
15125         Promise2.prototype._peekContext = Promise_peekContext;
15126         Promise2.prototype._promiseCreated = Promise_promiseCreated;
15127         longStackTraces = false;
15128       };
15129       longStackTraces = true;
15130       Promise2.prototype._pushContext = Context.prototype._pushContext;
15131       Promise2.prototype._popContext = Context.prototype._popContext;
15132       Promise2._peekContext = Promise2.prototype._peekContext = peekContext;
15133       Promise2.prototype._promiseCreated = function() {
15134         var ctx = this._peekContext();
15135         if (ctx && ctx._promiseCreated == null)
15136           ctx._promiseCreated = this;
15137       };
15138     };
15139     return Context;
15140   };
15141 });
15142
15143 // node_modules/bluebird/js/release/debuggability.js
15144 var require_debuggability = __commonJS((exports2, module2) => {
15145   "use strict";
15146   module2.exports = function(Promise2, Context) {
15147     var getDomain = Promise2._getDomain;
15148     var async = Promise2._async;
15149     var Warning = require_errors().Warning;
15150     var util = require_util();
15151     var canAttachTrace2 = util.canAttachTrace;
15152     var unhandledRejectionHandled;
15153     var possiblyUnhandledRejection;
15154     var bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/;
15155     var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/;
15156     var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/;
15157     var stackFramePattern = null;
15158     var formatStack = null;
15159     var indentStackFrames = false;
15160     var printWarning;
15161     var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && (util.env("BLUEBIRD_DEBUG") || util.env("NODE_ENV") === "development"));
15162     var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && (debugging || util.env("BLUEBIRD_WARNINGS")));
15163     var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES")));
15164     var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));
15165     Promise2.prototype.suppressUnhandledRejections = function() {
15166       var target = this._target();
15167       target._bitField = target._bitField & ~1048576 | 524288;
15168     };
15169     Promise2.prototype._ensurePossibleRejectionHandled = function() {
15170       if ((this._bitField & 524288) !== 0)
15171         return;
15172       this._setRejectionIsUnhandled();
15173       async.invokeLater(this._notifyUnhandledRejection, this, void 0);
15174     };
15175     Promise2.prototype._notifyUnhandledRejectionIsHandled = function() {
15176       fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, void 0, this);
15177     };
15178     Promise2.prototype._setReturnedNonUndefined = function() {
15179       this._bitField = this._bitField | 268435456;
15180     };
15181     Promise2.prototype._returnedNonUndefined = function() {
15182       return (this._bitField & 268435456) !== 0;
15183     };
15184     Promise2.prototype._notifyUnhandledRejection = function() {
15185       if (this._isRejectionUnhandled()) {
15186         var reason = this._settledValue();
15187         this._setUnhandledRejectionIsNotified();
15188         fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this);
15189       }
15190     };
15191     Promise2.prototype._setUnhandledRejectionIsNotified = function() {
15192       this._bitField = this._bitField | 262144;
15193     };
15194     Promise2.prototype._unsetUnhandledRejectionIsNotified = function() {
15195       this._bitField = this._bitField & ~262144;
15196     };
15197     Promise2.prototype._isUnhandledRejectionNotified = function() {
15198       return (this._bitField & 262144) > 0;
15199     };
15200     Promise2.prototype._setRejectionIsUnhandled = function() {
15201       this._bitField = this._bitField | 1048576;
15202     };
15203     Promise2.prototype._unsetRejectionIsUnhandled = function() {
15204       this._bitField = this._bitField & ~1048576;
15205       if (this._isUnhandledRejectionNotified()) {
15206         this._unsetUnhandledRejectionIsNotified();
15207         this._notifyUnhandledRejectionIsHandled();
15208       }
15209     };
15210     Promise2.prototype._isRejectionUnhandled = function() {
15211       return (this._bitField & 1048576) > 0;
15212     };
15213     Promise2.prototype._warn = function(message, shouldUseOwnTrace, promise) {
15214       return warn(message, shouldUseOwnTrace, promise || this);
15215     };
15216     Promise2.onPossiblyUnhandledRejection = function(fn) {
15217       var domain = getDomain();
15218       possiblyUnhandledRejection = typeof fn === "function" ? domain === null ? fn : util.domainBind(domain, fn) : void 0;
15219     };
15220     Promise2.onUnhandledRejectionHandled = function(fn) {
15221       var domain = getDomain();
15222       unhandledRejectionHandled = typeof fn === "function" ? domain === null ? fn : util.domainBind(domain, fn) : void 0;
15223     };
15224     var disableLongStackTraces = function() {
15225     };
15226     Promise2.longStackTraces = function() {
15227       if (async.haveItemsQueued() && !config.longStackTraces) {
15228         throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");
15229       }
15230       if (!config.longStackTraces && longStackTracesIsSupported()) {
15231         var Promise_captureStackTrace = Promise2.prototype._captureStackTrace;
15232         var Promise_attachExtraTrace = Promise2.prototype._attachExtraTrace;
15233         config.longStackTraces = true;
15234         disableLongStackTraces = function() {
15235           if (async.haveItemsQueued() && !config.longStackTraces) {
15236             throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");
15237           }
15238           Promise2.prototype._captureStackTrace = Promise_captureStackTrace;
15239           Promise2.prototype._attachExtraTrace = Promise_attachExtraTrace;
15240           Context.deactivateLongStackTraces();
15241           async.enableTrampoline();
15242           config.longStackTraces = false;
15243         };
15244         Promise2.prototype._captureStackTrace = longStackTracesCaptureStackTrace;
15245         Promise2.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;
15246         Context.activateLongStackTraces();
15247         async.disableTrampolineIfNecessary();
15248       }
15249     };
15250     Promise2.hasLongStackTraces = function() {
15251       return config.longStackTraces && longStackTracesIsSupported();
15252     };
15253     var fireDomEvent = function() {
15254       try {
15255         if (typeof CustomEvent === "function") {
15256           var event = new CustomEvent("CustomEvent");
15257           util.global.dispatchEvent(event);
15258           return function(name, event2) {
15259             var domEvent = new CustomEvent(name.toLowerCase(), {
15260               detail: event2,
15261               cancelable: true
15262             });
15263             return !util.global.dispatchEvent(domEvent);
15264           };
15265         } else if (typeof Event === "function") {
15266           var event = new Event("CustomEvent");
15267           util.global.dispatchEvent(event);
15268           return function(name, event2) {
15269             var domEvent = new Event(name.toLowerCase(), {
15270               cancelable: true
15271             });
15272             domEvent.detail = event2;
15273             return !util.global.dispatchEvent(domEvent);
15274           };
15275         } else {
15276           var event = document.createEvent("CustomEvent");
15277           event.initCustomEvent("testingtheevent", false, true, {});
15278           util.global.dispatchEvent(event);
15279           return function(name, event2) {
15280             var domEvent = document.createEvent("CustomEvent");
15281             domEvent.initCustomEvent(name.toLowerCase(), false, true, event2);
15282             return !util.global.dispatchEvent(domEvent);
15283           };
15284         }
15285       } catch (e) {
15286       }
15287       return function() {
15288         return false;
15289       };
15290     }();
15291     var fireGlobalEvent = function() {
15292       if (util.isNode) {
15293         return function() {
15294           return process.emit.apply(process, arguments);
15295         };
15296       } else {
15297         if (!util.global) {
15298           return function() {
15299             return false;
15300           };
15301         }
15302         return function(name) {
15303           var methodName = "on" + name.toLowerCase();
15304           var method = util.global[methodName];
15305           if (!method)
15306             return false;
15307           method.apply(util.global, [].slice.call(arguments, 1));
15308           return true;
15309         };
15310       }
15311     }();
15312     function generatePromiseLifecycleEventObject(name, promise) {
15313       return {promise};
15314     }
15315     var eventToObjectGenerator = {
15316       promiseCreated: generatePromiseLifecycleEventObject,
15317       promiseFulfilled: generatePromiseLifecycleEventObject,
15318       promiseRejected: generatePromiseLifecycleEventObject,
15319       promiseResolved: generatePromiseLifecycleEventObject,
15320       promiseCancelled: generatePromiseLifecycleEventObject,
15321       promiseChained: function(name, promise, child) {
15322         return {promise, child};
15323       },
15324       warning: function(name, warning) {
15325         return {warning};
15326       },
15327       unhandledRejection: function(name, reason, promise) {
15328         return {reason, promise};
15329       },
15330       rejectionHandled: generatePromiseLifecycleEventObject
15331     };
15332     var activeFireEvent = function(name) {
15333       var globalEventFired = false;
15334       try {
15335         globalEventFired = fireGlobalEvent.apply(null, arguments);
15336       } catch (e) {
15337         async.throwLater(e);
15338         globalEventFired = true;
15339       }
15340       var domEventFired = false;
15341       try {
15342         domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments));
15343       } catch (e) {
15344         async.throwLater(e);
15345         domEventFired = true;
15346       }
15347       return domEventFired || globalEventFired;
15348     };
15349     Promise2.config = function(opts) {
15350       opts = Object(opts);
15351       if ("longStackTraces" in opts) {
15352         if (opts.longStackTraces) {
15353           Promise2.longStackTraces();
15354         } else if (!opts.longStackTraces && Promise2.hasLongStackTraces()) {
15355           disableLongStackTraces();
15356         }
15357       }
15358       if ("warnings" in opts) {
15359         var warningsOption = opts.warnings;
15360         config.warnings = !!warningsOption;
15361         wForgottenReturn = config.warnings;
15362         if (util.isObject(warningsOption)) {
15363           if ("wForgottenReturn" in warningsOption) {
15364             wForgottenReturn = !!warningsOption.wForgottenReturn;
15365           }
15366         }
15367       }
15368       if ("cancellation" in opts && opts.cancellation && !config.cancellation) {
15369         if (async.haveItemsQueued()) {
15370           throw new Error("cannot enable cancellation after promises are in use");
15371         }
15372         Promise2.prototype._clearCancellationData = cancellationClearCancellationData;
15373         Promise2.prototype._propagateFrom = cancellationPropagateFrom;
15374         Promise2.prototype._onCancel = cancellationOnCancel;
15375         Promise2.prototype._setOnCancel = cancellationSetOnCancel;
15376         Promise2.prototype._attachCancellationCallback = cancellationAttachCancellationCallback;
15377         Promise2.prototype._execute = cancellationExecute;
15378         propagateFromFunction = cancellationPropagateFrom;
15379         config.cancellation = true;
15380       }
15381       if ("monitoring" in opts) {
15382         if (opts.monitoring && !config.monitoring) {
15383           config.monitoring = true;
15384           Promise2.prototype._fireEvent = activeFireEvent;
15385         } else if (!opts.monitoring && config.monitoring) {
15386           config.monitoring = false;
15387           Promise2.prototype._fireEvent = defaultFireEvent;
15388         }
15389       }
15390       return Promise2;
15391     };
15392     function defaultFireEvent() {
15393       return false;
15394     }
15395     Promise2.prototype._fireEvent = defaultFireEvent;
15396     Promise2.prototype._execute = function(executor, resolve, reject) {
15397       try {
15398         executor(resolve, reject);
15399       } catch (e) {
15400         return e;
15401       }
15402     };
15403     Promise2.prototype._onCancel = function() {
15404     };
15405     Promise2.prototype._setOnCancel = function(handler) {
15406       ;
15407     };
15408     Promise2.prototype._attachCancellationCallback = function(onCancel) {
15409       ;
15410     };
15411     Promise2.prototype._captureStackTrace = function() {
15412     };
15413     Promise2.prototype._attachExtraTrace = function() {
15414     };
15415     Promise2.prototype._clearCancellationData = function() {
15416     };
15417     Promise2.prototype._propagateFrom = function(parent, flags) {
15418       ;
15419       ;
15420     };
15421     function cancellationExecute(executor, resolve, reject) {
15422       var promise = this;
15423       try {
15424         executor(resolve, reject, function(onCancel) {
15425           if (typeof onCancel !== "function") {
15426             throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel));
15427           }
15428           promise._attachCancellationCallback(onCancel);
15429         });
15430       } catch (e) {
15431         return e;
15432       }
15433     }
15434     function cancellationAttachCancellationCallback(onCancel) {
15435       if (!this._isCancellable())
15436         return this;
15437       var previousOnCancel = this._onCancel();
15438       if (previousOnCancel !== void 0) {
15439         if (util.isArray(previousOnCancel)) {
15440           previousOnCancel.push(onCancel);
15441         } else {
15442           this._setOnCancel([previousOnCancel, onCancel]);
15443         }
15444       } else {
15445         this._setOnCancel(onCancel);
15446       }
15447     }
15448     function cancellationOnCancel() {
15449       return this._onCancelField;
15450     }
15451     function cancellationSetOnCancel(onCancel) {
15452       this._onCancelField = onCancel;
15453     }
15454     function cancellationClearCancellationData() {
15455       this._cancellationParent = void 0;
15456       this._onCancelField = void 0;
15457     }
15458     function cancellationPropagateFrom(parent, flags) {
15459       if ((flags & 1) !== 0) {
15460         this._cancellationParent = parent;
15461         var branchesRemainingToCancel = parent._branchesRemainingToCancel;
15462         if (branchesRemainingToCancel === void 0) {
15463           branchesRemainingToCancel = 0;
15464         }
15465         parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;
15466       }
15467       if ((flags & 2) !== 0 && parent._isBound()) {
15468         this._setBoundTo(parent._boundTo);
15469       }
15470     }
15471     function bindingPropagateFrom(parent, flags) {
15472       if ((flags & 2) !== 0 && parent._isBound()) {
15473         this._setBoundTo(parent._boundTo);
15474       }
15475     }
15476     var propagateFromFunction = bindingPropagateFrom;
15477     function boundValueFunction() {
15478       var ret2 = this._boundTo;
15479       if (ret2 !== void 0) {
15480         if (ret2 instanceof Promise2) {
15481           if (ret2.isFulfilled()) {
15482             return ret2.value();
15483           } else {
15484             return void 0;
15485           }
15486         }
15487       }
15488       return ret2;
15489     }
15490     function longStackTracesCaptureStackTrace() {
15491       this._trace = new CapturedTrace(this._peekContext());
15492     }
15493     function longStackTracesAttachExtraTrace(error, ignoreSelf) {
15494       if (canAttachTrace2(error)) {
15495         var trace = this._trace;
15496         if (trace !== void 0) {
15497           if (ignoreSelf)
15498             trace = trace._parent;
15499         }
15500         if (trace !== void 0) {
15501           trace.attachExtraTrace(error);
15502         } else if (!error.__stackCleaned__) {
15503           var parsed = parseStackAndMessage(error);
15504           util.notEnumerableProp(error, "stack", parsed.message + "\n" + parsed.stack.join("\n"));
15505           util.notEnumerableProp(error, "__stackCleaned__", true);
15506         }
15507       }
15508     }
15509     function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) {
15510       if (returnValue === void 0 && promiseCreated !== null && wForgottenReturn) {
15511         if (parent !== void 0 && parent._returnedNonUndefined())
15512           return;
15513         if ((promise._bitField & 65535) === 0)
15514           return;
15515         if (name)
15516           name = name + " ";
15517         var handlerLine = "";
15518         var creatorLine = "";
15519         if (promiseCreated._trace) {
15520           var traceLines = promiseCreated._trace.stack.split("\n");
15521           var stack = cleanStack(traceLines);
15522           for (var i = stack.length - 1; i >= 0; --i) {
15523             var line = stack[i];
15524             if (!nodeFramePattern.test(line)) {
15525               var lineMatches = line.match(parseLinePattern);
15526               if (lineMatches) {
15527                 handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " ";
15528               }
15529               break;
15530             }
15531           }
15532           if (stack.length > 0) {
15533             var firstUserLine = stack[0];
15534             for (var i = 0; i < traceLines.length; ++i) {
15535               if (traceLines[i] === firstUserLine) {
15536                 if (i > 0) {
15537                   creatorLine = "\n" + traceLines[i - 1];
15538                 }
15539                 break;
15540               }
15541             }
15542           }
15543         }
15544         var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine;
15545         promise._warn(msg, true, promiseCreated);
15546       }
15547     }
15548     function deprecated(name, replacement) {
15549       var message = name + " is deprecated and will be removed in a future version.";
15550       if (replacement)
15551         message += " Use " + replacement + " instead.";
15552       return warn(message);
15553     }
15554     function warn(message, shouldUseOwnTrace, promise) {
15555       if (!config.warnings)
15556         return;
15557       var warning = new Warning(message);
15558       var ctx;
15559       if (shouldUseOwnTrace) {
15560         promise._attachExtraTrace(warning);
15561       } else if (config.longStackTraces && (ctx = Promise2._peekContext())) {
15562         ctx.attachExtraTrace(warning);
15563       } else {
15564         var parsed = parseStackAndMessage(warning);
15565         warning.stack = parsed.message + "\n" + parsed.stack.join("\n");
15566       }
15567       if (!activeFireEvent("warning", warning)) {
15568         formatAndLogError(warning, "", true);
15569       }
15570     }
15571     function reconstructStack(message, stacks) {
15572       for (var i = 0; i < stacks.length - 1; ++i) {
15573         stacks[i].push("From previous event:");
15574         stacks[i] = stacks[i].join("\n");
15575       }
15576       if (i < stacks.length) {
15577         stacks[i] = stacks[i].join("\n");
15578       }
15579       return message + "\n" + stacks.join("\n");
15580     }
15581     function removeDuplicateOrEmptyJumps(stacks) {
15582       for (var i = 0; i < stacks.length; ++i) {
15583         if (stacks[i].length === 0 || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) {
15584           stacks.splice(i, 1);
15585           i--;
15586         }
15587       }
15588     }
15589     function removeCommonRoots(stacks) {
15590       var current = stacks[0];
15591       for (var i = 1; i < stacks.length; ++i) {
15592         var prev = stacks[i];
15593         var currentLastIndex = current.length - 1;
15594         var currentLastLine = current[currentLastIndex];
15595         var commonRootMeetPoint = -1;
15596         for (var j = prev.length - 1; j >= 0; --j) {
15597           if (prev[j] === currentLastLine) {
15598             commonRootMeetPoint = j;
15599             break;
15600           }
15601         }
15602         for (var j = commonRootMeetPoint; j >= 0; --j) {
15603           var line = prev[j];
15604           if (current[currentLastIndex] === line) {
15605             current.pop();
15606             currentLastIndex--;
15607           } else {
15608             break;
15609           }
15610         }
15611         current = prev;
15612       }
15613     }
15614     function cleanStack(stack) {
15615       var ret2 = [];
15616       for (var i = 0; i < stack.length; ++i) {
15617         var line = stack[i];
15618         var isTraceLine = line === "    (No stack trace)" || stackFramePattern.test(line);
15619         var isInternalFrame = isTraceLine && shouldIgnore(line);
15620         if (isTraceLine && !isInternalFrame) {
15621           if (indentStackFrames && line.charAt(0) !== " ") {
15622             line = "    " + line;
15623           }
15624           ret2.push(line);
15625         }
15626       }
15627       return ret2;
15628     }
15629     function stackFramesAsArray(error) {
15630       var stack = error.stack.replace(/\s+$/g, "").split("\n");
15631       for (var i = 0; i < stack.length; ++i) {
15632         var line = stack[i];
15633         if (line === "    (No stack trace)" || stackFramePattern.test(line)) {
15634           break;
15635         }
15636       }
15637       if (i > 0 && error.name != "SyntaxError") {
15638         stack = stack.slice(i);
15639       }
15640       return stack;
15641     }
15642     function parseStackAndMessage(error) {
15643       var stack = error.stack;
15644       var message = error.toString();
15645       stack = typeof stack === "string" && stack.length > 0 ? stackFramesAsArray(error) : ["    (No stack trace)"];
15646       return {
15647         message,
15648         stack: error.name == "SyntaxError" ? stack : cleanStack(stack)
15649       };
15650     }
15651     function formatAndLogError(error, title, isSoft) {
15652       if (typeof console !== "undefined") {
15653         var message;
15654         if (util.isObject(error)) {
15655           var stack = error.stack;
15656           message = title + formatStack(stack, error);
15657         } else {
15658           message = title + String(error);
15659         }
15660         if (typeof printWarning === "function") {
15661           printWarning(message, isSoft);
15662         } else if (typeof console.log === "function" || typeof console.log === "object") {
15663           console.log(message);
15664         }
15665       }
15666     }
15667     function fireRejectionEvent(name, localHandler, reason, promise) {
15668       var localEventFired = false;
15669       try {
15670         if (typeof localHandler === "function") {
15671           localEventFired = true;
15672           if (name === "rejectionHandled") {
15673             localHandler(promise);
15674           } else {
15675             localHandler(reason, promise);
15676           }
15677         }
15678       } catch (e) {
15679         async.throwLater(e);
15680       }
15681       if (name === "unhandledRejection") {
15682         if (!activeFireEvent(name, reason, promise) && !localEventFired) {
15683           formatAndLogError(reason, "Unhandled rejection ");
15684         }
15685       } else {
15686         activeFireEvent(name, promise);
15687       }
15688     }
15689     function formatNonError(obj) {
15690       var str;
15691       if (typeof obj === "function") {
15692         str = "[function " + (obj.name || "anonymous") + "]";
15693       } else {
15694         str = obj && typeof obj.toString === "function" ? obj.toString() : util.toString(obj);
15695         var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;
15696         if (ruselessToString.test(str)) {
15697           try {
15698             var newStr = JSON.stringify(obj);
15699             str = newStr;
15700           } catch (e) {
15701           }
15702         }
15703         if (str.length === 0) {
15704           str = "(empty array)";
15705         }
15706       }
15707       return "(<" + snip(str) + ">, no stack trace)";
15708     }
15709     function snip(str) {
15710       var maxChars = 41;
15711       if (str.length < maxChars) {
15712         return str;
15713       }
15714       return str.substr(0, maxChars - 3) + "...";
15715     }
15716     function longStackTracesIsSupported() {
15717       return typeof captureStackTrace === "function";
15718     }
15719     var shouldIgnore = function() {
15720       return false;
15721     };
15722     var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
15723     function parseLineInfo(line) {
15724       var matches = line.match(parseLineInfoRegex);
15725       if (matches) {
15726         return {
15727           fileName: matches[1],
15728           line: parseInt(matches[2], 10)
15729         };
15730       }
15731     }
15732     function setBounds(firstLineError, lastLineError) {
15733       if (!longStackTracesIsSupported())
15734         return;
15735       var firstStackLines = firstLineError.stack.split("\n");
15736       var lastStackLines = lastLineError.stack.split("\n");
15737       var firstIndex = -1;
15738       var lastIndex = -1;
15739       var firstFileName;
15740       var lastFileName;
15741       for (var i = 0; i < firstStackLines.length; ++i) {
15742         var result = parseLineInfo(firstStackLines[i]);
15743         if (result) {
15744           firstFileName = result.fileName;
15745           firstIndex = result.line;
15746           break;
15747         }
15748       }
15749       for (var i = 0; i < lastStackLines.length; ++i) {
15750         var result = parseLineInfo(lastStackLines[i]);
15751         if (result) {
15752           lastFileName = result.fileName;
15753           lastIndex = result.line;
15754           break;
15755         }
15756       }
15757       if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) {
15758         return;
15759       }
15760       shouldIgnore = function(line) {
15761         if (bluebirdFramePattern.test(line))
15762           return true;
15763         var info = parseLineInfo(line);
15764         if (info) {
15765           if (info.fileName === firstFileName && (firstIndex <= info.line && info.line <= lastIndex)) {
15766             return true;
15767           }
15768         }
15769         return false;
15770       };
15771     }
15772     function CapturedTrace(parent) {
15773       this._parent = parent;
15774       this._promisesCreated = 0;
15775       var length = this._length = 1 + (parent === void 0 ? 0 : parent._length);
15776       captureStackTrace(this, CapturedTrace);
15777       if (length > 32)
15778         this.uncycle();
15779     }
15780     util.inherits(CapturedTrace, Error);
15781     Context.CapturedTrace = CapturedTrace;
15782     CapturedTrace.prototype.uncycle = function() {
15783       var length = this._length;
15784       if (length < 2)
15785         return;
15786       var nodes = [];
15787       var stackToIndex = {};
15788       for (var i = 0, node = this; node !== void 0; ++i) {
15789         nodes.push(node);
15790         node = node._parent;
15791       }
15792       length = this._length = i;
15793       for (var i = length - 1; i >= 0; --i) {
15794         var stack = nodes[i].stack;
15795         if (stackToIndex[stack] === void 0) {
15796           stackToIndex[stack] = i;
15797         }
15798       }
15799       for (var i = 0; i < length; ++i) {
15800         var currentStack = nodes[i].stack;
15801         var index = stackToIndex[currentStack];
15802         if (index !== void 0 && index !== i) {
15803           if (index > 0) {
15804             nodes[index - 1]._parent = void 0;
15805             nodes[index - 1]._length = 1;
15806           }
15807           nodes[i]._parent = void 0;
15808           nodes[i]._length = 1;
15809           var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;
15810           if (index < length - 1) {
15811             cycleEdgeNode._parent = nodes[index + 1];
15812             cycleEdgeNode._parent.uncycle();
15813             cycleEdgeNode._length = cycleEdgeNode._parent._length + 1;
15814           } else {
15815             cycleEdgeNode._parent = void 0;
15816             cycleEdgeNode._length = 1;
15817           }
15818           var currentChildLength = cycleEdgeNode._length + 1;
15819           for (var j = i - 2; j >= 0; --j) {
15820             nodes[j]._length = currentChildLength;
15821             currentChildLength++;
15822           }
15823           return;
15824         }
15825       }
15826     };
15827     CapturedTrace.prototype.attachExtraTrace = function(error) {
15828       if (error.__stackCleaned__)
15829         return;
15830       this.uncycle();
15831       var parsed = parseStackAndMessage(error);
15832       var message = parsed.message;
15833       var stacks = [parsed.stack];
15834       var trace = this;
15835       while (trace !== void 0) {
15836         stacks.push(cleanStack(trace.stack.split("\n")));
15837         trace = trace._parent;
15838       }
15839       removeCommonRoots(stacks);
15840       removeDuplicateOrEmptyJumps(stacks);
15841       util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
15842       util.notEnumerableProp(error, "__stackCleaned__", true);
15843     };
15844     var captureStackTrace = function stackDetection() {
15845       var v8stackFramePattern = /^\s*at\s*/;
15846       var v8stackFormatter = function(stack, error) {
15847         if (typeof stack === "string")
15848           return stack;
15849         if (error.name !== void 0 && error.message !== void 0) {
15850           return error.toString();
15851         }
15852         return formatNonError(error);
15853       };
15854       if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") {
15855         Error.stackTraceLimit += 6;
15856         stackFramePattern = v8stackFramePattern;
15857         formatStack = v8stackFormatter;
15858         var captureStackTrace2 = Error.captureStackTrace;
15859         shouldIgnore = function(line) {
15860           return bluebirdFramePattern.test(line);
15861         };
15862         return function(receiver, ignoreUntil) {
15863           Error.stackTraceLimit += 6;
15864           captureStackTrace2(receiver, ignoreUntil);
15865           Error.stackTraceLimit -= 6;
15866         };
15867       }
15868       var err = new Error();
15869       if (typeof err.stack === "string" && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) {
15870         stackFramePattern = /@/;
15871         formatStack = v8stackFormatter;
15872         indentStackFrames = true;
15873         return function captureStackTrace3(o) {
15874           o.stack = new Error().stack;
15875         };
15876       }
15877       var hasStackAfterThrow;
15878       try {
15879         throw new Error();
15880       } catch (e) {
15881         hasStackAfterThrow = "stack" in e;
15882       }
15883       if (!("stack" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === "number") {
15884         stackFramePattern = v8stackFramePattern;
15885         formatStack = v8stackFormatter;
15886         return function captureStackTrace3(o) {
15887           Error.stackTraceLimit += 6;
15888           try {
15889             throw new Error();
15890           } catch (e) {
15891             o.stack = e.stack;
15892           }
15893           Error.stackTraceLimit -= 6;
15894         };
15895       }
15896       formatStack = function(stack, error) {
15897         if (typeof stack === "string")
15898           return stack;
15899         if ((typeof error === "object" || typeof error === "function") && error.name !== void 0 && error.message !== void 0) {
15900           return error.toString();
15901         }
15902         return formatNonError(error);
15903       };
15904       return null;
15905     }([]);
15906     if (typeof console !== "undefined" && typeof console.warn !== "undefined") {
15907       printWarning = function(message) {
15908         console.warn(message);
15909       };
15910       if (util.isNode && process.stderr.isTTY) {
15911         printWarning = function(message, isSoft) {
15912           var color = isSoft ? "\e[33m" : "\e[31m";
15913           console.warn(color + message + "\e[0m\n");
15914         };
15915       } else if (!util.isNode && typeof new Error().stack === "string") {
15916         printWarning = function(message, isSoft) {
15917           console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red");
15918         };
15919       }
15920     }
15921     var config = {
15922       warnings,
15923       longStackTraces: false,
15924       cancellation: false,
15925       monitoring: false
15926     };
15927     if (longStackTraces)
15928       Promise2.longStackTraces();
15929     return {
15930       longStackTraces: function() {
15931         return config.longStackTraces;
15932       },
15933       warnings: function() {
15934         return config.warnings;
15935       },
15936       cancellation: function() {
15937         return config.cancellation;
15938       },
15939       monitoring: function() {
15940         return config.monitoring;
15941       },
15942       propagateFromFunction: function() {
15943         return propagateFromFunction;
15944       },
15945       boundValueFunction: function() {
15946         return boundValueFunction;
15947       },
15948       checkForgottenReturns,
15949       setBounds,
15950       warn,
15951       deprecated,
15952       CapturedTrace,
15953       fireDomEvent,
15954       fireGlobalEvent
15955     };
15956   };
15957 });
15958
15959 // node_modules/bluebird/js/release/finally.js
15960 var require_finally = __commonJS((exports2, module2) => {
15961   "use strict";
15962   module2.exports = function(Promise2, tryConvertToPromise) {
15963     var util = require_util();
15964     var CancellationError = Promise2.CancellationError;
15965     var errorObj2 = util.errorObj;
15966     function PassThroughHandlerContext(promise, type, handler) {
15967       this.promise = promise;
15968       this.type = type;
15969       this.handler = handler;
15970       this.called = false;
15971       this.cancelPromise = null;
15972     }
15973     PassThroughHandlerContext.prototype.isFinallyHandler = function() {
15974       return this.type === 0;
15975     };
15976     function FinallyHandlerCancelReaction(finallyHandler2) {
15977       this.finallyHandler = finallyHandler2;
15978     }
15979     FinallyHandlerCancelReaction.prototype._resultCancelled = function() {
15980       checkCancel(this.finallyHandler);
15981     };
15982     function checkCancel(ctx, reason) {
15983       if (ctx.cancelPromise != null) {
15984         if (arguments.length > 1) {
15985           ctx.cancelPromise._reject(reason);
15986         } else {
15987           ctx.cancelPromise._cancel();
15988         }
15989         ctx.cancelPromise = null;
15990         return true;
15991       }
15992       return false;
15993     }
15994     function succeed() {
15995       return finallyHandler.call(this, this.promise._target()._settledValue());
15996     }
15997     function fail(reason) {
15998       if (checkCancel(this, reason))
15999         return;
16000       errorObj2.e = reason;
16001       return errorObj2;
16002     }
16003     function finallyHandler(reasonOrValue) {
16004       var promise = this.promise;
16005       var handler = this.handler;
16006       if (!this.called) {
16007         this.called = true;
16008         var ret2 = this.isFinallyHandler() ? handler.call(promise._boundValue()) : handler.call(promise._boundValue(), reasonOrValue);
16009         if (ret2 !== void 0) {
16010           promise._setReturnedNonUndefined();
16011           var maybePromise = tryConvertToPromise(ret2, promise);
16012           if (maybePromise instanceof Promise2) {
16013             if (this.cancelPromise != null) {
16014               if (maybePromise._isCancelled()) {
16015                 var reason = new CancellationError("late cancellation observer");
16016                 promise._attachExtraTrace(reason);
16017                 errorObj2.e = reason;
16018                 return errorObj2;
16019               } else if (maybePromise.isPending()) {
16020                 maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this));
16021               }
16022             }
16023             return maybePromise._then(succeed, fail, void 0, this, void 0);
16024           }
16025         }
16026       }
16027       if (promise.isRejected()) {
16028         checkCancel(this);
16029         errorObj2.e = reasonOrValue;
16030         return errorObj2;
16031       } else {
16032         checkCancel(this);
16033         return reasonOrValue;
16034       }
16035     }
16036     Promise2.prototype._passThrough = function(handler, type, success, fail2) {
16037       if (typeof handler !== "function")
16038         return this.then();
16039       return this._then(success, fail2, void 0, new PassThroughHandlerContext(this, type, handler), void 0);
16040     };
16041     Promise2.prototype.lastly = Promise2.prototype["finally"] = function(handler) {
16042       return this._passThrough(handler, 0, finallyHandler, finallyHandler);
16043     };
16044     Promise2.prototype.tap = function(handler) {
16045       return this._passThrough(handler, 1, finallyHandler);
16046     };
16047     return PassThroughHandlerContext;
16048   };
16049 });
16050
16051 // node_modules/bluebird/js/release/catch_filter.js
16052 var require_catch_filter = __commonJS((exports2, module2) => {
16053   "use strict";
16054   module2.exports = function(NEXT_FILTER) {
16055     var util = require_util();
16056     var getKeys = require_es5().keys;
16057     var tryCatch2 = util.tryCatch;
16058     var errorObj2 = util.errorObj;
16059     function catchFilter(instances, cb, promise) {
16060       return function(e) {
16061         var boundTo = promise._boundValue();
16062         predicateLoop:
16063           for (var i = 0; i < instances.length; ++i) {
16064             var item = instances[i];
16065             if (item === Error || item != null && item.prototype instanceof Error) {
16066               if (e instanceof item) {
16067                 return tryCatch2(cb).call(boundTo, e);
16068               }
16069             } else if (typeof item === "function") {
16070               var matchesPredicate = tryCatch2(item).call(boundTo, e);
16071               if (matchesPredicate === errorObj2) {
16072                 return matchesPredicate;
16073               } else if (matchesPredicate) {
16074                 return tryCatch2(cb).call(boundTo, e);
16075               }
16076             } else if (util.isObject(e)) {
16077               var keys = getKeys(item);
16078               for (var j = 0; j < keys.length; ++j) {
16079                 var key = keys[j];
16080                 if (item[key] != e[key]) {
16081                   continue predicateLoop;
16082                 }
16083               }
16084               return tryCatch2(cb).call(boundTo, e);
16085             }
16086           }
16087         return NEXT_FILTER;
16088       };
16089     }
16090     return catchFilter;
16091   };
16092 });
16093
16094 // node_modules/bluebird/js/release/nodeback.js
16095 var require_nodeback = __commonJS((exports2, module2) => {
16096   "use strict";
16097   var util = require_util();
16098   var maybeWrapAsError2 = util.maybeWrapAsError;
16099   var errors = require_errors();
16100   var OperationalError = errors.OperationalError;
16101   var es52 = require_es5();
16102   function isUntypedError(obj) {
16103     return obj instanceof Error && es52.getPrototypeOf(obj) === Error.prototype;
16104   }
16105   var rErrorKey = /^(?:name|message|stack|cause)$/;
16106   function wrapAsOperationalError(obj) {
16107     var ret2;
16108     if (isUntypedError(obj)) {
16109       ret2 = new OperationalError(obj);
16110       ret2.name = obj.name;
16111       ret2.message = obj.message;
16112       ret2.stack = obj.stack;
16113       var keys = es52.keys(obj);
16114       for (var i = 0; i < keys.length; ++i) {
16115         var key = keys[i];
16116         if (!rErrorKey.test(key)) {
16117           ret2[key] = obj[key];
16118         }
16119       }
16120       return ret2;
16121     }
16122     util.markAsOriginatingFromRejection(obj);
16123     return obj;
16124   }
16125   function nodebackForPromise(promise, multiArgs) {
16126     return function(err, value) {
16127       if (promise === null)
16128         return;
16129       if (err) {
16130         var wrapped = wrapAsOperationalError(maybeWrapAsError2(err));
16131         promise._attachExtraTrace(wrapped);
16132         promise._reject(wrapped);
16133       } else if (!multiArgs) {
16134         promise._fulfill(value);
16135       } else {
16136         var $_len = arguments.length;
16137         var args = new Array(Math.max($_len - 1, 0));
16138         for (var $_i = 1; $_i < $_len; ++$_i) {
16139           args[$_i - 1] = arguments[$_i];
16140         }
16141         ;
16142         promise._fulfill(args);
16143       }
16144       promise = null;
16145     };
16146   }
16147   module2.exports = nodebackForPromise;
16148 });
16149
16150 // node_modules/bluebird/js/release/method.js
16151 var require_method = __commonJS((exports2, module2) => {
16152   "use strict";
16153   module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug) {
16154     var util = require_util();
16155     var tryCatch2 = util.tryCatch;
16156     Promise2.method = function(fn) {
16157       if (typeof fn !== "function") {
16158         throw new Promise2.TypeError("expecting a function but got " + util.classString(fn));
16159       }
16160       return function() {
16161         var ret2 = new Promise2(INTERNAL);
16162         ret2._captureStackTrace();
16163         ret2._pushContext();
16164         var value = tryCatch2(fn).apply(this, arguments);
16165         var promiseCreated = ret2._popContext();
16166         debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret2);
16167         ret2._resolveFromSyncValue(value);
16168         return ret2;
16169       };
16170     };
16171     Promise2.attempt = Promise2["try"] = function(fn) {
16172       if (typeof fn !== "function") {
16173         return apiRejection("expecting a function but got " + util.classString(fn));
16174       }
16175       var ret2 = new Promise2(INTERNAL);
16176       ret2._captureStackTrace();
16177       ret2._pushContext();
16178       var value;
16179       if (arguments.length > 1) {
16180         debug.deprecated("calling Promise.try with more than 1 argument");
16181         var arg = arguments[1];
16182         var ctx = arguments[2];
16183         value = util.isArray(arg) ? tryCatch2(fn).apply(ctx, arg) : tryCatch2(fn).call(ctx, arg);
16184       } else {
16185         value = tryCatch2(fn)();
16186       }
16187       var promiseCreated = ret2._popContext();
16188       debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret2);
16189       ret2._resolveFromSyncValue(value);
16190       return ret2;
16191     };
16192     Promise2.prototype._resolveFromSyncValue = function(value) {
16193       if (value === util.errorObj) {
16194         this._rejectCallback(value.e, false);
16195       } else {
16196         this._resolveCallback(value, true);
16197       }
16198     };
16199   };
16200 });
16201
16202 // node_modules/bluebird/js/release/bind.js
16203 var require_bind = __commonJS((exports2, module2) => {
16204   "use strict";
16205   module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, debug) {
16206     var calledBind = false;
16207     var rejectThis = function(_, e) {
16208       this._reject(e);
16209     };
16210     var targetRejected = function(e, context) {
16211       context.promiseRejectionQueued = true;
16212       context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
16213     };
16214     var bindingResolved = function(thisArg, context) {
16215       if ((this._bitField & 50397184) === 0) {
16216         this._resolveCallback(context.target);
16217       }
16218     };
16219     var bindingRejected = function(e, context) {
16220       if (!context.promiseRejectionQueued)
16221         this._reject(e);
16222     };
16223     Promise2.prototype.bind = function(thisArg) {
16224       if (!calledBind) {
16225         calledBind = true;
16226         Promise2.prototype._propagateFrom = debug.propagateFromFunction();
16227         Promise2.prototype._boundValue = debug.boundValueFunction();
16228       }
16229       var maybePromise = tryConvertToPromise(thisArg);
16230       var ret2 = new Promise2(INTERNAL);
16231       ret2._propagateFrom(this, 1);
16232       var target = this._target();
16233       ret2._setBoundTo(maybePromise);
16234       if (maybePromise instanceof Promise2) {
16235         var context = {
16236           promiseRejectionQueued: false,
16237           promise: ret2,
16238           target,
16239           bindingPromise: maybePromise
16240         };
16241         target._then(INTERNAL, targetRejected, void 0, ret2, context);
16242         maybePromise._then(bindingResolved, bindingRejected, void 0, ret2, context);
16243         ret2._setOnCancel(maybePromise);
16244       } else {
16245         ret2._resolveCallback(target);
16246       }
16247       return ret2;
16248     };
16249     Promise2.prototype._setBoundTo = function(obj) {
16250       if (obj !== void 0) {
16251         this._bitField = this._bitField | 2097152;
16252         this._boundTo = obj;
16253       } else {
16254         this._bitField = this._bitField & ~2097152;
16255       }
16256     };
16257     Promise2.prototype._isBound = function() {
16258       return (this._bitField & 2097152) === 2097152;
16259     };
16260     Promise2.bind = function(thisArg, value) {
16261       return Promise2.resolve(value).bind(thisArg);
16262     };
16263   };
16264 });
16265
16266 // node_modules/bluebird/js/release/cancel.js
16267 var require_cancel = __commonJS((exports2, module2) => {
16268   "use strict";
16269   module2.exports = function(Promise2, PromiseArray, apiRejection, debug) {
16270     var util = require_util();
16271     var tryCatch2 = util.tryCatch;
16272     var errorObj2 = util.errorObj;
16273     var async = Promise2._async;
16274     Promise2.prototype["break"] = Promise2.prototype.cancel = function() {
16275       if (!debug.cancellation())
16276         return this._warn("cancellation is disabled");
16277       var promise = this;
16278       var child = promise;
16279       while (promise._isCancellable()) {
16280         if (!promise._cancelBy(child)) {
16281           if (child._isFollowing()) {
16282             child._followee().cancel();
16283           } else {
16284             child._cancelBranched();
16285           }
16286           break;
16287         }
16288         var parent = promise._cancellationParent;
16289         if (parent == null || !parent._isCancellable()) {
16290           if (promise._isFollowing()) {
16291             promise._followee().cancel();
16292           } else {
16293             promise._cancelBranched();
16294           }
16295           break;
16296         } else {
16297           if (promise._isFollowing())
16298             promise._followee().cancel();
16299           promise._setWillBeCancelled();
16300           child = promise;
16301           promise = parent;
16302         }
16303       }
16304     };
16305     Promise2.prototype._branchHasCancelled = function() {
16306       this._branchesRemainingToCancel--;
16307     };
16308     Promise2.prototype._enoughBranchesHaveCancelled = function() {
16309       return this._branchesRemainingToCancel === void 0 || this._branchesRemainingToCancel <= 0;
16310     };
16311     Promise2.prototype._cancelBy = function(canceller) {
16312       if (canceller === this) {
16313         this._branchesRemainingToCancel = 0;
16314         this._invokeOnCancel();
16315         return true;
16316       } else {
16317         this._branchHasCancelled();
16318         if (this._enoughBranchesHaveCancelled()) {
16319           this._invokeOnCancel();
16320           return true;
16321         }
16322       }
16323       return false;
16324     };
16325     Promise2.prototype._cancelBranched = function() {
16326       if (this._enoughBranchesHaveCancelled()) {
16327         this._cancel();
16328       }
16329     };
16330     Promise2.prototype._cancel = function() {
16331       if (!this._isCancellable())
16332         return;
16333       this._setCancelled();
16334       async.invoke(this._cancelPromises, this, void 0);
16335     };
16336     Promise2.prototype._cancelPromises = function() {
16337       if (this._length() > 0)
16338         this._settlePromises();
16339     };
16340     Promise2.prototype._unsetOnCancel = function() {
16341       this._onCancelField = void 0;
16342     };
16343     Promise2.prototype._isCancellable = function() {
16344       return this.isPending() && !this._isCancelled();
16345     };
16346     Promise2.prototype.isCancellable = function() {
16347       return this.isPending() && !this.isCancelled();
16348     };
16349     Promise2.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {
16350       if (util.isArray(onCancelCallback)) {
16351         for (var i = 0; i < onCancelCallback.length; ++i) {
16352           this._doInvokeOnCancel(onCancelCallback[i], internalOnly);
16353         }
16354       } else if (onCancelCallback !== void 0) {
16355         if (typeof onCancelCallback === "function") {
16356           if (!internalOnly) {
16357             var e = tryCatch2(onCancelCallback).call(this._boundValue());
16358             if (e === errorObj2) {
16359               this._attachExtraTrace(e.e);
16360               async.throwLater(e.e);
16361             }
16362           }
16363         } else {
16364           onCancelCallback._resultCancelled(this);
16365         }
16366       }
16367     };
16368     Promise2.prototype._invokeOnCancel = function() {
16369       var onCancelCallback = this._onCancel();
16370       this._unsetOnCancel();
16371       async.invoke(this._doInvokeOnCancel, this, onCancelCallback);
16372     };
16373     Promise2.prototype._invokeInternalOnCancel = function() {
16374       if (this._isCancellable()) {
16375         this._doInvokeOnCancel(this._onCancel(), true);
16376         this._unsetOnCancel();
16377       }
16378     };
16379     Promise2.prototype._resultCancelled = function() {
16380       this.cancel();
16381     };
16382   };
16383 });
16384
16385 // node_modules/bluebird/js/release/direct_resolve.js
16386 var require_direct_resolve = __commonJS((exports2, module2) => {
16387   "use strict";
16388   module2.exports = function(Promise2) {
16389     function returner() {
16390       return this.value;
16391     }
16392     function thrower2() {
16393       throw this.reason;
16394     }
16395     Promise2.prototype["return"] = Promise2.prototype.thenReturn = function(value) {
16396       if (value instanceof Promise2)
16397         value.suppressUnhandledRejections();
16398       return this._then(returner, void 0, void 0, {value}, void 0);
16399     };
16400     Promise2.prototype["throw"] = Promise2.prototype.thenThrow = function(reason) {
16401       return this._then(thrower2, void 0, void 0, {reason}, void 0);
16402     };
16403     Promise2.prototype.catchThrow = function(reason) {
16404       if (arguments.length <= 1) {
16405         return this._then(void 0, thrower2, void 0, {reason}, void 0);
16406       } else {
16407         var _reason = arguments[1];
16408         var handler = function() {
16409           throw _reason;
16410         };
16411         return this.caught(reason, handler);
16412       }
16413     };
16414     Promise2.prototype.catchReturn = function(value) {
16415       if (arguments.length <= 1) {
16416         if (value instanceof Promise2)
16417           value.suppressUnhandledRejections();
16418         return this._then(void 0, returner, void 0, {value}, void 0);
16419       } else {
16420         var _value = arguments[1];
16421         if (_value instanceof Promise2)
16422           _value.suppressUnhandledRejections();
16423         var handler = function() {
16424           return _value;
16425         };
16426         return this.caught(value, handler);
16427       }
16428     };
16429   };
16430 });
16431
16432 // node_modules/bluebird/js/release/synchronous_inspection.js
16433 var require_synchronous_inspection = __commonJS((exports2, module2) => {
16434   "use strict";
16435   module2.exports = function(Promise2) {
16436     function PromiseInspection(promise) {
16437       if (promise !== void 0) {
16438         promise = promise._target();
16439         this._bitField = promise._bitField;
16440         this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0;
16441       } else {
16442         this._bitField = 0;
16443         this._settledValueField = void 0;
16444       }
16445     }
16446     PromiseInspection.prototype._settledValue = function() {
16447       return this._settledValueField;
16448     };
16449     var value = PromiseInspection.prototype.value = function() {
16450       if (!this.isFulfilled()) {
16451         throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");
16452       }
16453       return this._settledValue();
16454     };
16455     var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() {
16456       if (!this.isRejected()) {
16457         throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");
16458       }
16459       return this._settledValue();
16460     };
16461     var isFulfilled = PromiseInspection.prototype.isFulfilled = function() {
16462       return (this._bitField & 33554432) !== 0;
16463     };
16464     var isRejected = PromiseInspection.prototype.isRejected = function() {
16465       return (this._bitField & 16777216) !== 0;
16466     };
16467     var isPending = PromiseInspection.prototype.isPending = function() {
16468       return (this._bitField & 50397184) === 0;
16469     };
16470     var isResolved = PromiseInspection.prototype.isResolved = function() {
16471       return (this._bitField & 50331648) !== 0;
16472     };
16473     PromiseInspection.prototype.isCancelled = function() {
16474       return (this._bitField & 8454144) !== 0;
16475     };
16476     Promise2.prototype.__isCancelled = function() {
16477       return (this._bitField & 65536) === 65536;
16478     };
16479     Promise2.prototype._isCancelled = function() {
16480       return this._target().__isCancelled();
16481     };
16482     Promise2.prototype.isCancelled = function() {
16483       return (this._target()._bitField & 8454144) !== 0;
16484     };
16485     Promise2.prototype.isPending = function() {
16486       return isPending.call(this._target());
16487     };
16488     Promise2.prototype.isRejected = function() {
16489       return isRejected.call(this._target());
16490     };
16491     Promise2.prototype.isFulfilled = function() {
16492       return isFulfilled.call(this._target());
16493     };
16494     Promise2.prototype.isResolved = function() {
16495       return isResolved.call(this._target());
16496     };
16497     Promise2.prototype.value = function() {
16498       return value.call(this._target());
16499     };
16500     Promise2.prototype.reason = function() {
16501       var target = this._target();
16502       target._unsetRejectionIsUnhandled();
16503       return reason.call(target);
16504     };
16505     Promise2.prototype._value = function() {
16506       return this._settledValue();
16507     };
16508     Promise2.prototype._reason = function() {
16509       this._unsetRejectionIsUnhandled();
16510       return this._settledValue();
16511     };
16512     Promise2.PromiseInspection = PromiseInspection;
16513   };
16514 });
16515
16516 // node_modules/bluebird/js/release/join.js
16517 var require_join = __commonJS((exports2, module2) => {
16518   "use strict";
16519   module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain) {
16520     var util = require_util();
16521     var canEvaluate2 = util.canEvaluate;
16522     var tryCatch2 = util.tryCatch;
16523     var errorObj2 = util.errorObj;
16524     var reject;
16525     if (true) {
16526       if (canEvaluate2) {
16527         var thenCallback = function(i2) {
16528           return new Function("value", "holder", "                             \n            'use strict';                                                    \n            holder.pIndex = value;                                           \n            holder.checkFulfillment(this);                                   \n            ".replace(/Index/g, i2));
16529         };
16530         var promiseSetter = function(i2) {
16531           return new Function("promise", "holder", "                           \n            'use strict';                                                    \n            holder.pIndex = promise;                                         \n            ".replace(/Index/g, i2));
16532         };
16533         var generateHolderClass = function(total) {
16534           var props = new Array(total);
16535           for (var i2 = 0; i2 < props.length; ++i2) {
16536             props[i2] = "this.p" + (i2 + 1);
16537           }
16538           var assignment = props.join(" = ") + " = null;";
16539           var cancellationCode = "var promise;\n" + props.map(function(prop) {
16540             return "                                                         \n                promise = " + prop + ";                                      \n                if (promise instanceof Promise) {                            \n                    promise.cancel();                                        \n                }                                                            \n            ";
16541           }).join("\n");
16542           var passedArguments = props.join(", ");
16543           var name = "Holder$" + total;
16544           var code = "return function(tryCatch, errorObj, Promise, async) {    \n            'use strict';                                                    \n            function [TheName](fn) {                                         \n                [TheProperties]                                              \n                this.fn = fn;                                                \n                this.asyncNeeded = true;                                     \n                this.now = 0;                                                \n            }                                                                \n                                                                             \n            [TheName].prototype._callFunction = function(promise) {          \n                promise._pushContext();                                      \n                var ret = tryCatch(this.fn)([ThePassedArguments]);           \n                promise._popContext();                                       \n                if (ret === errorObj) {                                      \n                    promise._rejectCallback(ret.e, false);                   \n                } else {                                                     \n                    promise._resolveCallback(ret);                           \n                }                                                            \n            };                                                               \n                                                                             \n            [TheName].prototype.checkFulfillment = function(promise) {       \n                var now = ++this.now;                                        \n                if (now === [TheTotal]) {                                    \n                    if (this.asyncNeeded) {                                  \n                        async.invoke(this._callFunction, this, promise);     \n                    } else {                                                 \n                        this._callFunction(promise);                         \n                    }                                                        \n                                                                             \n                }                                                            \n            };                                                               \n                                                                             \n            [TheName].prototype._resultCancelled = function() {              \n                [CancellationCode]                                           \n            };                                                               \n                                                                             \n            return [TheName];                                                \n        }(tryCatch, errorObj, Promise, async);                               \n        ";
16545           code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode);
16546           return new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch2, errorObj2, Promise2, async);
16547         };
16548         var holderClasses = [];
16549         var thenCallbacks = [];
16550         var promiseSetters = [];
16551         for (var i = 0; i < 8; ++i) {
16552           holderClasses.push(generateHolderClass(i + 1));
16553           thenCallbacks.push(thenCallback(i + 1));
16554           promiseSetters.push(promiseSetter(i + 1));
16555         }
16556         reject = function(reason) {
16557           this._reject(reason);
16558         };
16559       }
16560     }
16561     Promise2.join = function() {
16562       var last = arguments.length - 1;
16563       var fn;
16564       if (last > 0 && typeof arguments[last] === "function") {
16565         fn = arguments[last];
16566         if (true) {
16567           if (last <= 8 && canEvaluate2) {
16568             var ret2 = new Promise2(INTERNAL);
16569             ret2._captureStackTrace();
16570             var HolderClass = holderClasses[last - 1];
16571             var holder = new HolderClass(fn);
16572             var callbacks = thenCallbacks;
16573             for (var i2 = 0; i2 < last; ++i2) {
16574               var maybePromise = tryConvertToPromise(arguments[i2], ret2);
16575               if (maybePromise instanceof Promise2) {
16576                 maybePromise = maybePromise._target();
16577                 var bitField = maybePromise._bitField;
16578                 ;
16579                 if ((bitField & 50397184) === 0) {
16580                   maybePromise._then(callbacks[i2], reject, void 0, ret2, holder);
16581                   promiseSetters[i2](maybePromise, holder);
16582                   holder.asyncNeeded = false;
16583                 } else if ((bitField & 33554432) !== 0) {
16584                   callbacks[i2].call(ret2, maybePromise._value(), holder);
16585                 } else if ((bitField & 16777216) !== 0) {
16586                   ret2._reject(maybePromise._reason());
16587                 } else {
16588                   ret2._cancel();
16589                 }
16590               } else {
16591                 callbacks[i2].call(ret2, maybePromise, holder);
16592               }
16593             }
16594             if (!ret2._isFateSealed()) {
16595               if (holder.asyncNeeded) {
16596                 var domain = getDomain();
16597                 if (domain !== null) {
16598                   holder.fn = util.domainBind(domain, holder.fn);
16599                 }
16600               }
16601               ret2._setAsyncGuaranteed();
16602               ret2._setOnCancel(holder);
16603             }
16604             return ret2;
16605           }
16606         }
16607       }
16608       var $_len = arguments.length;
16609       var args = new Array($_len);
16610       for (var $_i = 0; $_i < $_len; ++$_i) {
16611         args[$_i] = arguments[$_i];
16612       }
16613       ;
16614       if (fn)
16615         args.pop();
16616       var ret2 = new PromiseArray(args).promise();
16617       return fn !== void 0 ? ret2.spread(fn) : ret2;
16618     };
16619   };
16620 });
16621
16622 // node_modules/bluebird/js/release/map.js
16623 var require_map = __commonJS((exports2, module2) => {
16624   "use strict";
16625   module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) {
16626     var getDomain = Promise2._getDomain;
16627     var util = require_util();
16628     var tryCatch2 = util.tryCatch;
16629     var errorObj2 = util.errorObj;
16630     var async = Promise2._async;
16631     function MappingPromiseArray(promises, fn, limit, _filter) {
16632       this.constructor$(promises);
16633       this._promise._captureStackTrace();
16634       var domain = getDomain();
16635       this._callback = domain === null ? fn : util.domainBind(domain, fn);
16636       this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null;
16637       this._limit = limit;
16638       this._inFlight = 0;
16639       this._queue = [];
16640       async.invoke(this._asyncInit, this, void 0);
16641     }
16642     util.inherits(MappingPromiseArray, PromiseArray);
16643     MappingPromiseArray.prototype._asyncInit = function() {
16644       this._init$(void 0, -2);
16645     };
16646     MappingPromiseArray.prototype._init = function() {
16647     };
16648     MappingPromiseArray.prototype._promiseFulfilled = function(value, index) {
16649       var values = this._values;
16650       var length = this.length();
16651       var preservedValues = this._preservedValues;
16652       var limit = this._limit;
16653       if (index < 0) {
16654         index = index * -1 - 1;
16655         values[index] = value;
16656         if (limit >= 1) {
16657           this._inFlight--;
16658           this._drainQueue();
16659           if (this._isResolved())
16660             return true;
16661         }
16662       } else {
16663         if (limit >= 1 && this._inFlight >= limit) {
16664           values[index] = value;
16665           this._queue.push(index);
16666           return false;
16667         }
16668         if (preservedValues !== null)
16669           preservedValues[index] = value;
16670         var promise = this._promise;
16671         var callback = this._callback;
16672         var receiver = promise._boundValue();
16673         promise._pushContext();
16674         var ret2 = tryCatch2(callback).call(receiver, value, index, length);
16675         var promiseCreated = promise._popContext();
16676         debug.checkForgottenReturns(ret2, promiseCreated, preservedValues !== null ? "Promise.filter" : "Promise.map", promise);
16677         if (ret2 === errorObj2) {
16678           this._reject(ret2.e);
16679           return true;
16680         }
16681         var maybePromise = tryConvertToPromise(ret2, this._promise);
16682         if (maybePromise instanceof Promise2) {
16683           maybePromise = maybePromise._target();
16684           var bitField = maybePromise._bitField;
16685           ;
16686           if ((bitField & 50397184) === 0) {
16687             if (limit >= 1)
16688               this._inFlight++;
16689             values[index] = maybePromise;
16690             maybePromise._proxy(this, (index + 1) * -1);
16691             return false;
16692           } else if ((bitField & 33554432) !== 0) {
16693             ret2 = maybePromise._value();
16694           } else if ((bitField & 16777216) !== 0) {
16695             this._reject(maybePromise._reason());
16696             return true;
16697           } else {
16698             this._cancel();
16699             return true;
16700           }
16701         }
16702         values[index] = ret2;
16703       }
16704       var totalResolved = ++this._totalResolved;
16705       if (totalResolved >= length) {
16706         if (preservedValues !== null) {
16707           this._filter(values, preservedValues);
16708         } else {
16709           this._resolve(values);
16710         }
16711         return true;
16712       }
16713       return false;
16714     };
16715     MappingPromiseArray.prototype._drainQueue = function() {
16716       var queue = this._queue;
16717       var limit = this._limit;
16718       var values = this._values;
16719       while (queue.length > 0 && this._inFlight < limit) {
16720         if (this._isResolved())
16721           return;
16722         var index = queue.pop();
16723         this._promiseFulfilled(values[index], index);
16724       }
16725     };
16726     MappingPromiseArray.prototype._filter = function(booleans, values) {
16727       var len = values.length;
16728       var ret2 = new Array(len);
16729       var j = 0;
16730       for (var i = 0; i < len; ++i) {
16731         if (booleans[i])
16732           ret2[j++] = values[i];
16733       }
16734       ret2.length = j;
16735       this._resolve(ret2);
16736     };
16737     MappingPromiseArray.prototype.preservedValues = function() {
16738       return this._preservedValues;
16739     };
16740     function map(promises, fn, options, _filter) {
16741       if (typeof fn !== "function") {
16742         return apiRejection("expecting a function but got " + util.classString(fn));
16743       }
16744       var limit = 0;
16745       if (options !== void 0) {
16746         if (typeof options === "object" && options !== null) {
16747           if (typeof options.concurrency !== "number") {
16748             return Promise2.reject(new TypeError("'concurrency' must be a number but it is " + util.classString(options.concurrency)));
16749           }
16750           limit = options.concurrency;
16751         } else {
16752           return Promise2.reject(new TypeError("options argument must be an object but it is " + util.classString(options)));
16753         }
16754       }
16755       limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0;
16756       return new MappingPromiseArray(promises, fn, limit, _filter).promise();
16757     }
16758     Promise2.prototype.map = function(fn, options) {
16759       return map(this, fn, options, null);
16760     };
16761     Promise2.map = function(promises, fn, options, _filter) {
16762       return map(promises, fn, options, _filter);
16763     };
16764   };
16765 });
16766
16767 // node_modules/bluebird/js/release/call_get.js
16768 var require_call_get = __commonJS((exports2, module2) => {
16769   "use strict";
16770   var cr = Object.create;
16771   if (cr) {
16772     callerCache = cr(null);
16773     getterCache = cr(null);
16774     callerCache[" size"] = getterCache[" size"] = 0;
16775   }
16776   var callerCache;
16777   var getterCache;
16778   module2.exports = function(Promise2) {
16779     var util = require_util();
16780     var canEvaluate2 = util.canEvaluate;
16781     var isIdentifier2 = util.isIdentifier;
16782     var getMethodCaller;
16783     var getGetter;
16784     if (true) {
16785       var makeMethodCaller = function(methodName) {
16786         return new Function("ensureMethod", "                                    \n        return function(obj) {                                               \n            'use strict'                                                     \n            var len = this.length;                                           \n            ensureMethod(obj, 'methodName');                                 \n            switch(len) {                                                    \n                case 1: return obj.methodName(this[0]);                      \n                case 2: return obj.methodName(this[0], this[1]);             \n                case 3: return obj.methodName(this[0], this[1], this[2]);    \n                case 0: return obj.methodName();                             \n                default:                                                     \n                    return obj.methodName.apply(obj, this);                  \n            }                                                                \n        };                                                                   \n        ".replace(/methodName/g, methodName))(ensureMethod);
16787       };
16788       var makeGetter = function(propertyName) {
16789         return new Function("obj", "                                             \n        'use strict';                                                        \n        return obj.propertyName;                                             \n        ".replace("propertyName", propertyName));
16790       };
16791       var getCompiled = function(name, compiler, cache) {
16792         var ret2 = cache[name];
16793         if (typeof ret2 !== "function") {
16794           if (!isIdentifier2(name)) {
16795             return null;
16796           }
16797           ret2 = compiler(name);
16798           cache[name] = ret2;
16799           cache[" size"]++;
16800           if (cache[" size"] > 512) {
16801             var keys = Object.keys(cache);
16802             for (var i = 0; i < 256; ++i)
16803               delete cache[keys[i]];
16804             cache[" size"] = keys.length - 256;
16805           }
16806         }
16807         return ret2;
16808       };
16809       getMethodCaller = function(name) {
16810         return getCompiled(name, makeMethodCaller, callerCache);
16811       };
16812       getGetter = function(name) {
16813         return getCompiled(name, makeGetter, getterCache);
16814       };
16815     }
16816     function ensureMethod(obj, methodName) {
16817       var fn;
16818       if (obj != null)
16819         fn = obj[methodName];
16820       if (typeof fn !== "function") {
16821         var message = "Object " + util.classString(obj) + " has no method '" + util.toString(methodName) + "'";
16822         throw new Promise2.TypeError(message);
16823       }
16824       return fn;
16825     }
16826     function caller(obj) {
16827       var methodName = this.pop();
16828       var fn = ensureMethod(obj, methodName);
16829       return fn.apply(obj, this);
16830     }
16831     Promise2.prototype.call = function(methodName) {
16832       var $_len = arguments.length;
16833       var args = new Array(Math.max($_len - 1, 0));
16834       for (var $_i = 1; $_i < $_len; ++$_i) {
16835         args[$_i - 1] = arguments[$_i];
16836       }
16837       ;
16838       if (true) {
16839         if (canEvaluate2) {
16840           var maybeCaller = getMethodCaller(methodName);
16841           if (maybeCaller !== null) {
16842             return this._then(maybeCaller, void 0, void 0, args, void 0);
16843           }
16844         }
16845       }
16846       args.push(methodName);
16847       return this._then(caller, void 0, void 0, args, void 0);
16848     };
16849     function namedGetter(obj) {
16850       return obj[this];
16851     }
16852     function indexedGetter(obj) {
16853       var index = +this;
16854       if (index < 0)
16855         index = Math.max(0, index + obj.length);
16856       return obj[index];
16857     }
16858     Promise2.prototype.get = function(propertyName) {
16859       var isIndex = typeof propertyName === "number";
16860       var getter;
16861       if (!isIndex) {
16862         if (canEvaluate2) {
16863           var maybeGetter = getGetter(propertyName);
16864           getter = maybeGetter !== null ? maybeGetter : namedGetter;
16865         } else {
16866           getter = namedGetter;
16867         }
16868       } else {
16869         getter = indexedGetter;
16870       }
16871       return this._then(getter, void 0, void 0, propertyName, void 0);
16872     };
16873   };
16874 });
16875
16876 // node_modules/bluebird/js/release/using.js
16877 var require_using = __commonJS((exports2, module2) => {
16878   "use strict";
16879   module2.exports = function(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) {
16880     var util = require_util();
16881     var TypeError2 = require_errors().TypeError;
16882     var inherits2 = require_util().inherits;
16883     var errorObj2 = util.errorObj;
16884     var tryCatch2 = util.tryCatch;
16885     var NULL = {};
16886     function thrower2(e) {
16887       setTimeout(function() {
16888         throw e;
16889       }, 0);
16890     }
16891     function castPreservingDisposable(thenable) {
16892       var maybePromise = tryConvertToPromise(thenable);
16893       if (maybePromise !== thenable && typeof thenable._isDisposable === "function" && typeof thenable._getDisposer === "function" && thenable._isDisposable()) {
16894         maybePromise._setDisposable(thenable._getDisposer());
16895       }
16896       return maybePromise;
16897     }
16898     function dispose(resources, inspection) {
16899       var i = 0;
16900       var len = resources.length;
16901       var ret2 = new Promise2(INTERNAL);
16902       function iterator() {
16903         if (i >= len)
16904           return ret2._fulfill();
16905         var maybePromise = castPreservingDisposable(resources[i++]);
16906         if (maybePromise instanceof Promise2 && maybePromise._isDisposable()) {
16907           try {
16908             maybePromise = tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection), resources.promise);
16909           } catch (e) {
16910             return thrower2(e);
16911           }
16912           if (maybePromise instanceof Promise2) {
16913             return maybePromise._then(iterator, thrower2, null, null, null);
16914           }
16915         }
16916         iterator();
16917       }
16918       iterator();
16919       return ret2;
16920     }
16921     function Disposer(data, promise, context) {
16922       this._data = data;
16923       this._promise = promise;
16924       this._context = context;
16925     }
16926     Disposer.prototype.data = function() {
16927       return this._data;
16928     };
16929     Disposer.prototype.promise = function() {
16930       return this._promise;
16931     };
16932     Disposer.prototype.resource = function() {
16933       if (this.promise().isFulfilled()) {
16934         return this.promise().value();
16935       }
16936       return NULL;
16937     };
16938     Disposer.prototype.tryDispose = function(inspection) {
16939       var resource = this.resource();
16940       var context = this._context;
16941       if (context !== void 0)
16942         context._pushContext();
16943       var ret2 = resource !== NULL ? this.doDispose(resource, inspection) : null;
16944       if (context !== void 0)
16945         context._popContext();
16946       this._promise._unsetDisposable();
16947       this._data = null;
16948       return ret2;
16949     };
16950     Disposer.isDisposer = function(d) {
16951       return d != null && typeof d.resource === "function" && typeof d.tryDispose === "function";
16952     };
16953     function FunctionDisposer(fn, promise, context) {
16954       this.constructor$(fn, promise, context);
16955     }
16956     inherits2(FunctionDisposer, Disposer);
16957     FunctionDisposer.prototype.doDispose = function(resource, inspection) {
16958       var fn = this.data();
16959       return fn.call(resource, resource, inspection);
16960     };
16961     function maybeUnwrapDisposer(value) {
16962       if (Disposer.isDisposer(value)) {
16963         this.resources[this.index]._setDisposable(value);
16964         return value.promise();
16965       }
16966       return value;
16967     }
16968     function ResourceList(length) {
16969       this.length = length;
16970       this.promise = null;
16971       this[length - 1] = null;
16972     }
16973     ResourceList.prototype._resultCancelled = function() {
16974       var len = this.length;
16975       for (var i = 0; i < len; ++i) {
16976         var item = this[i];
16977         if (item instanceof Promise2) {
16978           item.cancel();
16979         }
16980       }
16981     };
16982     Promise2.using = function() {
16983       var len = arguments.length;
16984       if (len < 2)
16985         return apiRejection("you must pass at least 2 arguments to Promise.using");
16986       var fn = arguments[len - 1];
16987       if (typeof fn !== "function") {
16988         return apiRejection("expecting a function but got " + util.classString(fn));
16989       }
16990       var input;
16991       var spreadArgs = true;
16992       if (len === 2 && Array.isArray(arguments[0])) {
16993         input = arguments[0];
16994         len = input.length;
16995         spreadArgs = false;
16996       } else {
16997         input = arguments;
16998         len--;
16999       }
17000       var resources = new ResourceList(len);
17001       for (var i = 0; i < len; ++i) {
17002         var resource = input[i];
17003         if (Disposer.isDisposer(resource)) {
17004           var disposer = resource;
17005           resource = resource.promise();
17006           resource._setDisposable(disposer);
17007         } else {
17008           var maybePromise = tryConvertToPromise(resource);
17009           if (maybePromise instanceof Promise2) {
17010             resource = maybePromise._then(maybeUnwrapDisposer, null, null, {
17011               resources,
17012               index: i
17013             }, void 0);
17014           }
17015         }
17016         resources[i] = resource;
17017       }
17018       var reflectedResources = new Array(resources.length);
17019       for (var i = 0; i < reflectedResources.length; ++i) {
17020         reflectedResources[i] = Promise2.resolve(resources[i]).reflect();
17021       }
17022       var resultPromise = Promise2.all(reflectedResources).then(function(inspections) {
17023         for (var i2 = 0; i2 < inspections.length; ++i2) {
17024           var inspection = inspections[i2];
17025           if (inspection.isRejected()) {
17026             errorObj2.e = inspection.error();
17027             return errorObj2;
17028           } else if (!inspection.isFulfilled()) {
17029             resultPromise.cancel();
17030             return;
17031           }
17032           inspections[i2] = inspection.value();
17033         }
17034         promise._pushContext();
17035         fn = tryCatch2(fn);
17036         var ret2 = spreadArgs ? fn.apply(void 0, inspections) : fn(inspections);
17037         var promiseCreated = promise._popContext();
17038         debug.checkForgottenReturns(ret2, promiseCreated, "Promise.using", promise);
17039         return ret2;
17040       });
17041       var promise = resultPromise.lastly(function() {
17042         var inspection = new Promise2.PromiseInspection(resultPromise);
17043         return dispose(resources, inspection);
17044       });
17045       resources.promise = promise;
17046       promise._setOnCancel(resources);
17047       return promise;
17048     };
17049     Promise2.prototype._setDisposable = function(disposer) {
17050       this._bitField = this._bitField | 131072;
17051       this._disposer = disposer;
17052     };
17053     Promise2.prototype._isDisposable = function() {
17054       return (this._bitField & 131072) > 0;
17055     };
17056     Promise2.prototype._getDisposer = function() {
17057       return this._disposer;
17058     };
17059     Promise2.prototype._unsetDisposable = function() {
17060       this._bitField = this._bitField & ~131072;
17061       this._disposer = void 0;
17062     };
17063     Promise2.prototype.disposer = function(fn) {
17064       if (typeof fn === "function") {
17065         return new FunctionDisposer(fn, this, createContext());
17066       }
17067       throw new TypeError2();
17068     };
17069   };
17070 });
17071
17072 // node_modules/bluebird/js/release/timers.js
17073 var require_timers = __commonJS((exports2, module2) => {
17074   "use strict";
17075   module2.exports = function(Promise2, INTERNAL, debug) {
17076     var util = require_util();
17077     var TimeoutError = Promise2.TimeoutError;
17078     function HandleWrapper(handle) {
17079       this.handle = handle;
17080     }
17081     HandleWrapper.prototype._resultCancelled = function() {
17082       clearTimeout(this.handle);
17083     };
17084     var afterValue = function(value) {
17085       return delay(+this).thenReturn(value);
17086     };
17087     var delay = Promise2.delay = function(ms, value) {
17088       var ret2;
17089       var handle;
17090       if (value !== void 0) {
17091         ret2 = Promise2.resolve(value)._then(afterValue, null, null, ms, void 0);
17092         if (debug.cancellation() && value instanceof Promise2) {
17093           ret2._setOnCancel(value);
17094         }
17095       } else {
17096         ret2 = new Promise2(INTERNAL);
17097         handle = setTimeout(function() {
17098           ret2._fulfill();
17099         }, +ms);
17100         if (debug.cancellation()) {
17101           ret2._setOnCancel(new HandleWrapper(handle));
17102         }
17103         ret2._captureStackTrace();
17104       }
17105       ret2._setAsyncGuaranteed();
17106       return ret2;
17107     };
17108     Promise2.prototype.delay = function(ms) {
17109       return delay(ms, this);
17110     };
17111     var afterTimeout = function(promise, message, parent) {
17112       var err;
17113       if (typeof message !== "string") {
17114         if (message instanceof Error) {
17115           err = message;
17116         } else {
17117           err = new TimeoutError("operation timed out");
17118         }
17119       } else {
17120         err = new TimeoutError(message);
17121       }
17122       util.markAsOriginatingFromRejection(err);
17123       promise._attachExtraTrace(err);
17124       promise._reject(err);
17125       if (parent != null) {
17126         parent.cancel();
17127       }
17128     };
17129     function successClear(value) {
17130       clearTimeout(this.handle);
17131       return value;
17132     }
17133     function failureClear(reason) {
17134       clearTimeout(this.handle);
17135       throw reason;
17136     }
17137     Promise2.prototype.timeout = function(ms, message) {
17138       ms = +ms;
17139       var ret2, parent;
17140       var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {
17141         if (ret2.isPending()) {
17142           afterTimeout(ret2, message, parent);
17143         }
17144       }, ms));
17145       if (debug.cancellation()) {
17146         parent = this.then();
17147         ret2 = parent._then(successClear, failureClear, void 0, handleWrapper, void 0);
17148         ret2._setOnCancel(handleWrapper);
17149       } else {
17150         ret2 = this._then(successClear, failureClear, void 0, handleWrapper, void 0);
17151       }
17152       return ret2;
17153     };
17154   };
17155 });
17156
17157 // node_modules/bluebird/js/release/generators.js
17158 var require_generators = __commonJS((exports2, module2) => {
17159   "use strict";
17160   module2.exports = function(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) {
17161     var errors = require_errors();
17162     var TypeError2 = errors.TypeError;
17163     var util = require_util();
17164     var errorObj2 = util.errorObj;
17165     var tryCatch2 = util.tryCatch;
17166     var yieldHandlers = [];
17167     function promiseFromYieldHandler(value, yieldHandlers2, traceParent) {
17168       for (var i = 0; i < yieldHandlers2.length; ++i) {
17169         traceParent._pushContext();
17170         var result = tryCatch2(yieldHandlers2[i])(value);
17171         traceParent._popContext();
17172         if (result === errorObj2) {
17173           traceParent._pushContext();
17174           var ret2 = Promise2.reject(errorObj2.e);
17175           traceParent._popContext();
17176           return ret2;
17177         }
17178         var maybePromise = tryConvertToPromise(result, traceParent);
17179         if (maybePromise instanceof Promise2)
17180           return maybePromise;
17181       }
17182       return null;
17183     }
17184     function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {
17185       if (debug.cancellation()) {
17186         var internal = new Promise2(INTERNAL);
17187         var _finallyPromise = this._finallyPromise = new Promise2(INTERNAL);
17188         this._promise = internal.lastly(function() {
17189           return _finallyPromise;
17190         });
17191         internal._captureStackTrace();
17192         internal._setOnCancel(this);
17193       } else {
17194         var promise = this._promise = new Promise2(INTERNAL);
17195         promise._captureStackTrace();
17196       }
17197       this._stack = stack;
17198       this._generatorFunction = generatorFunction;
17199       this._receiver = receiver;
17200       this._generator = void 0;
17201       this._yieldHandlers = typeof yieldHandler === "function" ? [yieldHandler].concat(yieldHandlers) : yieldHandlers;
17202       this._yieldedPromise = null;
17203       this._cancellationPhase = false;
17204     }
17205     util.inherits(PromiseSpawn, Proxyable);
17206     PromiseSpawn.prototype._isResolved = function() {
17207       return this._promise === null;
17208     };
17209     PromiseSpawn.prototype._cleanup = function() {
17210       this._promise = this._generator = null;
17211       if (debug.cancellation() && this._finallyPromise !== null) {
17212         this._finallyPromise._fulfill();
17213         this._finallyPromise = null;
17214       }
17215     };
17216     PromiseSpawn.prototype._promiseCancelled = function() {
17217       if (this._isResolved())
17218         return;
17219       var implementsReturn = typeof this._generator["return"] !== "undefined";
17220       var result;
17221       if (!implementsReturn) {
17222         var reason = new Promise2.CancellationError("generator .return() sentinel");
17223         Promise2.coroutine.returnSentinel = reason;
17224         this._promise._attachExtraTrace(reason);
17225         this._promise._pushContext();
17226         result = tryCatch2(this._generator["throw"]).call(this._generator, reason);
17227         this._promise._popContext();
17228       } else {
17229         this._promise._pushContext();
17230         result = tryCatch2(this._generator["return"]).call(this._generator, void 0);
17231         this._promise._popContext();
17232       }
17233       this._cancellationPhase = true;
17234       this._yieldedPromise = null;
17235       this._continue(result);
17236     };
17237     PromiseSpawn.prototype._promiseFulfilled = function(value) {
17238       this._yieldedPromise = null;
17239       this._promise._pushContext();
17240       var result = tryCatch2(this._generator.next).call(this._generator, value);
17241       this._promise._popContext();
17242       this._continue(result);
17243     };
17244     PromiseSpawn.prototype._promiseRejected = function(reason) {
17245       this._yieldedPromise = null;
17246       this._promise._attachExtraTrace(reason);
17247       this._promise._pushContext();
17248       var result = tryCatch2(this._generator["throw"]).call(this._generator, reason);
17249       this._promise._popContext();
17250       this._continue(result);
17251     };
17252     PromiseSpawn.prototype._resultCancelled = function() {
17253       if (this._yieldedPromise instanceof Promise2) {
17254         var promise = this._yieldedPromise;
17255         this._yieldedPromise = null;
17256         promise.cancel();
17257       }
17258     };
17259     PromiseSpawn.prototype.promise = function() {
17260       return this._promise;
17261     };
17262     PromiseSpawn.prototype._run = function() {
17263       this._generator = this._generatorFunction.call(this._receiver);
17264       this._receiver = this._generatorFunction = void 0;
17265       this._promiseFulfilled(void 0);
17266     };
17267     PromiseSpawn.prototype._continue = function(result) {
17268       var promise = this._promise;
17269       if (result === errorObj2) {
17270         this._cleanup();
17271         if (this._cancellationPhase) {
17272           return promise.cancel();
17273         } else {
17274           return promise._rejectCallback(result.e, false);
17275         }
17276       }
17277       var value = result.value;
17278       if (result.done === true) {
17279         this._cleanup();
17280         if (this._cancellationPhase) {
17281           return promise.cancel();
17282         } else {
17283           return promise._resolveCallback(value);
17284         }
17285       } else {
17286         var maybePromise = tryConvertToPromise(value, this._promise);
17287         if (!(maybePromise instanceof Promise2)) {
17288           maybePromise = promiseFromYieldHandler(maybePromise, this._yieldHandlers, this._promise);
17289           if (maybePromise === null) {
17290             this._promiseRejected(new TypeError2("A value %s was yielded that could not be treated as a promise\n\n    See http://goo.gl/MqrFmX\n\n".replace("%s", value) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n")));
17291             return;
17292           }
17293         }
17294         maybePromise = maybePromise._target();
17295         var bitField = maybePromise._bitField;
17296         ;
17297         if ((bitField & 50397184) === 0) {
17298           this._yieldedPromise = maybePromise;
17299           maybePromise._proxy(this, null);
17300         } else if ((bitField & 33554432) !== 0) {
17301           Promise2._async.invoke(this._promiseFulfilled, this, maybePromise._value());
17302         } else if ((bitField & 16777216) !== 0) {
17303           Promise2._async.invoke(this._promiseRejected, this, maybePromise._reason());
17304         } else {
17305           this._promiseCancelled();
17306         }
17307       }
17308     };
17309     Promise2.coroutine = function(generatorFunction, options) {
17310       if (typeof generatorFunction !== "function") {
17311         throw new TypeError2("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
17312       }
17313       var yieldHandler = Object(options).yieldHandler;
17314       var PromiseSpawn$ = PromiseSpawn;
17315       var stack = new Error().stack;
17316       return function() {
17317         var generator = generatorFunction.apply(this, arguments);
17318         var spawn = new PromiseSpawn$(void 0, void 0, yieldHandler, stack);
17319         var ret2 = spawn.promise();
17320         spawn._generator = generator;
17321         spawn._promiseFulfilled(void 0);
17322         return ret2;
17323       };
17324     };
17325     Promise2.coroutine.addYieldHandler = function(fn) {
17326       if (typeof fn !== "function") {
17327         throw new TypeError2("expecting a function but got " + util.classString(fn));
17328       }
17329       yieldHandlers.push(fn);
17330     };
17331     Promise2.spawn = function(generatorFunction) {
17332       debug.deprecated("Promise.spawn()", "Promise.coroutine()");
17333       if (typeof generatorFunction !== "function") {
17334         return apiRejection("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
17335       }
17336       var spawn = new PromiseSpawn(generatorFunction, this);
17337       var ret2 = spawn.promise();
17338       spawn._run(Promise2.spawn);
17339       return ret2;
17340     };
17341   };
17342 });
17343
17344 // node_modules/bluebird/js/release/nodeify.js
17345 var require_nodeify = __commonJS((exports2, module2) => {
17346   "use strict";
17347   module2.exports = function(Promise2) {
17348     var util = require_util();
17349     var async = Promise2._async;
17350     var tryCatch2 = util.tryCatch;
17351     var errorObj2 = util.errorObj;
17352     function spreadAdapter(val, nodeback) {
17353       var promise = this;
17354       if (!util.isArray(val))
17355         return successAdapter.call(promise, val, nodeback);
17356       var ret2 = tryCatch2(nodeback).apply(promise._boundValue(), [null].concat(val));
17357       if (ret2 === errorObj2) {
17358         async.throwLater(ret2.e);
17359       }
17360     }
17361     function successAdapter(val, nodeback) {
17362       var promise = this;
17363       var receiver = promise._boundValue();
17364       var ret2 = val === void 0 ? tryCatch2(nodeback).call(receiver, null) : tryCatch2(nodeback).call(receiver, null, val);
17365       if (ret2 === errorObj2) {
17366         async.throwLater(ret2.e);
17367       }
17368     }
17369     function errorAdapter(reason, nodeback) {
17370       var promise = this;
17371       if (!reason) {
17372         var newReason = new Error(reason + "");
17373         newReason.cause = reason;
17374         reason = newReason;
17375       }
17376       var ret2 = tryCatch2(nodeback).call(promise._boundValue(), reason);
17377       if (ret2 === errorObj2) {
17378         async.throwLater(ret2.e);
17379       }
17380     }
17381     Promise2.prototype.asCallback = Promise2.prototype.nodeify = function(nodeback, options) {
17382       if (typeof nodeback == "function") {
17383         var adapter = successAdapter;
17384         if (options !== void 0 && Object(options).spread) {
17385           adapter = spreadAdapter;
17386         }
17387         this._then(adapter, errorAdapter, void 0, this, nodeback);
17388       }
17389       return this;
17390     };
17391   };
17392 });
17393
17394 // node_modules/bluebird/js/release/promisify.js
17395 var require_promisify = __commonJS((exports2, module2) => {
17396   "use strict";
17397   module2.exports = function(Promise2, INTERNAL) {
17398     var THIS = {};
17399     var util = require_util();
17400     var nodebackForPromise = require_nodeback();
17401     var withAppended2 = util.withAppended;
17402     var maybeWrapAsError2 = util.maybeWrapAsError;
17403     var canEvaluate2 = util.canEvaluate;
17404     var TypeError2 = require_errors().TypeError;
17405     var defaultSuffix = "Async";
17406     var defaultPromisified = {__isPromisified__: true};
17407     var noCopyProps = [
17408       "arity",
17409       "length",
17410       "name",
17411       "arguments",
17412       "caller",
17413       "callee",
17414       "prototype",
17415       "__isPromisified__"
17416     ];
17417     var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");
17418     var defaultFilter = function(name) {
17419       return util.isIdentifier(name) && name.charAt(0) !== "_" && name !== "constructor";
17420     };
17421     function propsFilter(key) {
17422       return !noCopyPropsPattern.test(key);
17423     }
17424     function isPromisified(fn) {
17425       try {
17426         return fn.__isPromisified__ === true;
17427       } catch (e) {
17428         return false;
17429       }
17430     }
17431     function hasPromisified(obj, key, suffix) {
17432       var val = util.getDataPropertyOrDefault(obj, key + suffix, defaultPromisified);
17433       return val ? isPromisified(val) : false;
17434     }
17435     function checkValid(ret2, suffix, suffixRegexp) {
17436       for (var i = 0; i < ret2.length; i += 2) {
17437         var key = ret2[i];
17438         if (suffixRegexp.test(key)) {
17439           var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");
17440           for (var j = 0; j < ret2.length; j += 2) {
17441             if (ret2[j] === keyWithoutAsyncSuffix) {
17442               throw new TypeError2("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s", suffix));
17443             }
17444           }
17445         }
17446       }
17447     }
17448     function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
17449       var keys = util.inheritedDataKeys(obj);
17450       var ret2 = [];
17451       for (var i = 0; i < keys.length; ++i) {
17452         var key = keys[i];
17453         var value = obj[key];
17454         var passesDefaultFilter = filter === defaultFilter ? true : defaultFilter(key, value, obj);
17455         if (typeof value === "function" && !isPromisified(value) && !hasPromisified(obj, key, suffix) && filter(key, value, obj, passesDefaultFilter)) {
17456           ret2.push(key, value);
17457         }
17458       }
17459       checkValid(ret2, suffix, suffixRegexp);
17460       return ret2;
17461     }
17462     var escapeIdentRegex = function(str) {
17463       return str.replace(/([$])/, "\\$");
17464     };
17465     var makeNodePromisifiedEval;
17466     if (true) {
17467       var switchCaseArgumentOrder = function(likelyArgumentCount) {
17468         var ret2 = [likelyArgumentCount];
17469         var min = Math.max(0, likelyArgumentCount - 1 - 3);
17470         for (var i = likelyArgumentCount - 1; i >= min; --i) {
17471           ret2.push(i);
17472         }
17473         for (var i = likelyArgumentCount + 1; i <= 3; ++i) {
17474           ret2.push(i);
17475         }
17476         return ret2;
17477       };
17478       var argumentSequence = function(argumentCount) {
17479         return util.filledRange(argumentCount, "_arg", "");
17480       };
17481       var parameterDeclaration = function(parameterCount2) {
17482         return util.filledRange(Math.max(parameterCount2, 3), "_arg", "");
17483       };
17484       var parameterCount = function(fn) {
17485         if (typeof fn.length === "number") {
17486           return Math.max(Math.min(fn.length, 1023 + 1), 0);
17487         }
17488         return 0;
17489       };
17490       makeNodePromisifiedEval = function(callback, receiver, originalName, fn, _, multiArgs) {
17491         var newParameterCount = Math.max(0, parameterCount(fn) - 1);
17492         var argumentOrder = switchCaseArgumentOrder(newParameterCount);
17493         var shouldProxyThis = typeof callback === "string" || receiver === THIS;
17494         function generateCallForArgumentCount(count) {
17495           var args = argumentSequence(count).join(", ");
17496           var comma = count > 0 ? ", " : "";
17497           var ret2;
17498           if (shouldProxyThis) {
17499             ret2 = "ret = callback.call(this, {{args}}, nodeback); break;\n";
17500           } else {
17501             ret2 = receiver === void 0 ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n";
17502           }
17503           return ret2.replace("{{args}}", args).replace(", ", comma);
17504         }
17505         function generateArgumentSwitchCase() {
17506           var ret2 = "";
17507           for (var i = 0; i < argumentOrder.length; ++i) {
17508             ret2 += "case " + argumentOrder[i] + ":" + generateCallForArgumentCount(argumentOrder[i]);
17509           }
17510           ret2 += "                                                             \n        default:                                                             \n            var args = new Array(len + 1);                                   \n            var i = 0;                                                       \n            for (var i = 0; i < len; ++i) {                                  \n               args[i] = arguments[i];                                       \n            }                                                                \n            args[i] = nodeback;                                              \n            [CodeForCall]                                                    \n            break;                                                           \n        ".replace("[CodeForCall]", shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n");
17511           return ret2;
17512         }
17513         var getFunctionCode = typeof callback === "string" ? "this != null ? this['" + callback + "'] : fn" : "fn";
17514         var body = "'use strict';                                                \n        var ret = function (Parameters) {                                    \n            'use strict';                                                    \n            var len = arguments.length;                                      \n            var promise = new Promise(INTERNAL);                             \n            promise._captureStackTrace();                                    \n            var nodeback = nodebackForPromise(promise, " + multiArgs + ");   \n            var ret;                                                         \n            var callback = tryCatch([GetFunctionCode]);                      \n            switch(len) {                                                    \n                [CodeForSwitchCase]                                          \n            }                                                                \n            if (ret === errorObj) {                                          \n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n            }                                                                \n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \n            return promise;                                                  \n        };                                                                   \n        notEnumerableProp(ret, '__isPromisified__', true);                   \n        return ret;                                                          \n    ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()).replace("[GetFunctionCode]", getFunctionCode);
17515         body = body.replace("Parameters", parameterDeclaration(newParameterCount));
17516         return new Function("Promise", "fn", "receiver", "withAppended", "maybeWrapAsError", "nodebackForPromise", "tryCatch", "errorObj", "notEnumerableProp", "INTERNAL", body)(Promise2, fn, receiver, withAppended2, maybeWrapAsError2, nodebackForPromise, util.tryCatch, util.errorObj, util.notEnumerableProp, INTERNAL);
17517       };
17518     }
17519     function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {
17520       var defaultThis = function() {
17521         return this;
17522       }();
17523       var method = callback;
17524       if (typeof method === "string") {
17525         callback = fn;
17526       }
17527       function promisified() {
17528         var _receiver = receiver;
17529         if (receiver === THIS)
17530           _receiver = this;
17531         var promise = new Promise2(INTERNAL);
17532         promise._captureStackTrace();
17533         var cb = typeof method === "string" && this !== defaultThis ? this[method] : callback;
17534         var fn2 = nodebackForPromise(promise, multiArgs);
17535         try {
17536           cb.apply(_receiver, withAppended2(arguments, fn2));
17537         } catch (e) {
17538           promise._rejectCallback(maybeWrapAsError2(e), true, true);
17539         }
17540         if (!promise._isFateSealed())
17541           promise._setAsyncGuaranteed();
17542         return promise;
17543       }
17544       util.notEnumerableProp(promisified, "__isPromisified__", true);
17545       return promisified;
17546     }
17547     var makeNodePromisified = canEvaluate2 ? makeNodePromisifiedEval : makeNodePromisifiedClosure;
17548     function promisifyAll(obj, suffix, filter, promisifier, multiArgs) {
17549       var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");
17550       var methods = promisifiableMethods(obj, suffix, suffixRegexp, filter);
17551       for (var i = 0, len = methods.length; i < len; i += 2) {
17552         var key = methods[i];
17553         var fn = methods[i + 1];
17554         var promisifiedKey = key + suffix;
17555         if (promisifier === makeNodePromisified) {
17556           obj[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);
17557         } else {
17558           var promisified = promisifier(fn, function() {
17559             return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);
17560           });
17561           util.notEnumerableProp(promisified, "__isPromisified__", true);
17562           obj[promisifiedKey] = promisified;
17563         }
17564       }
17565       util.toFastProperties(obj);
17566       return obj;
17567     }
17568     function promisify(callback, receiver, multiArgs) {
17569       return makeNodePromisified(callback, receiver, void 0, callback, null, multiArgs);
17570     }
17571     Promise2.promisify = function(fn, options) {
17572       if (typeof fn !== "function") {
17573         throw new TypeError2("expecting a function but got " + util.classString(fn));
17574       }
17575       if (isPromisified(fn)) {
17576         return fn;
17577       }
17578       options = Object(options);
17579       var receiver = options.context === void 0 ? THIS : options.context;
17580       var multiArgs = !!options.multiArgs;
17581       var ret2 = promisify(fn, receiver, multiArgs);
17582       util.copyDescriptors(fn, ret2, propsFilter);
17583       return ret2;
17584     };
17585     Promise2.promisifyAll = function(target, options) {
17586       if (typeof target !== "function" && typeof target !== "object") {
17587         throw new TypeError2("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");
17588       }
17589       options = Object(options);
17590       var multiArgs = !!options.multiArgs;
17591       var suffix = options.suffix;
17592       if (typeof suffix !== "string")
17593         suffix = defaultSuffix;
17594       var filter = options.filter;
17595       if (typeof filter !== "function")
17596         filter = defaultFilter;
17597       var promisifier = options.promisifier;
17598       if (typeof promisifier !== "function")
17599         promisifier = makeNodePromisified;
17600       if (!util.isIdentifier(suffix)) {
17601         throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");
17602       }
17603       var keys = util.inheritedDataKeys(target);
17604       for (var i = 0; i < keys.length; ++i) {
17605         var value = target[keys[i]];
17606         if (keys[i] !== "constructor" && util.isClass(value)) {
17607           promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs);
17608           promisifyAll(value, suffix, filter, promisifier, multiArgs);
17609         }
17610       }
17611       return promisifyAll(target, suffix, filter, promisifier, multiArgs);
17612     };
17613   };
17614 });
17615
17616 // node_modules/bluebird/js/release/props.js
17617 var require_props = __commonJS((exports2, module2) => {
17618   "use strict";
17619   module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, apiRejection) {
17620     var util = require_util();
17621     var isObject3 = util.isObject;
17622     var es52 = require_es5();
17623     var Es6Map;
17624     if (typeof Map === "function")
17625       Es6Map = Map;
17626     var mapToEntries = function() {
17627       var index = 0;
17628       var size = 0;
17629       function extractEntry(value, key) {
17630         this[index] = value;
17631         this[index + size] = key;
17632         index++;
17633       }
17634       return function mapToEntries2(map) {
17635         size = map.size;
17636         index = 0;
17637         var ret2 = new Array(map.size * 2);
17638         map.forEach(extractEntry, ret2);
17639         return ret2;
17640       };
17641     }();
17642     var entriesToMap = function(entries) {
17643       var ret2 = new Es6Map();
17644       var length = entries.length / 2 | 0;
17645       for (var i = 0; i < length; ++i) {
17646         var key = entries[length + i];
17647         var value = entries[i];
17648         ret2.set(key, value);
17649       }
17650       return ret2;
17651     };
17652     function PropertiesPromiseArray(obj) {
17653       var isMap = false;
17654       var entries;
17655       if (Es6Map !== void 0 && obj instanceof Es6Map) {
17656         entries = mapToEntries(obj);
17657         isMap = true;
17658       } else {
17659         var keys = es52.keys(obj);
17660         var len = keys.length;
17661         entries = new Array(len * 2);
17662         for (var i = 0; i < len; ++i) {
17663           var key = keys[i];
17664           entries[i] = obj[key];
17665           entries[i + len] = key;
17666         }
17667       }
17668       this.constructor$(entries);
17669       this._isMap = isMap;
17670       this._init$(void 0, -3);
17671     }
17672     util.inherits(PropertiesPromiseArray, PromiseArray);
17673     PropertiesPromiseArray.prototype._init = function() {
17674     };
17675     PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index) {
17676       this._values[index] = value;
17677       var totalResolved = ++this._totalResolved;
17678       if (totalResolved >= this._length) {
17679         var val;
17680         if (this._isMap) {
17681           val = entriesToMap(this._values);
17682         } else {
17683           val = {};
17684           var keyOffset = this.length();
17685           for (var i = 0, len = this.length(); i < len; ++i) {
17686             val[this._values[i + keyOffset]] = this._values[i];
17687           }
17688         }
17689         this._resolve(val);
17690         return true;
17691       }
17692       return false;
17693     };
17694     PropertiesPromiseArray.prototype.shouldCopyValues = function() {
17695       return false;
17696     };
17697     PropertiesPromiseArray.prototype.getActualLength = function(len) {
17698       return len >> 1;
17699     };
17700     function props(promises) {
17701       var ret2;
17702       var castValue = tryConvertToPromise(promises);
17703       if (!isObject3(castValue)) {
17704         return apiRejection("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n");
17705       } else if (castValue instanceof Promise2) {
17706         ret2 = castValue._then(Promise2.props, void 0, void 0, void 0, void 0);
17707       } else {
17708         ret2 = new PropertiesPromiseArray(castValue).promise();
17709       }
17710       if (castValue instanceof Promise2) {
17711         ret2._propagateFrom(castValue, 2);
17712       }
17713       return ret2;
17714     }
17715     Promise2.prototype.props = function() {
17716       return props(this);
17717     };
17718     Promise2.props = function(promises) {
17719       return props(promises);
17720     };
17721   };
17722 });
17723
17724 // node_modules/bluebird/js/release/race.js
17725 var require_race = __commonJS((exports2, module2) => {
17726   "use strict";
17727   module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection) {
17728     var util = require_util();
17729     var raceLater = function(promise) {
17730       return promise.then(function(array) {
17731         return race(array, promise);
17732       });
17733     };
17734     function race(promises, parent) {
17735       var maybePromise = tryConvertToPromise(promises);
17736       if (maybePromise instanceof Promise2) {
17737         return raceLater(maybePromise);
17738       } else {
17739         promises = util.asArray(promises);
17740         if (promises === null)
17741           return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));
17742       }
17743       var ret2 = new Promise2(INTERNAL);
17744       if (parent !== void 0) {
17745         ret2._propagateFrom(parent, 3);
17746       }
17747       var fulfill = ret2._fulfill;
17748       var reject = ret2._reject;
17749       for (var i = 0, len = promises.length; i < len; ++i) {
17750         var val = promises[i];
17751         if (val === void 0 && !(i in promises)) {
17752           continue;
17753         }
17754         Promise2.cast(val)._then(fulfill, reject, void 0, ret2, null);
17755       }
17756       return ret2;
17757     }
17758     Promise2.race = function(promises) {
17759       return race(promises, void 0);
17760     };
17761     Promise2.prototype.race = function() {
17762       return race(this, void 0);
17763     };
17764   };
17765 });
17766
17767 // node_modules/bluebird/js/release/reduce.js
17768 var require_reduce = __commonJS((exports2, module2) => {
17769   "use strict";
17770   module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) {
17771     var getDomain = Promise2._getDomain;
17772     var util = require_util();
17773     var tryCatch2 = util.tryCatch;
17774     function ReductionPromiseArray(promises, fn, initialValue, _each) {
17775       this.constructor$(promises);
17776       var domain = getDomain();
17777       this._fn = domain === null ? fn : util.domainBind(domain, fn);
17778       if (initialValue !== void 0) {
17779         initialValue = Promise2.resolve(initialValue);
17780         initialValue._attachCancellationCallback(this);
17781       }
17782       this._initialValue = initialValue;
17783       this._currentCancellable = null;
17784       if (_each === INTERNAL) {
17785         this._eachValues = Array(this._length);
17786       } else if (_each === 0) {
17787         this._eachValues = null;
17788       } else {
17789         this._eachValues = void 0;
17790       }
17791       this._promise._captureStackTrace();
17792       this._init$(void 0, -5);
17793     }
17794     util.inherits(ReductionPromiseArray, PromiseArray);
17795     ReductionPromiseArray.prototype._gotAccum = function(accum) {
17796       if (this._eachValues !== void 0 && this._eachValues !== null && accum !== INTERNAL) {
17797         this._eachValues.push(accum);
17798       }
17799     };
17800     ReductionPromiseArray.prototype._eachComplete = function(value) {
17801       if (this._eachValues !== null) {
17802         this._eachValues.push(value);
17803       }
17804       return this._eachValues;
17805     };
17806     ReductionPromiseArray.prototype._init = function() {
17807     };
17808     ReductionPromiseArray.prototype._resolveEmptyArray = function() {
17809       this._resolve(this._eachValues !== void 0 ? this._eachValues : this._initialValue);
17810     };
17811     ReductionPromiseArray.prototype.shouldCopyValues = function() {
17812       return false;
17813     };
17814     ReductionPromiseArray.prototype._resolve = function(value) {
17815       this._promise._resolveCallback(value);
17816       this._values = null;
17817     };
17818     ReductionPromiseArray.prototype._resultCancelled = function(sender) {
17819       if (sender === this._initialValue)
17820         return this._cancel();
17821       if (this._isResolved())
17822         return;
17823       this._resultCancelled$();
17824       if (this._currentCancellable instanceof Promise2) {
17825         this._currentCancellable.cancel();
17826       }
17827       if (this._initialValue instanceof Promise2) {
17828         this._initialValue.cancel();
17829       }
17830     };
17831     ReductionPromiseArray.prototype._iterate = function(values) {
17832       this._values = values;
17833       var value;
17834       var i;
17835       var length = values.length;
17836       if (this._initialValue !== void 0) {
17837         value = this._initialValue;
17838         i = 0;
17839       } else {
17840         value = Promise2.resolve(values[0]);
17841         i = 1;
17842       }
17843       this._currentCancellable = value;
17844       if (!value.isRejected()) {
17845         for (; i < length; ++i) {
17846           var ctx = {
17847             accum: null,
17848             value: values[i],
17849             index: i,
17850             length,
17851             array: this
17852           };
17853           value = value._then(gotAccum, void 0, void 0, ctx, void 0);
17854         }
17855       }
17856       if (this._eachValues !== void 0) {
17857         value = value._then(this._eachComplete, void 0, void 0, this, void 0);
17858       }
17859       value._then(completed, completed, void 0, value, this);
17860     };
17861     Promise2.prototype.reduce = function(fn, initialValue) {
17862       return reduce(this, fn, initialValue, null);
17863     };
17864     Promise2.reduce = function(promises, fn, initialValue, _each) {
17865       return reduce(promises, fn, initialValue, _each);
17866     };
17867     function completed(valueOrReason, array) {
17868       if (this.isFulfilled()) {
17869         array._resolve(valueOrReason);
17870       } else {
17871         array._reject(valueOrReason);
17872       }
17873     }
17874     function reduce(promises, fn, initialValue, _each) {
17875       if (typeof fn !== "function") {
17876         return apiRejection("expecting a function but got " + util.classString(fn));
17877       }
17878       var array = new ReductionPromiseArray(promises, fn, initialValue, _each);
17879       return array.promise();
17880     }
17881     function gotAccum(accum) {
17882       this.accum = accum;
17883       this.array._gotAccum(accum);
17884       var value = tryConvertToPromise(this.value, this.array._promise);
17885       if (value instanceof Promise2) {
17886         this.array._currentCancellable = value;
17887         return value._then(gotValue, void 0, void 0, this, void 0);
17888       } else {
17889         return gotValue.call(this, value);
17890       }
17891     }
17892     function gotValue(value) {
17893       var array = this.array;
17894       var promise = array._promise;
17895       var fn = tryCatch2(array._fn);
17896       promise._pushContext();
17897       var ret2;
17898       if (array._eachValues !== void 0) {
17899         ret2 = fn.call(promise._boundValue(), value, this.index, this.length);
17900       } else {
17901         ret2 = fn.call(promise._boundValue(), this.accum, value, this.index, this.length);
17902       }
17903       if (ret2 instanceof Promise2) {
17904         array._currentCancellable = ret2;
17905       }
17906       var promiseCreated = promise._popContext();
17907       debug.checkForgottenReturns(ret2, promiseCreated, array._eachValues !== void 0 ? "Promise.each" : "Promise.reduce", promise);
17908       return ret2;
17909     }
17910   };
17911 });
17912
17913 // node_modules/bluebird/js/release/settle.js
17914 var require_settle = __commonJS((exports2, module2) => {
17915   "use strict";
17916   module2.exports = function(Promise2, PromiseArray, debug) {
17917     var PromiseInspection = Promise2.PromiseInspection;
17918     var util = require_util();
17919     function SettledPromiseArray(values) {
17920       this.constructor$(values);
17921     }
17922     util.inherits(SettledPromiseArray, PromiseArray);
17923     SettledPromiseArray.prototype._promiseResolved = function(index, inspection) {
17924       this._values[index] = inspection;
17925       var totalResolved = ++this._totalResolved;
17926       if (totalResolved >= this._length) {
17927         this._resolve(this._values);
17928         return true;
17929       }
17930       return false;
17931     };
17932     SettledPromiseArray.prototype._promiseFulfilled = function(value, index) {
17933       var ret2 = new PromiseInspection();
17934       ret2._bitField = 33554432;
17935       ret2._settledValueField = value;
17936       return this._promiseResolved(index, ret2);
17937     };
17938     SettledPromiseArray.prototype._promiseRejected = function(reason, index) {
17939       var ret2 = new PromiseInspection();
17940       ret2._bitField = 16777216;
17941       ret2._settledValueField = reason;
17942       return this._promiseResolved(index, ret2);
17943     };
17944     Promise2.settle = function(promises) {
17945       debug.deprecated(".settle()", ".reflect()");
17946       return new SettledPromiseArray(promises).promise();
17947     };
17948     Promise2.prototype.settle = function() {
17949       return Promise2.settle(this);
17950     };
17951   };
17952 });
17953
17954 // node_modules/bluebird/js/release/some.js
17955 var require_some = __commonJS((exports2, module2) => {
17956   "use strict";
17957   module2.exports = function(Promise2, PromiseArray, apiRejection) {
17958     var util = require_util();
17959     var RangeError2 = require_errors().RangeError;
17960     var AggregateError = require_errors().AggregateError;
17961     var isArray = util.isArray;
17962     var CANCELLATION = {};
17963     function SomePromiseArray(values) {
17964       this.constructor$(values);
17965       this._howMany = 0;
17966       this._unwrap = false;
17967       this._initialized = false;
17968     }
17969     util.inherits(SomePromiseArray, PromiseArray);
17970     SomePromiseArray.prototype._init = function() {
17971       if (!this._initialized) {
17972         return;
17973       }
17974       if (this._howMany === 0) {
17975         this._resolve([]);
17976         return;
17977       }
17978       this._init$(void 0, -5);
17979       var isArrayResolved = isArray(this._values);
17980       if (!this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill()) {
17981         this._reject(this._getRangeError(this.length()));
17982       }
17983     };
17984     SomePromiseArray.prototype.init = function() {
17985       this._initialized = true;
17986       this._init();
17987     };
17988     SomePromiseArray.prototype.setUnwrap = function() {
17989       this._unwrap = true;
17990     };
17991     SomePromiseArray.prototype.howMany = function() {
17992       return this._howMany;
17993     };
17994     SomePromiseArray.prototype.setHowMany = function(count) {
17995       this._howMany = count;
17996     };
17997     SomePromiseArray.prototype._promiseFulfilled = function(value) {
17998       this._addFulfilled(value);
17999       if (this._fulfilled() === this.howMany()) {
18000         this._values.length = this.howMany();
18001         if (this.howMany() === 1 && this._unwrap) {
18002           this._resolve(this._values[0]);
18003         } else {
18004           this._resolve(this._values);
18005         }
18006         return true;
18007       }
18008       return false;
18009     };
18010     SomePromiseArray.prototype._promiseRejected = function(reason) {
18011       this._addRejected(reason);
18012       return this._checkOutcome();
18013     };
18014     SomePromiseArray.prototype._promiseCancelled = function() {
18015       if (this._values instanceof Promise2 || this._values == null) {
18016         return this._cancel();
18017       }
18018       this._addRejected(CANCELLATION);
18019       return this._checkOutcome();
18020     };
18021     SomePromiseArray.prototype._checkOutcome = function() {
18022       if (this.howMany() > this._canPossiblyFulfill()) {
18023         var e = new AggregateError();
18024         for (var i = this.length(); i < this._values.length; ++i) {
18025           if (this._values[i] !== CANCELLATION) {
18026             e.push(this._values[i]);
18027           }
18028         }
18029         if (e.length > 0) {
18030           this._reject(e);
18031         } else {
18032           this._cancel();
18033         }
18034         return true;
18035       }
18036       return false;
18037     };
18038     SomePromiseArray.prototype._fulfilled = function() {
18039       return this._totalResolved;
18040     };
18041     SomePromiseArray.prototype._rejected = function() {
18042       return this._values.length - this.length();
18043     };
18044     SomePromiseArray.prototype._addRejected = function(reason) {
18045       this._values.push(reason);
18046     };
18047     SomePromiseArray.prototype._addFulfilled = function(value) {
18048       this._values[this._totalResolved++] = value;
18049     };
18050     SomePromiseArray.prototype._canPossiblyFulfill = function() {
18051       return this.length() - this._rejected();
18052     };
18053     SomePromiseArray.prototype._getRangeError = function(count) {
18054       var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items";
18055       return new RangeError2(message);
18056     };
18057     SomePromiseArray.prototype._resolveEmptyArray = function() {
18058       this._reject(this._getRangeError(0));
18059     };
18060     function some(promises, howMany) {
18061       if ((howMany | 0) !== howMany || howMany < 0) {
18062         return apiRejection("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");
18063       }
18064       var ret2 = new SomePromiseArray(promises);
18065       var promise = ret2.promise();
18066       ret2.setHowMany(howMany);
18067       ret2.init();
18068       return promise;
18069     }
18070     Promise2.some = function(promises, howMany) {
18071       return some(promises, howMany);
18072     };
18073     Promise2.prototype.some = function(howMany) {
18074       return some(this, howMany);
18075     };
18076     Promise2._SomePromiseArray = SomePromiseArray;
18077   };
18078 });
18079
18080 // node_modules/bluebird/js/release/filter.js
18081 var require_filter = __commonJS((exports2, module2) => {
18082   "use strict";
18083   module2.exports = function(Promise2, INTERNAL) {
18084     var PromiseMap = Promise2.map;
18085     Promise2.prototype.filter = function(fn, options) {
18086       return PromiseMap(this, fn, options, INTERNAL);
18087     };
18088     Promise2.filter = function(promises, fn, options) {
18089       return PromiseMap(promises, fn, options, INTERNAL);
18090     };
18091   };
18092 });
18093
18094 // node_modules/bluebird/js/release/each.js
18095 var require_each = __commonJS((exports2, module2) => {
18096   "use strict";
18097   module2.exports = function(Promise2, INTERNAL) {
18098     var PromiseReduce = Promise2.reduce;
18099     var PromiseAll = Promise2.all;
18100     function promiseAllThis() {
18101       return PromiseAll(this);
18102     }
18103     function PromiseMapSeries(promises, fn) {
18104       return PromiseReduce(promises, fn, INTERNAL, INTERNAL);
18105     }
18106     Promise2.prototype.each = function(fn) {
18107       return PromiseReduce(this, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, this, void 0);
18108     };
18109     Promise2.prototype.mapSeries = function(fn) {
18110       return PromiseReduce(this, fn, INTERNAL, INTERNAL);
18111     };
18112     Promise2.each = function(promises, fn) {
18113       return PromiseReduce(promises, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, promises, void 0);
18114     };
18115     Promise2.mapSeries = PromiseMapSeries;
18116   };
18117 });
18118
18119 // node_modules/bluebird/js/release/any.js
18120 var require_any = __commonJS((exports2, module2) => {
18121   "use strict";
18122   module2.exports = function(Promise2) {
18123     var SomePromiseArray = Promise2._SomePromiseArray;
18124     function any(promises) {
18125       var ret2 = new SomePromiseArray(promises);
18126       var promise = ret2.promise();
18127       ret2.setHowMany(1);
18128       ret2.setUnwrap();
18129       ret2.init();
18130       return promise;
18131     }
18132     Promise2.any = function(promises) {
18133       return any(promises);
18134     };
18135     Promise2.prototype.any = function() {
18136       return any(this);
18137     };
18138   };
18139 });
18140
18141 // node_modules/bluebird/js/release/promise.js
18142 var require_promise = __commonJS((exports2, module2) => {
18143   "use strict";
18144   module2.exports = function() {
18145     var makeSelfResolutionError = function() {
18146       return new TypeError2("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n");
18147     };
18148     var reflectHandler = function() {
18149       return new Promise2.PromiseInspection(this._target());
18150     };
18151     var apiRejection = function(msg) {
18152       return Promise2.reject(new TypeError2(msg));
18153     };
18154     function Proxyable() {
18155     }
18156     var UNDEFINED_BINDING = {};
18157     var util = require_util();
18158     var getDomain;
18159     if (util.isNode) {
18160       getDomain = function() {
18161         var ret2 = process.domain;
18162         if (ret2 === void 0)
18163           ret2 = null;
18164         return ret2;
18165       };
18166     } else {
18167       getDomain = function() {
18168         return null;
18169       };
18170     }
18171     util.notEnumerableProp(Promise2, "_getDomain", getDomain);
18172     var es52 = require_es5();
18173     var Async = require_async();
18174     var async = new Async();
18175     es52.defineProperty(Promise2, "_async", {value: async});
18176     var errors = require_errors();
18177     var TypeError2 = Promise2.TypeError = errors.TypeError;
18178     Promise2.RangeError = errors.RangeError;
18179     var CancellationError = Promise2.CancellationError = errors.CancellationError;
18180     Promise2.TimeoutError = errors.TimeoutError;
18181     Promise2.OperationalError = errors.OperationalError;
18182     Promise2.RejectionError = errors.OperationalError;
18183     Promise2.AggregateError = errors.AggregateError;
18184     var INTERNAL = function() {
18185     };
18186     var APPLY = {};
18187     var NEXT_FILTER = {};
18188     var tryConvertToPromise = require_thenables()(Promise2, INTERNAL);
18189     var PromiseArray = require_promise_array()(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable);
18190     var Context = require_context()(Promise2);
18191     var createContext = Context.create;
18192     var debug = require_debuggability()(Promise2, Context);
18193     var CapturedTrace = debug.CapturedTrace;
18194     var PassThroughHandlerContext = require_finally()(Promise2, tryConvertToPromise);
18195     var catchFilter = require_catch_filter()(NEXT_FILTER);
18196     var nodebackForPromise = require_nodeback();
18197     var errorObj2 = util.errorObj;
18198     var tryCatch2 = util.tryCatch;
18199     function check(self2, executor) {
18200       if (typeof executor !== "function") {
18201         throw new TypeError2("expecting a function but got " + util.classString(executor));
18202       }
18203       if (self2.constructor !== Promise2) {
18204         throw new TypeError2("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n");
18205       }
18206     }
18207     function Promise2(executor) {
18208       this._bitField = 0;
18209       this._fulfillmentHandler0 = void 0;
18210       this._rejectionHandler0 = void 0;
18211       this._promise0 = void 0;
18212       this._receiver0 = void 0;
18213       if (executor !== INTERNAL) {
18214         check(this, executor);
18215         this._resolveFromExecutor(executor);
18216       }
18217       this._promiseCreated();
18218       this._fireEvent("promiseCreated", this);
18219     }
18220     Promise2.prototype.toString = function() {
18221       return "[object Promise]";
18222     };
18223     Promise2.prototype.caught = Promise2.prototype["catch"] = function(fn) {
18224       var len = arguments.length;
18225       if (len > 1) {
18226         var catchInstances = new Array(len - 1), j = 0, i;
18227         for (i = 0; i < len - 1; ++i) {
18228           var item = arguments[i];
18229           if (util.isObject(item)) {
18230             catchInstances[j++] = item;
18231           } else {
18232             return apiRejection("expecting an object but got A catch statement predicate " + util.classString(item));
18233           }
18234         }
18235         catchInstances.length = j;
18236         fn = arguments[i];
18237         return this.then(void 0, catchFilter(catchInstances, fn, this));
18238       }
18239       return this.then(void 0, fn);
18240     };
18241     Promise2.prototype.reflect = function() {
18242       return this._then(reflectHandler, reflectHandler, void 0, this, void 0);
18243     };
18244     Promise2.prototype.then = function(didFulfill, didReject) {
18245       if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== "function" && typeof didReject !== "function") {
18246         var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill);
18247         if (arguments.length > 1) {
18248           msg += ", " + util.classString(didReject);
18249         }
18250         this._warn(msg);
18251       }
18252       return this._then(didFulfill, didReject, void 0, void 0, void 0);
18253     };
18254     Promise2.prototype.done = function(didFulfill, didReject) {
18255       var promise = this._then(didFulfill, didReject, void 0, void 0, void 0);
18256       promise._setIsFinal();
18257     };
18258     Promise2.prototype.spread = function(fn) {
18259       if (typeof fn !== "function") {
18260         return apiRejection("expecting a function but got " + util.classString(fn));
18261       }
18262       return this.all()._then(fn, void 0, void 0, APPLY, void 0);
18263     };
18264     Promise2.prototype.toJSON = function() {
18265       var ret2 = {
18266         isFulfilled: false,
18267         isRejected: false,
18268         fulfillmentValue: void 0,
18269         rejectionReason: void 0
18270       };
18271       if (this.isFulfilled()) {
18272         ret2.fulfillmentValue = this.value();
18273         ret2.isFulfilled = true;
18274       } else if (this.isRejected()) {
18275         ret2.rejectionReason = this.reason();
18276         ret2.isRejected = true;
18277       }
18278       return ret2;
18279     };
18280     Promise2.prototype.all = function() {
18281       if (arguments.length > 0) {
18282         this._warn(".all() was passed arguments but it does not take any");
18283       }
18284       return new PromiseArray(this).promise();
18285     };
18286     Promise2.prototype.error = function(fn) {
18287       return this.caught(util.originatesFromRejection, fn);
18288     };
18289     Promise2.getNewLibraryCopy = module2.exports;
18290     Promise2.is = function(val) {
18291       return val instanceof Promise2;
18292     };
18293     Promise2.fromNode = Promise2.fromCallback = function(fn) {
18294       var ret2 = new Promise2(INTERNAL);
18295       ret2._captureStackTrace();
18296       var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false;
18297       var result = tryCatch2(fn)(nodebackForPromise(ret2, multiArgs));
18298       if (result === errorObj2) {
18299         ret2._rejectCallback(result.e, true);
18300       }
18301       if (!ret2._isFateSealed())
18302         ret2._setAsyncGuaranteed();
18303       return ret2;
18304     };
18305     Promise2.all = function(promises) {
18306       return new PromiseArray(promises).promise();
18307     };
18308     Promise2.cast = function(obj) {
18309       var ret2 = tryConvertToPromise(obj);
18310       if (!(ret2 instanceof Promise2)) {
18311         ret2 = new Promise2(INTERNAL);
18312         ret2._captureStackTrace();
18313         ret2._setFulfilled();
18314         ret2._rejectionHandler0 = obj;
18315       }
18316       return ret2;
18317     };
18318     Promise2.resolve = Promise2.fulfilled = Promise2.cast;
18319     Promise2.reject = Promise2.rejected = function(reason) {
18320       var ret2 = new Promise2(INTERNAL);
18321       ret2._captureStackTrace();
18322       ret2._rejectCallback(reason, true);
18323       return ret2;
18324     };
18325     Promise2.setScheduler = function(fn) {
18326       if (typeof fn !== "function") {
18327         throw new TypeError2("expecting a function but got " + util.classString(fn));
18328       }
18329       return async.setScheduler(fn);
18330     };
18331     Promise2.prototype._then = function(didFulfill, didReject, _, receiver, internalData) {
18332       var haveInternalData = internalData !== void 0;
18333       var promise = haveInternalData ? internalData : new Promise2(INTERNAL);
18334       var target = this._target();
18335       var bitField = target._bitField;
18336       if (!haveInternalData) {
18337         promise._propagateFrom(this, 3);
18338         promise._captureStackTrace();
18339         if (receiver === void 0 && (this._bitField & 2097152) !== 0) {
18340           if (!((bitField & 50397184) === 0)) {
18341             receiver = this._boundValue();
18342           } else {
18343             receiver = target === this ? void 0 : this._boundTo;
18344           }
18345         }
18346         this._fireEvent("promiseChained", this, promise);
18347       }
18348       var domain = getDomain();
18349       if (!((bitField & 50397184) === 0)) {
18350         var handler, value, settler = target._settlePromiseCtx;
18351         if ((bitField & 33554432) !== 0) {
18352           value = target._rejectionHandler0;
18353           handler = didFulfill;
18354         } else if ((bitField & 16777216) !== 0) {
18355           value = target._fulfillmentHandler0;
18356           handler = didReject;
18357           target._unsetRejectionIsUnhandled();
18358         } else {
18359           settler = target._settlePromiseLateCancellationObserver;
18360           value = new CancellationError("late cancellation observer");
18361           target._attachExtraTrace(value);
18362           handler = didReject;
18363         }
18364         async.invoke(settler, target, {
18365           handler: domain === null ? handler : typeof handler === "function" && util.domainBind(domain, handler),
18366           promise,
18367           receiver,
18368           value
18369         });
18370       } else {
18371         target._addCallbacks(didFulfill, didReject, promise, receiver, domain);
18372       }
18373       return promise;
18374     };
18375     Promise2.prototype._length = function() {
18376       return this._bitField & 65535;
18377     };
18378     Promise2.prototype._isFateSealed = function() {
18379       return (this._bitField & 117506048) !== 0;
18380     };
18381     Promise2.prototype._isFollowing = function() {
18382       return (this._bitField & 67108864) === 67108864;
18383     };
18384     Promise2.prototype._setLength = function(len) {
18385       this._bitField = this._bitField & -65536 | len & 65535;
18386     };
18387     Promise2.prototype._setFulfilled = function() {
18388       this._bitField = this._bitField | 33554432;
18389       this._fireEvent("promiseFulfilled", this);
18390     };
18391     Promise2.prototype._setRejected = function() {
18392       this._bitField = this._bitField | 16777216;
18393       this._fireEvent("promiseRejected", this);
18394     };
18395     Promise2.prototype._setFollowing = function() {
18396       this._bitField = this._bitField | 67108864;
18397       this._fireEvent("promiseResolved", this);
18398     };
18399     Promise2.prototype._setIsFinal = function() {
18400       this._bitField = this._bitField | 4194304;
18401     };
18402     Promise2.prototype._isFinal = function() {
18403       return (this._bitField & 4194304) > 0;
18404     };
18405     Promise2.prototype._unsetCancelled = function() {
18406       this._bitField = this._bitField & ~65536;
18407     };
18408     Promise2.prototype._setCancelled = function() {
18409       this._bitField = this._bitField | 65536;
18410       this._fireEvent("promiseCancelled", this);
18411     };
18412     Promise2.prototype._setWillBeCancelled = function() {
18413       this._bitField = this._bitField | 8388608;
18414     };
18415     Promise2.prototype._setAsyncGuaranteed = function() {
18416       if (async.hasCustomScheduler())
18417         return;
18418       this._bitField = this._bitField | 134217728;
18419     };
18420     Promise2.prototype._receiverAt = function(index) {
18421       var ret2 = index === 0 ? this._receiver0 : this[index * 4 - 4 + 3];
18422       if (ret2 === UNDEFINED_BINDING) {
18423         return void 0;
18424       } else if (ret2 === void 0 && this._isBound()) {
18425         return this._boundValue();
18426       }
18427       return ret2;
18428     };
18429     Promise2.prototype._promiseAt = function(index) {
18430       return this[index * 4 - 4 + 2];
18431     };
18432     Promise2.prototype._fulfillmentHandlerAt = function(index) {
18433       return this[index * 4 - 4 + 0];
18434     };
18435     Promise2.prototype._rejectionHandlerAt = function(index) {
18436       return this[index * 4 - 4 + 1];
18437     };
18438     Promise2.prototype._boundValue = function() {
18439     };
18440     Promise2.prototype._migrateCallback0 = function(follower) {
18441       var bitField = follower._bitField;
18442       var fulfill = follower._fulfillmentHandler0;
18443       var reject = follower._rejectionHandler0;
18444       var promise = follower._promise0;
18445       var receiver = follower._receiverAt(0);
18446       if (receiver === void 0)
18447         receiver = UNDEFINED_BINDING;
18448       this._addCallbacks(fulfill, reject, promise, receiver, null);
18449     };
18450     Promise2.prototype._migrateCallbackAt = function(follower, index) {
18451       var fulfill = follower._fulfillmentHandlerAt(index);
18452       var reject = follower._rejectionHandlerAt(index);
18453       var promise = follower._promiseAt(index);
18454       var receiver = follower._receiverAt(index);
18455       if (receiver === void 0)
18456         receiver = UNDEFINED_BINDING;
18457       this._addCallbacks(fulfill, reject, promise, receiver, null);
18458     };
18459     Promise2.prototype._addCallbacks = function(fulfill, reject, promise, receiver, domain) {
18460       var index = this._length();
18461       if (index >= 65535 - 4) {
18462         index = 0;
18463         this._setLength(0);
18464       }
18465       if (index === 0) {
18466         this._promise0 = promise;
18467         this._receiver0 = receiver;
18468         if (typeof fulfill === "function") {
18469           this._fulfillmentHandler0 = domain === null ? fulfill : util.domainBind(domain, fulfill);
18470         }
18471         if (typeof reject === "function") {
18472           this._rejectionHandler0 = domain === null ? reject : util.domainBind(domain, reject);
18473         }
18474       } else {
18475         var base = index * 4 - 4;
18476         this[base + 2] = promise;
18477         this[base + 3] = receiver;
18478         if (typeof fulfill === "function") {
18479           this[base + 0] = domain === null ? fulfill : util.domainBind(domain, fulfill);
18480         }
18481         if (typeof reject === "function") {
18482           this[base + 1] = domain === null ? reject : util.domainBind(domain, reject);
18483         }
18484       }
18485       this._setLength(index + 1);
18486       return index;
18487     };
18488     Promise2.prototype._proxy = function(proxyable, arg) {
18489       this._addCallbacks(void 0, void 0, arg, proxyable, null);
18490     };
18491     Promise2.prototype._resolveCallback = function(value, shouldBind) {
18492       if ((this._bitField & 117506048) !== 0)
18493         return;
18494       if (value === this)
18495         return this._rejectCallback(makeSelfResolutionError(), false);
18496       var maybePromise = tryConvertToPromise(value, this);
18497       if (!(maybePromise instanceof Promise2))
18498         return this._fulfill(value);
18499       if (shouldBind)
18500         this._propagateFrom(maybePromise, 2);
18501       var promise = maybePromise._target();
18502       if (promise === this) {
18503         this._reject(makeSelfResolutionError());
18504         return;
18505       }
18506       var bitField = promise._bitField;
18507       if ((bitField & 50397184) === 0) {
18508         var len = this._length();
18509         if (len > 0)
18510           promise._migrateCallback0(this);
18511         for (var i = 1; i < len; ++i) {
18512           promise._migrateCallbackAt(this, i);
18513         }
18514         this._setFollowing();
18515         this._setLength(0);
18516         this._setFollowee(promise);
18517       } else if ((bitField & 33554432) !== 0) {
18518         this._fulfill(promise._value());
18519       } else if ((bitField & 16777216) !== 0) {
18520         this._reject(promise._reason());
18521       } else {
18522         var reason = new CancellationError("late cancellation observer");
18523         promise._attachExtraTrace(reason);
18524         this._reject(reason);
18525       }
18526     };
18527     Promise2.prototype._rejectCallback = function(reason, synchronous, ignoreNonErrorWarnings) {
18528       var trace = util.ensureErrorObject(reason);
18529       var hasStack = trace === reason;
18530       if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {
18531         var message = "a promise was rejected with a non-error: " + util.classString(reason);
18532         this._warn(message, true);
18533       }
18534       this._attachExtraTrace(trace, synchronous ? hasStack : false);
18535       this._reject(reason);
18536     };
18537     Promise2.prototype._resolveFromExecutor = function(executor) {
18538       var promise = this;
18539       this._captureStackTrace();
18540       this._pushContext();
18541       var synchronous = true;
18542       var r = this._execute(executor, function(value) {
18543         promise._resolveCallback(value);
18544       }, function(reason) {
18545         promise._rejectCallback(reason, synchronous);
18546       });
18547       synchronous = false;
18548       this._popContext();
18549       if (r !== void 0) {
18550         promise._rejectCallback(r, true);
18551       }
18552     };
18553     Promise2.prototype._settlePromiseFromHandler = function(handler, receiver, value, promise) {
18554       var bitField = promise._bitField;
18555       if ((bitField & 65536) !== 0)
18556         return;
18557       promise._pushContext();
18558       var x;
18559       if (receiver === APPLY) {
18560         if (!value || typeof value.length !== "number") {
18561           x = errorObj2;
18562           x.e = new TypeError2("cannot .spread() a non-array: " + util.classString(value));
18563         } else {
18564           x = tryCatch2(handler).apply(this._boundValue(), value);
18565         }
18566       } else {
18567         x = tryCatch2(handler).call(receiver, value);
18568       }
18569       var promiseCreated = promise._popContext();
18570       bitField = promise._bitField;
18571       if ((bitField & 65536) !== 0)
18572         return;
18573       if (x === NEXT_FILTER) {
18574         promise._reject(value);
18575       } else if (x === errorObj2) {
18576         promise._rejectCallback(x.e, false);
18577       } else {
18578         debug.checkForgottenReturns(x, promiseCreated, "", promise, this);
18579         promise._resolveCallback(x);
18580       }
18581     };
18582     Promise2.prototype._target = function() {
18583       var ret2 = this;
18584       while (ret2._isFollowing())
18585         ret2 = ret2._followee();
18586       return ret2;
18587     };
18588     Promise2.prototype._followee = function() {
18589       return this._rejectionHandler0;
18590     };
18591     Promise2.prototype._setFollowee = function(promise) {
18592       this._rejectionHandler0 = promise;
18593     };
18594     Promise2.prototype._settlePromise = function(promise, handler, receiver, value) {
18595       var isPromise = promise instanceof Promise2;
18596       var bitField = this._bitField;
18597       var asyncGuaranteed = (bitField & 134217728) !== 0;
18598       if ((bitField & 65536) !== 0) {
18599         if (isPromise)
18600           promise._invokeInternalOnCancel();
18601         if (receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler()) {
18602           receiver.cancelPromise = promise;
18603           if (tryCatch2(handler).call(receiver, value) === errorObj2) {
18604             promise._reject(errorObj2.e);
18605           }
18606         } else if (handler === reflectHandler) {
18607           promise._fulfill(reflectHandler.call(receiver));
18608         } else if (receiver instanceof Proxyable) {
18609           receiver._promiseCancelled(promise);
18610         } else if (isPromise || promise instanceof PromiseArray) {
18611           promise._cancel();
18612         } else {
18613           receiver.cancel();
18614         }
18615       } else if (typeof handler === "function") {
18616         if (!isPromise) {
18617           handler.call(receiver, value, promise);
18618         } else {
18619           if (asyncGuaranteed)
18620             promise._setAsyncGuaranteed();
18621           this._settlePromiseFromHandler(handler, receiver, value, promise);
18622         }
18623       } else if (receiver instanceof Proxyable) {
18624         if (!receiver._isResolved()) {
18625           if ((bitField & 33554432) !== 0) {
18626             receiver._promiseFulfilled(value, promise);
18627           } else {
18628             receiver._promiseRejected(value, promise);
18629           }
18630         }
18631       } else if (isPromise) {
18632         if (asyncGuaranteed)
18633           promise._setAsyncGuaranteed();
18634         if ((bitField & 33554432) !== 0) {
18635           promise._fulfill(value);
18636         } else {
18637           promise._reject(value);
18638         }
18639       }
18640     };
18641     Promise2.prototype._settlePromiseLateCancellationObserver = function(ctx) {
18642       var handler = ctx.handler;
18643       var promise = ctx.promise;
18644       var receiver = ctx.receiver;
18645       var value = ctx.value;
18646       if (typeof handler === "function") {
18647         if (!(promise instanceof Promise2)) {
18648           handler.call(receiver, value, promise);
18649         } else {
18650           this._settlePromiseFromHandler(handler, receiver, value, promise);
18651         }
18652       } else if (promise instanceof Promise2) {
18653         promise._reject(value);
18654       }
18655     };
18656     Promise2.prototype._settlePromiseCtx = function(ctx) {
18657       this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);
18658     };
18659     Promise2.prototype._settlePromise0 = function(handler, value, bitField) {
18660       var promise = this._promise0;
18661       var receiver = this._receiverAt(0);
18662       this._promise0 = void 0;
18663       this._receiver0 = void 0;
18664       this._settlePromise(promise, handler, receiver, value);
18665     };
18666     Promise2.prototype._clearCallbackDataAtIndex = function(index) {
18667       var base = index * 4 - 4;
18668       this[base + 2] = this[base + 3] = this[base + 0] = this[base + 1] = void 0;
18669     };
18670     Promise2.prototype._fulfill = function(value) {
18671       var bitField = this._bitField;
18672       if ((bitField & 117506048) >>> 16)
18673         return;
18674       if (value === this) {
18675         var err = makeSelfResolutionError();
18676         this._attachExtraTrace(err);
18677         return this._reject(err);
18678       }
18679       this._setFulfilled();
18680       this._rejectionHandler0 = value;
18681       if ((bitField & 65535) > 0) {
18682         if ((bitField & 134217728) !== 0) {
18683           this._settlePromises();
18684         } else {
18685           async.settlePromises(this);
18686         }
18687       }
18688     };
18689     Promise2.prototype._reject = function(reason) {
18690       var bitField = this._bitField;
18691       if ((bitField & 117506048) >>> 16)
18692         return;
18693       this._setRejected();
18694       this._fulfillmentHandler0 = reason;
18695       if (this._isFinal()) {
18696         return async.fatalError(reason, util.isNode);
18697       }
18698       if ((bitField & 65535) > 0) {
18699         async.settlePromises(this);
18700       } else {
18701         this._ensurePossibleRejectionHandled();
18702       }
18703     };
18704     Promise2.prototype._fulfillPromises = function(len, value) {
18705       for (var i = 1; i < len; i++) {
18706         var handler = this._fulfillmentHandlerAt(i);
18707         var promise = this._promiseAt(i);
18708         var receiver = this._receiverAt(i);
18709         this._clearCallbackDataAtIndex(i);
18710         this._settlePromise(promise, handler, receiver, value);
18711       }
18712     };
18713     Promise2.prototype._rejectPromises = function(len, reason) {
18714       for (var i = 1; i < len; i++) {
18715         var handler = this._rejectionHandlerAt(i);
18716         var promise = this._promiseAt(i);
18717         var receiver = this._receiverAt(i);
18718         this._clearCallbackDataAtIndex(i);
18719         this._settlePromise(promise, handler, receiver, reason);
18720       }
18721     };
18722     Promise2.prototype._settlePromises = function() {
18723       var bitField = this._bitField;
18724       var len = bitField & 65535;
18725       if (len > 0) {
18726         if ((bitField & 16842752) !== 0) {
18727           var reason = this._fulfillmentHandler0;
18728           this._settlePromise0(this._rejectionHandler0, reason, bitField);
18729           this._rejectPromises(len, reason);
18730         } else {
18731           var value = this._rejectionHandler0;
18732           this._settlePromise0(this._fulfillmentHandler0, value, bitField);
18733           this._fulfillPromises(len, value);
18734         }
18735         this._setLength(0);
18736       }
18737       this._clearCancellationData();
18738     };
18739     Promise2.prototype._settledValue = function() {
18740       var bitField = this._bitField;
18741       if ((bitField & 33554432) !== 0) {
18742         return this._rejectionHandler0;
18743       } else if ((bitField & 16777216) !== 0) {
18744         return this._fulfillmentHandler0;
18745       }
18746     };
18747     function deferResolve(v) {
18748       this.promise._resolveCallback(v);
18749     }
18750     function deferReject(v) {
18751       this.promise._rejectCallback(v, false);
18752     }
18753     Promise2.defer = Promise2.pending = function() {
18754       debug.deprecated("Promise.defer", "new Promise");
18755       var promise = new Promise2(INTERNAL);
18756       return {
18757         promise,
18758         resolve: deferResolve,
18759         reject: deferReject
18760       };
18761     };
18762     util.notEnumerableProp(Promise2, "_makeSelfResolutionError", makeSelfResolutionError);
18763     require_method()(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug);
18764     require_bind()(Promise2, INTERNAL, tryConvertToPromise, debug);
18765     require_cancel()(Promise2, PromiseArray, apiRejection, debug);
18766     require_direct_resolve()(Promise2);
18767     require_synchronous_inspection()(Promise2);
18768     require_join()(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain);
18769     Promise2.Promise = Promise2;
18770     Promise2.version = "3.4.7";
18771     require_map()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);
18772     require_call_get()(Promise2);
18773     require_using()(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);
18774     require_timers()(Promise2, INTERNAL, debug);
18775     require_generators()(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);
18776     require_nodeify()(Promise2);
18777     require_promisify()(Promise2, INTERNAL);
18778     require_props()(Promise2, PromiseArray, tryConvertToPromise, apiRejection);
18779     require_race()(Promise2, INTERNAL, tryConvertToPromise, apiRejection);
18780     require_reduce()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);
18781     require_settle()(Promise2, PromiseArray, debug);
18782     require_some()(Promise2, PromiseArray, apiRejection);
18783     require_filter()(Promise2, INTERNAL);
18784     require_each()(Promise2, INTERNAL);
18785     require_any()(Promise2);
18786     util.toFastProperties(Promise2);
18787     util.toFastProperties(Promise2.prototype);
18788     function fillTypes(value) {
18789       var p = new Promise2(INTERNAL);
18790       p._fulfillmentHandler0 = value;
18791       p._rejectionHandler0 = value;
18792       p._promise0 = value;
18793       p._receiver0 = value;
18794     }
18795     fillTypes({a: 1});
18796     fillTypes({b: 2});
18797     fillTypes({c: 3});
18798     fillTypes(1);
18799     fillTypes(function() {
18800     });
18801     fillTypes(void 0);
18802     fillTypes(false);
18803     fillTypes(new Promise2(INTERNAL));
18804     debug.setBounds(Async.firstLineError, util.lastLineError);
18805     return Promise2;
18806   };
18807 });
18808
18809 // node_modules/bluebird/js/release/bluebird.js
18810 var require_bluebird = __commonJS((exports2, module2) => {
18811   "use strict";
18812   var old;
18813   if (typeof Promise !== "undefined")
18814     old = Promise;
18815   function noConflict() {
18816     try {
18817       if (Promise === bluebird)
18818         Promise = old;
18819     } catch (e) {
18820     }
18821     return bluebird;
18822   }
18823   var bluebird = require_promise()();
18824   bluebird.noConflict = noConflict;
18825   module2.exports = bluebird;
18826 });
18827
18828 // node_modules/unzipper/lib/Buffer.js
18829 var require_Buffer = __commonJS((exports2, module2) => {
18830   var Buffer2 = require("buffer").Buffer;
18831   if (Buffer2.from === void 0) {
18832     Buffer2.from = function(a, b, c) {
18833       return new Buffer2(a, b, c);
18834     };
18835     Buffer2.alloc = Buffer2.from;
18836   }
18837   module2.exports = Buffer2;
18838 });
18839
18840 // node_modules/process-nextick-args/index.js
18841 var require_process_nextick_args = __commonJS((exports2, module2) => {
18842   "use strict";
18843   if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
18844     module2.exports = {nextTick};
18845   } else {
18846     module2.exports = process;
18847   }
18848   function nextTick(fn, arg1, arg2, arg3) {
18849     if (typeof fn !== "function") {
18850       throw new TypeError('"callback" argument must be a function');
18851     }
18852     var len = arguments.length;
18853     var args, i;
18854     switch (len) {
18855       case 0:
18856       case 1:
18857         return process.nextTick(fn);
18858       case 2:
18859         return process.nextTick(function afterTickOne() {
18860           fn.call(null, arg1);
18861         });
18862       case 3:
18863         return process.nextTick(function afterTickTwo() {
18864           fn.call(null, arg1, arg2);
18865         });
18866       case 4:
18867         return process.nextTick(function afterTickThree() {
18868           fn.call(null, arg1, arg2, arg3);
18869         });
18870       default:
18871         args = new Array(len - 1);
18872         i = 0;
18873         while (i < args.length) {
18874           args[i++] = arguments[i];
18875         }
18876         return process.nextTick(function afterTick() {
18877           fn.apply(null, args);
18878         });
18879     }
18880   }
18881 });
18882
18883 // node_modules/isarray/index.js
18884 var require_isarray = __commonJS((exports2, module2) => {
18885   var toString = {}.toString;
18886   module2.exports = Array.isArray || function(arr) {
18887     return toString.call(arr) == "[object Array]";
18888   };
18889 });
18890
18891 // node_modules/readable-stream/lib/internal/streams/stream.js
18892 var require_stream = __commonJS((exports2, module2) => {
18893   module2.exports = require("stream");
18894 });
18895
18896 // node_modules/safe-buffer/index.js
18897 var require_safe_buffer = __commonJS((exports2, module2) => {
18898   var buffer = require("buffer");
18899   var Buffer2 = buffer.Buffer;
18900   function copyProps(src, dst) {
18901     for (var key in src) {
18902       dst[key] = src[key];
18903     }
18904   }
18905   if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
18906     module2.exports = buffer;
18907   } else {
18908     copyProps(buffer, exports2);
18909     exports2.Buffer = SafeBuffer;
18910   }
18911   function SafeBuffer(arg, encodingOrOffset, length) {
18912     return Buffer2(arg, encodingOrOffset, length);
18913   }
18914   copyProps(Buffer2, SafeBuffer);
18915   SafeBuffer.from = function(arg, encodingOrOffset, length) {
18916     if (typeof arg === "number") {
18917       throw new TypeError("Argument must not be a number");
18918     }
18919     return Buffer2(arg, encodingOrOffset, length);
18920   };
18921   SafeBuffer.alloc = function(size, fill, encoding) {
18922     if (typeof size !== "number") {
18923       throw new TypeError("Argument must be a number");
18924     }
18925     var buf = Buffer2(size);
18926     if (fill !== void 0) {
18927       if (typeof encoding === "string") {
18928         buf.fill(fill, encoding);
18929       } else {
18930         buf.fill(fill);
18931       }
18932     } else {
18933       buf.fill(0);
18934     }
18935     return buf;
18936   };
18937   SafeBuffer.allocUnsafe = function(size) {
18938     if (typeof size !== "number") {
18939       throw new TypeError("Argument must be a number");
18940     }
18941     return Buffer2(size);
18942   };
18943   SafeBuffer.allocUnsafeSlow = function(size) {
18944     if (typeof size !== "number") {
18945       throw new TypeError("Argument must be a number");
18946     }
18947     return buffer.SlowBuffer(size);
18948   };
18949 });
18950
18951 // node_modules/core-util-is/lib/util.js
18952 var require_util2 = __commonJS((exports2) => {
18953   function isArray(arg) {
18954     if (Array.isArray) {
18955       return Array.isArray(arg);
18956     }
18957     return objectToString(arg) === "[object Array]";
18958   }
18959   exports2.isArray = isArray;
18960   function isBoolean(arg) {
18961     return typeof arg === "boolean";
18962   }
18963   exports2.isBoolean = isBoolean;
18964   function isNull(arg) {
18965     return arg === null;
18966   }
18967   exports2.isNull = isNull;
18968   function isNullOrUndefined(arg) {
18969     return arg == null;
18970   }
18971   exports2.isNullOrUndefined = isNullOrUndefined;
18972   function isNumber(arg) {
18973     return typeof arg === "number";
18974   }
18975   exports2.isNumber = isNumber;
18976   function isString(arg) {
18977     return typeof arg === "string";
18978   }
18979   exports2.isString = isString;
18980   function isSymbol(arg) {
18981     return typeof arg === "symbol";
18982   }
18983   exports2.isSymbol = isSymbol;
18984   function isUndefined(arg) {
18985     return arg === void 0;
18986   }
18987   exports2.isUndefined = isUndefined;
18988   function isRegExp(re) {
18989     return objectToString(re) === "[object RegExp]";
18990   }
18991   exports2.isRegExp = isRegExp;
18992   function isObject3(arg) {
18993     return typeof arg === "object" && arg !== null;
18994   }
18995   exports2.isObject = isObject3;
18996   function isDate(d) {
18997     return objectToString(d) === "[object Date]";
18998   }
18999   exports2.isDate = isDate;
19000   function isError2(e) {
19001     return objectToString(e) === "[object Error]" || e instanceof Error;
19002   }
19003   exports2.isError = isError2;
19004   function isFunction(arg) {
19005     return typeof arg === "function";
19006   }
19007   exports2.isFunction = isFunction;
19008   function isPrimitive2(arg) {
19009     return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
19010   }
19011   exports2.isPrimitive = isPrimitive2;
19012   exports2.isBuffer = Buffer.isBuffer;
19013   function objectToString(o) {
19014     return Object.prototype.toString.call(o);
19015   }
19016 });
19017
19018 // node_modules/readable-stream/lib/internal/streams/BufferList.js
19019 var require_BufferList = __commonJS((exports2, module2) => {
19020   "use strict";
19021   function _classCallCheck(instance, Constructor) {
19022     if (!(instance instanceof Constructor)) {
19023       throw new TypeError("Cannot call a class as a function");
19024     }
19025   }
19026   var Buffer2 = require_safe_buffer().Buffer;
19027   var util = require("util");
19028   function copyBuffer(src, target, offset) {
19029     src.copy(target, offset);
19030   }
19031   module2.exports = function() {
19032     function BufferList() {
19033       _classCallCheck(this, BufferList);
19034       this.head = null;
19035       this.tail = null;
19036       this.length = 0;
19037     }
19038     BufferList.prototype.push = function push(v) {
19039       var entry = {data: v, next: null};
19040       if (this.length > 0)
19041         this.tail.next = entry;
19042       else
19043         this.head = entry;
19044       this.tail = entry;
19045       ++this.length;
19046     };
19047     BufferList.prototype.unshift = function unshift(v) {
19048       var entry = {data: v, next: this.head};
19049       if (this.length === 0)
19050         this.tail = entry;
19051       this.head = entry;
19052       ++this.length;
19053     };
19054     BufferList.prototype.shift = function shift() {
19055       if (this.length === 0)
19056         return;
19057       var ret2 = this.head.data;
19058       if (this.length === 1)
19059         this.head = this.tail = null;
19060       else
19061         this.head = this.head.next;
19062       --this.length;
19063       return ret2;
19064     };
19065     BufferList.prototype.clear = function clear() {
19066       this.head = this.tail = null;
19067       this.length = 0;
19068     };
19069     BufferList.prototype.join = function join(s) {
19070       if (this.length === 0)
19071         return "";
19072       var p = this.head;
19073       var ret2 = "" + p.data;
19074       while (p = p.next) {
19075         ret2 += s + p.data;
19076       }
19077       return ret2;
19078     };
19079     BufferList.prototype.concat = function concat(n) {
19080       if (this.length === 0)
19081         return Buffer2.alloc(0);
19082       if (this.length === 1)
19083         return this.head.data;
19084       var ret2 = Buffer2.allocUnsafe(n >>> 0);
19085       var p = this.head;
19086       var i = 0;
19087       while (p) {
19088         copyBuffer(p.data, ret2, i);
19089         i += p.data.length;
19090         p = p.next;
19091       }
19092       return ret2;
19093     };
19094     return BufferList;
19095   }();
19096   if (util && util.inspect && util.inspect.custom) {
19097     module2.exports.prototype[util.inspect.custom] = function() {
19098       var obj = util.inspect({length: this.length});
19099       return this.constructor.name + " " + obj;
19100     };
19101   }
19102 });
19103
19104 // node_modules/readable-stream/lib/internal/streams/destroy.js
19105 var require_destroy = __commonJS((exports2, module2) => {
19106   "use strict";
19107   var pna = require_process_nextick_args();
19108   function destroy(err, cb) {
19109     var _this = this;
19110     var readableDestroyed = this._readableState && this._readableState.destroyed;
19111     var writableDestroyed = this._writableState && this._writableState.destroyed;
19112     if (readableDestroyed || writableDestroyed) {
19113       if (cb) {
19114         cb(err);
19115       } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
19116         pna.nextTick(emitErrorNT, this, err);
19117       }
19118       return this;
19119     }
19120     if (this._readableState) {
19121       this._readableState.destroyed = true;
19122     }
19123     if (this._writableState) {
19124       this._writableState.destroyed = true;
19125     }
19126     this._destroy(err || null, function(err2) {
19127       if (!cb && err2) {
19128         pna.nextTick(emitErrorNT, _this, err2);
19129         if (_this._writableState) {
19130           _this._writableState.errorEmitted = true;
19131         }
19132       } else if (cb) {
19133         cb(err2);
19134       }
19135     });
19136     return this;
19137   }
19138   function undestroy() {
19139     if (this._readableState) {
19140       this._readableState.destroyed = false;
19141       this._readableState.reading = false;
19142       this._readableState.ended = false;
19143       this._readableState.endEmitted = false;
19144     }
19145     if (this._writableState) {
19146       this._writableState.destroyed = false;
19147       this._writableState.ended = false;
19148       this._writableState.ending = false;
19149       this._writableState.finished = false;
19150       this._writableState.errorEmitted = false;
19151     }
19152   }
19153   function emitErrorNT(self2, err) {
19154     self2.emit("error", err);
19155   }
19156   module2.exports = {
19157     destroy,
19158     undestroy
19159   };
19160 });
19161
19162 // node_modules/util-deprecate/node.js
19163 var require_node2 = __commonJS((exports2, module2) => {
19164   module2.exports = require("util").deprecate;
19165 });
19166
19167 // node_modules/readable-stream/lib/_stream_writable.js
19168 var require_stream_writable = __commonJS((exports2, module2) => {
19169   "use strict";
19170   var pna = require_process_nextick_args();
19171   module2.exports = Writable;
19172   function CorkedRequest(state) {
19173     var _this = this;
19174     this.next = null;
19175     this.entry = null;
19176     this.finish = function() {
19177       onCorkedFinish(_this, state);
19178     };
19179   }
19180   var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
19181   var Duplex;
19182   Writable.WritableState = WritableState;
19183   var util = Object.create(require_util2());
19184   util.inherits = require_inherits();
19185   var internalUtil = {
19186     deprecate: require_node2()
19187   };
19188   var Stream = require_stream();
19189   var Buffer2 = require_safe_buffer().Buffer;
19190   var OurUint8Array = global.Uint8Array || function() {
19191   };
19192   function _uint8ArrayToBuffer(chunk) {
19193     return Buffer2.from(chunk);
19194   }
19195   function _isUint8Array(obj) {
19196     return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
19197   }
19198   var destroyImpl = require_destroy();
19199   util.inherits(Writable, Stream);
19200   function nop() {
19201   }
19202   function WritableState(options, stream) {
19203     Duplex = Duplex || require_stream_duplex();
19204     options = options || {};
19205     var isDuplex = stream instanceof Duplex;
19206     this.objectMode = !!options.objectMode;
19207     if (isDuplex)
19208       this.objectMode = this.objectMode || !!options.writableObjectMode;
19209     var hwm = options.highWaterMark;
19210     var writableHwm = options.writableHighWaterMark;
19211     var defaultHwm = this.objectMode ? 16 : 16 * 1024;
19212     if (hwm || hwm === 0)
19213       this.highWaterMark = hwm;
19214     else if (isDuplex && (writableHwm || writableHwm === 0))
19215       this.highWaterMark = writableHwm;
19216     else
19217       this.highWaterMark = defaultHwm;
19218     this.highWaterMark = Math.floor(this.highWaterMark);
19219     this.finalCalled = false;
19220     this.needDrain = false;
19221     this.ending = false;
19222     this.ended = false;
19223     this.finished = false;
19224     this.destroyed = false;
19225     var noDecode = options.decodeStrings === false;
19226     this.decodeStrings = !noDecode;
19227     this.defaultEncoding = options.defaultEncoding || "utf8";
19228     this.length = 0;
19229     this.writing = false;
19230     this.corked = 0;
19231     this.sync = true;
19232     this.bufferProcessing = false;
19233     this.onwrite = function(er) {
19234       onwrite(stream, er);
19235     };
19236     this.writecb = null;
19237     this.writelen = 0;
19238     this.bufferedRequest = null;
19239     this.lastBufferedRequest = null;
19240     this.pendingcb = 0;
19241     this.prefinished = false;
19242     this.errorEmitted = false;
19243     this.bufferedRequestCount = 0;
19244     this.corkedRequestsFree = new CorkedRequest(this);
19245   }
19246   WritableState.prototype.getBuffer = function getBuffer() {
19247     var current = this.bufferedRequest;
19248     var out = [];
19249     while (current) {
19250       out.push(current);
19251       current = current.next;
19252     }
19253     return out;
19254   };
19255   (function() {
19256     try {
19257       Object.defineProperty(WritableState.prototype, "buffer", {
19258         get: internalUtil.deprecate(function() {
19259           return this.getBuffer();
19260         }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
19261       });
19262     } catch (_) {
19263     }
19264   })();
19265   var realHasInstance;
19266   if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
19267     realHasInstance = Function.prototype[Symbol.hasInstance];
19268     Object.defineProperty(Writable, Symbol.hasInstance, {
19269       value: function(object) {
19270         if (realHasInstance.call(this, object))
19271           return true;
19272         if (this !== Writable)
19273           return false;
19274         return object && object._writableState instanceof WritableState;
19275       }
19276     });
19277   } else {
19278     realHasInstance = function(object) {
19279       return object instanceof this;
19280     };
19281   }
19282   function Writable(options) {
19283     Duplex = Duplex || require_stream_duplex();
19284     if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
19285       return new Writable(options);
19286     }
19287     this._writableState = new WritableState(options, this);
19288     this.writable = true;
19289     if (options) {
19290       if (typeof options.write === "function")
19291         this._write = options.write;
19292       if (typeof options.writev === "function")
19293         this._writev = options.writev;
19294       if (typeof options.destroy === "function")
19295         this._destroy = options.destroy;
19296       if (typeof options.final === "function")
19297         this._final = options.final;
19298     }
19299     Stream.call(this);
19300   }
19301   Writable.prototype.pipe = function() {
19302     this.emit("error", new Error("Cannot pipe, not readable"));
19303   };
19304   function writeAfterEnd(stream, cb) {
19305     var er = new Error("write after end");
19306     stream.emit("error", er);
19307     pna.nextTick(cb, er);
19308   }
19309   function validChunk(stream, state, chunk, cb) {
19310     var valid = true;
19311     var er = false;
19312     if (chunk === null) {
19313       er = new TypeError("May not write null values to stream");
19314     } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
19315       er = new TypeError("Invalid non-string/buffer chunk");
19316     }
19317     if (er) {
19318       stream.emit("error", er);
19319       pna.nextTick(cb, er);
19320       valid = false;
19321     }
19322     return valid;
19323   }
19324   Writable.prototype.write = function(chunk, encoding, cb) {
19325     var state = this._writableState;
19326     var ret2 = false;
19327     var isBuf = !state.objectMode && _isUint8Array(chunk);
19328     if (isBuf && !Buffer2.isBuffer(chunk)) {
19329       chunk = _uint8ArrayToBuffer(chunk);
19330     }
19331     if (typeof encoding === "function") {
19332       cb = encoding;
19333       encoding = null;
19334     }
19335     if (isBuf)
19336       encoding = "buffer";
19337     else if (!encoding)
19338       encoding = state.defaultEncoding;
19339     if (typeof cb !== "function")
19340       cb = nop;
19341     if (state.ended)
19342       writeAfterEnd(this, cb);
19343     else if (isBuf || validChunk(this, state, chunk, cb)) {
19344       state.pendingcb++;
19345       ret2 = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
19346     }
19347     return ret2;
19348   };
19349   Writable.prototype.cork = function() {
19350     var state = this._writableState;
19351     state.corked++;
19352   };
19353   Writable.prototype.uncork = function() {
19354     var state = this._writableState;
19355     if (state.corked) {
19356       state.corked--;
19357       if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest)
19358         clearBuffer(this, state);
19359     }
19360   };
19361   Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
19362     if (typeof encoding === "string")
19363       encoding = encoding.toLowerCase();
19364     if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1))
19365       throw new TypeError("Unknown encoding: " + encoding);
19366     this._writableState.defaultEncoding = encoding;
19367     return this;
19368   };
19369   function decodeChunk(state, chunk, encoding) {
19370     if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
19371       chunk = Buffer2.from(chunk, encoding);
19372     }
19373     return chunk;
19374   }
19375   Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
19376     enumerable: false,
19377     get: function() {
19378       return this._writableState.highWaterMark;
19379     }
19380   });
19381   function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
19382     if (!isBuf) {
19383       var newChunk = decodeChunk(state, chunk, encoding);
19384       if (chunk !== newChunk) {
19385         isBuf = true;
19386         encoding = "buffer";
19387         chunk = newChunk;
19388       }
19389     }
19390     var len = state.objectMode ? 1 : chunk.length;
19391     state.length += len;
19392     var ret2 = state.length < state.highWaterMark;
19393     if (!ret2)
19394       state.needDrain = true;
19395     if (state.writing || state.corked) {
19396       var last = state.lastBufferedRequest;
19397       state.lastBufferedRequest = {
19398         chunk,
19399         encoding,
19400         isBuf,
19401         callback: cb,
19402         next: null
19403       };
19404       if (last) {
19405         last.next = state.lastBufferedRequest;
19406       } else {
19407         state.bufferedRequest = state.lastBufferedRequest;
19408       }
19409       state.bufferedRequestCount += 1;
19410     } else {
19411       doWrite(stream, state, false, len, chunk, encoding, cb);
19412     }
19413     return ret2;
19414   }
19415   function doWrite(stream, state, writev, len, chunk, encoding, cb) {
19416     state.writelen = len;
19417     state.writecb = cb;
19418     state.writing = true;
19419     state.sync = true;
19420     if (writev)
19421       stream._writev(chunk, state.onwrite);
19422     else
19423       stream._write(chunk, encoding, state.onwrite);
19424     state.sync = false;
19425   }
19426   function onwriteError(stream, state, sync, er, cb) {
19427     --state.pendingcb;
19428     if (sync) {
19429       pna.nextTick(cb, er);
19430       pna.nextTick(finishMaybe, stream, state);
19431       stream._writableState.errorEmitted = true;
19432       stream.emit("error", er);
19433     } else {
19434       cb(er);
19435       stream._writableState.errorEmitted = true;
19436       stream.emit("error", er);
19437       finishMaybe(stream, state);
19438     }
19439   }
19440   function onwriteStateUpdate(state) {
19441     state.writing = false;
19442     state.writecb = null;
19443     state.length -= state.writelen;
19444     state.writelen = 0;
19445   }
19446   function onwrite(stream, er) {
19447     var state = stream._writableState;
19448     var sync = state.sync;
19449     var cb = state.writecb;
19450     onwriteStateUpdate(state);
19451     if (er)
19452       onwriteError(stream, state, sync, er, cb);
19453     else {
19454       var finished = needFinish(state);
19455       if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
19456         clearBuffer(stream, state);
19457       }
19458       if (sync) {
19459         asyncWrite(afterWrite, stream, state, finished, cb);
19460       } else {
19461         afterWrite(stream, state, finished, cb);
19462       }
19463     }
19464   }
19465   function afterWrite(stream, state, finished, cb) {
19466     if (!finished)
19467       onwriteDrain(stream, state);
19468     state.pendingcb--;
19469     cb();
19470     finishMaybe(stream, state);
19471   }
19472   function onwriteDrain(stream, state) {
19473     if (state.length === 0 && state.needDrain) {
19474       state.needDrain = false;
19475       stream.emit("drain");
19476     }
19477   }
19478   function clearBuffer(stream, state) {
19479     state.bufferProcessing = true;
19480     var entry = state.bufferedRequest;
19481     if (stream._writev && entry && entry.next) {
19482       var l = state.bufferedRequestCount;
19483       var buffer = new Array(l);
19484       var holder = state.corkedRequestsFree;
19485       holder.entry = entry;
19486       var count = 0;
19487       var allBuffers = true;
19488       while (entry) {
19489         buffer[count] = entry;
19490         if (!entry.isBuf)
19491           allBuffers = false;
19492         entry = entry.next;
19493         count += 1;
19494       }
19495       buffer.allBuffers = allBuffers;
19496       doWrite(stream, state, true, state.length, buffer, "", holder.finish);
19497       state.pendingcb++;
19498       state.lastBufferedRequest = null;
19499       if (holder.next) {
19500         state.corkedRequestsFree = holder.next;
19501         holder.next = null;
19502       } else {
19503         state.corkedRequestsFree = new CorkedRequest(state);
19504       }
19505       state.bufferedRequestCount = 0;
19506     } else {
19507       while (entry) {
19508         var chunk = entry.chunk;
19509         var encoding = entry.encoding;
19510         var cb = entry.callback;
19511         var len = state.objectMode ? 1 : chunk.length;
19512         doWrite(stream, state, false, len, chunk, encoding, cb);
19513         entry = entry.next;
19514         state.bufferedRequestCount--;
19515         if (state.writing) {
19516           break;
19517         }
19518       }
19519       if (entry === null)
19520         state.lastBufferedRequest = null;
19521     }
19522     state.bufferedRequest = entry;
19523     state.bufferProcessing = false;
19524   }
19525   Writable.prototype._write = function(chunk, encoding, cb) {
19526     cb(new Error("_write() is not implemented"));
19527   };
19528   Writable.prototype._writev = null;
19529   Writable.prototype.end = function(chunk, encoding, cb) {
19530     var state = this._writableState;
19531     if (typeof chunk === "function") {
19532       cb = chunk;
19533       chunk = null;
19534       encoding = null;
19535     } else if (typeof encoding === "function") {
19536       cb = encoding;
19537       encoding = null;
19538     }
19539     if (chunk !== null && chunk !== void 0)
19540       this.write(chunk, encoding);
19541     if (state.corked) {
19542       state.corked = 1;
19543       this.uncork();
19544     }
19545     if (!state.ending && !state.finished)
19546       endWritable(this, state, cb);
19547   };
19548   function needFinish(state) {
19549     return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
19550   }
19551   function callFinal(stream, state) {
19552     stream._final(function(err) {
19553       state.pendingcb--;
19554       if (err) {
19555         stream.emit("error", err);
19556       }
19557       state.prefinished = true;
19558       stream.emit("prefinish");
19559       finishMaybe(stream, state);
19560     });
19561   }
19562   function prefinish(stream, state) {
19563     if (!state.prefinished && !state.finalCalled) {
19564       if (typeof stream._final === "function") {
19565         state.pendingcb++;
19566         state.finalCalled = true;
19567         pna.nextTick(callFinal, stream, state);
19568       } else {
19569         state.prefinished = true;
19570         stream.emit("prefinish");
19571       }
19572     }
19573   }
19574   function finishMaybe(stream, state) {
19575     var need = needFinish(state);
19576     if (need) {
19577       prefinish(stream, state);
19578       if (state.pendingcb === 0) {
19579         state.finished = true;
19580         stream.emit("finish");
19581       }
19582     }
19583     return need;
19584   }
19585   function endWritable(stream, state, cb) {
19586     state.ending = true;
19587     finishMaybe(stream, state);
19588     if (cb) {
19589       if (state.finished)
19590         pna.nextTick(cb);
19591       else
19592         stream.once("finish", cb);
19593     }
19594     state.ended = true;
19595     stream.writable = false;
19596   }
19597   function onCorkedFinish(corkReq, state, err) {
19598     var entry = corkReq.entry;
19599     corkReq.entry = null;
19600     while (entry) {
19601       var cb = entry.callback;
19602       state.pendingcb--;
19603       cb(err);
19604       entry = entry.next;
19605     }
19606     if (state.corkedRequestsFree) {
19607       state.corkedRequestsFree.next = corkReq;
19608     } else {
19609       state.corkedRequestsFree = corkReq;
19610     }
19611   }
19612   Object.defineProperty(Writable.prototype, "destroyed", {
19613     get: function() {
19614       if (this._writableState === void 0) {
19615         return false;
19616       }
19617       return this._writableState.destroyed;
19618     },
19619     set: function(value) {
19620       if (!this._writableState) {
19621         return;
19622       }
19623       this._writableState.destroyed = value;
19624     }
19625   });
19626   Writable.prototype.destroy = destroyImpl.destroy;
19627   Writable.prototype._undestroy = destroyImpl.undestroy;
19628   Writable.prototype._destroy = function(err, cb) {
19629     this.end();
19630     cb(err);
19631   };
19632 });
19633
19634 // node_modules/readable-stream/lib/_stream_duplex.js
19635 var require_stream_duplex = __commonJS((exports2, module2) => {
19636   "use strict";
19637   var pna = require_process_nextick_args();
19638   var objectKeys = Object.keys || function(obj) {
19639     var keys2 = [];
19640     for (var key in obj) {
19641       keys2.push(key);
19642     }
19643     return keys2;
19644   };
19645   module2.exports = Duplex;
19646   var util = Object.create(require_util2());
19647   util.inherits = require_inherits();
19648   var Readable = require_stream_readable();
19649   var Writable = require_stream_writable();
19650   util.inherits(Duplex, Readable);
19651   {
19652     keys = objectKeys(Writable.prototype);
19653     for (v = 0; v < keys.length; v++) {
19654       method = keys[v];
19655       if (!Duplex.prototype[method])
19656         Duplex.prototype[method] = Writable.prototype[method];
19657     }
19658   }
19659   var keys;
19660   var method;
19661   var v;
19662   function Duplex(options) {
19663     if (!(this instanceof Duplex))
19664       return new Duplex(options);
19665     Readable.call(this, options);
19666     Writable.call(this, options);
19667     if (options && options.readable === false)
19668       this.readable = false;
19669     if (options && options.writable === false)
19670       this.writable = false;
19671     this.allowHalfOpen = true;
19672     if (options && options.allowHalfOpen === false)
19673       this.allowHalfOpen = false;
19674     this.once("end", onend);
19675   }
19676   Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
19677     enumerable: false,
19678     get: function() {
19679       return this._writableState.highWaterMark;
19680     }
19681   });
19682   function onend() {
19683     if (this.allowHalfOpen || this._writableState.ended)
19684       return;
19685     pna.nextTick(onEndNT, this);
19686   }
19687   function onEndNT(self2) {
19688     self2.end();
19689   }
19690   Object.defineProperty(Duplex.prototype, "destroyed", {
19691     get: function() {
19692       if (this._readableState === void 0 || this._writableState === void 0) {
19693         return false;
19694       }
19695       return this._readableState.destroyed && this._writableState.destroyed;
19696     },
19697     set: function(value) {
19698       if (this._readableState === void 0 || this._writableState === void 0) {
19699         return;
19700       }
19701       this._readableState.destroyed = value;
19702       this._writableState.destroyed = value;
19703     }
19704   });
19705   Duplex.prototype._destroy = function(err, cb) {
19706     this.push(null);
19707     this.end();
19708     pna.nextTick(cb, err);
19709   };
19710 });
19711
19712 // node_modules/readable-stream/lib/_stream_readable.js
19713 var require_stream_readable = __commonJS((exports2, module2) => {
19714   "use strict";
19715   var pna = require_process_nextick_args();
19716   module2.exports = Readable;
19717   var isArray = require_isarray();
19718   var Duplex;
19719   Readable.ReadableState = ReadableState;
19720   var EE = require("events").EventEmitter;
19721   var EElistenerCount = function(emitter, type) {
19722     return emitter.listeners(type).length;
19723   };
19724   var Stream = require_stream();
19725   var Buffer2 = require_safe_buffer().Buffer;
19726   var OurUint8Array = global.Uint8Array || function() {
19727   };
19728   function _uint8ArrayToBuffer(chunk) {
19729     return Buffer2.from(chunk);
19730   }
19731   function _isUint8Array(obj) {
19732     return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
19733   }
19734   var util = Object.create(require_util2());
19735   util.inherits = require_inherits();
19736   var debugUtil = require("util");
19737   var debug = void 0;
19738   if (debugUtil && debugUtil.debuglog) {
19739     debug = debugUtil.debuglog("stream");
19740   } else {
19741     debug = function() {
19742     };
19743   }
19744   var BufferList = require_BufferList();
19745   var destroyImpl = require_destroy();
19746   var StringDecoder;
19747   util.inherits(Readable, Stream);
19748   var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
19749   function prependListener(emitter, event, fn) {
19750     if (typeof emitter.prependListener === "function")
19751       return emitter.prependListener(event, fn);
19752     if (!emitter._events || !emitter._events[event])
19753       emitter.on(event, fn);
19754     else if (isArray(emitter._events[event]))
19755       emitter._events[event].unshift(fn);
19756     else
19757       emitter._events[event] = [fn, emitter._events[event]];
19758   }
19759   function ReadableState(options, stream) {
19760     Duplex = Duplex || require_stream_duplex();
19761     options = options || {};
19762     var isDuplex = stream instanceof Duplex;
19763     this.objectMode = !!options.objectMode;
19764     if (isDuplex)
19765       this.objectMode = this.objectMode || !!options.readableObjectMode;
19766     var hwm = options.highWaterMark;
19767     var readableHwm = options.readableHighWaterMark;
19768     var defaultHwm = this.objectMode ? 16 : 16 * 1024;
19769     if (hwm || hwm === 0)
19770       this.highWaterMark = hwm;
19771     else if (isDuplex && (readableHwm || readableHwm === 0))
19772       this.highWaterMark = readableHwm;
19773     else
19774       this.highWaterMark = defaultHwm;
19775     this.highWaterMark = Math.floor(this.highWaterMark);
19776     this.buffer = new BufferList();
19777     this.length = 0;
19778     this.pipes = null;
19779     this.pipesCount = 0;
19780     this.flowing = null;
19781     this.ended = false;
19782     this.endEmitted = false;
19783     this.reading = false;
19784     this.sync = true;
19785     this.needReadable = false;
19786     this.emittedReadable = false;
19787     this.readableListening = false;
19788     this.resumeScheduled = false;
19789     this.destroyed = false;
19790     this.defaultEncoding = options.defaultEncoding || "utf8";
19791     this.awaitDrain = 0;
19792     this.readingMore = false;
19793     this.decoder = null;
19794     this.encoding = null;
19795     if (options.encoding) {
19796       if (!StringDecoder)
19797         StringDecoder = require("string_decoder/").StringDecoder;
19798       this.decoder = new StringDecoder(options.encoding);
19799       this.encoding = options.encoding;
19800     }
19801   }
19802   function Readable(options) {
19803     Duplex = Duplex || require_stream_duplex();
19804     if (!(this instanceof Readable))
19805       return new Readable(options);
19806     this._readableState = new ReadableState(options, this);
19807     this.readable = true;
19808     if (options) {
19809       if (typeof options.read === "function")
19810         this._read = options.read;
19811       if (typeof options.destroy === "function")
19812         this._destroy = options.destroy;
19813     }
19814     Stream.call(this);
19815   }
19816   Object.defineProperty(Readable.prototype, "destroyed", {
19817     get: function() {
19818       if (this._readableState === void 0) {
19819         return false;
19820       }
19821       return this._readableState.destroyed;
19822     },
19823     set: function(value) {
19824       if (!this._readableState) {
19825         return;
19826       }
19827       this._readableState.destroyed = value;
19828     }
19829   });
19830   Readable.prototype.destroy = destroyImpl.destroy;
19831   Readable.prototype._undestroy = destroyImpl.undestroy;
19832   Readable.prototype._destroy = function(err, cb) {
19833     this.push(null);
19834     cb(err);
19835   };
19836   Readable.prototype.push = function(chunk, encoding) {
19837     var state = this._readableState;
19838     var skipChunkCheck;
19839     if (!state.objectMode) {
19840       if (typeof chunk === "string") {
19841         encoding = encoding || state.defaultEncoding;
19842         if (encoding !== state.encoding) {
19843           chunk = Buffer2.from(chunk, encoding);
19844           encoding = "";
19845         }
19846         skipChunkCheck = true;
19847       }
19848     } else {
19849       skipChunkCheck = true;
19850     }
19851     return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
19852   };
19853   Readable.prototype.unshift = function(chunk) {
19854     return readableAddChunk(this, chunk, null, true, false);
19855   };
19856   function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
19857     var state = stream._readableState;
19858     if (chunk === null) {
19859       state.reading = false;
19860       onEofChunk(stream, state);
19861     } else {
19862       var er;
19863       if (!skipChunkCheck)
19864         er = chunkInvalid(state, chunk);
19865       if (er) {
19866         stream.emit("error", er);
19867       } else if (state.objectMode || chunk && chunk.length > 0) {
19868         if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
19869           chunk = _uint8ArrayToBuffer(chunk);
19870         }
19871         if (addToFront) {
19872           if (state.endEmitted)
19873             stream.emit("error", new Error("stream.unshift() after end event"));
19874           else
19875             addChunk(stream, state, chunk, true);
19876         } else if (state.ended) {
19877           stream.emit("error", new Error("stream.push() after EOF"));
19878         } else {
19879           state.reading = false;
19880           if (state.decoder && !encoding) {
19881             chunk = state.decoder.write(chunk);
19882             if (state.objectMode || chunk.length !== 0)
19883               addChunk(stream, state, chunk, false);
19884             else
19885               maybeReadMore(stream, state);
19886           } else {
19887             addChunk(stream, state, chunk, false);
19888           }
19889         }
19890       } else if (!addToFront) {
19891         state.reading = false;
19892       }
19893     }
19894     return needMoreData(state);
19895   }
19896   function addChunk(stream, state, chunk, addToFront) {
19897     if (state.flowing && state.length === 0 && !state.sync) {
19898       stream.emit("data", chunk);
19899       stream.read(0);
19900     } else {
19901       state.length += state.objectMode ? 1 : chunk.length;
19902       if (addToFront)
19903         state.buffer.unshift(chunk);
19904       else
19905         state.buffer.push(chunk);
19906       if (state.needReadable)
19907         emitReadable(stream);
19908     }
19909     maybeReadMore(stream, state);
19910   }
19911   function chunkInvalid(state, chunk) {
19912     var er;
19913     if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
19914       er = new TypeError("Invalid non-string/buffer chunk");
19915     }
19916     return er;
19917   }
19918   function needMoreData(state) {
19919     return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
19920   }
19921   Readable.prototype.isPaused = function() {
19922     return this._readableState.flowing === false;
19923   };
19924   Readable.prototype.setEncoding = function(enc) {
19925     if (!StringDecoder)
19926       StringDecoder = require("string_decoder/").StringDecoder;
19927     this._readableState.decoder = new StringDecoder(enc);
19928     this._readableState.encoding = enc;
19929     return this;
19930   };
19931   var MAX_HWM = 8388608;
19932   function computeNewHighWaterMark(n) {
19933     if (n >= MAX_HWM) {
19934       n = MAX_HWM;
19935     } else {
19936       n--;
19937       n |= n >>> 1;
19938       n |= n >>> 2;
19939       n |= n >>> 4;
19940       n |= n >>> 8;
19941       n |= n >>> 16;
19942       n++;
19943     }
19944     return n;
19945   }
19946   function howMuchToRead(n, state) {
19947     if (n <= 0 || state.length === 0 && state.ended)
19948       return 0;
19949     if (state.objectMode)
19950       return 1;
19951     if (n !== n) {
19952       if (state.flowing && state.length)
19953         return state.buffer.head.data.length;
19954       else
19955         return state.length;
19956     }
19957     if (n > state.highWaterMark)
19958       state.highWaterMark = computeNewHighWaterMark(n);
19959     if (n <= state.length)
19960       return n;
19961     if (!state.ended) {
19962       state.needReadable = true;
19963       return 0;
19964     }
19965     return state.length;
19966   }
19967   Readable.prototype.read = function(n) {
19968     debug("read", n);
19969     n = parseInt(n, 10);
19970     var state = this._readableState;
19971     var nOrig = n;
19972     if (n !== 0)
19973       state.emittedReadable = false;
19974     if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
19975       debug("read: emitReadable", state.length, state.ended);
19976       if (state.length === 0 && state.ended)
19977         endReadable(this);
19978       else
19979         emitReadable(this);
19980       return null;
19981     }
19982     n = howMuchToRead(n, state);
19983     if (n === 0 && state.ended) {
19984       if (state.length === 0)
19985         endReadable(this);
19986       return null;
19987     }
19988     var doRead = state.needReadable;
19989     debug("need readable", doRead);
19990     if (state.length === 0 || state.length - n < state.highWaterMark) {
19991       doRead = true;
19992       debug("length less than watermark", doRead);
19993     }
19994     if (state.ended || state.reading) {
19995       doRead = false;
19996       debug("reading or ended", doRead);
19997     } else if (doRead) {
19998       debug("do read");
19999       state.reading = true;
20000       state.sync = true;
20001       if (state.length === 0)
20002         state.needReadable = true;
20003       this._read(state.highWaterMark);
20004       state.sync = false;
20005       if (!state.reading)
20006         n = howMuchToRead(nOrig, state);
20007     }
20008     var ret2;
20009     if (n > 0)
20010       ret2 = fromList(n, state);
20011     else
20012       ret2 = null;
20013     if (ret2 === null) {
20014       state.needReadable = true;
20015       n = 0;
20016     } else {
20017       state.length -= n;
20018     }
20019     if (state.length === 0) {
20020       if (!state.ended)
20021         state.needReadable = true;
20022       if (nOrig !== n && state.ended)
20023         endReadable(this);
20024     }
20025     if (ret2 !== null)
20026       this.emit("data", ret2);
20027     return ret2;
20028   };
20029   function onEofChunk(stream, state) {
20030     if (state.ended)
20031       return;
20032     if (state.decoder) {
20033       var chunk = state.decoder.end();
20034       if (chunk && chunk.length) {
20035         state.buffer.push(chunk);
20036         state.length += state.objectMode ? 1 : chunk.length;
20037       }
20038     }
20039     state.ended = true;
20040     emitReadable(stream);
20041   }
20042   function emitReadable(stream) {
20043     var state = stream._readableState;
20044     state.needReadable = false;
20045     if (!state.emittedReadable) {
20046       debug("emitReadable", state.flowing);
20047       state.emittedReadable = true;
20048       if (state.sync)
20049         pna.nextTick(emitReadable_, stream);
20050       else
20051         emitReadable_(stream);
20052     }
20053   }
20054   function emitReadable_(stream) {
20055     debug("emit readable");
20056     stream.emit("readable");
20057     flow(stream);
20058   }
20059   function maybeReadMore(stream, state) {
20060     if (!state.readingMore) {
20061       state.readingMore = true;
20062       pna.nextTick(maybeReadMore_, stream, state);
20063     }
20064   }
20065   function maybeReadMore_(stream, state) {
20066     var len = state.length;
20067     while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
20068       debug("maybeReadMore read 0");
20069       stream.read(0);
20070       if (len === state.length)
20071         break;
20072       else
20073         len = state.length;
20074     }
20075     state.readingMore = false;
20076   }
20077   Readable.prototype._read = function(n) {
20078     this.emit("error", new Error("_read() is not implemented"));
20079   };
20080   Readable.prototype.pipe = function(dest, pipeOpts) {
20081     var src = this;
20082     var state = this._readableState;
20083     switch (state.pipesCount) {
20084       case 0:
20085         state.pipes = dest;
20086         break;
20087       case 1:
20088         state.pipes = [state.pipes, dest];
20089         break;
20090       default:
20091         state.pipes.push(dest);
20092         break;
20093     }
20094     state.pipesCount += 1;
20095     debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
20096     var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
20097     var endFn = doEnd ? onend : unpipe;
20098     if (state.endEmitted)
20099       pna.nextTick(endFn);
20100     else
20101       src.once("end", endFn);
20102     dest.on("unpipe", onunpipe);
20103     function onunpipe(readable, unpipeInfo) {
20104       debug("onunpipe");
20105       if (readable === src) {
20106         if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
20107           unpipeInfo.hasUnpiped = true;
20108           cleanup();
20109         }
20110       }
20111     }
20112     function onend() {
20113       debug("onend");
20114       dest.end();
20115     }
20116     var ondrain = pipeOnDrain(src);
20117     dest.on("drain", ondrain);
20118     var cleanedUp = false;
20119     function cleanup() {
20120       debug("cleanup");
20121       dest.removeListener("close", onclose);
20122       dest.removeListener("finish", onfinish);
20123       dest.removeListener("drain", ondrain);
20124       dest.removeListener("error", onerror);
20125       dest.removeListener("unpipe", onunpipe);
20126       src.removeListener("end", onend);
20127       src.removeListener("end", unpipe);
20128       src.removeListener("data", ondata);
20129       cleanedUp = true;
20130       if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain))
20131         ondrain();
20132     }
20133     var increasedAwaitDrain = false;
20134     src.on("data", ondata);
20135     function ondata(chunk) {
20136       debug("ondata");
20137       increasedAwaitDrain = false;
20138       var ret2 = dest.write(chunk);
20139       if (ret2 === false && !increasedAwaitDrain) {
20140         if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
20141           debug("false write response, pause", src._readableState.awaitDrain);
20142           src._readableState.awaitDrain++;
20143           increasedAwaitDrain = true;
20144         }
20145         src.pause();
20146       }
20147     }
20148     function onerror(er) {
20149       debug("onerror", er);
20150       unpipe();
20151       dest.removeListener("error", onerror);
20152       if (EElistenerCount(dest, "error") === 0)
20153         dest.emit("error", er);
20154     }
20155     prependListener(dest, "error", onerror);
20156     function onclose() {
20157       dest.removeListener("finish", onfinish);
20158       unpipe();
20159     }
20160     dest.once("close", onclose);
20161     function onfinish() {
20162       debug("onfinish");
20163       dest.removeListener("close", onclose);
20164       unpipe();
20165     }
20166     dest.once("finish", onfinish);
20167     function unpipe() {
20168       debug("unpipe");
20169       src.unpipe(dest);
20170     }
20171     dest.emit("pipe", src);
20172     if (!state.flowing) {
20173       debug("pipe resume");
20174       src.resume();
20175     }
20176     return dest;
20177   };
20178   function pipeOnDrain(src) {
20179     return function() {
20180       var state = src._readableState;
20181       debug("pipeOnDrain", state.awaitDrain);
20182       if (state.awaitDrain)
20183         state.awaitDrain--;
20184       if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
20185         state.flowing = true;
20186         flow(src);
20187       }
20188     };
20189   }
20190   Readable.prototype.unpipe = function(dest) {
20191     var state = this._readableState;
20192     var unpipeInfo = {hasUnpiped: false};
20193     if (state.pipesCount === 0)
20194       return this;
20195     if (state.pipesCount === 1) {
20196       if (dest && dest !== state.pipes)
20197         return this;
20198       if (!dest)
20199         dest = state.pipes;
20200       state.pipes = null;
20201       state.pipesCount = 0;
20202       state.flowing = false;
20203       if (dest)
20204         dest.emit("unpipe", this, unpipeInfo);
20205       return this;
20206     }
20207     if (!dest) {
20208       var dests = state.pipes;
20209       var len = state.pipesCount;
20210       state.pipes = null;
20211       state.pipesCount = 0;
20212       state.flowing = false;
20213       for (var i = 0; i < len; i++) {
20214         dests[i].emit("unpipe", this, unpipeInfo);
20215       }
20216       return this;
20217     }
20218     var index = indexOf(state.pipes, dest);
20219     if (index === -1)
20220       return this;
20221     state.pipes.splice(index, 1);
20222     state.pipesCount -= 1;
20223     if (state.pipesCount === 1)
20224       state.pipes = state.pipes[0];
20225     dest.emit("unpipe", this, unpipeInfo);
20226     return this;
20227   };
20228   Readable.prototype.on = function(ev, fn) {
20229     var res = Stream.prototype.on.call(this, ev, fn);
20230     if (ev === "data") {
20231       if (this._readableState.flowing !== false)
20232         this.resume();
20233     } else if (ev === "readable") {
20234       var state = this._readableState;
20235       if (!state.endEmitted && !state.readableListening) {
20236         state.readableListening = state.needReadable = true;
20237         state.emittedReadable = false;
20238         if (!state.reading) {
20239           pna.nextTick(nReadingNextTick, this);
20240         } else if (state.length) {
20241           emitReadable(this);
20242         }
20243       }
20244     }
20245     return res;
20246   };
20247   Readable.prototype.addListener = Readable.prototype.on;
20248   function nReadingNextTick(self2) {
20249     debug("readable nexttick read 0");
20250     self2.read(0);
20251   }
20252   Readable.prototype.resume = function() {
20253     var state = this._readableState;
20254     if (!state.flowing) {
20255       debug("resume");
20256       state.flowing = true;
20257       resume(this, state);
20258     }
20259     return this;
20260   };
20261   function resume(stream, state) {
20262     if (!state.resumeScheduled) {
20263       state.resumeScheduled = true;
20264       pna.nextTick(resume_, stream, state);
20265     }
20266   }
20267   function resume_(stream, state) {
20268     if (!state.reading) {
20269       debug("resume read 0");
20270       stream.read(0);
20271     }
20272     state.resumeScheduled = false;
20273     state.awaitDrain = 0;
20274     stream.emit("resume");
20275     flow(stream);
20276     if (state.flowing && !state.reading)
20277       stream.read(0);
20278   }
20279   Readable.prototype.pause = function() {
20280     debug("call pause flowing=%j", this._readableState.flowing);
20281     if (this._readableState.flowing !== false) {
20282       debug("pause");
20283       this._readableState.flowing = false;
20284       this.emit("pause");
20285     }
20286     return this;
20287   };
20288   function flow(stream) {
20289     var state = stream._readableState;
20290     debug("flow", state.flowing);
20291     while (state.flowing && stream.read() !== null) {
20292     }
20293   }
20294   Readable.prototype.wrap = function(stream) {
20295     var _this = this;
20296     var state = this._readableState;
20297     var paused = false;
20298     stream.on("end", function() {
20299       debug("wrapped end");
20300       if (state.decoder && !state.ended) {
20301         var chunk = state.decoder.end();
20302         if (chunk && chunk.length)
20303           _this.push(chunk);
20304       }
20305       _this.push(null);
20306     });
20307     stream.on("data", function(chunk) {
20308       debug("wrapped data");
20309       if (state.decoder)
20310         chunk = state.decoder.write(chunk);
20311       if (state.objectMode && (chunk === null || chunk === void 0))
20312         return;
20313       else if (!state.objectMode && (!chunk || !chunk.length))
20314         return;
20315       var ret2 = _this.push(chunk);
20316       if (!ret2) {
20317         paused = true;
20318         stream.pause();
20319       }
20320     });
20321     for (var i in stream) {
20322       if (this[i] === void 0 && typeof stream[i] === "function") {
20323         this[i] = function(method) {
20324           return function() {
20325             return stream[method].apply(stream, arguments);
20326           };
20327         }(i);
20328       }
20329     }
20330     for (var n = 0; n < kProxyEvents.length; n++) {
20331       stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
20332     }
20333     this._read = function(n2) {
20334       debug("wrapped _read", n2);
20335       if (paused) {
20336         paused = false;
20337         stream.resume();
20338       }
20339     };
20340     return this;
20341   };
20342   Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
20343     enumerable: false,
20344     get: function() {
20345       return this._readableState.highWaterMark;
20346     }
20347   });
20348   Readable._fromList = fromList;
20349   function fromList(n, state) {
20350     if (state.length === 0)
20351       return null;
20352     var ret2;
20353     if (state.objectMode)
20354       ret2 = state.buffer.shift();
20355     else if (!n || n >= state.length) {
20356       if (state.decoder)
20357         ret2 = state.buffer.join("");
20358       else if (state.buffer.length === 1)
20359         ret2 = state.buffer.head.data;
20360       else
20361         ret2 = state.buffer.concat(state.length);
20362       state.buffer.clear();
20363     } else {
20364       ret2 = fromListPartial(n, state.buffer, state.decoder);
20365     }
20366     return ret2;
20367   }
20368   function fromListPartial(n, list, hasStrings) {
20369     var ret2;
20370     if (n < list.head.data.length) {
20371       ret2 = list.head.data.slice(0, n);
20372       list.head.data = list.head.data.slice(n);
20373     } else if (n === list.head.data.length) {
20374       ret2 = list.shift();
20375     } else {
20376       ret2 = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
20377     }
20378     return ret2;
20379   }
20380   function copyFromBufferString(n, list) {
20381     var p = list.head;
20382     var c = 1;
20383     var ret2 = p.data;
20384     n -= ret2.length;
20385     while (p = p.next) {
20386       var str = p.data;
20387       var nb = n > str.length ? str.length : n;
20388       if (nb === str.length)
20389         ret2 += str;
20390       else
20391         ret2 += str.slice(0, n);
20392       n -= nb;
20393       if (n === 0) {
20394         if (nb === str.length) {
20395           ++c;
20396           if (p.next)
20397             list.head = p.next;
20398           else
20399             list.head = list.tail = null;
20400         } else {
20401           list.head = p;
20402           p.data = str.slice(nb);
20403         }
20404         break;
20405       }
20406       ++c;
20407     }
20408     list.length -= c;
20409     return ret2;
20410   }
20411   function copyFromBuffer(n, list) {
20412     var ret2 = Buffer2.allocUnsafe(n);
20413     var p = list.head;
20414     var c = 1;
20415     p.data.copy(ret2);
20416     n -= p.data.length;
20417     while (p = p.next) {
20418       var buf = p.data;
20419       var nb = n > buf.length ? buf.length : n;
20420       buf.copy(ret2, ret2.length - n, 0, nb);
20421       n -= nb;
20422       if (n === 0) {
20423         if (nb === buf.length) {
20424           ++c;
20425           if (p.next)
20426             list.head = p.next;
20427           else
20428             list.head = list.tail = null;
20429         } else {
20430           list.head = p;
20431           p.data = buf.slice(nb);
20432         }
20433         break;
20434       }
20435       ++c;
20436     }
20437     list.length -= c;
20438     return ret2;
20439   }
20440   function endReadable(stream) {
20441     var state = stream._readableState;
20442     if (state.length > 0)
20443       throw new Error('"endReadable()" called on non-empty stream');
20444     if (!state.endEmitted) {
20445       state.ended = true;
20446       pna.nextTick(endReadableNT, state, stream);
20447     }
20448   }
20449   function endReadableNT(state, stream) {
20450     if (!state.endEmitted && state.length === 0) {
20451       state.endEmitted = true;
20452       stream.readable = false;
20453       stream.emit("end");
20454     }
20455   }
20456   function indexOf(xs, x) {
20457     for (var i = 0, l = xs.length; i < l; i++) {
20458       if (xs[i] === x)
20459         return i;
20460     }
20461     return -1;
20462   }
20463 });
20464
20465 // node_modules/readable-stream/lib/_stream_transform.js
20466 var require_stream_transform = __commonJS((exports2, module2) => {
20467   "use strict";
20468   module2.exports = Transform;
20469   var Duplex = require_stream_duplex();
20470   var util = Object.create(require_util2());
20471   util.inherits = require_inherits();
20472   util.inherits(Transform, Duplex);
20473   function afterTransform(er, data) {
20474     var ts = this._transformState;
20475     ts.transforming = false;
20476     var cb = ts.writecb;
20477     if (!cb) {
20478       return this.emit("error", new Error("write callback called multiple times"));
20479     }
20480     ts.writechunk = null;
20481     ts.writecb = null;
20482     if (data != null)
20483       this.push(data);
20484     cb(er);
20485     var rs = this._readableState;
20486     rs.reading = false;
20487     if (rs.needReadable || rs.length < rs.highWaterMark) {
20488       this._read(rs.highWaterMark);
20489     }
20490   }
20491   function Transform(options) {
20492     if (!(this instanceof Transform))
20493       return new Transform(options);
20494     Duplex.call(this, options);
20495     this._transformState = {
20496       afterTransform: afterTransform.bind(this),
20497       needTransform: false,
20498       transforming: false,
20499       writecb: null,
20500       writechunk: null,
20501       writeencoding: null
20502     };
20503     this._readableState.needReadable = true;
20504     this._readableState.sync = false;
20505     if (options) {
20506       if (typeof options.transform === "function")
20507         this._transform = options.transform;
20508       if (typeof options.flush === "function")
20509         this._flush = options.flush;
20510     }
20511     this.on("prefinish", prefinish);
20512   }
20513   function prefinish() {
20514     var _this = this;
20515     if (typeof this._flush === "function") {
20516       this._flush(function(er, data) {
20517         done(_this, er, data);
20518       });
20519     } else {
20520       done(this, null, null);
20521     }
20522   }
20523   Transform.prototype.push = function(chunk, encoding) {
20524     this._transformState.needTransform = false;
20525     return Duplex.prototype.push.call(this, chunk, encoding);
20526   };
20527   Transform.prototype._transform = function(chunk, encoding, cb) {
20528     throw new Error("_transform() is not implemented");
20529   };
20530   Transform.prototype._write = function(chunk, encoding, cb) {
20531     var ts = this._transformState;
20532     ts.writecb = cb;
20533     ts.writechunk = chunk;
20534     ts.writeencoding = encoding;
20535     if (!ts.transforming) {
20536       var rs = this._readableState;
20537       if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark)
20538         this._read(rs.highWaterMark);
20539     }
20540   };
20541   Transform.prototype._read = function(n) {
20542     var ts = this._transformState;
20543     if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
20544       ts.transforming = true;
20545       this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
20546     } else {
20547       ts.needTransform = true;
20548     }
20549   };
20550   Transform.prototype._destroy = function(err, cb) {
20551     var _this2 = this;
20552     Duplex.prototype._destroy.call(this, err, function(err2) {
20553       cb(err2);
20554       _this2.emit("close");
20555     });
20556   };
20557   function done(stream, er, data) {
20558     if (er)
20559       return stream.emit("error", er);
20560     if (data != null)
20561       stream.push(data);
20562     if (stream._writableState.length)
20563       throw new Error("Calling transform done when ws.length != 0");
20564     if (stream._transformState.transforming)
20565       throw new Error("Calling transform done when still transforming");
20566     return stream.push(null);
20567   }
20568 });
20569
20570 // node_modules/readable-stream/lib/_stream_passthrough.js
20571 var require_stream_passthrough = __commonJS((exports2, module2) => {
20572   "use strict";
20573   module2.exports = PassThrough;
20574   var Transform = require_stream_transform();
20575   var util = Object.create(require_util2());
20576   util.inherits = require_inherits();
20577   util.inherits(PassThrough, Transform);
20578   function PassThrough(options) {
20579     if (!(this instanceof PassThrough))
20580       return new PassThrough(options);
20581     Transform.call(this, options);
20582   }
20583   PassThrough.prototype._transform = function(chunk, encoding, cb) {
20584     cb(null, chunk);
20585   };
20586 });
20587
20588 // node_modules/readable-stream/readable.js
20589 var require_readable = __commonJS((exports2, module2) => {
20590   var Stream = require("stream");
20591   if (process.env.READABLE_STREAM === "disable" && Stream) {
20592     module2.exports = Stream;
20593     exports2 = module2.exports = Stream.Readable;
20594     exports2.Readable = Stream.Readable;
20595     exports2.Writable = Stream.Writable;
20596     exports2.Duplex = Stream.Duplex;
20597     exports2.Transform = Stream.Transform;
20598     exports2.PassThrough = Stream.PassThrough;
20599     exports2.Stream = Stream;
20600   } else {
20601     exports2 = module2.exports = require_stream_readable();
20602     exports2.Stream = Stream || exports2;
20603     exports2.Readable = exports2;
20604     exports2.Writable = require_stream_writable();
20605     exports2.Duplex = require_stream_duplex();
20606     exports2.Transform = require_stream_transform();
20607     exports2.PassThrough = require_stream_passthrough();
20608   }
20609 });
20610
20611 // node_modules/unzipper/lib/PullStream.js
20612 var require_PullStream = __commonJS((exports2, module2) => {
20613   var Stream = require("stream");
20614   var Promise2 = require_bluebird();
20615   var util = require("util");
20616   var Buffer2 = require_Buffer();
20617   var strFunction = "function";
20618   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
20619     Stream = require_readable();
20620   function PullStream() {
20621     if (!(this instanceof PullStream))
20622       return new PullStream();
20623     Stream.Duplex.call(this, {decodeStrings: false, objectMode: true});
20624     this.buffer = Buffer2.from("");
20625     var self2 = this;
20626     self2.on("finish", function() {
20627       self2.finished = true;
20628       self2.emit("chunk", false);
20629     });
20630   }
20631   util.inherits(PullStream, Stream.Duplex);
20632   PullStream.prototype._write = function(chunk, e, cb) {
20633     this.buffer = Buffer2.concat([this.buffer, chunk]);
20634     this.cb = cb;
20635     this.emit("chunk");
20636   };
20637   PullStream.prototype.stream = function(eof, includeEof) {
20638     var p = Stream.PassThrough();
20639     var done, self2 = this;
20640     function cb() {
20641       if (typeof self2.cb === strFunction) {
20642         var callback = self2.cb;
20643         self2.cb = void 0;
20644         return callback();
20645       }
20646     }
20647     function pull() {
20648       var packet;
20649       if (self2.buffer && self2.buffer.length) {
20650         if (typeof eof === "number") {
20651           packet = self2.buffer.slice(0, eof);
20652           self2.buffer = self2.buffer.slice(eof);
20653           eof -= packet.length;
20654           done = !eof;
20655         } else {
20656           var match = self2.buffer.indexOf(eof);
20657           if (match !== -1) {
20658             self2.match = match;
20659             if (includeEof)
20660               match = match + eof.length;
20661             packet = self2.buffer.slice(0, match);
20662             self2.buffer = self2.buffer.slice(match);
20663             done = true;
20664           } else {
20665             var len = self2.buffer.length - eof.length;
20666             if (len <= 0) {
20667               cb();
20668             } else {
20669               packet = self2.buffer.slice(0, len);
20670               self2.buffer = self2.buffer.slice(len);
20671             }
20672           }
20673         }
20674         if (packet)
20675           p.write(packet, function() {
20676             if (self2.buffer.length === 0 || eof.length && self2.buffer.length <= eof.length)
20677               cb();
20678           });
20679       }
20680       if (!done) {
20681         if (self2.finished && !this.__ended) {
20682           self2.removeListener("chunk", pull);
20683           self2.emit("error", new Error("FILE_ENDED"));
20684           this.__ended = true;
20685           return;
20686         }
20687       } else {
20688         self2.removeListener("chunk", pull);
20689         p.end();
20690       }
20691     }
20692     self2.on("chunk", pull);
20693     pull();
20694     return p;
20695   };
20696   PullStream.prototype.pull = function(eof, includeEof) {
20697     if (eof === 0)
20698       return Promise2.resolve("");
20699     if (!isNaN(eof) && this.buffer.length > eof) {
20700       var data = this.buffer.slice(0, eof);
20701       this.buffer = this.buffer.slice(eof);
20702       return Promise2.resolve(data);
20703     }
20704     var buffer = Buffer2.from(""), self2 = this;
20705     var concatStream = Stream.Transform();
20706     concatStream._transform = function(d, e, cb) {
20707       buffer = Buffer2.concat([buffer, d]);
20708       cb();
20709     };
20710     var rejectHandler;
20711     var pullStreamRejectHandler;
20712     return new Promise2(function(resolve, reject) {
20713       rejectHandler = reject;
20714       pullStreamRejectHandler = function(e) {
20715         self2.__emittedError = e;
20716         reject(e);
20717       };
20718       if (self2.finished)
20719         return reject(new Error("FILE_ENDED"));
20720       self2.once("error", pullStreamRejectHandler);
20721       self2.stream(eof, includeEof).on("error", reject).pipe(concatStream).on("finish", function() {
20722         resolve(buffer);
20723       }).on("error", reject);
20724     }).finally(function() {
20725       self2.removeListener("error", rejectHandler);
20726       self2.removeListener("error", pullStreamRejectHandler);
20727     });
20728   };
20729   PullStream.prototype._read = function() {
20730   };
20731   module2.exports = PullStream;
20732 });
20733
20734 // node_modules/unzipper/lib/NoopStream.js
20735 var require_NoopStream = __commonJS((exports2, module2) => {
20736   var Stream = require("stream");
20737   var util = require("util");
20738   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
20739     Stream = require_readable();
20740   function NoopStream() {
20741     if (!(this instanceof NoopStream)) {
20742       return new NoopStream();
20743     }
20744     Stream.Transform.call(this);
20745   }
20746   util.inherits(NoopStream, Stream.Transform);
20747   NoopStream.prototype._transform = function(d, e, cb) {
20748     cb();
20749   };
20750   module2.exports = NoopStream;
20751 });
20752
20753 // node_modules/unzipper/lib/BufferStream.js
20754 var require_BufferStream = __commonJS((exports2, module2) => {
20755   var Promise2 = require_bluebird();
20756   var Stream = require("stream");
20757   var Buffer2 = require_Buffer();
20758   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
20759     Stream = require_readable();
20760   module2.exports = function(entry) {
20761     return new Promise2(function(resolve, reject) {
20762       var chunks = [];
20763       var bufferStream = Stream.Transform().on("finish", function() {
20764         resolve(Buffer2.concat(chunks));
20765       }).on("error", reject);
20766       bufferStream._transform = function(d, e, cb) {
20767         chunks.push(d);
20768         cb();
20769       };
20770       entry.on("error", reject).pipe(bufferStream);
20771     });
20772   };
20773 });
20774
20775 // node_modules/unzipper/lib/parseExtraField.js
20776 var require_parseExtraField = __commonJS((exports2, module2) => {
20777   var binary = require_binary();
20778   module2.exports = function(extraField, vars) {
20779     var extra;
20780     while (!extra && extraField && extraField.length) {
20781       var candidateExtra = binary.parse(extraField).word16lu("signature").word16lu("partsize").word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offset").word64lu("disknum").vars;
20782       if (candidateExtra.signature === 1) {
20783         extra = candidateExtra;
20784       } else {
20785         extraField = extraField.slice(candidateExtra.partsize + 4);
20786       }
20787     }
20788     extra = extra || {};
20789     if (vars.compressedSize === 4294967295)
20790       vars.compressedSize = extra.compressedSize;
20791     if (vars.uncompressedSize === 4294967295)
20792       vars.uncompressedSize = extra.uncompressedSize;
20793     if (vars.offsetToLocalFileHeader === 4294967295)
20794       vars.offsetToLocalFileHeader = extra.offset;
20795     return extra;
20796   };
20797 });
20798
20799 // node_modules/unzipper/lib/parseDateTime.js
20800 var require_parseDateTime = __commonJS((exports2, module2) => {
20801   module2.exports = function parseDateTime(date, time) {
20802     const day = date & 31;
20803     const month = date >> 5 & 15;
20804     const year = (date >> 9 & 127) + 1980;
20805     const seconds = time ? (time & 31) * 2 : 0;
20806     const minutes = time ? time >> 5 & 63 : 0;
20807     const hours = time ? time >> 11 : 0;
20808     return new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds));
20809   };
20810 });
20811
20812 // node_modules/unzipper/lib/parse.js
20813 var require_parse3 = __commonJS((exports2, module2) => {
20814   var util = require("util");
20815   var zlib = require("zlib");
20816   var Stream = require("stream");
20817   var binary = require_binary();
20818   var Promise2 = require_bluebird();
20819   var PullStream = require_PullStream();
20820   var NoopStream = require_NoopStream();
20821   var BufferStream = require_BufferStream();
20822   var parseExtraField = require_parseExtraField();
20823   var Buffer2 = require_Buffer();
20824   var parseDateTime = require_parseDateTime();
20825   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
20826     Stream = require_readable();
20827   var endDirectorySignature = Buffer2.alloc(4);
20828   endDirectorySignature.writeUInt32LE(101010256, 0);
20829   function Parse(opts) {
20830     if (!(this instanceof Parse)) {
20831       return new Parse(opts);
20832     }
20833     var self2 = this;
20834     self2._opts = opts || {verbose: false};
20835     PullStream.call(self2, self2._opts);
20836     self2.on("finish", function() {
20837       self2.emit("close");
20838     });
20839     self2._readRecord().catch(function(e) {
20840       if (!self2.__emittedError || self2.__emittedError !== e)
20841         self2.emit("error", e);
20842     });
20843   }
20844   util.inherits(Parse, PullStream);
20845   Parse.prototype._readRecord = function() {
20846     var self2 = this;
20847     return self2.pull(4).then(function(data) {
20848       if (data.length === 0)
20849         return;
20850       var signature = data.readUInt32LE(0);
20851       if (signature === 875721283) {
20852         return self2._readCrxHeader();
20853       }
20854       if (signature === 67324752) {
20855         return self2._readFile();
20856       } else if (signature === 33639248) {
20857         self2.__ended = true;
20858         return self2._readCentralDirectoryFileHeader();
20859       } else if (signature === 101010256) {
20860         return self2._readEndOfCentralDirectoryRecord();
20861       } else if (self2.__ended) {
20862         return self2.pull(endDirectorySignature).then(function() {
20863           return self2._readEndOfCentralDirectoryRecord();
20864         });
20865       } else
20866         self2.emit("error", new Error("invalid signature: 0x" + signature.toString(16)));
20867     });
20868   };
20869   Parse.prototype._readCrxHeader = function() {
20870     var self2 = this;
20871     return self2.pull(12).then(function(data) {
20872       self2.crxHeader = binary.parse(data).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars;
20873       return self2.pull(self2.crxHeader.pubKeyLength + self2.crxHeader.signatureLength);
20874     }).then(function(data) {
20875       self2.crxHeader.publicKey = data.slice(0, self2.crxHeader.pubKeyLength);
20876       self2.crxHeader.signature = data.slice(self2.crxHeader.pubKeyLength);
20877       self2.emit("crx-header", self2.crxHeader);
20878       return self2._readRecord();
20879     });
20880   };
20881   Parse.prototype._readFile = function() {
20882     var self2 = this;
20883     return self2.pull(26).then(function(data) {
20884       var vars = binary.parse(data).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;
20885       vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime);
20886       if (self2.crxHeader)
20887         vars.crxHeader = self2.crxHeader;
20888       return self2.pull(vars.fileNameLength).then(function(fileNameBuffer) {
20889         var fileName = fileNameBuffer.toString("utf8");
20890         var entry = Stream.PassThrough();
20891         var __autodraining = false;
20892         entry.autodrain = function() {
20893           __autodraining = true;
20894           var draining = entry.pipe(NoopStream());
20895           draining.promise = function() {
20896             return new Promise2(function(resolve, reject) {
20897               draining.on("finish", resolve);
20898               draining.on("error", reject);
20899             });
20900           };
20901           return draining;
20902         };
20903         entry.buffer = function() {
20904           return BufferStream(entry);
20905         };
20906         entry.path = fileName;
20907         entry.props = {};
20908         entry.props.path = fileName;
20909         entry.props.pathBuffer = fileNameBuffer;
20910         entry.props.flags = {
20911           isUnicode: vars.flags & 17
20912         };
20913         entry.type = vars.uncompressedSize === 0 && /[\/\\]$/.test(fileName) ? "Directory" : "File";
20914         if (self2._opts.verbose) {
20915           if (entry.type === "Directory") {
20916             console.log("   creating:", fileName);
20917           } else if (entry.type === "File") {
20918             if (vars.compressionMethod === 0) {
20919               console.log(" extracting:", fileName);
20920             } else {
20921               console.log("  inflating:", fileName);
20922             }
20923           }
20924         }
20925         return self2.pull(vars.extraFieldLength).then(function(extraField) {
20926           var extra = parseExtraField(extraField, vars);
20927           entry.vars = vars;
20928           entry.extra = extra;
20929           if (self2._opts.forceStream) {
20930             self2.push(entry);
20931           } else {
20932             self2.emit("entry", entry);
20933             if (self2._readableState.pipesCount || self2._readableState.pipes && self2._readableState.pipes.length)
20934               self2.push(entry);
20935           }
20936           if (self2._opts.verbose)
20937             console.log({
20938               filename: fileName,
20939               vars,
20940               extra
20941             });
20942           var fileSizeKnown = !(vars.flags & 8) || vars.compressedSize > 0, eof;
20943           entry.__autodraining = __autodraining;
20944           var inflater = vars.compressionMethod && !__autodraining ? zlib.createInflateRaw() : Stream.PassThrough();
20945           if (fileSizeKnown) {
20946             entry.size = vars.uncompressedSize;
20947             eof = vars.compressedSize;
20948           } else {
20949             eof = Buffer2.alloc(4);
20950             eof.writeUInt32LE(134695760, 0);
20951           }
20952           return new Promise2(function(resolve, reject) {
20953             self2.stream(eof).pipe(inflater).on("error", function(err) {
20954               self2.emit("error", err);
20955             }).pipe(entry).on("finish", function() {
20956               return fileSizeKnown ? self2._readRecord().then(resolve).catch(reject) : self2._processDataDescriptor(entry).then(resolve).catch(reject);
20957             });
20958           });
20959         });
20960       });
20961     });
20962   };
20963   Parse.prototype._processDataDescriptor = function(entry) {
20964     var self2 = this;
20965     return self2.pull(16).then(function(data) {
20966       var vars = binary.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;
20967       entry.size = vars.uncompressedSize;
20968       return self2._readRecord();
20969     });
20970   };
20971   Parse.prototype._readCentralDirectoryFileHeader = function() {
20972     var self2 = this;
20973     return self2.pull(42).then(function(data) {
20974       var vars = binary.parse(data).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;
20975       return self2.pull(vars.fileNameLength).then(function(fileName) {
20976         vars.fileName = fileName.toString("utf8");
20977         return self2.pull(vars.extraFieldLength);
20978       }).then(function(extraField) {
20979         return self2.pull(vars.fileCommentLength);
20980       }).then(function(fileComment) {
20981         return self2._readRecord();
20982       });
20983     });
20984   };
20985   Parse.prototype._readEndOfCentralDirectoryRecord = function() {
20986     var self2 = this;
20987     return self2.pull(18).then(function(data) {
20988       var vars = binary.parse(data).word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;
20989       return self2.pull(vars.commentLength).then(function(comment) {
20990         comment = comment.toString("utf8");
20991         self2.end();
20992         self2.push(null);
20993       });
20994     });
20995   };
20996   Parse.prototype.promise = function() {
20997     var self2 = this;
20998     return new Promise2(function(resolve, reject) {
20999       self2.on("finish", resolve);
21000       self2.on("error", reject);
21001     });
21002   };
21003   module2.exports = Parse;
21004 });
21005
21006 // node_modules/duplexer2/index.js
21007 var require_duplexer2 = __commonJS((exports2, module2) => {
21008   "use strict";
21009   var stream = require_readable();
21010   function DuplexWrapper(options, writable, readable) {
21011     if (typeof readable === "undefined") {
21012       readable = writable;
21013       writable = options;
21014       options = null;
21015     }
21016     stream.Duplex.call(this, options);
21017     if (typeof readable.read !== "function") {
21018       readable = new stream.Readable(options).wrap(readable);
21019     }
21020     this._writable = writable;
21021     this._readable = readable;
21022     this._waiting = false;
21023     var self2 = this;
21024     writable.once("finish", function() {
21025       self2.end();
21026     });
21027     this.once("finish", function() {
21028       writable.end();
21029     });
21030     readable.on("readable", function() {
21031       if (self2._waiting) {
21032         self2._waiting = false;
21033         self2._read();
21034       }
21035     });
21036     readable.once("end", function() {
21037       self2.push(null);
21038     });
21039     if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) {
21040       writable.on("error", function(err) {
21041         self2.emit("error", err);
21042       });
21043       readable.on("error", function(err) {
21044         self2.emit("error", err);
21045       });
21046     }
21047   }
21048   DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}});
21049   DuplexWrapper.prototype._write = function _write(input, encoding, done) {
21050     this._writable.write(input, encoding, done);
21051   };
21052   DuplexWrapper.prototype._read = function _read() {
21053     var buf;
21054     var reads = 0;
21055     while ((buf = this._readable.read()) !== null) {
21056       this.push(buf);
21057       reads++;
21058     }
21059     if (reads === 0) {
21060       this._waiting = true;
21061     }
21062   };
21063   module2.exports = function duplex2(options, writable, readable) {
21064     return new DuplexWrapper(options, writable, readable);
21065   };
21066   module2.exports.DuplexWrapper = DuplexWrapper;
21067 });
21068
21069 // node_modules/unzipper/lib/parseOne.js
21070 var require_parseOne = __commonJS((exports2, module2) => {
21071   var Stream = require("stream");
21072   var Parse = require_parse3();
21073   var duplexer2 = require_duplexer2();
21074   var BufferStream = require_BufferStream();
21075   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
21076     Stream = require_readable();
21077   function parseOne(match, opts) {
21078     var inStream = Stream.PassThrough({objectMode: true});
21079     var outStream = Stream.PassThrough();
21080     var transform = Stream.Transform({objectMode: true});
21081     var re = match instanceof RegExp ? match : match && new RegExp(match);
21082     var found;
21083     transform._transform = function(entry, e, cb) {
21084       if (found || re && !re.exec(entry.path)) {
21085         entry.autodrain();
21086         return cb();
21087       } else {
21088         found = true;
21089         out.emit("entry", entry);
21090         entry.on("error", function(e2) {
21091           outStream.emit("error", e2);
21092         });
21093         entry.pipe(outStream).on("error", function(err) {
21094           cb(err);
21095         }).on("finish", function(d) {
21096           cb(null, d);
21097         });
21098       }
21099     };
21100     inStream.pipe(Parse(opts)).on("error", function(err) {
21101       outStream.emit("error", err);
21102     }).pipe(transform).on("error", Object).on("finish", function() {
21103       if (!found)
21104         outStream.emit("error", new Error("PATTERN_NOT_FOUND"));
21105       else
21106         outStream.end();
21107     });
21108     var out = duplexer2(inStream, outStream);
21109     out.buffer = function() {
21110       return BufferStream(outStream);
21111     };
21112     return out;
21113   }
21114   module2.exports = parseOne;
21115 });
21116
21117 // node_modules/fstream/lib/abstract.js
21118 var require_abstract = __commonJS((exports2, module2) => {
21119   module2.exports = Abstract;
21120   var Stream = require("stream").Stream;
21121   var inherits2 = require_inherits();
21122   function Abstract() {
21123     Stream.call(this);
21124   }
21125   inherits2(Abstract, Stream);
21126   Abstract.prototype.on = function(ev, fn) {
21127     if (ev === "ready" && this.ready) {
21128       process.nextTick(fn.bind(this));
21129     } else {
21130       Stream.prototype.on.call(this, ev, fn);
21131     }
21132     return this;
21133   };
21134   Abstract.prototype.abort = function() {
21135     this._aborted = true;
21136     this.emit("abort");
21137   };
21138   Abstract.prototype.destroy = function() {
21139   };
21140   Abstract.prototype.warn = function(msg, code) {
21141     var self2 = this;
21142     var er = decorate(msg, code, self2);
21143     if (!self2.listeners("warn")) {
21144       console.error("%s %s\npath = %s\nsyscall = %s\nfstream_type = %s\nfstream_path = %s\nfstream_unc_path = %s\nfstream_class = %s\nfstream_stack =\n%s\n", code || "UNKNOWN", er.stack, er.path, er.syscall, er.fstream_type, er.fstream_path, er.fstream_unc_path, er.fstream_class, er.fstream_stack.join("\n"));
21145     } else {
21146       self2.emit("warn", er);
21147     }
21148   };
21149   Abstract.prototype.info = function(msg, code) {
21150     this.emit("info", msg, code);
21151   };
21152   Abstract.prototype.error = function(msg, code, th) {
21153     var er = decorate(msg, code, this);
21154     if (th)
21155       throw er;
21156     else
21157       this.emit("error", er);
21158   };
21159   function decorate(er, code, self2) {
21160     if (!(er instanceof Error))
21161       er = new Error(er);
21162     er.code = er.code || code;
21163     er.path = er.path || self2.path;
21164     er.fstream_type = er.fstream_type || self2.type;
21165     er.fstream_path = er.fstream_path || self2.path;
21166     if (self2._path !== self2.path) {
21167       er.fstream_unc_path = er.fstream_unc_path || self2._path;
21168     }
21169     if (self2.linkpath) {
21170       er.fstream_linkpath = er.fstream_linkpath || self2.linkpath;
21171     }
21172     er.fstream_class = er.fstream_class || self2.constructor.name;
21173     er.fstream_stack = er.fstream_stack || new Error().stack.split(/\n/).slice(3).map(function(s) {
21174       return s.replace(/^ {4}at /, "");
21175     });
21176     return er;
21177   }
21178 });
21179
21180 // node_modules/graceful-fs/polyfills.js
21181 var require_polyfills = __commonJS((exports2, module2) => {
21182   var constants = require("constants");
21183   var origCwd = process.cwd;
21184   var cwd = null;
21185   var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
21186   process.cwd = function() {
21187     if (!cwd)
21188       cwd = origCwd.call(process);
21189     return cwd;
21190   };
21191   try {
21192     process.cwd();
21193   } catch (er) {
21194   }
21195   var chdir = process.chdir;
21196   process.chdir = function(d) {
21197     cwd = null;
21198     chdir.call(process, d);
21199   };
21200   module2.exports = patch;
21201   function patch(fs) {
21202     if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
21203       patchLchmod(fs);
21204     }
21205     if (!fs.lutimes) {
21206       patchLutimes(fs);
21207     }
21208     fs.chown = chownFix(fs.chown);
21209     fs.fchown = chownFix(fs.fchown);
21210     fs.lchown = chownFix(fs.lchown);
21211     fs.chmod = chmodFix(fs.chmod);
21212     fs.fchmod = chmodFix(fs.fchmod);
21213     fs.lchmod = chmodFix(fs.lchmod);
21214     fs.chownSync = chownFixSync(fs.chownSync);
21215     fs.fchownSync = chownFixSync(fs.fchownSync);
21216     fs.lchownSync = chownFixSync(fs.lchownSync);
21217     fs.chmodSync = chmodFixSync(fs.chmodSync);
21218     fs.fchmodSync = chmodFixSync(fs.fchmodSync);
21219     fs.lchmodSync = chmodFixSync(fs.lchmodSync);
21220     fs.stat = statFix(fs.stat);
21221     fs.fstat = statFix(fs.fstat);
21222     fs.lstat = statFix(fs.lstat);
21223     fs.statSync = statFixSync(fs.statSync);
21224     fs.fstatSync = statFixSync(fs.fstatSync);
21225     fs.lstatSync = statFixSync(fs.lstatSync);
21226     if (!fs.lchmod) {
21227       fs.lchmod = function(path, mode, cb) {
21228         if (cb)
21229           process.nextTick(cb);
21230       };
21231       fs.lchmodSync = function() {
21232       };
21233     }
21234     if (!fs.lchown) {
21235       fs.lchown = function(path, uid, gid, cb) {
21236         if (cb)
21237           process.nextTick(cb);
21238       };
21239       fs.lchownSync = function() {
21240       };
21241     }
21242     if (platform === "win32") {
21243       fs.rename = function(fs$rename) {
21244         return function(from, to, cb) {
21245           var start = Date.now();
21246           var backoff = 0;
21247           fs$rename(from, to, function CB(er) {
21248             if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 6e4) {
21249               setTimeout(function() {
21250                 fs.stat(to, function(stater, st) {
21251                   if (stater && stater.code === "ENOENT")
21252                     fs$rename(from, to, CB);
21253                   else
21254                     cb(er);
21255                 });
21256               }, backoff);
21257               if (backoff < 100)
21258                 backoff += 10;
21259               return;
21260             }
21261             if (cb)
21262               cb(er);
21263           });
21264         };
21265       }(fs.rename);
21266     }
21267     fs.read = function(fs$read) {
21268       function read(fd, buffer, offset, length, position, callback_) {
21269         var callback;
21270         if (callback_ && typeof callback_ === "function") {
21271           var eagCounter = 0;
21272           callback = function(er, _, __) {
21273             if (er && er.code === "EAGAIN" && eagCounter < 10) {
21274               eagCounter++;
21275               return fs$read.call(fs, fd, buffer, offset, length, position, callback);
21276             }
21277             callback_.apply(this, arguments);
21278           };
21279         }
21280         return fs$read.call(fs, fd, buffer, offset, length, position, callback);
21281       }
21282       read.__proto__ = fs$read;
21283       return read;
21284     }(fs.read);
21285     fs.readSync = function(fs$readSync) {
21286       return function(fd, buffer, offset, length, position) {
21287         var eagCounter = 0;
21288         while (true) {
21289           try {
21290             return fs$readSync.call(fs, fd, buffer, offset, length, position);
21291           } catch (er) {
21292             if (er.code === "EAGAIN" && eagCounter < 10) {
21293               eagCounter++;
21294               continue;
21295             }
21296             throw er;
21297           }
21298         }
21299       };
21300     }(fs.readSync);
21301     function patchLchmod(fs2) {
21302       fs2.lchmod = function(path, mode, callback) {
21303         fs2.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
21304           if (err) {
21305             if (callback)
21306               callback(err);
21307             return;
21308           }
21309           fs2.fchmod(fd, mode, function(err2) {
21310             fs2.close(fd, function(err22) {
21311               if (callback)
21312                 callback(err2 || err22);
21313             });
21314           });
21315         });
21316       };
21317       fs2.lchmodSync = function(path, mode) {
21318         var fd = fs2.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
21319         var threw = true;
21320         var ret2;
21321         try {
21322           ret2 = fs2.fchmodSync(fd, mode);
21323           threw = false;
21324         } finally {
21325           if (threw) {
21326             try {
21327               fs2.closeSync(fd);
21328             } catch (er) {
21329             }
21330           } else {
21331             fs2.closeSync(fd);
21332           }
21333         }
21334         return ret2;
21335       };
21336     }
21337     function patchLutimes(fs2) {
21338       if (constants.hasOwnProperty("O_SYMLINK")) {
21339         fs2.lutimes = function(path, at, mt, cb) {
21340           fs2.open(path, constants.O_SYMLINK, function(er, fd) {
21341             if (er) {
21342               if (cb)
21343                 cb(er);
21344               return;
21345             }
21346             fs2.futimes(fd, at, mt, function(er2) {
21347               fs2.close(fd, function(er22) {
21348                 if (cb)
21349                   cb(er2 || er22);
21350               });
21351             });
21352           });
21353         };
21354         fs2.lutimesSync = function(path, at, mt) {
21355           var fd = fs2.openSync(path, constants.O_SYMLINK);
21356           var ret2;
21357           var threw = true;
21358           try {
21359             ret2 = fs2.futimesSync(fd, at, mt);
21360             threw = false;
21361           } finally {
21362             if (threw) {
21363               try {
21364                 fs2.closeSync(fd);
21365               } catch (er) {
21366               }
21367             } else {
21368               fs2.closeSync(fd);
21369             }
21370           }
21371           return ret2;
21372         };
21373       } else {
21374         fs2.lutimes = function(_a, _b, _c, cb) {
21375           if (cb)
21376             process.nextTick(cb);
21377         };
21378         fs2.lutimesSync = function() {
21379         };
21380       }
21381     }
21382     function chmodFix(orig) {
21383       if (!orig)
21384         return orig;
21385       return function(target, mode, cb) {
21386         return orig.call(fs, target, mode, function(er) {
21387           if (chownErOk(er))
21388             er = null;
21389           if (cb)
21390             cb.apply(this, arguments);
21391         });
21392       };
21393     }
21394     function chmodFixSync(orig) {
21395       if (!orig)
21396         return orig;
21397       return function(target, mode) {
21398         try {
21399           return orig.call(fs, target, mode);
21400         } catch (er) {
21401           if (!chownErOk(er))
21402             throw er;
21403         }
21404       };
21405     }
21406     function chownFix(orig) {
21407       if (!orig)
21408         return orig;
21409       return function(target, uid, gid, cb) {
21410         return orig.call(fs, target, uid, gid, function(er) {
21411           if (chownErOk(er))
21412             er = null;
21413           if (cb)
21414             cb.apply(this, arguments);
21415         });
21416       };
21417     }
21418     function chownFixSync(orig) {
21419       if (!orig)
21420         return orig;
21421       return function(target, uid, gid) {
21422         try {
21423           return orig.call(fs, target, uid, gid);
21424         } catch (er) {
21425           if (!chownErOk(er))
21426             throw er;
21427         }
21428       };
21429     }
21430     function statFix(orig) {
21431       if (!orig)
21432         return orig;
21433       return function(target, options, cb) {
21434         if (typeof options === "function") {
21435           cb = options;
21436           options = null;
21437         }
21438         function callback(er, stats) {
21439           if (stats) {
21440             if (stats.uid < 0)
21441               stats.uid += 4294967296;
21442             if (stats.gid < 0)
21443               stats.gid += 4294967296;
21444           }
21445           if (cb)
21446             cb.apply(this, arguments);
21447         }
21448         return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
21449       };
21450     }
21451     function statFixSync(orig) {
21452       if (!orig)
21453         return orig;
21454       return function(target, options) {
21455         var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
21456         if (stats.uid < 0)
21457           stats.uid += 4294967296;
21458         if (stats.gid < 0)
21459           stats.gid += 4294967296;
21460         return stats;
21461       };
21462     }
21463     function chownErOk(er) {
21464       if (!er)
21465         return true;
21466       if (er.code === "ENOSYS")
21467         return true;
21468       var nonroot = !process.getuid || process.getuid() !== 0;
21469       if (nonroot) {
21470         if (er.code === "EINVAL" || er.code === "EPERM")
21471           return true;
21472       }
21473       return false;
21474     }
21475   }
21476 });
21477
21478 // node_modules/graceful-fs/legacy-streams.js
21479 var require_legacy_streams = __commonJS((exports2, module2) => {
21480   var Stream = require("stream").Stream;
21481   module2.exports = legacy;
21482   function legacy(fs) {
21483     return {
21484       ReadStream,
21485       WriteStream
21486     };
21487     function ReadStream(path, options) {
21488       if (!(this instanceof ReadStream))
21489         return new ReadStream(path, options);
21490       Stream.call(this);
21491       var self2 = this;
21492       this.path = path;
21493       this.fd = null;
21494       this.readable = true;
21495       this.paused = false;
21496       this.flags = "r";
21497       this.mode = 438;
21498       this.bufferSize = 64 * 1024;
21499       options = options || {};
21500       var keys = Object.keys(options);
21501       for (var index = 0, length = keys.length; index < length; index++) {
21502         var key = keys[index];
21503         this[key] = options[key];
21504       }
21505       if (this.encoding)
21506         this.setEncoding(this.encoding);
21507       if (this.start !== void 0) {
21508         if (typeof this.start !== "number") {
21509           throw TypeError("start must be a Number");
21510         }
21511         if (this.end === void 0) {
21512           this.end = Infinity;
21513         } else if (typeof this.end !== "number") {
21514           throw TypeError("end must be a Number");
21515         }
21516         if (this.start > this.end) {
21517           throw new Error("start must be <= end");
21518         }
21519         this.pos = this.start;
21520       }
21521       if (this.fd !== null) {
21522         process.nextTick(function() {
21523           self2._read();
21524         });
21525         return;
21526       }
21527       fs.open(this.path, this.flags, this.mode, function(err, fd) {
21528         if (err) {
21529           self2.emit("error", err);
21530           self2.readable = false;
21531           return;
21532         }
21533         self2.fd = fd;
21534         self2.emit("open", fd);
21535         self2._read();
21536       });
21537     }
21538     function WriteStream(path, options) {
21539       if (!(this instanceof WriteStream))
21540         return new WriteStream(path, options);
21541       Stream.call(this);
21542       this.path = path;
21543       this.fd = null;
21544       this.writable = true;
21545       this.flags = "w";
21546       this.encoding = "binary";
21547       this.mode = 438;
21548       this.bytesWritten = 0;
21549       options = options || {};
21550       var keys = Object.keys(options);
21551       for (var index = 0, length = keys.length; index < length; index++) {
21552         var key = keys[index];
21553         this[key] = options[key];
21554       }
21555       if (this.start !== void 0) {
21556         if (typeof this.start !== "number") {
21557           throw TypeError("start must be a Number");
21558         }
21559         if (this.start < 0) {
21560           throw new Error("start must be >= zero");
21561         }
21562         this.pos = this.start;
21563       }
21564       this.busy = false;
21565       this._queue = [];
21566       if (this.fd === null) {
21567         this._open = fs.open;
21568         this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
21569         this.flush();
21570       }
21571     }
21572   }
21573 });
21574
21575 // node_modules/graceful-fs/clone.js
21576 var require_clone = __commonJS((exports2, module2) => {
21577   "use strict";
21578   module2.exports = clone;
21579   function clone(obj) {
21580     if (obj === null || typeof obj !== "object")
21581       return obj;
21582     if (obj instanceof Object)
21583       var copy = {__proto__: obj.__proto__};
21584     else
21585       var copy = Object.create(null);
21586     Object.getOwnPropertyNames(obj).forEach(function(key) {
21587       Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
21588     });
21589     return copy;
21590   }
21591 });
21592
21593 // node_modules/graceful-fs/graceful-fs.js
21594 var require_graceful_fs = __commonJS((exports2, module2) => {
21595   var fs = require("fs");
21596   var polyfills = require_polyfills();
21597   var legacy = require_legacy_streams();
21598   var clone = require_clone();
21599   var util = require("util");
21600   var gracefulQueue;
21601   var previousSymbol;
21602   if (typeof Symbol === "function" && typeof Symbol.for === "function") {
21603     gracefulQueue = Symbol.for("graceful-fs.queue");
21604     previousSymbol = Symbol.for("graceful-fs.previous");
21605   } else {
21606     gracefulQueue = "___graceful-fs.queue";
21607     previousSymbol = "___graceful-fs.previous";
21608   }
21609   function noop() {
21610   }
21611   function publishQueue(context, queue2) {
21612     Object.defineProperty(context, gracefulQueue, {
21613       get: function() {
21614         return queue2;
21615       }
21616     });
21617   }
21618   var debug = noop;
21619   if (util.debuglog)
21620     debug = util.debuglog("gfs4");
21621   else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
21622     debug = function() {
21623       var m = util.format.apply(util, arguments);
21624       m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
21625       console.error(m);
21626     };
21627   if (!fs[gracefulQueue]) {
21628     queue = global[gracefulQueue] || [];
21629     publishQueue(fs, queue);
21630     fs.close = function(fs$close) {
21631       function close(fd, cb) {
21632         return fs$close.call(fs, fd, function(err) {
21633           if (!err) {
21634             retry();
21635           }
21636           if (typeof cb === "function")
21637             cb.apply(this, arguments);
21638         });
21639       }
21640       Object.defineProperty(close, previousSymbol, {
21641         value: fs$close
21642       });
21643       return close;
21644     }(fs.close);
21645     fs.closeSync = function(fs$closeSync) {
21646       function closeSync(fd) {
21647         fs$closeSync.apply(fs, arguments);
21648         retry();
21649       }
21650       Object.defineProperty(closeSync, previousSymbol, {
21651         value: fs$closeSync
21652       });
21653       return closeSync;
21654     }(fs.closeSync);
21655     if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
21656       process.on("exit", function() {
21657         debug(fs[gracefulQueue]);
21658         require("assert").equal(fs[gracefulQueue].length, 0);
21659       });
21660     }
21661   }
21662   var queue;
21663   if (!global[gracefulQueue]) {
21664     publishQueue(global, fs[gracefulQueue]);
21665   }
21666   module2.exports = patch(clone(fs));
21667   if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {
21668     module2.exports = patch(fs);
21669     fs.__patched = true;
21670   }
21671   function patch(fs2) {
21672     polyfills(fs2);
21673     fs2.gracefulify = patch;
21674     fs2.createReadStream = createReadStream;
21675     fs2.createWriteStream = createWriteStream;
21676     var fs$readFile = fs2.readFile;
21677     fs2.readFile = readFile;
21678     function readFile(path, options, cb) {
21679       if (typeof options === "function")
21680         cb = options, options = null;
21681       return go$readFile(path, options, cb);
21682       function go$readFile(path2, options2, cb2) {
21683         return fs$readFile(path2, options2, function(err) {
21684           if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
21685             enqueue([go$readFile, [path2, options2, cb2]]);
21686           else {
21687             if (typeof cb2 === "function")
21688               cb2.apply(this, arguments);
21689             retry();
21690           }
21691         });
21692       }
21693     }
21694     var fs$writeFile = fs2.writeFile;
21695     fs2.writeFile = writeFile;
21696     function writeFile(path, data, options, cb) {
21697       if (typeof options === "function")
21698         cb = options, options = null;
21699       return go$writeFile(path, data, options, cb);
21700       function go$writeFile(path2, data2, options2, cb2) {
21701         return fs$writeFile(path2, data2, options2, function(err) {
21702           if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
21703             enqueue([go$writeFile, [path2, data2, options2, cb2]]);
21704           else {
21705             if (typeof cb2 === "function")
21706               cb2.apply(this, arguments);
21707             retry();
21708           }
21709         });
21710       }
21711     }
21712     var fs$appendFile = fs2.appendFile;
21713     if (fs$appendFile)
21714       fs2.appendFile = appendFile;
21715     function appendFile(path, data, options, cb) {
21716       if (typeof options === "function")
21717         cb = options, options = null;
21718       return go$appendFile(path, data, options, cb);
21719       function go$appendFile(path2, data2, options2, cb2) {
21720         return fs$appendFile(path2, data2, options2, function(err) {
21721           if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
21722             enqueue([go$appendFile, [path2, data2, options2, cb2]]);
21723           else {
21724             if (typeof cb2 === "function")
21725               cb2.apply(this, arguments);
21726             retry();
21727           }
21728         });
21729       }
21730     }
21731     var fs$readdir = fs2.readdir;
21732     fs2.readdir = readdir;
21733     function readdir(path, options, cb) {
21734       var args = [path];
21735       if (typeof options !== "function") {
21736         args.push(options);
21737       } else {
21738         cb = options;
21739       }
21740       args.push(go$readdir$cb);
21741       return go$readdir(args);
21742       function go$readdir$cb(err, files) {
21743         if (files && files.sort)
21744           files.sort();
21745         if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
21746           enqueue([go$readdir, [args]]);
21747         else {
21748           if (typeof cb === "function")
21749             cb.apply(this, arguments);
21750           retry();
21751         }
21752       }
21753     }
21754     function go$readdir(args) {
21755       return fs$readdir.apply(fs2, args);
21756     }
21757     if (process.version.substr(0, 4) === "v0.8") {
21758       var legStreams = legacy(fs2);
21759       ReadStream = legStreams.ReadStream;
21760       WriteStream = legStreams.WriteStream;
21761     }
21762     var fs$ReadStream = fs2.ReadStream;
21763     if (fs$ReadStream) {
21764       ReadStream.prototype = Object.create(fs$ReadStream.prototype);
21765       ReadStream.prototype.open = ReadStream$open;
21766     }
21767     var fs$WriteStream = fs2.WriteStream;
21768     if (fs$WriteStream) {
21769       WriteStream.prototype = Object.create(fs$WriteStream.prototype);
21770       WriteStream.prototype.open = WriteStream$open;
21771     }
21772     Object.defineProperty(fs2, "ReadStream", {
21773       get: function() {
21774         return ReadStream;
21775       },
21776       set: function(val) {
21777         ReadStream = val;
21778       },
21779       enumerable: true,
21780       configurable: true
21781     });
21782     Object.defineProperty(fs2, "WriteStream", {
21783       get: function() {
21784         return WriteStream;
21785       },
21786       set: function(val) {
21787         WriteStream = val;
21788       },
21789       enumerable: true,
21790       configurable: true
21791     });
21792     var FileReadStream = ReadStream;
21793     Object.defineProperty(fs2, "FileReadStream", {
21794       get: function() {
21795         return FileReadStream;
21796       },
21797       set: function(val) {
21798         FileReadStream = val;
21799       },
21800       enumerable: true,
21801       configurable: true
21802     });
21803     var FileWriteStream = WriteStream;
21804     Object.defineProperty(fs2, "FileWriteStream", {
21805       get: function() {
21806         return FileWriteStream;
21807       },
21808       set: function(val) {
21809         FileWriteStream = val;
21810       },
21811       enumerable: true,
21812       configurable: true
21813     });
21814     function ReadStream(path, options) {
21815       if (this instanceof ReadStream)
21816         return fs$ReadStream.apply(this, arguments), this;
21817       else
21818         return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
21819     }
21820     function ReadStream$open() {
21821       var that = this;
21822       open(that.path, that.flags, that.mode, function(err, fd) {
21823         if (err) {
21824           if (that.autoClose)
21825             that.destroy();
21826           that.emit("error", err);
21827         } else {
21828           that.fd = fd;
21829           that.emit("open", fd);
21830           that.read();
21831         }
21832       });
21833     }
21834     function WriteStream(path, options) {
21835       if (this instanceof WriteStream)
21836         return fs$WriteStream.apply(this, arguments), this;
21837       else
21838         return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
21839     }
21840     function WriteStream$open() {
21841       var that = this;
21842       open(that.path, that.flags, that.mode, function(err, fd) {
21843         if (err) {
21844           that.destroy();
21845           that.emit("error", err);
21846         } else {
21847           that.fd = fd;
21848           that.emit("open", fd);
21849         }
21850       });
21851     }
21852     function createReadStream(path, options) {
21853       return new fs2.ReadStream(path, options);
21854     }
21855     function createWriteStream(path, options) {
21856       return new fs2.WriteStream(path, options);
21857     }
21858     var fs$open = fs2.open;
21859     fs2.open = open;
21860     function open(path, flags, mode, cb) {
21861       if (typeof mode === "function")
21862         cb = mode, mode = null;
21863       return go$open(path, flags, mode, cb);
21864       function go$open(path2, flags2, mode2, cb2) {
21865         return fs$open(path2, flags2, mode2, function(err, fd) {
21866           if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
21867             enqueue([go$open, [path2, flags2, mode2, cb2]]);
21868           else {
21869             if (typeof cb2 === "function")
21870               cb2.apply(this, arguments);
21871             retry();
21872           }
21873         });
21874       }
21875     }
21876     return fs2;
21877   }
21878   function enqueue(elem) {
21879     debug("ENQUEUE", elem[0].name, elem[1]);
21880     fs[gracefulQueue].push(elem);
21881   }
21882   function retry() {
21883     var elem = fs[gracefulQueue].shift();
21884     if (elem) {
21885       debug("RETRY", elem[0].name, elem[1]);
21886       elem[0].apply(null, elem[1]);
21887     }
21888   }
21889 });
21890
21891 // node_modules/fstream/lib/get-type.js
21892 var require_get_type = __commonJS((exports2, module2) => {
21893   module2.exports = getType;
21894   function getType(st) {
21895     var types = [
21896       "Directory",
21897       "File",
21898       "SymbolicLink",
21899       "Link",
21900       "BlockDevice",
21901       "CharacterDevice",
21902       "FIFO",
21903       "Socket"
21904     ];
21905     var type;
21906     if (st.type && types.indexOf(st.type) !== -1) {
21907       st[st.type] = true;
21908       return st.type;
21909     }
21910     for (var i = 0, l = types.length; i < l; i++) {
21911       type = types[i];
21912       var is = st[type] || st["is" + type];
21913       if (typeof is === "function")
21914         is = is.call(st);
21915       if (is) {
21916         st[type] = true;
21917         st.type = type;
21918         return type;
21919       }
21920     }
21921     return null;
21922   }
21923 });
21924
21925 // node_modules/fstream/lib/link-reader.js
21926 var require_link_reader = __commonJS((exports2, module2) => {
21927   module2.exports = LinkReader;
21928   var fs = require_graceful_fs();
21929   var inherits2 = require_inherits();
21930   var Reader = require_reader();
21931   inherits2(LinkReader, Reader);
21932   function LinkReader(props) {
21933     var self2 = this;
21934     if (!(self2 instanceof LinkReader)) {
21935       throw new Error("LinkReader must be called as constructor.");
21936     }
21937     if (!(props.type === "Link" && props.Link || props.type === "SymbolicLink" && props.SymbolicLink)) {
21938       throw new Error("Non-link type " + props.type);
21939     }
21940     Reader.call(self2, props);
21941   }
21942   LinkReader.prototype._stat = function(currentStat) {
21943     var self2 = this;
21944     fs.readlink(self2._path, function(er, linkpath) {
21945       if (er)
21946         return self2.error(er);
21947       self2.linkpath = self2.props.linkpath = linkpath;
21948       self2.emit("linkpath", linkpath);
21949       Reader.prototype._stat.call(self2, currentStat);
21950     });
21951   };
21952   LinkReader.prototype._read = function() {
21953     var self2 = this;
21954     if (self2._paused)
21955       return;
21956     if (!self2._ended) {
21957       self2.emit("end");
21958       self2.emit("close");
21959       self2._ended = true;
21960     }
21961   };
21962 });
21963
21964 // node_modules/fstream/lib/dir-reader.js
21965 var require_dir_reader = __commonJS((exports2, module2) => {
21966   module2.exports = DirReader;
21967   var fs = require_graceful_fs();
21968   var inherits2 = require_inherits();
21969   var path = require("path");
21970   var Reader = require_reader();
21971   var assert = require("assert").ok;
21972   inherits2(DirReader, Reader);
21973   function DirReader(props) {
21974     var self2 = this;
21975     if (!(self2 instanceof DirReader)) {
21976       throw new Error("DirReader must be called as constructor.");
21977     }
21978     if (props.type !== "Directory" || !props.Directory) {
21979       throw new Error("Non-directory type " + props.type);
21980     }
21981     self2.entries = null;
21982     self2._index = -1;
21983     self2._paused = false;
21984     self2._length = -1;
21985     if (props.sort) {
21986       this.sort = props.sort;
21987     }
21988     Reader.call(this, props);
21989   }
21990   DirReader.prototype._getEntries = function() {
21991     var self2 = this;
21992     if (self2._gotEntries)
21993       return;
21994     self2._gotEntries = true;
21995     fs.readdir(self2._path, function(er, entries) {
21996       if (er)
21997         return self2.error(er);
21998       self2.entries = entries;
21999       self2.emit("entries", entries);
22000       if (self2._paused)
22001         self2.once("resume", processEntries);
22002       else
22003         processEntries();
22004       function processEntries() {
22005         self2._length = self2.entries.length;
22006         if (typeof self2.sort === "function") {
22007           self2.entries = self2.entries.sort(self2.sort.bind(self2));
22008         }
22009         self2._read();
22010       }
22011     });
22012   };
22013   DirReader.prototype._read = function() {
22014     var self2 = this;
22015     if (!self2.entries)
22016       return self2._getEntries();
22017     if (self2._paused || self2._currentEntry || self2._aborted) {
22018       return;
22019     }
22020     self2._index++;
22021     if (self2._index >= self2.entries.length) {
22022       if (!self2._ended) {
22023         self2._ended = true;
22024         self2.emit("end");
22025         self2.emit("close");
22026       }
22027       return;
22028     }
22029     var p = path.resolve(self2._path, self2.entries[self2._index]);
22030     assert(p !== self2._path);
22031     assert(self2.entries[self2._index]);
22032     self2._currentEntry = p;
22033     fs[self2.props.follow ? "stat" : "lstat"](p, function(er, stat) {
22034       if (er)
22035         return self2.error(er);
22036       var who = self2._proxy || self2;
22037       stat.path = p;
22038       stat.basename = path.basename(p);
22039       stat.dirname = path.dirname(p);
22040       var childProps = self2.getChildProps.call(who, stat);
22041       childProps.path = p;
22042       childProps.basename = path.basename(p);
22043       childProps.dirname = path.dirname(p);
22044       var entry = Reader(childProps, stat);
22045       self2._currentEntry = entry;
22046       entry.on("pause", function(who2) {
22047         if (!self2._paused && !entry._disowned) {
22048           self2.pause(who2);
22049         }
22050       });
22051       entry.on("resume", function(who2) {
22052         if (self2._paused && !entry._disowned) {
22053           self2.resume(who2);
22054         }
22055       });
22056       entry.on("stat", function(props) {
22057         self2.emit("_entryStat", entry, props);
22058         if (entry._aborted)
22059           return;
22060         if (entry._paused) {
22061           entry.once("resume", function() {
22062             self2.emit("entryStat", entry, props);
22063           });
22064         } else
22065           self2.emit("entryStat", entry, props);
22066       });
22067       entry.on("ready", function EMITCHILD() {
22068         if (self2._paused) {
22069           entry.pause(self2);
22070           return self2.once("resume", EMITCHILD);
22071         }
22072         if (entry.type === "Socket") {
22073           self2.emit("socket", entry);
22074         } else {
22075           self2.emitEntry(entry);
22076         }
22077       });
22078       var ended = false;
22079       entry.on("close", onend);
22080       entry.on("disown", onend);
22081       function onend() {
22082         if (ended)
22083           return;
22084         ended = true;
22085         self2.emit("childEnd", entry);
22086         self2.emit("entryEnd", entry);
22087         self2._currentEntry = null;
22088         if (!self2._paused) {
22089           self2._read();
22090         }
22091       }
22092       entry.on("error", function(er2) {
22093         if (entry._swallowErrors) {
22094           self2.warn(er2);
22095           entry.emit("end");
22096           entry.emit("close");
22097         } else {
22098           self2.emit("error", er2);
22099         }
22100       });
22101       [
22102         "child",
22103         "childEnd",
22104         "warn"
22105       ].forEach(function(ev) {
22106         entry.on(ev, self2.emit.bind(self2, ev));
22107       });
22108     });
22109   };
22110   DirReader.prototype.disown = function(entry) {
22111     entry.emit("beforeDisown");
22112     entry._disowned = true;
22113     entry.parent = entry.root = null;
22114     if (entry === this._currentEntry) {
22115       this._currentEntry = null;
22116     }
22117     entry.emit("disown");
22118   };
22119   DirReader.prototype.getChildProps = function() {
22120     return {
22121       depth: this.depth + 1,
22122       root: this.root || this,
22123       parent: this,
22124       follow: this.follow,
22125       filter: this.filter,
22126       sort: this.props.sort,
22127       hardlinks: this.props.hardlinks
22128     };
22129   };
22130   DirReader.prototype.pause = function(who) {
22131     var self2 = this;
22132     if (self2._paused)
22133       return;
22134     who = who || self2;
22135     self2._paused = true;
22136     if (self2._currentEntry && self2._currentEntry.pause) {
22137       self2._currentEntry.pause(who);
22138     }
22139     self2.emit("pause", who);
22140   };
22141   DirReader.prototype.resume = function(who) {
22142     var self2 = this;
22143     if (!self2._paused)
22144       return;
22145     who = who || self2;
22146     self2._paused = false;
22147     self2.emit("resume", who);
22148     if (self2._paused) {
22149       return;
22150     }
22151     if (self2._currentEntry) {
22152       if (self2._currentEntry.resume)
22153         self2._currentEntry.resume(who);
22154     } else
22155       self2._read();
22156   };
22157   DirReader.prototype.emitEntry = function(entry) {
22158     this.emit("entry", entry);
22159     this.emit("child", entry);
22160   };
22161 });
22162
22163 // node_modules/fstream/lib/file-reader.js
22164 var require_file_reader = __commonJS((exports2, module2) => {
22165   module2.exports = FileReader;
22166   var fs = require_graceful_fs();
22167   var inherits2 = require_inherits();
22168   var Reader = require_reader();
22169   var EOF = {EOF: true};
22170   var CLOSE = {CLOSE: true};
22171   inherits2(FileReader, Reader);
22172   function FileReader(props) {
22173     var self2 = this;
22174     if (!(self2 instanceof FileReader)) {
22175       throw new Error("FileReader must be called as constructor.");
22176     }
22177     if (!(props.type === "Link" && props.Link || props.type === "File" && props.File)) {
22178       throw new Error("Non-file type " + props.type);
22179     }
22180     self2._buffer = [];
22181     self2._bytesEmitted = 0;
22182     Reader.call(self2, props);
22183   }
22184   FileReader.prototype._getStream = function() {
22185     var self2 = this;
22186     var stream = self2._stream = fs.createReadStream(self2._path, self2.props);
22187     if (self2.props.blksize) {
22188       stream.bufferSize = self2.props.blksize;
22189     }
22190     stream.on("open", self2.emit.bind(self2, "open"));
22191     stream.on("data", function(c) {
22192       self2._bytesEmitted += c.length;
22193       if (!c.length) {
22194         return;
22195       } else if (self2._paused || self2._buffer.length) {
22196         self2._buffer.push(c);
22197         self2._read();
22198       } else
22199         self2.emit("data", c);
22200     });
22201     stream.on("end", function() {
22202       if (self2._paused || self2._buffer.length) {
22203         self2._buffer.push(EOF);
22204         self2._read();
22205       } else {
22206         self2.emit("end");
22207       }
22208       if (self2._bytesEmitted !== self2.props.size) {
22209         self2.error("Didn't get expected byte count\nexpect: " + self2.props.size + "\nactual: " + self2._bytesEmitted);
22210       }
22211     });
22212     stream.on("close", function() {
22213       if (self2._paused || self2._buffer.length) {
22214         self2._buffer.push(CLOSE);
22215         self2._read();
22216       } else {
22217         self2.emit("close");
22218       }
22219     });
22220     stream.on("error", function(e) {
22221       self2.emit("error", e);
22222     });
22223     self2._read();
22224   };
22225   FileReader.prototype._read = function() {
22226     var self2 = this;
22227     if (self2._paused) {
22228       return;
22229     }
22230     if (!self2._stream) {
22231       return self2._getStream();
22232     }
22233     if (self2._buffer.length) {
22234       var buf = self2._buffer;
22235       for (var i = 0, l = buf.length; i < l; i++) {
22236         var c = buf[i];
22237         if (c === EOF) {
22238           self2.emit("end");
22239         } else if (c === CLOSE) {
22240           self2.emit("close");
22241         } else {
22242           self2.emit("data", c);
22243         }
22244         if (self2._paused) {
22245           self2._buffer = buf.slice(i);
22246           return;
22247         }
22248       }
22249       self2._buffer.length = 0;
22250     }
22251   };
22252   FileReader.prototype.pause = function(who) {
22253     var self2 = this;
22254     if (self2._paused)
22255       return;
22256     who = who || self2;
22257     self2._paused = true;
22258     if (self2._stream)
22259       self2._stream.pause();
22260     self2.emit("pause", who);
22261   };
22262   FileReader.prototype.resume = function(who) {
22263     var self2 = this;
22264     if (!self2._paused)
22265       return;
22266     who = who || self2;
22267     self2.emit("resume", who);
22268     self2._paused = false;
22269     if (self2._stream)
22270       self2._stream.resume();
22271     self2._read();
22272   };
22273 });
22274
22275 // node_modules/fstream/lib/socket-reader.js
22276 var require_socket_reader = __commonJS((exports2, module2) => {
22277   module2.exports = SocketReader;
22278   var inherits2 = require_inherits();
22279   var Reader = require_reader();
22280   inherits2(SocketReader, Reader);
22281   function SocketReader(props) {
22282     var self2 = this;
22283     if (!(self2 instanceof SocketReader)) {
22284       throw new Error("SocketReader must be called as constructor.");
22285     }
22286     if (!(props.type === "Socket" && props.Socket)) {
22287       throw new Error("Non-socket type " + props.type);
22288     }
22289     Reader.call(self2, props);
22290   }
22291   SocketReader.prototype._read = function() {
22292     var self2 = this;
22293     if (self2._paused)
22294       return;
22295     if (!self2._ended) {
22296       self2.emit("end");
22297       self2.emit("close");
22298       self2._ended = true;
22299     }
22300   };
22301 });
22302
22303 // node_modules/fstream/lib/proxy-reader.js
22304 var require_proxy_reader = __commonJS((exports2, module2) => {
22305   module2.exports = ProxyReader;
22306   var Reader = require_reader();
22307   var getType = require_get_type();
22308   var inherits2 = require_inherits();
22309   var fs = require_graceful_fs();
22310   inherits2(ProxyReader, Reader);
22311   function ProxyReader(props) {
22312     var self2 = this;
22313     if (!(self2 instanceof ProxyReader)) {
22314       throw new Error("ProxyReader must be called as constructor.");
22315     }
22316     self2.props = props;
22317     self2._buffer = [];
22318     self2.ready = false;
22319     Reader.call(self2, props);
22320   }
22321   ProxyReader.prototype._stat = function() {
22322     var self2 = this;
22323     var props = self2.props;
22324     var stat = props.follow ? "stat" : "lstat";
22325     fs[stat](props.path, function(er, current) {
22326       var type;
22327       if (er || !current) {
22328         type = "File";
22329       } else {
22330         type = getType(current);
22331       }
22332       props[type] = true;
22333       props.type = self2.type = type;
22334       self2._old = current;
22335       self2._addProxy(Reader(props, current));
22336     });
22337   };
22338   ProxyReader.prototype._addProxy = function(proxy) {
22339     var self2 = this;
22340     if (self2._proxyTarget) {
22341       return self2.error("proxy already set");
22342     }
22343     self2._proxyTarget = proxy;
22344     proxy._proxy = self2;
22345     [
22346       "error",
22347       "data",
22348       "end",
22349       "close",
22350       "linkpath",
22351       "entry",
22352       "entryEnd",
22353       "child",
22354       "childEnd",
22355       "warn",
22356       "stat"
22357     ].forEach(function(ev) {
22358       proxy.on(ev, self2.emit.bind(self2, ev));
22359     });
22360     self2.emit("proxy", proxy);
22361     proxy.on("ready", function() {
22362       self2.ready = true;
22363       self2.emit("ready");
22364     });
22365     var calls = self2._buffer;
22366     self2._buffer.length = 0;
22367     calls.forEach(function(c) {
22368       proxy[c[0]].apply(proxy, c[1]);
22369     });
22370   };
22371   ProxyReader.prototype.pause = function() {
22372     return this._proxyTarget ? this._proxyTarget.pause() : false;
22373   };
22374   ProxyReader.prototype.resume = function() {
22375     return this._proxyTarget ? this._proxyTarget.resume() : false;
22376   };
22377 });
22378
22379 // node_modules/fstream/lib/reader.js
22380 var require_reader = __commonJS((exports2, module2) => {
22381   module2.exports = Reader;
22382   var fs = require_graceful_fs();
22383   var Stream = require("stream").Stream;
22384   var inherits2 = require_inherits();
22385   var path = require("path");
22386   var getType = require_get_type();
22387   var hardLinks = Reader.hardLinks = {};
22388   var Abstract = require_abstract();
22389   inherits2(Reader, Abstract);
22390   var LinkReader = require_link_reader();
22391   function Reader(props, currentStat) {
22392     var self2 = this;
22393     if (!(self2 instanceof Reader))
22394       return new Reader(props, currentStat);
22395     if (typeof props === "string") {
22396       props = {path: props};
22397     }
22398     var type;
22399     var ClassType;
22400     if (props.type && typeof props.type === "function") {
22401       type = props.type;
22402       ClassType = type;
22403     } else {
22404       type = getType(props);
22405       ClassType = Reader;
22406     }
22407     if (currentStat && !type) {
22408       type = getType(currentStat);
22409       props[type] = true;
22410       props.type = type;
22411     }
22412     switch (type) {
22413       case "Directory":
22414         ClassType = require_dir_reader();
22415         break;
22416       case "Link":
22417       case "File":
22418         ClassType = require_file_reader();
22419         break;
22420       case "SymbolicLink":
22421         ClassType = LinkReader;
22422         break;
22423       case "Socket":
22424         ClassType = require_socket_reader();
22425         break;
22426       case null:
22427         ClassType = require_proxy_reader();
22428         break;
22429     }
22430     if (!(self2 instanceof ClassType)) {
22431       return new ClassType(props);
22432     }
22433     Abstract.call(self2);
22434     if (!props.path) {
22435       self2.error("Must provide a path", null, true);
22436     }
22437     self2.readable = true;
22438     self2.writable = false;
22439     self2.type = type;
22440     self2.props = props;
22441     self2.depth = props.depth = props.depth || 0;
22442     self2.parent = props.parent || null;
22443     self2.root = props.root || props.parent && props.parent.root || self2;
22444     self2._path = self2.path = path.resolve(props.path);
22445     if (process.platform === "win32") {
22446       self2.path = self2._path = self2.path.replace(/\?/g, "_");
22447       if (self2._path.length >= 260) {
22448         self2._swallowErrors = true;
22449         self2._path = "\\\\?\\" + self2.path.replace(/\//g, "\\");
22450       }
22451     }
22452     self2.basename = props.basename = path.basename(self2.path);
22453     self2.dirname = props.dirname = path.dirname(self2.path);
22454     props.parent = props.root = null;
22455     self2.size = props.size;
22456     self2.filter = typeof props.filter === "function" ? props.filter : null;
22457     if (props.sort === "alpha")
22458       props.sort = alphasort;
22459     self2._stat(currentStat);
22460   }
22461   function alphasort(a, b) {
22462     return a === b ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : a.toLowerCase() < b.toLowerCase() ? -1 : a > b ? 1 : -1;
22463   }
22464   Reader.prototype._stat = function(currentStat) {
22465     var self2 = this;
22466     var props = self2.props;
22467     var stat = props.follow ? "stat" : "lstat";
22468     if (currentStat)
22469       process.nextTick(statCb.bind(null, null, currentStat));
22470     else
22471       fs[stat](self2._path, statCb);
22472     function statCb(er, props_) {
22473       if (er)
22474         return self2.error(er);
22475       Object.keys(props_).forEach(function(k2) {
22476         props[k2] = props_[k2];
22477       });
22478       if (self2.size !== void 0 && props.size !== self2.size) {
22479         return self2.error("incorrect size");
22480       }
22481       self2.size = props.size;
22482       var type = getType(props);
22483       var handleHardlinks = props.hardlinks !== false;
22484       if (handleHardlinks && type !== "Directory" && props.nlink && props.nlink > 1) {
22485         var k = props.dev + ":" + props.ino;
22486         if (hardLinks[k] === self2._path || !hardLinks[k]) {
22487           hardLinks[k] = self2._path;
22488         } else {
22489           type = self2.type = self2.props.type = "Link";
22490           self2.Link = self2.props.Link = true;
22491           self2.linkpath = self2.props.linkpath = hardLinks[k];
22492           self2._stat = self2._read = LinkReader.prototype._read;
22493         }
22494       }
22495       if (self2.type && self2.type !== type) {
22496         self2.error("Unexpected type: " + type);
22497       }
22498       if (self2.filter) {
22499         var who = self2._proxy || self2;
22500         if (!self2.filter.call(who, who, props)) {
22501           if (!self2._disowned) {
22502             self2.abort();
22503             self2.emit("end");
22504             self2.emit("close");
22505           }
22506           return;
22507         }
22508       }
22509       var events = ["_stat", "stat", "ready"];
22510       var e = 0;
22511       (function go() {
22512         if (self2._aborted) {
22513           self2.emit("end");
22514           self2.emit("close");
22515           return;
22516         }
22517         if (self2._paused && self2.type !== "Directory") {
22518           self2.once("resume", go);
22519           return;
22520         }
22521         var ev = events[e++];
22522         if (!ev) {
22523           return self2._read();
22524         }
22525         self2.emit(ev, props);
22526         go();
22527       })();
22528     }
22529   };
22530   Reader.prototype.pipe = function(dest) {
22531     var self2 = this;
22532     if (typeof dest.add === "function") {
22533       self2.on("entry", function(entry) {
22534         var ret2 = dest.add(entry);
22535         if (ret2 === false) {
22536           self2.pause();
22537         }
22538       });
22539     }
22540     return Stream.prototype.pipe.apply(this, arguments);
22541   };
22542   Reader.prototype.pause = function(who) {
22543     this._paused = true;
22544     who = who || this;
22545     this.emit("pause", who);
22546     if (this._stream)
22547       this._stream.pause(who);
22548   };
22549   Reader.prototype.resume = function(who) {
22550     this._paused = false;
22551     who = who || this;
22552     this.emit("resume", who);
22553     if (this._stream)
22554       this._stream.resume(who);
22555     this._read();
22556   };
22557   Reader.prototype._read = function() {
22558     this.error("Cannot read unknown type: " + this.type);
22559   };
22560 });
22561
22562 // node_modules/fstream/node_modules/rimraf/rimraf.js
22563 var require_rimraf2 = __commonJS((exports2, module2) => {
22564   module2.exports = rimraf;
22565   rimraf.sync = rimrafSync;
22566   var assert = require("assert");
22567   var path = require("path");
22568   var fs = require("fs");
22569   var glob = void 0;
22570   try {
22571     glob = require_glob();
22572   } catch (_err) {
22573   }
22574   var _0666 = parseInt("666", 8);
22575   var defaultGlobOpts = {
22576     nosort: true,
22577     silent: true
22578   };
22579   var timeout = 0;
22580   var isWindows = process.platform === "win32";
22581   function defaults(options) {
22582     var methods = [
22583       "unlink",
22584       "chmod",
22585       "stat",
22586       "lstat",
22587       "rmdir",
22588       "readdir"
22589     ];
22590     methods.forEach(function(m) {
22591       options[m] = options[m] || fs[m];
22592       m = m + "Sync";
22593       options[m] = options[m] || fs[m];
22594     });
22595     options.maxBusyTries = options.maxBusyTries || 3;
22596     options.emfileWait = options.emfileWait || 1e3;
22597     if (options.glob === false) {
22598       options.disableGlob = true;
22599     }
22600     if (options.disableGlob !== true && glob === void 0) {
22601       throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");
22602     }
22603     options.disableGlob = options.disableGlob || false;
22604     options.glob = options.glob || defaultGlobOpts;
22605   }
22606   function rimraf(p, options, cb) {
22607     if (typeof options === "function") {
22608       cb = options;
22609       options = {};
22610     }
22611     assert(p, "rimraf: missing path");
22612     assert.equal(typeof p, "string", "rimraf: path should be a string");
22613     assert.equal(typeof cb, "function", "rimraf: callback function required");
22614     assert(options, "rimraf: invalid options argument provided");
22615     assert.equal(typeof options, "object", "rimraf: options should be object");
22616     defaults(options);
22617     var busyTries = 0;
22618     var errState = null;
22619     var n = 0;
22620     if (options.disableGlob || !glob.hasMagic(p))
22621       return afterGlob(null, [p]);
22622     options.lstat(p, function(er, stat) {
22623       if (!er)
22624         return afterGlob(null, [p]);
22625       glob(p, options.glob, afterGlob);
22626     });
22627     function next(er) {
22628       errState = errState || er;
22629       if (--n === 0)
22630         cb(errState);
22631     }
22632     function afterGlob(er, results) {
22633       if (er)
22634         return cb(er);
22635       n = results.length;
22636       if (n === 0)
22637         return cb();
22638       results.forEach(function(p2) {
22639         rimraf_(p2, options, function CB(er2) {
22640           if (er2) {
22641             if ((er2.code === "EBUSY" || er2.code === "ENOTEMPTY" || er2.code === "EPERM") && busyTries < options.maxBusyTries) {
22642               busyTries++;
22643               var time = busyTries * 100;
22644               return setTimeout(function() {
22645                 rimraf_(p2, options, CB);
22646               }, time);
22647             }
22648             if (er2.code === "EMFILE" && timeout < options.emfileWait) {
22649               return setTimeout(function() {
22650                 rimraf_(p2, options, CB);
22651               }, timeout++);
22652             }
22653             if (er2.code === "ENOENT")
22654               er2 = null;
22655           }
22656           timeout = 0;
22657           next(er2);
22658         });
22659       });
22660     }
22661   }
22662   function rimraf_(p, options, cb) {
22663     assert(p);
22664     assert(options);
22665     assert(typeof cb === "function");
22666     options.lstat(p, function(er, st) {
22667       if (er && er.code === "ENOENT")
22668         return cb(null);
22669       if (er && er.code === "EPERM" && isWindows)
22670         fixWinEPERM(p, options, er, cb);
22671       if (st && st.isDirectory())
22672         return rmdir(p, options, er, cb);
22673       options.unlink(p, function(er2) {
22674         if (er2) {
22675           if (er2.code === "ENOENT")
22676             return cb(null);
22677           if (er2.code === "EPERM")
22678             return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
22679           if (er2.code === "EISDIR")
22680             return rmdir(p, options, er2, cb);
22681         }
22682         return cb(er2);
22683       });
22684     });
22685   }
22686   function fixWinEPERM(p, options, er, cb) {
22687     assert(p);
22688     assert(options);
22689     assert(typeof cb === "function");
22690     if (er)
22691       assert(er instanceof Error);
22692     options.chmod(p, _0666, function(er2) {
22693       if (er2)
22694         cb(er2.code === "ENOENT" ? null : er);
22695       else
22696         options.stat(p, function(er3, stats) {
22697           if (er3)
22698             cb(er3.code === "ENOENT" ? null : er);
22699           else if (stats.isDirectory())
22700             rmdir(p, options, er, cb);
22701           else
22702             options.unlink(p, cb);
22703         });
22704     });
22705   }
22706   function fixWinEPERMSync(p, options, er) {
22707     assert(p);
22708     assert(options);
22709     if (er)
22710       assert(er instanceof Error);
22711     try {
22712       options.chmodSync(p, _0666);
22713     } catch (er2) {
22714       if (er2.code === "ENOENT")
22715         return;
22716       else
22717         throw er;
22718     }
22719     try {
22720       var stats = options.statSync(p);
22721     } catch (er3) {
22722       if (er3.code === "ENOENT")
22723         return;
22724       else
22725         throw er;
22726     }
22727     if (stats.isDirectory())
22728       rmdirSync(p, options, er);
22729     else
22730       options.unlinkSync(p);
22731   }
22732   function rmdir(p, options, originalEr, cb) {
22733     assert(p);
22734     assert(options);
22735     if (originalEr)
22736       assert(originalEr instanceof Error);
22737     assert(typeof cb === "function");
22738     options.rmdir(p, function(er) {
22739       if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
22740         rmkids(p, options, cb);
22741       else if (er && er.code === "ENOTDIR")
22742         cb(originalEr);
22743       else
22744         cb(er);
22745     });
22746   }
22747   function rmkids(p, options, cb) {
22748     assert(p);
22749     assert(options);
22750     assert(typeof cb === "function");
22751     options.readdir(p, function(er, files) {
22752       if (er)
22753         return cb(er);
22754       var n = files.length;
22755       if (n === 0)
22756         return options.rmdir(p, cb);
22757       var errState;
22758       files.forEach(function(f) {
22759         rimraf(path.join(p, f), options, function(er2) {
22760           if (errState)
22761             return;
22762           if (er2)
22763             return cb(errState = er2);
22764           if (--n === 0)
22765             options.rmdir(p, cb);
22766         });
22767       });
22768     });
22769   }
22770   function rimrafSync(p, options) {
22771     options = options || {};
22772     defaults(options);
22773     assert(p, "rimraf: missing path");
22774     assert.equal(typeof p, "string", "rimraf: path should be a string");
22775     assert(options, "rimraf: missing options");
22776     assert.equal(typeof options, "object", "rimraf: options should be object");
22777     var results;
22778     if (options.disableGlob || !glob.hasMagic(p)) {
22779       results = [p];
22780     } else {
22781       try {
22782         options.lstatSync(p);
22783         results = [p];
22784       } catch (er) {
22785         results = glob.sync(p, options.glob);
22786       }
22787     }
22788     if (!results.length)
22789       return;
22790     for (var i = 0; i < results.length; i++) {
22791       var p = results[i];
22792       try {
22793         var st = options.lstatSync(p);
22794       } catch (er) {
22795         if (er.code === "ENOENT")
22796           return;
22797         if (er.code === "EPERM" && isWindows)
22798           fixWinEPERMSync(p, options, er);
22799       }
22800       try {
22801         if (st && st.isDirectory())
22802           rmdirSync(p, options, null);
22803         else
22804           options.unlinkSync(p);
22805       } catch (er) {
22806         if (er.code === "ENOENT")
22807           return;
22808         if (er.code === "EPERM")
22809           return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er);
22810         if (er.code !== "EISDIR")
22811           throw er;
22812         rmdirSync(p, options, er);
22813       }
22814     }
22815   }
22816   function rmdirSync(p, options, originalEr) {
22817     assert(p);
22818     assert(options);
22819     if (originalEr)
22820       assert(originalEr instanceof Error);
22821     try {
22822       options.rmdirSync(p);
22823     } catch (er) {
22824       if (er.code === "ENOENT")
22825         return;
22826       if (er.code === "ENOTDIR")
22827         throw originalEr;
22828       if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
22829         rmkidsSync(p, options);
22830     }
22831   }
22832   function rmkidsSync(p, options) {
22833     assert(p);
22834     assert(options);
22835     options.readdirSync(p).forEach(function(f) {
22836       rimrafSync(path.join(p, f), options);
22837     });
22838     var retries = isWindows ? 100 : 1;
22839     var i = 0;
22840     do {
22841       var threw = true;
22842       try {
22843         var ret2 = options.rmdirSync(p, options);
22844         threw = false;
22845         return ret2;
22846       } finally {
22847         if (++i < retries && threw)
22848           continue;
22849       }
22850     } while (true);
22851   }
22852 });
22853
22854 // node_modules/mkdirp/index.js
22855 var require_mkdirp = __commonJS((exports2, module2) => {
22856   var path = require("path");
22857   var fs = require("fs");
22858   var _0777 = parseInt("0777", 8);
22859   module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
22860   function mkdirP(p, opts, f, made) {
22861     if (typeof opts === "function") {
22862       f = opts;
22863       opts = {};
22864     } else if (!opts || typeof opts !== "object") {
22865       opts = {mode: opts};
22866     }
22867     var mode = opts.mode;
22868     var xfs = opts.fs || fs;
22869     if (mode === void 0) {
22870       mode = _0777;
22871     }
22872     if (!made)
22873       made = null;
22874     var cb = f || function() {
22875     };
22876     p = path.resolve(p);
22877     xfs.mkdir(p, mode, function(er) {
22878       if (!er) {
22879         made = made || p;
22880         return cb(null, made);
22881       }
22882       switch (er.code) {
22883         case "ENOENT":
22884           if (path.dirname(p) === p)
22885             return cb(er);
22886           mkdirP(path.dirname(p), opts, function(er2, made2) {
22887             if (er2)
22888               cb(er2, made2);
22889             else
22890               mkdirP(p, opts, cb, made2);
22891           });
22892           break;
22893         default:
22894           xfs.stat(p, function(er2, stat) {
22895             if (er2 || !stat.isDirectory())
22896               cb(er, made);
22897             else
22898               cb(null, made);
22899           });
22900           break;
22901       }
22902     });
22903   }
22904   mkdirP.sync = function sync(p, opts, made) {
22905     if (!opts || typeof opts !== "object") {
22906       opts = {mode: opts};
22907     }
22908     var mode = opts.mode;
22909     var xfs = opts.fs || fs;
22910     if (mode === void 0) {
22911       mode = _0777;
22912     }
22913     if (!made)
22914       made = null;
22915     p = path.resolve(p);
22916     try {
22917       xfs.mkdirSync(p, mode);
22918       made = made || p;
22919     } catch (err0) {
22920       switch (err0.code) {
22921         case "ENOENT":
22922           made = sync(path.dirname(p), opts, made);
22923           sync(p, opts, made);
22924           break;
22925         default:
22926           var stat;
22927           try {
22928             stat = xfs.statSync(p);
22929           } catch (err1) {
22930             throw err0;
22931           }
22932           if (!stat.isDirectory())
22933             throw err0;
22934           break;
22935       }
22936     }
22937     return made;
22938   };
22939 });
22940
22941 // node_modules/fstream/lib/collect.js
22942 var require_collect = __commonJS((exports2, module2) => {
22943   module2.exports = collect;
22944   function collect(stream) {
22945     if (stream._collected)
22946       return;
22947     if (stream._paused)
22948       return stream.on("resume", collect.bind(null, stream));
22949     stream._collected = true;
22950     stream.pause();
22951     stream.on("data", save);
22952     stream.on("end", save);
22953     var buf = [];
22954     function save(b) {
22955       if (typeof b === "string")
22956         b = new Buffer(b);
22957       if (Buffer.isBuffer(b) && !b.length)
22958         return;
22959       buf.push(b);
22960     }
22961     stream.on("entry", saveEntry);
22962     var entryBuffer = [];
22963     function saveEntry(e) {
22964       collect(e);
22965       entryBuffer.push(e);
22966     }
22967     stream.on("proxy", proxyPause);
22968     function proxyPause(p) {
22969       p.pause();
22970     }
22971     stream.pipe = function(orig) {
22972       return function(dest) {
22973         var e = 0;
22974         (function unblockEntry() {
22975           var entry = entryBuffer[e++];
22976           if (!entry)
22977             return resume();
22978           entry.on("end", unblockEntry);
22979           if (dest)
22980             dest.add(entry);
22981           else
22982             stream.emit("entry", entry);
22983         })();
22984         function resume() {
22985           stream.removeListener("entry", saveEntry);
22986           stream.removeListener("data", save);
22987           stream.removeListener("end", save);
22988           stream.pipe = orig;
22989           if (dest)
22990             stream.pipe(dest);
22991           buf.forEach(function(b) {
22992             if (b)
22993               stream.emit("data", b);
22994             else
22995               stream.emit("end");
22996           });
22997           stream.resume();
22998         }
22999         return dest;
23000       };
23001     }(stream.pipe);
23002   }
23003 });
23004
23005 // node_modules/fstream/lib/dir-writer.js
23006 var require_dir_writer = __commonJS((exports2, module2) => {
23007   module2.exports = DirWriter;
23008   var Writer = require_writer();
23009   var inherits2 = require_inherits();
23010   var mkdir = require_mkdirp();
23011   var path = require("path");
23012   var collect = require_collect();
23013   inherits2(DirWriter, Writer);
23014   function DirWriter(props) {
23015     var self2 = this;
23016     if (!(self2 instanceof DirWriter)) {
23017       self2.error("DirWriter must be called as constructor.", null, true);
23018     }
23019     if (props.type !== "Directory" || !props.Directory) {
23020       self2.error("Non-directory type " + props.type + " " + JSON.stringify(props), null, true);
23021     }
23022     Writer.call(this, props);
23023   }
23024   DirWriter.prototype._create = function() {
23025     var self2 = this;
23026     mkdir(self2._path, Writer.dirmode, function(er) {
23027       if (er)
23028         return self2.error(er);
23029       self2.ready = true;
23030       self2.emit("ready");
23031       self2._process();
23032     });
23033   };
23034   DirWriter.prototype.write = function() {
23035     return true;
23036   };
23037   DirWriter.prototype.end = function() {
23038     this._ended = true;
23039     this._process();
23040   };
23041   DirWriter.prototype.add = function(entry) {
23042     var self2 = this;
23043     collect(entry);
23044     if (!self2.ready || self2._currentEntry) {
23045       self2._buffer.push(entry);
23046       return false;
23047     }
23048     if (self2._ended) {
23049       return self2.error("add after end");
23050     }
23051     self2._buffer.push(entry);
23052     self2._process();
23053     return this._buffer.length === 0;
23054   };
23055   DirWriter.prototype._process = function() {
23056     var self2 = this;
23057     if (self2._processing)
23058       return;
23059     var entry = self2._buffer.shift();
23060     if (!entry) {
23061       self2.emit("drain");
23062       if (self2._ended)
23063         self2._finish();
23064       return;
23065     }
23066     self2._processing = true;
23067     self2.emit("entry", entry);
23068     var p = entry;
23069     var pp;
23070     do {
23071       pp = p._path || p.path;
23072       if (pp === self2.root._path || pp === self2._path || pp && pp.indexOf(self2._path) === 0) {
23073         self2._processing = false;
23074         if (entry._collected)
23075           entry.pipe();
23076         return self2._process();
23077       }
23078       p = p.parent;
23079     } while (p);
23080     var props = {
23081       parent: self2,
23082       root: self2.root || self2,
23083       type: entry.type,
23084       depth: self2.depth + 1
23085     };
23086     pp = entry._path || entry.path || entry.props.path;
23087     if (entry.parent) {
23088       pp = pp.substr(entry.parent._path.length + 1);
23089     }
23090     props.path = path.join(self2.path, path.join("/", pp));
23091     props.filter = self2.filter;
23092     Object.keys(entry.props).forEach(function(k) {
23093       if (!props.hasOwnProperty(k)) {
23094         props[k] = entry.props[k];
23095       }
23096     });
23097     var child = self2._currentChild = new Writer(props);
23098     child.on("ready", function() {
23099       entry.pipe(child);
23100       entry.resume();
23101     });
23102     child.on("error", function(er) {
23103       if (child._swallowErrors) {
23104         self2.warn(er);
23105         child.emit("end");
23106         child.emit("close");
23107       } else {
23108         self2.emit("error", er);
23109       }
23110     });
23111     child.on("close", onend);
23112     var ended = false;
23113     function onend() {
23114       if (ended)
23115         return;
23116       ended = true;
23117       self2._currentChild = null;
23118       self2._processing = false;
23119       self2._process();
23120     }
23121   };
23122 });
23123
23124 // node_modules/fstream/lib/link-writer.js
23125 var require_link_writer = __commonJS((exports2, module2) => {
23126   module2.exports = LinkWriter;
23127   var fs = require_graceful_fs();
23128   var Writer = require_writer();
23129   var inherits2 = require_inherits();
23130   var path = require("path");
23131   var rimraf = require_rimraf2();
23132   inherits2(LinkWriter, Writer);
23133   function LinkWriter(props) {
23134     var self2 = this;
23135     if (!(self2 instanceof LinkWriter)) {
23136       throw new Error("LinkWriter must be called as constructor.");
23137     }
23138     if (!(props.type === "Link" && props.Link || props.type === "SymbolicLink" && props.SymbolicLink)) {
23139       throw new Error("Non-link type " + props.type);
23140     }
23141     if (props.linkpath === "")
23142       props.linkpath = ".";
23143     if (!props.linkpath) {
23144       self2.error("Need linkpath property to create " + props.type);
23145     }
23146     Writer.call(this, props);
23147   }
23148   LinkWriter.prototype._create = function() {
23149     var self2 = this;
23150     var hard = self2.type === "Link" || process.platform === "win32";
23151     var link = hard ? "link" : "symlink";
23152     var lp = hard ? path.resolve(self2.dirname, self2.linkpath) : self2.linkpath;
23153     if (hard)
23154       return clobber(self2, lp, link);
23155     fs.readlink(self2._path, function(er, p) {
23156       if (p && p === lp)
23157         return finish(self2);
23158       clobber(self2, lp, link);
23159     });
23160   };
23161   function clobber(self2, lp, link) {
23162     rimraf(self2._path, function(er) {
23163       if (er)
23164         return self2.error(er);
23165       create(self2, lp, link);
23166     });
23167   }
23168   function create(self2, lp, link) {
23169     fs[link](lp, self2._path, function(er) {
23170       if (er) {
23171         if ((er.code === "ENOENT" || er.code === "EACCES" || er.code === "EPERM") && process.platform === "win32") {
23172           self2.ready = true;
23173           self2.emit("ready");
23174           self2.emit("end");
23175           self2.emit("close");
23176           self2.end = self2._finish = function() {
23177           };
23178         } else
23179           return self2.error(er);
23180       }
23181       finish(self2);
23182     });
23183   }
23184   function finish(self2) {
23185     self2.ready = true;
23186     self2.emit("ready");
23187     if (self2._ended && !self2._finished)
23188       self2._finish();
23189   }
23190   LinkWriter.prototype.end = function() {
23191     this._ended = true;
23192     if (this.ready) {
23193       this._finished = true;
23194       this._finish();
23195     }
23196   };
23197 });
23198
23199 // node_modules/fstream/lib/file-writer.js
23200 var require_file_writer = __commonJS((exports2, module2) => {
23201   module2.exports = FileWriter;
23202   var fs = require_graceful_fs();
23203   var Writer = require_writer();
23204   var inherits2 = require_inherits();
23205   var EOF = {};
23206   inherits2(FileWriter, Writer);
23207   function FileWriter(props) {
23208     var self2 = this;
23209     if (!(self2 instanceof FileWriter)) {
23210       throw new Error("FileWriter must be called as constructor.");
23211     }
23212     if (props.type !== "File" || !props.File) {
23213       throw new Error("Non-file type " + props.type);
23214     }
23215     self2._buffer = [];
23216     self2._bytesWritten = 0;
23217     Writer.call(this, props);
23218   }
23219   FileWriter.prototype._create = function() {
23220     var self2 = this;
23221     if (self2._stream)
23222       return;
23223     var so = {};
23224     if (self2.props.flags)
23225       so.flags = self2.props.flags;
23226     so.mode = Writer.filemode;
23227     if (self2._old && self2._old.blksize)
23228       so.bufferSize = self2._old.blksize;
23229     self2._stream = fs.createWriteStream(self2._path, so);
23230     self2._stream.on("open", function() {
23231       self2.ready = true;
23232       self2._buffer.forEach(function(c) {
23233         if (c === EOF)
23234           self2._stream.end();
23235         else
23236           self2._stream.write(c);
23237       });
23238       self2.emit("ready");
23239       self2.emit("drain");
23240     });
23241     self2._stream.on("error", function(er) {
23242       self2.emit("error", er);
23243     });
23244     self2._stream.on("drain", function() {
23245       self2.emit("drain");
23246     });
23247     self2._stream.on("close", function() {
23248       self2._finish();
23249     });
23250   };
23251   FileWriter.prototype.write = function(c) {
23252     var self2 = this;
23253     self2._bytesWritten += c.length;
23254     if (!self2.ready) {
23255       if (!Buffer.isBuffer(c) && typeof c !== "string") {
23256         throw new Error("invalid write data");
23257       }
23258       self2._buffer.push(c);
23259       return false;
23260     }
23261     var ret2 = self2._stream.write(c);
23262     if (ret2 === false && self2._stream._queue) {
23263       return self2._stream._queue.length <= 2;
23264     } else {
23265       return ret2;
23266     }
23267   };
23268   FileWriter.prototype.end = function(c) {
23269     var self2 = this;
23270     if (c)
23271       self2.write(c);
23272     if (!self2.ready) {
23273       self2._buffer.push(EOF);
23274       return false;
23275     }
23276     return self2._stream.end();
23277   };
23278   FileWriter.prototype._finish = function() {
23279     var self2 = this;
23280     if (typeof self2.size === "number" && self2._bytesWritten !== self2.size) {
23281       self2.error("Did not get expected byte count.\nexpect: " + self2.size + "\nactual: " + self2._bytesWritten);
23282     }
23283     Writer.prototype._finish.call(self2);
23284   };
23285 });
23286
23287 // node_modules/fstream/lib/proxy-writer.js
23288 var require_proxy_writer = __commonJS((exports2, module2) => {
23289   module2.exports = ProxyWriter;
23290   var Writer = require_writer();
23291   var getType = require_get_type();
23292   var inherits2 = require_inherits();
23293   var collect = require_collect();
23294   var fs = require("fs");
23295   inherits2(ProxyWriter, Writer);
23296   function ProxyWriter(props) {
23297     var self2 = this;
23298     if (!(self2 instanceof ProxyWriter)) {
23299       throw new Error("ProxyWriter must be called as constructor.");
23300     }
23301     self2.props = props;
23302     self2._needDrain = false;
23303     Writer.call(self2, props);
23304   }
23305   ProxyWriter.prototype._stat = function() {
23306     var self2 = this;
23307     var props = self2.props;
23308     var stat = props.follow ? "stat" : "lstat";
23309     fs[stat](props.path, function(er, current) {
23310       var type;
23311       if (er || !current) {
23312         type = "File";
23313       } else {
23314         type = getType(current);
23315       }
23316       props[type] = true;
23317       props.type = self2.type = type;
23318       self2._old = current;
23319       self2._addProxy(Writer(props, current));
23320     });
23321   };
23322   ProxyWriter.prototype._addProxy = function(proxy) {
23323     var self2 = this;
23324     if (self2._proxy) {
23325       return self2.error("proxy already set");
23326     }
23327     self2._proxy = proxy;
23328     [
23329       "ready",
23330       "error",
23331       "close",
23332       "pipe",
23333       "drain",
23334       "warn"
23335     ].forEach(function(ev) {
23336       proxy.on(ev, self2.emit.bind(self2, ev));
23337     });
23338     self2.emit("proxy", proxy);
23339     var calls = self2._buffer;
23340     calls.forEach(function(c) {
23341       proxy[c[0]].apply(proxy, c[1]);
23342     });
23343     self2._buffer.length = 0;
23344     if (self2._needsDrain)
23345       self2.emit("drain");
23346   };
23347   ProxyWriter.prototype.add = function(entry) {
23348     collect(entry);
23349     if (!this._proxy) {
23350       this._buffer.push(["add", [entry]]);
23351       this._needDrain = true;
23352       return false;
23353     }
23354     return this._proxy.add(entry);
23355   };
23356   ProxyWriter.prototype.write = function(c) {
23357     if (!this._proxy) {
23358       this._buffer.push(["write", [c]]);
23359       this._needDrain = true;
23360       return false;
23361     }
23362     return this._proxy.write(c);
23363   };
23364   ProxyWriter.prototype.end = function(c) {
23365     if (!this._proxy) {
23366       this._buffer.push(["end", [c]]);
23367       return false;
23368     }
23369     return this._proxy.end(c);
23370   };
23371 });
23372
23373 // node_modules/fstream/lib/writer.js
23374 var require_writer = __commonJS((exports2, module2) => {
23375   module2.exports = Writer;
23376   var fs = require_graceful_fs();
23377   var inherits2 = require_inherits();
23378   var rimraf = require_rimraf2();
23379   var mkdir = require_mkdirp();
23380   var path = require("path");
23381   var umask = process.platform === "win32" ? 0 : process.umask();
23382   var getType = require_get_type();
23383   var Abstract = require_abstract();
23384   inherits2(Writer, Abstract);
23385   Writer.dirmode = parseInt("0777", 8) & ~umask;
23386   Writer.filemode = parseInt("0666", 8) & ~umask;
23387   var DirWriter = require_dir_writer();
23388   var LinkWriter = require_link_writer();
23389   var FileWriter = require_file_writer();
23390   var ProxyWriter = require_proxy_writer();
23391   function Writer(props, current) {
23392     var self2 = this;
23393     if (typeof props === "string") {
23394       props = {path: props};
23395     }
23396     var type = getType(props);
23397     var ClassType = Writer;
23398     switch (type) {
23399       case "Directory":
23400         ClassType = DirWriter;
23401         break;
23402       case "File":
23403         ClassType = FileWriter;
23404         break;
23405       case "Link":
23406       case "SymbolicLink":
23407         ClassType = LinkWriter;
23408         break;
23409       case null:
23410       default:
23411         ClassType = ProxyWriter;
23412         break;
23413     }
23414     if (!(self2 instanceof ClassType))
23415       return new ClassType(props);
23416     Abstract.call(self2);
23417     if (!props.path)
23418       self2.error("Must provide a path", null, true);
23419     self2.type = props.type;
23420     self2.props = props;
23421     self2.depth = props.depth || 0;
23422     self2.clobber = props.clobber === false ? props.clobber : true;
23423     self2.parent = props.parent || null;
23424     self2.root = props.root || props.parent && props.parent.root || self2;
23425     self2._path = self2.path = path.resolve(props.path);
23426     if (process.platform === "win32") {
23427       self2.path = self2._path = self2.path.replace(/\?/g, "_");
23428       if (self2._path.length >= 260) {
23429         self2._swallowErrors = true;
23430         self2._path = "\\\\?\\" + self2.path.replace(/\//g, "\\");
23431       }
23432     }
23433     self2.basename = path.basename(props.path);
23434     self2.dirname = path.dirname(props.path);
23435     self2.linkpath = props.linkpath || null;
23436     props.parent = props.root = null;
23437     self2.size = props.size;
23438     if (typeof props.mode === "string") {
23439       props.mode = parseInt(props.mode, 8);
23440     }
23441     self2.readable = false;
23442     self2.writable = true;
23443     self2._buffer = [];
23444     self2.ready = false;
23445     self2.filter = typeof props.filter === "function" ? props.filter : null;
23446     self2._stat(current);
23447   }
23448   Writer.prototype._create = function() {
23449     var self2 = this;
23450     fs[self2.props.follow ? "stat" : "lstat"](self2._path, function(er) {
23451       if (er) {
23452         return self2.warn("Cannot create " + self2._path + "\nUnsupported type: " + self2.type, "ENOTSUP");
23453       }
23454       self2._finish();
23455     });
23456   };
23457   Writer.prototype._stat = function(current) {
23458     var self2 = this;
23459     var props = self2.props;
23460     var stat = props.follow ? "stat" : "lstat";
23461     var who = self2._proxy || self2;
23462     if (current)
23463       statCb(null, current);
23464     else
23465       fs[stat](self2._path, statCb);
23466     function statCb(er, current2) {
23467       if (self2.filter && !self2.filter.call(who, who, current2)) {
23468         self2._aborted = true;
23469         self2.emit("end");
23470         self2.emit("close");
23471         return;
23472       }
23473       if (er || !current2) {
23474         return create(self2);
23475       }
23476       self2._old = current2;
23477       var currentType = getType(current2);
23478       if (currentType !== self2.type || self2.type === "File" && current2.nlink > 1) {
23479         return rimraf(self2._path, function(er2) {
23480           if (er2)
23481             return self2.error(er2);
23482           self2._old = null;
23483           create(self2);
23484         });
23485       }
23486       create(self2);
23487     }
23488   };
23489   function create(self2) {
23490     mkdir(path.dirname(self2._path), Writer.dirmode, function(er, made) {
23491       if (er)
23492         return self2.error(er);
23493       self2._madeDir = made;
23494       return self2._create();
23495     });
23496   }
23497   function endChmod(self2, want, current, path2, cb) {
23498     var wantMode = want.mode;
23499     var chmod = want.follow || self2.type !== "SymbolicLink" ? "chmod" : "lchmod";
23500     if (!fs[chmod])
23501       return cb();
23502     if (typeof wantMode !== "number")
23503       return cb();
23504     var curMode = current.mode & parseInt("0777", 8);
23505     wantMode = wantMode & parseInt("0777", 8);
23506     if (wantMode === curMode)
23507       return cb();
23508     fs[chmod](path2, wantMode, cb);
23509   }
23510   function endChown(self2, want, current, path2, cb) {
23511     if (process.platform === "win32")
23512       return cb();
23513     if (!process.getuid || process.getuid() !== 0)
23514       return cb();
23515     if (typeof want.uid !== "number" && typeof want.gid !== "number")
23516       return cb();
23517     if (current.uid === want.uid && current.gid === want.gid)
23518       return cb();
23519     var chown = self2.props.follow || self2.type !== "SymbolicLink" ? "chown" : "lchown";
23520     if (!fs[chown])
23521       return cb();
23522     if (typeof want.uid !== "number")
23523       want.uid = current.uid;
23524     if (typeof want.gid !== "number")
23525       want.gid = current.gid;
23526     fs[chown](path2, want.uid, want.gid, cb);
23527   }
23528   function endUtimes(self2, want, current, path2, cb) {
23529     if (!fs.utimes || process.platform === "win32")
23530       return cb();
23531     var utimes = want.follow || self2.type !== "SymbolicLink" ? "utimes" : "lutimes";
23532     if (utimes === "lutimes" && !fs[utimes]) {
23533       utimes = "utimes";
23534     }
23535     if (!fs[utimes])
23536       return cb();
23537     var curA = current.atime;
23538     var curM = current.mtime;
23539     var meA = want.atime;
23540     var meM = want.mtime;
23541     if (meA === void 0)
23542       meA = curA;
23543     if (meM === void 0)
23544       meM = curM;
23545     if (!isDate(meA))
23546       meA = new Date(meA);
23547     if (!isDate(meM))
23548       meA = new Date(meM);
23549     if (meA.getTime() === curA.getTime() && meM.getTime() === curM.getTime())
23550       return cb();
23551     fs[utimes](path2, meA, meM, cb);
23552   }
23553   Writer.prototype._finish = function() {
23554     var self2 = this;
23555     if (self2._finishing)
23556       return;
23557     self2._finishing = true;
23558     var todo = 0;
23559     var errState = null;
23560     var done = false;
23561     if (self2._old) {
23562       self2._old.atime = new Date(0);
23563       self2._old.mtime = new Date(0);
23564       setProps(self2._old);
23565     } else {
23566       var stat = self2.props.follow ? "stat" : "lstat";
23567       fs[stat](self2._path, function(er, current) {
23568         if (er) {
23569           if (er.code === "ENOENT" && (self2.type === "Link" || self2.type === "SymbolicLink") && process.platform === "win32") {
23570             self2.ready = true;
23571             self2.emit("ready");
23572             self2.emit("end");
23573             self2.emit("close");
23574             self2.end = self2._finish = function() {
23575             };
23576             return;
23577           } else
23578             return self2.error(er);
23579         }
23580         setProps(self2._old = current);
23581       });
23582     }
23583     return;
23584     function setProps(current) {
23585       todo += 3;
23586       endChmod(self2, self2.props, current, self2._path, next("chmod"));
23587       endChown(self2, self2.props, current, self2._path, next("chown"));
23588       endUtimes(self2, self2.props, current, self2._path, next("utimes"));
23589     }
23590     function next(what) {
23591       return function(er) {
23592         if (errState)
23593           return;
23594         if (er) {
23595           er.fstream_finish_call = what;
23596           return self2.error(errState = er);
23597         }
23598         if (--todo > 0)
23599           return;
23600         if (done)
23601           return;
23602         done = true;
23603         if (!self2._madeDir)
23604           return end();
23605         else
23606           endMadeDir(self2, self2._path, end);
23607         function end(er2) {
23608           if (er2) {
23609             er2.fstream_finish_call = "setupMadeDir";
23610             return self2.error(er2);
23611           }
23612           self2.emit("end");
23613           self2.emit("close");
23614         }
23615       };
23616     }
23617   };
23618   function endMadeDir(self2, p, cb) {
23619     var made = self2._madeDir;
23620     var d = path.dirname(p);
23621     endMadeDir_(self2, d, function(er) {
23622       if (er)
23623         return cb(er);
23624       if (d === made) {
23625         return cb();
23626       }
23627       endMadeDir(self2, d, cb);
23628     });
23629   }
23630   function endMadeDir_(self2, p, cb) {
23631     var dirProps = {};
23632     Object.keys(self2.props).forEach(function(k) {
23633       dirProps[k] = self2.props[k];
23634       if (k === "mode" && self2.type !== "Directory") {
23635         dirProps[k] = dirProps[k] | parseInt("0111", 8);
23636       }
23637     });
23638     var todo = 3;
23639     var errState = null;
23640     fs.stat(p, function(er, current) {
23641       if (er)
23642         return cb(errState = er);
23643       endChmod(self2, dirProps, current, p, next);
23644       endChown(self2, dirProps, current, p, next);
23645       endUtimes(self2, dirProps, current, p, next);
23646     });
23647     function next(er) {
23648       if (errState)
23649         return;
23650       if (er)
23651         return cb(errState = er);
23652       if (--todo === 0)
23653         return cb();
23654     }
23655   }
23656   Writer.prototype.pipe = function() {
23657     this.error("Can't pipe from writable stream");
23658   };
23659   Writer.prototype.add = function() {
23660     this.error("Can't add to non-Directory type");
23661   };
23662   Writer.prototype.write = function() {
23663     return true;
23664   };
23665   function objectToString(d) {
23666     return Object.prototype.toString.call(d);
23667   }
23668   function isDate(d) {
23669     return typeof d === "object" && objectToString(d) === "[object Date]";
23670   }
23671 });
23672
23673 // node_modules/fstream/fstream.js
23674 var require_fstream = __commonJS((exports2) => {
23675   exports2.Abstract = require_abstract();
23676   exports2.Reader = require_reader();
23677   exports2.Writer = require_writer();
23678   exports2.File = {
23679     Reader: require_file_reader(),
23680     Writer: require_file_writer()
23681   };
23682   exports2.Dir = {
23683     Reader: require_dir_reader(),
23684     Writer: require_dir_writer()
23685   };
23686   exports2.Link = {
23687     Reader: require_link_reader(),
23688     Writer: require_link_writer()
23689   };
23690   exports2.Proxy = {
23691     Reader: require_proxy_reader(),
23692     Writer: require_proxy_writer()
23693   };
23694   exports2.Reader.Dir = exports2.DirReader = exports2.Dir.Reader;
23695   exports2.Reader.File = exports2.FileReader = exports2.File.Reader;
23696   exports2.Reader.Link = exports2.LinkReader = exports2.Link.Reader;
23697   exports2.Reader.Proxy = exports2.ProxyReader = exports2.Proxy.Reader;
23698   exports2.Writer.Dir = exports2.DirWriter = exports2.Dir.Writer;
23699   exports2.Writer.File = exports2.FileWriter = exports2.File.Writer;
23700   exports2.Writer.Link = exports2.LinkWriter = exports2.Link.Writer;
23701   exports2.Writer.Proxy = exports2.ProxyWriter = exports2.Proxy.Writer;
23702   exports2.collect = require_collect();
23703 });
23704
23705 // node_modules/unzipper/lib/extract.js
23706 var require_extract = __commonJS((exports2, module2) => {
23707   module2.exports = Extract;
23708   var Parse = require_parse3();
23709   var Writer = require_fstream().Writer;
23710   var path = require("path");
23711   var stream = require("stream");
23712   var duplexer2 = require_duplexer2();
23713   var Promise2 = require_bluebird();
23714   function Extract(opts) {
23715     opts.path = path.resolve(path.normalize(opts.path));
23716     var parser = new Parse(opts);
23717     var outStream = new stream.Writable({objectMode: true});
23718     outStream._write = function(entry, encoding, cb) {
23719       if (entry.type == "Directory")
23720         return cb();
23721       var extractPath = path.join(opts.path, entry.path);
23722       if (extractPath.indexOf(opts.path) != 0) {
23723         return cb();
23724       }
23725       const writer = opts.getWriter ? opts.getWriter({path: extractPath}) : Writer({path: extractPath});
23726       entry.pipe(writer).on("error", cb).on("close", cb);
23727     };
23728     var extract = duplexer2(parser, outStream);
23729     parser.once("crx-header", function(crxHeader) {
23730       extract.crxHeader = crxHeader;
23731     });
23732     parser.pipe(outStream).on("finish", function() {
23733       extract.emit("close");
23734     });
23735     extract.promise = function() {
23736       return new Promise2(function(resolve, reject) {
23737         extract.on("close", resolve);
23738         extract.on("error", reject);
23739       });
23740     };
23741     return extract;
23742   }
23743 });
23744
23745 // node_modules/big-integer/BigInteger.js
23746 var require_BigInteger = __commonJS((exports2, module2) => {
23747   var bigInt = function(undefined2) {
23748     "use strict";
23749     var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
23750     var supportsNativeBigInt = typeof BigInt === "function";
23751     function Integer(v, radix, alphabet, caseSensitive) {
23752       if (typeof v === "undefined")
23753         return Integer[0];
23754       if (typeof radix !== "undefined")
23755         return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);
23756       return parseValue(v);
23757     }
23758     function BigInteger(value, sign) {
23759       this.value = value;
23760       this.sign = sign;
23761       this.isSmall = false;
23762     }
23763     BigInteger.prototype = Object.create(Integer.prototype);
23764     function SmallInteger(value) {
23765       this.value = value;
23766       this.sign = value < 0;
23767       this.isSmall = true;
23768     }
23769     SmallInteger.prototype = Object.create(Integer.prototype);
23770     function NativeBigInt(value) {
23771       this.value = value;
23772     }
23773     NativeBigInt.prototype = Object.create(Integer.prototype);
23774     function isPrecise(n) {
23775       return -MAX_INT < n && n < MAX_INT;
23776     }
23777     function smallToArray(n) {
23778       if (n < 1e7)
23779         return [n];
23780       if (n < 1e14)
23781         return [n % 1e7, Math.floor(n / 1e7)];
23782       return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
23783     }
23784     function arrayToSmall(arr) {
23785       trim(arr);
23786       var length = arr.length;
23787       if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
23788         switch (length) {
23789           case 0:
23790             return 0;
23791           case 1:
23792             return arr[0];
23793           case 2:
23794             return arr[0] + arr[1] * BASE;
23795           default:
23796             return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
23797         }
23798       }
23799       return arr;
23800     }
23801     function trim(v) {
23802       var i2 = v.length;
23803       while (v[--i2] === 0)
23804         ;
23805       v.length = i2 + 1;
23806     }
23807     function createArray(length) {
23808       var x = new Array(length);
23809       var i2 = -1;
23810       while (++i2 < length) {
23811         x[i2] = 0;
23812       }
23813       return x;
23814     }
23815     function truncate(n) {
23816       if (n > 0)
23817         return Math.floor(n);
23818       return Math.ceil(n);
23819     }
23820     function add(a, b) {
23821       var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i2;
23822       for (i2 = 0; i2 < l_b; i2++) {
23823         sum = a[i2] + b[i2] + carry;
23824         carry = sum >= base ? 1 : 0;
23825         r[i2] = sum - carry * base;
23826       }
23827       while (i2 < l_a) {
23828         sum = a[i2] + carry;
23829         carry = sum === base ? 1 : 0;
23830         r[i2++] = sum - carry * base;
23831       }
23832       if (carry > 0)
23833         r.push(carry);
23834       return r;
23835     }
23836     function addAny(a, b) {
23837       if (a.length >= b.length)
23838         return add(a, b);
23839       return add(b, a);
23840     }
23841     function addSmall(a, carry) {
23842       var l = a.length, r = new Array(l), base = BASE, sum, i2;
23843       for (i2 = 0; i2 < l; i2++) {
23844         sum = a[i2] - base + carry;
23845         carry = Math.floor(sum / base);
23846         r[i2] = sum - carry * base;
23847         carry += 1;
23848       }
23849       while (carry > 0) {
23850         r[i2++] = carry % base;
23851         carry = Math.floor(carry / base);
23852       }
23853       return r;
23854     }
23855     BigInteger.prototype.add = function(v) {
23856       var n = parseValue(v);
23857       if (this.sign !== n.sign) {
23858         return this.subtract(n.negate());
23859       }
23860       var a = this.value, b = n.value;
23861       if (n.isSmall) {
23862         return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
23863       }
23864       return new BigInteger(addAny(a, b), this.sign);
23865     };
23866     BigInteger.prototype.plus = BigInteger.prototype.add;
23867     SmallInteger.prototype.add = function(v) {
23868       var n = parseValue(v);
23869       var a = this.value;
23870       if (a < 0 !== n.sign) {
23871         return this.subtract(n.negate());
23872       }
23873       var b = n.value;
23874       if (n.isSmall) {
23875         if (isPrecise(a + b))
23876           return new SmallInteger(a + b);
23877         b = smallToArray(Math.abs(b));
23878       }
23879       return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
23880     };
23881     SmallInteger.prototype.plus = SmallInteger.prototype.add;
23882     NativeBigInt.prototype.add = function(v) {
23883       return new NativeBigInt(this.value + parseValue(v).value);
23884     };
23885     NativeBigInt.prototype.plus = NativeBigInt.prototype.add;
23886     function subtract(a, b) {
23887       var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i2, difference;
23888       for (i2 = 0; i2 < b_l; i2++) {
23889         difference = a[i2] - borrow - b[i2];
23890         if (difference < 0) {
23891           difference += base;
23892           borrow = 1;
23893         } else
23894           borrow = 0;
23895         r[i2] = difference;
23896       }
23897       for (i2 = b_l; i2 < a_l; i2++) {
23898         difference = a[i2] - borrow;
23899         if (difference < 0)
23900           difference += base;
23901         else {
23902           r[i2++] = difference;
23903           break;
23904         }
23905         r[i2] = difference;
23906       }
23907       for (; i2 < a_l; i2++) {
23908         r[i2] = a[i2];
23909       }
23910       trim(r);
23911       return r;
23912     }
23913     function subtractAny(a, b, sign) {
23914       var value;
23915       if (compareAbs(a, b) >= 0) {
23916         value = subtract(a, b);
23917       } else {
23918         value = subtract(b, a);
23919         sign = !sign;
23920       }
23921       value = arrayToSmall(value);
23922       if (typeof value === "number") {
23923         if (sign)
23924           value = -value;
23925         return new SmallInteger(value);
23926       }
23927       return new BigInteger(value, sign);
23928     }
23929     function subtractSmall(a, b, sign) {
23930       var l = a.length, r = new Array(l), carry = -b, base = BASE, i2, difference;
23931       for (i2 = 0; i2 < l; i2++) {
23932         difference = a[i2] + carry;
23933         carry = Math.floor(difference / base);
23934         difference %= base;
23935         r[i2] = difference < 0 ? difference + base : difference;
23936       }
23937       r = arrayToSmall(r);
23938       if (typeof r === "number") {
23939         if (sign)
23940           r = -r;
23941         return new SmallInteger(r);
23942       }
23943       return new BigInteger(r, sign);
23944     }
23945     BigInteger.prototype.subtract = function(v) {
23946       var n = parseValue(v);
23947       if (this.sign !== n.sign) {
23948         return this.add(n.negate());
23949       }
23950       var a = this.value, b = n.value;
23951       if (n.isSmall)
23952         return subtractSmall(a, Math.abs(b), this.sign);
23953       return subtractAny(a, b, this.sign);
23954     };
23955     BigInteger.prototype.minus = BigInteger.prototype.subtract;
23956     SmallInteger.prototype.subtract = function(v) {
23957       var n = parseValue(v);
23958       var a = this.value;
23959       if (a < 0 !== n.sign) {
23960         return this.add(n.negate());
23961       }
23962       var b = n.value;
23963       if (n.isSmall) {
23964         return new SmallInteger(a - b);
23965       }
23966       return subtractSmall(b, Math.abs(a), a >= 0);
23967     };
23968     SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
23969     NativeBigInt.prototype.subtract = function(v) {
23970       return new NativeBigInt(this.value - parseValue(v).value);
23971     };
23972     NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;
23973     BigInteger.prototype.negate = function() {
23974       return new BigInteger(this.value, !this.sign);
23975     };
23976     SmallInteger.prototype.negate = function() {
23977       var sign = this.sign;
23978       var small = new SmallInteger(-this.value);
23979       small.sign = !sign;
23980       return small;
23981     };
23982     NativeBigInt.prototype.negate = function() {
23983       return new NativeBigInt(-this.value);
23984     };
23985     BigInteger.prototype.abs = function() {
23986       return new BigInteger(this.value, false);
23987     };
23988     SmallInteger.prototype.abs = function() {
23989       return new SmallInteger(Math.abs(this.value));
23990     };
23991     NativeBigInt.prototype.abs = function() {
23992       return new NativeBigInt(this.value >= 0 ? this.value : -this.value);
23993     };
23994     function multiplyLong(a, b) {
23995       var a_l = a.length, b_l = b.length, l = a_l + b_l, r = createArray(l), base = BASE, product, carry, i2, a_i, b_j;
23996       for (i2 = 0; i2 < a_l; ++i2) {
23997         a_i = a[i2];
23998         for (var j = 0; j < b_l; ++j) {
23999           b_j = b[j];
24000           product = a_i * b_j + r[i2 + j];
24001           carry = Math.floor(product / base);
24002           r[i2 + j] = product - carry * base;
24003           r[i2 + j + 1] += carry;
24004         }
24005       }
24006       trim(r);
24007       return r;
24008     }
24009     function multiplySmall(a, b) {
24010       var l = a.length, r = new Array(l), base = BASE, carry = 0, product, i2;
24011       for (i2 = 0; i2 < l; i2++) {
24012         product = a[i2] * b + carry;
24013         carry = Math.floor(product / base);
24014         r[i2] = product - carry * base;
24015       }
24016       while (carry > 0) {
24017         r[i2++] = carry % base;
24018         carry = Math.floor(carry / base);
24019       }
24020       return r;
24021     }
24022     function shiftLeft(x, n) {
24023       var r = [];
24024       while (n-- > 0)
24025         r.push(0);
24026       return r.concat(x);
24027     }
24028     function multiplyKaratsuba(x, y) {
24029       var n = Math.max(x.length, y.length);
24030       if (n <= 30)
24031         return multiplyLong(x, y);
24032       n = Math.ceil(n / 2);
24033       var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n);
24034       var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
24035       var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
24036       trim(product);
24037       return product;
24038     }
24039     function useKaratsuba(l1, l2) {
24040       return -0.012 * l1 - 0.012 * l2 + 15e-6 * l1 * l2 > 0;
24041     }
24042     BigInteger.prototype.multiply = function(v) {
24043       var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs;
24044       if (n.isSmall) {
24045         if (b === 0)
24046           return Integer[0];
24047         if (b === 1)
24048           return this;
24049         if (b === -1)
24050           return this.negate();
24051         abs = Math.abs(b);
24052         if (abs < BASE) {
24053           return new BigInteger(multiplySmall(a, abs), sign);
24054         }
24055         b = smallToArray(abs);
24056       }
24057       if (useKaratsuba(a.length, b.length))
24058         return new BigInteger(multiplyKaratsuba(a, b), sign);
24059       return new BigInteger(multiplyLong(a, b), sign);
24060     };
24061     BigInteger.prototype.times = BigInteger.prototype.multiply;
24062     function multiplySmallAndArray(a, b, sign) {
24063       if (a < BASE) {
24064         return new BigInteger(multiplySmall(b, a), sign);
24065       }
24066       return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
24067     }
24068     SmallInteger.prototype._multiplyBySmall = function(a) {
24069       if (isPrecise(a.value * this.value)) {
24070         return new SmallInteger(a.value * this.value);
24071       }
24072       return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
24073     };
24074     BigInteger.prototype._multiplyBySmall = function(a) {
24075       if (a.value === 0)
24076         return Integer[0];
24077       if (a.value === 1)
24078         return this;
24079       if (a.value === -1)
24080         return this.negate();
24081       return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
24082     };
24083     SmallInteger.prototype.multiply = function(v) {
24084       return parseValue(v)._multiplyBySmall(this);
24085     };
24086     SmallInteger.prototype.times = SmallInteger.prototype.multiply;
24087     NativeBigInt.prototype.multiply = function(v) {
24088       return new NativeBigInt(this.value * parseValue(v).value);
24089     };
24090     NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;
24091     function square(a) {
24092       var l = a.length, r = createArray(l + l), base = BASE, product, carry, i2, a_i, a_j;
24093       for (i2 = 0; i2 < l; i2++) {
24094         a_i = a[i2];
24095         carry = 0 - a_i * a_i;
24096         for (var j = i2; j < l; j++) {
24097           a_j = a[j];
24098           product = 2 * (a_i * a_j) + r[i2 + j] + carry;
24099           carry = Math.floor(product / base);
24100           r[i2 + j] = product - carry * base;
24101         }
24102         r[i2 + l] = carry;
24103       }
24104       trim(r);
24105       return r;
24106     }
24107     BigInteger.prototype.square = function() {
24108       return new BigInteger(square(this.value), false);
24109     };
24110     SmallInteger.prototype.square = function() {
24111       var value = this.value * this.value;
24112       if (isPrecise(value))
24113         return new SmallInteger(value);
24114       return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
24115     };
24116     NativeBigInt.prototype.square = function(v) {
24117       return new NativeBigInt(this.value * this.value);
24118     };
24119     function divMod1(a, b) {
24120       var a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length), divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda), quotientDigit, shift, carry, borrow, i2, l, q;
24121       if (remainder.length <= a_l)
24122         remainder.push(0);
24123       divisor.push(0);
24124       divisorMostSignificantDigit = divisor[b_l - 1];
24125       for (shift = a_l - b_l; shift >= 0; shift--) {
24126         quotientDigit = base - 1;
24127         if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
24128           quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
24129         }
24130         carry = 0;
24131         borrow = 0;
24132         l = divisor.length;
24133         for (i2 = 0; i2 < l; i2++) {
24134           carry += quotientDigit * divisor[i2];
24135           q = Math.floor(carry / base);
24136           borrow += remainder[shift + i2] - (carry - q * base);
24137           carry = q;
24138           if (borrow < 0) {
24139             remainder[shift + i2] = borrow + base;
24140             borrow = -1;
24141           } else {
24142             remainder[shift + i2] = borrow;
24143             borrow = 0;
24144           }
24145         }
24146         while (borrow !== 0) {
24147           quotientDigit -= 1;
24148           carry = 0;
24149           for (i2 = 0; i2 < l; i2++) {
24150             carry += remainder[shift + i2] - base + divisor[i2];
24151             if (carry < 0) {
24152               remainder[shift + i2] = carry + base;
24153               carry = 0;
24154             } else {
24155               remainder[shift + i2] = carry;
24156               carry = 1;
24157             }
24158           }
24159           borrow += carry;
24160         }
24161         result[shift] = quotientDigit;
24162       }
24163       remainder = divModSmall(remainder, lambda)[0];
24164       return [arrayToSmall(result), arrayToSmall(remainder)];
24165     }
24166     function divMod2(a, b) {
24167       var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check;
24168       while (a_l) {
24169         part.unshift(a[--a_l]);
24170         trim(part);
24171         if (compareAbs(part, b) < 0) {
24172           result.push(0);
24173           continue;
24174         }
24175         xlen = part.length;
24176         highx = part[xlen - 1] * base + part[xlen - 2];
24177         highy = b[b_l - 1] * base + b[b_l - 2];
24178         if (xlen > b_l) {
24179           highx = (highx + 1) * base;
24180         }
24181         guess = Math.ceil(highx / highy);
24182         do {
24183           check = multiplySmall(b, guess);
24184           if (compareAbs(check, part) <= 0)
24185             break;
24186           guess--;
24187         } while (guess);
24188         result.push(guess);
24189         part = subtract(part, check);
24190       }
24191       result.reverse();
24192       return [arrayToSmall(result), arrayToSmall(part)];
24193     }
24194     function divModSmall(value, lambda) {
24195       var length = value.length, quotient = createArray(length), base = BASE, i2, q, remainder, divisor;
24196       remainder = 0;
24197       for (i2 = length - 1; i2 >= 0; --i2) {
24198         divisor = remainder * base + value[i2];
24199         q = truncate(divisor / lambda);
24200         remainder = divisor - q * lambda;
24201         quotient[i2] = q | 0;
24202       }
24203       return [quotient, remainder | 0];
24204     }
24205     function divModAny(self2, v) {
24206       var value, n = parseValue(v);
24207       if (supportsNativeBigInt) {
24208         return [new NativeBigInt(self2.value / n.value), new NativeBigInt(self2.value % n.value)];
24209       }
24210       var a = self2.value, b = n.value;
24211       var quotient;
24212       if (b === 0)
24213         throw new Error("Cannot divide by zero");
24214       if (self2.isSmall) {
24215         if (n.isSmall) {
24216           return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
24217         }
24218         return [Integer[0], self2];
24219       }
24220       if (n.isSmall) {
24221         if (b === 1)
24222           return [self2, Integer[0]];
24223         if (b == -1)
24224           return [self2.negate(), Integer[0]];
24225         var abs = Math.abs(b);
24226         if (abs < BASE) {
24227           value = divModSmall(a, abs);
24228           quotient = arrayToSmall(value[0]);
24229           var remainder = value[1];
24230           if (self2.sign)
24231             remainder = -remainder;
24232           if (typeof quotient === "number") {
24233             if (self2.sign !== n.sign)
24234               quotient = -quotient;
24235             return [new SmallInteger(quotient), new SmallInteger(remainder)];
24236           }
24237           return [new BigInteger(quotient, self2.sign !== n.sign), new SmallInteger(remainder)];
24238         }
24239         b = smallToArray(abs);
24240       }
24241       var comparison = compareAbs(a, b);
24242       if (comparison === -1)
24243         return [Integer[0], self2];
24244       if (comparison === 0)
24245         return [Integer[self2.sign === n.sign ? 1 : -1], Integer[0]];
24246       if (a.length + b.length <= 200)
24247         value = divMod1(a, b);
24248       else
24249         value = divMod2(a, b);
24250       quotient = value[0];
24251       var qSign = self2.sign !== n.sign, mod = value[1], mSign = self2.sign;
24252       if (typeof quotient === "number") {
24253         if (qSign)
24254           quotient = -quotient;
24255         quotient = new SmallInteger(quotient);
24256       } else
24257         quotient = new BigInteger(quotient, qSign);
24258       if (typeof mod === "number") {
24259         if (mSign)
24260           mod = -mod;
24261         mod = new SmallInteger(mod);
24262       } else
24263         mod = new BigInteger(mod, mSign);
24264       return [quotient, mod];
24265     }
24266     BigInteger.prototype.divmod = function(v) {
24267       var result = divModAny(this, v);
24268       return {
24269         quotient: result[0],
24270         remainder: result[1]
24271       };
24272     };
24273     NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
24274     BigInteger.prototype.divide = function(v) {
24275       return divModAny(this, v)[0];
24276     };
24277     NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function(v) {
24278       return new NativeBigInt(this.value / parseValue(v).value);
24279     };
24280     SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
24281     BigInteger.prototype.mod = function(v) {
24282       return divModAny(this, v)[1];
24283     };
24284     NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function(v) {
24285       return new NativeBigInt(this.value % parseValue(v).value);
24286     };
24287     SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
24288     BigInteger.prototype.pow = function(v) {
24289       var n = parseValue(v), a = this.value, b = n.value, value, x, y;
24290       if (b === 0)
24291         return Integer[1];
24292       if (a === 0)
24293         return Integer[0];
24294       if (a === 1)
24295         return Integer[1];
24296       if (a === -1)
24297         return n.isEven() ? Integer[1] : Integer[-1];
24298       if (n.sign) {
24299         return Integer[0];
24300       }
24301       if (!n.isSmall)
24302         throw new Error("The exponent " + n.toString() + " is too large.");
24303       if (this.isSmall) {
24304         if (isPrecise(value = Math.pow(a, b)))
24305           return new SmallInteger(truncate(value));
24306       }
24307       x = this;
24308       y = Integer[1];
24309       while (true) {
24310         if (b & true) {
24311           y = y.times(x);
24312           --b;
24313         }
24314         if (b === 0)
24315           break;
24316         b /= 2;
24317         x = x.square();
24318       }
24319       return y;
24320     };
24321     SmallInteger.prototype.pow = BigInteger.prototype.pow;
24322     NativeBigInt.prototype.pow = function(v) {
24323       var n = parseValue(v);
24324       var a = this.value, b = n.value;
24325       var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);
24326       if (b === _0)
24327         return Integer[1];
24328       if (a === _0)
24329         return Integer[0];
24330       if (a === _1)
24331         return Integer[1];
24332       if (a === BigInt(-1))
24333         return n.isEven() ? Integer[1] : Integer[-1];
24334       if (n.isNegative())
24335         return new NativeBigInt(_0);
24336       var x = this;
24337       var y = Integer[1];
24338       while (true) {
24339         if ((b & _1) === _1) {
24340           y = y.times(x);
24341           --b;
24342         }
24343         if (b === _0)
24344           break;
24345         b /= _2;
24346         x = x.square();
24347       }
24348       return y;
24349     };
24350     BigInteger.prototype.modPow = function(exp, mod) {
24351       exp = parseValue(exp);
24352       mod = parseValue(mod);
24353       if (mod.isZero())
24354         throw new Error("Cannot take modPow with modulus 0");
24355       var r = Integer[1], base = this.mod(mod);
24356       if (exp.isNegative()) {
24357         exp = exp.multiply(Integer[-1]);
24358         base = base.modInv(mod);
24359       }
24360       while (exp.isPositive()) {
24361         if (base.isZero())
24362           return Integer[0];
24363         if (exp.isOdd())
24364           r = r.multiply(base).mod(mod);
24365         exp = exp.divide(2);
24366         base = base.square().mod(mod);
24367       }
24368       return r;
24369     };
24370     NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
24371     function compareAbs(a, b) {
24372       if (a.length !== b.length) {
24373         return a.length > b.length ? 1 : -1;
24374       }
24375       for (var i2 = a.length - 1; i2 >= 0; i2--) {
24376         if (a[i2] !== b[i2])
24377           return a[i2] > b[i2] ? 1 : -1;
24378       }
24379       return 0;
24380     }
24381     BigInteger.prototype.compareAbs = function(v) {
24382       var n = parseValue(v), a = this.value, b = n.value;
24383       if (n.isSmall)
24384         return 1;
24385       return compareAbs(a, b);
24386     };
24387     SmallInteger.prototype.compareAbs = function(v) {
24388       var n = parseValue(v), a = Math.abs(this.value), b = n.value;
24389       if (n.isSmall) {
24390         b = Math.abs(b);
24391         return a === b ? 0 : a > b ? 1 : -1;
24392       }
24393       return -1;
24394     };
24395     NativeBigInt.prototype.compareAbs = function(v) {
24396       var a = this.value;
24397       var b = parseValue(v).value;
24398       a = a >= 0 ? a : -a;
24399       b = b >= 0 ? b : -b;
24400       return a === b ? 0 : a > b ? 1 : -1;
24401     };
24402     BigInteger.prototype.compare = function(v) {
24403       if (v === Infinity) {
24404         return -1;
24405       }
24406       if (v === -Infinity) {
24407         return 1;
24408       }
24409       var n = parseValue(v), a = this.value, b = n.value;
24410       if (this.sign !== n.sign) {
24411         return n.sign ? 1 : -1;
24412       }
24413       if (n.isSmall) {
24414         return this.sign ? -1 : 1;
24415       }
24416       return compareAbs(a, b) * (this.sign ? -1 : 1);
24417     };
24418     BigInteger.prototype.compareTo = BigInteger.prototype.compare;
24419     SmallInteger.prototype.compare = function(v) {
24420       if (v === Infinity) {
24421         return -1;
24422       }
24423       if (v === -Infinity) {
24424         return 1;
24425       }
24426       var n = parseValue(v), a = this.value, b = n.value;
24427       if (n.isSmall) {
24428         return a == b ? 0 : a > b ? 1 : -1;
24429       }
24430       if (a < 0 !== n.sign) {
24431         return a < 0 ? -1 : 1;
24432       }
24433       return a < 0 ? 1 : -1;
24434     };
24435     SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
24436     NativeBigInt.prototype.compare = function(v) {
24437       if (v === Infinity) {
24438         return -1;
24439       }
24440       if (v === -Infinity) {
24441         return 1;
24442       }
24443       var a = this.value;
24444       var b = parseValue(v).value;
24445       return a === b ? 0 : a > b ? 1 : -1;
24446     };
24447     NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;
24448     BigInteger.prototype.equals = function(v) {
24449       return this.compare(v) === 0;
24450     };
24451     NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
24452     BigInteger.prototype.notEquals = function(v) {
24453       return this.compare(v) !== 0;
24454     };
24455     NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
24456     BigInteger.prototype.greater = function(v) {
24457       return this.compare(v) > 0;
24458     };
24459     NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
24460     BigInteger.prototype.lesser = function(v) {
24461       return this.compare(v) < 0;
24462     };
24463     NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
24464     BigInteger.prototype.greaterOrEquals = function(v) {
24465       return this.compare(v) >= 0;
24466     };
24467     NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
24468     BigInteger.prototype.lesserOrEquals = function(v) {
24469       return this.compare(v) <= 0;
24470     };
24471     NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
24472     BigInteger.prototype.isEven = function() {
24473       return (this.value[0] & 1) === 0;
24474     };
24475     SmallInteger.prototype.isEven = function() {
24476       return (this.value & 1) === 0;
24477     };
24478     NativeBigInt.prototype.isEven = function() {
24479       return (this.value & BigInt(1)) === BigInt(0);
24480     };
24481     BigInteger.prototype.isOdd = function() {
24482       return (this.value[0] & 1) === 1;
24483     };
24484     SmallInteger.prototype.isOdd = function() {
24485       return (this.value & 1) === 1;
24486     };
24487     NativeBigInt.prototype.isOdd = function() {
24488       return (this.value & BigInt(1)) === BigInt(1);
24489     };
24490     BigInteger.prototype.isPositive = function() {
24491       return !this.sign;
24492     };
24493     SmallInteger.prototype.isPositive = function() {
24494       return this.value > 0;
24495     };
24496     NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;
24497     BigInteger.prototype.isNegative = function() {
24498       return this.sign;
24499     };
24500     SmallInteger.prototype.isNegative = function() {
24501       return this.value < 0;
24502     };
24503     NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;
24504     BigInteger.prototype.isUnit = function() {
24505       return false;
24506     };
24507     SmallInteger.prototype.isUnit = function() {
24508       return Math.abs(this.value) === 1;
24509     };
24510     NativeBigInt.prototype.isUnit = function() {
24511       return this.abs().value === BigInt(1);
24512     };
24513     BigInteger.prototype.isZero = function() {
24514       return false;
24515     };
24516     SmallInteger.prototype.isZero = function() {
24517       return this.value === 0;
24518     };
24519     NativeBigInt.prototype.isZero = function() {
24520       return this.value === BigInt(0);
24521     };
24522     BigInteger.prototype.isDivisibleBy = function(v) {
24523       var n = parseValue(v);
24524       if (n.isZero())
24525         return false;
24526       if (n.isUnit())
24527         return true;
24528       if (n.compareAbs(2) === 0)
24529         return this.isEven();
24530       return this.mod(n).isZero();
24531     };
24532     NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
24533     function isBasicPrime(v) {
24534       var n = v.abs();
24535       if (n.isUnit())
24536         return false;
24537       if (n.equals(2) || n.equals(3) || n.equals(5))
24538         return true;
24539       if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5))
24540         return false;
24541       if (n.lesser(49))
24542         return true;
24543     }
24544     function millerRabinTest(n, a) {
24545       var nPrev = n.prev(), b = nPrev, r = 0, d, t, i2, x;
24546       while (b.isEven())
24547         b = b.divide(2), r++;
24548       next:
24549         for (i2 = 0; i2 < a.length; i2++) {
24550           if (n.lesser(a[i2]))
24551             continue;
24552           x = bigInt(a[i2]).modPow(b, n);
24553           if (x.isUnit() || x.equals(nPrev))
24554             continue;
24555           for (d = r - 1; d != 0; d--) {
24556             x = x.square().mod(n);
24557             if (x.isUnit())
24558               return false;
24559             if (x.equals(nPrev))
24560               continue next;
24561           }
24562           return false;
24563         }
24564       return true;
24565     }
24566     BigInteger.prototype.isPrime = function(strict) {
24567       var isPrime = isBasicPrime(this);
24568       if (isPrime !== undefined2)
24569         return isPrime;
24570       var n = this.abs();
24571       var bits = n.bitLength();
24572       if (bits <= 64)
24573         return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
24574       var logN = Math.log(2) * bits.toJSNumber();
24575       var t = Math.ceil(strict === true ? 2 * Math.pow(logN, 2) : logN);
24576       for (var a = [], i2 = 0; i2 < t; i2++) {
24577         a.push(bigInt(i2 + 2));
24578       }
24579       return millerRabinTest(n, a);
24580     };
24581     NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
24582     BigInteger.prototype.isProbablePrime = function(iterations, rng) {
24583       var isPrime = isBasicPrime(this);
24584       if (isPrime !== undefined2)
24585         return isPrime;
24586       var n = this.abs();
24587       var t = iterations === undefined2 ? 5 : iterations;
24588       for (var a = [], i2 = 0; i2 < t; i2++) {
24589         a.push(bigInt.randBetween(2, n.minus(2), rng));
24590       }
24591       return millerRabinTest(n, a);
24592     };
24593     NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
24594     BigInteger.prototype.modInv = function(n) {
24595       var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
24596       while (!newR.isZero()) {
24597         q = r.divide(newR);
24598         lastT = t;
24599         lastR = r;
24600         t = newT;
24601         r = newR;
24602         newT = lastT.subtract(q.multiply(newT));
24603         newR = lastR.subtract(q.multiply(newR));
24604       }
24605       if (!r.isUnit())
24606         throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
24607       if (t.compare(0) === -1) {
24608         t = t.add(n);
24609       }
24610       if (this.isNegative()) {
24611         return t.negate();
24612       }
24613       return t;
24614     };
24615     NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
24616     BigInteger.prototype.next = function() {
24617       var value = this.value;
24618       if (this.sign) {
24619         return subtractSmall(value, 1, this.sign);
24620       }
24621       return new BigInteger(addSmall(value, 1), this.sign);
24622     };
24623     SmallInteger.prototype.next = function() {
24624       var value = this.value;
24625       if (value + 1 < MAX_INT)
24626         return new SmallInteger(value + 1);
24627       return new BigInteger(MAX_INT_ARR, false);
24628     };
24629     NativeBigInt.prototype.next = function() {
24630       return new NativeBigInt(this.value + BigInt(1));
24631     };
24632     BigInteger.prototype.prev = function() {
24633       var value = this.value;
24634       if (this.sign) {
24635         return new BigInteger(addSmall(value, 1), true);
24636       }
24637       return subtractSmall(value, 1, this.sign);
24638     };
24639     SmallInteger.prototype.prev = function() {
24640       var value = this.value;
24641       if (value - 1 > -MAX_INT)
24642         return new SmallInteger(value - 1);
24643       return new BigInteger(MAX_INT_ARR, true);
24644     };
24645     NativeBigInt.prototype.prev = function() {
24646       return new NativeBigInt(this.value - BigInt(1));
24647     };
24648     var powersOfTwo = [1];
24649     while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE)
24650       powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
24651     var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
24652     function shift_isSmall(n) {
24653       return Math.abs(n) <= BASE;
24654     }
24655     BigInteger.prototype.shiftLeft = function(v) {
24656       var n = parseValue(v).toJSNumber();
24657       if (!shift_isSmall(n)) {
24658         throw new Error(String(n) + " is too large for shifting.");
24659       }
24660       if (n < 0)
24661         return this.shiftRight(-n);
24662       var result = this;
24663       if (result.isZero())
24664         return result;
24665       while (n >= powers2Length) {
24666         result = result.multiply(highestPower2);
24667         n -= powers2Length - 1;
24668       }
24669       return result.multiply(powersOfTwo[n]);
24670     };
24671     NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
24672     BigInteger.prototype.shiftRight = function(v) {
24673       var remQuo;
24674       var n = parseValue(v).toJSNumber();
24675       if (!shift_isSmall(n)) {
24676         throw new Error(String(n) + " is too large for shifting.");
24677       }
24678       if (n < 0)
24679         return this.shiftLeft(-n);
24680       var result = this;
24681       while (n >= powers2Length) {
24682         if (result.isZero() || result.isNegative() && result.isUnit())
24683           return result;
24684         remQuo = divModAny(result, highestPower2);
24685         result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
24686         n -= powers2Length - 1;
24687       }
24688       remQuo = divModAny(result, powersOfTwo[n]);
24689       return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
24690     };
24691     NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
24692     function bitwise(x, y, fn) {
24693       y = parseValue(y);
24694       var xSign = x.isNegative(), ySign = y.isNegative();
24695       var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y;
24696       var xDigit = 0, yDigit = 0;
24697       var xDivMod = null, yDivMod = null;
24698       var result = [];
24699       while (!xRem.isZero() || !yRem.isZero()) {
24700         xDivMod = divModAny(xRem, highestPower2);
24701         xDigit = xDivMod[1].toJSNumber();
24702         if (xSign) {
24703           xDigit = highestPower2 - 1 - xDigit;
24704         }
24705         yDivMod = divModAny(yRem, highestPower2);
24706         yDigit = yDivMod[1].toJSNumber();
24707         if (ySign) {
24708           yDigit = highestPower2 - 1 - yDigit;
24709         }
24710         xRem = xDivMod[0];
24711         yRem = yDivMod[0];
24712         result.push(fn(xDigit, yDigit));
24713       }
24714       var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);
24715       for (var i2 = result.length - 1; i2 >= 0; i2 -= 1) {
24716         sum = sum.multiply(highestPower2).add(bigInt(result[i2]));
24717       }
24718       return sum;
24719     }
24720     BigInteger.prototype.not = function() {
24721       return this.negate().prev();
24722     };
24723     NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;
24724     BigInteger.prototype.and = function(n) {
24725       return bitwise(this, n, function(a, b) {
24726         return a & b;
24727       });
24728     };
24729     NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;
24730     BigInteger.prototype.or = function(n) {
24731       return bitwise(this, n, function(a, b) {
24732         return a | b;
24733       });
24734     };
24735     NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;
24736     BigInteger.prototype.xor = function(n) {
24737       return bitwise(this, n, function(a, b) {
24738         return a ^ b;
24739       });
24740     };
24741     NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;
24742     var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
24743     function roughLOB(n) {
24744       var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : typeof v === "bigint" ? v | BigInt(LOBMASK_I) : v[0] + v[1] * BASE | LOBMASK_BI;
24745       return x & -x;
24746     }
24747     function integerLogarithm(value, base) {
24748       if (base.compareTo(value) <= 0) {
24749         var tmp = integerLogarithm(value, base.square(base));
24750         var p = tmp.p;
24751         var e = tmp.e;
24752         var t = p.multiply(base);
24753         return t.compareTo(value) <= 0 ? {p: t, e: e * 2 + 1} : {p, e: e * 2};
24754       }
24755       return {p: bigInt(1), e: 0};
24756     }
24757     BigInteger.prototype.bitLength = function() {
24758       var n = this;
24759       if (n.compareTo(bigInt(0)) < 0) {
24760         n = n.negate().subtract(bigInt(1));
24761       }
24762       if (n.compareTo(bigInt(0)) === 0) {
24763         return bigInt(0);
24764       }
24765       return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));
24766     };
24767     NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
24768     function max(a, b) {
24769       a = parseValue(a);
24770       b = parseValue(b);
24771       return a.greater(b) ? a : b;
24772     }
24773     function min(a, b) {
24774       a = parseValue(a);
24775       b = parseValue(b);
24776       return a.lesser(b) ? a : b;
24777     }
24778     function gcd(a, b) {
24779       a = parseValue(a).abs();
24780       b = parseValue(b).abs();
24781       if (a.equals(b))
24782         return a;
24783       if (a.isZero())
24784         return b;
24785       if (b.isZero())
24786         return a;
24787       var c = Integer[1], d, t;
24788       while (a.isEven() && b.isEven()) {
24789         d = min(roughLOB(a), roughLOB(b));
24790         a = a.divide(d);
24791         b = b.divide(d);
24792         c = c.multiply(d);
24793       }
24794       while (a.isEven()) {
24795         a = a.divide(roughLOB(a));
24796       }
24797       do {
24798         while (b.isEven()) {
24799           b = b.divide(roughLOB(b));
24800         }
24801         if (a.greater(b)) {
24802           t = b;
24803           b = a;
24804           a = t;
24805         }
24806         b = b.subtract(a);
24807       } while (!b.isZero());
24808       return c.isUnit() ? a : a.multiply(c);
24809     }
24810     function lcm(a, b) {
24811       a = parseValue(a).abs();
24812       b = parseValue(b).abs();
24813       return a.divide(gcd(a, b)).multiply(b);
24814     }
24815     function randBetween(a, b, rng) {
24816       a = parseValue(a);
24817       b = parseValue(b);
24818       var usedRNG = rng || Math.random;
24819       var low = min(a, b), high = max(a, b);
24820       var range = high.subtract(low).add(1);
24821       if (range.isSmall)
24822         return low.add(Math.floor(usedRNG() * range));
24823       var digits = toBase(range, BASE).value;
24824       var result = [], restricted = true;
24825       for (var i2 = 0; i2 < digits.length; i2++) {
24826         var top = restricted ? digits[i2] : BASE;
24827         var digit = truncate(usedRNG() * top);
24828         result.push(digit);
24829         if (digit < top)
24830           restricted = false;
24831       }
24832       return low.add(Integer.fromArray(result, BASE, false));
24833     }
24834     var parseBase = function(text, base, alphabet, caseSensitive) {
24835       alphabet = alphabet || DEFAULT_ALPHABET;
24836       text = String(text);
24837       if (!caseSensitive) {
24838         text = text.toLowerCase();
24839         alphabet = alphabet.toLowerCase();
24840       }
24841       var length = text.length;
24842       var i2;
24843       var absBase = Math.abs(base);
24844       var alphabetValues = {};
24845       for (i2 = 0; i2 < alphabet.length; i2++) {
24846         alphabetValues[alphabet[i2]] = i2;
24847       }
24848       for (i2 = 0; i2 < length; i2++) {
24849         var c = text[i2];
24850         if (c === "-")
24851           continue;
24852         if (c in alphabetValues) {
24853           if (alphabetValues[c] >= absBase) {
24854             if (c === "1" && absBase === 1)
24855               continue;
24856             throw new Error(c + " is not a valid digit in base " + base + ".");
24857           }
24858         }
24859       }
24860       base = parseValue(base);
24861       var digits = [];
24862       var isNegative = text[0] === "-";
24863       for (i2 = isNegative ? 1 : 0; i2 < text.length; i2++) {
24864         var c = text[i2];
24865         if (c in alphabetValues)
24866           digits.push(parseValue(alphabetValues[c]));
24867         else if (c === "<") {
24868           var start = i2;
24869           do {
24870             i2++;
24871           } while (text[i2] !== ">" && i2 < text.length);
24872           digits.push(parseValue(text.slice(start + 1, i2)));
24873         } else
24874           throw new Error(c + " is not a valid character");
24875       }
24876       return parseBaseFromArray(digits, base, isNegative);
24877     };
24878     function parseBaseFromArray(digits, base, isNegative) {
24879       var val = Integer[0], pow = Integer[1], i2;
24880       for (i2 = digits.length - 1; i2 >= 0; i2--) {
24881         val = val.add(digits[i2].times(pow));
24882         pow = pow.times(base);
24883       }
24884       return isNegative ? val.negate() : val;
24885     }
24886     function stringify(digit, alphabet) {
24887       alphabet = alphabet || DEFAULT_ALPHABET;
24888       if (digit < alphabet.length) {
24889         return alphabet[digit];
24890       }
24891       return "<" + digit + ">";
24892     }
24893     function toBase(n, base) {
24894       base = bigInt(base);
24895       if (base.isZero()) {
24896         if (n.isZero())
24897           return {value: [0], isNegative: false};
24898         throw new Error("Cannot convert nonzero numbers to base 0.");
24899       }
24900       if (base.equals(-1)) {
24901         if (n.isZero())
24902           return {value: [0], isNegative: false};
24903         if (n.isNegative())
24904           return {
24905             value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber())).map(Array.prototype.valueOf, [1, 0])),
24906             isNegative: false
24907           };
24908         var arr = Array.apply(null, Array(n.toJSNumber() - 1)).map(Array.prototype.valueOf, [0, 1]);
24909         arr.unshift([1]);
24910         return {
24911           value: [].concat.apply([], arr),
24912           isNegative: false
24913         };
24914       }
24915       var neg = false;
24916       if (n.isNegative() && base.isPositive()) {
24917         neg = true;
24918         n = n.abs();
24919       }
24920       if (base.isUnit()) {
24921         if (n.isZero())
24922           return {value: [0], isNegative: false};
24923         return {
24924           value: Array.apply(null, Array(n.toJSNumber())).map(Number.prototype.valueOf, 1),
24925           isNegative: neg
24926         };
24927       }
24928       var out = [];
24929       var left = n, divmod;
24930       while (left.isNegative() || left.compareAbs(base) >= 0) {
24931         divmod = left.divmod(base);
24932         left = divmod.quotient;
24933         var digit = divmod.remainder;
24934         if (digit.isNegative()) {
24935           digit = base.minus(digit).abs();
24936           left = left.next();
24937         }
24938         out.push(digit.toJSNumber());
24939       }
24940       out.push(left.toJSNumber());
24941       return {value: out.reverse(), isNegative: neg};
24942     }
24943     function toBaseString(n, base, alphabet) {
24944       var arr = toBase(n, base);
24945       return (arr.isNegative ? "-" : "") + arr.value.map(function(x) {
24946         return stringify(x, alphabet);
24947       }).join("");
24948     }
24949     BigInteger.prototype.toArray = function(radix) {
24950       return toBase(this, radix);
24951     };
24952     SmallInteger.prototype.toArray = function(radix) {
24953       return toBase(this, radix);
24954     };
24955     NativeBigInt.prototype.toArray = function(radix) {
24956       return toBase(this, radix);
24957     };
24958     BigInteger.prototype.toString = function(radix, alphabet) {
24959       if (radix === undefined2)
24960         radix = 10;
24961       if (radix !== 10)
24962         return toBaseString(this, radix, alphabet);
24963       var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
24964       while (--l >= 0) {
24965         digit = String(v[l]);
24966         str += zeros.slice(digit.length) + digit;
24967       }
24968       var sign = this.sign ? "-" : "";
24969       return sign + str;
24970     };
24971     SmallInteger.prototype.toString = function(radix, alphabet) {
24972       if (radix === undefined2)
24973         radix = 10;
24974       if (radix != 10)
24975         return toBaseString(this, radix, alphabet);
24976       return String(this.value);
24977     };
24978     NativeBigInt.prototype.toString = SmallInteger.prototype.toString;
24979     NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function() {
24980       return this.toString();
24981     };
24982     BigInteger.prototype.valueOf = function() {
24983       return parseInt(this.toString(), 10);
24984     };
24985     BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
24986     SmallInteger.prototype.valueOf = function() {
24987       return this.value;
24988     };
24989     SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
24990     NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function() {
24991       return parseInt(this.toString(), 10);
24992     };
24993     function parseStringValue(v) {
24994       if (isPrecise(+v)) {
24995         var x = +v;
24996         if (x === truncate(x))
24997           return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);
24998         throw new Error("Invalid integer: " + v);
24999       }
25000       var sign = v[0] === "-";
25001       if (sign)
25002         v = v.slice(1);
25003       var split = v.split(/e/i);
25004       if (split.length > 2)
25005         throw new Error("Invalid integer: " + split.join("e"));
25006       if (split.length === 2) {
25007         var exp = split[1];
25008         if (exp[0] === "+")
25009           exp = exp.slice(1);
25010         exp = +exp;
25011         if (exp !== truncate(exp) || !isPrecise(exp))
25012           throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
25013         var text = split[0];
25014         var decimalPlace = text.indexOf(".");
25015         if (decimalPlace >= 0) {
25016           exp -= text.length - decimalPlace - 1;
25017           text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
25018         }
25019         if (exp < 0)
25020           throw new Error("Cannot include negative exponent part for integers");
25021         text += new Array(exp + 1).join("0");
25022         v = text;
25023       }
25024       var isValid = /^([0-9][0-9]*)$/.test(v);
25025       if (!isValid)
25026         throw new Error("Invalid integer: " + v);
25027       if (supportsNativeBigInt) {
25028         return new NativeBigInt(BigInt(sign ? "-" + v : v));
25029       }
25030       var r = [], max2 = v.length, l = LOG_BASE, min2 = max2 - l;
25031       while (max2 > 0) {
25032         r.push(+v.slice(min2, max2));
25033         min2 -= l;
25034         if (min2 < 0)
25035           min2 = 0;
25036         max2 -= l;
25037       }
25038       trim(r);
25039       return new BigInteger(r, sign);
25040     }
25041     function parseNumberValue(v) {
25042       if (supportsNativeBigInt) {
25043         return new NativeBigInt(BigInt(v));
25044       }
25045       if (isPrecise(v)) {
25046         if (v !== truncate(v))
25047           throw new Error(v + " is not an integer.");
25048         return new SmallInteger(v);
25049       }
25050       return parseStringValue(v.toString());
25051     }
25052     function parseValue(v) {
25053       if (typeof v === "number") {
25054         return parseNumberValue(v);
25055       }
25056       if (typeof v === "string") {
25057         return parseStringValue(v);
25058       }
25059       if (typeof v === "bigint") {
25060         return new NativeBigInt(v);
25061       }
25062       return v;
25063     }
25064     for (var i = 0; i < 1e3; i++) {
25065       Integer[i] = parseValue(i);
25066       if (i > 0)
25067         Integer[-i] = parseValue(-i);
25068     }
25069     Integer.one = Integer[1];
25070     Integer.zero = Integer[0];
25071     Integer.minusOne = Integer[-1];
25072     Integer.max = max;
25073     Integer.min = min;
25074     Integer.gcd = gcd;
25075     Integer.lcm = lcm;
25076     Integer.isInstance = function(x) {
25077       return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt;
25078     };
25079     Integer.randBetween = randBetween;
25080     Integer.fromArray = function(digits, base, isNegative) {
25081       return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
25082     };
25083     return Integer;
25084   }();
25085   if (typeof module2 !== "undefined" && module2.hasOwnProperty("exports")) {
25086     module2.exports = bigInt;
25087   }
25088   if (typeof define === "function" && define.amd) {
25089     define(function() {
25090       return bigInt;
25091     });
25092   }
25093 });
25094
25095 // node_modules/unzipper/lib/Decrypt.js
25096 var require_Decrypt = __commonJS((exports2, module2) => {
25097   var bigInt = require_BigInteger();
25098   var Stream = require("stream");
25099   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
25100     Stream = require_readable();
25101   var table;
25102   function generateTable() {
25103     var poly = 3988292384, c, n, k;
25104     table = [];
25105     for (n = 0; n < 256; n++) {
25106       c = n;
25107       for (k = 0; k < 8; k++)
25108         c = c & 1 ? poly ^ c >>> 1 : c = c >>> 1;
25109       table[n] = c >>> 0;
25110     }
25111   }
25112   function crc(ch, crc2) {
25113     if (!table)
25114       generateTable();
25115     if (ch.charCodeAt)
25116       ch = ch.charCodeAt(0);
25117     return bigInt(crc2).shiftRight(8).and(16777215).xor(table[bigInt(crc2).xor(ch).and(255)]).value;
25118   }
25119   function Decrypt() {
25120     if (!(this instanceof Decrypt))
25121       return new Decrypt();
25122     this.key0 = 305419896;
25123     this.key1 = 591751049;
25124     this.key2 = 878082192;
25125   }
25126   Decrypt.prototype.update = function(h) {
25127     this.key0 = crc(h, this.key0);
25128     this.key1 = bigInt(this.key0).and(255).and(4294967295).add(this.key1);
25129     this.key1 = bigInt(this.key1).multiply(134775813).add(1).and(4294967295).value;
25130     this.key2 = crc(bigInt(this.key1).shiftRight(24).and(255), this.key2);
25131   };
25132   Decrypt.prototype.decryptByte = function(c) {
25133     var k = bigInt(this.key2).or(2);
25134     c = c ^ bigInt(k).multiply(bigInt(k ^ 1)).shiftRight(8).and(255);
25135     this.update(c);
25136     return c;
25137   };
25138   Decrypt.prototype.stream = function() {
25139     var stream = Stream.Transform(), self2 = this;
25140     stream._transform = function(d, e, cb) {
25141       for (var i = 0; i < d.length; i++) {
25142         d[i] = self2.decryptByte(d[i]);
25143       }
25144       this.push(d);
25145       cb();
25146     };
25147     return stream;
25148   };
25149   module2.exports = Decrypt;
25150 });
25151
25152 // node_modules/unzipper/lib/Open/unzip.js
25153 var require_unzip = __commonJS((exports2, module2) => {
25154   var Promise2 = require_bluebird();
25155   var Decrypt = require_Decrypt();
25156   var PullStream = require_PullStream();
25157   var Stream = require("stream");
25158   var binary = require_binary();
25159   var zlib = require("zlib");
25160   var parseExtraField = require_parseExtraField();
25161   var Buffer2 = require_Buffer();
25162   var parseDateTime = require_parseDateTime();
25163   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
25164     Stream = require_readable();
25165   module2.exports = function unzip(source, offset, _password, directoryVars) {
25166     var file = PullStream(), entry = Stream.PassThrough();
25167     var req = source.stream(offset);
25168     req.pipe(file).on("error", function(e) {
25169       entry.emit("error", e);
25170     });
25171     entry.vars = file.pull(30).then(function(data) {
25172       var vars = binary.parse(data).word32lu("signature").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;
25173       vars.lastModifiedDateTime = parseDateTime(vars.lastModifiedDate, vars.lastModifiedTime);
25174       return file.pull(vars.fileNameLength).then(function(fileName) {
25175         vars.fileName = fileName.toString("utf8");
25176         return file.pull(vars.extraFieldLength);
25177       }).then(function(extraField) {
25178         var checkEncryption;
25179         vars.extra = parseExtraField(extraField, vars);
25180         if (directoryVars && directoryVars.compressedSize)
25181           vars = directoryVars;
25182         if (vars.flags & 1)
25183           checkEncryption = file.pull(12).then(function(header) {
25184             if (!_password)
25185               throw new Error("MISSING_PASSWORD");
25186             var decrypt = Decrypt();
25187             String(_password).split("").forEach(function(d) {
25188               decrypt.update(d);
25189             });
25190             for (var i = 0; i < header.length; i++)
25191               header[i] = decrypt.decryptByte(header[i]);
25192             vars.decrypt = decrypt;
25193             vars.compressedSize -= 12;
25194             var check = vars.flags & 8 ? vars.lastModifiedTime >> 8 & 255 : vars.crc32 >> 24 & 255;
25195             if (header[11] !== check)
25196               throw new Error("BAD_PASSWORD");
25197             return vars;
25198           });
25199         return Promise2.resolve(checkEncryption).then(function() {
25200           entry.emit("vars", vars);
25201           return vars;
25202         });
25203       });
25204     });
25205     entry.vars.then(function(vars) {
25206       var fileSizeKnown = !(vars.flags & 8) || vars.compressedSize > 0, eof;
25207       var inflater = vars.compressionMethod ? zlib.createInflateRaw() : Stream.PassThrough();
25208       if (fileSizeKnown) {
25209         entry.size = vars.uncompressedSize;
25210         eof = vars.compressedSize;
25211       } else {
25212         eof = Buffer2.alloc(4);
25213         eof.writeUInt32LE(134695760, 0);
25214       }
25215       var stream = file.stream(eof);
25216       if (vars.decrypt)
25217         stream = stream.pipe(vars.decrypt.stream());
25218       stream.pipe(inflater).on("error", function(err) {
25219         entry.emit("error", err);
25220       }).pipe(entry).on("finish", function() {
25221         if (req.abort)
25222           req.abort();
25223         else if (req.close)
25224           req.close();
25225         else if (req.push)
25226           req.push();
25227         else
25228           console.log("warning - unable to close stream");
25229       });
25230     }).catch(function(e) {
25231       entry.emit("error", e);
25232     });
25233     return entry;
25234   };
25235 });
25236
25237 // node_modules/unzipper/lib/Open/directory.js
25238 var require_directory = __commonJS((exports2, module2) => {
25239   var binary = require_binary();
25240   var PullStream = require_PullStream();
25241   var unzip = require_unzip();
25242   var Promise2 = require_bluebird();
25243   var BufferStream = require_BufferStream();
25244   var parseExtraField = require_parseExtraField();
25245   var Buffer2 = require_Buffer();
25246   var path = require("path");
25247   var Writer = require_fstream().Writer;
25248   var parseDateTime = require_parseDateTime();
25249   var signature = Buffer2.alloc(4);
25250   signature.writeUInt32LE(101010256, 0);
25251   function getCrxHeader(source) {
25252     var sourceStream = source.stream(0).pipe(PullStream());
25253     return sourceStream.pull(4).then(function(data) {
25254       var signature2 = data.readUInt32LE(0);
25255       if (signature2 === 875721283) {
25256         var crxHeader;
25257         return sourceStream.pull(12).then(function(data2) {
25258           crxHeader = binary.parse(data2).word32lu("version").word32lu("pubKeyLength").word32lu("signatureLength").vars;
25259         }).then(function() {
25260           return sourceStream.pull(crxHeader.pubKeyLength + crxHeader.signatureLength);
25261         }).then(function(data2) {
25262           crxHeader.publicKey = data2.slice(0, crxHeader.pubKeyLength);
25263           crxHeader.signature = data2.slice(crxHeader.pubKeyLength);
25264           crxHeader.size = 16 + crxHeader.pubKeyLength + crxHeader.signatureLength;
25265           return crxHeader;
25266         });
25267       }
25268     });
25269   }
25270   function getZip64CentralDirectory(source, zip64CDL) {
25271     var d64loc = binary.parse(zip64CDL).word32lu("signature").word32lu("diskNumber").word64lu("offsetToStartOfCentralDirectory").word32lu("numberOfDisks").vars;
25272     if (d64loc.signature != 117853008) {
25273       throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x" + d64loc.signature.toString(16));
25274     }
25275     var dir64 = PullStream();
25276     source.stream(d64loc.offsetToStartOfCentralDirectory).pipe(dir64);
25277     return dir64.pull(56);
25278   }
25279   function parseZip64DirRecord(dir64record) {
25280     var vars = binary.parse(dir64record).word32lu("signature").word64lu("sizeOfCentralDirectory").word16lu("version").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskStart").word64lu("numberOfRecordsOnDisk").word64lu("numberOfRecords").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;
25281     if (vars.signature != 101075792) {
25282       throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0" + vars.signature.toString(16));
25283     }
25284     return vars;
25285   }
25286   module2.exports = function centralDirectory(source, options) {
25287     var endDir = PullStream(), records = PullStream(), tailSize = options && options.tailSize || 80, sourceSize, crxHeader, startOffset, vars;
25288     if (options && options.crx)
25289       crxHeader = getCrxHeader(source);
25290     return source.size().then(function(size) {
25291       sourceSize = size;
25292       source.stream(Math.max(0, size - tailSize)).on("error", function(error) {
25293         endDir.emit("error", error);
25294       }).pipe(endDir);
25295       return endDir.pull(signature);
25296     }).then(function() {
25297       return Promise2.props({directory: endDir.pull(22), crxHeader});
25298     }).then(function(d) {
25299       var data = d.directory;
25300       startOffset = d.crxHeader && d.crxHeader.size || 0;
25301       vars = binary.parse(data).word32lu("signature").word16lu("diskNumber").word16lu("diskStart").word16lu("numberOfRecordsOnDisk").word16lu("numberOfRecords").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;
25302       if (vars.numberOfRecords == 65535 || vars.numberOfRecords == 65535 || vars.offsetToStartOfCentralDirectory == 4294967295) {
25303         const zip64CDLSize = 20;
25304         const zip64CDLOffset = sourceSize - (tailSize - endDir.match + zip64CDLSize);
25305         const zip64CDLStream = PullStream();
25306         source.stream(zip64CDLOffset).pipe(zip64CDLStream);
25307         return zip64CDLStream.pull(zip64CDLSize).then(function(d2) {
25308           return getZip64CentralDirectory(source, d2);
25309         }).then(function(dir64record) {
25310           vars = parseZip64DirRecord(dir64record);
25311         });
25312       } else {
25313         vars.offsetToStartOfCentralDirectory += startOffset;
25314       }
25315     }).then(function() {
25316       source.stream(vars.offsetToStartOfCentralDirectory).pipe(records);
25317       vars.extract = function(opts) {
25318         if (!opts || !opts.path)
25319           throw new Error("PATH_MISSING");
25320         return vars.files.then(function(files) {
25321           return Promise2.map(files, function(entry) {
25322             if (entry.type == "Directory")
25323               return;
25324             var extractPath = path.join(opts.path, entry.path);
25325             if (extractPath.indexOf(opts.path) != 0) {
25326               return;
25327             }
25328             var writer = opts.getWriter ? opts.getWriter({path: extractPath}) : Writer({path: extractPath});
25329             return new Promise2(function(resolve, reject) {
25330               entry.stream(opts.password).on("error", reject).pipe(writer).on("close", resolve).on("error", reject);
25331             });
25332           }, opts.concurrency > 1 ? {concurrency: opts.concurrency || void 0} : void 0);
25333         });
25334       };
25335       vars.files = Promise2.mapSeries(Array(vars.numberOfRecords), function() {
25336         return records.pull(46).then(function(data) {
25337           var vars2 = binary.parse(data).word32lu("signature").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;
25338           vars2.offsetToLocalFileHeader += startOffset;
25339           vars2.lastModifiedDateTime = parseDateTime(vars2.lastModifiedDate, vars2.lastModifiedTime);
25340           return records.pull(vars2.fileNameLength).then(function(fileNameBuffer) {
25341             vars2.pathBuffer = fileNameBuffer;
25342             vars2.path = fileNameBuffer.toString("utf8");
25343             vars2.isUnicode = vars2.flags & 17;
25344             return records.pull(vars2.extraFieldLength);
25345           }).then(function(extraField) {
25346             vars2.extra = parseExtraField(extraField, vars2);
25347             return records.pull(vars2.fileCommentLength);
25348           }).then(function(comment) {
25349             vars2.comment = comment;
25350             vars2.type = vars2.uncompressedSize === 0 && /[\/\\]$/.test(vars2.path) ? "Directory" : "File";
25351             vars2.stream = function(_password) {
25352               return unzip(source, vars2.offsetToLocalFileHeader, _password, vars2);
25353             };
25354             vars2.buffer = function(_password) {
25355               return BufferStream(vars2.stream(_password));
25356             };
25357             return vars2;
25358           });
25359         });
25360       });
25361       return Promise2.props(vars);
25362     });
25363   };
25364 });
25365
25366 // node_modules/unzipper/lib/Open/index.js
25367 var require_Open = __commonJS((exports2, module2) => {
25368   var fs = require_graceful_fs();
25369   var Promise2 = require_bluebird();
25370   var directory = require_directory();
25371   var Stream = require("stream");
25372   if (!Stream.Writable || !Stream.Writable.prototype.destroy)
25373     Stream = require_readable();
25374   module2.exports = {
25375     buffer: function(buffer, options) {
25376       var source = {
25377         stream: function(offset, length) {
25378           var stream = Stream.PassThrough();
25379           stream.end(buffer.slice(offset, length));
25380           return stream;
25381         },
25382         size: function() {
25383           return Promise2.resolve(buffer.length);
25384         }
25385       };
25386       return directory(source, options);
25387     },
25388     file: function(filename, options) {
25389       var source = {
25390         stream: function(offset, length) {
25391           return fs.createReadStream(filename, {start: offset, end: length && offset + length});
25392         },
25393         size: function() {
25394           return new Promise2(function(resolve, reject) {
25395             fs.stat(filename, function(err, d) {
25396               if (err)
25397                 reject(err);
25398               else
25399                 resolve(d.size);
25400             });
25401           });
25402         }
25403       };
25404       return directory(source, options);
25405     },
25406     url: function(request, params, options) {
25407       if (typeof params === "string")
25408         params = {url: params};
25409       if (!params.url)
25410         throw "URL missing";
25411       params.headers = params.headers || {};
25412       var source = {
25413         stream: function(offset, length) {
25414           var options2 = Object.create(params);
25415           options2.headers = Object.create(params.headers);
25416           options2.headers.range = "bytes=" + offset + "-" + (length ? length : "");
25417           return request(options2);
25418         },
25419         size: function() {
25420           return new Promise2(function(resolve, reject) {
25421             var req = request(params);
25422             req.on("response", function(d) {
25423               req.abort();
25424               if (!d.headers["content-length"])
25425                 reject(new Error("Missing content length header"));
25426               else
25427                 resolve(d.headers["content-length"]);
25428             }).on("error", reject);
25429           });
25430         }
25431       };
25432       return directory(source, options);
25433     },
25434     s3: function(client, params, options) {
25435       var source = {
25436         size: function() {
25437           return new Promise2(function(resolve, reject) {
25438             client.headObject(params, function(err, d) {
25439               if (err)
25440                 reject(err);
25441               else
25442                 resolve(d.ContentLength);
25443             });
25444           });
25445         },
25446         stream: function(offset, length) {
25447           var d = {};
25448           for (var key in params)
25449             d[key] = params[key];
25450           d.Range = "bytes=" + offset + "-" + (length ? length : "");
25451           return client.getObject(d).createReadStream();
25452         }
25453       };
25454       return directory(source, options);
25455     }
25456   };
25457 });
25458
25459 // node_modules/unzipper/unzip.js
25460 var require_unzip2 = __commonJS((exports2) => {
25461   "use strict";
25462   require_listenercount();
25463   require_buffer_indexof_polyfill();
25464   require_setImmediate();
25465   exports2.Parse = require_parse3();
25466   exports2.ParseOne = require_parseOne();
25467   exports2.Extract = require_extract();
25468   exports2.Open = require_Open();
25469 });
25470
25471 // node_modules/isexe/windows.js
25472 var require_windows = __commonJS((exports2, module2) => {
25473   module2.exports = isexe;
25474   isexe.sync = sync;
25475   var fs = require("fs");
25476   function checkPathExt(path, options) {
25477     var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
25478     if (!pathext) {
25479       return true;
25480     }
25481     pathext = pathext.split(";");
25482     if (pathext.indexOf("") !== -1) {
25483       return true;
25484     }
25485     for (var i = 0; i < pathext.length; i++) {
25486       var p = pathext[i].toLowerCase();
25487       if (p && path.substr(-p.length).toLowerCase() === p) {
25488         return true;
25489       }
25490     }
25491     return false;
25492   }
25493   function checkStat(stat, path, options) {
25494     if (!stat.isSymbolicLink() && !stat.isFile()) {
25495       return false;
25496     }
25497     return checkPathExt(path, options);
25498   }
25499   function isexe(path, options, cb) {
25500     fs.stat(path, function(er, stat) {
25501       cb(er, er ? false : checkStat(stat, path, options));
25502     });
25503   }
25504   function sync(path, options) {
25505     return checkStat(fs.statSync(path), path, options);
25506   }
25507 });
25508
25509 // node_modules/isexe/mode.js
25510 var require_mode = __commonJS((exports2, module2) => {
25511   module2.exports = isexe;
25512   isexe.sync = sync;
25513   var fs = require("fs");
25514   function isexe(path, options, cb) {
25515     fs.stat(path, function(er, stat) {
25516       cb(er, er ? false : checkStat(stat, options));
25517     });
25518   }
25519   function sync(path, options) {
25520     return checkStat(fs.statSync(path), options);
25521   }
25522   function checkStat(stat, options) {
25523     return stat.isFile() && checkMode(stat, options);
25524   }
25525   function checkMode(stat, options) {
25526     var mod = stat.mode;
25527     var uid = stat.uid;
25528     var gid = stat.gid;
25529     var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
25530     var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
25531     var u = parseInt("100", 8);
25532     var g = parseInt("010", 8);
25533     var o = parseInt("001", 8);
25534     var ug = u | g;
25535     var ret2 = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
25536     return ret2;
25537   }
25538 });
25539
25540 // node_modules/isexe/index.js
25541 var require_isexe = __commonJS((exports2, module2) => {
25542   var fs = require("fs");
25543   var core;
25544   if (process.platform === "win32" || global.TESTING_WINDOWS) {
25545     core = require_windows();
25546   } else {
25547     core = require_mode();
25548   }
25549   module2.exports = isexe;
25550   isexe.sync = sync;
25551   function isexe(path, options, cb) {
25552     if (typeof options === "function") {
25553       cb = options;
25554       options = {};
25555     }
25556     if (!cb) {
25557       if (typeof Promise !== "function") {
25558         throw new TypeError("callback not provided");
25559       }
25560       return new Promise(function(resolve, reject) {
25561         isexe(path, options || {}, function(er, is) {
25562           if (er) {
25563             reject(er);
25564           } else {
25565             resolve(is);
25566           }
25567         });
25568       });
25569     }
25570     core(path, options || {}, function(er, is) {
25571       if (er) {
25572         if (er.code === "EACCES" || options && options.ignoreErrors) {
25573           er = null;
25574           is = false;
25575         }
25576       }
25577       cb(er, is);
25578     });
25579   }
25580   function sync(path, options) {
25581     try {
25582       return core.sync(path, options || {});
25583     } catch (er) {
25584       if (options && options.ignoreErrors || er.code === "EACCES") {
25585         return false;
25586       } else {
25587         throw er;
25588       }
25589     }
25590   }
25591 });
25592
25593 // node_modules/which/which.js
25594 var require_which = __commonJS((exports2, module2) => {
25595   var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
25596   var path = require("path");
25597   var COLON = isWindows ? ";" : ":";
25598   var isexe = require_isexe();
25599   var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), {code: "ENOENT"});
25600   var getPathInfo = (cmd, opt) => {
25601     const colon = opt.colon || COLON;
25602     const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
25603       ...isWindows ? [process.cwd()] : [],
25604       ...(opt.path || process.env.PATH || "").split(colon)
25605     ];
25606     const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
25607     const pathExt = isWindows ? pathExtExe.split(colon) : [""];
25608     if (isWindows) {
25609       if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
25610         pathExt.unshift("");
25611     }
25612     return {
25613       pathEnv,
25614       pathExt,
25615       pathExtExe
25616     };
25617   };
25618   var which = (cmd, opt, cb) => {
25619     if (typeof opt === "function") {
25620       cb = opt;
25621       opt = {};
25622     }
25623     if (!opt)
25624       opt = {};
25625     const {pathEnv, pathExt, pathExtExe} = getPathInfo(cmd, opt);
25626     const found = [];
25627     const step = (i) => new Promise((resolve, reject) => {
25628       if (i === pathEnv.length)
25629         return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
25630       const ppRaw = pathEnv[i];
25631       const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
25632       const pCmd = path.join(pathPart, cmd);
25633       const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
25634       resolve(subStep(p, i, 0));
25635     });
25636     const subStep = (p, i, ii) => new Promise((resolve, reject) => {
25637       if (ii === pathExt.length)
25638         return resolve(step(i + 1));
25639       const ext = pathExt[ii];
25640       isexe(p + ext, {pathExt: pathExtExe}, (er, is) => {
25641         if (!er && is) {
25642           if (opt.all)
25643             found.push(p + ext);
25644           else
25645             return resolve(p + ext);
25646         }
25647         return resolve(subStep(p, i, ii + 1));
25648       });
25649     });
25650     return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
25651   };
25652   var whichSync = (cmd, opt) => {
25653     opt = opt || {};
25654     const {pathEnv, pathExt, pathExtExe} = getPathInfo(cmd, opt);
25655     const found = [];
25656     for (let i = 0; i < pathEnv.length; i++) {
25657       const ppRaw = pathEnv[i];
25658       const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
25659       const pCmd = path.join(pathPart, cmd);
25660       const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
25661       for (let j = 0; j < pathExt.length; j++) {
25662         const cur = p + pathExt[j];
25663         try {
25664           const is = isexe.sync(cur, {pathExt: pathExtExe});
25665           if (is) {
25666             if (opt.all)
25667               found.push(cur);
25668             else
25669               return cur;
25670           }
25671         } catch (ex) {
25672         }
25673       }
25674     }
25675     if (opt.all && found.length)
25676       return found;
25677     if (opt.nothrow)
25678       return null;
25679     throw getNotFoundError(cmd);
25680   };
25681   module2.exports = which;
25682   which.sync = whichSync;
25683 });
25684
25685 // node_modules/@clangd/install/out/src/index.js
25686 var require_src = __commonJS((exports2) => {
25687   "use strict";
25688   var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
25689     function adopt(value) {
25690       return value instanceof P ? value : new P(function(resolve) {
25691         resolve(value);
25692       });
25693     }
25694     return new (P || (P = Promise))(function(resolve, reject) {
25695       function fulfilled(value) {
25696         try {
25697           step(generator.next(value));
25698         } catch (e) {
25699           reject(e);
25700         }
25701       }
25702       function rejected(value) {
25703         try {
25704           step(generator["throw"](value));
25705         } catch (e) {
25706           reject(e);
25707         }
25708       }
25709       function step(result) {
25710         result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
25711       }
25712       step((generator = generator.apply(thisArg, _arguments || [])).next());
25713     });
25714   };
25715   var __asyncValues = exports2 && exports2.__asyncValues || function(o) {
25716     if (!Symbol.asyncIterator)
25717       throw new TypeError("Symbol.asyncIterator is not defined.");
25718     var m = o[Symbol.asyncIterator], i;
25719     return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
25720       return this;
25721     }, i);
25722     function verb(n) {
25723       i[n] = o[n] && function(v) {
25724         return new Promise(function(resolve, reject) {
25725           v = o[n](v), settle(resolve, reject, v.done, v.value);
25726         });
25727       };
25728     }
25729     function settle(resolve, reject, d, v) {
25730       Promise.resolve(v).then(function(v2) {
25731         resolve({value: v2, done: d});
25732       }, reject);
25733     }
25734   };
25735   Object.defineProperty(exports2, "__esModule", {value: true});
25736   var abort_controller_1 = require_abort_controller();
25737   var child_process = require("child_process");
25738   var fs = require("fs");
25739   var node_fetch_1 = require_lib();
25740   var os = require("os");
25741   var path = require("path");
25742   var readdirp = require_readdirp();
25743   var rimraf = require_rimraf();
25744   var semver = require_semver2();
25745   var stream = require("stream");
25746   var unzipper = require_unzip2();
25747   var util_1 = require("util");
25748   var which = require_which();
25749   function prepare2(ui, checkUpdate) {
25750     return __awaiter(this, void 0, void 0, function* () {
25751       try {
25752         var absPath = yield util_1.promisify(which)(ui.clangdPath);
25753       } catch (e) {
25754         return {clangdPath: null, background: recover(ui)};
25755       }
25756       return {
25757         clangdPath: absPath,
25758         background: checkUpdate ? checkUpdates2(false, ui) : Promise.resolve()
25759       };
25760     });
25761   }
25762   exports2.prepare = prepare2;
25763   function installLatest2(ui) {
25764     return __awaiter(this, void 0, void 0, function* () {
25765       const abort = new abort_controller_1.AbortController();
25766       try {
25767         const release = yield Github.latestRelease();
25768         const asset = yield Github.chooseAsset(release);
25769         ui.clangdPath = yield Install.install(release, asset, abort, ui);
25770         ui.promptReload(`clangd ${release.name} is now installed.`);
25771       } catch (e) {
25772         if (!abort.signal.aborted) {
25773           console.error("Failed to install clangd: ", e);
25774           const message = `Failed to install clangd language server: ${e}
25775 You may want to install it manually.`;
25776           ui.showHelp(message, installURL);
25777         }
25778       }
25779     });
25780   }
25781   exports2.installLatest = installLatest2;
25782   function checkUpdates2(requested, ui) {
25783     return __awaiter(this, void 0, void 0, function* () {
25784       try {
25785         var release = yield Github.latestRelease();
25786         yield Github.chooseAsset(release);
25787         var upgrade = yield Version.upgrade(release, ui.clangdPath);
25788       } catch (e) {
25789         console.log("Failed to check for clangd update: ", e);
25790         if (requested)
25791           ui.error(`Failed to check for clangd update: ${e}`);
25792         return;
25793       }
25794       console.log("Checking for clangd update: available=", upgrade.new, " installed=", upgrade.old);
25795       if (!upgrade.upgrade) {
25796         if (requested)
25797           ui.info(`clangd is up-to-date (you have ${upgrade.old}, latest is ${upgrade.new})`);
25798         return;
25799       }
25800       ui.promptUpdate(upgrade.old, upgrade.new);
25801     });
25802   }
25803   exports2.checkUpdates = checkUpdates2;
25804   function recover(ui) {
25805     return __awaiter(this, void 0, void 0, function* () {
25806       try {
25807         const release = yield Github.latestRelease();
25808         yield Github.chooseAsset(release);
25809         ui.promptInstall(release.name);
25810       } catch (e) {
25811         console.error("Auto-install failed: ", e);
25812         ui.showHelp("The clangd language server is not installed.", installURL);
25813       }
25814     });
25815   }
25816   var installURL = "https://clangd.llvm.org/installation.html";
25817   var githubReleaseURL = "https://api.github.com/repos/clangd/clangd/releases/latest";
25818   function fakeGitHubReleaseURL(u) {
25819     githubReleaseURL = u;
25820   }
25821   exports2.fakeGitHubReleaseURL = fakeGitHubReleaseURL;
25822   var lddCommand = "ldd";
25823   function fakeLddCommand(l) {
25824     lddCommand = l;
25825   }
25826   exports2.fakeLddCommand = fakeLddCommand;
25827   var Github;
25828   (function(Github2) {
25829     function latestRelease() {
25830       return __awaiter(this, void 0, void 0, function* () {
25831         const response = yield node_fetch_1.default(githubReleaseURL);
25832         if (!response.ok) {
25833           console.log(response.url, response.status, response.statusText);
25834           throw new Error(`Can't fetch release: ${response.statusText}`);
25835         }
25836         return yield response.json();
25837       });
25838     }
25839     Github2.latestRelease = latestRelease;
25840     function chooseAsset(release) {
25841       return __awaiter(this, void 0, void 0, function* () {
25842         const variants = {
25843           win32: "windows",
25844           linux: "linux",
25845           darwin: "mac"
25846         };
25847         const variant = variants[os.platform()];
25848         if (variant == "linux") {
25849           const minGlibc = new semver.Range("2.18");
25850           const oldGlibc = yield Version.oldGlibc(minGlibc);
25851           if (oldGlibc) {
25852             throw new Error(`The clangd release is not compatible with your system (glibc ${oldGlibc.raw} < ${minGlibc.raw}). Try to install it using your package manager instead.`);
25853           }
25854         }
25855         if (variant && (os.arch() == "x64" || variant == "windows")) {
25856           const asset = release.assets.find((a) => a.name.indexOf(variant) >= 0);
25857           if (asset)
25858             return asset;
25859         }
25860         throw new Error(`No clangd ${release.name} binary available for ${os.platform()}/${os.arch()}`);
25861       });
25862     }
25863     Github2.chooseAsset = chooseAsset;
25864   })(Github || (Github = {}));
25865   var Install;
25866   (function(Install2) {
25867     function install2(release, asset, abort, ui) {
25868       return __awaiter(this, void 0, void 0, function* () {
25869         const dirs = yield createDirs(ui);
25870         const extractRoot = path.join(dirs.install, release.tag_name);
25871         if (yield util_1.promisify(fs.exists)(extractRoot)) {
25872           const reuse = yield ui.shouldReuse(release.name);
25873           if (reuse === void 0) {
25874             abort.abort();
25875             throw new Error(`clangd ${release.name} already installed!`);
25876           }
25877           if (reuse) {
25878             let files = (yield readdirp.promise(extractRoot)).map((e) => e.fullPath);
25879             return findExecutable(files);
25880           } else {
25881             yield util_1.promisify(rimraf)(extractRoot);
25882           }
25883         }
25884         const zipFile = path.join(dirs.download, asset.name);
25885         yield download(asset.browser_download_url, zipFile, abort, ui);
25886         const archive = yield unzipper.Open.file(zipFile);
25887         const executable = findExecutable(archive.files.map((f) => f.path));
25888         yield ui.slow(`Extracting ${asset.name}`, archive.extract({path: extractRoot}));
25889         const clangdPath = path.join(extractRoot, executable);
25890         yield fs.promises.chmod(clangdPath, 493);
25891         yield fs.promises.unlink(zipFile);
25892         return clangdPath;
25893       });
25894     }
25895     Install2.install = install2;
25896     function createDirs(ui) {
25897       return __awaiter(this, void 0, void 0, function* () {
25898         const install3 = path.join(ui.storagePath, "install");
25899         const download2 = path.join(ui.storagePath, "download");
25900         for (const dir of [install3, download2])
25901           yield fs.promises.mkdir(dir, {recursive: true});
25902         return {install: install3, download: download2};
25903       });
25904     }
25905     function findExecutable(paths) {
25906       const filename = os.platform() == "win32" ? "clangd.exe" : "clangd";
25907       const entry = paths.find((f) => path.posix.basename(f) == filename || path.win32.basename(f) == filename);
25908       if (entry == null)
25909         throw new Error("Didn't find a clangd executable!");
25910       return entry;
25911     }
25912     function download(url, dest, abort, ui) {
25913       return __awaiter(this, void 0, void 0, function* () {
25914         console.log("Downloading ", url, " to ", dest);
25915         return ui.progress(`Downloading ${path.basename(dest)}`, abort, (progress) => __awaiter(this, void 0, void 0, function* () {
25916           const response = yield node_fetch_1.default(url, {signal: abort.signal});
25917           if (!response.ok)
25918             throw new Error(`Failed to download $url`);
25919           const size = Number(response.headers.get("content-length"));
25920           let read = 0;
25921           response.body.on("data", (chunk) => {
25922             read += chunk.length;
25923             progress(read / size);
25924           });
25925           const out = fs.createWriteStream(dest);
25926           yield util_1.promisify(stream.pipeline)(response.body, out).catch((e) => {
25927             fs.unlink(dest, (_) => null);
25928             throw e;
25929           });
25930         }));
25931       });
25932     }
25933   })(Install || (Install = {}));
25934   var Version;
25935   (function(Version2) {
25936     function upgrade(release, clangdPath) {
25937       return __awaiter(this, void 0, void 0, function* () {
25938         const releasedVer = released(release);
25939         const installedVer = yield installed(clangdPath);
25940         return {
25941           old: installedVer.raw,
25942           new: releasedVer.raw,
25943           upgrade: rangeGreater(releasedVer, installedVer)
25944         };
25945       });
25946     }
25947     Version2.upgrade = upgrade;
25948     const loose = {
25949       loose: true
25950     };
25951     function installed(clangdPath) {
25952       return __awaiter(this, void 0, void 0, function* () {
25953         const output = yield run(clangdPath, ["--version"]);
25954         console.log(clangdPath, " --version output: ", output);
25955         const prefix = "clangd version ";
25956         if (!output.startsWith(prefix))
25957           throw new Error(`Couldn't parse clangd --version output: ${output}`);
25958         const rawVersion = output.substr(prefix.length).split(" ", 1)[0];
25959         return new semver.Range(rawVersion, loose);
25960       });
25961     }
25962     function released(release) {
25963       return !semver.validRange(release.tag_name, loose) && semver.validRange(release.name, loose) ? new semver.Range(release.name, loose) : new semver.Range(release.tag_name, loose);
25964     }
25965     function oldGlibc(min) {
25966       return __awaiter(this, void 0, void 0, function* () {
25967         const output = yield run(lddCommand, ["--version"]);
25968         const line = output.split("\n", 1)[0];
25969         const match = line.match(/^ldd .*glibc.* (\d+(?:\.\d+)+)[^ ]*$/i);
25970         if (!match || !semver.validRange(match[1], loose)) {
25971           console.error(`Can't glibc version from ldd --version output: ${line}`);
25972           return null;
25973         }
25974         const version = new semver.Range(match[1], loose);
25975         console.log("glibc is", version.raw, "min is", min.raw);
25976         return rangeGreater(min, version) ? version : null;
25977       });
25978     }
25979     Version2.oldGlibc = oldGlibc;
25980     function run(command, flags) {
25981       var e_1, _a;
25982       return __awaiter(this, void 0, void 0, function* () {
25983         const child = child_process.spawn(command, flags, {stdio: ["ignore", "pipe", "ignore"]});
25984         let output = "";
25985         try {
25986           for (var _b = __asyncValues(child.stdout), _c; _c = yield _b.next(), !_c.done; ) {
25987             const chunk = _c.value;
25988             output += chunk;
25989           }
25990         } catch (e_1_1) {
25991           e_1 = {error: e_1_1};
25992         } finally {
25993           try {
25994             if (_c && !_c.done && (_a = _b.return))
25995               yield _a.call(_b);
25996           } finally {
25997             if (e_1)
25998               throw e_1.error;
25999           }
26000         }
26001         return output;
26002       });
26003     }
26004     function rangeGreater(newVer, oldVer) {
26005       return semver.gtr(semver.minVersion(newVer), oldVer);
26006     }
26007   })(Version || (Version = {}));
26008 });
26009
26010 // src/index.ts
26011 __markAsModule(exports);
26012 __export(exports, {
26013   activate: () => activate2
26014 });
26015 var import_coc7 = __toModule(require("coc.nvim"));
26016
26017 // src/cmds.ts
26018 var import_coc = __toModule(require("coc.nvim"));
26019 var import_vscode_languageserver_protocol = __toModule(require_main3());
26020 var SwitchSourceHeaderRequest;
26021 (function(SwitchSourceHeaderRequest2) {
26022   SwitchSourceHeaderRequest2.type = new import_vscode_languageserver_protocol.RequestType("textDocument/switchSourceHeader");
26023 })(SwitchSourceHeaderRequest || (SwitchSourceHeaderRequest = {}));
26024 var SymbolInfoRequest;
26025 (function(SymbolInfoRequest2) {
26026   SymbolInfoRequest2.type = new import_vscode_languageserver_protocol.RequestType("textDocument/symbolInfo");
26027 })(SymbolInfoRequest || (SymbolInfoRequest = {}));
26028 function switchSourceHeader(ctx) {
26029   return async () => {
26030     if (!ctx.client) {
26031       return;
26032     }
26033     const doc = await import_coc.workspace.document;
26034     if (!doc) {
26035       return;
26036     }
26037     const params = {
26038       uri: doc.uri
26039     };
26040     const dest = await ctx.client.sendRequest(SwitchSourceHeaderRequest.type.method, params);
26041     if (!dest) {
26042       import_coc.window.showMessage(`Didn't find a corresponding file.`);
26043       return;
26044     }
26045     await import_coc.workspace.jumpTo(dest);
26046   };
26047 }
26048 function symbolInfo(ctx) {
26049   return async () => {
26050     if (!ctx.client) {
26051       return;
26052     }
26053     const doc = await import_coc.workspace.document;
26054     if (!doc) {
26055       return;
26056     }
26057     const position = await import_coc.window.getCursorPosition();
26058     const params = {
26059       textDocument: {uri: doc.uri},
26060       position
26061     };
26062     const details = await ctx.client.sendRequest(SymbolInfoRequest.type.method, params);
26063     if (!details.length) {
26064       return;
26065     }
26066     const detail = details[0];
26067     import_coc.window.showMessage(`name: ${detail.name}, containerName: ${detail.containerName}, usr: ${detail.usr}`);
26068   };
26069 }
26070
26071 // src/ctx.ts
26072 var import_coc4 = __toModule(require("coc.nvim"));
26073
26074 // src/config.ts
26075 var import_coc2 = __toModule(require("coc.nvim"));
26076 var Config = class {
26077   constructor() {
26078     this.cfg = import_coc2.workspace.getConfiguration("clangd");
26079   }
26080   get enabled() {
26081     return this.cfg.get("enabled");
26082   }
26083   get disableDiagnostics() {
26084     return this.cfg.get("disableDiagnostics");
26085   }
26086   get disableSnippetCompletion() {
26087     return this.cfg.get("disableSnippetCompletion");
26088   }
26089   get disableCompletion() {
26090     return this.cfg.get("disableCompletion");
26091   }
26092   get arguments() {
26093     return this.cfg.get("arguments", []);
26094   }
26095   get trace() {
26096     return this.cfg.get("trace", "");
26097   }
26098   get fallbackFlags() {
26099     return this.cfg.get("fallbackFlags", []);
26100   }
26101   get semanticHighlighting() {
26102     return this.cfg.get("semanticHighlighting");
26103   }
26104   get showDBChangedNotification() {
26105     return this.cfg.get("showDBChangedNotification");
26106   }
26107   get compilationDatabasePath() {
26108     return this.cfg.get("compilationDatabasePath");
26109   }
26110   get serverCompletionRanking() {
26111     return this.cfg.get("serverCompletionRanking");
26112   }
26113 };
26114
26115 // src/semantic-highlighting.ts
26116 var import_coc3 = __toModule(require("coc.nvim"));
26117 var import_vscode_languageserver_protocol2 = __toModule(require_main3());
26118 var SemanticHighlightingFeature = class {
26119   constructor(client, context) {
26120     this.scopeTable = [];
26121     this.bufTokens = {};
26122     context.subscriptions.push(client.onDidChangeState(({newState}) => {
26123       if (newState === import_coc3.State.Running) {
26124         const notification = new import_vscode_languageserver_protocol2.NotificationType("textDocument/semanticHighlighting");
26125         client.onNotification(notification, this.handleNotification.bind(this));
26126       }
26127     }));
26128   }
26129   dispose() {
26130   }
26131   initialize(capabilities) {
26132     const serverCapabilities = capabilities;
26133     if (!serverCapabilities.semanticHighlighting)
26134       return;
26135     this.scopeTable = serverCapabilities.semanticHighlighting.scopes;
26136   }
26137   fillClientCapabilities(capabilities) {
26138     const textDocumentCapabilities = capabilities.textDocument;
26139     textDocumentCapabilities.semanticHighlightingCapabilities = {
26140       semanticHighlighting: true
26141     };
26142   }
26143   async handleNotification(params) {
26144     const doc = import_coc3.workspace.getDocument(params.textDocument.uri);
26145     if (!(doc.bufnr in this.bufTokens))
26146       this.bufTokens[doc.bufnr] = [];
26147     const lines = this.bufTokens[doc.bufnr];
26148     for (const line of params.lines) {
26149       while (line.line >= lines.length)
26150         lines.push([]);
26151       lines[line.line] = this.decodeTokens(line.tokens);
26152     }
26153     const symbols = [];
26154     const skipped = [];
26155     for (const [line, tokens] of lines.entries()) {
26156       for (const token of tokens) {
26157         if (token.kind === "InactiveCode") {
26158           skipped.push(import_vscode_languageserver_protocol2.Range.create(line, token.character, line, token.character + token.length));
26159         } else {
26160           symbols.push({
26161             id: 0,
26162             kind: token.kind,
26163             ranges: [import_vscode_languageserver_protocol2.Range.create(line, token.character, line, token.character + token.length)],
26164             parentKind: "Unknown",
26165             storage: "None"
26166           });
26167         }
26168       }
26169     }
26170     await import_coc3.workspace.nvim.call("lsp_cxx_hl#hl#notify_symbols", [doc.bufnr, symbols]);
26171     if (skipped.length) {
26172       await import_coc3.workspace.nvim.call("lsp_cxx_hl#hl#notify_skipped", [doc.bufnr, skipped]);
26173     }
26174   }
26175   decodeTokens(tokens) {
26176     const scopeMask = 65535;
26177     const lenShift = 16;
26178     const uint32Size = 4;
26179     const buf = Buffer.from(tokens, "base64");
26180     const retTokens = [];
26181     for (let i = 0, end = buf.length / uint32Size; i < end; i += 2) {
26182       const start = buf.readUInt32BE(i * uint32Size);
26183       const lenKind = buf.readUInt32BE((i + 1) * uint32Size);
26184       const scopeIndex = lenKind & scopeMask;
26185       const len = lenKind >>> lenShift;
26186       const kind = this.scopeTable[scopeIndex][0];
26187       retTokens.push({character: start, scopeIndex, length: len, kind: this.decodeKind(kind)});
26188     }
26189     return retTokens;
26190   }
26191   decodeKind(kind) {
26192     switch (kind) {
26193       case "entity.name.function.cpp":
26194         return "Function";
26195       case "entity.name.function.method.cpp":
26196         return "Method";
26197       case "entity.name.function.method.static.cpp":
26198         return "StaticMethod";
26199       case "variable.other.cpp":
26200         return "Variable";
26201       case "variable.other.local.cpp":
26202         return "LocalVariable";
26203       case "variable.parameter.cpp":
26204         return "Parameter";
26205       case "variable.other.field.cpp":
26206         return "Field";
26207       case "variable.other.field.static.cpp":
26208         return "StaticField";
26209       case "entity.name.type.class.cpp":
26210         return "Class";
26211       case "entity.name.type.enum.cpp":
26212         return "Enum";
26213       case "variable.other.enummember.cpp":
26214         return "EnumConstant";
26215       case "entity.name.type.typedef.cpp":
26216         return "Typedef";
26217       case "entity.name.type.dependent.cpp":
26218         return "DependentType";
26219       case "entity.name.other.dependent.cpp":
26220         return "DependentName";
26221       case "entity.name.namespace.cpp":
26222         return "Namespace";
26223       case "entity.name.type.template.cpp":
26224         return "TemplateParameter";
26225       case "entity.name.type.concept.cpp":
26226         return "Concept";
26227       case "storage.type.primitive.cpp":
26228         return "Primitive";
26229       case "entity.name.function.preprocessor.cpp":
26230         return "Macro";
26231       case "meta.disabled":
26232         return "InactiveCode";
26233       default:
26234         return "Unknown";
26235     }
26236   }
26237 };
26238
26239 // src/ctx.ts
26240 var ClangdExtensionFeature = class {
26241   constructor() {
26242   }
26243   dispose() {
26244   }
26245   initialize() {
26246   }
26247   fillClientCapabilities(capabilities) {
26248     const extendedCompletionCapabilities = capabilities.textDocument.completion;
26249     if (extendedCompletionCapabilities) {
26250       extendedCompletionCapabilities.editsNearCursor = true;
26251     }
26252   }
26253 };
26254 var Ctx = class {
26255   constructor(context) {
26256     this.context = context;
26257     this.client = null;
26258     this.config = new Config();
26259   }
26260   async startServer(bin, ...features) {
26261     const old = this.client;
26262     if (old) {
26263       await old.stop();
26264     }
26265     const exec = {
26266       command: bin,
26267       args: this.config.arguments
26268     };
26269     if (!!this.config.trace) {
26270       exec.options = {env: {CLANGD_TRACE: this.config.trace}};
26271     }
26272     const serverOptions = exec;
26273     const outputChannel = import_coc4.window.createOutputChannel("clangd");
26274     const initializationOptions = {clangdFileStatus: true, fallbackFlags: this.config.fallbackFlags};
26275     if (this.config.compilationDatabasePath) {
26276       initializationOptions.compilationDatabasePath = this.config.compilationDatabasePath;
26277     }
26278     const clientOptions = {
26279       documentSelector: [
26280         {scheme: "file", language: "c"},
26281         {scheme: "file", language: "cpp"},
26282         {scheme: "file", language: "objc"},
26283         {scheme: "file", language: "objcpp"},
26284         {scheme: "file", language: "objective-c"},
26285         {scheme: "file", language: "objective-cpp"},
26286         {scheme: "file", language: "cuda"},
26287         {scheme: "file", language: "arduino"}
26288       ],
26289       initializationOptions,
26290       disableDiagnostics: this.config.disableDiagnostics,
26291       disableSnippetCompletion: this.config.disableSnippetCompletion,
26292       disableCompletion: this.config.disableCompletion,
26293       outputChannel,
26294       middleware: {
26295         provideOnTypeFormattingEdits: (document2, position, ch, options, token, next) => {
26296           const line = document2.getText(import_coc4.Range.create(position.line, 0, position.line, position.character));
26297           if (!line.trim().length)
26298             return;
26299           if (ch === "\n")
26300             ch = "";
26301           return next(document2, position, ch, options, token);
26302         },
26303         provideCompletionItem: async (document2, position, context, token, next) => {
26304           const list = await next(document2, position, context, token);
26305           if (!list)
26306             return [];
26307           if (!this.config.serverCompletionRanking)
26308             return list;
26309           const items = (Array.isArray(list) ? list : list.items).map((item) => {
26310             var _a;
26311             const start = (_a = item.textEdit) == null ? void 0 : _a.range.start;
26312             if (start) {
26313               const prefix = document2.getText(import_coc4.Range.create(start, position));
26314               if (prefix)
26315                 item.filterText = prefix + "_" + item.filterText;
26316             }
26317             return item;
26318           });
26319           return {items, isIncomplete: true};
26320         },
26321         provideWorkspaceSymbols: async (query, token, next) => {
26322           const symbols = await next(query, token);
26323           if (!symbols)
26324             return;
26325           return symbols.map((symbol) => {
26326             if (query.includes("::")) {
26327               if (symbol.containerName) {
26328                 symbol.name = `${symbol.containerName}::${symbol.name}`;
26329               }
26330               symbol.containerName = "";
26331             }
26332             return symbol;
26333           });
26334         }
26335       }
26336     };
26337     const client = new import_coc4.LanguageClient("clangd", serverOptions, clientOptions);
26338     client.registerFeature(new ClangdExtensionFeature());
26339     if (this.config.semanticHighlighting) {
26340       const lspCxx = await import_coc4.workspace.nvim.call("exists", "g:lsp_cxx_hl_loaded");
26341       if (lspCxx === 1) {
26342         client.registerFeature(new SemanticHighlightingFeature(client, this.context));
26343       }
26344     }
26345     for (const feature of features)
26346       client.registerFeature(feature);
26347     this.context.subscriptions.push(import_coc4.services.registLanguageClient(client));
26348     await client.onReady();
26349     this.client = client;
26350   }
26351   get subscriptions() {
26352     return this.context.subscriptions;
26353   }
26354 };
26355
26356 // src/file_status.ts
26357 var import_coc5 = __toModule(require("coc.nvim"));
26358 var FileStatus = class {
26359   constructor() {
26360     this.statuses = new Map();
26361     this.statusBarItem = import_coc5.window.createStatusBarItem(0);
26362   }
26363   onFileUpdated(status) {
26364     this.statuses.set(status.uri, status);
26365     this.updateStatus();
26366   }
26367   async updateStatus() {
26368     const doc = await import_coc5.workspace.document;
26369     if (!doc) {
26370       return;
26371     }
26372     const status = this.statuses.get(doc.uri);
26373     if (!status || status.state === "idle") {
26374       this.statusBarItem.hide();
26375       return;
26376     }
26377     this.statusBarItem.text = `clangd: ` + status.state;
26378     this.statusBarItem.show();
26379   }
26380   clear() {
26381     this.statuses.clear();
26382     this.statusBarItem.hide();
26383   }
26384   dispose() {
26385     this.statusBarItem.dispose();
26386   }
26387 };
26388
26389 // node_modules/event-target-shim/dist/event-target-shim.mjs
26390 var privateData = new WeakMap();
26391 var wrappers = new WeakMap();
26392 function pd(event) {
26393   const retv = privateData.get(event);
26394   console.assert(retv != null, "'this' is expected an Event object, but got", event);
26395   return retv;
26396 }
26397 function setCancelFlag(data) {
26398   if (data.passiveListener != null) {
26399     if (typeof console !== "undefined" && typeof console.error === "function") {
26400       console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
26401     }
26402     return;
26403   }
26404   if (!data.event.cancelable) {
26405     return;
26406   }
26407   data.canceled = true;
26408   if (typeof data.event.preventDefault === "function") {
26409     data.event.preventDefault();
26410   }
26411 }
26412 function Event2(eventTarget, event) {
26413   privateData.set(this, {
26414     eventTarget,
26415     event,
26416     eventPhase: 2,
26417     currentTarget: eventTarget,
26418     canceled: false,
26419     stopped: false,
26420     immediateStopped: false,
26421     passiveListener: null,
26422     timeStamp: event.timeStamp || Date.now()
26423   });
26424   Object.defineProperty(this, "isTrusted", {value: false, enumerable: true});
26425   const keys = Object.keys(event);
26426   for (let i = 0; i < keys.length; ++i) {
26427     const key = keys[i];
26428     if (!(key in this)) {
26429       Object.defineProperty(this, key, defineRedirectDescriptor(key));
26430     }
26431   }
26432 }
26433 Event2.prototype = {
26434   get type() {
26435     return pd(this).event.type;
26436   },
26437   get target() {
26438     return pd(this).eventTarget;
26439   },
26440   get currentTarget() {
26441     return pd(this).currentTarget;
26442   },
26443   composedPath() {
26444     const currentTarget = pd(this).currentTarget;
26445     if (currentTarget == null) {
26446       return [];
26447     }
26448     return [currentTarget];
26449   },
26450   get NONE() {
26451     return 0;
26452   },
26453   get CAPTURING_PHASE() {
26454     return 1;
26455   },
26456   get AT_TARGET() {
26457     return 2;
26458   },
26459   get BUBBLING_PHASE() {
26460     return 3;
26461   },
26462   get eventPhase() {
26463     return pd(this).eventPhase;
26464   },
26465   stopPropagation() {
26466     const data = pd(this);
26467     data.stopped = true;
26468     if (typeof data.event.stopPropagation === "function") {
26469       data.event.stopPropagation();
26470     }
26471   },
26472   stopImmediatePropagation() {
26473     const data = pd(this);
26474     data.stopped = true;
26475     data.immediateStopped = true;
26476     if (typeof data.event.stopImmediatePropagation === "function") {
26477       data.event.stopImmediatePropagation();
26478     }
26479   },
26480   get bubbles() {
26481     return Boolean(pd(this).event.bubbles);
26482   },
26483   get cancelable() {
26484     return Boolean(pd(this).event.cancelable);
26485   },
26486   preventDefault() {
26487     setCancelFlag(pd(this));
26488   },
26489   get defaultPrevented() {
26490     return pd(this).canceled;
26491   },
26492   get composed() {
26493     return Boolean(pd(this).event.composed);
26494   },
26495   get timeStamp() {
26496     return pd(this).timeStamp;
26497   },
26498   get srcElement() {
26499     return pd(this).eventTarget;
26500   },
26501   get cancelBubble() {
26502     return pd(this).stopped;
26503   },
26504   set cancelBubble(value) {
26505     if (!value) {
26506       return;
26507     }
26508     const data = pd(this);
26509     data.stopped = true;
26510     if (typeof data.event.cancelBubble === "boolean") {
26511       data.event.cancelBubble = true;
26512     }
26513   },
26514   get returnValue() {
26515     return !pd(this).canceled;
26516   },
26517   set returnValue(value) {
26518     if (!value) {
26519       setCancelFlag(pd(this));
26520     }
26521   },
26522   initEvent() {
26523   }
26524 };
26525 Object.defineProperty(Event2.prototype, "constructor", {
26526   value: Event2,
26527   configurable: true,
26528   writable: true
26529 });
26530 if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
26531   Object.setPrototypeOf(Event2.prototype, window.Event.prototype);
26532   wrappers.set(window.Event.prototype, Event2);
26533 }
26534 function defineRedirectDescriptor(key) {
26535   return {
26536     get() {
26537       return pd(this).event[key];
26538     },
26539     set(value) {
26540       pd(this).event[key] = value;
26541     },
26542     configurable: true,
26543     enumerable: true
26544   };
26545 }
26546 function defineCallDescriptor(key) {
26547   return {
26548     value() {
26549       const event = pd(this).event;
26550       return event[key].apply(event, arguments);
26551     },
26552     configurable: true,
26553     enumerable: true
26554   };
26555 }
26556 function defineWrapper(BaseEvent, proto) {
26557   const keys = Object.keys(proto);
26558   if (keys.length === 0) {
26559     return BaseEvent;
26560   }
26561   function CustomEvent2(eventTarget, event) {
26562     BaseEvent.call(this, eventTarget, event);
26563   }
26564   CustomEvent2.prototype = Object.create(BaseEvent.prototype, {
26565     constructor: {value: CustomEvent2, configurable: true, writable: true}
26566   });
26567   for (let i = 0; i < keys.length; ++i) {
26568     const key = keys[i];
26569     if (!(key in BaseEvent.prototype)) {
26570       const descriptor = Object.getOwnPropertyDescriptor(proto, key);
26571       const isFunc = typeof descriptor.value === "function";
26572       Object.defineProperty(CustomEvent2.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
26573     }
26574   }
26575   return CustomEvent2;
26576 }
26577 function getWrapper(proto) {
26578   if (proto == null || proto === Object.prototype) {
26579     return Event2;
26580   }
26581   let wrapper = wrappers.get(proto);
26582   if (wrapper == null) {
26583     wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);
26584     wrappers.set(proto, wrapper);
26585   }
26586   return wrapper;
26587 }
26588 function wrapEvent(eventTarget, event) {
26589   const Wrapper = getWrapper(Object.getPrototypeOf(event));
26590   return new Wrapper(eventTarget, event);
26591 }
26592 function isStopped(event) {
26593   return pd(event).immediateStopped;
26594 }
26595 function setEventPhase(event, eventPhase) {
26596   pd(event).eventPhase = eventPhase;
26597 }
26598 function setCurrentTarget(event, currentTarget) {
26599   pd(event).currentTarget = currentTarget;
26600 }
26601 function setPassiveListener(event, passiveListener) {
26602   pd(event).passiveListener = passiveListener;
26603 }
26604 var listenersMap = new WeakMap();
26605 var CAPTURE = 1;
26606 var BUBBLE = 2;
26607 var ATTRIBUTE = 3;
26608 function isObject2(x) {
26609   return x !== null && typeof x === "object";
26610 }
26611 function getListeners(eventTarget) {
26612   const listeners = listenersMap.get(eventTarget);
26613   if (listeners == null) {
26614     throw new TypeError("'this' is expected an EventTarget object, but got another value.");
26615   }
26616   return listeners;
26617 }
26618 function defineEventAttributeDescriptor(eventName) {
26619   return {
26620     get() {
26621       const listeners = getListeners(this);
26622       let node = listeners.get(eventName);
26623       while (node != null) {
26624         if (node.listenerType === ATTRIBUTE) {
26625           return node.listener;
26626         }
26627         node = node.next;
26628       }
26629       return null;
26630     },
26631     set(listener) {
26632       if (typeof listener !== "function" && !isObject2(listener)) {
26633         listener = null;
26634       }
26635       const listeners = getListeners(this);
26636       let prev = null;
26637       let node = listeners.get(eventName);
26638       while (node != null) {
26639         if (node.listenerType === ATTRIBUTE) {
26640           if (prev !== null) {
26641             prev.next = node.next;
26642           } else if (node.next !== null) {
26643             listeners.set(eventName, node.next);
26644           } else {
26645             listeners.delete(eventName);
26646           }
26647         } else {
26648           prev = node;
26649         }
26650         node = node.next;
26651       }
26652       if (listener !== null) {
26653         const newNode = {
26654           listener,
26655           listenerType: ATTRIBUTE,
26656           passive: false,
26657           once: false,
26658           next: null
26659         };
26660         if (prev === null) {
26661           listeners.set(eventName, newNode);
26662         } else {
26663           prev.next = newNode;
26664         }
26665       }
26666     },
26667     configurable: true,
26668     enumerable: true
26669   };
26670 }
26671 function defineEventAttribute(eventTargetPrototype, eventName) {
26672   Object.defineProperty(eventTargetPrototype, `on${eventName}`, defineEventAttributeDescriptor(eventName));
26673 }
26674 function defineCustomEventTarget(eventNames) {
26675   function CustomEventTarget() {
26676     EventTarget.call(this);
26677   }
26678   CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
26679     constructor: {
26680       value: CustomEventTarget,
26681       configurable: true,
26682       writable: true
26683     }
26684   });
26685   for (let i = 0; i < eventNames.length; ++i) {
26686     defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
26687   }
26688   return CustomEventTarget;
26689 }
26690 function EventTarget() {
26691   if (this instanceof EventTarget) {
26692     listenersMap.set(this, new Map());
26693     return;
26694   }
26695   if (arguments.length === 1 && Array.isArray(arguments[0])) {
26696     return defineCustomEventTarget(arguments[0]);
26697   }
26698   if (arguments.length > 0) {
26699     const types = new Array(arguments.length);
26700     for (let i = 0; i < arguments.length; ++i) {
26701       types[i] = arguments[i];
26702     }
26703     return defineCustomEventTarget(types);
26704   }
26705   throw new TypeError("Cannot call a class as a function");
26706 }
26707 EventTarget.prototype = {
26708   addEventListener(eventName, listener, options) {
26709     if (listener == null) {
26710       return;
26711     }
26712     if (typeof listener !== "function" && !isObject2(listener)) {
26713       throw new TypeError("'listener' should be a function or an object.");
26714     }
26715     const listeners = getListeners(this);
26716     const optionsIsObj = isObject2(options);
26717     const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
26718     const listenerType = capture ? CAPTURE : BUBBLE;
26719     const newNode = {
26720       listener,
26721       listenerType,
26722       passive: optionsIsObj && Boolean(options.passive),
26723       once: optionsIsObj && Boolean(options.once),
26724       next: null
26725     };
26726     let node = listeners.get(eventName);
26727     if (node === void 0) {
26728       listeners.set(eventName, newNode);
26729       return;
26730     }
26731     let prev = null;
26732     while (node != null) {
26733       if (node.listener === listener && node.listenerType === listenerType) {
26734         return;
26735       }
26736       prev = node;
26737       node = node.next;
26738     }
26739     prev.next = newNode;
26740   },
26741   removeEventListener(eventName, listener, options) {
26742     if (listener == null) {
26743       return;
26744     }
26745     const listeners = getListeners(this);
26746     const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options);
26747     const listenerType = capture ? CAPTURE : BUBBLE;
26748     let prev = null;
26749     let node = listeners.get(eventName);
26750     while (node != null) {
26751       if (node.listener === listener && node.listenerType === listenerType) {
26752         if (prev !== null) {
26753           prev.next = node.next;
26754         } else if (node.next !== null) {
26755           listeners.set(eventName, node.next);
26756         } else {
26757           listeners.delete(eventName);
26758         }
26759         return;
26760       }
26761       prev = node;
26762       node = node.next;
26763     }
26764   },
26765   dispatchEvent(event) {
26766     if (event == null || typeof event.type !== "string") {
26767       throw new TypeError('"event.type" should be a string.');
26768     }
26769     const listeners = getListeners(this);
26770     const eventName = event.type;
26771     let node = listeners.get(eventName);
26772     if (node == null) {
26773       return true;
26774     }
26775     const wrappedEvent = wrapEvent(this, event);
26776     let prev = null;
26777     while (node != null) {
26778       if (node.once) {
26779         if (prev !== null) {
26780           prev.next = node.next;
26781         } else if (node.next !== null) {
26782           listeners.set(eventName, node.next);
26783         } else {
26784           listeners.delete(eventName);
26785         }
26786       } else {
26787         prev = node;
26788       }
26789       setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
26790       if (typeof node.listener === "function") {
26791         try {
26792           node.listener.call(this, wrappedEvent);
26793         } catch (err) {
26794           if (typeof console !== "undefined" && typeof console.error === "function") {
26795             console.error(err);
26796           }
26797         }
26798       } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
26799         node.listener.handleEvent(wrappedEvent);
26800       }
26801       if (isStopped(wrappedEvent)) {
26802         break;
26803       }
26804       node = node.next;
26805     }
26806     setPassiveListener(wrappedEvent, null);
26807     setEventPhase(wrappedEvent, 0);
26808     setCurrentTarget(wrappedEvent, null);
26809     return !wrappedEvent.defaultPrevented;
26810   }
26811 };
26812 Object.defineProperty(EventTarget.prototype, "constructor", {
26813   value: EventTarget,
26814   configurable: true,
26815   writable: true
26816 });
26817 if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
26818   Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);
26819 }
26820
26821 // src/install.ts
26822 var common = __toModule(require_src());
26823 var coc = __toModule(require("coc.nvim"));
26824 var UI = class {
26825   constructor(context, config) {
26826     this.context = context;
26827     this.config = config;
26828   }
26829   get storagePath() {
26830     return this.context.storagePath;
26831   }
26832   slow(title, result) {
26833     coc.window.showMessage(title + "...");
26834     return result;
26835   }
26836   error(s) {
26837     coc.window.showMessage(s, "error");
26838   }
26839   info(s) {
26840     coc.window.showMessage(s);
26841   }
26842   progress(title, _cancel, body) {
26843     return this.slow(title, body(() => {
26844     }));
26845   }
26846   async shouldReuse(release) {
26847     coc.window.showMessage(`Reusing existing ${release} installation in ${this.storagePath}`);
26848     return true;
26849   }
26850   async promptReload() {
26851     await coc.commands.executeCommand("editor.action.restart");
26852   }
26853   showHelp(message, url) {
26854     message += ` See ${url}.`;
26855     coc.window.showMessage(message);
26856   }
26857   async promptUpdate(oldVersion, newVersion) {
26858     const message = `clangd ${newVersion} is available (you have ${oldVersion}). :CocCommand clangd.install, or :CocSettings to disable clangd.checkUpdates.`;
26859     coc.window.showMessage(message);
26860   }
26861   async promptInstall(version) {
26862     const message = `clangd was not found on your PATH. :CocCommand clangd.install will install ${version}.`;
26863     coc.window.showMessage(message);
26864   }
26865   get clangdPath() {
26866     return this.config.get("path");
26867   }
26868   set clangdPath(p) {
26869     this.config.update("path", p, true);
26870   }
26871 };
26872 async function activate(context) {
26873   const cfg = coc.workspace.getConfiguration("clangd");
26874   const ui = new UI(context, cfg);
26875   context.subscriptions.push(coc.commands.registerCommand("clangd.install", async () => common.installLatest(ui)));
26876   context.subscriptions.push(coc.commands.registerCommand("clangd.update", async () => common.checkUpdates(true, ui)));
26877   const status = await common.prepare(ui, cfg.get("checkUpdates", false));
26878   return status.clangdPath;
26879 }
26880
26881 // src/reload.ts
26882 var import_coc6 = __toModule(require("coc.nvim"));
26883 var import_path = __toModule(require("path"));
26884 var ReloadFeature = class {
26885   constructor(ctx, activate3) {
26886     this.ctx = ctx;
26887     this.activate = activate3;
26888   }
26889   dispose() {
26890   }
26891   initialize(caps) {
26892     var _a;
26893     if ((_a = caps.compilationDatabase) == null ? void 0 : _a.automaticReload) {
26894       return;
26895     }
26896     const fileWatcher = import_coc6.workspace.createFileSystemWatcher("**/{compile_commands.json,compile_flags.txt}");
26897     this.ctx.subscriptions.push(fileWatcher, fileWatcher.onDidChange((e) => this.reload(e.fsPath)), fileWatcher.onDidCreate((e) => this.reload(e.fsPath)));
26898   }
26899   fillClientCapabilities() {
26900   }
26901   async reload(url) {
26902     const notification = this.ctx.config.showDBChangedNotification;
26903     if (notification) {
26904       const msg = `${import_path.basename(url)} has changed, clangd is reloading...`;
26905       import_coc6.window.showMessage(msg);
26906     }
26907     for (const sub of this.ctx.subscriptions) {
26908       try {
26909         sub.dispose();
26910       } catch (e) {
26911         console.error(e);
26912       }
26913     }
26914     this.activate();
26915     if (notification)
26916       import_coc6.window.showMessage(`clangd has reloaded`);
26917   }
26918 };
26919
26920 // src/index.ts
26921 async function activate2(context) {
26922   var _a;
26923   const ctx = new Ctx(context);
26924   if (!ctx.config.enabled) {
26925     return;
26926   }
26927   const service = import_coc7.services.getService("clangd");
26928   if (service) {
26929     import_coc7.window.showMessage(`Looks like you've configured clangd in coc-settings.json, you should remove it to use coc-clangd`, "warning");
26930     return;
26931   }
26932   const clangdPath = await activate(context);
26933   if (!clangdPath) {
26934     return;
26935   }
26936   try {
26937     await ctx.startServer(clangdPath, new ReloadFeature(ctx, () => activate2(context)));
26938   } catch (e) {
26939     return;
26940   }
26941   const fileStatus = new FileStatus();
26942   context.subscriptions.push(fileStatus, import_coc7.commands.registerCommand("clangd.switchSourceHeader", switchSourceHeader(ctx)), import_coc7.commands.registerCommand("clangd.symbolInfo", symbolInfo(ctx)), ctx.client.onDidChangeState((e) => {
26943     var _a2;
26944     if (e.newState === import_coc7.State.Running) {
26945       (_a2 = ctx.client) == null ? void 0 : _a2.onNotification("textDocument/clangd.fileStatus", (status) => {
26946         fileStatus.onFileUpdated(status);
26947       });
26948     } else if (e.newState === import_coc7.State.Stopped) {
26949       fileStatus.clear();
26950     }
26951   }), import_coc7.workspace.onDidOpenTextDocument(() => {
26952     fileStatus.updateStatus();
26953   }));
26954   (_a = ctx.client) == null ? void 0 : _a.onNotification("textDocument/clangd.fileStatus", (status) => {
26955     fileStatus.onFileUpdated(status);
26956   });
26957 }