@boxes-dev/dvb 1.0.778 → 1.0.780

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/dvb.cjs CHANGED
@@ -45,7 +45,7 @@ var import_path = require("path");
45
45
  var import_events2 = require("events");
46
46
  var import_assert = __toESM(require("assert"), 1);
47
47
  var import_buffer = require("buffer");
48
- var vs = __toESM(require("zlib"), 1);
48
+ var Ms = __toESM(require("zlib"), 1);
49
49
  var import_zlib = __toESM(require("zlib"), 1);
50
50
  var import_node_path2 = require("node:path");
51
51
  var import_node_path3 = require("node:path");
@@ -68,51 +68,51 @@ var import_node_path7 = __toESM(require("node:path"), 1);
68
68
  var import_node_path8 = require("node:path");
69
69
  var import_node_fs6 = __toESM(require("node:fs"), 1);
70
70
  var import_node_path9 = __toESM(require("node:path"), 1);
71
- var Dr = Object.defineProperty;
72
- var Ar = (s3, t) => {
73
- for (var e in t) Dr(s3, e, { get: t[e], enumerable: true });
74
- };
75
- var Ts = typeof process == "object" && process ? process : { stdout: null, stderr: null };
76
- var Cr = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof A || s3 instanceof import_node_stream.default || Fr(s3) || kr(s3));
77
- var Fr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof import_node_events.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== import_node_stream.default.Writable.prototype.pipe;
78
- var kr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof import_node_events.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
71
+ var Mr = Object.defineProperty;
72
+ var Br = (s3, t) => {
73
+ for (var e in t) Mr(s3, e, { get: t[e], enumerable: true });
74
+ };
75
+ var xs = typeof process == "object" && process ? process : { stdout: null, stderr: null };
76
+ var zr = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof A || s3 instanceof import_node_stream.default || Ur(s3) || Hr(s3));
77
+ var Ur = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof import_node_events.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== import_node_stream.default.Writable.prototype.pipe;
78
+ var Hr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof import_node_events.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
79
79
  var q = /* @__PURE__ */ Symbol("EOF");
80
- var j = /* @__PURE__ */ Symbol("maybeEmitEnd");
80
+ var Q = /* @__PURE__ */ Symbol("maybeEmitEnd");
81
81
  var rt = /* @__PURE__ */ Symbol("emittedEnd");
82
- var xe = /* @__PURE__ */ Symbol("emittingEnd");
83
- var jt = /* @__PURE__ */ Symbol("emittedError");
84
- var Le = /* @__PURE__ */ Symbol("closed");
85
- var xs = /* @__PURE__ */ Symbol("read");
86
- var Ne = /* @__PURE__ */ Symbol("flush");
87
- var Ls = /* @__PURE__ */ Symbol("flushChunk");
82
+ var Le = /* @__PURE__ */ Symbol("emittingEnd");
83
+ var qt = /* @__PURE__ */ Symbol("emittedError");
84
+ var Ne = /* @__PURE__ */ Symbol("closed");
85
+ var Ls = /* @__PURE__ */ Symbol("read");
86
+ var De = /* @__PURE__ */ Symbol("flush");
87
+ var Ns = /* @__PURE__ */ Symbol("flushChunk");
88
88
  var z = /* @__PURE__ */ Symbol("encoding");
89
89
  var Mt = /* @__PURE__ */ Symbol("decoder");
90
- var b = /* @__PURE__ */ Symbol("flowing");
90
+ var g = /* @__PURE__ */ Symbol("flowing");
91
91
  var Qt = /* @__PURE__ */ Symbol("paused");
92
92
  var Bt = /* @__PURE__ */ Symbol("resume");
93
- var g = /* @__PURE__ */ Symbol("buffer");
93
+ var b = /* @__PURE__ */ Symbol("buffer");
94
94
  var D = /* @__PURE__ */ Symbol("pipes");
95
95
  var _ = /* @__PURE__ */ Symbol("bufferLength");
96
- var Si = /* @__PURE__ */ Symbol("bufferPush");
97
- var De = /* @__PURE__ */ Symbol("bufferShift");
96
+ var gi = /* @__PURE__ */ Symbol("bufferPush");
97
+ var Ae = /* @__PURE__ */ Symbol("bufferShift");
98
98
  var L = /* @__PURE__ */ Symbol("objectMode");
99
99
  var w = /* @__PURE__ */ Symbol("destroyed");
100
- var yi = /* @__PURE__ */ Symbol("error");
101
- var Ri = /* @__PURE__ */ Symbol("emitData");
102
- var Ns = /* @__PURE__ */ Symbol("emitEnd");
103
- var bi = /* @__PURE__ */ Symbol("emitEnd2");
100
+ var bi = /* @__PURE__ */ Symbol("error");
101
+ var _i = /* @__PURE__ */ Symbol("emitData");
102
+ var Ds = /* @__PURE__ */ Symbol("emitEnd");
103
+ var Oi = /* @__PURE__ */ Symbol("emitEnd2");
104
104
  var Z = /* @__PURE__ */ Symbol("async");
105
- var gi = /* @__PURE__ */ Symbol("abort");
106
- var Ae = /* @__PURE__ */ Symbol("aborted");
105
+ var Ti = /* @__PURE__ */ Symbol("abort");
106
+ var Ie = /* @__PURE__ */ Symbol("aborted");
107
107
  var Jt = /* @__PURE__ */ Symbol("signal");
