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