108
- var yt = /* @__PURE__ */ Symbol("dataListeners");
109
- var C = /* @__PURE__ */ Symbol("discarded");
110
- var te = (s3) => Promise.resolve().then(s3);
111
- var vr = (s3) => s3();
112
- var Mr = (s3) => s3 === "end" || s3 === "finish" || s3 === "prefinish";
113
- var Br = (s3) => s3 instanceof ArrayBuffer || !!s3 && typeof s3 == "object" && s3.constructor && s3.constructor.name === "ArrayBuffer" && s3.byteLength >= 0;
114
- var Pr = (s3) => !Buffer.isBuffer(s3) && ArrayBuffer.isView(s3);
115
- var Ie = class {
108
+ var Rt = /* @__PURE__ */ Symbol("dataListeners");
109
+ var F = /* @__PURE__ */ Symbol("discarded");
110
+ var jt = (s3) => Promise.resolve().then(s3);
111
+ var Wr = (s3) => s3();
112
+ var Gr = (s3) => s3 === "end" || s3 === "finish" || s3 === "prefinish";
113
+ var Zr = (s3) => s3 instanceof ArrayBuffer || !!s3 && typeof s3 == "object" && s3.constructor && s3.constructor.name === "ArrayBuffer" && s3.byteLength >= 0;
114
+ var Yr = (s3) => !Buffer.isBuffer(s3) && ArrayBuffer.isView(s3);
115
+ var Fe = class {
116
116
  src;
117
117
  dest;
118
118
  opts;
@@ -129,7 +129,7 @@ var Ie = class {
129
129
  this.unpipe(), this.opts.end && this.dest.end();
130
130
  }
131
131
  };
132
- var _i = class extends Ie {
132
+ var xi = class extends Fe {
133
133
  unpipe() {
134
134
  this.src.removeListener("error", this.proxyErrors), super.unpipe();
135
135
  }
@@ -137,36 +137,36 @@ var _i = class extends Ie {
137
137
  super(t, e, i), this.proxyErrors = (r) => this.dest.emit("error", r), t.on("error", this.proxyErrors);
138
138
  }
139
139
  };
140
- var zr = (s3) => !!s3.objectMode;
141
- var Ur = (s3) => !s3.objectMode && !!s3.encoding && s3.encoding !== "buffer";
140
+ var Kr = (s3) => !!s3.objectMode;
141
+ var Vr = (s3) => !s3.objectMode && !!s3.encoding && s3.encoding !== "buffer";
142
142
  var A = class extends import_node_events.EventEmitter {
143
- [b] = false;
143
+ [g] = false;
144
144
  [Qt] = false;
145
145
  [D] = [];
146
- [g] = [];
146
+ [b] = [];
147
147
  [L];
148
148
  [z];
149
149
  [Z];
150
150
  [Mt];
151
151
  [q] = false;
152
152
  [rt] = false;
153
- [xe] = false;
154
153
  [Le] = false;
155
- [jt] = null;
154
+ [Ne] = false;
155
+ [qt] = null;
156
156
  [_] = 0;
157
157
  [w] = false;
158
158
  [Jt];
159
- [Ae] = false;
160
- [yt] = 0;
161
- [C] = false;
159
+ [Ie] = false;
160
+ [Rt] = 0;
161
+ [F] = false;
162
162
  writable = true;
163
163
  readable = true;
164
164
  constructor(...t) {
165
165
  let e = t[0] || {};
166
166
  if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
167
- zr(e) ? (this[L] = true, this[z] = null) : Ur(e) ? (this[z] = e.encoding, this[L] = false) : (this[L] = false, this[z] = null), this[Z] = !!e.async, this[Mt] = this[z] ? new import_node_string_decoder.StringDecoder(this[z]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[g] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[D] });
167
+ Kr(e) ? (this[L] = true, this[z] = null) : Vr(e) ? (this[z] = e.encoding, this[L] = false) : (this[L] = false, this[z] = null), this[Z] = !!e.async, this[Mt] = this[z] ? new import_node_string_decoder.StringDecoder(this[z]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[b] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[D] });
168
168
  let { signal: i } = e;
169
- i && (this[Jt] = i, i.aborted ? this[gi]() : i.addEventListener("abort", () => this[gi]()));
169
+ i && (this[Jt] = i, i.aborted ? this[Ti]() : i.addEventListener("abort", () => this[Ti]()));
170
170
  }
171
171
  get bufferLength() {
172
172
  return this[_];
@@ -192,99 +192,99 @@ var A = class extends import_node_events.EventEmitter {
192
192
  set async(t) {
193
193
  this[Z] = this[Z] || !!t;
194
194
  }
195
- [gi]() {
196
- this[Ae] = true, this.emit("abort", this[Jt]?.reason), this.destroy(this[Jt]?.reason);
195
+ [Ti]() {
196
+ this[Ie] = true, this.emit("abort", this[Jt]?.reason), this.destroy(this[Jt]?.reason);
197
197
  }
198
198
  get aborted() {
199
- return this[Ae];
199
+ return this[Ie];
200
200
  }
201
201
  set aborted(t) {
202
202
  }
203
203
  write(t, e, i) {
204
- if (this[Ae]) return false;
204
+ if (this[Ie]) return false;
205
205
  if (this[q]) throw new Error("write after end");
206
206
  if (this[w]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
207
207
  typeof e == "function" && (i = e, e = "utf8"), e || (e = "utf8");
208
- let r = this[Z] ? te : vr;
208
+ let r = this[Z] ? jt : Wr;
209
209
  if (!this[L] && !Buffer.isBuffer(t)) {
210
- if (Pr(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
211
- else if (Br(t)) t = Buffer.from(t);
210
+ if (Yr(t)) t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
211
+ else if (Zr(t)) t = Buffer.from(t);
212
212
  else if (typeof t != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
213
213
  }
214
- return this[L] ? (this[b] && this[_] !== 0 && this[Ne](true), this[b] ? this.emit("data", t) : this[Si](t), this[_] !== 0 && this.emit("readable"), i && r(i), this[b]) : t.length ? (typeof t == "string" && !(e === this[z] && !this[Mt]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[z] && (t = this[Mt].write(t)), this[b] && this[_] !== 0 && this[Ne](true), this[b] ? this.emit("data", t) : this[Si](t), this[_] !== 0 && this.emit("readable"), i && r(i), this[b]) : (this[_] !== 0 && this.emit("readable"), i && r(i), this[b]);
214
+ return this[L] ? (this[g] && this[_] !== 0 && this[De](true), this[g] ? this.emit("data", t) : this[gi](t), this[_] !== 0 && this.emit("readable"), i && r(i), this[g]) : t.length ? (typeof t == "string" && !(e === this[z] && !this[Mt]?.lastNeed) && (t = Buffer.from(t, e)), Buffer.isBuffer(t) && this[z] && (t = this[Mt].write(t)), this[g] && this[_] !== 0 && this[De](true), this[g] ? this.emit("data", t) : this[gi](t), this[_] !== 0 && this.emit("readable"), i && r(i), this[g]) : (this[_] !== 0 && this.emit("readable"), i && r(i), this[g]);
215
215
  }
216
216
  read(t) {
217
217
  if (this[w]) return null;
218
- if (this[C] = false, this[_] === 0 || t === 0 || t && t > this[_]) return this[j](), null;
219
- this[L] && (t = null), this[g].length > 1 && !this[L] && (this[g] = [this[z] ? this[g].join("") : Buffer.concat(this[g], this[_])]);
220
- let e = this[xs](t || null, this[g][0]);
221
- return this[j](), e;
218
+ if (this[F] = false, this[_] === 0 || t === 0 || t && t > this[_]) return this[Q](), null;
219
+ this[L] && (t = null), this[b].length > 1 && !this[L] && (this[b] = [this[z] ? this[b].join("") : Buffer.concat(this[b], this[_])]);
220
+ let e = this[Ls](t || null, this[b][0]);
221
+ return this[Q](), e;
222
222
  }
223
- [xs](t, e) {
224
- if (this[L]) this[De]();
223
+ [Ls](t, e) {
224
+ if (this[L]) this[Ae]();
225
225
  else {
226
226
  let i = e;
227
- t === i.length || t === null ? this[De]() : typeof i == "string" ? (this[g][0] = i.slice(t), e = i.slice(0, t), this[_] -= t) : (this[g][0] = i.subarray(t), e = i.subarray(0, t), this[_] -= t);
227
+ t === i.length || t === null ? this[Ae]() : typeof i == "string" ? (this[b][0] = i.slice(t), e = i.slice(0, t), this[_] -= t) : (this[b][0] = i.subarray(t), e = i.subarray(0, t), this[_] -= t);
228
228
  }
229
- return this.emit("data", e), !this[g].length && !this[q] && this.emit("drain"), e;
229
+ return this.emit("data", e), !this[b].length && !this[q] && this.emit("drain"), e;
230
230
  }
231
231
  end(t, e, i) {
232
- return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = "utf8"), t !== void 0 && this.write(t, e), i && this.once("end", i), this[q] = true, this.writable = false, (this[b] || !this[Qt]) && this[j](), this;
232
+ return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = "utf8"), t !== void 0 && this.write(t, e), i && this.once("end", i), this[q] = true, this.writable = false, (this[g] || !this[Qt]) && this[Q](), this;
233
233
  }
234
234
  [Bt]() {
235
- this[w] || (!this[yt] && !this[D].length && (this[C] = true), this[Qt] = false, this[b] = true, this.emit("resume"), this[g].length ? this[Ne]() : this[q] ? this[j]() : this.emit("drain"));
235
+ this[w] || (!this[Rt] && !this[D].length && (this[F] = true), this[Qt] = false, this[g] = true, this.emit("resume"), this[b].length ? this[De]() : this[q] ? this[Q]() : this.emit("drain"));
236
236
  }
237
237
  resume() {
238
238
  return this[Bt]();
239
239
  }
240
240
  pause() {
241
- this[b] = false, this[Qt] = true, this[C] = false;
241
+ this[g] = false, this[Qt] = true, this[F] = false;
242
242
  }
243
243
  get destroyed() {
244
244
  return this[w];
245
245
  }
246
246
  get flowing() {
247
- return this[b];
247
+ return this[g];
248
248
  }
249
249
  get paused() {
250
250
  return this[Qt];
251
251
  }
252
- [Si](t) {
253
- this[L] ? this[_] += 1 : this[_] += t.length, this[g].push(t);
252
+ [gi](t) {
253
+ this[L] ? this[_] += 1 : this[_] += t.length, this[b].push(t);
254
254
  }
255
- [De]() {
256
- return this[L] ? this[_] -= 1 : this[_] -= this[g][0].length, this[g].shift();
255
+ [Ae]() {
256
+ return this[L] ? this[_] -= 1 : this[_] -= this[b][0].length, this[b].shift();
257
257
  }
258
- [Ne](t = false) {
258
+ [De](t = false) {
259
259
  do
260
260
  ;
261
- while (this[Ls](this[De]()) && this[g].length);
262
- !t && !this[g].length && !this[q] && this.emit("drain");
261
+ while (this[Ns](this[Ae]()) && this[b].length);
262
+ !t && !this[b].length && !this[q] && this.emit("drain");
263
263
  }
264
- [Ls](t) {
265
- return this.emit("data", t), this[b];
264
+ [Ns](t) {
265
+ return this.emit("data", t), this[g];
266
266
  }
267
267
  pipe(t, e) {
268
268
  if (this[w]) return t;
269
- this[C] = false;
269
+ this[F] = false;
270
270
  let i = this[rt];
271
- return e = e || {}, t === Ts.stdout || t === Ts.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, i ? e.end && t.end() : (this[D].push(e.proxyErrors ? new _i(this, t, e) : new Ie(this, t, e)), this[Z] ? te(() => this[Bt]()) : this[Bt]()), t;
271
+ return e = e || {}, t === xs.stdout || t === xs.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, i ? e.end && t.end() : (this[D].push(e.proxyErrors ? new xi(this, t, e) : new Fe(this, t, e)), this[Z] ? jt(() => this[Bt]()) : this[Bt]()), t;
272
272
  }
273
273
  unpipe(t) {
274
274
  let e = this[D].find((i) => i.dest === t);
275
- e && (this[D].length === 1 ? (this[b] && this[yt] === 0 && (this[b] = false), this[D] = []) : this[D].splice(this[D].indexOf(e), 1), e.unpipe());
275
+ e && (this[D].length === 1 ? (this[g] && this[Rt] === 0 && (this[g] = false), this[D] = []) : this[D].splice(this[D].indexOf(e), 1), e.unpipe());
276
276
  }
277
277
  addListener(t, e) {
278
278
  return this.on(t, e);
279
279
  }
280
280
  on(t, e) {
281
281
  let i = super.on(t, e);
282
- if (t === "data") this[C] = false, this[yt]++, !this[D].length && !this[b] && this[Bt]();
282
+ if (t === "data") this[F] = false, this[Rt]++, !this[D].length && !this[g] && this[Bt]();
283
283
  else if (t === "readable" && this[_] !== 0) super.emit("readable");
284
- else if (Mr(t) && this[rt]) super.emit(t), this.removeAllListeners(t);
285
- else if (t === "error" && this[jt]) {
284
+ else if (Gr(t) && this[rt]) super.emit(t), this.removeAllListeners(t);
285
+ else if (t === "error" && this[qt]) {
286
286
  let r = e;
287
- this[Z] ? te(() => r.call(this, this[jt])) : r.call(this, this[jt]);
287
+ this[Z] ? jt(() => r.call(this, this[qt])) : r.call(this, this[qt]);
288
288
  }
289
289
  return i;
290
290
  }
@@ -293,55 +293,55 @@ var A = class extends import_node_events.EventEmitter {
293
293
  }
294
294
  off(t, e) {
295
295
  let i = super.off(t, e);
296
- return t === "data" && (this[yt] = this.listeners("data").length, this[yt] === 0 && !this[C] && !this[D].length && (this[b] = false)), i;
296
+ return t === "data" && (this[Rt] = this.listeners("data").length, this[Rt] === 0 && !this[F] && !this[D].length && (this[g] = false)), i;
297
297
  }
298
298
  removeAllListeners(t) {
299
299
  let e = super.removeAllListeners(t);
300
- return (t === "data" || t === void 0) && (this[yt] = 0, !this[C] && !this[D].length && (this[b] = false)), e;
300
+ return (t === "data" || t === void 0) && (this[Rt] = 0, !this[F] && !this[D].length && (this[g] = false)), e;
301
301
  }
302
302
  get emittedEnd() {
303
303
  return this[rt];
304
304
  }
305
- [j]() {
306
- !this[xe] && !this[rt] && !this[w] && this[g].length === 0 && this[q] && (this[xe] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Le] && this.emit("close"), this[xe] = false);
305
+ [Q]() {
306
+ !this[Le] && !this[rt] && !this[w] && this[b].length === 0 && this[q] && (this[Le] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Ne] && this.emit("close"), this[Le] = false);
307
307
  }
308
308
  emit(t, ...e) {
309
309
  let i = e[0];
310
310
  if (t !== "error" && t !== "close" && t !== w && this[w]) return false;
311
- if (t === "data") return !this[L] && !i ? false : this[Z] ? (te(() => this[Ri](i)), true) : this[Ri](i);
312
- if (t === "end") return this[Ns]();
311
+ if (t === "data") return !this[L] && !i ? false : this[Z] ? (jt(() => this[_i](i)), true) : this[_i](i);
312
+ if (t === "end") return this[Ds]();
313
313
  if (t === "close") {
314
- if (this[Le] = true, !this[rt] && !this[w]) return false;
314
+ if (this[Ne] = true, !this[rt] && !this[w]) return false;
315
315
  let n = super.emit("close");
316
316
  return this.removeAllListeners("close"), n;
317
317
  } else if (t === "error") {
318
- this[jt] = i, super.emit(yi, i);
318
+ this[qt] = i, super.emit(bi, i);
319
319
  let n = !this[Jt] || this.listeners("error").length ? super.emit("error", i) : false;
320
- return this[j](), n;
320
+ return this[Q](), n;
321
321
  } else if (t === "resume") {
322
322
  let n = super.emit("resume");
323
- return this[j](), n;
323
+ return this[Q](), n;
324
324
  } else if (t === "finish" || t === "prefinish") {
325
325
  let n = super.emit(t);
326
326
  return this.removeAllListeners(t), n;
327
327
  }
328
328
  let r = super.emit(t, ...e);
329
- return this[j](), r;
329
+ return this[Q](), r;
330
330
  }
331
- [Ri](t) {
331
+ [_i](t) {
332
332
  for (let i of this[D]) i.dest.write(t) === false && this.pause();
333
- let e = this[C] ? false : super.emit("data", t);
334
- return this[j](), e;
333
+ let e = this[F] ? false : super.emit("data", t);
334
+ return this[Q](), e;
335
335
  }
336
- [Ns]() {
337
- return this[rt] ? false : (this[rt] = true, this.readable = false, this[Z] ? (te(() => this[bi]()), true) : this[bi]());
336
+ [Ds]() {
337
+ return this[rt] ? false : (this[rt] = true, this.readable = false, this[Z] ? (jt(() => this[Oi]()), true) : this[Oi]());
338
338
  }
339
- [bi]() {
339
+ [Oi]() {
340
340
  if (this[Mt]) {
341
341
  let e = this[Mt].end();
342
342
  if (e) {
343
343
  for (let i of this[D]) i.dest.write(e);
344
- this[C] || super.emit("data", e);
344
+ this[F] || super.emit("data", e);
345
345
  }
346
346
  }
347
347
  for (let e of this[D]) e.end();
@@ -367,22 +367,22 @@ var A = class extends import_node_events.EventEmitter {
367
367
  });
368
368
  }
369
369
  [Symbol.asyncIterator]() {
370
- this[C] = false;
370
+ this[F] = false;
371
371
  let t = false, e = async () => (this.pause(), t = true, { value: void 0, done: true });
372
372
  return { next: () => {
373
373
  if (t) return e();
374
374
  let r = this.read();
375
375
  if (r !== null) return Promise.resolve({ done: false, value: r });
376
376
  if (this[q]) return e();
377
- let n, o, h = (d) => {
378
- this.off("data", a), this.off("end", l), this.off(w, c), e(), o(d);
379
- }, a = (d) => {
380
- this.off("error", h), this.off("end", l), this.off(w, c), this.pause(), n({ value: d, done: !!this[q] });
377
+ let n, o, a = (d) => {
378
+ this.off("data", h), this.off("end", l), this.off(w, c), e(), o(d);
379
+ }, h = (d) => {
380
+ this.off("error", a), this.off("end", l), this.off(w, c), this.pause(), n({ value: d, done: !!this[q] });
381
381
  }, l = () => {
382
- this.off("error", h), this.off("data", a), this.off(w, c), e(), n({ done: true, value: void 0 });
383
- }, c = () => h(new Error("stream destroyed"));
382
+ this.off("error", a), this.off("data", h), this.off(w, c), e(), n({ done: true, value: void 0 });
383
+ }, c = () => a(new Error("stream destroyed"));
384
384
  return new Promise((d, S) => {
385
- o = S, n = d, this.once(w, c), this.once("error", h), this.once("end", l), this.once("data", a);
385
+ o = S, n = d, this.once(w, c), this.once("error", a), this.once("end", l), this.once("data", h);
386
386
  });
387
387
  }, throw: e, return: e, [Symbol.asyncIterator]() {
388
388
  return this;
@@ -390,68 +390,68 @@ var A = class extends import_node_events.EventEmitter {
390
390
  } };
391
391
  }
392
392
  [Symbol.iterator]() {
393
- this[C] = false;
394
- let t = false, e = () => (this.pause(), this.off(yi, e), this.off(w, e), this.off("end", e), t = true, { done: true, value: void 0 }), i = () => {
393
+ this[F] = false;
394
+ let t = false, e = () => (this.pause(), this.off(bi, e), this.off(w, e), this.off("end", e), t = true, { done: true, value: void 0 }), i = () => {
395
395
  if (t) return e();
396
396
  let r = this.read();
397
397
  return r === null ? e() : { done: false, value: r };
398
398
  };
399
- return this.once("end", e), this.once(yi, e), this.once(w, e), { next: i, throw: e, return: e, [Symbol.iterator]() {
399
+ return this.once("end", e), this.once(bi, e), this.once(w, e), { next: i, throw: e, return: e, [Symbol.iterator]() {
400
400
  return this;
401
401
  }, [Symbol.dispose]: () => {
402
402
  } };
403
403
  }
404
404
  destroy(t) {
405
405
  if (this[w]) return t ? this.emit("error", t) : this.emit(w), this;
406
- this[w] = true, this[C] = true, this[g].length = 0, this[_] = 0;
406
+ this[w] = true, this[F] = true, this[b].length = 0, this[_] = 0;
407
407
  let e = this;
408
- return typeof e.close == "function" && !this[Le] && e.close(), t ? this.emit("error", t) : this.emit(w), this;
408
+ return typeof e.close == "function" && !this[Ne] && e.close(), t ? this.emit("error", t) : this.emit(w), this;
409
409
  }
410
410
  static get isStream() {
411
- return Cr;
411
+ return zr;
412
412
  }
413
413
  };
414
- var Wr = import_fs.default.writev;
414
+ var Xr = import_fs.default.writev;
415
415
  var ot = /* @__PURE__ */ Symbol("_autoClose");
416
416
  var H = /* @__PURE__ */ Symbol("_close");
417
- var ee = /* @__PURE__ */ Symbol("_ended");
417
+ var te = /* @__PURE__ */ Symbol("_ended");
418
418
  var m = /* @__PURE__ */ Symbol("_fd");
419
- var Ti = /* @__PURE__ */ Symbol("_finished");
420
- var J = /* @__PURE__ */ Symbol("_flags");
421
- var xi = /* @__PURE__ */ Symbol("_flush");
422
- var Ai = /* @__PURE__ */ Symbol("_handleChunk");
423
- var Ii = /* @__PURE__ */ Symbol("_makeBuf");
424
- var se = /* @__PURE__ */ Symbol("_mode");
419
+ var Ni = /* @__PURE__ */ Symbol("_finished");
420
+ var j = /* @__PURE__ */ Symbol("_flags");
421
+ var Di = /* @__PURE__ */ Symbol("_flush");
422
+ var Ci = /* @__PURE__ */ Symbol("_handleChunk");
423
+ var ki = /* @__PURE__ */ Symbol("_makeBuf");
424
+ var ie = /* @__PURE__ */ Symbol("_mode");
425
425
  var Ce = /* @__PURE__ */ Symbol("_needDrain");
426
426
  var Ut = /* @__PURE__ */ Symbol("_onerror");
427
427
  var Ht = /* @__PURE__ */ Symbol("_onopen");
428
- var Li = /* @__PURE__ */ Symbol("_onread");
428
+ var Ai = /* @__PURE__ */ Symbol("_onread");
429
429
  var Pt = /* @__PURE__ */ Symbol("_onwrite");
430
430
  var ht = /* @__PURE__ */ Symbol("_open");
431
431
  var U = /* @__PURE__ */ Symbol("_path");
432
432
  var nt = /* @__PURE__ */ Symbol("_pos");
433
433
  var Y = /* @__PURE__ */ Symbol("_queue");
434
434
  var zt = /* @__PURE__ */ Symbol("_read");
435
- var Ni = /* @__PURE__ */ Symbol("_readSize");
436
- var Q = /* @__PURE__ */ Symbol("_reading");
437
- var ie = /* @__PURE__ */ Symbol("_remain");
438
- var Di = /* @__PURE__ */ Symbol("_size");
439
- var Fe = /* @__PURE__ */ Symbol("_write");
440
- var Rt = /* @__PURE__ */ Symbol("_writing");
441
- var ke = /* @__PURE__ */ Symbol("_defaultFlag");
435
+ var Ii = /* @__PURE__ */ Symbol("_readSize");
436
+ var J = /* @__PURE__ */ Symbol("_reading");
437
+ var ee = /* @__PURE__ */ Symbol("_remain");
438
+ var Fi = /* @__PURE__ */ Symbol("_size");
439
+ var ke = /* @__PURE__ */ Symbol("_write");
440
+ var gt = /* @__PURE__ */ Symbol("_writing");
441
+ var ve = /* @__PURE__ */ Symbol("_defaultFlag");
442
442
  var bt = /* @__PURE__ */ Symbol("_errored");
443
- var gt = class extends A {
443
+ var _t = class extends A {
444
444
  [bt] = false;
445
445
  [m];
446
446
  [U];
447
- [Ni];
448
- [Q] = false;
449
- [Di];
450
- [ie];
447
+ [Ii];
448
+ [J] = false;
449
+ [Fi];
450
+ [ee];
451
451
  [ot];
452
452
  constructor(t, e) {
453
453
  if (e = e || {}, super(e), this.readable = true, this.writable = false, typeof t != "string") throw new TypeError("path must be a string");
454
- this[bt] = false, this[m] = typeof e.fd == "number" ? e.fd : void 0, this[U] = t, this[Ni] = e.readSize || 16 * 1024 * 1024, this[Q] = false, this[Di] = typeof e.size == "number" ? e.size : 1 / 0, this[ie] = this[Di], this[ot] = typeof e.autoClose == "boolean" ? e.autoClose : true, typeof this[m] == "number" ? this[zt]() : this[ht]();
454
+ this[bt] = false, this[m] = typeof e.fd == "number" ? e.fd : void 0, this[U] = t, this[Ii] = e.readSize || 16 * 1024 * 1024, this[J] = false, this[Fi] = typeof e.size == "number" ? e.size : 1 / 0, this[ee] = this[Fi], this[ot] = typeof e.autoClose == "boolean" ? e.autoClose : true, typeof this[m] == "number" ? this[zt]() : this[ht]();
455
455
  }
456
456
  get fd() {
457
457
  return this[m];
@@ -471,19 +471,19 @@ var gt = class extends A {
471
471
  [Ht](t, e) {
472
472
  t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[zt]());
473
473
  }
474
- [Ii]() {
475
- return Buffer.allocUnsafe(Math.min(this[Ni], this[ie]));
474
+ [ki]() {
475
+ return Buffer.allocUnsafe(Math.min(this[Ii], this[ee]));
476
476
  }
477
477
  [zt]() {
478
- if (!this[Q]) {
479
- this[Q] = true;
480
- let t = this[Ii]();
481
- if (t.length === 0) return process.nextTick(() => this[Li](null, 0, t));
482
- import_fs.default.read(this[m], t, 0, t.length, null, (e, i, r) => this[Li](e, i, r));
478
+ if (!this[J]) {
479
+ this[J] = true;
480
+ let t = this[ki]();
481
+ if (t.length === 0) return process.nextTick(() => this[Ai](null, 0, t));
482
+ import_fs.default.read(this[m], t, 0, t.length, null, (e, i, r) => this[Ai](e, i, r));
483
483
  }
484
484
  }
485
- [Li](t, e, i) {
486
- this[Q] = false, t ? this[Ut](t) : this[Ai](e, i) && this[zt]();
485
+ [Ai](t, e, i) {
486
+ this[J] = false, t ? this[Ut](t) : this[Ci](e, i) && this[zt]();
487
487
  }
488
488
  [H]() {
489
489
  if (this[ot] && typeof this[m] == "number") {
@@ -492,11 +492,11 @@ var gt = class extends A {
492
492
  }
493
493
  }
494
494
  [Ut](t) {
495
- this[Q] = true, this[H](), this.emit("error", t);
495
+ this[J] = true, this[H](), this.emit("error", t);
496
496
  }
497
- [Ai](t, e) {
497
+ [Ci](t, e) {
498
498
  let i = false;
499
- return this[ie] -= t, t > 0 && (i = super.write(t < e.length ? e.subarray(0, t) : e)), (t === 0 || this[ie] <= 0) && (i = false, this[H](), super.end()), i;
499
+ return this[ee] -= t, t > 0 && (i = super.write(t < e.length ? e.subarray(0, t) : e)), (t === 0 || this[ee] <= 0) && (i = false, this[H](), super.end()), i;
500
500
  }
501
501
  emit(t, ...e) {
502
502
  switch (t) {
@@ -512,7 +512,7 @@ var gt = class extends A {
512
512
  }
513
513
  }
514
514
  };
515
- var ve = class extends gt {
515
+ var Me = class extends _t {
516
516
  [ht]() {
517
517
  let t = true;
518
518
  try {
@@ -524,13 +524,13 @@ var ve = class extends gt {
524
524
  [zt]() {
525
525
  let t = true;
526
526
  try {
527
- if (!this[Q]) {
528
- this[Q] = true;
527
+ if (!this[J]) {
528
+ this[J] = true;
529
529
  do {
530
- let e = this[Ii](), i = e.length === 0 ? 0 : import_fs.default.readSync(this[m], e, 0, e.length, null);
531
- if (!this[Ai](i, e)) break;
530
+ let e = this[ki](), i = e.length === 0 ? 0 : import_fs.default.readSync(this[m], e, 0, e.length, null);
531
+ if (!this[Ci](i, e)) break;
532
532
  } while (true);
533
- this[Q] = false;
533
+ this[J] = false;
534
534
  }
535
535
  t = false;
536
536
  } finally {
@@ -548,22 +548,22 @@ var tt = class extends import_events.default {
548
548
  readable = false;
549
549
  writable = true;
550
550
  [bt] = false;
551
- [Rt] = false;
552
- [ee] = false;
551
+ [gt] = false;
552
+ [te] = false;
553
553
  [Y] = [];
554
554
  [Ce] = false;
555
555
  [U];
556
- [se];
556
+ [ie];
557
557
  [ot];
558
558
  [m];
559
- [ke];
560
- [J];
561
- [Ti] = false;
559
+ [ve];
560
+ [j];
561
+ [Ni] = false;
562
562
  [nt];
563
563
  constructor(t, e) {
564
- e = e || {}, super(e), this[U] = t, this[m] = typeof e.fd == "number" ? e.fd : void 0, this[se] = e.mode === void 0 ? 438 : e.mode, this[nt] = typeof e.start == "number" ? e.start : void 0, this[ot] = typeof e.autoClose == "boolean" ? e.autoClose : true;
564
+ e = e || {}, super(e), this[U] = t, this[m] = typeof e.fd == "number" ? e.fd : void 0, this[ie] = e.mode === void 0 ? 438 : e.mode, this[nt] = typeof e.start == "number" ? e.start : void 0, this[ot] = typeof e.autoClose == "boolean" ? e.autoClose : true;
565
565
  let i = this[nt] !== void 0 ? "r+" : "w";
566
- this[ke] = e.flags === void 0, this[J] = e.flags === void 0 ? i : e.flags, this[m] === void 0 && this[ht]();
566
+ this[ve] = e.flags === void 0, this[j] = e.flags === void 0 ? i : e.flags, this[m] === void 0 && this[ht]();
567
567
  }
568
568
  emit(t, ...e) {
569
569
  if (t === "error") {
@@ -579,32 +579,32 @@ var tt = class extends import_events.default {
579
579
  return this[U];
580
580
  }
581
581
  [Ut](t) {
582
- this[H](), this[Rt] = true, this.emit("error", t);
582
+ this[H](), this[gt] = true, this.emit("error", t);
583
583
  }
584
584
  [ht]() {
585
- import_fs.default.open(this[U], this[J], this[se], (t, e) => this[Ht](t, e));
585
+ import_fs.default.open(this[U], this[j], this[ie], (t, e) => this[Ht](t, e));
586
586
  }
587
587
  [Ht](t, e) {
588
- this[ke] && this[J] === "r+" && t && t.code === "ENOENT" ? (this[J] = "w", this[ht]()) : t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[Rt] || this[xi]());
588
+ this[ve] && this[j] === "r+" && t && t.code === "ENOENT" ? (this[j] = "w", this[ht]()) : t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[gt] || this[Di]());
589
589
  }
590
590
  end(t, e) {
591
- return t && this.write(t, e), this[ee] = true, !this[Rt] && !this[Y].length && typeof this[m] == "number" && this[Pt](null, 0), this;
591
+ return t && this.write(t, e), this[te] = true, !this[gt] && !this[Y].length && typeof this[m] == "number" && this[Pt](null, 0), this;
592
592
  }
593
593
  write(t, e) {
594
- return typeof t == "string" && (t = Buffer.from(t, e)), this[ee] ? (this.emit("error", new Error("write() after end()")), false) : this[m] === void 0 || this[Rt] || this[Y].length ? (this[Y].push(t), this[Ce] = true, false) : (this[Rt] = true, this[Fe](t), true);
594
+ return typeof t == "string" && (t = Buffer.from(t, e)), this[te] ? (this.emit("error", new Error("write() after end()")), false) : this[m] === void 0 || this[gt] || this[Y].length ? (this[Y].push(t), this[Ce] = true, false) : (this[gt] = true, this[ke](t), true);
595
595
  }
596
- [Fe](t) {
596
+ [ke](t) {
597
597
  import_fs.default.write(this[m], t, 0, t.length, this[nt], (e, i) => this[Pt](e, i));
598
598
  }
599
599
  [Pt](t, e) {
600
- t ? this[Ut](t) : (this[nt] !== void 0 && typeof e == "number" && (this[nt] += e), this[Y].length ? this[xi]() : (this[Rt] = false, this[ee] && !this[Ti] ? (this[Ti] = true, this[H](), this.emit("finish")) : this[Ce] && (this[Ce] = false, this.emit("drain"))));
600
+ t ? this[Ut](t) : (this[nt] !== void 0 && typeof e == "number" && (this[nt] += e), this[Y].length ? this[Di]() : (this[gt] = false, this[te] && !this[Ni] ? (this[Ni] = true, this[H](), this.emit("finish")) : this[Ce] && (this[Ce] = false, this.emit("drain"))));
601
601
  }
602
- [xi]() {
603
- if (this[Y].length === 0) this[ee] && this[Pt](null, 0);
604
- else if (this[Y].length === 1) this[Fe](this[Y].pop());
602
+ [Di]() {
603
+ if (this[Y].length === 0) this[te] && this[Pt](null, 0);
604
+ else if (this[Y].length === 1) this[ke](this[Y].pop());
605
605
  else {
606
606
  let t = this[Y];
607
- this[Y] = [], Wr(this[m], t, this[nt], (e, i) => this[Pt](e, i));
607
+ this[Y] = [], Xr(this[m], t, this[nt], (e, i) => this[Pt](e, i));
608
608
  }
609
609
  }
610
610
  [H]() {
@@ -617,13 +617,13 @@ var tt = class extends import_events.default {
617
617
  var Wt = class extends tt {
618
618
  [ht]() {
619
619
  let t;
620
- if (this[ke] && this[J] === "r+") try {
621
- t = import_fs.default.openSync(this[U], this[J], this[se]);
620
+ if (this[ve] && this[j] === "r+") try {
621
+ t = import_fs.default.openSync(this[U], this[j], this[ie]);
622
622
  } catch (e) {
623
- if (e?.code === "ENOENT") return this[J] = "w", this[ht]();
623
+ if (e?.code === "ENOENT") return this[j] = "w", this[ht]();
624
624
  throw e;
625
625
  }
626
- else t = import_fs.default.openSync(this[U], this[J], this[se]);
626
+ else t = import_fs.default.openSync(this[U], this[j], this[ie]);
627
627
  this[Ht](null, t);
628
628
  }
629
629
  [H]() {
@@ -632,7 +632,7 @@ var Wt = class extends tt {
632
632
  this[m] = void 0, import_fs.default.closeSync(t), this.emit("close");
633
633
  }
634
634
  }
635
- [Fe](t) {
635
+ [ke](t) {
636
636
  let e = true;
637
637
  try {
638
638
  this[Pt](null, import_fs.default.writeSync(this[m], t, 0, t.length, this[nt])), e = false;
@@ -644,52 +644,53 @@ var Wt = class extends tt {
644
644
  }
645
645
  }
646
646
  };
647
- var Gr = /* @__PURE__ */ new Map([["C", "cwd"], ["f", "file"], ["z", "gzip"], ["P", "preservePaths"], ["U", "unlink"], ["strip-components", "strip"], ["stripComponents", "strip"], ["keep-newer", "newer"], ["keepNewer", "newer"], ["keep-newer-files", "newer"], ["keepNewerFiles", "newer"], ["k", "keep"], ["keep-existing", "keep"], ["keepExisting", "keep"], ["m", "noMtime"], ["no-mtime", "noMtime"], ["p", "preserveOwner"], ["L", "follow"], ["h", "follow"], ["onentry", "onReadEntry"]]);
648
- var As = (s3) => !!s3.sync && !!s3.file;
649
- var Is = (s3) => !s3.sync && !!s3.file;
647
+ var qr = /* @__PURE__ */ new Map([["C", "cwd"], ["f", "file"], ["z", "gzip"], ["P", "preservePaths"], ["U", "unlink"], ["strip-components", "strip"], ["stripComponents", "strip"], ["keep-newer", "newer"], ["keepNewer", "newer"], ["keep-newer-files", "newer"], ["keepNewerFiles", "newer"], ["k", "keep"], ["keep-existing", "keep"], ["keepExisting", "keep"], ["m", "noMtime"], ["no-mtime", "noMtime"], ["p", "preserveOwner"], ["L", "follow"], ["h", "follow"], ["onentry", "onReadEntry"]]);
648
+ var Is = (s3) => !!s3.sync && !!s3.file;
649
+ var Fs = (s3) => !s3.sync && !!s3.file;
650
650
  var Cs = (s3) => !!s3.sync && !s3.file;
651
- var Fs = (s3) => !s3.sync && !s3.file;
652
- var ks = (s3) => !!s3.file;
653
- var Zr = (s3) => {
654
- let t = Gr.get(s3);
651
+ var ks = (s3) => !s3.sync && !s3.file;
652
+ var vs = (s3) => !!s3.file;
653
+ var Qr = (s3) => {
654
+ let t = qr.get(s3);
655
655
  return t || s3;
656
656
  };
657
- var re = (s3 = {}) => {
657
+ var se = (s3 = {}) => {
658
658
  if (!s3) return {};
659
659
  let t = {};
660
660
  for (let [e, i] of Object.entries(s3)) {
661
- let r = Zr(e);
661
+ let r = Qr(e);
662
662
  t[r] = i;
663
663
  }
664
664
  return t.chmod === void 0 && t.noChmod === false && (t.chmod = true), delete t.noChmod, t;
665
665
  };
666
- var K = (s3, t, e, i, r) => Object.assign((n = [], o, h) => {
667
- Array.isArray(n) && (o = n, n = {}), typeof o == "function" && (h = o, o = void 0), o ? o = Array.from(o) : o = [];
668
- let a = re(n);
669
- if (r?.(a, o), As(a)) {
670
- if (typeof h == "function") throw new TypeError("callback not supported for sync tar functions");
671
- return s3(a, o);
672
- } else if (Is(a)) {
673
- let l = t(a, o), c = h || void 0;
674
- return c ? l.then(() => c(), c) : l;
675
- } else if (Cs(a)) {
676
- if (typeof h == "function") throw new TypeError("callback not supported for sync tar functions");
677
- return e(a, o);
678
- } else if (Fs(a)) {
679
- if (typeof h == "function") throw new TypeError("callback only supported with file option");
680
- return i(a, o);
681
- } else throw new Error("impossible options??");
666
+ var K = (s3, t, e, i, r) => Object.assign((n = [], o, a) => {
667
+ Array.isArray(n) && (o = n, n = {}), typeof o == "function" && (a = o, o = void 0), o = o ? Array.from(o) : [];
668
+ let h = se(n);
669
+ if (r?.(h, o), Is(h)) {
670
+ if (typeof a == "function") throw new TypeError("callback not supported for sync tar functions");
671
+ return s3(h, o);
672
+ } else if (Fs(h)) {
673
+ let l = t(h, o);
674
+ return a ? l.then(() => a(), a) : l;
675
+ } else if (Cs(h)) {
676
+ if (typeof a == "function") throw new TypeError("callback not supported for sync tar functions");
677
+ return e(h, o);
678
+ } else if (ks(h)) {
679
+ if (typeof a == "function") throw new TypeError("callback only supported with file option");
680
+ return i(h, o);
681
+ }
682
+ throw new Error("impossible options??");
682
683
  }, { syncFile: s3, asyncFile: t, syncNoFile: e, asyncNoFile: i, validate: r });
683
- var Kr = import_zlib.default.constants || { ZLIB_VERNUM: 4736 };
684
- var M = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 }, Kr));
685
- var Vr = import_buffer.Buffer.concat;
686
- var Ms = Object.getOwnPropertyDescriptor(import_buffer.Buffer, "concat");
687
- var $r = (s3) => s3;
688
- var Fi = Ms?.writable === true || Ms?.set !== void 0 ? (s3) => {
689
- import_buffer.Buffer.concat = s3 ? $r : Vr;
684
+ var jr = import_zlib.default.constants || { ZLIB_VERNUM: 4736 };
685
+ var M = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 }, jr));
686
+ var tn = import_buffer.Buffer.concat;
687
+ var Bs = Object.getOwnPropertyDescriptor(import_buffer.Buffer, "concat");
688
+ var en = (s3) => s3;
689
+ var Mi = Bs?.writable === true || Bs?.set !== void 0 ? (s3) => {
690
+ import_buffer.Buffer.concat = s3 ? en : tn;
690
691
  } : (s3) => {
691
692
  };
692
- var Ot = /* @__PURE__ */ Symbol("_superWrite");
693
+ var Tt = /* @__PURE__ */ Symbol("_superWrite");
693
694
  var Gt = class extends Error {
694
695
  code;
695
696
  errno;
@@ -700,8 +701,8 @@ var Gt = class extends Error {
700
701
  return "ZlibError";
701
702
  }
702
703
  };
703
- var ki = /* @__PURE__ */ Symbol("flushFlag");
704
- var ne = class extends A {
704
+ var Bi = /* @__PURE__ */ Symbol("flushFlag");
705
+ var re = class extends A {
705
706
  #t = false;
706
707
  #i = false;
707
708
  #s;
@@ -720,9 +721,9 @@ var ne = class extends A {
720
721
  }
721
722
  constructor(t, e) {
722
723
  if (!t || typeof t != "object") throw new TypeError("invalid options for ZlibBase constructor");
723
- if (super(t), this.#s = t.flush ?? 0, this.#n = t.finishFlush ?? 0, this.#r = t.fullFlushFlag ?? 0, typeof vs[e] != "function") throw new TypeError("Compression method not supported: " + e);
724
+ if (super(t), this.#s = t.flush ?? 0, this.#n = t.finishFlush ?? 0, this.#r = t.fullFlushFlag ?? 0, typeof Ms[e] != "function") throw new TypeError("Compression method not supported: " + e);
724
725
  try {
725
- this.#e = new vs[e](t);
726
+ this.#e = new Ms[e](t);
726
727
  } catch (i) {
727
728
  throw new Gt(i, this.constructor);
728
729
  }
@@ -737,7 +738,7 @@ var ne = class extends A {
737
738
  if (!this.#t) return (0, import_assert.default)(this.#e, "zlib binding closed"), this.#e.reset?.();
738
739
  }
739
740
  flush(t) {
740
- this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(import_buffer.Buffer.alloc(0), { [ki]: t })));
741
+ this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(import_buffer.Buffer.alloc(0), { [Bi]: t })));
741
742
  }
742
743
  end(t, e, i) {
743
744
  return typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), t && (e ? this.write(t, e) : this.write(t)), this.flush(this.#n), this.#i = true, super.end(i);
@@ -745,7 +746,7 @@ var ne = class extends A {
745
746
  get ended() {
746
747
  return this.#i;
747
748
  }
748
- [Ot](t) {
749
+ [Tt](t) {
749
750
  return super.write(t);
750
751
  }
751
752
  write(t, e, i) {
@@ -756,27 +757,27 @@ var ne = class extends A {
756
757
  };
757
758
  let o = this.#e.close;
758
759
  this.#e.close = () => {
759
- }, Fi(true);
760
- let h;
760
+ }, Mi(true);
761
+ let a;
761
762
  try {
762
- let l = typeof t[ki] == "number" ? t[ki] : this.#s;
763
- h = this.#e._processChunk(t, l), Fi(false);
763
+ let l = typeof t[Bi] == "number" ? t[Bi] : this.#s;
764
+ a = this.#e._processChunk(t, l), Mi(false);
764
765
  } catch (l) {
765
- Fi(false), this.#o(new Gt(l, this.write));
766
+ Mi(false), this.#o(new Gt(l, this.write));
766
767
  } finally {
767
768
  this.#e && (this.#e._handle = r, r.close = n, this.#e.close = o, this.#e.removeAllListeners("error"));
768
769
  }
769
770
  this.#e && this.#e.on("error", (l) => this.#o(new Gt(l, this.write)));
770
- let a;
771
- if (h) if (Array.isArray(h) && h.length > 0) {
772
- let l = h[0];
773
- a = this[Ot](import_buffer.Buffer.from(l));
774
- for (let c = 1; c < h.length; c++) a = this[Ot](h[c]);
775
- } else a = this[Ot](import_buffer.Buffer.from(h));
776
- return i && i(), a;
771
+ let h;
772
+ if (a) if (Array.isArray(a) && a.length > 0) {
773
+ let l = a[0];
774
+ h = this[Tt](import_buffer.Buffer.from(l));
775
+ for (let c = 1; c < a.length; c++) h = this[Tt](a[c]);
776
+ } else h = this[Tt](import_buffer.Buffer.from(a));
777
+ return i && i(), h;
777
778
  }
778
779
  };
779
- var Me = class extends ne {
780
+ var Be = class extends re {
780
781
  #t;
781
782
  #i;
782
783
  constructor(t, e) {
@@ -802,97 +803,98 @@ var Me = class extends ne {
802
803
  }
803
804
  }
804
805
  };
805
- var Be = class extends Me {
806
+ var Pe = class extends Be {
806
807
  #t;
807
808
  constructor(t) {
808
809
  super(t, "Gzip"), this.#t = t && !!t.portable;
809
810
  }
810
- [Ot](t) {
811
- return this.#t ? (this.#t = false, t[9] = 255, super[Ot](t)) : super[Ot](t);
811
+ [Tt](t) {
812
+ return this.#t ? (this.#t = false, t[9] = 255, super[Tt](t)) : super[Tt](t);
812
813
  }
813
814
  };
814
- var Pe = class extends Me {
815
+ var ze = class extends Be {
815
816
  constructor(t) {
816
817
  super(t, "Unzip");
817
818
  }
818
819
  };
819
- var ze = class extends ne {
820
+ var Ue = class extends re {
820
821
  constructor(t, e) {
821
822
  t = t || {}, t.flush = t.flush || M.BROTLI_OPERATION_PROCESS, t.finishFlush = t.finishFlush || M.BROTLI_OPERATION_FINISH, t.fullFlushFlag = M.BROTLI_OPERATION_FLUSH, super(t, e);
822
823
  }
823
824
  };
824
- var Ue = class extends ze {
825
+ var He = class extends Ue {
825
826
  constructor(t) {
826
827
  super(t, "BrotliCompress");
827
828
  }
828
829
  };
829
- var He = class extends ze {
830
+ var We = class extends Ue {
830
831
  constructor(t) {
831
832
  super(t, "BrotliDecompress");
832
833
  }
833
834
  };
834
- var We = class extends ne {
835
+ var Ge = class extends re {
835
836
  constructor(t, e) {
836
837
  t = t || {}, t.flush = t.flush || M.ZSTD_e_continue, t.finishFlush = t.finishFlush || M.ZSTD_e_end, t.fullFlushFlag = M.ZSTD_e_flush, super(t, e);
837
838
  }
838
839
  };
839
- var Ge = class extends We {
840
+ var Ze = class extends Ge {
840
841
  constructor(t) {
841
842
  super(t, "ZstdCompress");
842
843
  }
843
844
  };
844
- var Ze = class extends We {
845
+ var Ye = class extends Ge {
845
846
  constructor(t) {
846
847
  super(t, "ZstdDecompress");
847
848
  }
848
849
  };
849
- var Bs = (s3, t) => {
850
- if (Number.isSafeInteger(s3)) s3 < 0 ? jr(s3, t) : qr(s3, t);
850
+ var Ps = (s3, t) => {
851
+ if (Number.isSafeInteger(s3)) s3 < 0 ? nn(s3, t) : rn(s3, t);
851
852
  else throw Error("cannot encode number outside of javascript safe integer range");
852
853
  return t;
853
854
  };
854
- var qr = (s3, t) => {
855
+ var rn = (s3, t) => {
855
856
  t[0] = 128;
856
857
  for (var e = t.length; e > 1; e--) t[e - 1] = s3 & 255, s3 = Math.floor(s3 / 256);
857
858
  };
858
- var jr = (s3, t) => {
859
+ var nn = (s3, t) => {
859
860
  t[0] = 255;
860
861
  var e = false;
861
862
  s3 = s3 * -1;
862
863
  for (var i = t.length; i > 1; i--) {
863
864
  var r = s3 & 255;
864
- s3 = Math.floor(s3 / 256), e ? t[i - 1] = zs(r) : r === 0 ? t[i - 1] = 0 : (e = true, t[i - 1] = Us(r));
865
+ s3 = Math.floor(s3 / 256), e ? t[i - 1] = Us(r) : r === 0 ? t[i - 1] = 0 : (e = true, t[i - 1] = Hs(r));
865
866
  }
866
867
  };
867
- var Ps = (s3) => {
868
- let t = s3[0], e = t === 128 ? Jr(s3.subarray(1, s3.length)) : t === 255 ? Qr(s3) : null;
868
+ var zs = (s3) => {
869
+ let t = s3[0], e = t === 128 ? hn(s3.subarray(1, s3.length)) : t === 255 ? on(s3) : null;
869
870
  if (e === null) throw Error("invalid base256 encoding");
870
871
  if (!Number.isSafeInteger(e)) throw Error("parsed number outside of javascript safe integer range");
871
872
  return e;
872
873
  };
873
- var Qr = (s3) => {
874
+ var on = (s3) => {
874
875
  for (var t = s3.length, e = 0, i = false, r = t - 1; r > -1; r--) {
875
876
  var n = Number(s3[r]), o;
876
- i ? o = zs(n) : n === 0 ? o = n : (i = true, o = Us(n)), o !== 0 && (e -= o * Math.pow(256, t - r - 1));
877
+ i ? o = Us(n) : n === 0 ? o = n : (i = true, o = Hs(n)), o !== 0 && (e -= o * Math.pow(256, t - r - 1));
877
878
  }
878
879
  return e;
879
880
  };
880
- var Jr = (s3) => {
881
+ var hn = (s3) => {
881
882
  for (var t = s3.length, e = 0, i = t - 1; i > -1; i--) {
882
883
  var r = Number(s3[i]);
883
884
  r !== 0 && (e += r * Math.pow(256, t - i - 1));
884
885
  }
885
886
  return e;
886
887
  };
887
- var zs = (s3) => (255 ^ s3) & 255;
888
- var Us = (s3) => (255 ^ s3) + 1 & 255;
889
- var Mi = {};
890
- Ar(Mi, { code: () => Ye, isCode: () => oe, isName: () => en, name: () => he });
891
- var oe = (s3) => he.has(s3);
892
- var en = (s3) => Ye.has(s3);
893
- var he = /* @__PURE__ */ new Map([["0", "File"], ["", "OldFile"], ["1", "Link"], ["2", "SymbolicLink"], ["3", "CharacterDevice"], ["4", "BlockDevice"], ["5", "Directory"], ["6", "FIFO"], ["7", "ContiguousFile"], ["g", "GlobalExtendedHeader"], ["x", "ExtendedHeader"], ["A", "SolarisACL"], ["D", "GNUDumpDir"], ["I", "Inode"], ["K", "NextFileHasLongLinkpath"], ["L", "NextFileHasLongPath"], ["M", "ContinuationFile"], ["N", "OldGnuLongPath"], ["S", "SparseFile"], ["V", "TapeVolumeHeader"], ["X", "OldExtendedHeader"]]);
894
- var Ye = new Map(Array.from(he).map((s3) => [s3[1], s3[0]]));
895
- var F = class {
888
+ var Us = (s3) => (255 ^ s3) & 255;
889
+ var Hs = (s3) => (255 ^ s3) + 1 & 255;
890
+ var Ui = {};
891
+ Br(Ui, { code: () => Ke, isCode: () => ne, isName: () => ln, name: () => oe, normalFsTypes: () => zi });
892
+ var ne = (s3) => oe.has(s3);
893
+ var ln = (s3) => Ke.has(s3);
894
+ var zi = /* @__PURE__ */ new Set(["0", "", "1", "2", "3", "4", "5", "6", "7", "D"]);
895
+ var oe = /* @__PURE__ */ new Map([["0", "File"], ["", "OldFile"], ["1", "Link"], ["2", "SymbolicLink"], ["3", "CharacterDevice"], ["4", "BlockDevice"], ["5", "Directory"], ["6", "FIFO"], ["7", "ContiguousFile"], ["g", "GlobalExtendedHeader"], ["x", "ExtendedHeader"], ["A", "SolarisACL"], ["D", "GNUDumpDir"], ["I", "Inode"], ["K", "NextFileHasLongLinkpath"], ["L", "NextFileHasLongPath"], ["M", "ContinuationFile"], ["N", "OldGnuLongPath"], ["S", "SparseFile"], ["V", "TapeVolumeHeader"], ["X", "OldExtendedHeader"]]);
896
+ var Ke = new Map(Array.from(oe).map((s3) => [s3[1], s3[0]]));
897
+ var C = class {
896
898
  cksumValid = false;
897
899
  needPax = false;
898
900
  nullBlock = false;
@@ -919,46 +921,45 @@ var F = class {
919
921
  }
920
922
  decode(t, e, i, r) {
921
923
  if (e || (e = 0), !t || !(t.length >= e + 512)) throw new Error("need 512 bytes for header");
922
- this.path = i?.path ?? Tt(t, e, 100), this.mode = i?.mode ?? r?.mode ?? at(t, e + 100, 8), this.uid = i?.uid ?? r?.uid ?? at(t, e + 108, 8), this.gid = i?.gid ?? r?.gid ?? at(t, e + 116, 8), this.size = i?.size ?? r?.size ?? at(t, e + 124, 12), this.mtime = i?.mtime ?? r?.mtime ?? Bi(t, e + 136, 12), this.cksum = at(t, e + 148, 12), r && this.#i(r, true), i && this.#i(i);
923
- let n = Tt(t, e + 156, 1);
924
- if (oe(n) && (this.#t = n || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = Tt(t, e + 157, 100), t.subarray(e + 257, e + 265).toString() === "ustar\x0000") if (this.uname = i?.uname ?? r?.uname ?? Tt(t, e + 265, 32), this.gname = i?.gname ?? r?.gname ?? Tt(t, e + 297, 32), this.devmaj = i?.devmaj ?? r?.devmaj ?? at(t, e + 329, 8) ?? 0, this.devmin = i?.devmin ?? r?.devmin ?? at(t, e + 337, 8) ?? 0, t[e + 475] !== 0) {
925
- let h = Tt(t, e + 345, 155);
926
- this.path = h + "/" + this.path;
924
+ let n = xt(t, e + 156, 1), o = zi.has(n), a = o ? i : void 0, h = o ? r : void 0;
925
+ if (this.path = a?.path ?? xt(t, e, 100), this.mode = a?.mode ?? h?.mode ?? at(t, e + 100, 8), this.uid = a?.uid ?? h?.uid ?? at(t, e + 108, 8), this.gid = a?.gid ?? h?.gid ?? at(t, e + 116, 8), this.size = a?.size ?? h?.size ?? at(t, e + 124, 12), this.mtime = a?.mtime ?? h?.mtime ?? Hi(t, e + 136, 12), this.cksum = at(t, e + 148, 12), h && this.#i(h, true), a && this.#i(a), ne(n) && (this.#t = n || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = xt(t, e + 157, 100), t.subarray(e + 257, e + 265).toString() === "ustar\x0000") if (this.uname = a?.uname ?? h?.uname ?? xt(t, e + 265, 32), this.gname = a?.gname ?? h?.gname ?? xt(t, e + 297, 32), this.devmaj = a?.devmaj ?? h?.devmaj ?? at(t, e + 329, 8) ?? 0, this.devmin = a?.devmin ?? h?.devmin ?? at(t, e + 337, 8) ?? 0, t[e + 475] !== 0) {
926
+ let c = xt(t, e + 345, 155);
927
+ this.path = c + "/" + this.path;
927
928
  } else {
928
- let h = Tt(t, e + 345, 130);
929
- h && (this.path = h + "/" + this.path), this.atime = i?.atime ?? r?.atime ?? Bi(t, e + 476, 12), this.ctime = i?.ctime ?? r?.ctime ?? Bi(t, e + 488, 12);
929
+ let c = xt(t, e + 345, 130);
930
+ c && (this.path = c + "/" + this.path), this.atime = i?.atime ?? r?.atime ?? Hi(t, e + 476, 12), this.ctime = i?.ctime ?? r?.ctime ?? Hi(t, e + 488, 12);
930
931
  }
931
- let o = 256;
932
- for (let h = e; h < e + 148; h++) o += t[h];
933
- for (let h = e + 156; h < e + 512; h++) o += t[h];
934
- this.cksumValid = o === this.cksum, this.cksum === void 0 && o === 256 && (this.nullBlock = true);
932
+ let l = 256;
933
+ for (let c = e; c < e + 148; c++) l += t[c];
934
+ for (let c = e + 156; c < e + 512; c++) l += t[c];
935
+ this.cksumValid = l === this.cksum, this.cksum === void 0 && l === 256 && (this.nullBlock = true);
935
936
  }
936
937
  #i(t, e = false) {
937
938
  Object.assign(this, Object.fromEntries(Object.entries(t).filter(([i, r]) => !(r == null || i === "path" && e || i === "linkpath" && e || i === "global"))));
938
939
  }
939
940
  encode(t, e = 0) {
940
941
  if (t || (t = this.block = Buffer.alloc(512)), this.#t === "Unsupported" && (this.#t = "0"), !(t.length >= e + 512)) throw new Error("need 512 bytes for header");
941
- let i = this.ctime || this.atime ? 130 : 155, r = sn(this.path || "", i), n = r[0], o = r[1];
942
- this.needPax = !!r[2], this.needPax = xt(t, e, 100, n) || this.needPax, this.needPax = lt(t, e + 100, 8, this.mode) || this.needPax, this.needPax = lt(t, e + 108, 8, this.uid) || this.needPax, this.needPax = lt(t, e + 116, 8, this.gid) || this.needPax, this.needPax = lt(t, e + 124, 12, this.size) || this.needPax, this.needPax = Pi(t, e + 136, 12, this.mtime) || this.needPax, t[e + 156] = this.#t.charCodeAt(0), this.needPax = xt(t, e + 157, 100, this.linkpath) || this.needPax, t.write("ustar\x0000", e + 257, 8), this.needPax = xt(t, e + 265, 32, this.uname) || this.needPax, this.needPax = xt(t, e + 297, 32, this.gname) || this.needPax, this.needPax = lt(t, e + 329, 8, this.devmaj) || this.needPax, this.needPax = lt(t, e + 337, 8, this.devmin) || this.needPax, this.needPax = xt(t, e + 345, i, o) || this.needPax, t[e + 475] !== 0 ? this.needPax = xt(t, e + 345, 155, o) || this.needPax : (this.needPax = xt(t, e + 345, 130, o) || this.needPax, this.needPax = Pi(t, e + 476, 12, this.atime) || this.needPax, this.needPax = Pi(t, e + 488, 12, this.ctime) || this.needPax);
943
- let h = 256;
944
- for (let a = e; a < e + 148; a++) h += t[a];
945
- for (let a = e + 156; a < e + 512; a++) h += t[a];
946
- return this.cksum = h, lt(t, e + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
942
+ let i = this.ctime || this.atime ? 130 : 155, r = cn(this.path || "", i), n = r[0], o = r[1];
943
+ this.needPax = !!r[2], this.needPax = Lt(t, e, 100, n) || this.needPax, this.needPax = lt(t, e + 100, 8, this.mode) || this.needPax, this.needPax = lt(t, e + 108, 8, this.uid) || this.needPax, this.needPax = lt(t, e + 116, 8, this.gid) || this.needPax, this.needPax = lt(t, e + 124, 12, this.size) || this.needPax, this.needPax = Wi(t, e + 136, 12, this.mtime) || this.needPax, t[e + 156] = Number(this.#t.codePointAt(0)), this.needPax = Lt(t, e + 157, 100, this.linkpath) || this.needPax, t.write("ustar\x0000", e + 257, 8), this.needPax = Lt(t, e + 265, 32, this.uname) || this.needPax, this.needPax = Lt(t, e + 297, 32, this.gname) || this.needPax, this.needPax = lt(t, e + 329, 8, this.devmaj) || this.needPax, this.needPax = lt(t, e + 337, 8, this.devmin) || this.needPax, this.needPax = Lt(t, e + 345, i, o) || this.needPax, t[e + 475] !== 0 ? this.needPax = Lt(t, e + 345, 155, o) || this.needPax : (this.needPax = Lt(t, e + 345, 130, o) || this.needPax, this.needPax = Wi(t, e + 476, 12, this.atime) || this.needPax, this.needPax = Wi(t, e + 488, 12, this.ctime) || this.needPax);
944
+ let a = 256;
945
+ for (let h = e; h < e + 148; h++) a += t[h];
946
+ for (let h = e + 156; h < e + 512; h++) a += t[h];
947
+ return this.cksum = a, lt(t, e + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
947
948
  }
948
949
  get type() {
949
- return this.#t === "Unsupported" ? this.#t : he.get(this.#t);
950
+ return this.#t === "Unsupported" ? this.#t : oe.get(this.#t);
950
951
  }
951
952
  get typeKey() {
952
953
  return this.#t;
953
954
  }
954
955
  set type(t) {
955
- let e = String(Ye.get(t));
956
- if (oe(e) || e === "Unsupported") this.#t = e;
957
- else if (oe(t)) this.#t = t;
956
+ let e = String(Ke.get(t));
957
+ if (ne(e) || e === "Unsupported") this.#t = e;
958
+ else if (ne(t)) this.#t = t;
958
959
  else throw new TypeError("invalid entry type: " + t);
959
960
  }
960
961
  };
961
- var sn = (s3, t) => {
962
+ var cn = (s3, t) => {
962
963
  let i = s3, r = "", n, o = import_node_path2.posix.parse(s3).root || ".";
963
964
  if (Buffer.byteLength(i) < 100) n = [i, r, false];
964
965
  else {
@@ -970,20 +971,20 @@ var sn = (s3, t) => {
970
971
  }
971
972
  return n;
972
973
  };
973
- var Tt = (s3, t, e) => s3.subarray(t, t + e).toString("utf8").replace(/\0.*/, "");
974
- var Bi = (s3, t, e) => rn(at(s3, t, e));
975
- var rn = (s3) => s3 === void 0 ? void 0 : new Date(s3 * 1e3);
976
- var at = (s3, t, e) => Number(s3[t]) & 128 ? Ps(s3.subarray(t, t + e)) : on(s3, t, e);
977
- var nn = (s3) => isNaN(s3) ? void 0 : s3;
978
- var on = (s3, t, e) => nn(parseInt(s3.subarray(t, t + e).toString("utf8").replace(/\0.*$/, "").trim(), 8));
979
- var hn = { 12: 8589934591, 8: 2097151 };
980
- var lt = (s3, t, e, i) => i === void 0 ? false : i > hn[e] || i < 0 ? (Bs(i, s3.subarray(t, t + e)), true) : (an(s3, t, e, i), false);
981
- var an = (s3, t, e, i) => s3.write(ln(i, e), t, e, "ascii");
982
- var ln = (s3, t) => cn(Math.floor(s3).toString(8), t);
983
- var cn = (s3, t) => (s3.length === t - 1 ? s3 : new Array(t - s3.length - 1).join("0") + s3 + " ") + "\0";
984
- var Pi = (s3, t, e, i) => i === void 0 ? false : lt(s3, t, e, i.getTime() / 1e3);
985
- var fn = new Array(156).join("\0");
986
- var xt = (s3, t, e, i) => i === void 0 ? false : (s3.write(i + fn, t, e, "utf8"), i.length !== Buffer.byteLength(i) || i.length > e);
974
+ var xt = (s3, t, e) => s3.subarray(t, t + e).toString("utf8").replace(/\0.*/, "");
975
+ var Hi = (s3, t, e) => fn(at(s3, t, e));
976
+ var fn = (s3) => s3 === void 0 ? void 0 : new Date(s3 * 1e3);
977
+ var at = (s3, t, e) => Number(s3[t]) & 128 ? zs(s3.subarray(t, t + e)) : un(s3, t, e);
978
+ var dn = (s3) => isNaN(s3) ? void 0 : s3;
979
+ var un = (s3, t, e) => dn(parseInt(s3.subarray(t, t + e).toString("utf8").replace(/\0.*$/, "").trim(), 8));
980
+ var mn = { 12: 8589934591, 8: 2097151 };
981
+ var lt = (s3, t, e, i) => i === void 0 ? false : i > mn[e] || i < 0 ? (Ps(i, s3.subarray(t, t + e)), true) : (pn(s3, t, e, i), false);
982
+ var pn = (s3, t, e, i) => s3.write(En(i, e), t, e, "ascii");
983
+ var En = (s3, t) => wn(Math.floor(s3).toString(8), t);
984
+ var wn = (s3, t) => (s3.length === t - 1 ? s3 : new Array(t - s3.length - 1).join("0") + s3 + " ") + "\0";
985
+ var Wi = (s3, t, e, i) => i === void 0 ? false : lt(s3, t, e, i.getTime() / 1e3);
986
+ var Sn = new Array(156).join("\0");
987
+ var Lt = (s3, t, e, i) => i === void 0 ? false : (s3.write(i + Sn, t, e, "utf8"), i.length !== Buffer.byteLength(i) || i.length > e);
987
988
  var ct = class s {
988
989
  atime;
989
990
  mtime;
@@ -1010,7 +1011,7 @@ var ct = class s {
1010
1011
  if (t === "") return Buffer.allocUnsafe(0);
1011
1012
  let e = Buffer.byteLength(t), i = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i);
1012
1013
  for (let n = 0; n < 512; n++) r[n] = 0;
1013
- new F({ path: ("PaxHeader/" + (0, import_node_path3.basename)(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t, 512, e, "utf8");
1014
+ new C({ path: ("PaxHeader/" + (0, import_node_path3.basename)(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t, 512, e, "utf8");
1014
1015
  for (let n = e + 512; n < r.length; n++) r[n] = 0;
1015
1016
  return r;
1016
1017
  }
@@ -1024,13 +1025,13 @@ var ct = class s {
1024
1025
  return n + o >= Math.pow(10, o) && (o += 1), o + n + r;
1025
1026
  }
1026
1027
  static parse(t, e, i = false) {
1027
- return new s(un(mn(t), e), i);
1028
+ return new s(Rn(gn(t), e), i);
1028
1029
  }
1029
1030
  };
1030
- var un = (s3, t) => t ? Object.assign({}, t, s3) : s3;
1031
- var mn = (s3) => s3.replace(/\n$/, "").split(`
1032
- `).reduce(pn, /* @__PURE__ */ Object.create(null));
1033
- var pn = (s3, t) => {
1031
+ var Rn = (s3, t) => t ? Object.assign({}, t, s3) : s3;
1032
+ var gn = (s3) => s3.replace(/\n$/, "").split(`
1033
+ `).reduce(bn, /* @__PURE__ */ Object.create(null));
1034
+ var bn = (s3, t) => {
1034
1035
  let e = parseInt(t, 10);
1035
1036
  if (e !== Buffer.byteLength(t) + 1) return s3;
1036
1037
  t = t.slice((e + " ").length);
@@ -1039,9 +1040,9 @@ var pn = (s3, t) => {
1039
1040
  let n = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o = i.join("=");
1040
1041
  return s3[n] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n) ? new Date(Number(o) * 1e3) : /^[0-9]+$/.test(o) ? +o : o, s3;
1041
1042
  };
1042
- var En = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
1043
- var f = En !== "win32" ? (s3) => s3 : (s3) => s3 && s3.replace(/\\/g, "/");
1044
- var Yt = class extends A {
1043
+ var _n = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
1044
+ var f = _n !== "win32" ? (s3) => s3 : (s3) => s3 && s3.replaceAll(/\\/g, "/");
1045
+ var Ve = class extends A {
1045
1046
  extended;
1046
1047
  globalExtended;
1047
1048
  header;
@@ -1105,44 +1106,44 @@ var Yt = class extends A {
1105
1106
  t.path && (t.path = f(t.path)), t.linkpath && (t.linkpath = f(t.linkpath)), Object.assign(this, Object.fromEntries(Object.entries(t).filter(([i, r]) => !(r == null || i === "path" && e))));
1106
1107
  }
1107
1108
  };
1108
- var Lt = (s3, t, e, i = {}) => {
1109
+ var Nt = (s3, t, e, i = {}) => {
1109
1110
  s3.file && (i.file = s3.file), s3.cwd && (i.cwd = s3.cwd), i.code = e instanceof Error && e.code || t, i.tarCode = t, !s3.strict && i.recoverable !== false ? (e instanceof Error && (i = Object.assign(e, i), e = e.message), s3.emit("warn", t, e, i)) : e instanceof Error ? s3.emit("error", Object.assign(e, i)) : s3.emit("error", Object.assign(new Error(`${t}: ${e}`), i));
1110
1111
  };
1111
- var Sn = 1024 * 1024;
1112
- var Gi = Buffer.from([31, 139]);
1113
- var Zi = Buffer.from([40, 181, 47, 253]);
1114
- var yn = Math.max(Gi.length, Zi.length);
1112
+ var Tn = 1024 * 1024;
1113
+ var Vi = Buffer.from([31, 139]);
1114
+ var $i = Buffer.from([40, 181, 47, 253]);
1115
+ var xn = Math.max(Vi.length, $i.length);
1115
1116
  var B = /* @__PURE__ */ Symbol("state");
1116
- var Nt = /* @__PURE__ */ Symbol("writeEntry");
1117
+ var Dt = /* @__PURE__ */ Symbol("writeEntry");
1117
1118
  var et = /* @__PURE__ */ Symbol("readEntry");
1118
- var zi = /* @__PURE__ */ Symbol("nextEntry");
1119
- var Hs = /* @__PURE__ */ Symbol("processEntry");
1119
+ var Gi = /* @__PURE__ */ Symbol("nextEntry");
1120
+ var Ws = /* @__PURE__ */ Symbol("processEntry");
1120
1121
  var V = /* @__PURE__ */ Symbol("extendedHeader");
1121
- var ae = /* @__PURE__ */ Symbol("globalExtendedHeader");
1122
+ var he = /* @__PURE__ */ Symbol("globalExtendedHeader");
1122
1123
  var ft = /* @__PURE__ */ Symbol("meta");
1123
- var Ws = /* @__PURE__ */ Symbol("emitMeta");
1124
+ var Gs = /* @__PURE__ */ Symbol("emitMeta");
1124
1125
  var p = /* @__PURE__ */ Symbol("buffer");
1125
1126
  var it = /* @__PURE__ */ Symbol("queue");
1126
1127
  var dt = /* @__PURE__ */ Symbol("ended");
1127
- var Ui = /* @__PURE__ */ Symbol("emittedEnd");
1128
- var Dt = /* @__PURE__ */ Symbol("emit");
1128
+ var Zi = /* @__PURE__ */ Symbol("emittedEnd");
1129
+ var At = /* @__PURE__ */ Symbol("emit");
1129
1130
  var y = /* @__PURE__ */ Symbol("unzip");
1130
- var Ke = /* @__PURE__ */ Symbol("consumeChunk");
1131
- var Ve = /* @__PURE__ */ Symbol("consumeChunkSub");
1132
- var Hi = /* @__PURE__ */ Symbol("consumeBody");
1133
- var Gs = /* @__PURE__ */ Symbol("consumeMeta");
1134
- var Zs = /* @__PURE__ */ Symbol("consumeHeader");
1135
- var le = /* @__PURE__ */ Symbol("consuming");
1136
- var Wi = /* @__PURE__ */ Symbol("bufferConcat");
1137
- var $e = /* @__PURE__ */ Symbol("maybeEnd");
1138
- var Kt = /* @__PURE__ */ Symbol("writing");
1131
+ var $e = /* @__PURE__ */ Symbol("consumeChunk");
1132
+ var Xe = /* @__PURE__ */ Symbol("consumeChunkSub");
1133
+ var Yi = /* @__PURE__ */ Symbol("consumeBody");
1134
+ var Zs = /* @__PURE__ */ Symbol("consumeMeta");
1135
+ var Ys = /* @__PURE__ */ Symbol("consumeHeader");
1136
+ var ae = /* @__PURE__ */ Symbol("consuming");
1137
+ var Ki = /* @__PURE__ */ Symbol("bufferConcat");
1138
+ var qe = /* @__PURE__ */ Symbol("maybeEnd");
1139
+ var Yt = /* @__PURE__ */ Symbol("writing");
1139
1140
  var ut = /* @__PURE__ */ Symbol("aborted");
1140
- var Xe = /* @__PURE__ */ Symbol("onDone");
1141
- var At = /* @__PURE__ */ Symbol("sawValidEntry");
1142
- var qe = /* @__PURE__ */ Symbol("sawNullBlock");
1141
+ var Qe = /* @__PURE__ */ Symbol("onDone");
1142
+ var It = /* @__PURE__ */ Symbol("sawValidEntry");
1143
+ var Je = /* @__PURE__ */ Symbol("sawNullBlock");
1143
1144
  var je = /* @__PURE__ */ Symbol("sawEOF");
1144
- var Ys = /* @__PURE__ */ Symbol("closeStream");
1145
- var Rn = () => true;
1145
+ var Ks = /* @__PURE__ */ Symbol("closeStream");
1146
+ var Ln = () => true;
1146
1147
  var st = class extends import_events2.EventEmitter {
1147
1148
  file;
1148
1149
  strict;
@@ -1155,103 +1156,103 @@ var st = class extends import_events2.EventEmitter {
1155
1156
  [it] = [];
1156
1157
  [p];
1157
1158
  [et];
1158
- [Nt];
1159
+ [Dt];
1159
1160
  [B] = "begin";
1160
1161
  [ft] = "";
1161
1162
  [V];
1162
- [ae];
1163
+ [he];
1163
1164
  [dt] = false;
1164
1165
  [y];
1165
1166
  [ut] = false;
1166
- [At];
1167
- [qe] = false;
1167
+ [It];
1168
+ [Je] = false;
1168
1169
  [je] = false;
1169
- [Kt] = false;
1170
- [le] = false;
1171
- [Ui] = false;
1170
+ [Yt] = false;
1171
+ [ae] = false;
1172
+ [Zi] = false;
1172
1173
  constructor(t = {}) {
1173
- super(), this.file = t.file || "", this.on(Xe, () => {
1174
- (this[B] === "begin" || this[At] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
1175
- }), t.ondone ? this.on(Xe, t.ondone) : this.on(Xe, () => {
1174
+ super(), this.file = t.file || "", this.on(Qe, () => {
1175
+ (this[B] === "begin" || this[It] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
1176
+ }), t.ondone ? this.on(Qe, t.ondone) : this.on(Qe, () => {
1176
1177
  this.emit("prefinish"), this.emit("finish"), this.emit("end");
1177
- }), this.strict = !!t.strict, this.maxMetaEntrySize = t.maxMetaEntrySize || Sn, this.filter = typeof t.filter == "function" ? t.filter : Rn;
1178
+ }), this.strict = !!t.strict, this.maxMetaEntrySize = t.maxMetaEntrySize || Tn, this.filter = typeof t.filter == "function" ? t.filter : Ln;
1178
1179
  let e = t.file && (t.file.endsWith(".tar.br") || t.file.endsWith(".tbr"));
1179
1180
  this.brotli = !(t.gzip || t.zstd) && t.brotli !== void 0 ? t.brotli : e ? void 0 : false;
1180
1181
  let i = t.file && (t.file.endsWith(".tar.zst") || t.file.endsWith(".tzst"));
1181
- this.zstd = !(t.gzip || t.brotli) && t.zstd !== void 0 ? t.zstd : i ? true : void 0, this.on("end", () => this[Ys]()), typeof t.onwarn == "function" && this.on("warn", t.onwarn), typeof t.onReadEntry == "function" && this.on("entry", t.onReadEntry);
1182
+ this.zstd = !(t.gzip || t.brotli) && t.zstd !== void 0 ? t.zstd : i ? true : void 0, this.on("end", () => this[Ks]()), typeof t.onwarn == "function" && this.on("warn", t.onwarn), typeof t.onReadEntry == "function" && this.on("entry", t.onReadEntry);
1182
1183
  }
1183
1184
  warn(t, e, i = {}) {
1184
- Lt(this, t, e, i);
1185
+ Nt(this, t, e, i);
1185
1186
  }
1186
- [Zs](t, e) {
1187
- this[At] === void 0 && (this[At] = false);
1187
+ [Ys](t, e) {
1188
+ this[It] === void 0 && (this[It] = false);
1188
1189
  let i;
1189
1190
  try {
1190
- i = new F(t, e, this[V], this[ae]);
1191
+ i = new C(t, e, this[V], this[he]);
1191
1192
  } catch (r) {
1192
1193
  return this.warn("TAR_ENTRY_INVALID", r);
1193
1194
  }
1194
- if (i.nullBlock) this[qe] ? (this[je] = true, this[B] === "begin" && (this[B] = "header"), this[Dt]("eof")) : (this[qe] = true, this[Dt]("nullBlock"));
1195
- else if (this[qe] = false, !i.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: i });
1195
+ if (i.nullBlock) this[Je] ? (this[je] = true, this[B] === "begin" && (this[B] = "header"), this[At]("eof")) : (this[Je] = true, this[At]("nullBlock"));
1196
+ else if (this[Je] = false, !i.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: i });
1196
1197
  else if (!i.path) this.warn("TAR_ENTRY_INVALID", "path is required", { header: i });
1197
1198
  else {
1198
1199
  let r = i.type;
1199
1200
  if (/^(Symbolic)?Link$/.test(r) && !i.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath required", { header: i });
1200
1201
  else if (!/^(Symbolic)?Link$/.test(r) && !/^(Global)?ExtendedHeader$/.test(r) && i.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: i });
1201
1202
  else {
1202
- let n = this[Nt] = new Yt(i, this[V], this[ae]);
1203
- if (!this[At]) if (n.remain) {
1203
+ let n = this[Dt] = new Ve(i, this[V], this[he]);
1204
+ if (!this[It]) if (n.remain) {
1204
1205
  let o = () => {
1205
- n.invalid || (this[At] = true);
1206
+ n.invalid || (this[It] = true);
1206
1207
  };
1207
1208
  n.on("end", o);
1208
- } else this[At] = true;
1209
- n.meta ? n.size > this.maxMetaEntrySize ? (n.ignore = true, this[Dt]("ignoredEntry", n), this[B] = "ignore", n.resume()) : n.size > 0 && (this[ft] = "", n.on("data", (o) => this[ft] += o), this[B] = "meta") : (this[V] = void 0, n.ignore = n.ignore || !this.filter(n.path, n), n.ignore ? (this[Dt]("ignoredEntry", n), this[B] = n.remain ? "ignore" : "header", n.resume()) : (n.remain ? this[B] = "body" : (this[B] = "header", n.end()), this[et] ? this[it].push(n) : (this[it].push(n), this[zi]())));
1209
+ } else this[It] = true;
1210
+ n.meta ? n.size > this.maxMetaEntrySize ? (n.ignore = true, this[At]("ignoredEntry", n), this[B] = "ignore", n.resume()) : n.size > 0 && (this[ft] = "", n.on("data", (o) => this[ft] += o), this[B] = "meta") : (this[V] = void 0, n.ignore = n.ignore || !this.filter(n.path, n), n.ignore ? (this[At]("ignoredEntry", n), this[B] = n.remain ? "ignore" : "header", n.resume()) : (n.remain ? this[B] = "body" : (this[B] = "header", n.end()), this[et] ? this[it].push(n) : (this[it].push(n), this[Gi]())));
1210
1211
  }
1211
1212
  }
1212
1213
  }
1213
- [Ys]() {
1214
+ [Ks]() {
1214
1215
  queueMicrotask(() => this.emit("close"));
1215
1216
  }
1216
- [Hs](t) {
1217
+ [Ws](t) {
1217
1218
  let e = true;
1218
1219
  if (!t) this[et] = void 0, e = false;
1219
1220
  else if (Array.isArray(t)) {
1220
1221
  let [i, ...r] = t;
1221
1222
  this.emit(i, ...r);
1222
- } else this[et] = t, this.emit("entry", t), t.emittedEnd || (t.on("end", () => this[zi]()), e = false);
1223
+ } else this[et] = t, this.emit("entry", t), t.emittedEnd || (t.on("end", () => this[Gi]()), e = false);
1223
1224
  return e;
1224
1225
  }
1225
- [zi]() {
1226
+ [Gi]() {
1226
1227
  do
1227
1228
  ;
1228
- while (this[Hs](this[it].shift()));
1229
- if (!this[it].length) {
1229
+ while (this[Ws](this[it].shift()));
1230
+ if (this[it].length === 0) {
1230
1231
  let t = this[et];
1231
- !t || t.flowing || t.size === t.remain ? this[Kt] || this.emit("drain") : t.once("drain", () => this.emit("drain"));
1232
+ !t || t.flowing || t.size === t.remain ? this[Yt] || this.emit("drain") : t.once("drain", () => this.emit("drain"));
1232
1233
  }
1233
1234
  }
1234
- [Hi](t, e) {
1235
- let i = this[Nt];
1235
+ [Yi](t, e) {
1236
+ let i = this[Dt];
1236
1237
  if (!i) throw new Error("attempt to consume body without entry??");
1237
1238
  let r = i.blockRemain ?? 0, n = r >= t.length && e === 0 ? t : t.subarray(e, e + r);
1238
- return i.write(n), i.blockRemain || (this[B] = "header", this[Nt] = void 0, i.end()), n.length;
1239
+ return i.write(n), i.blockRemain || (this[B] = "header", this[Dt] = void 0, i.end()), n.length;
1239
1240
  }
1240
- [Gs](t, e) {
1241
- let i = this[Nt], r = this[Hi](t, e);
1242
- return !this[Nt] && i && this[Ws](i), r;
1241
+ [Zs](t, e) {
1242
+ let i = this[Dt], r = this[Yi](t, e);
1243
+ return !this[Dt] && i && this[Gs](i), r;
1243
1244
  }
1244
- [Dt](t, e, i) {
1245
- !this[it].length && !this[et] ? this.emit(t, e, i) : this[it].push([t, e, i]);
1245
+ [At](t, e, i) {
1246
+ this[it].length === 0 && !this[et] ? this.emit(t, e, i) : this[it].push([t, e, i]);
1246
1247
  }
1247
- [Ws](t) {
1248
- switch (this[Dt]("meta", this[ft]), t.type) {
1248
+ [Gs](t) {
1249
+ switch (this[At]("meta", this[ft]), t.type) {
1249
1250
  case "ExtendedHeader":
1250
1251
  case "OldExtendedHeader":
1251
1252
  this[V] = ct.parse(this[ft], this[V], false);
1252
1253
  break;
1253
1254
  case "GlobalExtendedHeader":
1254
- this[ae] = ct.parse(this[ft], this[ae], true);
1255
+ this[he] = ct.parse(this[ft], this[he], true);
1255
1256
  break;
1256
1257
  case "NextFileHasLongPath":
1257
1258
  case "OldGnuLongPath": {
@@ -1274,89 +1275,89 @@ var st = class extends import_events2.EventEmitter {
1274
1275
  write(t, e, i) {
1275
1276
  if (typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e == "string" ? e : "utf8")), this[ut]) return i?.(), false;
1276
1277
  if ((this[y] === void 0 || this.brotli === void 0 && this[y] === false) && t) {
1277
- if (this[p] && (t = Buffer.concat([this[p], t]), this[p] = void 0), t.length < yn) return this[p] = t, i?.(), true;
1278
- for (let a = 0; this[y] === void 0 && a < Gi.length; a++) t[a] !== Gi[a] && (this[y] = false);
1278
+ if (this[p] && (t = Buffer.concat([this[p], t]), this[p] = void 0), t.length < xn) return this[p] = t, i?.(), true;
1279
+ for (let h = 0; this[y] === void 0 && h < Vi.length; h++) t[h] !== Vi[h] && (this[y] = false);
1279
1280
  let o = false;
1280
1281
  if (this[y] === false && this.zstd !== false) {
1281
1282
  o = true;
1282
- for (let a = 0; a < Zi.length; a++) if (t[a] !== Zi[a]) {
1283
+ for (let h = 0; h < $i.length; h++) if (t[h] !== $i[h]) {
1283
1284
  o = false;
1284
1285
  break;
1285
1286
  }
1286
1287
  }
1287
- let h = this.brotli === void 0 && !o;
1288
- if (this[y] === false && h) if (t.length < 512) if (this[dt]) this.brotli = true;
1288
+ let a = this.brotli === void 0 && !o;
1289
+ if (this[y] === false && a) if (t.length < 512) if (this[dt]) this.brotli = true;
1289
1290
  else return this[p] = t, i?.(), true;
1290
1291
  else try {
1291
- new F(t.subarray(0, 512)), this.brotli = false;
1292
+ new C(t.subarray(0, 512)), this.brotli = false;
1292
1293
  } catch {
1293
1294
  this.brotli = true;
1294
1295
  }
1295
1296
  if (this[y] === void 0 || this[y] === false && (this.brotli || o)) {
1296
- let a = this[dt];
1297
- this[dt] = false, this[y] = this[y] === void 0 ? new Pe({}) : o ? new Ze({}) : new He({}), this[y].on("data", (c) => this[Ke](c)), this[y].on("error", (c) => this.abort(c)), this[y].on("end", () => {
1298
- this[dt] = true, this[Ke]();
1299
- }), this[Kt] = true;
1300
- let l = !!this[y][a ? "end" : "write"](t);
1301
- return this[Kt] = false, i?.(), l;
1297
+ let h = this[dt];
1298
+ this[dt] = false, this[y] = this[y] === void 0 ? new ze({}) : o ? new Ye({}) : new We({}), this[y].on("data", (c) => this[$e](c)), this[y].on("error", (c) => this.abort(c)), this[y].on("end", () => {
1299
+ this[dt] = true, this[$e]();
1300
+ }), this[Yt] = true;
1301
+ let l = !!this[y][h ? "end" : "write"](t);
1302
+ return this[Yt] = false, i?.(), l;
1302
1303
  }
1303
1304
  }
1304
- this[Kt] = true, this[y] ? this[y].write(t) : this[Ke](t), this[Kt] = false;
1305
- let n = this[it].length ? false : this[et] ? this[et].flowing : true;
1306
- return !n && !this[it].length && this[et]?.once("drain", () => this.emit("drain")), i?.(), n;
1305
+ this[Yt] = true, this[y] ? this[y].write(t) : this[$e](t), this[Yt] = false;
1306
+ let n = this[it].length > 0 ? false : this[et] ? this[et].flowing : true;
1307
+ return !n && this[it].length === 0 && this[et]?.once("drain", () => this.emit("drain")), i?.(), n;
1307
1308
  }
1308
- [Wi](t) {
1309
+ [Ki](t) {
1309
1310
  t && !this[ut] && (this[p] = this[p] ? Buffer.concat([this[p], t]) : t);
1310
1311
  }
1311
- [$e]() {
1312
- if (this[dt] && !this[Ui] && !this[ut] && !this[le]) {
1313
- this[Ui] = true;
1314
- let t = this[Nt];
1312
+ [qe]() {
1313
+ if (this[dt] && !this[Zi] && !this[ut] && !this[ae]) {
1314
+ this[Zi] = true;
1315
+ let t = this[Dt];
1315
1316
  if (t && t.blockRemain) {
1316
1317
  let e = this[p] ? this[p].length : 0;
1317
1318
  this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`, { entry: t }), this[p] && t.write(this[p]), t.end();
1318
1319
  }
1319
- this[Dt](Xe);
1320
+ this[At](Qe);
1320
1321
  }
1321
1322
  }
1322
- [Ke](t) {
1323
- if (this[le] && t) this[Wi](t);
1324
- else if (!t && !this[p]) this[$e]();
1323
+ [$e](t) {
1324
+ if (this[ae] && t) this[Ki](t);
1325
+ else if (!t && !this[p]) this[qe]();
1325
1326
  else if (t) {
1326
- if (this[le] = true, this[p]) {
1327
- this[Wi](t);
1327
+ if (this[ae] = true, this[p]) {
1328
+ this[Ki](t);
1328
1329
  let e = this[p];
1329
- this[p] = void 0, this[Ve](e);
1330
- } else this[Ve](t);
1330
+ this[p] = void 0, this[Xe](e);
1331
+ } else this[Xe](t);
1331
1332
  for (; this[p] && this[p]?.length >= 512 && !this[ut] && !this[je]; ) {
1332
1333
  let e = this[p];
1333
- this[p] = void 0, this[Ve](e);
1334
+ this[p] = void 0, this[Xe](e);
1334
1335
  }
1335
- this[le] = false;
1336
+ this[ae] = false;
1336
1337
  }
1337
- (!this[p] || this[dt]) && this[$e]();
1338
+ (!this[p] || this[dt]) && this[qe]();
1338
1339
  }
1339
- [Ve](t) {
1340
+ [Xe](t) {
1340
1341
  let e = 0, i = t.length;
1341
1342
  for (; e + 512 <= i && !this[ut] && !this[je]; ) switch (this[B]) {
1342
1343
  case "begin":
1343
1344
  case "header":
1344
- this[Zs](t, e), e += 512;
1345
+ this[Ys](t, e), e += 512;
1345
1346
  break;
1346
1347
  case "ignore":
1347
1348
  case "body":
1348
- e += this[Hi](t, e);
1349
+ e += this[Yi](t, e);
1349
1350
  break;
1350
1351
  case "meta":
1351
- e += this[Gs](t, e);
1352
+ e += this[Zs](t, e);
1352
1353
  break;
1353
1354
  default:
1354
1355
  throw new Error("invalid state: " + this[B]);
1355
1356
  }
1356
- e < i && (this[p] ? this[p] = Buffer.concat([t.subarray(e), this[p]]) : this[p] = t.subarray(e));
1357
+ e < i && (this[p] = this[p] ? Buffer.concat([t.subarray(e), this[p]]) : t.subarray(e));
1357
1358
  }
1358
1359
  end(t, e, i) {
1359
- return typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, e)), i && this.once("finish", i), this[ut] || (this[y] ? (t && this[y].write(t), this[y].end()) : (this[dt] = true, (this.brotli === void 0 || this.zstd === void 0) && (t = t || Buffer.alloc(0)), t && this.write(t), this[$e]())), this;
1360
+ return typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, e)), i && this.once("finish", i), this[ut] || (this[y] ? (t && this[y].write(t), this[y].end()) : (this[dt] = true, (this.brotli === void 0 || this.zstd === void 0) && (t = t || Buffer.alloc(0)), t && this.write(t), this[qe]())), this;
1360
1361
  }
1361
1362
  };
1362
1363
  var mt = (s3) => {
@@ -1364,38 +1365,38 @@ var mt = (s3) => {
1364
1365
  for (; t > -1 && s3.charAt(t) === "/"; ) e = t, t--;
1365
1366
  return e === -1 ? s3 : s3.slice(0, e);
1366
1367
  };
1367
- var _n = (s3) => {
1368
+ var An = (s3) => {
1368
1369
  let t = s3.onReadEntry;
1369
1370
  s3.onReadEntry = t ? (e) => {
1370
1371
  t(e), e.resume();
1371
1372
  } : (e) => e.resume();
1372
1373
  };
1373
- var Yi = (s3, t) => {
1374
+ var Xi = (s3, t) => {
1374
1375
  let e = new Map(t.map((n) => [mt(n), true])), i = s3.filter, r = (n, o = "") => {
1375
- let h = o || (0, import_path.parse)(n).root || ".", a;
1376
- if (n === h) a = false;
1376
+ let a = o || (0, import_path.parse)(n).root || ".", h;
1377
+ if (n === a) h = false;
1377
1378
  else {
1378
1379
  let l = e.get(n);
1379
- l !== void 0 ? a = l : a = r((0, import_path.dirname)(n), h);
1380
+ h = l !== void 0 ? l : r((0, import_path.dirname)(n), a);
1380
1381
  }
1381
- return e.set(n, a), a;
1382
+ return e.set(n, h), h;
1382
1383
  };
1383
1384
  s3.filter = i ? (n, o) => i(n, o) && r(mt(n)) : (n) => r(mt(n));
1384
1385
  };
1385
- var On = (s3) => {
1386
+ var In = (s3) => {
1386
1387
  let t = new st(s3), e = s3.file, i;
1387
1388
  try {
1388
1389
  i = import_node_fs.default.openSync(e, "r");
1389
1390
  let r = import_node_fs.default.fstatSync(i), n = s3.maxReadSize || 16 * 1024 * 1024;
1390
1391
  if (r.size < n) {
1391
- let o = Buffer.allocUnsafe(r.size), h = import_node_fs.default.readSync(i, o, 0, r.size, 0);
1392
- t.end(h === o.byteLength ? o : o.subarray(0, h));
1392
+ let o = Buffer.allocUnsafe(r.size), a = import_node_fs.default.readSync(i, o, 0, r.size, 0);
1393
+ t.end(a === o.byteLength ? o : o.subarray(0, a));
1393
1394
  } else {
1394
- let o = 0, h = Buffer.allocUnsafe(n);
1395
+ let o = 0, a = Buffer.allocUnsafe(n);
1395
1396
  for (; o < r.size; ) {
1396
- let a = import_node_fs.default.readSync(i, h, 0, n, o);
1397
- if (a === 0) break;
1398
- o += a, t.write(h.subarray(0, a));
1397
+ let h = import_node_fs.default.readSync(i, a, 0, n, o);
1398
+ if (h === 0) break;
1399
+ o += h, t.write(a.subarray(0, h));
1399
1400
  }
1400
1401
  t.end();
1401
1402
  }
@@ -1406,58 +1407,58 @@ var On = (s3) => {
1406
1407
  }
1407
1408
  }
1408
1409
  };
1409
- var Tn = (s3, t) => {
1410
+ var Fn = (s3, t) => {
1410
1411
  let e = new st(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
1411
- return new Promise((o, h) => {
1412
- e.on("error", h), e.on("end", o), import_node_fs.default.stat(r, (a, l) => {
1413
- if (a) h(a);
1412
+ return new Promise((o, a) => {
1413
+ e.on("error", a), e.on("end", o), import_node_fs.default.stat(r, (h, l) => {
1414
+ if (h) a(h);
1414
1415
  else {
1415
- let c = new gt(r, { readSize: i, size: l.size });
1416
- c.on("error", h), c.pipe(e);
1416
+ let c = new _t(r, { readSize: i, size: l.size });
1417
+ c.on("error", a), c.pipe(e);
1417
1418
  }
1418
1419
  });
1419
1420
  });
1420
1421
  };
1421
- var It = K(On, Tn, (s3) => new st(s3), (s3) => new st(s3), (s3, t) => {
1422
- t?.length && Yi(s3, t), s3.noResume || _n(s3);
1422
+ var Ft = K(In, Fn, (s3) => new st(s3), (s3) => new st(s3), (s3, t) => {
1423
+ t?.length && Xi(s3, t), s3.noResume || An(s3);
1423
1424
  });
1424
- var Ki = (s3, t, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
1425
- var { isAbsolute: Ln, parse: Ks } = import_node_path4.win32;
1426
- var ce = (s3) => {
1427
- let t = "", e = Ks(s3);
1428
- for (; Ln(s3) || e.root; ) {
1425
+ var qi = (s3, t, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
1426
+ var { isAbsolute: kn, parse: Vs } = import_node_path4.win32;
1427
+ var le = (s3) => {
1428
+ let t = "", e = Vs(s3);
1429
+ for (; kn(s3) || e.root; ) {
1429
1430
  let i = s3.charAt(0) === "/" && s3.slice(0, 4) !== "//?/" ? "/" : e.root;
1430
- s3 = s3.slice(i.length), t += i, e = Ks(s3);
1431
+ s3 = s3.slice(i.length), t += i, e = Vs(s3);
1431
1432
  }
1432
1433
  return [t, s3];
1433
1434
  };
1434
- var Qe = ["|", "<", ">", "?", ":"];
1435
- var Vi = Qe.map((s3) => String.fromCharCode(61440 + s3.charCodeAt(0)));
1436
- var Nn = new Map(Qe.map((s3, t) => [s3, Vi[t]]));
1437
- var Dn = new Map(Vi.map((s3, t) => [s3, Qe[t]]));
1438
- var $i = (s3) => Qe.reduce((t, e) => t.split(e).join(Nn.get(e)), s3);
1439
- var Vs = (s3) => Vi.reduce((t, e) => t.split(e).join(Dn.get(e)), s3);
1440
- var tr = (s3, t) => t ? (s3 = f(s3).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s3) : f(s3);
1441
- var An = 16 * 1024 * 1024;
1442
- var qs = /* @__PURE__ */ Symbol("process");
1443
- var js = /* @__PURE__ */ Symbol("file");
1444
- var Qs = /* @__PURE__ */ Symbol("directory");
1445
- var qi = /* @__PURE__ */ Symbol("symlink");
1446
- var Js = /* @__PURE__ */ Symbol("hardlink");
1447
- var fe = /* @__PURE__ */ Symbol("header");
1448
- var Je = /* @__PURE__ */ Symbol("read");
1449
- var ji = /* @__PURE__ */ Symbol("lstat");
1450
- var ti = /* @__PURE__ */ Symbol("onlstat");
1451
- var Qi = /* @__PURE__ */ Symbol("onread");
1452
- var Ji = /* @__PURE__ */ Symbol("onreadlink");
1453
- var ts = /* @__PURE__ */ Symbol("openfile");
1454
- var es = /* @__PURE__ */ Symbol("onopenfile");
1435
+ var ti = ["|", "<", ">", "?", ":"];
1436
+ var Qi = ti.map((s3) => String.fromCodePoint(61440 + Number(s3.codePointAt(0))));
1437
+ var vn = new Map(ti.map((s3, t) => [s3, Qi[t]]));
1438
+ var Mn = new Map(Qi.map((s3, t) => [s3, ti[t]]));
1439
+ var Ji = (s3) => ti.reduce((t, e) => t.split(e).join(vn.get(e)), s3);
1440
+ var $s = (s3) => Qi.reduce((t, e) => t.split(e).join(Mn.get(e)), s3);
1441
+ var er = (s3, t) => t ? (s3 = f(s3).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s3) : f(s3);
1442
+ var Bn = 16 * 1024 * 1024;
1443
+ var Qs = /* @__PURE__ */ Symbol("process");
1444
+ var Js = /* @__PURE__ */ Symbol("file");
1445
+ var js = /* @__PURE__ */ Symbol("directory");
1446
+ var ts = /* @__PURE__ */ Symbol("symlink");
1447
+ var tr = /* @__PURE__ */ Symbol("hardlink");
1448
+ var ce = /* @__PURE__ */ Symbol("header");
1449
+ var ei = /* @__PURE__ */ Symbol("read");
1450
+ var es = /* @__PURE__ */ Symbol("lstat");
1451
+ var ii = /* @__PURE__ */ Symbol("onlstat");
1452
+ var is = /* @__PURE__ */ Symbol("onread");
1453
+ var ss = /* @__PURE__ */ Symbol("onreadlink");
1454
+ var rs = /* @__PURE__ */ Symbol("openfile");
1455
+ var ns = /* @__PURE__ */ Symbol("onopenfile");
1455
1456
  var pt = /* @__PURE__ */ Symbol("close");
1456
- var ei = /* @__PURE__ */ Symbol("mode");
1457
- var is = /* @__PURE__ */ Symbol("awaitDrain");
1458
- var Xi = /* @__PURE__ */ Symbol("ondrain");
1457
+ var si = /* @__PURE__ */ Symbol("mode");
1458
+ var os = /* @__PURE__ */ Symbol("awaitDrain");
1459
+ var ji = /* @__PURE__ */ Symbol("ondrain");
1459
1460
  var X = /* @__PURE__ */ Symbol("prefix");
1460
- var de = class extends A {
1461
+ var fe = class extends A {
1461
1462
  path;
1462
1463
  portable;
1463
1464
  myuid = process.getuid && process.getuid() || 0;
@@ -1489,110 +1490,110 @@ var de = class extends A {
1489
1490
  onWriteEntry;
1490
1491
  #t = false;
1491
1492
  constructor(t, e = {}) {
1492
- let i = re(e);
1493
- super(), this.path = f(t), this.portable = !!i.portable, this.maxReadSize = i.maxReadSize || An, this.linkCache = i.linkCache || /* @__PURE__ */ new Map(), this.statCache = i.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!i.preservePaths, this.cwd = f(i.cwd || process.cwd()), this.strict = !!i.strict, this.noPax = !!i.noPax, this.noMtime = !!i.noMtime, this.mtime = i.mtime, this.prefix = i.prefix ? f(i.prefix) : void 0, this.onWriteEntry = i.onWriteEntry, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
1493
+ let i = se(e);
1494
+ super(), this.path = f(t), this.portable = !!i.portable, this.maxReadSize = i.maxReadSize || Bn, this.linkCache = i.linkCache || /* @__PURE__ */ new Map(), this.statCache = i.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!i.preservePaths, this.cwd = f(i.cwd || process.cwd()), this.strict = !!i.strict, this.noPax = !!i.noPax, this.noMtime = !!i.noMtime, this.mtime = i.mtime, this.prefix = i.prefix ? f(i.prefix) : void 0, this.onWriteEntry = i.onWriteEntry, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
1494
1495
  let r = false;
1495
1496
  if (!this.preservePaths) {
1496
- let [o, h] = ce(this.path);
1497
- o && typeof h == "string" && (this.path = h, r = o);
1497
+ let [o, a] = le(this.path);
1498
+ o && typeof a == "string" && (this.path = a, r = o);
1498
1499
  }
1499
- this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Vs(this.path.replace(/\\/g, "/")), t = t.replace(/\\/g, "/")), this.absolute = f(i.absolute || import_path2.default.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
1500
+ this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = $s(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || import_path2.default.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
1500
1501
  let n = this.statCache.get(this.absolute);
1501
- n ? this[ti](n) : this[ji]();
1502
+ n ? this[ii](n) : this[es]();
1502
1503
  }
1503
1504
  warn(t, e, i = {}) {
1504
- return Lt(this, t, e, i);
1505
+ return Nt(this, t, e, i);
1505
1506
  }
1506
1507
  emit(t, ...e) {
1507
1508
  return t === "error" && (this.#t = true), super.emit(t, ...e);
1508
1509
  }
1509
- [ji]() {
1510
+ [es]() {
1510
1511
  import_fs3.default.lstat(this.absolute, (t, e) => {
1511
1512
  if (t) return this.emit("error", t);
1512
- this[ti](e);
1513
+ this[ii](e);
1513
1514
  });
1514
1515
  }
1515
- [ti](t) {
1516
- this.statCache.set(this.absolute, t), this.stat = t, t.isFile() || (t.size = 0), this.type = In(t), this.emit("stat", t), this[qs]();
1516
+ [ii](t) {
1517
+ this.statCache.set(this.absolute, t), this.stat = t, t.isFile() || (t.size = 0), this.type = Pn(t), this.emit("stat", t), this[Qs]();
1517
1518
  }
1518
- [qs]() {
1519
+ [Qs]() {
1519
1520
  switch (this.type) {
1520
1521
  case "File":
1521
- return this[js]();
1522
+ return this[Js]();
1522
1523
  case "Directory":
1523
- return this[Qs]();
1524
+ return this[js]();
1524
1525
  case "SymbolicLink":
1525
- return this[qi]();
1526
+ return this[ts]();
1526
1527
  default:
1527
1528
  return this.end();
1528
1529
  }
1529
1530
  }
1530
- [ei](t) {
1531
- return Ki(t, this.type === "Directory", this.portable);
1531
+ [si](t) {
1532
+ return qi(t, this.type === "Directory", this.portable);
1532
1533
  }
1533
1534
  [X](t) {
1534
- return tr(t, this.prefix);
1535
+ return er(t, this.prefix);
1535
1536
  }
1536
- [fe]() {
1537
+ [ce]() {
1537
1538
  if (!this.stat) throw new Error("cannot write header before stat");
1538
- this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new F({ path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, mode: this[ei](this.stat.mode), uid: this.portable ? void 0 : this.stat.uid, gid: this.portable ? void 0 : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, type: this.type === "Unsupported" ? void 0 : this.type, uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", atime: this.portable ? void 0 : this.stat.atime, ctime: this.portable ? void 0 : this.stat.ctime }), this.header.encode() && !this.noPax && super.write(new ct({ atime: this.portable ? void 0 : this.header.atime, ctime: this.portable ? void 0 : this.header.ctime, gid: this.portable ? void 0 : this.header.gid, mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, size: this.header.size, uid: this.portable ? void 0 : this.header.uid, uname: this.portable ? void 0 : this.header.uname, dev: this.portable ? void 0 : this.stat.dev, ino: this.portable ? void 0 : this.stat.ino, nlink: this.portable ? void 0 : this.stat.nlink }).encode());
1539
+ this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new C({ path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, mode: this[si](this.stat.mode), uid: this.portable ? void 0 : this.stat.uid, gid: this.portable ? void 0 : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, type: this.type === "Unsupported" ? void 0 : this.type, uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", atime: this.portable ? void 0 : this.stat.atime, ctime: this.portable ? void 0 : this.stat.ctime }), this.header.encode() && !this.noPax && super.write(new ct({ atime: this.portable ? void 0 : this.header.atime, ctime: this.portable ? void 0 : this.header.ctime, gid: this.portable ? void 0 : this.header.gid, mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, size: this.header.size, uid: this.portable ? void 0 : this.header.uid, uname: this.portable ? void 0 : this.header.uname, dev: this.portable ? void 0 : this.stat.dev, ino: this.portable ? void 0 : this.stat.ino, nlink: this.portable ? void 0 : this.stat.nlink }).encode());
1539
1540
  let t = this.header?.block;
1540
1541
  if (!t) throw new Error("failed to encode header");
1541
1542
  super.write(t);
1542
1543
  }
1543
- [Qs]() {
1544
+ [js]() {
1544
1545
  if (!this.stat) throw new Error("cannot create directory entry without stat");
1545
- this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[fe](), this.end();
1546
+ this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[ce](), this.end();
1546
1547
  }
1547
- [qi]() {
1548
+ [ts]() {
1548
1549
  import_fs3.default.readlink(this.absolute, (t, e) => {
1549
1550
  if (t) return this.emit("error", t);
1550
- this[Ji](e);
1551
+ this[ss](e);
1551
1552
  });
1552
1553
  }
1553
- [Ji](t) {
1554
- this.linkpath = f(t), this[fe](), this.end();
1554
+ [ss](t) {
1555
+ this.linkpath = f(t), this[ce](), this.end();
1555
1556
  }
1556
- [Js](t) {
1557
+ [tr](t) {
1557
1558
  if (!this.stat) throw new Error("cannot create link entry without stat");
1558
- this.type = "Link", this.linkpath = f(import_path2.default.relative(this.cwd, t)), this.stat.size = 0, this[fe](), this.end();
1559
+ this.type = "Link", this.linkpath = f(import_path2.default.relative(this.cwd, t)), this.stat.size = 0, this[ce](), this.end();
1559
1560
  }
1560
- [js]() {
1561
+ [Js]() {
1561
1562
  if (!this.stat) throw new Error("cannot create file entry without stat");
1562
1563
  if (this.stat.nlink > 1) {
1563
1564
  let t = `${this.stat.dev}:${this.stat.ino}`, e = this.linkCache.get(t);
1564
- if (e?.indexOf(this.cwd) === 0) return this[Js](e);
1565
+ if (e?.indexOf(this.cwd) === 0) return this[tr](e);
1565
1566
  this.linkCache.set(t, this.absolute);
1566
1567
  }
1567
- if (this[fe](), this.stat.size === 0) return this.end();
1568
- this[ts]();
1568
+ if (this[ce](), this.stat.size === 0) return this.end();
1569
+ this[rs]();
1569
1570
  }
1570
- [ts]() {
1571
+ [rs]() {
1571
1572
  import_fs3.default.open(this.absolute, "r", (t, e) => {
1572
1573
  if (t) return this.emit("error", t);
1573
- this[es](e);
1574
+ this[ns](e);
1574
1575
  });
1575
1576
  }
1576
- [es](t) {
1577
+ [ns](t) {
1577
1578
  if (this.fd = t, this.#t) return this[pt]();
1578
1579
  if (!this.stat) throw new Error("should stat before calling onopenfile");
1579
1580
  this.blockLen = 512 * Math.ceil(this.stat.size / 512), this.blockRemain = this.blockLen;
1580
1581
  let e = Math.min(this.blockLen, this.maxReadSize);
1581
- this.buf = Buffer.allocUnsafe(e), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[Je]();
1582
+ this.buf = Buffer.allocUnsafe(e), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[ei]();
1582
1583
  }
1583
- [Je]() {
1584
+ [ei]() {
1584
1585
  let { fd: t, buf: e, offset: i, length: r, pos: n } = this;
1585
1586
  if (t === void 0 || e === void 0) throw new Error("cannot read file without first opening");
1586
- import_fs3.default.read(t, e, i, r, n, (o, h) => {
1587
+ import_fs3.default.read(t, e, i, r, n, (o, a) => {
1587
1588
  if (o) return this[pt](() => this.emit("error", o));
1588
- this[Qi](h);
1589
+ this[is](a);
1589
1590
  });
1590
1591
  }
1591
1592
  [pt](t = () => {
1592
1593
  }) {
1593
1594
  this.fd !== void 0 && import_fs3.default.close(this.fd, t);
1594
1595
  }
1595
- [Qi](t) {
1596
+ [is](t) {
1596
1597
  if (t <= 0 && this.remain > 0) {
1597
1598
  let r = Object.assign(new Error("encountered unexpected EOF"), { path: this.absolute, syscall: "read", code: "EOF" });
1598
1599
  return this[pt](() => this.emit("error", r));
@@ -1604,9 +1605,9 @@ var de = class extends A {
1604
1605
  if (!this.buf) throw new Error("should have created buffer prior to reading");
1605
1606
  if (t === this.remain) for (let r = t; r < this.length && t < this.blockRemain; r++) this.buf[r + this.offset] = 0, t++, this.remain++;
1606
1607
  let e = this.offset === 0 && t === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + t);
1607
- this.write(e) ? this[Xi]() : this[is](() => this[Xi]());
1608
+ this.write(e) ? this[ji]() : this[os](() => this[ji]());
1608
1609
  }
1609
- [is](t) {
1610
+ [os](t) {
1610
1611
  this.once("drain", t);
1611
1612
  }
1612
1613
  write(t, e, i) {
@@ -1616,30 +1617,30 @@ var de = class extends A {
1616
1617
  }
1617
1618
  return this.remain -= t.length, this.blockRemain -= t.length, this.pos += t.length, this.offset += t.length, super.write(t, null, i);
1618
1619
  }
1619
- [Xi]() {
1620
+ [ji]() {
1620
1621
  if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[pt]((t) => t ? this.emit("error", t) : this.end());
1621
1622
  if (!this.buf) throw new Error("buffer lost somehow in ONDRAIN");
1622
- this.offset >= this.length && (this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)), this.offset = 0), this.length = this.buf.length - this.offset, this[Je]();
1623
+ this.offset >= this.length && (this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)), this.offset = 0), this.length = this.buf.length - this.offset, this[ei]();
1623
1624
  }
1624
1625
  };
1625
- var ii = class extends de {
1626
+ var ri = class extends fe {
1626
1627
  sync = true;
1627
- [ji]() {
1628
- this[ti](import_fs3.default.lstatSync(this.absolute));
1629
- }
1630
- [qi]() {
1631
- this[Ji](import_fs3.default.readlinkSync(this.absolute));
1628
+ [es]() {
1629
+ this[ii](import_fs3.default.lstatSync(this.absolute));
1632
1630
  }
1633
1631
  [ts]() {
1634
- this[es](import_fs3.default.openSync(this.absolute, "r"));
1632
+ this[ss](import_fs3.default.readlinkSync(this.absolute));
1633
+ }
1634
+ [rs]() {
1635
+ this[ns](import_fs3.default.openSync(this.absolute, "r"));
1635
1636
  }
1636
- [Je]() {
1637
+ [ei]() {
1637
1638
  let t = true;
1638
1639
  try {
1639
1640
  let { fd: e, buf: i, offset: r, length: n, pos: o } = this;
1640
1641
  if (e === void 0 || i === void 0) throw new Error("fd and buf must be set in READ method");
1641
- let h = import_fs3.default.readSync(e, i, r, n, o);
1642
- this[Qi](h), t = false;
1642
+ let a = import_fs3.default.readSync(e, i, r, n, o);
1643
+ this[is](a), t = false;
1643
1644
  } finally {
1644
1645
  if (t) try {
1645
1646
  this[pt](() => {
@@ -1648,7 +1649,7 @@ var ii = class extends de {
1648
1649
  }
1649
1650
  }
1650
1651
  }
1651
- [is](t) {
1652
+ [os](t) {
1652
1653
  t();
1653
1654
  }
1654
1655
  [pt](t = () => {
@@ -1656,7 +1657,7 @@ var ii = class extends de {
1656
1657
  this.fd !== void 0 && import_fs3.default.closeSync(this.fd), t();
1657
1658
  }
1658
1659
  };
1659
- var si = class extends A {
1660
+ var ni = class extends A {
1660
1661
  blockLen = 0;
1661
1662
  blockRemain = 0;
1662
1663
  buf = 0;
@@ -1685,29 +1686,29 @@ var si = class extends A {
1685
1686
  size;
1686
1687
  onWriteEntry;
1687
1688
  warn(t, e, i = {}) {
1688
- return Lt(this, t, e, i);
1689
+ return Nt(this, t, e, i);
1689
1690
  }
1690
1691
  constructor(t, e = {}) {
1691
- let i = re(e);
1692
+ let i = se(e);
1692
1693
  super(), this.preservePaths = !!i.preservePaths, this.portable = !!i.portable, this.strict = !!i.strict, this.noPax = !!i.noPax, this.noMtime = !!i.noMtime, this.onWriteEntry = i.onWriteEntry, this.readEntry = t;
1693
1694
  let { type: r } = t;
1694
1695
  if (r === "Unsupported") throw new Error("writing entry that should be ignored");
1695
- this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i.prefix, this.path = f(t.path), this.mode = t.mode !== void 0 ? this[ei](t.mode) : void 0, this.uid = this.portable ? void 0 : t.uid, this.gid = this.portable ? void 0 : t.gid, this.uname = this.portable ? void 0 : t.uname, this.gname = this.portable ? void 0 : t.gname, this.size = t.size, this.mtime = this.noMtime ? void 0 : i.mtime || t.mtime, this.atime = this.portable ? void 0 : t.atime, this.ctime = this.portable ? void 0 : t.ctime, this.linkpath = t.linkpath !== void 0 ? f(t.linkpath) : void 0, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
1696
+ this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i.prefix, this.path = f(t.path), this.mode = t.mode !== void 0 ? this[si](t.mode) : void 0, this.uid = this.portable ? void 0 : t.uid, this.gid = this.portable ? void 0 : t.gid, this.uname = this.portable ? void 0 : t.uname, this.gname = this.portable ? void 0 : t.gname, this.size = t.size, this.mtime = this.noMtime ? void 0 : i.mtime || t.mtime, this.atime = this.portable ? void 0 : t.atime, this.ctime = this.portable ? void 0 : t.ctime, this.linkpath = t.linkpath !== void 0 ? f(t.linkpath) : void 0, typeof i.onwarn == "function" && this.on("warn", i.onwarn);
1696
1697
  let n = false;
1697
1698
  if (!this.preservePaths) {
1698
- let [h, a] = ce(this.path);
1699
- h && typeof a == "string" && (this.path = a, n = h);
1699
+ let [a, h] = le(this.path);
1700
+ a && typeof h == "string" && (this.path = h, n = a);
1700
1701
  }
1701
- this.remain = t.size, this.blockRemain = t.startBlockSize, this.onWriteEntry?.(this), this.header = new F({ path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, mode: this.mode, uid: this.portable ? void 0 : this.uid, gid: this.portable ? void 0 : this.gid, size: this.size, mtime: this.noMtime ? void 0 : this.mtime, type: this.type, uname: this.portable ? void 0 : this.uname, atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime }), n && this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute path`, { entry: this, path: n + this.path }), this.header.encode() && !this.noPax && super.write(new ct({ atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime, gid: this.portable ? void 0 : this.gid, mtime: this.noMtime ? void 0 : this.mtime, path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, size: this.size, uid: this.portable ? void 0 : this.uid, uname: this.portable ? void 0 : this.uname, dev: this.portable ? void 0 : this.readEntry.dev, ino: this.portable ? void 0 : this.readEntry.ino, nlink: this.portable ? void 0 : this.readEntry.nlink }).encode());
1702
+ this.remain = t.size, this.blockRemain = t.startBlockSize, this.onWriteEntry?.(this), this.header = new C({ path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, mode: this.mode, uid: this.portable ? void 0 : this.uid, gid: this.portable ? void 0 : this.gid, size: this.size, mtime: this.noMtime ? void 0 : this.mtime, type: this.type, uname: this.portable ? void 0 : this.uname, atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime }), n && this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute path`, { entry: this, path: n + this.path }), this.header.encode() && !this.noPax && super.write(new ct({ atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime, gid: this.portable ? void 0 : this.gid, mtime: this.noMtime ? void 0 : this.mtime, path: this[X](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X](this.linkpath) : this.linkpath, size: this.size, uid: this.portable ? void 0 : this.uid, uname: this.portable ? void 0 : this.uname, dev: this.portable ? void 0 : this.readEntry.dev, ino: this.portable ? void 0 : this.readEntry.ino, nlink: this.portable ? void 0 : this.readEntry.nlink }).encode());
1702
1703
  let o = this.header?.block;
1703
1704
  if (!o) throw new Error("failed to encode header");
1704
1705
  super.write(o), t.pipe(this);
1705
1706
  }
1706
1707
  [X](t) {
1707
- return tr(t, this.prefix);
1708
+ return er(t, this.prefix);
1708
1709
  }
1709
- [ei](t) {
1710
- return Ki(t, this.type === "Directory", this.portable);
1710
+ [si](t) {
1711
+ return qi(t, this.type === "Directory", this.portable);
1711
1712
  }
1712
1713
  write(t, e, i) {
1713
1714
  typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, typeof e == "string" ? e : "utf8"));
@@ -1719,8 +1720,8 @@ var si = class extends A {
1719
1720
  return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), typeof t == "function" && (i = t, e = void 0, t = void 0), typeof e == "function" && (i = e, e = void 0), typeof t == "string" && (t = Buffer.from(t, e ?? "utf8")), i && this.once("finish", i), t ? super.end(t, i) : super.end(i), this;
1720
1721
  }
1721
1722
  };
1722
- var In = (s3) => s3.isFile() ? "File" : s3.isDirectory() ? "Directory" : s3.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
1723
- var ri = class s2 {
1723
+ var Pn = (s3) => s3.isFile() ? "File" : s3.isDirectory() ? "Directory" : s3.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
1724
+ var oi = class s2 {
1724
1725
  tail;
1725
1726
  head;
1726
1727
  length = 0;
@@ -1751,11 +1752,11 @@ var ri = class s2 {
1751
1752
  t.list = this, t.prev = e, e && (e.next = t), this.tail = t, this.head || (this.head = t), this.length++;
1752
1753
  }
1753
1754
  push(...t) {
1754
- for (let e = 0, i = t.length; e < i; e++) Fn(this, t[e]);
1755
+ for (let e = 0, i = t.length; e < i; e++) Un(this, t[e]);
1755
1756
  return this.length;
1756
1757
  }
1757
1758
  unshift(...t) {
1758
- for (var e = 0, i = t.length; e < i; e++) kn(this, t[e]);
1759
+ for (var e = 0, i = t.length; e < i; e++) Hn(this, t[e]);
1759
1760
  return this.length;
1760
1761
  }
1761
1762
  pop() {
@@ -1851,7 +1852,7 @@ var ri = class s2 {
1851
1852
  let n = [];
1852
1853
  for (let o = 0; r && o < e; o++) n.push(r.value), r = this.removeNode(r);
1853
1854
  r ? r !== this.tail && (r = r.prev) : r = this.tail;
1854
- for (let o of i) r = Cn(this, r, o);
1855
+ for (let o of i) r = zn(this, r, o);
1855
1856
  return n;
1856
1857
  }
1857
1858
  reverse() {
@@ -1863,17 +1864,17 @@ var ri = class s2 {
1863
1864
  return this.head = e, this.tail = t, this;
1864
1865
  }
1865
1866
  };
1866
- function Cn(s3, t, e) {
1867
- let i = t, r = t ? t.next : s3.head, n = new ue(e, i, r, s3);
1867
+ function zn(s3, t, e) {
1868
+ let i = t, r = t ? t.next : s3.head, n = new de(e, i, r, s3);
1868
1869
  return n.next === void 0 && (s3.tail = n), n.prev === void 0 && (s3.head = n), s3.length++, n;
1869
1870
  }
1870
- function Fn(s3, t) {
1871
- s3.tail = new ue(t, s3.tail, void 0, s3), s3.head || (s3.head = s3.tail), s3.length++;
1871
+ function Un(s3, t) {
1872
+ s3.tail = new de(t, s3.tail, void 0, s3), s3.head || (s3.head = s3.tail), s3.length++;
1872
1873
  }
1873
- function kn(s3, t) {
1874
- s3.head = new ue(t, void 0, s3.head, s3), s3.tail || (s3.tail = s3.head), s3.length++;
1874
+ function Hn(s3, t) {
1875
+ s3.head = new de(t, void 0, s3.head, s3), s3.tail || (s3.tail = s3.head), s3.length++;
1875
1876
  }
1876
- var ue = class {
1877
+ var de = class {
1877
1878
  list;
1878
1879
  next;
1879
1880
  prev;
@@ -1882,41 +1883,43 @@ var ue = class {
1882
1883
  this.list = r, this.value = t, e ? (e.next = this, this.prev = e) : this.prev = void 0, i ? (i.prev = this, this.next = i) : this.next = void 0;
1883
1884
  }
1884
1885
  };
1885
- var fi = class {
1886
+ var mi = class {
1886
1887
  path;
1887
1888
  absolute;
1888
1889
  entry;
1889
1890
  stat;
1890
1891
  readdir;
1891
1892
  pending = false;
1893
+ pendingLink = false;
1892
1894
  ignore = false;
1893
1895
  piped = false;
1894
1896
  constructor(t, e) {
1895
1897
  this.path = t || "./", this.absolute = e;
1896
1898
  }
1897
1899
  };
1898
- var er = Buffer.alloc(1024);
1899
- var ni = /* @__PURE__ */ Symbol("onStat");
1900
- var me = /* @__PURE__ */ Symbol("ended");
1900
+ var ir = Buffer.alloc(1024);
1901
+ var ai = /* @__PURE__ */ Symbol("onStat");
1902
+ var ue = /* @__PURE__ */ Symbol("ended");
1901
1903
  var W = /* @__PURE__ */ Symbol("queue");
1902
- var Ct = /* @__PURE__ */ Symbol("current");
1903
- var Ft = /* @__PURE__ */ Symbol("process");
1904
+ var me = /* @__PURE__ */ Symbol("pendingLinks");
1905
+ var Et = /* @__PURE__ */ Symbol("current");
1906
+ var Ct = /* @__PURE__ */ Symbol("process");
1904
1907
  var pe = /* @__PURE__ */ Symbol("processing");
1905
- var ss = /* @__PURE__ */ Symbol("processJob");
1908
+ var hi = /* @__PURE__ */ Symbol("processJob");
1906
1909
  var G = /* @__PURE__ */ Symbol("jobs");
1907
- var rs = /* @__PURE__ */ Symbol("jobDone");
1908
- var oi = /* @__PURE__ */ Symbol("addFSEntry");
1909
- var ir = /* @__PURE__ */ Symbol("addTarEntry");
1910
- var hs = /* @__PURE__ */ Symbol("stat");
1911
- var as = /* @__PURE__ */ Symbol("readdir");
1912
- var hi = /* @__PURE__ */ Symbol("onreaddir");
1913
- var ai = /* @__PURE__ */ Symbol("pipe");
1914
- var sr = /* @__PURE__ */ Symbol("entry");
1915
- var ns = /* @__PURE__ */ Symbol("entryOpt");
1916
- var li = /* @__PURE__ */ Symbol("writeEntryClass");
1917
- var nr = /* @__PURE__ */ Symbol("write");
1918
- var os = /* @__PURE__ */ Symbol("ondrain");
1919
- var Et = class extends A {
1910
+ var hs = /* @__PURE__ */ Symbol("jobDone");
1911
+ var li = /* @__PURE__ */ Symbol("addFSEntry");
1912
+ var sr = /* @__PURE__ */ Symbol("addTarEntry");
1913
+ var cs = /* @__PURE__ */ Symbol("stat");
1914
+ var fs = /* @__PURE__ */ Symbol("readdir");
1915
+ var ci = /* @__PURE__ */ Symbol("onreaddir");
1916
+ var fi = /* @__PURE__ */ Symbol("pipe");
1917
+ var rr = /* @__PURE__ */ Symbol("entry");
1918
+ var as = /* @__PURE__ */ Symbol("entryOpt");
1919
+ var di = /* @__PURE__ */ Symbol("writeEntryClass");
1920
+ var or = /* @__PURE__ */ Symbol("write");
1921
+ var ls = /* @__PURE__ */ Symbol("ondrain");
1922
+ var wt = class extends A {
1920
1923
  sync = false;
1921
1924
  opt;
1922
1925
  cwd;
@@ -1937,123 +1940,139 @@ var Et = class extends A {
1937
1940
  mtime;
1938
1941
  filter;
1939
1942
  jobs;
1940
- [li];
1943
+ [di];
1941
1944
  onWriteEntry;
1942
1945
  [W];
1946
+ [me] = /* @__PURE__ */ new Map();
1943
1947
  [G] = 0;
1944
1948
  [pe] = false;
1945
- [me] = false;
1949
+ [ue] = false;
1946
1950
  constructor(t = {}) {
1947
- if (super(), this.opt = t, this.file = t.file || "", this.cwd = t.cwd || process.cwd(), this.maxReadSize = t.maxReadSize, this.preservePaths = !!t.preservePaths, this.strict = !!t.strict, this.noPax = !!t.noPax, this.prefix = f(t.prefix || ""), this.linkCache = t.linkCache || /* @__PURE__ */ new Map(), this.statCache = t.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t.onWriteEntry, this[li] = de, typeof t.onwarn == "function" && this.on("warn", t.onwarn), this.portable = !!t.portable, t.gzip || t.brotli || t.zstd) {
1951
+ if (super(), this.opt = t, this.file = t.file || "", this.cwd = t.cwd || process.cwd(), this.maxReadSize = t.maxReadSize, this.preservePaths = !!t.preservePaths, this.strict = !!t.strict, this.noPax = !!t.noPax, this.prefix = f(t.prefix || ""), this.linkCache = t.linkCache || /* @__PURE__ */ new Map(), this.statCache = t.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t.onWriteEntry, this[di] = fe, typeof t.onwarn == "function" && this.on("warn", t.onwarn), this.portable = !!t.portable, t.gzip || t.brotli || t.zstd) {
1948
1952
  if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
1949
- if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = true), this.zip = new Be(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new Ue(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ge(t.zstd)), !this.zip) throw new Error("impossible");
1953
+ if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = true), this.zip = new Pe(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new He(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ze(t.zstd)), !this.zip) throw new Error("impossible");
1950
1954
  let e = this.zip;
1951
- e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[os]()), this.on("resume", () => e.resume());
1952
- } else this.on("drain", this[os]);
1953
- this.noDirRecurse = !!t.noDirRecurse, this.follow = !!t.follow, this.noMtime = !!t.noMtime, t.mtime && (this.mtime = t.mtime), this.filter = typeof t.filter == "function" ? t.filter : () => true, this[W] = new ri(), this[G] = 0, this.jobs = Number(t.jobs) || 4, this[pe] = false, this[me] = false;
1955
+ e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[ls]()), this.on("resume", () => e.resume());
1956
+ } else this.on("drain", this[ls]);
1957
+ this.noDirRecurse = !!t.noDirRecurse, this.follow = !!t.follow, this.noMtime = !!t.noMtime, t.mtime && (this.mtime = t.mtime), this.filter = typeof t.filter == "function" ? t.filter : () => true, this[W] = new oi(), this[G] = 0, this.jobs = Number(t.jobs) || 4, this[pe] = false, this[ue] = false;
1954
1958
  }
1955
- [nr](t) {
1959
+ [or](t) {
1956
1960
  return super.write(t);
1957
1961
  }
1958
1962
  add(t) {
1959
1963
  return this.write(t), this;
1960
1964
  }
1961
1965
  end(t, e, i) {
1962
- return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = void 0), t && this.add(t), this[me] = true, this[Ft](), i && i(), this;
1966
+ return typeof t == "function" && (i = t, t = void 0), typeof e == "function" && (i = e, e = void 0), t && this.add(t), this[ue] = true, this[Ct](), i && i(), this;
1963
1967
  }
1964
1968
  write(t) {
1965
- if (this[me]) throw new Error("write after end");
1966
- return t instanceof Yt ? this[ir](t) : this[oi](t), this.flowing;
1969
+ if (this[ue]) throw new Error("write after end");
1970
+ return typeof t == "string" ? this[li](t) : this[sr](t), this.flowing;
1967
1971
  }
1968
- [ir](t) {
1972
+ [sr](t) {
1969
1973
  let e = f(import_path3.default.resolve(this.cwd, t.path));
1970
1974
  if (!this.filter(t.path, t)) t.resume();
1971
1975
  else {
1972
- let i = new fi(t.path, e);
1973
- i.entry = new si(t, this[ns](i)), i.entry.on("end", () => this[rs](i)), this[G] += 1, this[W].push(i);
1976
+ let i = new mi(t.path, e);
1977
+ i.entry = new ni(t, this[as](i)), i.entry.on("end", () => this[hs](i)), this[G] += 1, this[W].push(i);
1974
1978
  }
1975
- this[Ft]();
1979
+ this[Ct]();
1976
1980
  }
1977
- [oi](t) {
1981
+ [li](t) {
1978
1982
  let e = f(import_path3.default.resolve(this.cwd, t));
1979
- this[W].push(new fi(t, e)), this[Ft]();
1983
+ this[W].push(new mi(t, e)), this[Ct]();
1980
1984
  }
1981
- [hs](t) {
1985
+ [cs](t) {
1982
1986
  t.pending = true, this[G] += 1;
1983
1987
  let e = this.follow ? "stat" : "lstat";
1984
1988
  import_fs2.default[e](t.absolute, (i, r) => {
1985
- t.pending = false, this[G] -= 1, i ? this.emit("error", i) : this[ni](t, r);
1989
+ t.pending = false, this[G] -= 1, i ? this.emit("error", i) : this[ai](t, r);
1986
1990
  });
1987
1991
  }
1988
- [ni](t, e) {
1989
- this.statCache.set(t.absolute, e), t.stat = e, this.filter(t.path, e) ? e.isFile() && e.nlink > 1 && t === this[Ct] && !this.linkCache.get(`${e.dev}:${e.ino}`) && !this.sync && this[ss](t) : t.ignore = true, this[Ft]();
1992
+ [ai](t, e) {
1993
+ if (this.statCache.set(t.absolute, e), t.stat = e, !this.filter(t.path, e)) t.ignore = true;
1994
+ else if (e.isFile() && e.nlink > 1 && !this.linkCache.get(`${e.dev}:${e.ino}`) && !this.sync) if (t === this[Et]) this[hi](t);
1995
+ else {
1996
+ let i = `${e.dev}:${e.ino}`, r = this[me].get(i);
1997
+ r ? r.push(t) : this[me].set(i, [t]), t.pendingLink = true, t.pending = true;
1998
+ }
1999
+ this[Ct]();
1990
2000
  }
1991
- [as](t) {
2001
+ [fs](t) {
1992
2002
  t.pending = true, this[G] += 1, import_fs2.default.readdir(t.absolute, (e, i) => {
1993
2003
  if (t.pending = false, this[G] -= 1, e) return this.emit("error", e);
1994
- this[hi](t, i);
2004
+ this[ci](t, i);
1995
2005
  });
1996
2006
  }
1997
- [hi](t, e) {
1998
- this.readdirCache.set(t.absolute, e), t.readdir = e, this[Ft]();
2007
+ [ci](t, e) {
2008
+ this.readdirCache.set(t.absolute, e), t.readdir = e, this[Ct]();
1999
2009
  }
2000
- [Ft]() {
2010
+ [Ct]() {
2001
2011
  if (!this[pe]) {
2002
2012
  this[pe] = true;
2003
- for (let t = this[W].head; t && this[G] < this.jobs; t = t.next) if (this[ss](t.value), t.value.ignore) {
2013
+ for (let t = this[W].head; t && this[G] < this.jobs; t = t.next) if (this[hi](t.value), t.value.ignore) {
2004
2014
  let e = t.next;
2005
2015
  this[W].removeNode(t), t.next = e;
2006
2016
  }
2007
- this[pe] = false, this[me] && !this[W].length && this[G] === 0 && (this.zip ? this.zip.end(er) : (super.write(er), super.end()));
2017
+ this[pe] = false, this[ue] && this[W].length === 0 && this[G] === 0 && (this.zip ? this.zip.end(ir) : (super.write(ir), super.end()));
2008
2018
  }
2009
2019
  }
2010
- get [Ct]() {
2020
+ get [Et]() {
2011
2021
  return this[W] && this[W].head && this[W].head.value;
2012
2022
  }
2013
- [rs](t) {
2014
- this[W].shift(), this[G] -= 1, this[Ft]();
2023
+ [hs](t) {
2024
+ this[W].shift(), this[G] -= 1;
2025
+ let { stat: e } = t;
2026
+ if (e && e.isFile() && e.nlink > 1) {
2027
+ let i = `${e.dev}:${e.ino}`, r = this[me].get(i);
2028
+ if (r) {
2029
+ this[me].delete(i);
2030
+ for (let n of r) n.pending = false, this[hi](n);
2031
+ }
2032
+ }
2033
+ this[Ct]();
2015
2034
  }
2016
- [ss](t) {
2017
- if (!t.pending) {
2035
+ [hi](t) {
2036
+ if (t.pending && t.pendingLink && t === this[Et] && (t.pending = false, t.pendingLink = false), !t.pending) {
2018
2037
  if (t.entry) {
2019
- t === this[Ct] && !t.piped && this[ai](t);
2038
+ t === this[Et] && !t.piped && this[fi](t);
2020
2039
  return;
2021
2040
  }
2022
2041
  if (!t.stat) {
2023
2042
  let e = this.statCache.get(t.absolute);
2024
- e ? this[ni](t, e) : this[hs](t);
2043
+ e ? this[ai](t, e) : this[cs](t);
2025
2044
  }
2026
2045
  if (t.stat && !t.ignore) {
2027
2046
  if (!this.noDirRecurse && t.stat.isDirectory() && !t.readdir) {
2028
2047
  let e = this.readdirCache.get(t.absolute);
2029
- if (e ? this[hi](t, e) : this[as](t), !t.readdir) return;
2048
+ if (e ? this[ci](t, e) : this[fs](t), !t.readdir) return;
2030
2049
  }
2031
- if (t.entry = this[sr](t), !t.entry) {
2050
+ if (t.entry = this[rr](t), !t.entry) {
2032
2051
  t.ignore = true;
2033
2052
  return;
2034
2053
  }
2035
- t === this[Ct] && !t.piped && this[ai](t);
2054
+ t === this[Et] && !t.piped && this[fi](t);
2036
2055
  }
2037
2056
  }
2038
2057
  }
2039
- [ns](t) {
2058
+ [as](t) {
2040
2059
  return { onwarn: (e, i, r) => this.warn(e, i, r), noPax: this.noPax, cwd: this.cwd, absolute: t.absolute, preservePaths: this.preservePaths, maxReadSize: this.maxReadSize, strict: this.strict, portable: this.portable, linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, mtime: this.mtime, prefix: this.prefix, onWriteEntry: this.onWriteEntry };
2041
2060
  }
2042
- [sr](t) {
2061
+ [rr](t) {
2043
2062
  this[G] += 1;
2044
2063
  try {
2045
- return new this[li](t.path, this[ns](t)).on("end", () => this[rs](t)).on("error", (i) => this.emit("error", i));
2064
+ return new this[di](t.path, this[as](t)).on("end", () => this[hs](t)).on("error", (i) => this.emit("error", i));
2046
2065
  } catch (e) {
2047
2066
  this.emit("error", e);
2048
2067
  }
2049
2068
  }
2050
- [os]() {
2051
- this[Ct] && this[Ct].entry && this[Ct].entry.resume();
2069
+ [ls]() {
2070
+ this[Et] && this[Et].entry && this[Et].entry.resume();
2052
2071
  }
2053
- [ai](t) {
2072
+ [fi](t) {
2054
2073
  t.piped = true, t.readdir && t.readdir.forEach((r) => {
2055
2074
  let n = t.path, o = n === "./" ? "" : n.replace(/\/*$/, "/");
2056
- this[oi](o + r);
2075
+ this[li](o + r);
2057
2076
  });
2058
2077
  let e = t.entry, i = this.zip;
2059
2078
  if (!e) throw new Error("cannot pipe without source");
@@ -2067,137 +2086,135 @@ var Et = class extends A {
2067
2086
  return this.zip && this.zip.pause(), super.pause();
2068
2087
  }
2069
2088
  warn(t, e, i = {}) {
2070
- Lt(this, t, e, i);
2089
+ Nt(this, t, e, i);
2071
2090
  }
2072
2091
  };
2073
- var kt = class extends Et {
2092
+ var kt = class extends wt {
2074
2093
  sync = true;
2075
2094
  constructor(t) {
2076
- super(t), this[li] = ii;
2095
+ super(t), this[di] = ri;
2077
2096
  }
2078
2097
  pause() {
2079
2098
  }
2080
2099
  resume() {
2081
2100
  }
2082
- [hs](t) {
2101
+ [cs](t) {
2083
2102
  let e = this.follow ? "statSync" : "lstatSync";
2084
- this[ni](t, import_fs2.default[e](t.absolute));
2103
+ this[ai](t, import_fs2.default[e](t.absolute));
2085
2104
  }
2086
- [as](t) {
2087
- this[hi](t, import_fs2.default.readdirSync(t.absolute));
2105
+ [fs](t) {
2106
+ this[ci](t, import_fs2.default.readdirSync(t.absolute));
2088
2107
  }
2089
- [ai](t) {
2108
+ [fi](t) {
2090
2109
  let e = t.entry, i = this.zip;
2091
2110
  if (t.readdir && t.readdir.forEach((r) => {
2092
2111
  let n = t.path, o = n === "./" ? "" : n.replace(/\/*$/, "/");
2093
- this[oi](o + r);
2112
+ this[li](o + r);
2094
2113
  }), !e) throw new Error("Cannot pipe without source");
2095
2114
  i ? e.on("data", (r) => {
2096
2115
  i.write(r);
2097
2116
  }) : e.on("data", (r) => {
2098
- super[nr](r);
2117
+ super[or](r);
2099
2118
  });
2100
2119
  }
2101
2120
  };
2102
- var vn = (s3, t) => {
2121
+ var Wn = (s3, t) => {
2103
2122
  let e = new kt(s3), i = new Wt(s3.file, { mode: s3.mode || 438 });
2104
- e.pipe(i), hr(e, t);
2123
+ e.pipe(i), ar(e, t);
2105
2124
  };
2106
- var Mn = (s3, t) => {
2107
- let e = new Et(s3), i = new tt(s3.file, { mode: s3.mode || 438 });
2125
+ var Gn = (s3, t) => {
2126
+ let e = new wt(s3), i = new tt(s3.file, { mode: s3.mode || 438 });
2108
2127
  e.pipe(i);
2109
2128
  let r = new Promise((n, o) => {
2110
2129
  i.on("error", o), i.on("close", n), e.on("error", o);
2111
2130
  });
2112
- return ar(e, t), r;
2131
+ return lr(e, t).catch((n) => e.emit("error", n)), r;
2113
2132
  };
2114
- var hr = (s3, t) => {
2133
+ var ar = (s3, t) => {
2115
2134
  t.forEach((e) => {
2116
- e.charAt(0) === "@" ? It({ file: import_node_path.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
2135
+ e.charAt(0) === "@" ? Ft({ file: import_node_path.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
2117
2136
  }), s3.end();
2118
2137
  };
2119
- var ar = async (s3, t) => {
2120
- for (let e = 0; e < t.length; e++) {
2121
- let i = String(t[e]);
2122
- i.charAt(0) === "@" ? await It({ file: import_node_path.default.resolve(String(s3.cwd), i.slice(1)), noResume: true, onReadEntry: (r) => {
2123
- s3.add(r);
2124
- } }) : s3.add(i);
2125
- }
2138
+ var lr = async (s3, t) => {
2139
+ for (let e of t) e.charAt(0) === "@" ? await Ft({ file: import_node_path.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
2140
+ s3.add(i);
2141
+ } }) : s3.add(e);
2126
2142
  s3.end();
2127
2143
  };
2128
- var Bn = (s3, t) => {
2144
+ var Zn = (s3, t) => {
2129
2145
  let e = new kt(s3);
2130
- return hr(e, t), e;
2131
- };
2132
- var Pn = (s3, t) => {
2133
- let e = new Et(s3);
2134
2146
  return ar(e, t), e;
2135
2147
  };
2136
- var zn = K(vn, Mn, Bn, Pn, (s3, t) => {
2148
+ var Yn = (s3, t) => {
2149
+ let e = new wt(s3);
2150
+ return lr(e, t).catch((i) => e.emit("error", i)), e;
2151
+ };
2152
+ var Kn = K(Wn, Gn, Zn, Yn, (s3, t) => {
2137
2153
  if (!t?.length) throw new TypeError("no paths specified to add to archive");
2138
2154
  });
2139
- var Un = process.env.__FAKE_PLATFORM__ || process.platform;
2140
- var Hn = Un === "win32";
2141
- var { O_CREAT: Wn, O_TRUNC: Gn, O_WRONLY: Zn } = import_fs4.default.constants;
2142
- var cr = Number(process.env.__FAKE_FS_O_FILENAME__) || import_fs4.default.constants.UV_FS_O_FILEMAP || 0;
2143
- var Yn = Hn && !!cr;
2144
- var Kn = 512 * 1024;
2145
- var Vn = cr | Gn | Wn | Zn;
2146
- var ls = Yn ? (s3) => s3 < Kn ? Vn : "w" : () => "w";
2147
- var cs = (s3, t, e) => {
2155
+ var Vn = process.env.__FAKE_PLATFORM__ || process.platform;
2156
+ var ur = Vn === "win32";
2157
+ var { O_CREAT: mr, O_NOFOLLOW: cr, O_TRUNC: pr, O_WRONLY: Er } = import_fs4.default.constants;
2158
+ var wr = Number(process.env.__FAKE_FS_O_FILENAME__) || import_fs4.default.constants.UV_FS_O_FILEMAP || 0;
2159
+ var $n = ur && !!wr;
2160
+ var Xn = 512 * 1024;
2161
+ var qn = wr | pr | mr | Er;
2162
+ var fr = !ur && typeof cr == "number" ? cr | pr | mr | Er : null;
2163
+ var ds = fr !== null ? () => fr : $n ? (s3) => s3 < Xn ? qn : "w" : () => "w";
2164
+ var us = (s3, t, e) => {
2148
2165
  try {
2149
2166
  return import_node_fs4.default.lchownSync(s3, t, e);
2150
2167
  } catch (i) {
2151
2168
  if (i?.code !== "ENOENT") throw i;
2152
2169
  }
2153
2170
  };
2154
- var di = (s3, t, e, i) => {
2171
+ var pi = (s3, t, e, i) => {
2155
2172
  import_node_fs4.default.lchown(s3, t, e, (r) => {
2156
2173
  i(r && r?.code !== "ENOENT" ? r : null);
2157
2174
  });
2158
2175
  };
2159
- var $n = (s3, t, e, i, r) => {
2160
- if (t.isDirectory()) fs(import_node_path6.default.resolve(s3, t.name), e, i, (n) => {
2176
+ var Qn = (s3, t, e, i, r) => {
2177
+ if (t.isDirectory()) ms(import_node_path6.default.resolve(s3, t.name), e, i, (n) => {
2161
2178
  if (n) return r(n);
2162
2179
  let o = import_node_path6.default.resolve(s3, t.name);
2163
- di(o, e, i, r);
2180
+ pi(o, e, i, r);
2164
2181
  });
2165
2182
  else {
2166
2183
  let n = import_node_path6.default.resolve(s3, t.name);
2167
- di(n, e, i, r);
2184
+ pi(n, e, i, r);
2168
2185
  }
2169
2186
  };
2170
- var fs = (s3, t, e, i) => {
2187
+ var ms = (s3, t, e, i) => {
2171
2188
  import_node_fs4.default.readdir(s3, { withFileTypes: true }, (r, n) => {
2172
2189
  if (r) {
2173
2190
  if (r.code === "ENOENT") return i();
2174
2191
  if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
2175
2192
  }
2176
- if (r || !n.length) return di(s3, t, e, i);
2177
- let o = n.length, h = null, a = (l) => {
2178
- if (!h) {
2179
- if (l) return i(h = l);
2180
- if (--o === 0) return di(s3, t, e, i);
2193
+ if (r || !n.length) return pi(s3, t, e, i);
2194
+ let o = n.length, a = null, h = (l) => {
2195
+ if (!a) {
2196
+ if (l) return i(a = l);
2197
+ if (--o === 0) return pi(s3, t, e, i);
2181
2198
  }
2182
2199
  };
2183
- for (let l of n) $n(s3, l, t, e, a);
2200
+ for (let l of n) Qn(s3, l, t, e, h);
2184
2201
  });
2185
2202
  };
2186
- var Xn = (s3, t, e, i) => {
2187
- t.isDirectory() && ds(import_node_path6.default.resolve(s3, t.name), e, i), cs(import_node_path6.default.resolve(s3, t.name), e, i);
2203
+ var Jn = (s3, t, e, i) => {
2204
+ t.isDirectory() && ps(import_node_path6.default.resolve(s3, t.name), e, i), us(import_node_path6.default.resolve(s3, t.name), e, i);
2188
2205
  };
2189
- var ds = (s3, t, e) => {
2206
+ var ps = (s3, t, e) => {
2190
2207
  let i;
2191
2208
  try {
2192
2209
  i = import_node_fs4.default.readdirSync(s3, { withFileTypes: true });
2193
2210
  } catch (r) {
2194
2211
  let n = r;
2195
2212
  if (n?.code === "ENOENT") return;
2196
- if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return cs(s3, t, e);
2213
+ if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return us(s3, t, e);
2197
2214
  throw n;
2198
2215
  }
2199
- for (let r of i) Xn(s3, r, t, e);
2200
- return cs(s3, t, e);
2216
+ for (let r of i) Jn(s3, r, t, e);
2217
+ return us(s3, t, e);
2201
2218
  };
2202
2219
  var we = class extends Error {
2203
2220
  path;
@@ -2210,7 +2227,7 @@ var we = class extends Error {
2210
2227
  return "CwdError";
2211
2228
  }
2212
2229
  };
2213
- var wt = class extends Error {
2230
+ var St = class extends Error {
2214
2231
  path;
2215
2232
  symlink;
2216
2233
  syscall = "symlink";
@@ -2222,41 +2239,41 @@ var wt = class extends Error {
2222
2239
  return "SymlinkError";
2223
2240
  }
2224
2241
  };
2225
- var jn = (s3, t) => {
2242
+ var to = (s3, t) => {
2226
2243
  import_node_fs5.default.stat(s3, (e, i) => {
2227
2244
  (e || !i.isDirectory()) && (e = new we(s3, e?.code || "ENOTDIR")), t(e);
2228
2245
  });
2229
2246
  };
2230
- var fr = (s3, t, e) => {
2247
+ var Sr = (s3, t, e) => {
2231
2248
  s3 = f(s3);
2232
- let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, h = t.gid, a = typeof o == "number" && typeof h == "number" && (o !== t.processUid || h !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), S = (E, x) => {
2233
- E ? e(E) : x && a ? fs(x, o, h, (_s) => S(_s)) : n ? import_node_fs5.default.chmod(s3, r, e) : e();
2249
+ let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, a = t.gid, h = typeof o == "number" && typeof a == "number" && (o !== t.processUid || a !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), S = (E, x) => {
2250
+ E ? e(E) : x && h ? ms(x, o, a, (xe) => S(xe)) : n ? import_node_fs5.default.chmod(s3, r, e) : e();
2234
2251
  };
2235
- if (s3 === d) return jn(s3, S);
2252
+ if (s3 === d) return to(s3, S);
2236
2253
  if (l) return import_promises.default.mkdir(s3, { mode: r, recursive: true }).then((E) => S(null, E ?? void 0), S);
2237
2254
  let N = f(import_node_path7.default.relative(d, s3)).split("/");
2238
- us(d, N, r, c, d, void 0, S);
2255
+ Es(d, N, r, c, d, void 0, S);
2239
2256
  };
2240
- var us = (s3, t, e, i, r, n, o) => {
2241
- if (!t.length) return o(null, n);
2242
- let h = t.shift(), a = f(import_node_path7.default.resolve(s3 + "/" + h));
2243
- import_node_fs5.default.mkdir(a, e, dr(a, t, e, i, r, n, o));
2257
+ var Es = (s3, t, e, i, r, n, o) => {
2258
+ if (t.length === 0) return o(null, n);
2259
+ let a = t.shift(), h = f(import_node_path7.default.resolve(s3 + "/" + a));
2260
+ import_node_fs5.default.mkdir(h, e, yr(h, t, e, i, r, n, o));
2244
2261
  };
2245
- var dr = (s3, t, e, i, r, n, o) => (h) => {
2246
- h ? import_node_fs5.default.lstat(s3, (a, l) => {
2247
- if (a) a.path = a.path && f(a.path), o(a);
2248
- else if (l.isDirectory()) us(s3, t, e, i, r, n, o);
2262
+ var yr = (s3, t, e, i, r, n, o) => (a) => {
2263
+ a ? import_node_fs5.default.lstat(s3, (h, l) => {
2264
+ if (h) h.path = h.path && f(h.path), o(h);
2265
+ else if (l.isDirectory()) Es(s3, t, e, i, r, n, o);
2249
2266
  else if (i) import_node_fs5.default.unlink(s3, (c) => {
2250
2267
  if (c) return o(c);
2251
- import_node_fs5.default.mkdir(s3, e, dr(s3, t, e, i, r, n, o));
2268
+ import_node_fs5.default.mkdir(s3, e, yr(s3, t, e, i, r, n, o));
2252
2269
  });
2253
2270
  else {
2254
- if (l.isSymbolicLink()) return o(new wt(s3, s3 + "/" + t.join("/")));
2255
- o(h);
2271
+ if (l.isSymbolicLink()) return o(new St(s3, s3 + "/" + t.join("/")));
2272
+ o(a);
2256
2273
  }
2257
- }) : (n = n || s3, us(s3, t, e, i, r, n, o));
2274
+ }) : (n = n || s3, Es(s3, t, e, i, r, n, o));
2258
2275
  };
2259
- var Qn = (s3) => {
2276
+ var eo = (s3) => {
2260
2277
  let t = false, e;
2261
2278
  try {
2262
2279
  t = import_node_fs5.default.statSync(s3).isDirectory();
@@ -2266,53 +2283,53 @@ var Qn = (s3) => {
2266
2283
  if (!t) throw new we(s3, e ?? "ENOTDIR");
2267
2284
  }
2268
2285
  };
2269
- var ur = (s3, t) => {
2286
+ var Rr = (s3, t) => {
2270
2287
  s3 = f(s3);
2271
- let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, h = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), a = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
2272
- E && h && ds(E, n, o), r && import_node_fs5.default.chmodSync(s3, i);
2288
+ let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, a = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), h = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
2289
+ E && a && ps(E, n, o), r && import_node_fs5.default.chmodSync(s3, i);
2273
2290
  };
2274
- if (s3 === c) return Qn(c), d();
2275
- if (a) return d(import_node_fs5.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
2291
+ if (s3 === c) return eo(c), d();
2292
+ if (h) return d(import_node_fs5.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
2276
2293
  let T = f(import_node_path7.default.relative(c, s3)).split("/"), N;
2277
2294
  for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
2278
2295
  x = f(import_node_path7.default.resolve(x));
2279
2296
  try {
2280
2297
  import_node_fs5.default.mkdirSync(x, i), N = N || x;
2281
2298
  } catch {
2282
- let Os = import_node_fs5.default.lstatSync(x);
2283
- if (Os.isDirectory()) continue;
2299
+ let xe = import_node_fs5.default.lstatSync(x);
2300
+ if (xe.isDirectory()) continue;
2284
2301
  if (l) {
2285
2302
  import_node_fs5.default.unlinkSync(x), import_node_fs5.default.mkdirSync(x, i), N = N || x;
2286
2303
  continue;
2287
- } else if (Os.isSymbolicLink()) return new wt(x, x + "/" + T.join("/"));
2304
+ } else if (xe.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
2288
2305
  }
2289
2306
  }
2290
2307
  return d(N);
2291
2308
  };
2292
- var ms = /* @__PURE__ */ Object.create(null);
2293
- var mr = 1e4;
2294
- var $t = /* @__PURE__ */ new Set();
2295
- var pr = (s3) => {
2296
- $t.has(s3) ? $t.delete(s3) : ms[s3] = s3.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"), $t.add(s3);
2297
- let t = ms[s3], e = $t.size - mr;
2298
- if (e > mr / 10) {
2299
- for (let i of $t) if ($t.delete(i), delete ms[i], --e <= 0) break;
2309
+ var ws = /* @__PURE__ */ Object.create(null);
2310
+ var gr = 1e4;
2311
+ var Vt = /* @__PURE__ */ new Set();
2312
+ var br = (s3) => {
2313
+ Vt.has(s3) ? Vt.delete(s3) : ws[s3] = s3.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"), Vt.add(s3);
2314
+ let t = ws[s3], e = Vt.size - gr;
2315
+ if (e > gr / 10) {
2316
+ for (let i of Vt) if (Vt.delete(i), delete ws[i], --e <= 0) break;
2300
2317
  }
2301
2318
  return t;
2302
2319
  };
2303
- var Jn = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
2304
- var to = Jn === "win32";
2305
- var eo = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
2306
- let r = e[e.length - 1];
2320
+ var io = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
2321
+ var so = io === "win32";
2322
+ var ro = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
2323
+ let r = e.at(-1);
2307
2324
  return r !== void 0 && (i = (0, import_node_path8.join)(r, i)), e.push(i || "/"), e;
2308
2325
  }, []);
2309
- var pi = class {
2326
+ var Si = class {
2310
2327
  #t = /* @__PURE__ */ new Map();
2311
2328
  #i = /* @__PURE__ */ new Map();
2312
2329
  #s = /* @__PURE__ */ new Set();
2313
2330
  reserve(t, e) {
2314
- t = to ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path8.join)(pr(r))));
2315
- let i = new Set(t.map((r) => eo(r)).reduce((r, n) => r.concat(n)));
2331
+ t = so ? ["win32 parallelization disabled"] : t.map((r) => mt((0, import_node_path8.join)(br(r))));
2332
+ let i = new Set(t.map((r) => ro(r)).reduce((r, n) => r.concat(n)));
2316
2333
  this.#i.set(e, { dirs: i, paths: t });
2317
2334
  for (let r of t) {
2318
2335
  let n = this.#t.get(r);
@@ -2322,7 +2339,7 @@ var pi = class {
2322
2339
  let n = this.#t.get(r);
2323
2340
  if (!n) this.#t.set(r, [/* @__PURE__ */ new Set([e])]);
2324
2341
  else {
2325
- let o = n[n.length - 1];
2342
+ let o = n.at(-1);
2326
2343
  o instanceof Set ? o.add(e) : n.push(/* @__PURE__ */ new Set([e]));
2327
2344
  }
2328
2345
  }
@@ -2346,61 +2363,61 @@ var pi = class {
2346
2363
  if (!e) throw new Error("invalid reservation");
2347
2364
  let { paths: i, dirs: r } = e, n = /* @__PURE__ */ new Set();
2348
2365
  for (let o of i) {
2349
- let h = this.#t.get(o);
2350
- if (!h || h?.[0] !== t) continue;
2351
- let a = h[1];
2352
- if (!a) {
2366
+ let a = this.#t.get(o);
2367
+ if (!a || a?.[0] !== t) continue;
2368
+ let h = a[1];
2369
+ if (!h) {
2353
2370
  this.#t.delete(o);
2354
2371
  continue;
2355
2372
  }
2356
- if (h.shift(), typeof a == "function") n.add(a);
2357
- else for (let l of a) n.add(l);
2373
+ if (a.shift(), typeof h == "function") n.add(h);
2374
+ else for (let l of h) n.add(l);
2358
2375
  }
2359
2376
  for (let o of r) {
2360
- let h = this.#t.get(o), a = h?.[0];
2361
- if (!(!h || !(a instanceof Set))) if (a.size === 1 && h.length === 1) {
2377
+ let a = this.#t.get(o), h = a?.[0];
2378
+ if (!(!a || !(h instanceof Set))) if (h.size === 1 && a.length === 1) {
2362
2379
  this.#t.delete(o);
2363
2380
  continue;
2364
- } else if (a.size === 1) {
2365
- h.shift();
2366
- let l = h[0];
2381
+ } else if (h.size === 1) {
2382
+ a.shift();
2383
+ let l = a[0];
2367
2384
  typeof l == "function" && n.add(l);
2368
- } else a.delete(t);
2385
+ } else h.delete(t);
2369
2386
  }
2370
2387
  return this.#s.delete(t), n.forEach((o) => this.#r(o)), true;
2371
2388
  }
2372
2389
  };
2373
- var wr = () => process.umask();
2374
- var Sr = /* @__PURE__ */ Symbol("onEntry");
2375
- var Ss = /* @__PURE__ */ Symbol("checkFs");
2376
- var yr = /* @__PURE__ */ Symbol("checkFs2");
2377
- var ys = /* @__PURE__ */ Symbol("isReusable");
2390
+ var Or = () => process.umask();
2391
+ var Tr = /* @__PURE__ */ Symbol("onEntry");
2392
+ var gs = /* @__PURE__ */ Symbol("checkFs");
2393
+ var xr = /* @__PURE__ */ Symbol("checkFs2");
2394
+ var bs = /* @__PURE__ */ Symbol("isReusable");
2378
2395
  var P = /* @__PURE__ */ Symbol("makeFs");
2379
- var Rs = /* @__PURE__ */ Symbol("file");
2380
- var bs = /* @__PURE__ */ Symbol("directory");
2381
- var wi = /* @__PURE__ */ Symbol("link");
2382
- var Rr = /* @__PURE__ */ Symbol("symlink");
2383
- var br = /* @__PURE__ */ Symbol("hardlink");
2396
+ var _s = /* @__PURE__ */ Symbol("file");
2397
+ var Os = /* @__PURE__ */ Symbol("directory");
2398
+ var Ri = /* @__PURE__ */ Symbol("link");
2399
+ var Lr = /* @__PURE__ */ Symbol("symlink");
2400
+ var Nr = /* @__PURE__ */ Symbol("hardlink");
2384
2401
  var ye = /* @__PURE__ */ Symbol("ensureNoSymlink");
2385
- var gr = /* @__PURE__ */ Symbol("unsupported");
2386
- var _r = /* @__PURE__ */ Symbol("checkPath");
2387
- var ps = /* @__PURE__ */ Symbol("stripAbsolutePath");
2388
- var St = /* @__PURE__ */ Symbol("mkdir");
2402
+ var Dr = /* @__PURE__ */ Symbol("unsupported");
2403
+ var Ar = /* @__PURE__ */ Symbol("checkPath");
2404
+ var Ss = /* @__PURE__ */ Symbol("stripAbsolutePath");
2405
+ var yt = /* @__PURE__ */ Symbol("mkdir");
2389
2406
  var O = /* @__PURE__ */ Symbol("onError");
2390
- var Ei = /* @__PURE__ */ Symbol("pending");
2391
- var Or = /* @__PURE__ */ Symbol("pend");
2392
- var Xt = /* @__PURE__ */ Symbol("unpend");
2393
- var Es = /* @__PURE__ */ Symbol("ended");
2394
- var ws = /* @__PURE__ */ Symbol("maybeClose");
2395
- var gs = /* @__PURE__ */ Symbol("skip");
2407
+ var yi = /* @__PURE__ */ Symbol("pending");
2408
+ var Ir = /* @__PURE__ */ Symbol("pend");
2409
+ var $t = /* @__PURE__ */ Symbol("unpend");
2410
+ var ys = /* @__PURE__ */ Symbol("ended");
2411
+ var Rs = /* @__PURE__ */ Symbol("maybeClose");
2412
+ var Ts = /* @__PURE__ */ Symbol("skip");
2396
2413
  var Re = /* @__PURE__ */ Symbol("doChown");
2397
- var be = /* @__PURE__ */ Symbol("uid");
2398
- var ge = /* @__PURE__ */ Symbol("gid");
2414
+ var ge = /* @__PURE__ */ Symbol("uid");
2415
+ var be = /* @__PURE__ */ Symbol("gid");
2399
2416
  var _e = /* @__PURE__ */ Symbol("checkedCwd");
2400
- var so = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
2401
- var Oe = so === "win32";
2402
- var ro = 1024;
2403
- var no = (s3, t) => {
2417
+ var oo = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
2418
+ var Oe = oo === "win32";
2419
+ var ho = 1024;
2420
+ var ao = (s3, t) => {
2404
2421
  if (!Oe) return import_node_fs3.default.unlink(s3, t);
2405
2422
  let e = s3 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex");
2406
2423
  import_node_fs3.default.rename(s3, e, (i) => {
@@ -2408,17 +2425,17 @@ var no = (s3, t) => {
2408
2425
  import_node_fs3.default.unlink(e, t);
2409
2426
  });
2410
2427
  };
2411
- var oo = (s3) => {
2428
+ var lo = (s3) => {
2412
2429
  if (!Oe) return import_node_fs3.default.unlinkSync(s3);
2413
2430
  let t = s3 + ".DELETE." + (0, import_node_crypto.randomBytes)(16).toString("hex");
2414
2431
  import_node_fs3.default.renameSync(s3, t), import_node_fs3.default.unlinkSync(t);
2415
2432
  };
2416
- var Tr = (s3, t, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t !== void 0 && t === t >>> 0 ? t : e;
2417
- var qt = class extends st {
2418
- [Es] = false;
2433
+ var Fr = (s3, t, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t !== void 0 && t === t >>> 0 ? t : e;
2434
+ var Xt = class extends st {
2435
+ [ys] = false;
2419
2436
  [_e] = false;
2420
- [Ei] = 0;
2421
- reservations = new pi();
2437
+ [yi] = 0;
2438
+ reservations = new Si();
2422
2439
  transform;
2423
2440
  writable = true;
2424
2441
  readable = false;
@@ -2445,34 +2462,32 @@ var qt = class extends st {
2445
2462
  chmod;
2446
2463
  constructor(t = {}) {
2447
2464
  if (t.ondone = () => {
2448
- this[Es] = true, this[ws]();
2465
+ this[ys] = true, this[Rs]();
2449
2466
  }, super(t), this.transform = t.transform, this.chmod = !!t.chmod, typeof t.uid == "number" || typeof t.gid == "number") {
2450
2467
  if (typeof t.uid != "number" || typeof t.gid != "number") throw new TypeError("cannot set owner without number uid and gid");
2451
2468
  if (t.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
2452
2469
  this.uid = t.uid, this.gid = t.gid, this.setOwner = true;
2453
2470
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
2454
- t.preserveOwner === void 0 && typeof t.uid != "number" ? this.preserveOwner = !!(process.getuid && process.getuid() === 0) : this.preserveOwner = !!t.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t.maxDepth == "number" ? t.maxDepth : ro, this.forceChown = t.forceChown === true, this.win32 = !!t.win32 || Oe, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(import_node_path5.default.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : wr() : 0, this.umask = typeof t.umask == "number" ? t.umask : this.processUmask, this.dmode = t.dmode || 511 & ~this.umask, this.fmode = t.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Sr](e));
2471
+ this.preserveOwner = t.preserveOwner === void 0 && typeof t.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t.maxDepth == "number" ? t.maxDepth : ho, this.forceChown = t.forceChown === true, this.win32 = !!t.win32 || Oe, this.newer = !!t.newer, this.keep = !!t.keep, this.noMtime = !!t.noMtime, this.preservePaths = !!t.preservePaths, this.unlink = !!t.unlink, this.cwd = f(import_node_path5.default.resolve(t.cwd || process.cwd())), this.strip = Number(t.strip) || 0, this.processUmask = this.chmod ? typeof t.processUmask == "number" ? t.processUmask : Or() : 0, this.umask = typeof t.umask == "number" ? t.umask : this.processUmask, this.dmode = t.dmode || 511 & ~this.umask, this.fmode = t.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Tr](e));
2455
2472
  }
2456
2473
  warn(t, e, i = {}) {
2457
2474
  return (t === "TAR_BAD_ARCHIVE" || t === "TAR_ABORT") && (i.recoverable = false), super.warn(t, e, i);
2458
2475
  }
2459
- [ws]() {
2460
- this[Es] && this[Ei] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
2476
+ [Rs]() {
2477
+ this[ys] && this[yi] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
2461
2478
  }
2462
- [ps](t, e) {
2479
+ [Ss](t, e) {
2463
2480
  let i = t[e], { type: r } = t;
2464
2481
  if (!i || this.preservePaths) return true;
2465
- let [n, o] = ce(i), h = o.replace(/\\/g, "/").split("/");
2466
- if (h.includes("..") || Oe && /^[a-z]:\.\.$/i.test(h[0] ?? "")) {
2482
+ let [n, o] = le(i), a = o.replaceAll(/\\/g, "/").split("/");
2483
+ if (a.includes("..") || Oe && /^[a-z]:\.\.$/i.test(a[0] ?? "")) {
2467
2484
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t, [e]: i }), false;
2468
- {
2469
- let a = import_node_path5.default.posix.dirname(t.path), l = import_node_path5.default.posix.normalize(import_node_path5.default.posix.join(a, h.join("/")));
2470
- if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t, [e]: i }), false;
2471
- }
2485
+ let h = import_node_path5.default.posix.dirname(t.path), l = import_node_path5.default.posix.normalize(import_node_path5.default.posix.join(h, a.join("/")));
2486
+ if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t, [e]: i }), false;
2472
2487
  }
2473
2488
  return n && (t[e] = String(o), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e}`, { entry: t, [e]: i })), true;
2474
2489
  }
2475
- [_r](t) {
2490
+ [Ar](t) {
2476
2491
  let e = f(t.path), i = e.split("/");
2477
2492
  if (this.strip) {
2478
2493
  if (i.length < this.strip) return false;
@@ -2484,19 +2499,19 @@ var qt = class extends st {
2484
2499
  i.splice(0, this.strip), t.path = i.join("/");
2485
2500
  }
2486
2501
  if (isFinite(this.maxDepth) && i.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t, path: e, depth: i.length, maxDepth: this.maxDepth }), false;
2487
- if (!this[ps](t, "path") || !this[ps](t, "linkpath")) return false;
2488
- if (import_node_path5.default.isAbsolute(t.path) ? t.absolute = f(import_node_path5.default.resolve(t.path)) : t.absolute = f(import_node_path5.default.resolve(this.cwd, t.path)), !this.preservePaths && typeof t.absolute == "string" && t.absolute.indexOf(this.cwd + "/") !== 0 && t.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t, path: f(t.path), resolvedPath: t.absolute, cwd: this.cwd }), false;
2502
+ if (!this[Ss](t, "path") || !this[Ss](t, "linkpath")) return false;
2503
+ if (t.absolute = import_node_path5.default.isAbsolute(t.path) ? f(import_node_path5.default.resolve(t.path)) : f(import_node_path5.default.resolve(this.cwd, t.path)), !this.preservePaths && typeof t.absolute == "string" && t.absolute.indexOf(this.cwd + "/") !== 0 && t.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t, path: f(t.path), resolvedPath: t.absolute, cwd: this.cwd }), false;
2489
2504
  if (t.absolute === this.cwd && t.type !== "Directory" && t.type !== "GNUDumpDir") return false;
2490
2505
  if (this.win32) {
2491
2506
  let { root: r } = import_node_path5.default.win32.parse(String(t.absolute));
2492
- t.absolute = r + $i(String(t.absolute).slice(r.length));
2507
+ t.absolute = r + Ji(String(t.absolute).slice(r.length));
2493
2508
  let { root: n } = import_node_path5.default.win32.parse(t.path);
2494
- t.path = n + $i(t.path.slice(n.length));
2509
+ t.path = n + Ji(t.path.slice(n.length));
2495
2510
  }
2496
2511
  return true;
2497
2512
  }
2498
- [Sr](t) {
2499
- if (!this[_r](t)) return t.resume();
2513
+ [Tr](t) {
2514
+ if (!this[Ar](t)) return t.resume();
2500
2515
  switch (import_node_assert.default.equal(typeof t.absolute, "string"), t.type) {
2501
2516
  case "Directory":
2502
2517
  case "GNUDumpDir":
@@ -2506,133 +2521,133 @@ var qt = class extends st {
2506
2521
  case "ContiguousFile":
2507
2522
  case "Link":
2508
2523
  case "SymbolicLink":
2509
- return this[Ss](t);
2524
+ return this[gs](t);
2510
2525
  default:
2511
- return this[gr](t);
2526
+ return this[Dr](t);
2512
2527
  }
2513
2528
  }
2514
2529
  [O](t, e) {
2515
- t.name === "CwdError" ? this.emit("error", t) : (this.warn("TAR_ENTRY_ERROR", t, { entry: e }), this[Xt](), e.resume());
2530
+ t.name === "CwdError" ? this.emit("error", t) : (this.warn("TAR_ENTRY_ERROR", t, { entry: e }), this[$t](), e.resume());
2516
2531
  }
2517
- [St](t, e, i) {
2518
- fr(f(t), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e }, i);
2532
+ [yt](t, e, i) {
2533
+ Sr(f(t), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e }, i);
2519
2534
  }
2520
2535
  [Re](t) {
2521
2536
  return this.forceChown || this.preserveOwner && (typeof t.uid == "number" && t.uid !== this.processUid || typeof t.gid == "number" && t.gid !== this.processGid) || typeof this.uid == "number" && this.uid !== this.processUid || typeof this.gid == "number" && this.gid !== this.processGid;
2522
2537
  }
2523
- [be](t) {
2524
- return Tr(this.uid, t.uid, this.processUid);
2525
- }
2526
2538
  [ge](t) {
2527
- return Tr(this.gid, t.gid, this.processGid);
2539
+ return Fr(this.uid, t.uid, this.processUid);
2528
2540
  }
2529
- [Rs](t, e) {
2530
- let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = new tt(String(t.absolute), { flags: ls(t.size), mode: i, autoClose: false });
2531
- r.on("error", (a) => {
2541
+ [be](t) {
2542
+ return Fr(this.gid, t.gid, this.processGid);
2543
+ }
2544
+ [_s](t, e) {
2545
+ let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = new tt(String(t.absolute), { flags: ds(t.size), mode: i, autoClose: false });
2546
+ r.on("error", (h) => {
2532
2547
  r.fd && import_node_fs3.default.close(r.fd, () => {
2533
- }), r.write = () => true, this[O](a, t), e();
2548
+ }), r.write = () => true, this[O](h, t), e();
2534
2549
  });
2535
- let n = 1, o = (a) => {
2536
- if (a) {
2550
+ let n = 1, o = (h) => {
2551
+ if (h) {
2537
2552
  r.fd && import_node_fs3.default.close(r.fd, () => {
2538
- }), this[O](a, t), e();
2553
+ }), this[O](h, t), e();
2539
2554
  return;
2540
2555
  }
2541
2556
  --n === 0 && r.fd !== void 0 && import_node_fs3.default.close(r.fd, (l) => {
2542
- l ? this[O](l, t) : this[Xt](), e();
2557
+ l ? this[O](l, t) : this[$t](), e();
2543
2558
  });
2544
2559
  };
2545
2560
  r.on("finish", () => {
2546
- let a = String(t.absolute), l = r.fd;
2561
+ let h = String(t.absolute), l = r.fd;
2547
2562
  if (typeof l == "number" && t.mtime && !this.noMtime) {
2548
2563
  n++;
2549
2564
  let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
2550
- import_node_fs3.default.futimes(l, c, d, (S) => S ? import_node_fs3.default.utimes(a, c, d, (T) => o(T && S)) : o());
2565
+ import_node_fs3.default.futimes(l, c, d, (S) => S ? import_node_fs3.default.utimes(h, c, d, (T) => o(T && S)) : o());
2551
2566
  }
2552
2567
  if (typeof l == "number" && this[Re](t)) {
2553
2568
  n++;
2554
- let c = this[be](t), d = this[ge](t);
2555
- typeof c == "number" && typeof d == "number" && import_node_fs3.default.fchown(l, c, d, (S) => S ? import_node_fs3.default.chown(a, c, d, (T) => o(T && S)) : o());
2569
+ let c = this[ge](t), d = this[be](t);
2570
+ typeof c == "number" && typeof d == "number" && import_node_fs3.default.fchown(l, c, d, (S) => S ? import_node_fs3.default.chown(h, c, d, (T) => o(T && S)) : o());
2556
2571
  }
2557
2572
  o();
2558
2573
  });
2559
- let h = this.transform && this.transform(t) || t;
2560
- h !== t && (h.on("error", (a) => {
2561
- this[O](a, t), e();
2562
- }), t.pipe(h)), h.pipe(r);
2574
+ let a = this.transform && this.transform(t) || t;
2575
+ a !== t && (a.on("error", (h) => {
2576
+ this[O](h, t), e();
2577
+ }), t.pipe(a)), a.pipe(r);
2563
2578
  }
2564
- [bs](t, e) {
2579
+ [Os](t, e) {
2565
2580
  let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode;
2566
- this[St](String(t.absolute), i, (r) => {
2581
+ this[yt](String(t.absolute), i, (r) => {
2567
2582
  if (r) {
2568
2583
  this[O](r, t), e();
2569
2584
  return;
2570
2585
  }
2571
2586
  let n = 1, o = () => {
2572
- --n === 0 && (e(), this[Xt](), t.resume());
2587
+ --n === 0 && (e(), this[$t](), t.resume());
2573
2588
  };
2574
- t.mtime && !this.noMtime && (n++, import_node_fs3.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[Re](t) && (n++, import_node_fs3.default.chown(String(t.absolute), Number(this[be](t)), Number(this[ge](t)), o)), o();
2589
+ t.mtime && !this.noMtime && (n++, import_node_fs3.default.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[Re](t) && (n++, import_node_fs3.default.chown(String(t.absolute), Number(this[ge](t)), Number(this[be](t)), o)), o();
2575
2590
  });
2576
2591
  }
2577
- [gr](t) {
2592
+ [Dr](t) {
2578
2593
  t.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t.type}`, { entry: t }), t.resume();
2579
2594
  }
2580
- [Rr](t, e) {
2595
+ [Lr](t, e) {
2581
2596
  let i = f(import_node_path5.default.relative(this.cwd, import_node_path5.default.resolve(import_node_path5.default.dirname(String(t.absolute)), String(t.linkpath)))).split("/");
2582
- this[ye](t, this.cwd, i, () => this[wi](t, String(t.linkpath), "symlink", e), (r) => {
2597
+ this[ye](t, this.cwd, i, () => this[Ri](t, String(t.linkpath), "symlink", e), (r) => {
2583
2598
  this[O](r, t), e();
2584
2599
  });
2585
2600
  }
2586
- [br](t, e) {
2601
+ [Nr](t, e) {
2587
2602
  let i = f(import_node_path5.default.resolve(this.cwd, String(t.linkpath))), r = f(String(t.linkpath)).split("/");
2588
- this[ye](t, this.cwd, r, () => this[wi](t, i, "link", e), (n) => {
2603
+ this[ye](t, this.cwd, r, () => this[Ri](t, i, "link", e), (n) => {
2589
2604
  this[O](n, t), e();
2590
2605
  });
2591
2606
  }
2592
2607
  [ye](t, e, i, r, n) {
2593
2608
  let o = i.shift();
2594
2609
  if (this.preservePaths || o === void 0) return r();
2595
- let h = import_node_path5.default.resolve(e, o);
2596
- import_node_fs3.default.lstat(h, (a, l) => {
2597
- if (a) return r();
2598
- if (l?.isSymbolicLink()) return n(new wt(h, import_node_path5.default.resolve(h, i.join("/"))));
2599
- this[ye](t, h, i, r, n);
2610
+ let a = import_node_path5.default.resolve(e, o);
2611
+ import_node_fs3.default.lstat(a, (h, l) => {
2612
+ if (h) return r();
2613
+ if (l?.isSymbolicLink()) return n(new St(a, import_node_path5.default.resolve(a, i.join("/"))));
2614
+ this[ye](t, a, i, r, n);
2600
2615
  });
2601
2616
  }
2602
- [Or]() {
2603
- this[Ei]++;
2617
+ [Ir]() {
2618
+ this[yi]++;
2604
2619
  }
2605
- [Xt]() {
2606
- this[Ei]--, this[ws]();
2620
+ [$t]() {
2621
+ this[yi]--, this[Rs]();
2607
2622
  }
2608
- [gs](t) {
2609
- this[Xt](), t.resume();
2623
+ [Ts](t) {
2624
+ this[$t](), t.resume();
2610
2625
  }
2611
- [ys](t, e) {
2626
+ [bs](t, e) {
2612
2627
  return t.type === "File" && !this.unlink && e.isFile() && e.nlink <= 1 && !Oe;
2613
2628
  }
2614
- [Ss](t) {
2615
- this[Or]();
2629
+ [gs](t) {
2630
+ this[Ir]();
2616
2631
  let e = [t.path];
2617
- t.linkpath && e.push(t.linkpath), this.reservations.reserve(e, (i) => this[yr](t, i));
2632
+ t.linkpath && e.push(t.linkpath), this.reservations.reserve(e, (i) => this[xr](t, i));
2618
2633
  }
2619
- [yr](t, e) {
2620
- let i = (h) => {
2621
- e(h);
2634
+ [xr](t, e) {
2635
+ let i = (a) => {
2636
+ e(a);
2622
2637
  }, r = () => {
2623
- this[St](this.cwd, this.dmode, (h) => {
2624
- if (h) {
2625
- this[O](h, t), i();
2638
+ this[yt](this.cwd, this.dmode, (a) => {
2639
+ if (a) {
2640
+ this[O](a, t), i();
2626
2641
  return;
2627
2642
  }
2628
2643
  this[_e] = true, n();
2629
2644
  });
2630
2645
  }, n = () => {
2631
2646
  if (t.absolute !== this.cwd) {
2632
- let h = f(import_node_path5.default.dirname(String(t.absolute)));
2633
- if (h !== this.cwd) return this[St](h, this.dmode, (a) => {
2634
- if (a) {
2635
- this[O](a, t), i();
2647
+ let a = f(import_node_path5.default.dirname(String(t.absolute)));
2648
+ if (a !== this.cwd) return this[yt](a, this.dmode, (h) => {
2649
+ if (h) {
2650
+ this[O](h, t), i();
2636
2651
  return;
2637
2652
  }
2638
2653
  o();
@@ -2640,21 +2655,21 @@ var qt = class extends st {
2640
2655
  }
2641
2656
  o();
2642
2657
  }, o = () => {
2643
- import_node_fs3.default.lstat(String(t.absolute), (h, a) => {
2644
- if (a && (this.keep || this.newer && a.mtime > (t.mtime ?? a.mtime))) {
2645
- this[gs](t), i();
2658
+ import_node_fs3.default.lstat(String(t.absolute), (a, h) => {
2659
+ if (h && (this.keep || this.newer && h.mtime > (t.mtime ?? h.mtime))) {
2660
+ this[Ts](t), i();
2646
2661
  return;
2647
2662
  }
2648
- if (h || this[ys](t, a)) return this[P](null, t, i);
2649
- if (a.isDirectory()) {
2663
+ if (a || this[bs](t, h)) return this[P](null, t, i);
2664
+ if (h.isDirectory()) {
2650
2665
  if (t.type === "Directory") {
2651
- let l = this.chmod && t.mode && (a.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
2666
+ let l = this.chmod && t.mode && (h.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
2652
2667
  return l ? import_node_fs3.default.chmod(String(t.absolute), Number(t.mode), c) : c();
2653
2668
  }
2654
2669
  if (t.absolute !== this.cwd) return import_node_fs3.default.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
2655
2670
  }
2656
2671
  if (t.absolute === this.cwd) return this[P](null, t, i);
2657
- no(String(t.absolute), (l) => this[P](l ?? null, t, i));
2672
+ ao(String(t.absolute), (l) => this[P](l ?? null, t, i));
2658
2673
  });
2659
2674
  };
2660
2675
  this[_e] ? n() : r();
@@ -2668,19 +2683,19 @@ var qt = class extends st {
2668
2683
  case "File":
2669
2684
  case "OldFile":
2670
2685
  case "ContiguousFile":
2671
- return this[Rs](e, i);
2686
+ return this[_s](e, i);
2672
2687
  case "Link":
2673
- return this[br](e, i);
2688
+ return this[Nr](e, i);
2674
2689
  case "SymbolicLink":
2675
- return this[Rr](e, i);
2690
+ return this[Lr](e, i);
2676
2691
  case "Directory":
2677
2692
  case "GNUDumpDir":
2678
- return this[bs](e, i);
2693
+ return this[Os](e, i);
2679
2694
  }
2680
2695
  }
2681
- [wi](t, e, i, r) {
2696
+ [Ri](t, e, i, r) {
2682
2697
  import_node_fs3.default[i](e, String(t.absolute), (n) => {
2683
- n ? this[O](n, t) : (this[Xt](), t.resume()), r();
2698
+ n ? this[O](n, t) : (this[$t](), t.resume()), r();
2684
2699
  });
2685
2700
  }
2686
2701
  };
@@ -2691,94 +2706,94 @@ var Se = (s3) => {
2691
2706
  return [t, null];
2692
2707
  }
2693
2708
  };
2694
- var Te = class extends qt {
2709
+ var Te = class extends Xt {
2695
2710
  sync = true;
2696
2711
  [P](t, e) {
2697
2712
  return super[P](t, e, () => {
2698
2713
  });
2699
2714
  }
2700
- [Ss](t) {
2715
+ [gs](t) {
2701
2716
  if (!this[_e]) {
2702
- let n = this[St](this.cwd, this.dmode);
2717
+ let n = this[yt](this.cwd, this.dmode);
2703
2718
  if (n) return this[O](n, t);
2704
2719
  this[_e] = true;
2705
2720
  }
2706
2721
  if (t.absolute !== this.cwd) {
2707
2722
  let n = f(import_node_path5.default.dirname(String(t.absolute)));
2708
2723
  if (n !== this.cwd) {
2709
- let o = this[St](n, this.dmode);
2724
+ let o = this[yt](n, this.dmode);
2710
2725
  if (o) return this[O](o, t);
2711
2726
  }
2712
2727
  }
2713
2728
  let [e, i] = Se(() => import_node_fs3.default.lstatSync(String(t.absolute)));
2714
- if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[gs](t);
2715
- if (e || this[ys](t, i)) return this[P](null, t);
2729
+ if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Ts](t);
2730
+ if (e || this[bs](t, i)) return this[P](null, t);
2716
2731
  if (i.isDirectory()) {
2717
2732
  if (t.type === "Directory") {
2718
- let o = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [h] = o ? Se(() => {
2733
+ let o = this.chmod && t.mode && (i.mode & 4095) !== t.mode, [a] = o ? Se(() => {
2719
2734
  import_node_fs3.default.chmodSync(String(t.absolute), Number(t.mode));
2720
2735
  }) : [];
2721
- return this[P](h, t);
2736
+ return this[P](a, t);
2722
2737
  }
2723
2738
  let [n] = Se(() => import_node_fs3.default.rmdirSync(String(t.absolute)));
2724
2739
  this[P](n, t);
2725
2740
  }
2726
- let [r] = t.absolute === this.cwd ? [] : Se(() => oo(String(t.absolute)));
2741
+ let [r] = t.absolute === this.cwd ? [] : Se(() => lo(String(t.absolute)));
2727
2742
  this[P](r, t);
2728
2743
  }
2729
- [Rs](t, e) {
2730
- let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (h) => {
2731
- let a;
2744
+ [_s](t, e) {
2745
+ let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (a) => {
2746
+ let h;
2732
2747
  try {
2733
2748
  import_node_fs3.default.closeSync(n);
2734
2749
  } catch (l) {
2735
- a = l;
2750
+ h = l;
2736
2751
  }
2737
- (h || a) && this[O](h || a, t), e();
2752
+ (a || h) && this[O](a || h, t), e();
2738
2753
  }, n;
2739
2754
  try {
2740
- n = import_node_fs3.default.openSync(String(t.absolute), ls(t.size), i);
2741
- } catch (h) {
2742
- return r(h);
2755
+ n = import_node_fs3.default.openSync(String(t.absolute), ds(t.size), i);
2756
+ } catch (a) {
2757
+ return r(a);
2743
2758
  }
2744
2759
  let o = this.transform && this.transform(t) || t;
2745
- o !== t && (o.on("error", (h) => this[O](h, t)), t.pipe(o)), o.on("data", (h) => {
2760
+ o !== t && (o.on("error", (a) => this[O](a, t)), t.pipe(o)), o.on("data", (a) => {
2746
2761
  try {
2747
- import_node_fs3.default.writeSync(n, h, 0, h.length);
2748
- } catch (a) {
2749
- r(a);
2762
+ import_node_fs3.default.writeSync(n, a, 0, a.length);
2763
+ } catch (h) {
2764
+ r(h);
2750
2765
  }
2751
2766
  }), o.on("end", () => {
2752
- let h = null;
2767
+ let a = null;
2753
2768
  if (t.mtime && !this.noMtime) {
2754
- let a = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
2769
+ let h = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
2755
2770
  try {
2756
- import_node_fs3.default.futimesSync(n, a, l);
2771
+ import_node_fs3.default.futimesSync(n, h, l);
2757
2772
  } catch (c) {
2758
2773
  try {
2759
- import_node_fs3.default.utimesSync(String(t.absolute), a, l);
2774
+ import_node_fs3.default.utimesSync(String(t.absolute), h, l);
2760
2775
  } catch {
2761
- h = c;
2776
+ a = c;
2762
2777
  }
2763
2778
  }
2764
2779
  }
2765
2780
  if (this[Re](t)) {
2766
- let a = this[be](t), l = this[ge](t);
2781
+ let h = this[ge](t), l = this[be](t);
2767
2782
  try {
2768
- import_node_fs3.default.fchownSync(n, Number(a), Number(l));
2783
+ import_node_fs3.default.fchownSync(n, Number(h), Number(l));
2769
2784
  } catch (c) {
2770
2785
  try {
2771
- import_node_fs3.default.chownSync(String(t.absolute), Number(a), Number(l));
2786
+ import_node_fs3.default.chownSync(String(t.absolute), Number(h), Number(l));
2772
2787
  } catch {
2773
- h = h || c;
2788
+ a = a || c;
2774
2789
  }
2775
2790
  }
2776
2791
  }
2777
- r(h);
2792
+ r(a);
2778
2793
  });
2779
2794
  }
2780
- [bs](t, e) {
2781
- let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode, r = this[St](String(t.absolute), i);
2795
+ [Os](t, e) {
2796
+ let i = typeof t.mode == "number" ? t.mode & 4095 : this.dmode, r = this[yt](String(t.absolute), i);
2782
2797
  if (r) {
2783
2798
  this[O](r, t), e();
2784
2799
  return;
@@ -2788,30 +2803,30 @@ var Te = class extends qt {
2788
2803
  } catch {
2789
2804
  }
2790
2805
  if (this[Re](t)) try {
2791
- import_node_fs3.default.chownSync(String(t.absolute), Number(this[be](t)), Number(this[ge](t)));
2806
+ import_node_fs3.default.chownSync(String(t.absolute), Number(this[ge](t)), Number(this[be](t)));
2792
2807
  } catch {
2793
2808
  }
2794
2809
  e(), t.resume();
2795
2810
  }
2796
- [St](t, e) {
2811
+ [yt](t, e) {
2797
2812
  try {
2798
- return ur(f(t), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e });
2813
+ return Rr(f(t), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e });
2799
2814
  } catch (i) {
2800
2815
  return i;
2801
2816
  }
2802
2817
  }
2803
2818
  [ye](t, e, i, r, n) {
2804
- if (this.preservePaths || !i.length) return r();
2819
+ if (this.preservePaths || i.length === 0) return r();
2805
2820
  let o = e;
2806
- for (let h of i) {
2807
- o = import_node_path5.default.resolve(o, h);
2808
- let [a, l] = Se(() => import_node_fs3.default.lstatSync(o));
2809
- if (a) return r();
2810
- if (l.isSymbolicLink()) return n(new wt(o, import_node_path5.default.resolve(e, i.join("/"))));
2821
+ for (let a of i) {
2822
+ o = import_node_path5.default.resolve(o, a);
2823
+ let [h, l] = Se(() => import_node_fs3.default.lstatSync(o));
2824
+ if (h) return r();
2825
+ if (l.isSymbolicLink()) return n(new St(o, import_node_path5.default.resolve(e, i.join("/"))));
2811
2826
  }
2812
2827
  r();
2813
2828
  }
2814
- [wi](t, e, i, r) {
2829
+ [Ri](t, e, i, r) {
2815
2830
  let n = `${i}Sync`;
2816
2831
  try {
2817
2832
  import_node_fs3.default[n](e, String(t.absolute)), r(), t.resume();
@@ -2820,47 +2835,47 @@ var Te = class extends qt {
2820
2835
  }
2821
2836
  }
2822
2837
  };
2823
- var ho = (s3) => {
2838
+ var co = (s3) => {
2824
2839
  let t = new Te(s3), e = s3.file, i = import_node_fs2.default.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
2825
- new ve(e, { readSize: r, size: i.size }).pipe(t);
2840
+ new Me(e, { readSize: r, size: i.size }).pipe(t);
2826
2841
  };
2827
- var ao = (s3, t) => {
2828
- let e = new qt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
2829
- return new Promise((o, h) => {
2830
- e.on("error", h), e.on("close", o), import_node_fs2.default.stat(r, (a, l) => {
2831
- if (a) h(a);
2842
+ var fo = (s3, t) => {
2843
+ let e = new Xt(s3), i = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
2844
+ return new Promise((o, a) => {
2845
+ e.on("error", a), e.on("close", o), import_node_fs2.default.stat(r, (h, l) => {
2846
+ if (h) a(h);
2832
2847
  else {
2833
- let c = new gt(r, { readSize: i, size: l.size });
2834
- c.on("error", h), c.pipe(e);
2848
+ let c = new _t(r, { readSize: i, size: l.size });
2849
+ c.on("error", a), c.pipe(e);
2835
2850
  }
2836
2851
  });
2837
2852
  });
2838
2853
  };
2839
- var lo = K(ho, ao, (s3) => new Te(s3), (s3) => new qt(s3), (s3, t) => {
2840
- t?.length && Yi(s3, t);
2854
+ var uo = K(co, fo, (s3) => new Te(s3), (s3) => new Xt(s3), (s3, t) => {
2855
+ t?.length && Xi(s3, t);
2841
2856
  });
2842
- var co = (s3, t) => {
2857
+ var mo = (s3, t) => {
2843
2858
  let e = new kt(s3), i = true, r, n;
2844
2859
  try {
2845
2860
  try {
2846
2861
  r = import_node_fs6.default.openSync(s3.file, "r+");
2847
- } catch (a) {
2848
- if (a?.code === "ENOENT") r = import_node_fs6.default.openSync(s3.file, "w+");
2849
- else throw a;
2862
+ } catch (h) {
2863
+ if (h?.code === "ENOENT") r = import_node_fs6.default.openSync(s3.file, "w+");
2864
+ else throw h;
2850
2865
  }
2851
- let o = import_node_fs6.default.fstatSync(r), h = Buffer.alloc(512);
2866
+ let o = import_node_fs6.default.fstatSync(r), a = Buffer.alloc(512);
2852
2867
  t: for (n = 0; n < o.size; n += 512) {
2853
2868
  for (let c = 0, d = 0; c < 512; c += d) {
2854
- if (d = import_node_fs6.default.readSync(r, h, c, h.length - c, n + c), n === 0 && h[0] === 31 && h[1] === 139) throw new Error("cannot append to compressed archives");
2869
+ if (d = import_node_fs6.default.readSync(r, a, c, a.length - c, n + c), n === 0 && a[0] === 31 && a[1] === 139) throw new Error("cannot append to compressed archives");
2855
2870
  if (!d) break t;
2856
2871
  }
2857
- let a = new F(h);
2858
- if (!a.cksumValid) break;
2859
- let l = 512 * Math.ceil((a.size || 0) / 512);
2872
+ let h = new C(a);
2873
+ if (!h.cksumValid) break;
2874
+ let l = 512 * Math.ceil((h.size || 0) / 512);
2860
2875
  if (n + l + 512 > o.size) break;
2861
- n += l, s3.mtimeCache && a.mtime && s3.mtimeCache.set(String(a.path), a.mtime);
2876
+ n += l, s3.mtimeCache && h.mtime && s3.mtimeCache.set(String(h.path), h.mtime);
2862
2877
  }
2863
- i = false, fo(s3, e, n, r, t);
2878
+ i = false, po(s3, e, n, r, t);
2864
2879
  } finally {
2865
2880
  if (i) try {
2866
2881
  import_node_fs6.default.closeSync(r);
@@ -2868,72 +2883,69 @@ var co = (s3, t) => {
2868
2883
  }
2869
2884
  }
2870
2885
  };
2871
- var fo = (s3, t, e, i, r) => {
2886
+ var po = (s3, t, e, i, r) => {
2872
2887
  let n = new Wt(s3.file, { fd: i, start: e });
2873
- t.pipe(n), mo(t, r);
2888
+ t.pipe(n), wo(t, r);
2874
2889
  };
2875
- var uo = (s3, t) => {
2890
+ var Eo = (s3, t) => {
2876
2891
  t = Array.from(t);
2877
- let e = new Et(s3), i = (n, o, h) => {
2878
- let a = (T, N) => {
2879
- T ? import_node_fs6.default.close(n, (E) => h(T)) : h(null, N);
2892
+ let e = new wt(s3), i = (n, o, a) => {
2893
+ let h = (T, N) => {
2894
+ T ? import_node_fs6.default.close(n, (E) => a(T)) : a(null, N);
2880
2895
  }, l = 0;
2881
- if (o === 0) return a(null, 0);
2896
+ if (o === 0) return h(null, 0);
2882
2897
  let c = 0, d = Buffer.alloc(512), S = (T, N) => {
2883
- if (T || typeof N > "u") return a(T);
2898
+ if (T || N === void 0) return h(T);
2884
2899
  if (c += N, c < 512 && N) return import_node_fs6.default.read(n, d, c, d.length - c, l + c, S);
2885
- if (l === 0 && d[0] === 31 && d[1] === 139) return a(new Error("cannot append to compressed archives"));
2886
- if (c < 512) return a(null, l);
2887
- let E = new F(d);
2888
- if (!E.cksumValid) return a(null, l);
2900
+ if (l === 0 && d[0] === 31 && d[1] === 139) return h(new Error("cannot append to compressed archives"));
2901
+ if (c < 512) return h(null, l);
2902
+ let E = new C(d);
2903
+ if (!E.cksumValid) return h(null, l);
2889
2904
  let x = 512 * Math.ceil((E.size ?? 0) / 512);
2890
- if (l + x + 512 > o || (l += x + 512, l >= o)) return a(null, l);
2905
+ if (l + x + 512 > o || (l += x + 512, l >= o)) return h(null, l);
2891
2906
  s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c = 0, import_node_fs6.default.read(n, d, 0, 512, l, S);
2892
2907
  };
2893
2908
  import_node_fs6.default.read(n, d, 0, 512, l, S);
2894
2909
  };
2895
2910
  return new Promise((n, o) => {
2896
2911
  e.on("error", o);
2897
- let h = "r+", a = (l, c) => {
2898
- if (l && l.code === "ENOENT" && h === "r+") return h = "w+", import_node_fs6.default.open(s3.file, h, a);
2912
+ let a = "r+", h = (l, c) => {
2913
+ if (l && l.code === "ENOENT" && a === "r+") return a = "w+", import_node_fs6.default.open(s3.file, a, h);
2899
2914
  if (l || !c) return o(l);
2900
2915
  import_node_fs6.default.fstat(c, (d, S) => {
2901
2916
  if (d) return import_node_fs6.default.close(c, () => o(d));
2902
2917
  i(c, S.size, (T, N) => {
2903
2918
  if (T) return o(T);
2904
2919
  let E = new tt(s3.file, { fd: c, start: N });
2905
- e.pipe(E), E.on("error", o), E.on("close", n), po(e, t);
2920
+ e.pipe(E), E.on("error", o), E.on("close", n), So(e, t);
2906
2921
  });
2907
2922
  });
2908
2923
  };
2909
- import_node_fs6.default.open(s3.file, h, a);
2924
+ import_node_fs6.default.open(s3.file, a, h);
2910
2925
  });
2911
2926
  };
2912
- var mo = (s3, t) => {
2927
+ var wo = (s3, t) => {
2913
2928
  t.forEach((e) => {
2914
- e.charAt(0) === "@" ? It({ file: import_node_path9.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
2929
+ e.charAt(0) === "@" ? Ft({ file: import_node_path9.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
2915
2930
  }), s3.end();
2916
2931
  };
2917
- var po = async (s3, t) => {
2918
- for (let e = 0; e < t.length; e++) {
2919
- let i = String(t[e]);
2920
- i.charAt(0) === "@" ? await It({ file: import_node_path9.default.resolve(String(s3.cwd), i.slice(1)), noResume: true, onReadEntry: (r) => s3.add(r) }) : s3.add(i);
2921
- }
2932
+ var So = async (s3, t) => {
2933
+ for (let e of t) e.charAt(0) === "@" ? await Ft({ file: import_node_path9.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
2922
2934
  s3.end();
2923
2935
  };
2924
- var vt = K(co, uo, () => {
2936
+ var vt = K(mo, Eo, () => {
2925
2937
  throw new TypeError("file is required");
2926
2938
  }, () => {
2927
2939
  throw new TypeError("file is required");
2928
2940
  }, (s3, t) => {
2929
- if (!ks(s3)) throw new TypeError("file is required");
2941
+ if (!vs(s3)) throw new TypeError("file is required");
2930
2942
  if (s3.gzip || s3.brotli || s3.zstd || s3.file.endsWith(".br") || s3.file.endsWith(".tbr")) throw new TypeError("cannot append to compressed archives");
2931
2943
  if (!t?.length) throw new TypeError("no paths specified to add/replace");
2932
2944
  });
2933
- var Eo = K(vt.syncFile, vt.asyncFile, vt.syncNoFile, vt.asyncNoFile, (s3, t = []) => {
2934
- vt.validate?.(s3, t), wo(s3);
2945
+ var yo = K(vt.syncFile, vt.asyncFile, vt.syncNoFile, vt.asyncNoFile, (s3, t = []) => {
2946
+ vt.validate?.(s3, t), Ro(s3);
2935
2947
  });
2936
- var wo = (s3) => {
2948
+ var Ro = (s3) => {
2937
2949
  let t = s3.filter;
2938
2950
  s3.mtimeCache || (s3.mtimeCache = /* @__PURE__ */ new Map()), s3.filter = t ? (e, i) => t(e, i) && !((s3.mtimeCache?.get(e) ?? i.mtime ?? 0) > (i.mtime ?? 0)) : (e, i) => !((s3.mtimeCache?.get(e) ?? i.mtime ?? 0) > (i.mtime ?? 0));
2939
2951
  };
@@ -3347,7 +3359,7 @@ var downloadTarball = async (url, filePath) => {
3347
3359
  await import_promises2.default.writeFile(filePath, buffer);
3348
3360
  };
3349
3361
  var extractRuntimeTarballToStage = async (tarballPath, stageDir) => {
3350
- await lo({
3362
+ await uo({
3351
3363
  cwd: stageDir,
3352
3364
  file: tarballPath,
3353
3365
  strip: 1