@storm-software/git-tools 2.113.14 → 2.113.17

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.
Files changed (66) hide show
  1. package/README.md +2 -1
  2. package/bin/{chunk-TOALWLBQ.js → chunk-54Q5U5WW.js} +2 -8
  3. package/bin/chunk-AMSZ7DVW.js +17 -0
  4. package/bin/chunk-CIJVSMK2.cjs +23 -0
  5. package/bin/chunk-DDGJVTT5.cjs +1622 -0
  6. package/bin/chunk-NRQQ6RND.js +1581 -0
  7. package/bin/{chunk-TDO6B2H4.js → chunk-SWXHQXUT.cjs} +3 -8
  8. package/bin/git.cjs +3013 -81697
  9. package/bin/git.js +2825 -91795
  10. package/bin/post-checkout.cjs +16 -36
  11. package/bin/post-checkout.js +3 -25
  12. package/bin/post-commit.cjs +16 -36
  13. package/bin/post-commit.js +3 -25
  14. package/bin/post-merge.cjs +16 -36
  15. package/bin/post-merge.js +3 -25
  16. package/bin/pre-commit.cjs +13 -32
  17. package/bin/pre-commit.js +2 -23
  18. package/bin/pre-install.cjs +12 -29
  19. package/bin/pre-install.js +2 -21
  20. package/bin/pre-push.cjs +33 -50
  21. package/bin/pre-push.js +6 -30
  22. package/bin/prepare.cjs +10 -27
  23. package/bin/prepare.js +2 -21
  24. package/bin/version-warning.cjs +8 -23
  25. package/bin/version-warning.js +2 -19
  26. package/package.json +7 -10
  27. package/bin/chunk-2EJN2ZIP.cjs +0 -3631
  28. package/bin/chunk-2FWQQ2X4.js +0 -35624
  29. package/bin/chunk-335YPSVH.cjs +0 -111
  30. package/bin/chunk-5OLGPOTK.js +0 -1003
  31. package/bin/chunk-5QFXXGFE.js +0 -7427
  32. package/bin/chunk-D2AN4H4B.js +0 -111
  33. package/bin/chunk-DTYNP6HG.js +0 -3634
  34. package/bin/chunk-FMYKTN2Z.cjs +0 -7427
  35. package/bin/chunk-GSZ2Y7H4.cjs +0 -1003
  36. package/bin/chunk-GWDOCACN.cjs +0 -27
  37. package/bin/chunk-H4MEIOPL.cjs +0 -476
  38. package/bin/chunk-HTVOKCRJ.cjs +0 -25
  39. package/bin/chunk-IG6EXAQU.cjs +0 -59
  40. package/bin/chunk-JHBHEVIE.js +0 -55
  41. package/bin/chunk-MXO7CLUN.cjs +0 -739
  42. package/bin/chunk-OKG5KNKQ.js +0 -419
  43. package/bin/chunk-QWTKUQL3.js +0 -739
  44. package/bin/chunk-R7ZVOQ5D.js +0 -476
  45. package/bin/chunk-TVPM4C6Y.cjs +0 -419
  46. package/bin/chunk-UQFYXF6V.cjs +0 -74
  47. package/bin/chunk-VU7MBHMN.js +0 -74
  48. package/bin/chunk-WOADGD4X.cjs +0 -35563
  49. package/bin/dist-GTHSKIW6.cjs +0 -16571
  50. package/bin/dist-JFDTSOSQ.js +0 -33
  51. package/bin/dist-JIPEOSES.js +0 -16736
  52. package/bin/dist-S2SQNR26.cjs +0 -33
  53. package/bin/esm-MJTK2O7U.js +0 -1708
  54. package/bin/esm-NOFJXYSW.cjs +0 -1708
  55. package/bin/json5-PMDKQHWU.js +0 -10
  56. package/bin/json5-XWK64HEF.cjs +0 -10
  57. package/bin/jsonc-GWY6R4PV.js +0 -15
  58. package/bin/jsonc-SBYIKOG2.cjs +0 -15
  59. package/bin/multipart-parser-HT3QRMAQ.cjs +0 -181
  60. package/bin/multipart-parser-LDIDKHXR.js +0 -185
  61. package/bin/toml-CWI7LORJ.cjs +0 -10
  62. package/bin/toml-KVVESQIU.js +0 -10
  63. package/bin/utils-EKXINDVD.js +0 -101
  64. package/bin/utils-P2DNOMLG.cjs +0 -101
  65. package/bin/yaml-WPTJ2ZU5.cjs +0 -10
  66. package/bin/yaml-XEVR3LQS.js +0 -10
@@ -1,3631 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
-
4
-
5
- var _chunkIG6EXAQUcjs = require('./chunk-IG6EXAQU.cjs');
6
-
7
- // ../../node_modules/.pnpm/node-fetch-native@1.6.6/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs
8
- var require_node_fetch_native_DhEqb06g = _chunkIG6EXAQUcjs.__commonJS.call(void 0, {
9
- "../../node_modules/.pnpm/node-fetch-native@1.6.6/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs"(exports) {
10
- "use strict";
11
- _chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
12
- var l = Object.defineProperty;
13
- var o = (e, t) => l(e, "name", { value: t, configurable: true });
14
- var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
15
- function getDefaultExportFromCjs(e) {
16
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
17
- }
18
- o(getDefaultExportFromCjs, "getDefaultExportFromCjs"), exports.commonjsGlobal = commonjsGlobal, exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
19
- }
20
- });
21
-
22
- // ../../node_modules/.pnpm/node-fetch-native@1.6.6/node_modules/node-fetch-native/dist/node.cjs
23
- var require_node = _chunkIG6EXAQUcjs.__commonJS.call(void 0, {
24
- "../../node_modules/.pnpm/node-fetch-native@1.6.6/node_modules/node-fetch-native/dist/node.cjs"(exports) {
25
- "use strict";
26
- _chunkIG6EXAQUcjs.init_cjs_shims.call(void 0, );
27
- var qi = Object.defineProperty;
28
- var u = (c, l) => qi(c, "name", { value: l, configurable: true });
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- var http = _chunkIG6EXAQUcjs.__require.call(void 0, "http");
31
- var https = _chunkIG6EXAQUcjs.__require.call(void 0, "https");
32
- var zlib = _chunkIG6EXAQUcjs.__require.call(void 0, "zlib");
33
- var Stream = _chunkIG6EXAQUcjs.__require.call(void 0, "stream");
34
- var require$$0 = _chunkIG6EXAQUcjs.__require.call(void 0, "buffer");
35
- var require$$0$1 = _chunkIG6EXAQUcjs.__require.call(void 0, "util");
36
- var _commonjsHelpers = require_node_fetch_native_DhEqb06g();
37
- var require$$1 = _chunkIG6EXAQUcjs.__require.call(void 0, "url");
38
- var require$$0$2 = _chunkIG6EXAQUcjs.__require.call(void 0, "net");
39
- var node_fs = _chunkIG6EXAQUcjs.__require.call(void 0, "fs");
40
- var node_path = _chunkIG6EXAQUcjs.__require.call(void 0, "path");
41
- function _interopDefaultCompat(c) {
42
- return c && typeof c == "object" && "default" in c ? c.default : c;
43
- }
44
- u(_interopDefaultCompat, "_interopDefaultCompat");
45
- var http__default = _interopDefaultCompat(http);
46
- var https__default = _interopDefaultCompat(https);
47
- var zlib__default = _interopDefaultCompat(zlib);
48
- var Stream__default = _interopDefaultCompat(Stream);
49
- function dataUriToBuffer(c) {
50
- if (!/^data:/i.test(c)) throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');
51
- c = c.replace(/\r?\n/g, "");
52
- const l = c.indexOf(",");
53
- if (l === -1 || l <= 4) throw new TypeError("malformed data: URI");
54
- const d = c.substring(5, l).split(";");
55
- let y = "", b = false;
56
- const R = d[0] || "text/plain";
57
- let w = R;
58
- for (let z = 1; z < d.length; z++) d[z] === "base64" ? b = true : d[z] && (w += `;${d[z]}`, d[z].indexOf("charset=") === 0 && (y = d[z].substring(8)));
59
- !d[0] && !y.length && (w += ";charset=US-ASCII", y = "US-ASCII");
60
- const A = b ? "base64" : "ascii", F = unescape(c.substring(l + 1)), B = Buffer.from(F, A);
61
- return B.type = R, B.typeFull = w, B.charset = y, B;
62
- }
63
- u(dataUriToBuffer, "dataUriToBuffer");
64
- var streams = {};
65
- var ponyfill_es2018$1 = { exports: {} };
66
- var ponyfill_es2018 = ponyfill_es2018$1.exports;
67
- var hasRequiredPonyfill_es2018;
68
- function requirePonyfill_es2018() {
69
- return hasRequiredPonyfill_es2018 || (hasRequiredPonyfill_es2018 = 1, function(c, l) {
70
- (function(d, y) {
71
- y(l);
72
- })(ponyfill_es2018, function(d) {
73
- function y() {
74
- }
75
- u(y, "noop");
76
- function b(n) {
77
- return typeof n == "object" && n !== null || typeof n == "function";
78
- }
79
- u(b, "typeIsObject");
80
- const R = y;
81
- function w(n, o) {
82
- try {
83
- Object.defineProperty(n, "name", { value: o, configurable: true });
84
- } catch (e2) {
85
- }
86
- }
87
- u(w, "setFunctionName");
88
- const A = Promise, F = Promise.prototype.then, B = Promise.reject.bind(A);
89
- function z(n) {
90
- return new A(n);
91
- }
92
- u(z, "newPromise");
93
- function W(n) {
94
- return z((o) => o(n));
95
- }
96
- u(W, "promiseResolvedWith");
97
- function T(n) {
98
- return B(n);
99
- }
100
- u(T, "promiseRejectedWith");
101
- function D(n, o, a) {
102
- return F.call(n, o, a);
103
- }
104
- u(D, "PerformPromiseThen");
105
- function E(n, o, a) {
106
- D(D(n, o, a), void 0, R);
107
- }
108
- u(E, "uponPromise");
109
- function Z(n, o) {
110
- E(n, o);
111
- }
112
- u(Z, "uponFulfillment");
113
- function M(n, o) {
114
- E(n, void 0, o);
115
- }
116
- u(M, "uponRejection");
117
- function U(n, o, a) {
118
- return D(n, o, a);
119
- }
120
- u(U, "transformPromiseWith");
121
- function K(n) {
122
- D(n, void 0, R);
123
- }
124
- u(K, "setPromiseIsHandledToTrue");
125
- let se = u((n) => {
126
- if (typeof queueMicrotask == "function") se = queueMicrotask;
127
- else {
128
- const o = W(void 0);
129
- se = u((a) => D(o, a), "_queueMicrotask");
130
- }
131
- return se(n);
132
- }, "_queueMicrotask");
133
- function $(n, o, a) {
134
- if (typeof n != "function") throw new TypeError("Argument is not a function");
135
- return Function.prototype.apply.call(n, o, a);
136
- }
137
- u($, "reflectCall");
138
- function N(n, o, a) {
139
- try {
140
- return W($(n, o, a));
141
- } catch (p) {
142
- return T(p);
143
- }
144
- }
145
- u(N, "promiseCall");
146
- const V = 16384;
147
- class Q {
148
- static {
149
- u(this, "SimpleQueue");
150
- }
151
- constructor() {
152
- this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;
153
- }
154
- get length() {
155
- return this._size;
156
- }
157
- push(o) {
158
- const a = this._back;
159
- let p = a;
160
- a._elements.length === V - 1 && (p = { _elements: [], _next: void 0 }), a._elements.push(o), p !== a && (this._back = p, a._next = p), ++this._size;
161
- }
162
- shift() {
163
- const o = this._front;
164
- let a = o;
165
- const p = this._cursor;
166
- let g = p + 1;
167
- const _ = o._elements, S = _[p];
168
- return g === V && (a = o._next, g = 0), --this._size, this._cursor = g, o !== a && (this._front = a), _[p] = void 0, S;
169
- }
170
- forEach(o) {
171
- let a = this._cursor, p = this._front, g = p._elements;
172
- for (; (a !== g.length || p._next !== void 0) && !(a === g.length && (p = p._next, g = p._elements, a = 0, g.length === 0)); ) o(g[a]), ++a;
173
- }
174
- peek() {
175
- const o = this._front, a = this._cursor;
176
- return o._elements[a];
177
- }
178
- }
179
- const rt = Symbol("[[AbortSteps]]"), wr = Symbol("[[ErrorSteps]]"), Ot = Symbol("[[CancelSteps]]"), Ft = Symbol("[[PullSteps]]"), It = Symbol("[[ReleaseSteps]]");
180
- function Rr(n, o) {
181
- n._ownerReadableStream = o, o._reader = n, o._state === "readable" ? jt(n) : o._state === "closed" ? Dn(n) : Tr(n, o._storedError);
182
- }
183
- u(Rr, "ReadableStreamReaderGenericInitialize");
184
- function zt(n, o) {
185
- const a = n._ownerReadableStream;
186
- return ne(a, o);
187
- }
188
- u(zt, "ReadableStreamReaderGenericCancel");
189
- function ue(n) {
190
- const o = n._ownerReadableStream;
191
- o._state === "readable" ? Lt(n, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : $n(n, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), o._readableStreamController[It](), o._reader = void 0, n._ownerReadableStream = void 0;
192
- }
193
- u(ue, "ReadableStreamReaderGenericRelease");
194
- function nt(n) {
195
- return new TypeError("Cannot " + n + " a stream using a released reader");
196
- }
197
- u(nt, "readerLockException");
198
- function jt(n) {
199
- n._closedPromise = z((o, a) => {
200
- n._closedPromise_resolve = o, n._closedPromise_reject = a;
201
- });
202
- }
203
- u(jt, "defaultReaderClosedPromiseInitialize");
204
- function Tr(n, o) {
205
- jt(n), Lt(n, o);
206
- }
207
- u(Tr, "defaultReaderClosedPromiseInitializeAsRejected");
208
- function Dn(n) {
209
- jt(n), Cr(n);
210
- }
211
- u(Dn, "defaultReaderClosedPromiseInitializeAsResolved");
212
- function Lt(n, o) {
213
- n._closedPromise_reject !== void 0 && (K(n._closedPromise), n._closedPromise_reject(o), n._closedPromise_resolve = void 0, n._closedPromise_reject = void 0);
214
- }
215
- u(Lt, "defaultReaderClosedPromiseReject");
216
- function $n(n, o) {
217
- Tr(n, o);
218
- }
219
- u($n, "defaultReaderClosedPromiseResetToRejected");
220
- function Cr(n) {
221
- n._closedPromise_resolve !== void 0 && (n._closedPromise_resolve(void 0), n._closedPromise_resolve = void 0, n._closedPromise_reject = void 0);
222
- }
223
- u(Cr, "defaultReaderClosedPromiseResolve");
224
- const Pr = Number.isFinite || function(n) {
225
- return typeof n == "number" && isFinite(n);
226
- }, Mn = Math.trunc || function(n) {
227
- return n < 0 ? Math.ceil(n) : Math.floor(n);
228
- };
229
- function xn(n) {
230
- return typeof n == "object" || typeof n == "function";
231
- }
232
- u(xn, "isDictionary");
233
- function ie(n, o) {
234
- if (n !== void 0 && !xn(n)) throw new TypeError(`${o} is not an object.`);
235
- }
236
- u(ie, "assertDictionary");
237
- function X(n, o) {
238
- if (typeof n != "function") throw new TypeError(`${o} is not a function.`);
239
- }
240
- u(X, "assertFunction");
241
- function Un(n) {
242
- return typeof n == "object" && n !== null || typeof n == "function";
243
- }
244
- u(Un, "isObject");
245
- function Er(n, o) {
246
- if (!Un(n)) throw new TypeError(`${o} is not an object.`);
247
- }
248
- u(Er, "assertObject");
249
- function le(n, o, a) {
250
- if (n === void 0) throw new TypeError(`Parameter ${o} is required in '${a}'.`);
251
- }
252
- u(le, "assertRequiredArgument");
253
- function Dt(n, o, a) {
254
- if (n === void 0) throw new TypeError(`${o} is required in '${a}'.`);
255
- }
256
- u(Dt, "assertRequiredField");
257
- function $t(n) {
258
- return Number(n);
259
- }
260
- u($t, "convertUnrestrictedDouble");
261
- function vr(n) {
262
- return n === 0 ? 0 : n;
263
- }
264
- u(vr, "censorNegativeZero");
265
- function Nn(n) {
266
- return vr(Mn(n));
267
- }
268
- u(Nn, "integerPart");
269
- function Mt(n, o) {
270
- const p = Number.MAX_SAFE_INTEGER;
271
- let g = Number(n);
272
- if (g = vr(g), !Pr(g)) throw new TypeError(`${o} is not a finite number`);
273
- if (g = Nn(g), g < 0 || g > p) throw new TypeError(`${o} is outside the accepted range of 0 to ${p}, inclusive`);
274
- return !Pr(g) || g === 0 ? 0 : g;
275
- }
276
- u(Mt, "convertUnsignedLongLongWithEnforceRange");
277
- function xt(n, o) {
278
- if (!Re(n)) throw new TypeError(`${o} is not a ReadableStream.`);
279
- }
280
- u(xt, "assertReadableStream");
281
- function Fe(n) {
282
- return new me(n);
283
- }
284
- u(Fe, "AcquireReadableStreamDefaultReader");
285
- function Ar(n, o) {
286
- n._reader._readRequests.push(o);
287
- }
288
- u(Ar, "ReadableStreamAddReadRequest");
289
- function Ut(n, o, a) {
290
- const g = n._reader._readRequests.shift();
291
- a ? g._closeSteps() : g._chunkSteps(o);
292
- }
293
- u(Ut, "ReadableStreamFulfillReadRequest");
294
- function ot(n) {
295
- return n._reader._readRequests.length;
296
- }
297
- u(ot, "ReadableStreamGetNumReadRequests");
298
- function Br(n) {
299
- const o = n._reader;
300
- return !(o === void 0 || !ye(o));
301
- }
302
- u(Br, "ReadableStreamHasDefaultReader");
303
- class me {
304
- static {
305
- u(this, "ReadableStreamDefaultReader");
306
- }
307
- constructor(o) {
308
- if (le(o, 1, "ReadableStreamDefaultReader"), xt(o, "First parameter"), Te(o)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
309
- Rr(this, o), this._readRequests = new Q();
310
- }
311
- get closed() {
312
- return ye(this) ? this._closedPromise : T(it("closed"));
313
- }
314
- cancel(o = void 0) {
315
- return ye(this) ? this._ownerReadableStream === void 0 ? T(nt("cancel")) : zt(this, o) : T(it("cancel"));
316
- }
317
- read() {
318
- if (!ye(this)) return T(it("read"));
319
- if (this._ownerReadableStream === void 0) return T(nt("read from"));
320
- let o, a;
321
- const p = z((_, S) => {
322
- o = _, a = S;
323
- });
324
- return Ve(this, { _chunkSteps: u((_) => o({ value: _, done: false }), "_chunkSteps"), _closeSteps: u(() => o({ value: void 0, done: true }), "_closeSteps"), _errorSteps: u((_) => a(_), "_errorSteps") }), p;
325
- }
326
- releaseLock() {
327
- if (!ye(this)) throw it("releaseLock");
328
- this._ownerReadableStream !== void 0 && Hn(this);
329
- }
330
- }
331
- Object.defineProperties(me.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), w(me.prototype.cancel, "cancel"), w(me.prototype.read, "read"), w(me.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(me.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });
332
- function ye(n) {
333
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_readRequests") ? false : n instanceof me;
334
- }
335
- u(ye, "IsReadableStreamDefaultReader");
336
- function Ve(n, o) {
337
- const a = n._ownerReadableStream;
338
- a._disturbed = true, a._state === "closed" ? o._closeSteps() : a._state === "errored" ? o._errorSteps(a._storedError) : a._readableStreamController[Ft](o);
339
- }
340
- u(Ve, "ReadableStreamDefaultReaderRead");
341
- function Hn(n) {
342
- ue(n);
343
- const o = new TypeError("Reader was released");
344
- qr(n, o);
345
- }
346
- u(Hn, "ReadableStreamDefaultReaderRelease");
347
- function qr(n, o) {
348
- const a = n._readRequests;
349
- n._readRequests = new Q(), a.forEach((p) => {
350
- p._errorSteps(o);
351
- });
352
- }
353
- u(qr, "ReadableStreamDefaultReaderErrorReadRequests");
354
- function it(n) {
355
- return new TypeError(`ReadableStreamDefaultReader.prototype.${n} can only be used on a ReadableStreamDefaultReader`);
356
- }
357
- u(it, "defaultReaderBrandCheckException");
358
- const Vn = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {
359
- }).prototype);
360
- class Wr {
361
- static {
362
- u(this, "ReadableStreamAsyncIteratorImpl");
363
- }
364
- constructor(o, a) {
365
- this._ongoingPromise = void 0, this._isFinished = false, this._reader = o, this._preventCancel = a;
366
- }
367
- next() {
368
- const o = u(() => this._nextSteps(), "nextSteps");
369
- return this._ongoingPromise = this._ongoingPromise ? U(this._ongoingPromise, o, o) : o(), this._ongoingPromise;
370
- }
371
- return(o) {
372
- const a = u(() => this._returnSteps(o), "returnSteps");
373
- return this._ongoingPromise ? U(this._ongoingPromise, a, a) : a();
374
- }
375
- _nextSteps() {
376
- if (this._isFinished) return Promise.resolve({ value: void 0, done: true });
377
- const o = this._reader;
378
- let a, p;
379
- const g = z((S, C) => {
380
- a = S, p = C;
381
- });
382
- return Ve(o, { _chunkSteps: u((S) => {
383
- this._ongoingPromise = void 0, se(() => a({ value: S, done: false }));
384
- }, "_chunkSteps"), _closeSteps: u(() => {
385
- this._ongoingPromise = void 0, this._isFinished = true, ue(o), a({ value: void 0, done: true });
386
- }, "_closeSteps"), _errorSteps: u((S) => {
387
- this._ongoingPromise = void 0, this._isFinished = true, ue(o), p(S);
388
- }, "_errorSteps") }), g;
389
- }
390
- _returnSteps(o) {
391
- if (this._isFinished) return Promise.resolve({ value: o, done: true });
392
- this._isFinished = true;
393
- const a = this._reader;
394
- if (!this._preventCancel) {
395
- const p = zt(a, o);
396
- return ue(a), U(p, () => ({ value: o, done: true }));
397
- }
398
- return ue(a), W({ value: o, done: true });
399
- }
400
- }
401
- const kr = { next() {
402
- return Or(this) ? this._asyncIteratorImpl.next() : T(Fr("next"));
403
- }, return(n) {
404
- return Or(this) ? this._asyncIteratorImpl.return(n) : T(Fr("return"));
405
- } };
406
- Object.setPrototypeOf(kr, Vn);
407
- function Qn(n, o) {
408
- const a = Fe(n), p = new Wr(a, o), g = Object.create(kr);
409
- return g._asyncIteratorImpl = p, g;
410
- }
411
- u(Qn, "AcquireReadableStreamAsyncIterator");
412
- function Or(n) {
413
- if (!b(n) || !Object.prototype.hasOwnProperty.call(n, "_asyncIteratorImpl")) return false;
414
- try {
415
- return n._asyncIteratorImpl instanceof Wr;
416
- } catch (e3) {
417
- return false;
418
- }
419
- }
420
- u(Or, "IsReadableStreamAsyncIterator");
421
- function Fr(n) {
422
- return new TypeError(`ReadableStreamAsyncIterator.${n} can only be used on a ReadableSteamAsyncIterator`);
423
- }
424
- u(Fr, "streamAsyncIteratorBrandCheckException");
425
- const Ir = Number.isNaN || function(n) {
426
- return n !== n;
427
- };
428
- var Nt, Ht, Vt;
429
- function Qe(n) {
430
- return n.slice();
431
- }
432
- u(Qe, "CreateArrayFromList");
433
- function zr(n, o, a, p, g) {
434
- new Uint8Array(n).set(new Uint8Array(a, p, g), o);
435
- }
436
- u(zr, "CopyDataBlockBytes");
437
- let fe = u((n) => (typeof n.transfer == "function" ? fe = u((o) => o.transfer(), "TransferArrayBuffer") : typeof structuredClone == "function" ? fe = u((o) => structuredClone(o, { transfer: [o] }), "TransferArrayBuffer") : fe = u((o) => o, "TransferArrayBuffer"), fe(n)), "TransferArrayBuffer"), ge = u((n) => (typeof n.detached == "boolean" ? ge = u((o) => o.detached, "IsDetachedBuffer") : ge = u((o) => o.byteLength === 0, "IsDetachedBuffer"), ge(n)), "IsDetachedBuffer");
438
- function jr(n, o, a) {
439
- if (n.slice) return n.slice(o, a);
440
- const p = a - o, g = new ArrayBuffer(p);
441
- return zr(g, 0, n, o, p), g;
442
- }
443
- u(jr, "ArrayBufferSlice");
444
- function at(n, o) {
445
- const a = n[o];
446
- if (a != null) {
447
- if (typeof a != "function") throw new TypeError(`${String(o)} is not a function`);
448
- return a;
449
- }
450
- }
451
- u(at, "GetMethod");
452
- function Yn(n) {
453
- const o = { [Symbol.iterator]: () => n.iterator }, a = async function* () {
454
- return yield* o;
455
- }(), p = a.next;
456
- return { iterator: a, nextMethod: p, done: false };
457
- }
458
- u(Yn, "CreateAsyncFromSyncIterator");
459
- const Qt = (Vt = (Nt = Symbol.asyncIterator) !== null && Nt !== void 0 ? Nt : (Ht = Symbol.for) === null || Ht === void 0 ? void 0 : Ht.call(Symbol, "Symbol.asyncIterator")) !== null && Vt !== void 0 ? Vt : "@@asyncIterator";
460
- function Lr(n, o = "sync", a) {
461
- if (a === void 0) if (o === "async") {
462
- if (a = at(n, Qt), a === void 0) {
463
- const _ = at(n, Symbol.iterator), S = Lr(n, "sync", _);
464
- return Yn(S);
465
- }
466
- } else a = at(n, Symbol.iterator);
467
- if (a === void 0) throw new TypeError("The object is not iterable");
468
- const p = $(a, n, []);
469
- if (!b(p)) throw new TypeError("The iterator method must return an object");
470
- const g = p.next;
471
- return { iterator: p, nextMethod: g, done: false };
472
- }
473
- u(Lr, "GetIterator");
474
- function Gn(n) {
475
- const o = $(n.nextMethod, n.iterator, []);
476
- if (!b(o)) throw new TypeError("The iterator.next() method must return an object");
477
- return o;
478
- }
479
- u(Gn, "IteratorNext");
480
- function Zn(n) {
481
- return !!n.done;
482
- }
483
- u(Zn, "IteratorComplete");
484
- function Kn(n) {
485
- return n.value;
486
- }
487
- u(Kn, "IteratorValue");
488
- function Jn(n) {
489
- return !(typeof n != "number" || Ir(n) || n < 0);
490
- }
491
- u(Jn, "IsNonNegativeNumber");
492
- function Dr(n) {
493
- const o = jr(n.buffer, n.byteOffset, n.byteOffset + n.byteLength);
494
- return new Uint8Array(o);
495
- }
496
- u(Dr, "CloneAsUint8Array");
497
- function Yt(n) {
498
- const o = n._queue.shift();
499
- return n._queueTotalSize -= o.size, n._queueTotalSize < 0 && (n._queueTotalSize = 0), o.value;
500
- }
501
- u(Yt, "DequeueValue");
502
- function Gt(n, o, a) {
503
- if (!Jn(a) || a === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
504
- n._queue.push({ value: o, size: a }), n._queueTotalSize += a;
505
- }
506
- u(Gt, "EnqueueValueWithSize");
507
- function Xn(n) {
508
- return n._queue.peek().value;
509
- }
510
- u(Xn, "PeekQueueValue");
511
- function _e(n) {
512
- n._queue = new Q(), n._queueTotalSize = 0;
513
- }
514
- u(_e, "ResetQueue");
515
- function $r(n) {
516
- return n === DataView;
517
- }
518
- u($r, "isDataViewConstructor");
519
- function eo(n) {
520
- return $r(n.constructor);
521
- }
522
- u(eo, "isDataView");
523
- function to(n) {
524
- return $r(n) ? 1 : n.BYTES_PER_ELEMENT;
525
- }
526
- u(to, "arrayBufferViewElementSize");
527
- class Ee {
528
- static {
529
- u(this, "ReadableStreamBYOBRequest");
530
- }
531
- constructor() {
532
- throw new TypeError("Illegal constructor");
533
- }
534
- get view() {
535
- if (!Zt(this)) throw tr("view");
536
- return this._view;
537
- }
538
- respond(o) {
539
- if (!Zt(this)) throw tr("respond");
540
- if (le(o, 1, "respond"), o = Mt(o, "First parameter"), this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
541
- if (ge(this._view.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");
542
- ft(this._associatedReadableByteStreamController, o);
543
- }
544
- respondWithNewView(o) {
545
- if (!Zt(this)) throw tr("respondWithNewView");
546
- if (le(o, 1, "respondWithNewView"), !ArrayBuffer.isView(o)) throw new TypeError("You can only respond with array buffer views");
547
- if (this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
548
- if (ge(o.buffer)) throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");
549
- ct(this._associatedReadableByteStreamController, o);
550
- }
551
- }
552
- Object.defineProperties(Ee.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), w(Ee.prototype.respond, "respond"), w(Ee.prototype.respondWithNewView, "respondWithNewView"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Ee.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true });
553
- class ce {
554
- static {
555
- u(this, "ReadableByteStreamController");
556
- }
557
- constructor() {
558
- throw new TypeError("Illegal constructor");
559
- }
560
- get byobRequest() {
561
- if (!ve(this)) throw Ge("byobRequest");
562
- return er(this);
563
- }
564
- get desiredSize() {
565
- if (!ve(this)) throw Ge("desiredSize");
566
- return Zr(this);
567
- }
568
- close() {
569
- if (!ve(this)) throw Ge("close");
570
- if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
571
- const o = this._controlledReadableByteStream._state;
572
- if (o !== "readable") throw new TypeError(`The stream (in ${o} state) is not in the readable state and cannot be closed`);
573
- Ye(this);
574
- }
575
- enqueue(o) {
576
- if (!ve(this)) throw Ge("enqueue");
577
- if (le(o, 1, "enqueue"), !ArrayBuffer.isView(o)) throw new TypeError("chunk must be an array buffer view");
578
- if (o.byteLength === 0) throw new TypeError("chunk must have non-zero byteLength");
579
- if (o.buffer.byteLength === 0) throw new TypeError("chunk's buffer must have non-zero byteLength");
580
- if (this._closeRequested) throw new TypeError("stream is closed or draining");
581
- const a = this._controlledReadableByteStream._state;
582
- if (a !== "readable") throw new TypeError(`The stream (in ${a} state) is not in the readable state and cannot be enqueued to`);
583
- lt(this, o);
584
- }
585
- error(o = void 0) {
586
- if (!ve(this)) throw Ge("error");
587
- ee(this, o);
588
- }
589
- [Ot](o) {
590
- Mr(this), _e(this);
591
- const a = this._cancelAlgorithm(o);
592
- return ut(this), a;
593
- }
594
- [Ft](o) {
595
- const a = this._controlledReadableByteStream;
596
- if (this._queueTotalSize > 0) {
597
- Gr(this, o);
598
- return;
599
- }
600
- const p = this._autoAllocateChunkSize;
601
- if (p !== void 0) {
602
- let g;
603
- try {
604
- g = new ArrayBuffer(p);
605
- } catch (S) {
606
- o._errorSteps(S);
607
- return;
608
- }
609
- const _ = { buffer: g, bufferByteLength: p, byteOffset: 0, byteLength: p, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" };
610
- this._pendingPullIntos.push(_);
611
- }
612
- Ar(a, o), Ae(this);
613
- }
614
- [It]() {
615
- if (this._pendingPullIntos.length > 0) {
616
- const o = this._pendingPullIntos.peek();
617
- o.readerType = "none", this._pendingPullIntos = new Q(), this._pendingPullIntos.push(o);
618
- }
619
- }
620
- }
621
- Object.defineProperties(ce.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), w(ce.prototype.close, "close"), w(ce.prototype.enqueue, "enqueue"), w(ce.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ce.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: true });
622
- function ve(n) {
623
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_controlledReadableByteStream") ? false : n instanceof ce;
624
- }
625
- u(ve, "IsReadableByteStreamController");
626
- function Zt(n) {
627
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_associatedReadableByteStreamController") ? false : n instanceof Ee;
628
- }
629
- u(Zt, "IsReadableStreamBYOBRequest");
630
- function Ae(n) {
631
- if (!ao(n)) return;
632
- if (n._pulling) {
633
- n._pullAgain = true;
634
- return;
635
- }
636
- n._pulling = true;
637
- const a = n._pullAlgorithm();
638
- E(a, () => (n._pulling = false, n._pullAgain && (n._pullAgain = false, Ae(n)), null), (p) => (ee(n, p), null));
639
- }
640
- u(Ae, "ReadableByteStreamControllerCallPullIfNeeded");
641
- function Mr(n) {
642
- Jt(n), n._pendingPullIntos = new Q();
643
- }
644
- u(Mr, "ReadableByteStreamControllerClearPendingPullIntos");
645
- function Kt(n, o) {
646
- let a = false;
647
- n._state === "closed" && (a = true);
648
- const p = xr(o);
649
- o.readerType === "default" ? Ut(n, p, a) : ho(n, p, a);
650
- }
651
- u(Kt, "ReadableByteStreamControllerCommitPullIntoDescriptor");
652
- function xr(n) {
653
- const o = n.bytesFilled, a = n.elementSize;
654
- return new n.viewConstructor(n.buffer, n.byteOffset, o / a);
655
- }
656
- u(xr, "ReadableByteStreamControllerConvertPullIntoDescriptor");
657
- function st(n, o, a, p) {
658
- n._queue.push({ buffer: o, byteOffset: a, byteLength: p }), n._queueTotalSize += p;
659
- }
660
- u(st, "ReadableByteStreamControllerEnqueueChunkToQueue");
661
- function Ur(n, o, a, p) {
662
- let g;
663
- try {
664
- g = jr(o, a, a + p);
665
- } catch (_) {
666
- throw ee(n, _), _;
667
- }
668
- st(n, g, 0, p);
669
- }
670
- u(Ur, "ReadableByteStreamControllerEnqueueClonedChunkToQueue");
671
- function Nr(n, o) {
672
- o.bytesFilled > 0 && Ur(n, o.buffer, o.byteOffset, o.bytesFilled), Ie(n);
673
- }
674
- u(Nr, "ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");
675
- function Hr(n, o) {
676
- const a = Math.min(n._queueTotalSize, o.byteLength - o.bytesFilled), p = o.bytesFilled + a;
677
- let g = a, _ = false;
678
- const S = p % o.elementSize, C = p - S;
679
- C >= o.minimumFill && (g = C - o.bytesFilled, _ = true);
680
- const q = n._queue;
681
- for (; g > 0; ) {
682
- const P = q.peek(), k = Math.min(g, P.byteLength), O = o.byteOffset + o.bytesFilled;
683
- zr(o.buffer, O, P.buffer, P.byteOffset, k), P.byteLength === k ? q.shift() : (P.byteOffset += k, P.byteLength -= k), n._queueTotalSize -= k, Vr(n, k, o), g -= k;
684
- }
685
- return _;
686
- }
687
- u(Hr, "ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");
688
- function Vr(n, o, a) {
689
- a.bytesFilled += o;
690
- }
691
- u(Vr, "ReadableByteStreamControllerFillHeadPullIntoDescriptor");
692
- function Qr(n) {
693
- n._queueTotalSize === 0 && n._closeRequested ? (ut(n), tt(n._controlledReadableByteStream)) : Ae(n);
694
- }
695
- u(Qr, "ReadableByteStreamControllerHandleQueueDrain");
696
- function Jt(n) {
697
- n._byobRequest !== null && (n._byobRequest._associatedReadableByteStreamController = void 0, n._byobRequest._view = null, n._byobRequest = null);
698
- }
699
- u(Jt, "ReadableByteStreamControllerInvalidateBYOBRequest");
700
- function Xt(n) {
701
- for (; n._pendingPullIntos.length > 0; ) {
702
- if (n._queueTotalSize === 0) return;
703
- const o = n._pendingPullIntos.peek();
704
- Hr(n, o) && (Ie(n), Kt(n._controlledReadableByteStream, o));
705
- }
706
- }
707
- u(Xt, "ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");
708
- function ro(n) {
709
- const o = n._controlledReadableByteStream._reader;
710
- for (; o._readRequests.length > 0; ) {
711
- if (n._queueTotalSize === 0) return;
712
- const a = o._readRequests.shift();
713
- Gr(n, a);
714
- }
715
- }
716
- u(ro, "ReadableByteStreamControllerProcessReadRequestsUsingQueue");
717
- function no(n, o, a, p) {
718
- const g = n._controlledReadableByteStream, _ = o.constructor, S = to(_), { byteOffset: C, byteLength: q } = o, P = a * S;
719
- let k;
720
- try {
721
- k = fe(o.buffer);
722
- } catch (j) {
723
- p._errorSteps(j);
724
- return;
725
- }
726
- const O = { buffer: k, bufferByteLength: k.byteLength, byteOffset: C, byteLength: q, bytesFilled: 0, minimumFill: P, elementSize: S, viewConstructor: _, readerType: "byob" };
727
- if (n._pendingPullIntos.length > 0) {
728
- n._pendingPullIntos.push(O), Xr(g, p);
729
- return;
730
- }
731
- if (g._state === "closed") {
732
- const j = new _(O.buffer, O.byteOffset, 0);
733
- p._closeSteps(j);
734
- return;
735
- }
736
- if (n._queueTotalSize > 0) {
737
- if (Hr(n, O)) {
738
- const j = xr(O);
739
- Qr(n), p._chunkSteps(j);
740
- return;
741
- }
742
- if (n._closeRequested) {
743
- const j = new TypeError("Insufficient bytes to fill elements in the given buffer");
744
- ee(n, j), p._errorSteps(j);
745
- return;
746
- }
747
- }
748
- n._pendingPullIntos.push(O), Xr(g, p), Ae(n);
749
- }
750
- u(no, "ReadableByteStreamControllerPullInto");
751
- function oo(n, o) {
752
- o.readerType === "none" && Ie(n);
753
- const a = n._controlledReadableByteStream;
754
- if (rr(a)) for (; en(a) > 0; ) {
755
- const p = Ie(n);
756
- Kt(a, p);
757
- }
758
- }
759
- u(oo, "ReadableByteStreamControllerRespondInClosedState");
760
- function io(n, o, a) {
761
- if (Vr(n, o, a), a.readerType === "none") {
762
- Nr(n, a), Xt(n);
763
- return;
764
- }
765
- if (a.bytesFilled < a.minimumFill) return;
766
- Ie(n);
767
- const p = a.bytesFilled % a.elementSize;
768
- if (p > 0) {
769
- const g = a.byteOffset + a.bytesFilled;
770
- Ur(n, a.buffer, g - p, p);
771
- }
772
- a.bytesFilled -= p, Kt(n._controlledReadableByteStream, a), Xt(n);
773
- }
774
- u(io, "ReadableByteStreamControllerRespondInReadableState");
775
- function Yr(n, o) {
776
- const a = n._pendingPullIntos.peek();
777
- Jt(n), n._controlledReadableByteStream._state === "closed" ? oo(n, a) : io(n, o, a), Ae(n);
778
- }
779
- u(Yr, "ReadableByteStreamControllerRespondInternal");
780
- function Ie(n) {
781
- return n._pendingPullIntos.shift();
782
- }
783
- u(Ie, "ReadableByteStreamControllerShiftPendingPullInto");
784
- function ao(n) {
785
- const o = n._controlledReadableByteStream;
786
- return o._state !== "readable" || n._closeRequested || !n._started ? false : !!(Br(o) && ot(o) > 0 || rr(o) && en(o) > 0 || Zr(n) > 0);
787
- }
788
- u(ao, "ReadableByteStreamControllerShouldCallPull");
789
- function ut(n) {
790
- n._pullAlgorithm = void 0, n._cancelAlgorithm = void 0;
791
- }
792
- u(ut, "ReadableByteStreamControllerClearAlgorithms");
793
- function Ye(n) {
794
- const o = n._controlledReadableByteStream;
795
- if (!(n._closeRequested || o._state !== "readable")) {
796
- if (n._queueTotalSize > 0) {
797
- n._closeRequested = true;
798
- return;
799
- }
800
- if (n._pendingPullIntos.length > 0) {
801
- const a = n._pendingPullIntos.peek();
802
- if (a.bytesFilled % a.elementSize !== 0) {
803
- const p = new TypeError("Insufficient bytes to fill elements in the given buffer");
804
- throw ee(n, p), p;
805
- }
806
- }
807
- ut(n), tt(o);
808
- }
809
- }
810
- u(Ye, "ReadableByteStreamControllerClose");
811
- function lt(n, o) {
812
- const a = n._controlledReadableByteStream;
813
- if (n._closeRequested || a._state !== "readable") return;
814
- const { buffer: p, byteOffset: g, byteLength: _ } = o;
815
- if (ge(p)) throw new TypeError("chunk's buffer is detached and so cannot be enqueued");
816
- const S = fe(p);
817
- if (n._pendingPullIntos.length > 0) {
818
- const C = n._pendingPullIntos.peek();
819
- if (ge(C.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");
820
- Jt(n), C.buffer = fe(C.buffer), C.readerType === "none" && Nr(n, C);
821
- }
822
- if (Br(a)) if (ro(n), ot(a) === 0) st(n, S, g, _);
823
- else {
824
- n._pendingPullIntos.length > 0 && Ie(n);
825
- const C = new Uint8Array(S, g, _);
826
- Ut(a, C, false);
827
- }
828
- else rr(a) ? (st(n, S, g, _), Xt(n)) : st(n, S, g, _);
829
- Ae(n);
830
- }
831
- u(lt, "ReadableByteStreamControllerEnqueue");
832
- function ee(n, o) {
833
- const a = n._controlledReadableByteStream;
834
- a._state === "readable" && (Mr(n), _e(n), ut(n), Pn(a, o));
835
- }
836
- u(ee, "ReadableByteStreamControllerError");
837
- function Gr(n, o) {
838
- const a = n._queue.shift();
839
- n._queueTotalSize -= a.byteLength, Qr(n);
840
- const p = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
841
- o._chunkSteps(p);
842
- }
843
- u(Gr, "ReadableByteStreamControllerFillReadRequestFromQueue");
844
- function er(n) {
845
- if (n._byobRequest === null && n._pendingPullIntos.length > 0) {
846
- const o = n._pendingPullIntos.peek(), a = new Uint8Array(o.buffer, o.byteOffset + o.bytesFilled, o.byteLength - o.bytesFilled), p = Object.create(Ee.prototype);
847
- uo(p, n, a), n._byobRequest = p;
848
- }
849
- return n._byobRequest;
850
- }
851
- u(er, "ReadableByteStreamControllerGetBYOBRequest");
852
- function Zr(n) {
853
- const o = n._controlledReadableByteStream._state;
854
- return o === "errored" ? null : o === "closed" ? 0 : n._strategyHWM - n._queueTotalSize;
855
- }
856
- u(Zr, "ReadableByteStreamControllerGetDesiredSize");
857
- function ft(n, o) {
858
- const a = n._pendingPullIntos.peek();
859
- if (n._controlledReadableByteStream._state === "closed") {
860
- if (o !== 0) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
861
- } else {
862
- if (o === 0) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");
863
- if (a.bytesFilled + o > a.byteLength) throw new RangeError("bytesWritten out of range");
864
- }
865
- a.buffer = fe(a.buffer), Yr(n, o);
866
- }
867
- u(ft, "ReadableByteStreamControllerRespond");
868
- function ct(n, o) {
869
- const a = n._pendingPullIntos.peek();
870
- if (n._controlledReadableByteStream._state === "closed") {
871
- if (o.byteLength !== 0) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream");
872
- } else if (o.byteLength === 0) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");
873
- if (a.byteOffset + a.bytesFilled !== o.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
874
- if (a.bufferByteLength !== o.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
875
- if (a.bytesFilled + o.byteLength > a.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");
876
- const g = o.byteLength;
877
- a.buffer = fe(o.buffer), Yr(n, g);
878
- }
879
- u(ct, "ReadableByteStreamControllerRespondWithNewView");
880
- function Kr(n, o, a, p, g, _, S) {
881
- o._controlledReadableByteStream = n, o._pullAgain = false, o._pulling = false, o._byobRequest = null, o._queue = o._queueTotalSize = void 0, _e(o), o._closeRequested = false, o._started = false, o._strategyHWM = _, o._pullAlgorithm = p, o._cancelAlgorithm = g, o._autoAllocateChunkSize = S, o._pendingPullIntos = new Q(), n._readableStreamController = o;
882
- const C = a();
883
- E(W(C), () => (o._started = true, Ae(o), null), (q) => (ee(o, q), null));
884
- }
885
- u(Kr, "SetUpReadableByteStreamController");
886
- function so(n, o, a) {
887
- const p = Object.create(ce.prototype);
888
- let g, _, S;
889
- o.start !== void 0 ? g = u(() => o.start(p), "startAlgorithm") : g = u(() => {
890
- }, "startAlgorithm"), o.pull !== void 0 ? _ = u(() => o.pull(p), "pullAlgorithm") : _ = u(() => W(void 0), "pullAlgorithm"), o.cancel !== void 0 ? S = u((q) => o.cancel(q), "cancelAlgorithm") : S = u(() => W(void 0), "cancelAlgorithm");
891
- const C = o.autoAllocateChunkSize;
892
- if (C === 0) throw new TypeError("autoAllocateChunkSize must be greater than 0");
893
- Kr(n, p, g, _, S, a, C);
894
- }
895
- u(so, "SetUpReadableByteStreamControllerFromUnderlyingSource");
896
- function uo(n, o, a) {
897
- n._associatedReadableByteStreamController = o, n._view = a;
898
- }
899
- u(uo, "SetUpReadableStreamBYOBRequest");
900
- function tr(n) {
901
- return new TypeError(`ReadableStreamBYOBRequest.prototype.${n} can only be used on a ReadableStreamBYOBRequest`);
902
- }
903
- u(tr, "byobRequestBrandCheckException");
904
- function Ge(n) {
905
- return new TypeError(`ReadableByteStreamController.prototype.${n} can only be used on a ReadableByteStreamController`);
906
- }
907
- u(Ge, "byteStreamControllerBrandCheckException");
908
- function lo(n, o) {
909
- ie(n, o);
910
- const a = _optionalChain([n, 'optionalAccess', _2 => _2.mode]);
911
- return { mode: a === void 0 ? void 0 : fo(a, `${o} has member 'mode' that`) };
912
- }
913
- u(lo, "convertReaderOptions");
914
- function fo(n, o) {
915
- if (n = `${n}`, n !== "byob") throw new TypeError(`${o} '${n}' is not a valid enumeration value for ReadableStreamReaderMode`);
916
- return n;
917
- }
918
- u(fo, "convertReadableStreamReaderMode");
919
- function co(n, o) {
920
- var a;
921
- ie(n, o);
922
- const p = (a = _optionalChain([n, 'optionalAccess', _3 => _3.min])) !== null && a !== void 0 ? a : 1;
923
- return { min: Mt(p, `${o} has member 'min' that`) };
924
- }
925
- u(co, "convertByobReadOptions");
926
- function Jr(n) {
927
- return new Se(n);
928
- }
929
- u(Jr, "AcquireReadableStreamBYOBReader");
930
- function Xr(n, o) {
931
- n._reader._readIntoRequests.push(o);
932
- }
933
- u(Xr, "ReadableStreamAddReadIntoRequest");
934
- function ho(n, o, a) {
935
- const g = n._reader._readIntoRequests.shift();
936
- a ? g._closeSteps(o) : g._chunkSteps(o);
937
- }
938
- u(ho, "ReadableStreamFulfillReadIntoRequest");
939
- function en(n) {
940
- return n._reader._readIntoRequests.length;
941
- }
942
- u(en, "ReadableStreamGetNumReadIntoRequests");
943
- function rr(n) {
944
- const o = n._reader;
945
- return !(o === void 0 || !Be(o));
946
- }
947
- u(rr, "ReadableStreamHasBYOBReader");
948
- class Se {
949
- static {
950
- u(this, "ReadableStreamBYOBReader");
951
- }
952
- constructor(o) {
953
- if (le(o, 1, "ReadableStreamBYOBReader"), xt(o, "First parameter"), Te(o)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
954
- if (!ve(o._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
955
- Rr(this, o), this._readIntoRequests = new Q();
956
- }
957
- get closed() {
958
- return Be(this) ? this._closedPromise : T(dt("closed"));
959
- }
960
- cancel(o = void 0) {
961
- return Be(this) ? this._ownerReadableStream === void 0 ? T(nt("cancel")) : zt(this, o) : T(dt("cancel"));
962
- }
963
- read(o, a = {}) {
964
- if (!Be(this)) return T(dt("read"));
965
- if (!ArrayBuffer.isView(o)) return T(new TypeError("view must be an array buffer view"));
966
- if (o.byteLength === 0) return T(new TypeError("view must have non-zero byteLength"));
967
- if (o.buffer.byteLength === 0) return T(new TypeError("view's buffer must have non-zero byteLength"));
968
- if (ge(o.buffer)) return T(new TypeError("view's buffer has been detached"));
969
- let p;
970
- try {
971
- p = co(a, "options");
972
- } catch (P) {
973
- return T(P);
974
- }
975
- const g = p.min;
976
- if (g === 0) return T(new TypeError("options.min must be greater than 0"));
977
- if (eo(o)) {
978
- if (g > o.byteLength) return T(new RangeError("options.min must be less than or equal to view's byteLength"));
979
- } else if (g > o.length) return T(new RangeError("options.min must be less than or equal to view's length"));
980
- if (this._ownerReadableStream === void 0) return T(nt("read from"));
981
- let _, S;
982
- const C = z((P, k) => {
983
- _ = P, S = k;
984
- });
985
- return tn(this, o, g, { _chunkSteps: u((P) => _({ value: P, done: false }), "_chunkSteps"), _closeSteps: u((P) => _({ value: P, done: true }), "_closeSteps"), _errorSteps: u((P) => S(P), "_errorSteps") }), C;
986
- }
987
- releaseLock() {
988
- if (!Be(this)) throw dt("releaseLock");
989
- this._ownerReadableStream !== void 0 && po(this);
990
- }
991
- }
992
- Object.defineProperties(Se.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), w(Se.prototype.cancel, "cancel"), w(Se.prototype.read, "read"), w(Se.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Se.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true });
993
- function Be(n) {
994
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_readIntoRequests") ? false : n instanceof Se;
995
- }
996
- u(Be, "IsReadableStreamBYOBReader");
997
- function tn(n, o, a, p) {
998
- const g = n._ownerReadableStream;
999
- g._disturbed = true, g._state === "errored" ? p._errorSteps(g._storedError) : no(g._readableStreamController, o, a, p);
1000
- }
1001
- u(tn, "ReadableStreamBYOBReaderRead");
1002
- function po(n) {
1003
- ue(n);
1004
- const o = new TypeError("Reader was released");
1005
- rn(n, o);
1006
- }
1007
- u(po, "ReadableStreamBYOBReaderRelease");
1008
- function rn(n, o) {
1009
- const a = n._readIntoRequests;
1010
- n._readIntoRequests = new Q(), a.forEach((p) => {
1011
- p._errorSteps(o);
1012
- });
1013
- }
1014
- u(rn, "ReadableStreamBYOBReaderErrorReadIntoRequests");
1015
- function dt(n) {
1016
- return new TypeError(`ReadableStreamBYOBReader.prototype.${n} can only be used on a ReadableStreamBYOBReader`);
1017
- }
1018
- u(dt, "byobReaderBrandCheckException");
1019
- function Ze(n, o) {
1020
- const { highWaterMark: a } = n;
1021
- if (a === void 0) return o;
1022
- if (Ir(a) || a < 0) throw new RangeError("Invalid highWaterMark");
1023
- return a;
1024
- }
1025
- u(Ze, "ExtractHighWaterMark");
1026
- function ht(n) {
1027
- const { size: o } = n;
1028
- return o || (() => 1);
1029
- }
1030
- u(ht, "ExtractSizeAlgorithm");
1031
- function pt(n, o) {
1032
- ie(n, o);
1033
- const a = _optionalChain([n, 'optionalAccess', _4 => _4.highWaterMark]), p = _optionalChain([n, 'optionalAccess', _5 => _5.size]);
1034
- return { highWaterMark: a === void 0 ? void 0 : $t(a), size: p === void 0 ? void 0 : bo(p, `${o} has member 'size' that`) };
1035
- }
1036
- u(pt, "convertQueuingStrategy");
1037
- function bo(n, o) {
1038
- return X(n, o), (a) => $t(n(a));
1039
- }
1040
- u(bo, "convertQueuingStrategySize");
1041
- function mo(n, o) {
1042
- ie(n, o);
1043
- const a = _optionalChain([n, 'optionalAccess', _6 => _6.abort]), p = _optionalChain([n, 'optionalAccess', _7 => _7.close]), g = _optionalChain([n, 'optionalAccess', _8 => _8.start]), _ = _optionalChain([n, 'optionalAccess', _9 => _9.type]), S = _optionalChain([n, 'optionalAccess', _10 => _10.write]);
1044
- return { abort: a === void 0 ? void 0 : yo(a, n, `${o} has member 'abort' that`), close: p === void 0 ? void 0 : go(p, n, `${o} has member 'close' that`), start: g === void 0 ? void 0 : _o(g, n, `${o} has member 'start' that`), write: S === void 0 ? void 0 : So(S, n, `${o} has member 'write' that`), type: _ };
1045
- }
1046
- u(mo, "convertUnderlyingSink");
1047
- function yo(n, o, a) {
1048
- return X(n, a), (p) => N(n, o, [p]);
1049
- }
1050
- u(yo, "convertUnderlyingSinkAbortCallback");
1051
- function go(n, o, a) {
1052
- return X(n, a), () => N(n, o, []);
1053
- }
1054
- u(go, "convertUnderlyingSinkCloseCallback");
1055
- function _o(n, o, a) {
1056
- return X(n, a), (p) => $(n, o, [p]);
1057
- }
1058
- u(_o, "convertUnderlyingSinkStartCallback");
1059
- function So(n, o, a) {
1060
- return X(n, a), (p, g) => N(n, o, [p, g]);
1061
- }
1062
- u(So, "convertUnderlyingSinkWriteCallback");
1063
- function nn(n, o) {
1064
- if (!ze(n)) throw new TypeError(`${o} is not a WritableStream.`);
1065
- }
1066
- u(nn, "assertWritableStream");
1067
- function wo(n) {
1068
- if (typeof n != "object" || n === null) return false;
1069
- try {
1070
- return typeof n.aborted == "boolean";
1071
- } catch (e4) {
1072
- return false;
1073
- }
1074
- }
1075
- u(wo, "isAbortSignal");
1076
- const Ro = typeof AbortController == "function";
1077
- function To() {
1078
- if (Ro) return new AbortController();
1079
- }
1080
- u(To, "createAbortController");
1081
- class we {
1082
- static {
1083
- u(this, "WritableStream");
1084
- }
1085
- constructor(o = {}, a = {}) {
1086
- o === void 0 ? o = null : Er(o, "First parameter");
1087
- const p = pt(a, "Second parameter"), g = mo(o, "First parameter");
1088
- if (an(this), g.type !== void 0) throw new RangeError("Invalid type is specified");
1089
- const S = ht(p), C = Ze(p, 1);
1090
- jo(this, g, C, S);
1091
- }
1092
- get locked() {
1093
- if (!ze(this)) throw _t("locked");
1094
- return je(this);
1095
- }
1096
- abort(o = void 0) {
1097
- return ze(this) ? je(this) ? T(new TypeError("Cannot abort a stream that already has a writer")) : bt(this, o) : T(_t("abort"));
1098
- }
1099
- close() {
1100
- return ze(this) ? je(this) ? T(new TypeError("Cannot close a stream that already has a writer")) : ae(this) ? T(new TypeError("Cannot close an already-closing stream")) : sn(this) : T(_t("close"));
1101
- }
1102
- getWriter() {
1103
- if (!ze(this)) throw _t("getWriter");
1104
- return on(this);
1105
- }
1106
- }
1107
- Object.defineProperties(we.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), w(we.prototype.abort, "abort"), w(we.prototype.close, "close"), w(we.prototype.getWriter, "getWriter"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(we.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: true });
1108
- function on(n) {
1109
- return new de(n);
1110
- }
1111
- u(on, "AcquireWritableStreamDefaultWriter");
1112
- function Co(n, o, a, p, g = 1, _ = () => 1) {
1113
- const S = Object.create(we.prototype);
1114
- an(S);
1115
- const C = Object.create(Le.prototype);
1116
- return hn(S, C, n, o, a, p, g, _), S;
1117
- }
1118
- u(Co, "CreateWritableStream");
1119
- function an(n) {
1120
- n._state = "writable", n._storedError = void 0, n._writer = void 0, n._writableStreamController = void 0, n._writeRequests = new Q(), n._inFlightWriteRequest = void 0, n._closeRequest = void 0, n._inFlightCloseRequest = void 0, n._pendingAbortRequest = void 0, n._backpressure = false;
1121
- }
1122
- u(an, "InitializeWritableStream");
1123
- function ze(n) {
1124
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_writableStreamController") ? false : n instanceof we;
1125
- }
1126
- u(ze, "IsWritableStream");
1127
- function je(n) {
1128
- return n._writer !== void 0;
1129
- }
1130
- u(je, "IsWritableStreamLocked");
1131
- function bt(n, o) {
1132
- var a;
1133
- if (n._state === "closed" || n._state === "errored") return W(void 0);
1134
- n._writableStreamController._abortReason = o, (a = n._writableStreamController._abortController) === null || a === void 0 || a.abort(o);
1135
- const p = n._state;
1136
- if (p === "closed" || p === "errored") return W(void 0);
1137
- if (n._pendingAbortRequest !== void 0) return n._pendingAbortRequest._promise;
1138
- let g = false;
1139
- p === "erroring" && (g = true, o = void 0);
1140
- const _ = z((S, C) => {
1141
- n._pendingAbortRequest = { _promise: void 0, _resolve: S, _reject: C, _reason: o, _wasAlreadyErroring: g };
1142
- });
1143
- return n._pendingAbortRequest._promise = _, g || or(n, o), _;
1144
- }
1145
- u(bt, "WritableStreamAbort");
1146
- function sn(n) {
1147
- const o = n._state;
1148
- if (o === "closed" || o === "errored") return T(new TypeError(`The stream (in ${o} state) is not in the writable state and cannot be closed`));
1149
- const a = z((g, _) => {
1150
- const S = { _resolve: g, _reject: _ };
1151
- n._closeRequest = S;
1152
- }), p = n._writer;
1153
- return p !== void 0 && n._backpressure && o === "writable" && dr(p), Lo(n._writableStreamController), a;
1154
- }
1155
- u(sn, "WritableStreamClose");
1156
- function Po(n) {
1157
- return z((a, p) => {
1158
- const g = { _resolve: a, _reject: p };
1159
- n._writeRequests.push(g);
1160
- });
1161
- }
1162
- u(Po, "WritableStreamAddWriteRequest");
1163
- function nr(n, o) {
1164
- if (n._state === "writable") {
1165
- or(n, o);
1166
- return;
1167
- }
1168
- ir(n);
1169
- }
1170
- u(nr, "WritableStreamDealWithRejection");
1171
- function or(n, o) {
1172
- const a = n._writableStreamController;
1173
- n._state = "erroring", n._storedError = o;
1174
- const p = n._writer;
1175
- p !== void 0 && ln(p, o), !qo(n) && a._started && ir(n);
1176
- }
1177
- u(or, "WritableStreamStartErroring");
1178
- function ir(n) {
1179
- n._state = "errored", n._writableStreamController[wr]();
1180
- const o = n._storedError;
1181
- if (n._writeRequests.forEach((g) => {
1182
- g._reject(o);
1183
- }), n._writeRequests = new Q(), n._pendingAbortRequest === void 0) {
1184
- mt(n);
1185
- return;
1186
- }
1187
- const a = n._pendingAbortRequest;
1188
- if (n._pendingAbortRequest = void 0, a._wasAlreadyErroring) {
1189
- a._reject(o), mt(n);
1190
- return;
1191
- }
1192
- const p = n._writableStreamController[rt](a._reason);
1193
- E(p, () => (a._resolve(), mt(n), null), (g) => (a._reject(g), mt(n), null));
1194
- }
1195
- u(ir, "WritableStreamFinishErroring");
1196
- function Eo(n) {
1197
- n._inFlightWriteRequest._resolve(void 0), n._inFlightWriteRequest = void 0;
1198
- }
1199
- u(Eo, "WritableStreamFinishInFlightWrite");
1200
- function vo(n, o) {
1201
- n._inFlightWriteRequest._reject(o), n._inFlightWriteRequest = void 0, nr(n, o);
1202
- }
1203
- u(vo, "WritableStreamFinishInFlightWriteWithError");
1204
- function Ao(n) {
1205
- n._inFlightCloseRequest._resolve(void 0), n._inFlightCloseRequest = void 0, n._state === "erroring" && (n._storedError = void 0, n._pendingAbortRequest !== void 0 && (n._pendingAbortRequest._resolve(), n._pendingAbortRequest = void 0)), n._state = "closed";
1206
- const a = n._writer;
1207
- a !== void 0 && yn(a);
1208
- }
1209
- u(Ao, "WritableStreamFinishInFlightClose");
1210
- function Bo(n, o) {
1211
- n._inFlightCloseRequest._reject(o), n._inFlightCloseRequest = void 0, n._pendingAbortRequest !== void 0 && (n._pendingAbortRequest._reject(o), n._pendingAbortRequest = void 0), nr(n, o);
1212
- }
1213
- u(Bo, "WritableStreamFinishInFlightCloseWithError");
1214
- function ae(n) {
1215
- return !(n._closeRequest === void 0 && n._inFlightCloseRequest === void 0);
1216
- }
1217
- u(ae, "WritableStreamCloseQueuedOrInFlight");
1218
- function qo(n) {
1219
- return !(n._inFlightWriteRequest === void 0 && n._inFlightCloseRequest === void 0);
1220
- }
1221
- u(qo, "WritableStreamHasOperationMarkedInFlight");
1222
- function Wo(n) {
1223
- n._inFlightCloseRequest = n._closeRequest, n._closeRequest = void 0;
1224
- }
1225
- u(Wo, "WritableStreamMarkCloseRequestInFlight");
1226
- function ko(n) {
1227
- n._inFlightWriteRequest = n._writeRequests.shift();
1228
- }
1229
- u(ko, "WritableStreamMarkFirstWriteRequestInFlight");
1230
- function mt(n) {
1231
- n._closeRequest !== void 0 && (n._closeRequest._reject(n._storedError), n._closeRequest = void 0);
1232
- const o = n._writer;
1233
- o !== void 0 && fr(o, n._storedError);
1234
- }
1235
- u(mt, "WritableStreamRejectCloseAndClosedPromiseIfNeeded");
1236
- function ar(n, o) {
1237
- const a = n._writer;
1238
- a !== void 0 && o !== n._backpressure && (o ? Ho(a) : dr(a)), n._backpressure = o;
1239
- }
1240
- u(ar, "WritableStreamUpdateBackpressure");
1241
- class de {
1242
- static {
1243
- u(this, "WritableStreamDefaultWriter");
1244
- }
1245
- constructor(o) {
1246
- if (le(o, 1, "WritableStreamDefaultWriter"), nn(o, "First parameter"), je(o)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
1247
- this._ownerWritableStream = o, o._writer = this;
1248
- const a = o._state;
1249
- if (a === "writable") !ae(o) && o._backpressure ? wt(this) : gn(this), St(this);
1250
- else if (a === "erroring") cr(this, o._storedError), St(this);
1251
- else if (a === "closed") gn(this), Uo(this);
1252
- else {
1253
- const p = o._storedError;
1254
- cr(this, p), mn(this, p);
1255
- }
1256
- }
1257
- get closed() {
1258
- return qe(this) ? this._closedPromise : T(We("closed"));
1259
- }
1260
- get desiredSize() {
1261
- if (!qe(this)) throw We("desiredSize");
1262
- if (this._ownerWritableStream === void 0) throw Je("desiredSize");
1263
- return zo(this);
1264
- }
1265
- get ready() {
1266
- return qe(this) ? this._readyPromise : T(We("ready"));
1267
- }
1268
- abort(o = void 0) {
1269
- return qe(this) ? this._ownerWritableStream === void 0 ? T(Je("abort")) : Oo(this, o) : T(We("abort"));
1270
- }
1271
- close() {
1272
- if (!qe(this)) return T(We("close"));
1273
- const o = this._ownerWritableStream;
1274
- return o === void 0 ? T(Je("close")) : ae(o) ? T(new TypeError("Cannot close an already-closing stream")) : un(this);
1275
- }
1276
- releaseLock() {
1277
- if (!qe(this)) throw We("releaseLock");
1278
- this._ownerWritableStream !== void 0 && fn(this);
1279
- }
1280
- write(o = void 0) {
1281
- return qe(this) ? this._ownerWritableStream === void 0 ? T(Je("write to")) : cn(this, o) : T(We("write"));
1282
- }
1283
- }
1284
- Object.defineProperties(de.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), w(de.prototype.abort, "abort"), w(de.prototype.close, "close"), w(de.prototype.releaseLock, "releaseLock"), w(de.prototype.write, "write"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(de.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true });
1285
- function qe(n) {
1286
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_ownerWritableStream") ? false : n instanceof de;
1287
- }
1288
- u(qe, "IsWritableStreamDefaultWriter");
1289
- function Oo(n, o) {
1290
- const a = n._ownerWritableStream;
1291
- return bt(a, o);
1292
- }
1293
- u(Oo, "WritableStreamDefaultWriterAbort");
1294
- function un(n) {
1295
- const o = n._ownerWritableStream;
1296
- return sn(o);
1297
- }
1298
- u(un, "WritableStreamDefaultWriterClose");
1299
- function Fo(n) {
1300
- const o = n._ownerWritableStream, a = o._state;
1301
- return ae(o) || a === "closed" ? W(void 0) : a === "errored" ? T(o._storedError) : un(n);
1302
- }
1303
- u(Fo, "WritableStreamDefaultWriterCloseWithErrorPropagation");
1304
- function Io(n, o) {
1305
- n._closedPromiseState === "pending" ? fr(n, o) : No(n, o);
1306
- }
1307
- u(Io, "WritableStreamDefaultWriterEnsureClosedPromiseRejected");
1308
- function ln(n, o) {
1309
- n._readyPromiseState === "pending" ? _n(n, o) : Vo(n, o);
1310
- }
1311
- u(ln, "WritableStreamDefaultWriterEnsureReadyPromiseRejected");
1312
- function zo(n) {
1313
- const o = n._ownerWritableStream, a = o._state;
1314
- return a === "errored" || a === "erroring" ? null : a === "closed" ? 0 : pn(o._writableStreamController);
1315
- }
1316
- u(zo, "WritableStreamDefaultWriterGetDesiredSize");
1317
- function fn(n) {
1318
- const o = n._ownerWritableStream, a = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
1319
- ln(n, a), Io(n, a), o._writer = void 0, n._ownerWritableStream = void 0;
1320
- }
1321
- u(fn, "WritableStreamDefaultWriterRelease");
1322
- function cn(n, o) {
1323
- const a = n._ownerWritableStream, p = a._writableStreamController, g = Do(p, o);
1324
- if (a !== n._ownerWritableStream) return T(Je("write to"));
1325
- const _ = a._state;
1326
- if (_ === "errored") return T(a._storedError);
1327
- if (ae(a) || _ === "closed") return T(new TypeError("The stream is closing or closed and cannot be written to"));
1328
- if (_ === "erroring") return T(a._storedError);
1329
- const S = Po(a);
1330
- return $o(p, o, g), S;
1331
- }
1332
- u(cn, "WritableStreamDefaultWriterWrite");
1333
- const dn = {};
1334
- class Le {
1335
- static {
1336
- u(this, "WritableStreamDefaultController");
1337
- }
1338
- constructor() {
1339
- throw new TypeError("Illegal constructor");
1340
- }
1341
- get abortReason() {
1342
- if (!sr(this)) throw lr("abortReason");
1343
- return this._abortReason;
1344
- }
1345
- get signal() {
1346
- if (!sr(this)) throw lr("signal");
1347
- if (this._abortController === void 0) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");
1348
- return this._abortController.signal;
1349
- }
1350
- error(o = void 0) {
1351
- if (!sr(this)) throw lr("error");
1352
- this._controlledWritableStream._state === "writable" && bn(this, o);
1353
- }
1354
- [rt](o) {
1355
- const a = this._abortAlgorithm(o);
1356
- return yt(this), a;
1357
- }
1358
- [wr]() {
1359
- _e(this);
1360
- }
1361
- }
1362
- Object.defineProperties(Le.prototype, { abortReason: { enumerable: true }, signal: { enumerable: true }, error: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Le.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: true });
1363
- function sr(n) {
1364
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_controlledWritableStream") ? false : n instanceof Le;
1365
- }
1366
- u(sr, "IsWritableStreamDefaultController");
1367
- function hn(n, o, a, p, g, _, S, C) {
1368
- o._controlledWritableStream = n, n._writableStreamController = o, o._queue = void 0, o._queueTotalSize = void 0, _e(o), o._abortReason = void 0, o._abortController = To(), o._started = false, o._strategySizeAlgorithm = C, o._strategyHWM = S, o._writeAlgorithm = p, o._closeAlgorithm = g, o._abortAlgorithm = _;
1369
- const q = ur(o);
1370
- ar(n, q);
1371
- const P = a(), k = W(P);
1372
- E(k, () => (o._started = true, gt(o), null), (O) => (o._started = true, nr(n, O), null));
1373
- }
1374
- u(hn, "SetUpWritableStreamDefaultController");
1375
- function jo(n, o, a, p) {
1376
- const g = Object.create(Le.prototype);
1377
- let _, S, C, q;
1378
- o.start !== void 0 ? _ = u(() => o.start(g), "startAlgorithm") : _ = u(() => {
1379
- }, "startAlgorithm"), o.write !== void 0 ? S = u((P) => o.write(P, g), "writeAlgorithm") : S = u(() => W(void 0), "writeAlgorithm"), o.close !== void 0 ? C = u(() => o.close(), "closeAlgorithm") : C = u(() => W(void 0), "closeAlgorithm"), o.abort !== void 0 ? q = u((P) => o.abort(P), "abortAlgorithm") : q = u(() => W(void 0), "abortAlgorithm"), hn(n, g, _, S, C, q, a, p);
1380
- }
1381
- u(jo, "SetUpWritableStreamDefaultControllerFromUnderlyingSink");
1382
- function yt(n) {
1383
- n._writeAlgorithm = void 0, n._closeAlgorithm = void 0, n._abortAlgorithm = void 0, n._strategySizeAlgorithm = void 0;
1384
- }
1385
- u(yt, "WritableStreamDefaultControllerClearAlgorithms");
1386
- function Lo(n) {
1387
- Gt(n, dn, 0), gt(n);
1388
- }
1389
- u(Lo, "WritableStreamDefaultControllerClose");
1390
- function Do(n, o) {
1391
- try {
1392
- return n._strategySizeAlgorithm(o);
1393
- } catch (a) {
1394
- return Ke(n, a), 1;
1395
- }
1396
- }
1397
- u(Do, "WritableStreamDefaultControllerGetChunkSize");
1398
- function pn(n) {
1399
- return n._strategyHWM - n._queueTotalSize;
1400
- }
1401
- u(pn, "WritableStreamDefaultControllerGetDesiredSize");
1402
- function $o(n, o, a) {
1403
- try {
1404
- Gt(n, o, a);
1405
- } catch (g) {
1406
- Ke(n, g);
1407
- return;
1408
- }
1409
- const p = n._controlledWritableStream;
1410
- if (!ae(p) && p._state === "writable") {
1411
- const g = ur(n);
1412
- ar(p, g);
1413
- }
1414
- gt(n);
1415
- }
1416
- u($o, "WritableStreamDefaultControllerWrite");
1417
- function gt(n) {
1418
- const o = n._controlledWritableStream;
1419
- if (!n._started || o._inFlightWriteRequest !== void 0) return;
1420
- if (o._state === "erroring") {
1421
- ir(o);
1422
- return;
1423
- }
1424
- if (n._queue.length === 0) return;
1425
- const p = Xn(n);
1426
- p === dn ? Mo(n) : xo(n, p);
1427
- }
1428
- u(gt, "WritableStreamDefaultControllerAdvanceQueueIfNeeded");
1429
- function Ke(n, o) {
1430
- n._controlledWritableStream._state === "writable" && bn(n, o);
1431
- }
1432
- u(Ke, "WritableStreamDefaultControllerErrorIfNeeded");
1433
- function Mo(n) {
1434
- const o = n._controlledWritableStream;
1435
- Wo(o), Yt(n);
1436
- const a = n._closeAlgorithm();
1437
- yt(n), E(a, () => (Ao(o), null), (p) => (Bo(o, p), null));
1438
- }
1439
- u(Mo, "WritableStreamDefaultControllerProcessClose");
1440
- function xo(n, o) {
1441
- const a = n._controlledWritableStream;
1442
- ko(a);
1443
- const p = n._writeAlgorithm(o);
1444
- E(p, () => {
1445
- Eo(a);
1446
- const g = a._state;
1447
- if (Yt(n), !ae(a) && g === "writable") {
1448
- const _ = ur(n);
1449
- ar(a, _);
1450
- }
1451
- return gt(n), null;
1452
- }, (g) => (a._state === "writable" && yt(n), vo(a, g), null));
1453
- }
1454
- u(xo, "WritableStreamDefaultControllerProcessWrite");
1455
- function ur(n) {
1456
- return pn(n) <= 0;
1457
- }
1458
- u(ur, "WritableStreamDefaultControllerGetBackpressure");
1459
- function bn(n, o) {
1460
- const a = n._controlledWritableStream;
1461
- yt(n), or(a, o);
1462
- }
1463
- u(bn, "WritableStreamDefaultControllerError");
1464
- function _t(n) {
1465
- return new TypeError(`WritableStream.prototype.${n} can only be used on a WritableStream`);
1466
- }
1467
- u(_t, "streamBrandCheckException$2");
1468
- function lr(n) {
1469
- return new TypeError(`WritableStreamDefaultController.prototype.${n} can only be used on a WritableStreamDefaultController`);
1470
- }
1471
- u(lr, "defaultControllerBrandCheckException$2");
1472
- function We(n) {
1473
- return new TypeError(`WritableStreamDefaultWriter.prototype.${n} can only be used on a WritableStreamDefaultWriter`);
1474
- }
1475
- u(We, "defaultWriterBrandCheckException");
1476
- function Je(n) {
1477
- return new TypeError("Cannot " + n + " a stream using a released writer");
1478
- }
1479
- u(Je, "defaultWriterLockException");
1480
- function St(n) {
1481
- n._closedPromise = z((o, a) => {
1482
- n._closedPromise_resolve = o, n._closedPromise_reject = a, n._closedPromiseState = "pending";
1483
- });
1484
- }
1485
- u(St, "defaultWriterClosedPromiseInitialize");
1486
- function mn(n, o) {
1487
- St(n), fr(n, o);
1488
- }
1489
- u(mn, "defaultWriterClosedPromiseInitializeAsRejected");
1490
- function Uo(n) {
1491
- St(n), yn(n);
1492
- }
1493
- u(Uo, "defaultWriterClosedPromiseInitializeAsResolved");
1494
- function fr(n, o) {
1495
- n._closedPromise_reject !== void 0 && (K(n._closedPromise), n._closedPromise_reject(o), n._closedPromise_resolve = void 0, n._closedPromise_reject = void 0, n._closedPromiseState = "rejected");
1496
- }
1497
- u(fr, "defaultWriterClosedPromiseReject");
1498
- function No(n, o) {
1499
- mn(n, o);
1500
- }
1501
- u(No, "defaultWriterClosedPromiseResetToRejected");
1502
- function yn(n) {
1503
- n._closedPromise_resolve !== void 0 && (n._closedPromise_resolve(void 0), n._closedPromise_resolve = void 0, n._closedPromise_reject = void 0, n._closedPromiseState = "resolved");
1504
- }
1505
- u(yn, "defaultWriterClosedPromiseResolve");
1506
- function wt(n) {
1507
- n._readyPromise = z((o, a) => {
1508
- n._readyPromise_resolve = o, n._readyPromise_reject = a;
1509
- }), n._readyPromiseState = "pending";
1510
- }
1511
- u(wt, "defaultWriterReadyPromiseInitialize");
1512
- function cr(n, o) {
1513
- wt(n), _n(n, o);
1514
- }
1515
- u(cr, "defaultWriterReadyPromiseInitializeAsRejected");
1516
- function gn(n) {
1517
- wt(n), dr(n);
1518
- }
1519
- u(gn, "defaultWriterReadyPromiseInitializeAsResolved");
1520
- function _n(n, o) {
1521
- n._readyPromise_reject !== void 0 && (K(n._readyPromise), n._readyPromise_reject(o), n._readyPromise_resolve = void 0, n._readyPromise_reject = void 0, n._readyPromiseState = "rejected");
1522
- }
1523
- u(_n, "defaultWriterReadyPromiseReject");
1524
- function Ho(n) {
1525
- wt(n);
1526
- }
1527
- u(Ho, "defaultWriterReadyPromiseReset");
1528
- function Vo(n, o) {
1529
- cr(n, o);
1530
- }
1531
- u(Vo, "defaultWriterReadyPromiseResetToRejected");
1532
- function dr(n) {
1533
- n._readyPromise_resolve !== void 0 && (n._readyPromise_resolve(void 0), n._readyPromise_resolve = void 0, n._readyPromise_reject = void 0, n._readyPromiseState = "fulfilled");
1534
- }
1535
- u(dr, "defaultWriterReadyPromiseResolve");
1536
- function Qo() {
1537
- if (typeof globalThis < "u") return globalThis;
1538
- if (typeof self < "u") return self;
1539
- if (typeof _commonjsHelpers.commonjsGlobal < "u") return _commonjsHelpers.commonjsGlobal;
1540
- }
1541
- u(Qo, "getGlobals");
1542
- const hr = Qo();
1543
- function Yo(n) {
1544
- if (!(typeof n == "function" || typeof n == "object") || n.name !== "DOMException") return false;
1545
- try {
1546
- return new n(), true;
1547
- } catch (e5) {
1548
- return false;
1549
- }
1550
- }
1551
- u(Yo, "isDOMExceptionConstructor");
1552
- function Go() {
1553
- const n = _optionalChain([hr, 'optionalAccess', _11 => _11.DOMException]);
1554
- return Yo(n) ? n : void 0;
1555
- }
1556
- u(Go, "getFromGlobal");
1557
- function Zo() {
1558
- const n = u(function(a, p) {
1559
- this.message = a || "", this.name = p || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
1560
- }, "DOMException");
1561
- return w(n, "DOMException"), n.prototype = Object.create(Error.prototype), Object.defineProperty(n.prototype, "constructor", { value: n, writable: true, configurable: true }), n;
1562
- }
1563
- u(Zo, "createPolyfill");
1564
- const Ko = Go() || Zo();
1565
- function Sn(n, o, a, p, g, _) {
1566
- const S = Fe(n), C = on(o);
1567
- n._disturbed = true;
1568
- let q = false, P = W(void 0);
1569
- return z((k, O) => {
1570
- let j;
1571
- if (_ !== void 0) {
1572
- if (j = u(() => {
1573
- const v = _.reason !== void 0 ? _.reason : new Ko("Aborted", "AbortError"), I = [];
1574
- p || I.push(() => o._state === "writable" ? bt(o, v) : W(void 0)), g || I.push(() => n._state === "readable" ? ne(n, v) : W(void 0)), G(() => Promise.all(I.map((L) => L())), true, v);
1575
- }, "abortAlgorithm"), _.aborted) {
1576
- j();
1577
- return;
1578
- }
1579
- _.addEventListener("abort", j);
1580
- }
1581
- function oe() {
1582
- return z((v, I) => {
1583
- function L(J) {
1584
- J ? v() : D(xe(), L, I);
1585
- }
1586
- u(L, "next"), L(false);
1587
- });
1588
- }
1589
- u(oe, "pipeLoop");
1590
- function xe() {
1591
- return q ? W(true) : D(C._readyPromise, () => z((v, I) => {
1592
- Ve(S, { _chunkSteps: u((L) => {
1593
- P = D(cn(C, L), void 0, y), v(false);
1594
- }, "_chunkSteps"), _closeSteps: u(() => v(true), "_closeSteps"), _errorSteps: I });
1595
- }));
1596
- }
1597
- if (u(xe, "pipeStep"), pe(n, S._closedPromise, (v) => (p ? te(true, v) : G(() => bt(o, v), true, v), null)), pe(o, C._closedPromise, (v) => (g ? te(true, v) : G(() => ne(n, v), true, v), null)), Y(n, S._closedPromise, () => (a ? te() : G(() => Fo(C)), null)), ae(o) || o._state === "closed") {
1598
- const v = new TypeError("the destination writable stream closed before all data could be piped to it");
1599
- g ? te(true, v) : G(() => ne(n, v), true, v);
1600
- }
1601
- K(oe());
1602
- function Pe() {
1603
- const v = P;
1604
- return D(P, () => v !== P ? Pe() : void 0);
1605
- }
1606
- u(Pe, "waitForWritesToFinish");
1607
- function pe(v, I, L) {
1608
- v._state === "errored" ? L(v._storedError) : M(I, L);
1609
- }
1610
- u(pe, "isOrBecomesErrored");
1611
- function Y(v, I, L) {
1612
- v._state === "closed" ? L() : Z(I, L);
1613
- }
1614
- u(Y, "isOrBecomesClosed");
1615
- function G(v, I, L) {
1616
- if (q) return;
1617
- q = true, o._state === "writable" && !ae(o) ? Z(Pe(), J) : J();
1618
- function J() {
1619
- return E(v(), () => be(I, L), (Ue) => be(true, Ue)), null;
1620
- }
1621
- u(J, "doTheRest");
1622
- }
1623
- u(G, "shutdownWithAction");
1624
- function te(v, I) {
1625
- q || (q = true, o._state === "writable" && !ae(o) ? Z(Pe(), () => be(v, I)) : be(v, I));
1626
- }
1627
- u(te, "shutdown");
1628
- function be(v, I) {
1629
- return fn(C), ue(S), _ !== void 0 && _.removeEventListener("abort", j), v ? O(I) : k(void 0), null;
1630
- }
1631
- u(be, "finalize");
1632
- });
1633
- }
1634
- u(Sn, "ReadableStreamPipeTo");
1635
- class he {
1636
- static {
1637
- u(this, "ReadableStreamDefaultController");
1638
- }
1639
- constructor() {
1640
- throw new TypeError("Illegal constructor");
1641
- }
1642
- get desiredSize() {
1643
- if (!Rt(this)) throw Ct("desiredSize");
1644
- return pr(this);
1645
- }
1646
- close() {
1647
- if (!Rt(this)) throw Ct("close");
1648
- if (!$e(this)) throw new TypeError("The stream is not in a state that permits close");
1649
- ke(this);
1650
- }
1651
- enqueue(o = void 0) {
1652
- if (!Rt(this)) throw Ct("enqueue");
1653
- if (!$e(this)) throw new TypeError("The stream is not in a state that permits enqueue");
1654
- return De(this, o);
1655
- }
1656
- error(o = void 0) {
1657
- if (!Rt(this)) throw Ct("error");
1658
- re(this, o);
1659
- }
1660
- [Ot](o) {
1661
- _e(this);
1662
- const a = this._cancelAlgorithm(o);
1663
- return Tt(this), a;
1664
- }
1665
- [Ft](o) {
1666
- const a = this._controlledReadableStream;
1667
- if (this._queue.length > 0) {
1668
- const p = Yt(this);
1669
- this._closeRequested && this._queue.length === 0 ? (Tt(this), tt(a)) : Xe(this), o._chunkSteps(p);
1670
- } else Ar(a, o), Xe(this);
1671
- }
1672
- [It]() {
1673
- }
1674
- }
1675
- Object.defineProperties(he.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), w(he.prototype.close, "close"), w(he.prototype.enqueue, "enqueue"), w(he.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(he.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: true });
1676
- function Rt(n) {
1677
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_controlledReadableStream") ? false : n instanceof he;
1678
- }
1679
- u(Rt, "IsReadableStreamDefaultController");
1680
- function Xe(n) {
1681
- if (!wn(n)) return;
1682
- if (n._pulling) {
1683
- n._pullAgain = true;
1684
- return;
1685
- }
1686
- n._pulling = true;
1687
- const a = n._pullAlgorithm();
1688
- E(a, () => (n._pulling = false, n._pullAgain && (n._pullAgain = false, Xe(n)), null), (p) => (re(n, p), null));
1689
- }
1690
- u(Xe, "ReadableStreamDefaultControllerCallPullIfNeeded");
1691
- function wn(n) {
1692
- const o = n._controlledReadableStream;
1693
- return !$e(n) || !n._started ? false : !!(Te(o) && ot(o) > 0 || pr(n) > 0);
1694
- }
1695
- u(wn, "ReadableStreamDefaultControllerShouldCallPull");
1696
- function Tt(n) {
1697
- n._pullAlgorithm = void 0, n._cancelAlgorithm = void 0, n._strategySizeAlgorithm = void 0;
1698
- }
1699
- u(Tt, "ReadableStreamDefaultControllerClearAlgorithms");
1700
- function ke(n) {
1701
- if (!$e(n)) return;
1702
- const o = n._controlledReadableStream;
1703
- n._closeRequested = true, n._queue.length === 0 && (Tt(n), tt(o));
1704
- }
1705
- u(ke, "ReadableStreamDefaultControllerClose");
1706
- function De(n, o) {
1707
- if (!$e(n)) return;
1708
- const a = n._controlledReadableStream;
1709
- if (Te(a) && ot(a) > 0) Ut(a, o, false);
1710
- else {
1711
- let p;
1712
- try {
1713
- p = n._strategySizeAlgorithm(o);
1714
- } catch (g) {
1715
- throw re(n, g), g;
1716
- }
1717
- try {
1718
- Gt(n, o, p);
1719
- } catch (g) {
1720
- throw re(n, g), g;
1721
- }
1722
- }
1723
- Xe(n);
1724
- }
1725
- u(De, "ReadableStreamDefaultControllerEnqueue");
1726
- function re(n, o) {
1727
- const a = n._controlledReadableStream;
1728
- a._state === "readable" && (_e(n), Tt(n), Pn(a, o));
1729
- }
1730
- u(re, "ReadableStreamDefaultControllerError");
1731
- function pr(n) {
1732
- const o = n._controlledReadableStream._state;
1733
- return o === "errored" ? null : o === "closed" ? 0 : n._strategyHWM - n._queueTotalSize;
1734
- }
1735
- u(pr, "ReadableStreamDefaultControllerGetDesiredSize");
1736
- function Jo(n) {
1737
- return !wn(n);
1738
- }
1739
- u(Jo, "ReadableStreamDefaultControllerHasBackpressure");
1740
- function $e(n) {
1741
- const o = n._controlledReadableStream._state;
1742
- return !n._closeRequested && o === "readable";
1743
- }
1744
- u($e, "ReadableStreamDefaultControllerCanCloseOrEnqueue");
1745
- function Rn(n, o, a, p, g, _, S) {
1746
- o._controlledReadableStream = n, o._queue = void 0, o._queueTotalSize = void 0, _e(o), o._started = false, o._closeRequested = false, o._pullAgain = false, o._pulling = false, o._strategySizeAlgorithm = S, o._strategyHWM = _, o._pullAlgorithm = p, o._cancelAlgorithm = g, n._readableStreamController = o;
1747
- const C = a();
1748
- E(W(C), () => (o._started = true, Xe(o), null), (q) => (re(o, q), null));
1749
- }
1750
- u(Rn, "SetUpReadableStreamDefaultController");
1751
- function Xo(n, o, a, p) {
1752
- const g = Object.create(he.prototype);
1753
- let _, S, C;
1754
- o.start !== void 0 ? _ = u(() => o.start(g), "startAlgorithm") : _ = u(() => {
1755
- }, "startAlgorithm"), o.pull !== void 0 ? S = u(() => o.pull(g), "pullAlgorithm") : S = u(() => W(void 0), "pullAlgorithm"), o.cancel !== void 0 ? C = u((q) => o.cancel(q), "cancelAlgorithm") : C = u(() => W(void 0), "cancelAlgorithm"), Rn(n, g, _, S, C, a, p);
1756
- }
1757
- u(Xo, "SetUpReadableStreamDefaultControllerFromUnderlyingSource");
1758
- function Ct(n) {
1759
- return new TypeError(`ReadableStreamDefaultController.prototype.${n} can only be used on a ReadableStreamDefaultController`);
1760
- }
1761
- u(Ct, "defaultControllerBrandCheckException$1");
1762
- function ei(n, o) {
1763
- return ve(n._readableStreamController) ? ri(n) : ti(n);
1764
- }
1765
- u(ei, "ReadableStreamTee");
1766
- function ti(n, o) {
1767
- const a = Fe(n);
1768
- let p = false, g = false, _ = false, S = false, C, q, P, k, O;
1769
- const j = z((Y) => {
1770
- O = Y;
1771
- });
1772
- function oe() {
1773
- return p ? (g = true, W(void 0)) : (p = true, Ve(a, { _chunkSteps: u((G) => {
1774
- se(() => {
1775
- g = false;
1776
- const te = G, be = G;
1777
- _ || De(P._readableStreamController, te), S || De(k._readableStreamController, be), p = false, g && oe();
1778
- });
1779
- }, "_chunkSteps"), _closeSteps: u(() => {
1780
- p = false, _ || ke(P._readableStreamController), S || ke(k._readableStreamController), (!_ || !S) && O(void 0);
1781
- }, "_closeSteps"), _errorSteps: u(() => {
1782
- p = false;
1783
- }, "_errorSteps") }), W(void 0));
1784
- }
1785
- u(oe, "pullAlgorithm");
1786
- function xe(Y) {
1787
- if (_ = true, C = Y, S) {
1788
- const G = Qe([C, q]), te = ne(n, G);
1789
- O(te);
1790
- }
1791
- return j;
1792
- }
1793
- u(xe, "cancel1Algorithm");
1794
- function Pe(Y) {
1795
- if (S = true, q = Y, _) {
1796
- const G = Qe([C, q]), te = ne(n, G);
1797
- O(te);
1798
- }
1799
- return j;
1800
- }
1801
- u(Pe, "cancel2Algorithm");
1802
- function pe() {
1803
- }
1804
- return u(pe, "startAlgorithm"), P = et(pe, oe, xe), k = et(pe, oe, Pe), M(a._closedPromise, (Y) => (re(P._readableStreamController, Y), re(k._readableStreamController, Y), (!_ || !S) && O(void 0), null)), [P, k];
1805
- }
1806
- u(ti, "ReadableStreamDefaultTee");
1807
- function ri(n) {
1808
- let o = Fe(n), a = false, p = false, g = false, _ = false, S = false, C, q, P, k, O;
1809
- const j = z((v) => {
1810
- O = v;
1811
- });
1812
- function oe(v) {
1813
- M(v._closedPromise, (I) => (v !== o || (ee(P._readableStreamController, I), ee(k._readableStreamController, I), (!_ || !S) && O(void 0)), null));
1814
- }
1815
- u(oe, "forwardReaderError");
1816
- function xe() {
1817
- Be(o) && (ue(o), o = Fe(n), oe(o)), Ve(o, { _chunkSteps: u((I) => {
1818
- se(() => {
1819
- p = false, g = false;
1820
- const L = I;
1821
- let J = I;
1822
- if (!_ && !S) try {
1823
- J = Dr(I);
1824
- } catch (Ue) {
1825
- ee(P._readableStreamController, Ue), ee(k._readableStreamController, Ue), O(ne(n, Ue));
1826
- return;
1827
- }
1828
- _ || lt(P._readableStreamController, L), S || lt(k._readableStreamController, J), a = false, p ? pe() : g && Y();
1829
- });
1830
- }, "_chunkSteps"), _closeSteps: u(() => {
1831
- a = false, _ || Ye(P._readableStreamController), S || Ye(k._readableStreamController), P._readableStreamController._pendingPullIntos.length > 0 && ft(P._readableStreamController, 0), k._readableStreamController._pendingPullIntos.length > 0 && ft(k._readableStreamController, 0), (!_ || !S) && O(void 0);
1832
- }, "_closeSteps"), _errorSteps: u(() => {
1833
- a = false;
1834
- }, "_errorSteps") });
1835
- }
1836
- u(xe, "pullWithDefaultReader");
1837
- function Pe(v, I) {
1838
- ye(o) && (ue(o), o = Jr(n), oe(o));
1839
- const L = I ? k : P, J = I ? P : k;
1840
- tn(o, v, 1, { _chunkSteps: u((Ne) => {
1841
- se(() => {
1842
- p = false, g = false;
1843
- const He = I ? S : _;
1844
- if (I ? _ : S) He || ct(L._readableStreamController, Ne);
1845
- else {
1846
- let Ln;
1847
- try {
1848
- Ln = Dr(Ne);
1849
- } catch (_r) {
1850
- ee(L._readableStreamController, _r), ee(J._readableStreamController, _r), O(ne(n, _r));
1851
- return;
1852
- }
1853
- He || ct(L._readableStreamController, Ne), lt(J._readableStreamController, Ln);
1854
- }
1855
- a = false, p ? pe() : g && Y();
1856
- });
1857
- }, "_chunkSteps"), _closeSteps: u((Ne) => {
1858
- a = false;
1859
- const He = I ? S : _, kt = I ? _ : S;
1860
- He || Ye(L._readableStreamController), kt || Ye(J._readableStreamController), Ne !== void 0 && (He || ct(L._readableStreamController, Ne), !kt && J._readableStreamController._pendingPullIntos.length > 0 && ft(J._readableStreamController, 0)), (!He || !kt) && O(void 0);
1861
- }, "_closeSteps"), _errorSteps: u(() => {
1862
- a = false;
1863
- }, "_errorSteps") });
1864
- }
1865
- u(Pe, "pullWithBYOBReader");
1866
- function pe() {
1867
- if (a) return p = true, W(void 0);
1868
- a = true;
1869
- const v = er(P._readableStreamController);
1870
- return v === null ? xe() : Pe(v._view, false), W(void 0);
1871
- }
1872
- u(pe, "pull1Algorithm");
1873
- function Y() {
1874
- if (a) return g = true, W(void 0);
1875
- a = true;
1876
- const v = er(k._readableStreamController);
1877
- return v === null ? xe() : Pe(v._view, true), W(void 0);
1878
- }
1879
- u(Y, "pull2Algorithm");
1880
- function G(v) {
1881
- if (_ = true, C = v, S) {
1882
- const I = Qe([C, q]), L = ne(n, I);
1883
- O(L);
1884
- }
1885
- return j;
1886
- }
1887
- u(G, "cancel1Algorithm");
1888
- function te(v) {
1889
- if (S = true, q = v, _) {
1890
- const I = Qe([C, q]), L = ne(n, I);
1891
- O(L);
1892
- }
1893
- return j;
1894
- }
1895
- u(te, "cancel2Algorithm");
1896
- function be() {
1897
- }
1898
- return u(be, "startAlgorithm"), P = Cn(be, pe, G), k = Cn(be, Y, te), oe(o), [P, k];
1899
- }
1900
- u(ri, "ReadableByteStreamTee");
1901
- function ni(n) {
1902
- return b(n) && typeof n.getReader < "u";
1903
- }
1904
- u(ni, "isReadableStreamLike");
1905
- function oi(n) {
1906
- return ni(n) ? ai(n.getReader()) : ii(n);
1907
- }
1908
- u(oi, "ReadableStreamFrom");
1909
- function ii(n) {
1910
- let o;
1911
- const a = Lr(n, "async"), p = y;
1912
- function g() {
1913
- let S;
1914
- try {
1915
- S = Gn(a);
1916
- } catch (q) {
1917
- return T(q);
1918
- }
1919
- const C = W(S);
1920
- return U(C, (q) => {
1921
- if (!b(q)) throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");
1922
- if (Zn(q)) ke(o._readableStreamController);
1923
- else {
1924
- const k = Kn(q);
1925
- De(o._readableStreamController, k);
1926
- }
1927
- });
1928
- }
1929
- u(g, "pullAlgorithm");
1930
- function _(S) {
1931
- const C = a.iterator;
1932
- let q;
1933
- try {
1934
- q = at(C, "return");
1935
- } catch (O) {
1936
- return T(O);
1937
- }
1938
- if (q === void 0) return W(void 0);
1939
- let P;
1940
- try {
1941
- P = $(q, C, [S]);
1942
- } catch (O) {
1943
- return T(O);
1944
- }
1945
- const k = W(P);
1946
- return U(k, (O) => {
1947
- if (!b(O)) throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");
1948
- });
1949
- }
1950
- return u(_, "cancelAlgorithm"), o = et(p, g, _, 0), o;
1951
- }
1952
- u(ii, "ReadableStreamFromIterable");
1953
- function ai(n) {
1954
- let o;
1955
- const a = y;
1956
- function p() {
1957
- let _;
1958
- try {
1959
- _ = n.read();
1960
- } catch (S) {
1961
- return T(S);
1962
- }
1963
- return U(_, (S) => {
1964
- if (!b(S)) throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");
1965
- if (S.done) ke(o._readableStreamController);
1966
- else {
1967
- const C = S.value;
1968
- De(o._readableStreamController, C);
1969
- }
1970
- });
1971
- }
1972
- u(p, "pullAlgorithm");
1973
- function g(_) {
1974
- try {
1975
- return W(n.cancel(_));
1976
- } catch (S) {
1977
- return T(S);
1978
- }
1979
- }
1980
- return u(g, "cancelAlgorithm"), o = et(a, p, g, 0), o;
1981
- }
1982
- u(ai, "ReadableStreamFromDefaultReader");
1983
- function si(n, o) {
1984
- ie(n, o);
1985
- const a = n, p = _optionalChain([a, 'optionalAccess', _12 => _12.autoAllocateChunkSize]), g = _optionalChain([a, 'optionalAccess', _13 => _13.cancel]), _ = _optionalChain([a, 'optionalAccess', _14 => _14.pull]), S = _optionalChain([a, 'optionalAccess', _15 => _15.start]), C = _optionalChain([a, 'optionalAccess', _16 => _16.type]);
1986
- return { autoAllocateChunkSize: p === void 0 ? void 0 : Mt(p, `${o} has member 'autoAllocateChunkSize' that`), cancel: g === void 0 ? void 0 : ui(g, a, `${o} has member 'cancel' that`), pull: _ === void 0 ? void 0 : li(_, a, `${o} has member 'pull' that`), start: S === void 0 ? void 0 : fi(S, a, `${o} has member 'start' that`), type: C === void 0 ? void 0 : ci(C, `${o} has member 'type' that`) };
1987
- }
1988
- u(si, "convertUnderlyingDefaultOrByteSource");
1989
- function ui(n, o, a) {
1990
- return X(n, a), (p) => N(n, o, [p]);
1991
- }
1992
- u(ui, "convertUnderlyingSourceCancelCallback");
1993
- function li(n, o, a) {
1994
- return X(n, a), (p) => N(n, o, [p]);
1995
- }
1996
- u(li, "convertUnderlyingSourcePullCallback");
1997
- function fi(n, o, a) {
1998
- return X(n, a), (p) => $(n, o, [p]);
1999
- }
2000
- u(fi, "convertUnderlyingSourceStartCallback");
2001
- function ci(n, o) {
2002
- if (n = `${n}`, n !== "bytes") throw new TypeError(`${o} '${n}' is not a valid enumeration value for ReadableStreamType`);
2003
- return n;
2004
- }
2005
- u(ci, "convertReadableStreamType");
2006
- function di(n, o) {
2007
- return ie(n, o), { preventCancel: !!_optionalChain([n, 'optionalAccess', _17 => _17.preventCancel]) };
2008
- }
2009
- u(di, "convertIteratorOptions");
2010
- function Tn(n, o) {
2011
- ie(n, o);
2012
- const a = _optionalChain([n, 'optionalAccess', _18 => _18.preventAbort]), p = _optionalChain([n, 'optionalAccess', _19 => _19.preventCancel]), g = _optionalChain([n, 'optionalAccess', _20 => _20.preventClose]), _ = _optionalChain([n, 'optionalAccess', _21 => _21.signal]);
2013
- return _ !== void 0 && hi(_, `${o} has member 'signal' that`), { preventAbort: !!a, preventCancel: !!p, preventClose: !!g, signal: _ };
2014
- }
2015
- u(Tn, "convertPipeOptions");
2016
- function hi(n, o) {
2017
- if (!wo(n)) throw new TypeError(`${o} is not an AbortSignal.`);
2018
- }
2019
- u(hi, "assertAbortSignal");
2020
- function pi(n, o) {
2021
- ie(n, o);
2022
- const a = _optionalChain([n, 'optionalAccess', _22 => _22.readable]);
2023
- Dt(a, "readable", "ReadableWritablePair"), xt(a, `${o} has member 'readable' that`);
2024
- const p = _optionalChain([n, 'optionalAccess', _23 => _23.writable]);
2025
- return Dt(p, "writable", "ReadableWritablePair"), nn(p, `${o} has member 'writable' that`), { readable: a, writable: p };
2026
- }
2027
- u(pi, "convertReadableWritablePair");
2028
- class H {
2029
- static {
2030
- u(this, "ReadableStream");
2031
- }
2032
- constructor(o = {}, a = {}) {
2033
- o === void 0 ? o = null : Er(o, "First parameter");
2034
- const p = pt(a, "Second parameter"), g = si(o, "First parameter");
2035
- if (br(this), g.type === "bytes") {
2036
- if (p.size !== void 0) throw new RangeError("The strategy for a byte stream cannot have a size function");
2037
- const _ = Ze(p, 0);
2038
- so(this, g, _);
2039
- } else {
2040
- const _ = ht(p), S = Ze(p, 1);
2041
- Xo(this, g, S, _);
2042
- }
2043
- }
2044
- get locked() {
2045
- if (!Re(this)) throw Oe("locked");
2046
- return Te(this);
2047
- }
2048
- cancel(o = void 0) {
2049
- return Re(this) ? Te(this) ? T(new TypeError("Cannot cancel a stream that already has a reader")) : ne(this, o) : T(Oe("cancel"));
2050
- }
2051
- getReader(o = void 0) {
2052
- if (!Re(this)) throw Oe("getReader");
2053
- return lo(o, "First parameter").mode === void 0 ? Fe(this) : Jr(this);
2054
- }
2055
- pipeThrough(o, a = {}) {
2056
- if (!Re(this)) throw Oe("pipeThrough");
2057
- le(o, 1, "pipeThrough");
2058
- const p = pi(o, "First parameter"), g = Tn(a, "Second parameter");
2059
- if (Te(this)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
2060
- if (je(p.writable)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
2061
- const _ = Sn(this, p.writable, g.preventClose, g.preventAbort, g.preventCancel, g.signal);
2062
- return K(_), p.readable;
2063
- }
2064
- pipeTo(o, a = {}) {
2065
- if (!Re(this)) return T(Oe("pipeTo"));
2066
- if (o === void 0) return T("Parameter 1 is required in 'pipeTo'.");
2067
- if (!ze(o)) return T(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
2068
- let p;
2069
- try {
2070
- p = Tn(a, "Second parameter");
2071
- } catch (g) {
2072
- return T(g);
2073
- }
2074
- return Te(this) ? T(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : je(o) ? T(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : Sn(this, o, p.preventClose, p.preventAbort, p.preventCancel, p.signal);
2075
- }
2076
- tee() {
2077
- if (!Re(this)) throw Oe("tee");
2078
- const o = ei(this);
2079
- return Qe(o);
2080
- }
2081
- values(o = void 0) {
2082
- if (!Re(this)) throw Oe("values");
2083
- const a = di(o, "First parameter");
2084
- return Qn(this, a.preventCancel);
2085
- }
2086
- [Qt](o) {
2087
- return this.values(o);
2088
- }
2089
- static from(o) {
2090
- return oi(o);
2091
- }
2092
- }
2093
- Object.defineProperties(H, { from: { enumerable: true } }), Object.defineProperties(H.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), w(H.from, "from"), w(H.prototype.cancel, "cancel"), w(H.prototype.getReader, "getReader"), w(H.prototype.pipeThrough, "pipeThrough"), w(H.prototype.pipeTo, "pipeTo"), w(H.prototype.tee, "tee"), w(H.prototype.values, "values"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(H.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: true }), Object.defineProperty(H.prototype, Qt, { value: H.prototype.values, writable: true, configurable: true });
2094
- function et(n, o, a, p = 1, g = () => 1) {
2095
- const _ = Object.create(H.prototype);
2096
- br(_);
2097
- const S = Object.create(he.prototype);
2098
- return Rn(_, S, n, o, a, p, g), _;
2099
- }
2100
- u(et, "CreateReadableStream");
2101
- function Cn(n, o, a) {
2102
- const p = Object.create(H.prototype);
2103
- br(p);
2104
- const g = Object.create(ce.prototype);
2105
- return Kr(p, g, n, o, a, 0, void 0), p;
2106
- }
2107
- u(Cn, "CreateReadableByteStream");
2108
- function br(n) {
2109
- n._state = "readable", n._reader = void 0, n._storedError = void 0, n._disturbed = false;
2110
- }
2111
- u(br, "InitializeReadableStream");
2112
- function Re(n) {
2113
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_readableStreamController") ? false : n instanceof H;
2114
- }
2115
- u(Re, "IsReadableStream");
2116
- function Te(n) {
2117
- return n._reader !== void 0;
2118
- }
2119
- u(Te, "IsReadableStreamLocked");
2120
- function ne(n, o) {
2121
- if (n._disturbed = true, n._state === "closed") return W(void 0);
2122
- if (n._state === "errored") return T(n._storedError);
2123
- tt(n);
2124
- const a = n._reader;
2125
- if (a !== void 0 && Be(a)) {
2126
- const g = a._readIntoRequests;
2127
- a._readIntoRequests = new Q(), g.forEach((_) => {
2128
- _._closeSteps(void 0);
2129
- });
2130
- }
2131
- const p = n._readableStreamController[Ot](o);
2132
- return U(p, y);
2133
- }
2134
- u(ne, "ReadableStreamCancel");
2135
- function tt(n) {
2136
- n._state = "closed";
2137
- const o = n._reader;
2138
- if (o !== void 0 && (Cr(o), ye(o))) {
2139
- const a = o._readRequests;
2140
- o._readRequests = new Q(), a.forEach((p) => {
2141
- p._closeSteps();
2142
- });
2143
- }
2144
- }
2145
- u(tt, "ReadableStreamClose");
2146
- function Pn(n, o) {
2147
- n._state = "errored", n._storedError = o;
2148
- const a = n._reader;
2149
- a !== void 0 && (Lt(a, o), ye(a) ? qr(a, o) : rn(a, o));
2150
- }
2151
- u(Pn, "ReadableStreamError");
2152
- function Oe(n) {
2153
- return new TypeError(`ReadableStream.prototype.${n} can only be used on a ReadableStream`);
2154
- }
2155
- u(Oe, "streamBrandCheckException$1");
2156
- function En(n, o) {
2157
- ie(n, o);
2158
- const a = _optionalChain([n, 'optionalAccess', _24 => _24.highWaterMark]);
2159
- return Dt(a, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: $t(a) };
2160
- }
2161
- u(En, "convertQueuingStrategyInit");
2162
- const vn = u((n) => n.byteLength, "byteLengthSizeFunction");
2163
- w(vn, "size");
2164
- class Pt {
2165
- static {
2166
- u(this, "ByteLengthQueuingStrategy");
2167
- }
2168
- constructor(o) {
2169
- le(o, 1, "ByteLengthQueuingStrategy"), o = En(o, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = o.highWaterMark;
2170
- }
2171
- get highWaterMark() {
2172
- if (!Bn(this)) throw An("highWaterMark");
2173
- return this._byteLengthQueuingStrategyHighWaterMark;
2174
- }
2175
- get size() {
2176
- if (!Bn(this)) throw An("size");
2177
- return vn;
2178
- }
2179
- }
2180
- Object.defineProperties(Pt.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Pt.prototype, Symbol.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true });
2181
- function An(n) {
2182
- return new TypeError(`ByteLengthQueuingStrategy.prototype.${n} can only be used on a ByteLengthQueuingStrategy`);
2183
- }
2184
- u(An, "byteLengthBrandCheckException");
2185
- function Bn(n) {
2186
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_byteLengthQueuingStrategyHighWaterMark") ? false : n instanceof Pt;
2187
- }
2188
- u(Bn, "IsByteLengthQueuingStrategy");
2189
- const qn = u(() => 1, "countSizeFunction");
2190
- w(qn, "size");
2191
- class Et {
2192
- static {
2193
- u(this, "CountQueuingStrategy");
2194
- }
2195
- constructor(o) {
2196
- le(o, 1, "CountQueuingStrategy"), o = En(o, "First parameter"), this._countQueuingStrategyHighWaterMark = o.highWaterMark;
2197
- }
2198
- get highWaterMark() {
2199
- if (!kn(this)) throw Wn("highWaterMark");
2200
- return this._countQueuingStrategyHighWaterMark;
2201
- }
2202
- get size() {
2203
- if (!kn(this)) throw Wn("size");
2204
- return qn;
2205
- }
2206
- }
2207
- Object.defineProperties(Et.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Et.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true });
2208
- function Wn(n) {
2209
- return new TypeError(`CountQueuingStrategy.prototype.${n} can only be used on a CountQueuingStrategy`);
2210
- }
2211
- u(Wn, "countBrandCheckException");
2212
- function kn(n) {
2213
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_countQueuingStrategyHighWaterMark") ? false : n instanceof Et;
2214
- }
2215
- u(kn, "IsCountQueuingStrategy");
2216
- function bi(n, o) {
2217
- ie(n, o);
2218
- const a = _optionalChain([n, 'optionalAccess', _25 => _25.cancel]), p = _optionalChain([n, 'optionalAccess', _26 => _26.flush]), g = _optionalChain([n, 'optionalAccess', _27 => _27.readableType]), _ = _optionalChain([n, 'optionalAccess', _28 => _28.start]), S = _optionalChain([n, 'optionalAccess', _29 => _29.transform]), C = _optionalChain([n, 'optionalAccess', _30 => _30.writableType]);
2219
- return { cancel: a === void 0 ? void 0 : _i(a, n, `${o} has member 'cancel' that`), flush: p === void 0 ? void 0 : mi(p, n, `${o} has member 'flush' that`), readableType: g, start: _ === void 0 ? void 0 : yi(_, n, `${o} has member 'start' that`), transform: S === void 0 ? void 0 : gi(S, n, `${o} has member 'transform' that`), writableType: C };
2220
- }
2221
- u(bi, "convertTransformer");
2222
- function mi(n, o, a) {
2223
- return X(n, a), (p) => N(n, o, [p]);
2224
- }
2225
- u(mi, "convertTransformerFlushCallback");
2226
- function yi(n, o, a) {
2227
- return X(n, a), (p) => $(n, o, [p]);
2228
- }
2229
- u(yi, "convertTransformerStartCallback");
2230
- function gi(n, o, a) {
2231
- return X(n, a), (p, g) => N(n, o, [p, g]);
2232
- }
2233
- u(gi, "convertTransformerTransformCallback");
2234
- function _i(n, o, a) {
2235
- return X(n, a), (p) => N(n, o, [p]);
2236
- }
2237
- u(_i, "convertTransformerCancelCallback");
2238
- class vt {
2239
- static {
2240
- u(this, "TransformStream");
2241
- }
2242
- constructor(o = {}, a = {}, p = {}) {
2243
- o === void 0 && (o = null);
2244
- const g = pt(a, "Second parameter"), _ = pt(p, "Third parameter"), S = bi(o, "First parameter");
2245
- if (S.readableType !== void 0) throw new RangeError("Invalid readableType specified");
2246
- if (S.writableType !== void 0) throw new RangeError("Invalid writableType specified");
2247
- const C = Ze(_, 0), q = ht(_), P = Ze(g, 1), k = ht(g);
2248
- let O;
2249
- const j = z((oe) => {
2250
- O = oe;
2251
- });
2252
- Si(this, j, P, k, C, q), Ri(this, S), S.start !== void 0 ? O(S.start(this._transformStreamController)) : O(void 0);
2253
- }
2254
- get readable() {
2255
- if (!On(this)) throw jn("readable");
2256
- return this._readable;
2257
- }
2258
- get writable() {
2259
- if (!On(this)) throw jn("writable");
2260
- return this._writable;
2261
- }
2262
- }
2263
- Object.defineProperties(vt.prototype, { readable: { enumerable: true }, writable: { enumerable: true } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(vt.prototype, Symbol.toStringTag, { value: "TransformStream", configurable: true });
2264
- function Si(n, o, a, p, g, _) {
2265
- function S() {
2266
- return o;
2267
- }
2268
- u(S, "startAlgorithm");
2269
- function C(j) {
2270
- return Pi(n, j);
2271
- }
2272
- u(C, "writeAlgorithm");
2273
- function q(j) {
2274
- return Ei(n, j);
2275
- }
2276
- u(q, "abortAlgorithm");
2277
- function P() {
2278
- return vi(n);
2279
- }
2280
- u(P, "closeAlgorithm"), n._writable = Co(S, C, P, q, a, p);
2281
- function k() {
2282
- return Ai(n);
2283
- }
2284
- u(k, "pullAlgorithm");
2285
- function O(j) {
2286
- return Bi(n, j);
2287
- }
2288
- u(O, "cancelAlgorithm"), n._readable = et(S, k, O, g, _), n._backpressure = void 0, n._backpressureChangePromise = void 0, n._backpressureChangePromise_resolve = void 0, At(n, true), n._transformStreamController = void 0;
2289
- }
2290
- u(Si, "InitializeTransformStream");
2291
- function On(n) {
2292
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_transformStreamController") ? false : n instanceof vt;
2293
- }
2294
- u(On, "IsTransformStream");
2295
- function Fn(n, o) {
2296
- re(n._readable._readableStreamController, o), mr(n, o);
2297
- }
2298
- u(Fn, "TransformStreamError");
2299
- function mr(n, o) {
2300
- qt(n._transformStreamController), Ke(n._writable._writableStreamController, o), yr(n);
2301
- }
2302
- u(mr, "TransformStreamErrorWritableAndUnblockWrite");
2303
- function yr(n) {
2304
- n._backpressure && At(n, false);
2305
- }
2306
- u(yr, "TransformStreamUnblockWrite");
2307
- function At(n, o) {
2308
- n._backpressureChangePromise !== void 0 && n._backpressureChangePromise_resolve(), n._backpressureChangePromise = z((a) => {
2309
- n._backpressureChangePromise_resolve = a;
2310
- }), n._backpressure = o;
2311
- }
2312
- u(At, "TransformStreamSetBackpressure");
2313
- class Ce {
2314
- static {
2315
- u(this, "TransformStreamDefaultController");
2316
- }
2317
- constructor() {
2318
- throw new TypeError("Illegal constructor");
2319
- }
2320
- get desiredSize() {
2321
- if (!Bt(this)) throw Wt("desiredSize");
2322
- const o = this._controlledTransformStream._readable._readableStreamController;
2323
- return pr(o);
2324
- }
2325
- enqueue(o = void 0) {
2326
- if (!Bt(this)) throw Wt("enqueue");
2327
- In(this, o);
2328
- }
2329
- error(o = void 0) {
2330
- if (!Bt(this)) throw Wt("error");
2331
- Ti(this, o);
2332
- }
2333
- terminate() {
2334
- if (!Bt(this)) throw Wt("terminate");
2335
- Ci(this);
2336
- }
2337
- }
2338
- Object.defineProperties(Ce.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), w(Ce.prototype.enqueue, "enqueue"), w(Ce.prototype.error, "error"), w(Ce.prototype.terminate, "terminate"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Ce.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: true });
2339
- function Bt(n) {
2340
- return !b(n) || !Object.prototype.hasOwnProperty.call(n, "_controlledTransformStream") ? false : n instanceof Ce;
2341
- }
2342
- u(Bt, "IsTransformStreamDefaultController");
2343
- function wi(n, o, a, p, g) {
2344
- o._controlledTransformStream = n, n._transformStreamController = o, o._transformAlgorithm = a, o._flushAlgorithm = p, o._cancelAlgorithm = g, o._finishPromise = void 0, o._finishPromise_resolve = void 0, o._finishPromise_reject = void 0;
2345
- }
2346
- u(wi, "SetUpTransformStreamDefaultController");
2347
- function Ri(n, o) {
2348
- const a = Object.create(Ce.prototype);
2349
- let p, g, _;
2350
- o.transform !== void 0 ? p = u((S) => o.transform(S, a), "transformAlgorithm") : p = u((S) => {
2351
- try {
2352
- return In(a, S), W(void 0);
2353
- } catch (C) {
2354
- return T(C);
2355
- }
2356
- }, "transformAlgorithm"), o.flush !== void 0 ? g = u(() => o.flush(a), "flushAlgorithm") : g = u(() => W(void 0), "flushAlgorithm"), o.cancel !== void 0 ? _ = u((S) => o.cancel(S), "cancelAlgorithm") : _ = u(() => W(void 0), "cancelAlgorithm"), wi(n, a, p, g, _);
2357
- }
2358
- u(Ri, "SetUpTransformStreamDefaultControllerFromTransformer");
2359
- function qt(n) {
2360
- n._transformAlgorithm = void 0, n._flushAlgorithm = void 0, n._cancelAlgorithm = void 0;
2361
- }
2362
- u(qt, "TransformStreamDefaultControllerClearAlgorithms");
2363
- function In(n, o) {
2364
- const a = n._controlledTransformStream, p = a._readable._readableStreamController;
2365
- if (!$e(p)) throw new TypeError("Readable side is not in a state that permits enqueue");
2366
- try {
2367
- De(p, o);
2368
- } catch (_) {
2369
- throw mr(a, _), a._readable._storedError;
2370
- }
2371
- Jo(p) !== a._backpressure && At(a, true);
2372
- }
2373
- u(In, "TransformStreamDefaultControllerEnqueue");
2374
- function Ti(n, o) {
2375
- Fn(n._controlledTransformStream, o);
2376
- }
2377
- u(Ti, "TransformStreamDefaultControllerError");
2378
- function zn(n, o) {
2379
- const a = n._transformAlgorithm(o);
2380
- return U(a, void 0, (p) => {
2381
- throw Fn(n._controlledTransformStream, p), p;
2382
- });
2383
- }
2384
- u(zn, "TransformStreamDefaultControllerPerformTransform");
2385
- function Ci(n) {
2386
- const o = n._controlledTransformStream, a = o._readable._readableStreamController;
2387
- ke(a);
2388
- const p = new TypeError("TransformStream terminated");
2389
- mr(o, p);
2390
- }
2391
- u(Ci, "TransformStreamDefaultControllerTerminate");
2392
- function Pi(n, o) {
2393
- const a = n._transformStreamController;
2394
- if (n._backpressure) {
2395
- const p = n._backpressureChangePromise;
2396
- return U(p, () => {
2397
- const g = n._writable;
2398
- if (g._state === "erroring") throw g._storedError;
2399
- return zn(a, o);
2400
- });
2401
- }
2402
- return zn(a, o);
2403
- }
2404
- u(Pi, "TransformStreamDefaultSinkWriteAlgorithm");
2405
- function Ei(n, o) {
2406
- const a = n._transformStreamController;
2407
- if (a._finishPromise !== void 0) return a._finishPromise;
2408
- const p = n._readable;
2409
- a._finishPromise = z((_, S) => {
2410
- a._finishPromise_resolve = _, a._finishPromise_reject = S;
2411
- });
2412
- const g = a._cancelAlgorithm(o);
2413
- return qt(a), E(g, () => (p._state === "errored" ? Me(a, p._storedError) : (re(p._readableStreamController, o), gr(a)), null), (_) => (re(p._readableStreamController, _), Me(a, _), null)), a._finishPromise;
2414
- }
2415
- u(Ei, "TransformStreamDefaultSinkAbortAlgorithm");
2416
- function vi(n) {
2417
- const o = n._transformStreamController;
2418
- if (o._finishPromise !== void 0) return o._finishPromise;
2419
- const a = n._readable;
2420
- o._finishPromise = z((g, _) => {
2421
- o._finishPromise_resolve = g, o._finishPromise_reject = _;
2422
- });
2423
- const p = o._flushAlgorithm();
2424
- return qt(o), E(p, () => (a._state === "errored" ? Me(o, a._storedError) : (ke(a._readableStreamController), gr(o)), null), (g) => (re(a._readableStreamController, g), Me(o, g), null)), o._finishPromise;
2425
- }
2426
- u(vi, "TransformStreamDefaultSinkCloseAlgorithm");
2427
- function Ai(n) {
2428
- return At(n, false), n._backpressureChangePromise;
2429
- }
2430
- u(Ai, "TransformStreamDefaultSourcePullAlgorithm");
2431
- function Bi(n, o) {
2432
- const a = n._transformStreamController;
2433
- if (a._finishPromise !== void 0) return a._finishPromise;
2434
- const p = n._writable;
2435
- a._finishPromise = z((_, S) => {
2436
- a._finishPromise_resolve = _, a._finishPromise_reject = S;
2437
- });
2438
- const g = a._cancelAlgorithm(o);
2439
- return qt(a), E(g, () => (p._state === "errored" ? Me(a, p._storedError) : (Ke(p._writableStreamController, o), yr(n), gr(a)), null), (_) => (Ke(p._writableStreamController, _), yr(n), Me(a, _), null)), a._finishPromise;
2440
- }
2441
- u(Bi, "TransformStreamDefaultSourceCancelAlgorithm");
2442
- function Wt(n) {
2443
- return new TypeError(`TransformStreamDefaultController.prototype.${n} can only be used on a TransformStreamDefaultController`);
2444
- }
2445
- u(Wt, "defaultControllerBrandCheckException");
2446
- function gr(n) {
2447
- n._finishPromise_resolve !== void 0 && (n._finishPromise_resolve(), n._finishPromise_resolve = void 0, n._finishPromise_reject = void 0);
2448
- }
2449
- u(gr, "defaultControllerFinishPromiseResolve");
2450
- function Me(n, o) {
2451
- n._finishPromise_reject !== void 0 && (K(n._finishPromise), n._finishPromise_reject(o), n._finishPromise_resolve = void 0, n._finishPromise_reject = void 0);
2452
- }
2453
- u(Me, "defaultControllerFinishPromiseReject");
2454
- function jn(n) {
2455
- return new TypeError(`TransformStream.prototype.${n} can only be used on a TransformStream`);
2456
- }
2457
- u(jn, "streamBrandCheckException"), d.ByteLengthQueuingStrategy = Pt, d.CountQueuingStrategy = Et, d.ReadableByteStreamController = ce, d.ReadableStream = H, d.ReadableStreamBYOBReader = Se, d.ReadableStreamBYOBRequest = Ee, d.ReadableStreamDefaultController = he, d.ReadableStreamDefaultReader = me, d.TransformStream = vt, d.TransformStreamDefaultController = Ce, d.WritableStream = we, d.WritableStreamDefaultController = Le, d.WritableStreamDefaultWriter = de;
2458
- });
2459
- }(ponyfill_es2018$1, ponyfill_es2018$1.exports)), ponyfill_es2018$1.exports;
2460
- }
2461
- u(requirePonyfill_es2018, "requirePonyfill_es2018");
2462
- var hasRequiredStreams;
2463
- function requireStreams() {
2464
- if (hasRequiredStreams) return streams;
2465
- hasRequiredStreams = 1;
2466
- const c = 65536;
2467
- if (!globalThis.ReadableStream) try {
2468
- const l = _chunkIG6EXAQUcjs.__require.call(void 0, "process"), { emitWarning: d } = l;
2469
- try {
2470
- l.emitWarning = () => {
2471
- }, Object.assign(globalThis, _chunkIG6EXAQUcjs.__require.call(void 0, "stream/web")), l.emitWarning = d;
2472
- } catch (y) {
2473
- throw l.emitWarning = d, y;
2474
- }
2475
- } catch (e6) {
2476
- Object.assign(globalThis, requirePonyfill_es2018());
2477
- }
2478
- try {
2479
- const { Blob: l } = _chunkIG6EXAQUcjs.__require.call(void 0, "buffer");
2480
- l && !l.prototype.stream && (l.prototype.stream = u(function(y) {
2481
- let b = 0;
2482
- const R = this;
2483
- return new ReadableStream({ type: "bytes", async pull(w) {
2484
- const F = await R.slice(b, Math.min(R.size, b + c)).arrayBuffer();
2485
- b += F.byteLength, w.enqueue(new Uint8Array(F)), b === R.size && w.close();
2486
- } });
2487
- }, "name"));
2488
- } catch (e7) {
2489
- }
2490
- return streams;
2491
- }
2492
- u(requireStreams, "requireStreams"), requireStreams();
2493
- var POOL_SIZE = 65536;
2494
- async function* toIterator(c, l = true) {
2495
- for (const d of c) if ("stream" in d) yield* d.stream();
2496
- else if (ArrayBuffer.isView(d)) if (l) {
2497
- let y = d.byteOffset;
2498
- const b = d.byteOffset + d.byteLength;
2499
- for (; y !== b; ) {
2500
- const R = Math.min(b - y, POOL_SIZE), w = d.buffer.slice(y, y + R);
2501
- y += w.byteLength, yield new Uint8Array(w);
2502
- }
2503
- } else yield d;
2504
- else {
2505
- let y = 0, b = d;
2506
- for (; y !== b.size; ) {
2507
- const w = await b.slice(y, Math.min(b.size, y + POOL_SIZE)).arrayBuffer();
2508
- y += w.byteLength, yield new Uint8Array(w);
2509
- }
2510
- }
2511
- }
2512
- u(toIterator, "toIterator");
2513
- var _Blob = class Sr {
2514
- static {
2515
- u(this, "Blob");
2516
- }
2517
- #e = [];
2518
- #t = "";
2519
- #r = 0;
2520
- #n = "transparent";
2521
- constructor(l = [], d = {}) {
2522
- if (typeof l != "object" || l === null) throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
2523
- if (typeof l[Symbol.iterator] != "function") throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");
2524
- if (typeof d != "object" && typeof d != "function") throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");
2525
- d === null && (d = {});
2526
- const y = new TextEncoder();
2527
- for (const R of l) {
2528
- let w;
2529
- ArrayBuffer.isView(R) ? w = new Uint8Array(R.buffer.slice(R.byteOffset, R.byteOffset + R.byteLength)) : R instanceof ArrayBuffer ? w = new Uint8Array(R.slice(0)) : R instanceof Sr ? w = R : w = y.encode(`${R}`), this.#r += ArrayBuffer.isView(w) ? w.byteLength : w.size, this.#e.push(w);
2530
- }
2531
- this.#n = `${d.endings === void 0 ? "transparent" : d.endings}`;
2532
- const b = d.type === void 0 ? "" : String(d.type);
2533
- this.#t = /^[\x20-\x7E]*$/.test(b) ? b : "";
2534
- }
2535
- get size() {
2536
- return this.#r;
2537
- }
2538
- get type() {
2539
- return this.#t;
2540
- }
2541
- async text() {
2542
- const l = new TextDecoder();
2543
- let d = "";
2544
- for await (const y of toIterator(this.#e, false)) d += l.decode(y, { stream: true });
2545
- return d += l.decode(), d;
2546
- }
2547
- async arrayBuffer() {
2548
- const l = new Uint8Array(this.size);
2549
- let d = 0;
2550
- for await (const y of toIterator(this.#e, false)) l.set(y, d), d += y.length;
2551
- return l.buffer;
2552
- }
2553
- stream() {
2554
- const l = toIterator(this.#e, true);
2555
- return new globalThis.ReadableStream({ type: "bytes", async pull(d) {
2556
- const y = await l.next();
2557
- y.done ? d.close() : d.enqueue(y.value);
2558
- }, async cancel() {
2559
- await l.return();
2560
- } });
2561
- }
2562
- slice(l = 0, d = this.size, y = "") {
2563
- const { size: b } = this;
2564
- let R = l < 0 ? Math.max(b + l, 0) : Math.min(l, b), w = d < 0 ? Math.max(b + d, 0) : Math.min(d, b);
2565
- const A = Math.max(w - R, 0), F = this.#e, B = [];
2566
- let z = 0;
2567
- for (const T of F) {
2568
- if (z >= A) break;
2569
- const D = ArrayBuffer.isView(T) ? T.byteLength : T.size;
2570
- if (R && D <= R) R -= D, w -= D;
2571
- else {
2572
- let E;
2573
- ArrayBuffer.isView(T) ? (E = T.subarray(R, Math.min(D, w)), z += E.byteLength) : (E = T.slice(R, Math.min(D, w)), z += E.size), w -= D, B.push(E), R = 0;
2574
- }
2575
- }
2576
- const W = new Sr([], { type: String(y).toLowerCase() });
2577
- return W.#r = A, W.#e = B, W;
2578
- }
2579
- get [Symbol.toStringTag]() {
2580
- return "Blob";
2581
- }
2582
- static [Symbol.hasInstance](l) {
2583
- return l && typeof l == "object" && typeof l.constructor == "function" && (typeof l.stream == "function" || typeof l.arrayBuffer == "function") && /^(Blob|File)$/.test(l[Symbol.toStringTag]);
2584
- }
2585
- };
2586
- Object.defineProperties(_Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } });
2587
- var Blob = _Blob;
2588
- var _File = class extends Blob {
2589
- static {
2590
- u(this, "File");
2591
- }
2592
- #e = 0;
2593
- #t = "";
2594
- constructor(l, d, y = {}) {
2595
- if (arguments.length < 2) throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
2596
- super(l, y), y === null && (y = {});
2597
- const b = y.lastModified === void 0 ? Date.now() : Number(y.lastModified);
2598
- Number.isNaN(b) || (this.#e = b), this.#t = String(d);
2599
- }
2600
- get name() {
2601
- return this.#t;
2602
- }
2603
- get lastModified() {
2604
- return this.#e;
2605
- }
2606
- get [Symbol.toStringTag]() {
2607
- return "File";
2608
- }
2609
- static [Symbol.hasInstance](l) {
2610
- return !!l && l instanceof Blob && /^(File)$/.test(l[Symbol.toStringTag]);
2611
- }
2612
- };
2613
- var File = _File;
2614
- var { toStringTag: t$1, iterator: i, hasInstance: h } = Symbol;
2615
- var r = Math.random;
2616
- var m = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(",");
2617
- var f = u((c, l, d) => (c += "", /^(Blob|File)$/.test(l && l[t$1]) ? [(d = d !== void 0 ? d + "" : l[t$1] == "File" ? l.name : "blob", c), l.name !== d || l[t$1] == "blob" ? new File([l], d, l) : l] : [c, l + ""]), "f");
2618
- var e$1 = u((c, l) => (l ? c : c.replace(/\r?\n|\r/g, `\r
2619
- `)).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "e$1");
2620
- var x = u((c, l, d) => {
2621
- if (l.length < d) throw new TypeError(`Failed to execute '${c}' on 'FormData': ${d} arguments required, but only ${l.length} present.`);
2622
- }, "x");
2623
- var FormData = class {
2624
- static {
2625
- u(this, "FormData");
2626
- }
2627
- #e = [];
2628
- constructor(...l) {
2629
- if (l.length) throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.");
2630
- }
2631
- get [t$1]() {
2632
- return "FormData";
2633
- }
2634
- [i]() {
2635
- return this.entries();
2636
- }
2637
- static [h](l) {
2638
- return l && typeof l == "object" && l[t$1] === "FormData" && !m.some((d) => typeof l[d] != "function");
2639
- }
2640
- append(...l) {
2641
- x("append", arguments, 2), this.#e.push(f(...l));
2642
- }
2643
- delete(l) {
2644
- x("delete", arguments, 1), l += "", this.#e = this.#e.filter(([d]) => d !== l);
2645
- }
2646
- get(l) {
2647
- x("get", arguments, 1), l += "";
2648
- for (var d = this.#e, y = d.length, b = 0; b < y; b++) if (d[b][0] === l) return d[b][1];
2649
- return null;
2650
- }
2651
- getAll(l, d) {
2652
- return x("getAll", arguments, 1), d = [], l += "", this.#e.forEach((y) => y[0] === l && d.push(y[1])), d;
2653
- }
2654
- has(l) {
2655
- return x("has", arguments, 1), l += "", this.#e.some((d) => d[0] === l);
2656
- }
2657
- forEach(l, d) {
2658
- x("forEach", arguments, 1);
2659
- for (var [y, b] of this) l.call(d, b, y, this);
2660
- }
2661
- set(...l) {
2662
- x("set", arguments, 2);
2663
- var d = [], y = true;
2664
- l = f(...l), this.#e.forEach((b) => {
2665
- b[0] === l[0] ? y && (y = !d.push(l)) : d.push(b);
2666
- }), y && d.push(l), this.#e = d;
2667
- }
2668
- *entries() {
2669
- yield* this.#e;
2670
- }
2671
- *keys() {
2672
- for (var [l] of this) yield l;
2673
- }
2674
- *values() {
2675
- for (var [, l] of this) yield l;
2676
- }
2677
- };
2678
- function formDataToBlob(c, l = Blob) {
2679
- var d = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), y = [], b = `--${d}\r
2680
- Content-Disposition: form-data; name="`;
2681
- return c.forEach((R, w) => typeof R == "string" ? y.push(b + e$1(w) + `"\r
2682
- \r
2683
- ${R.replace(/\r(?!\n)|(?<!\r)\n/g, `\r
2684
- `)}\r
2685
- `) : y.push(b + e$1(w) + `"; filename="${e$1(R.name, 1)}"\r
2686
- Content-Type: ${R.type || "application/octet-stream"}\r
2687
- \r
2688
- `, R, `\r
2689
- `)), y.push(`--${d}--`), new l(y, { type: "multipart/form-data; boundary=" + d });
2690
- }
2691
- u(formDataToBlob, "formDataToBlob");
2692
- var FetchBaseError = class extends Error {
2693
- static {
2694
- u(this, "FetchBaseError");
2695
- }
2696
- constructor(l, d) {
2697
- super(l), Error.captureStackTrace(this, this.constructor), this.type = d;
2698
- }
2699
- get name() {
2700
- return this.constructor.name;
2701
- }
2702
- get [Symbol.toStringTag]() {
2703
- return this.constructor.name;
2704
- }
2705
- };
2706
- var FetchError = class extends FetchBaseError {
2707
- static {
2708
- u(this, "FetchError");
2709
- }
2710
- constructor(l, d, y) {
2711
- super(l, d), y && (this.code = this.errno = y.code, this.erroredSysCall = y.syscall);
2712
- }
2713
- };
2714
- var NAME = Symbol.toStringTag;
2715
- var isURLSearchParameters = u((c) => typeof c == "object" && typeof c.append == "function" && typeof c.delete == "function" && typeof c.get == "function" && typeof c.getAll == "function" && typeof c.has == "function" && typeof c.set == "function" && typeof c.sort == "function" && c[NAME] === "URLSearchParams", "isURLSearchParameters");
2716
- var isBlob = u((c) => c && typeof c == "object" && typeof c.arrayBuffer == "function" && typeof c.type == "string" && typeof c.stream == "function" && typeof c.constructor == "function" && /^(Blob|File)$/.test(c[NAME]), "isBlob");
2717
- var isAbortSignal = u((c) => typeof c == "object" && (c[NAME] === "AbortSignal" || c[NAME] === "EventTarget"), "isAbortSignal");
2718
- var isDomainOrSubdomain = u((c, l) => {
2719
- const d = new URL(l).hostname, y = new URL(c).hostname;
2720
- return d === y || d.endsWith(`.${y}`);
2721
- }, "isDomainOrSubdomain");
2722
- var isSameProtocol = u((c, l) => {
2723
- const d = new URL(l).protocol, y = new URL(c).protocol;
2724
- return d === y;
2725
- }, "isSameProtocol");
2726
- var pipeline = require$$0$1.promisify(Stream__default.pipeline);
2727
- var INTERNALS$2 = Symbol("Body internals");
2728
- var Body = class {
2729
- static {
2730
- u(this, "Body");
2731
- }
2732
- constructor(l, { size: d = 0 } = {}) {
2733
- let y = null;
2734
- l === null ? l = null : isURLSearchParameters(l) ? l = require$$0.Buffer.from(l.toString()) : isBlob(l) || require$$0.Buffer.isBuffer(l) || (require$$0$1.types.isAnyArrayBuffer(l) ? l = require$$0.Buffer.from(l) : ArrayBuffer.isView(l) ? l = require$$0.Buffer.from(l.buffer, l.byteOffset, l.byteLength) : l instanceof Stream__default || (l instanceof FormData ? (l = formDataToBlob(l), y = l.type.split("=")[1]) : l = require$$0.Buffer.from(String(l))));
2735
- let b = l;
2736
- require$$0.Buffer.isBuffer(l) ? b = Stream__default.Readable.from(l) : isBlob(l) && (b = Stream__default.Readable.from(l.stream())), this[INTERNALS$2] = { body: l, stream: b, boundary: y, disturbed: false, error: null }, this.size = d, l instanceof Stream__default && l.on("error", (R) => {
2737
- const w = R instanceof FetchBaseError ? R : new FetchError(`Invalid response body while trying to fetch ${this.url}: ${R.message}`, "system", R);
2738
- this[INTERNALS$2].error = w;
2739
- });
2740
- }
2741
- get body() {
2742
- return this[INTERNALS$2].stream;
2743
- }
2744
- get bodyUsed() {
2745
- return this[INTERNALS$2].disturbed;
2746
- }
2747
- async arrayBuffer() {
2748
- const { buffer: l, byteOffset: d, byteLength: y } = await consumeBody(this);
2749
- return l.slice(d, d + y);
2750
- }
2751
- async formData() {
2752
- const l = this.headers.get("content-type");
2753
- if (l.startsWith("application/x-www-form-urlencoded")) {
2754
- const y = new FormData(), b = new URLSearchParams(await this.text());
2755
- for (const [R, w] of b) y.append(R, w);
2756
- return y;
2757
- }
2758
- const { toFormData: d } = await Promise.resolve().then(() => _interopRequireWildcard(require("./multipart-parser-HT3QRMAQ.cjs")));
2759
- return d(this.body, l);
2760
- }
2761
- async blob() {
2762
- const l = this.headers && this.headers.get("content-type") || this[INTERNALS$2].body && this[INTERNALS$2].body.type || "", d = await this.arrayBuffer();
2763
- return new Blob([d], { type: l });
2764
- }
2765
- async json() {
2766
- const l = await this.text();
2767
- return JSON.parse(l);
2768
- }
2769
- async text() {
2770
- const l = await consumeBody(this);
2771
- return new TextDecoder().decode(l);
2772
- }
2773
- buffer() {
2774
- return consumeBody(this);
2775
- }
2776
- };
2777
- Body.prototype.buffer = require$$0$1.deprecate(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer"), Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, data: { get: require$$0$1.deprecate(() => {
2778
- }, "data doesn't exist, use json(), text(), arrayBuffer(), or body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (response)") } });
2779
- async function consumeBody(c) {
2780
- if (c[INTERNALS$2].disturbed) throw new TypeError(`body used already for: ${c.url}`);
2781
- if (c[INTERNALS$2].disturbed = true, c[INTERNALS$2].error) throw c[INTERNALS$2].error;
2782
- const { body: l } = c;
2783
- if (l === null || !(l instanceof Stream__default)) return require$$0.Buffer.alloc(0);
2784
- const d = [];
2785
- let y = 0;
2786
- try {
2787
- for await (const b of l) {
2788
- if (c.size > 0 && y + b.length > c.size) {
2789
- const R = new FetchError(`content size at ${c.url} over limit: ${c.size}`, "max-size");
2790
- throw l.destroy(R), R;
2791
- }
2792
- y += b.length, d.push(b);
2793
- }
2794
- } catch (b) {
2795
- throw b instanceof FetchBaseError ? b : new FetchError(`Invalid response body while trying to fetch ${c.url}: ${b.message}`, "system", b);
2796
- }
2797
- if (l.readableEnded === true || l._readableState.ended === true) try {
2798
- return d.every((b) => typeof b == "string") ? require$$0.Buffer.from(d.join("")) : require$$0.Buffer.concat(d, y);
2799
- } catch (b) {
2800
- throw new FetchError(`Could not create Buffer from response body for ${c.url}: ${b.message}`, "system", b);
2801
- }
2802
- else throw new FetchError(`Premature close of server response while trying to fetch ${c.url}`);
2803
- }
2804
- u(consumeBody, "consumeBody");
2805
- var clone = u((c, l) => {
2806
- let d, y, { body: b } = c[INTERNALS$2];
2807
- if (c.bodyUsed) throw new Error("cannot clone body after it is used");
2808
- return b instanceof Stream__default && typeof b.getBoundary != "function" && (d = new Stream.PassThrough({ highWaterMark: l }), y = new Stream.PassThrough({ highWaterMark: l }), b.pipe(d), b.pipe(y), c[INTERNALS$2].stream = d, b = y), b;
2809
- }, "clone");
2810
- var getNonSpecFormDataBoundary = require$$0$1.deprecate((c) => c.getBoundary(), "form-data doesn't follow the spec and requires special treatment. Use alternative package", "https://github.com/node-fetch/node-fetch/issues/1167");
2811
- var extractContentType = u((c, l) => c === null ? null : typeof c == "string" ? "text/plain;charset=UTF-8" : isURLSearchParameters(c) ? "application/x-www-form-urlencoded;charset=UTF-8" : isBlob(c) ? c.type || null : require$$0.Buffer.isBuffer(c) || require$$0$1.types.isAnyArrayBuffer(c) || ArrayBuffer.isView(c) ? null : c instanceof FormData ? `multipart/form-data; boundary=${l[INTERNALS$2].boundary}` : c && typeof c.getBoundary == "function" ? `multipart/form-data;boundary=${getNonSpecFormDataBoundary(c)}` : c instanceof Stream__default ? null : "text/plain;charset=UTF-8", "extractContentType");
2812
- var getTotalBytes = u((c) => {
2813
- const { body: l } = c[INTERNALS$2];
2814
- return l === null ? 0 : isBlob(l) ? l.size : require$$0.Buffer.isBuffer(l) ? l.length : l && typeof l.getLengthSync == "function" && l.hasKnownLength && l.hasKnownLength() ? l.getLengthSync() : null;
2815
- }, "getTotalBytes");
2816
- var writeToStream = u(async (c, { body: l }) => {
2817
- l === null ? c.end() : await pipeline(l, c);
2818
- }, "writeToStream");
2819
- var validateHeaderName = typeof http__default.validateHeaderName == "function" ? http__default.validateHeaderName : (c) => {
2820
- if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(c)) {
2821
- const l = new TypeError(`Header name must be a valid HTTP token [${c}]`);
2822
- throw Object.defineProperty(l, "code", { value: "ERR_INVALID_HTTP_TOKEN" }), l;
2823
- }
2824
- };
2825
- var validateHeaderValue = typeof http__default.validateHeaderValue == "function" ? http__default.validateHeaderValue : (c, l) => {
2826
- if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(l)) {
2827
- const d = new TypeError(`Invalid character in header content ["${c}"]`);
2828
- throw Object.defineProperty(d, "code", { value: "ERR_INVALID_CHAR" }), d;
2829
- }
2830
- };
2831
- var Headers = class _Headers extends URLSearchParams {
2832
- static {
2833
- u(this, "Headers");
2834
- }
2835
- constructor(l) {
2836
- let d = [];
2837
- if (l instanceof _Headers) {
2838
- const y = l.raw();
2839
- for (const [b, R] of Object.entries(y)) d.push(...R.map((w) => [b, w]));
2840
- } else if (l != null) if (typeof l == "object" && !require$$0$1.types.isBoxedPrimitive(l)) {
2841
- const y = l[Symbol.iterator];
2842
- if (y == null) d.push(...Object.entries(l));
2843
- else {
2844
- if (typeof y != "function") throw new TypeError("Header pairs must be iterable");
2845
- d = [...l].map((b) => {
2846
- if (typeof b != "object" || require$$0$1.types.isBoxedPrimitive(b)) throw new TypeError("Each header pair must be an iterable object");
2847
- return [...b];
2848
- }).map((b) => {
2849
- if (b.length !== 2) throw new TypeError("Each header pair must be a name/value tuple");
2850
- return [...b];
2851
- });
2852
- }
2853
- } else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
2854
- return d = d.length > 0 ? d.map(([y, b]) => (validateHeaderName(y), validateHeaderValue(y, String(b)), [String(y).toLowerCase(), String(b)])) : void 0, super(d), new Proxy(this, { get(y, b, R) {
2855
- switch (b) {
2856
- case "append":
2857
- case "set":
2858
- return (w, A) => (validateHeaderName(w), validateHeaderValue(w, String(A)), URLSearchParams.prototype[b].call(y, String(w).toLowerCase(), String(A)));
2859
- case "delete":
2860
- case "has":
2861
- case "getAll":
2862
- return (w) => (validateHeaderName(w), URLSearchParams.prototype[b].call(y, String(w).toLowerCase()));
2863
- case "keys":
2864
- return () => (y.sort(), new Set(URLSearchParams.prototype.keys.call(y)).keys());
2865
- default:
2866
- return Reflect.get(y, b, R);
2867
- }
2868
- } });
2869
- }
2870
- get [Symbol.toStringTag]() {
2871
- return this.constructor.name;
2872
- }
2873
- toString() {
2874
- return Object.prototype.toString.call(this);
2875
- }
2876
- get(l) {
2877
- const d = this.getAll(l);
2878
- if (d.length === 0) return null;
2879
- let y = d.join(", ");
2880
- return /^content-encoding$/i.test(l) && (y = y.toLowerCase()), y;
2881
- }
2882
- forEach(l, d = void 0) {
2883
- for (const y of this.keys()) Reflect.apply(l, d, [this.get(y), y, this]);
2884
- }
2885
- *values() {
2886
- for (const l of this.keys()) yield this.get(l);
2887
- }
2888
- *entries() {
2889
- for (const l of this.keys()) yield [l, this.get(l)];
2890
- }
2891
- [Symbol.iterator]() {
2892
- return this.entries();
2893
- }
2894
- raw() {
2895
- return [...this.keys()].reduce((l, d) => (l[d] = this.getAll(d), l), {});
2896
- }
2897
- [Symbol.for("nodejs.util.inspect.custom")]() {
2898
- return [...this.keys()].reduce((l, d) => {
2899
- const y = this.getAll(d);
2900
- return d === "host" ? l[d] = y[0] : l[d] = y.length > 1 ? y : y[0], l;
2901
- }, {});
2902
- }
2903
- };
2904
- Object.defineProperties(Headers.prototype, ["get", "entries", "forEach", "values"].reduce((c, l) => (c[l] = { enumerable: true }, c), {}));
2905
- function fromRawHeaders(c = []) {
2906
- return new Headers(c.reduce((l, d, y, b) => (y % 2 === 0 && l.push(b.slice(y, y + 2)), l), []).filter(([l, d]) => {
2907
- try {
2908
- return validateHeaderName(l), validateHeaderValue(l, String(d)), true;
2909
- } catch (e8) {
2910
- return false;
2911
- }
2912
- }));
2913
- }
2914
- u(fromRawHeaders, "fromRawHeaders");
2915
- var redirectStatus = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
2916
- var isRedirect = u((c) => redirectStatus.has(c), "isRedirect");
2917
- var INTERNALS$1 = Symbol("Response internals");
2918
- var Response = class _Response extends Body {
2919
- static {
2920
- u(this, "Response");
2921
- }
2922
- constructor(l = null, d = {}) {
2923
- super(l, d);
2924
- const y = d.status != null ? d.status : 200, b = new Headers(d.headers);
2925
- if (l !== null && !b.has("Content-Type")) {
2926
- const R = extractContentType(l, this);
2927
- R && b.append("Content-Type", R);
2928
- }
2929
- this[INTERNALS$1] = { type: "default", url: d.url, status: y, statusText: d.statusText || "", headers: b, counter: d.counter, highWaterMark: d.highWaterMark };
2930
- }
2931
- get type() {
2932
- return this[INTERNALS$1].type;
2933
- }
2934
- get url() {
2935
- return this[INTERNALS$1].url || "";
2936
- }
2937
- get status() {
2938
- return this[INTERNALS$1].status;
2939
- }
2940
- get ok() {
2941
- return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
2942
- }
2943
- get redirected() {
2944
- return this[INTERNALS$1].counter > 0;
2945
- }
2946
- get statusText() {
2947
- return this[INTERNALS$1].statusText;
2948
- }
2949
- get headers() {
2950
- return this[INTERNALS$1].headers;
2951
- }
2952
- get highWaterMark() {
2953
- return this[INTERNALS$1].highWaterMark;
2954
- }
2955
- clone() {
2956
- return new _Response(clone(this, this.highWaterMark), { type: this.type, url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, size: this.size, highWaterMark: this.highWaterMark });
2957
- }
2958
- static redirect(l, d = 302) {
2959
- if (!isRedirect(d)) throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
2960
- return new _Response(null, { headers: { location: new URL(l).toString() }, status: d });
2961
- }
2962
- static error() {
2963
- const l = new _Response(null, { status: 0, statusText: "" });
2964
- return l[INTERNALS$1].type = "error", l;
2965
- }
2966
- static json(l = void 0, d = {}) {
2967
- const y = JSON.stringify(l);
2968
- if (y === void 0) throw new TypeError("data is not JSON serializable");
2969
- const b = new Headers(d && d.headers);
2970
- return b.has("content-type") || b.set("content-type", "application/json"), new _Response(y, { ...d, headers: b });
2971
- }
2972
- get [Symbol.toStringTag]() {
2973
- return "Response";
2974
- }
2975
- };
2976
- Object.defineProperties(Response.prototype, { type: { enumerable: true }, url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true } });
2977
- var getSearch = u((c) => {
2978
- if (c.search) return c.search;
2979
- const l = c.href.length - 1, d = c.hash || (c.href[l] === "#" ? "#" : "");
2980
- return c.href[l - d.length] === "?" ? "?" : "";
2981
- }, "getSearch");
2982
- function stripURLForUseAsAReferrer(c, l = false) {
2983
- return c == null || (c = new URL(c), /^(about|blob|data):$/.test(c.protocol)) ? "no-referrer" : (c.username = "", c.password = "", c.hash = "", l && (c.pathname = "", c.search = ""), c);
2984
- }
2985
- u(stripURLForUseAsAReferrer, "stripURLForUseAsAReferrer");
2986
- var ReferrerPolicy = /* @__PURE__ */ new Set(["", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"]);
2987
- var DEFAULT_REFERRER_POLICY = "strict-origin-when-cross-origin";
2988
- function validateReferrerPolicy(c) {
2989
- if (!ReferrerPolicy.has(c)) throw new TypeError(`Invalid referrerPolicy: ${c}`);
2990
- return c;
2991
- }
2992
- u(validateReferrerPolicy, "validateReferrerPolicy");
2993
- function isOriginPotentiallyTrustworthy(c) {
2994
- if (/^(http|ws)s:$/.test(c.protocol)) return true;
2995
- const l = c.host.replace(/(^\[)|(]$)/g, ""), d = require$$0$2.isIP(l);
2996
- return d === 4 && /^127\./.test(l) || d === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(l) ? true : c.host === "localhost" || c.host.endsWith(".localhost") ? false : c.protocol === "file:";
2997
- }
2998
- u(isOriginPotentiallyTrustworthy, "isOriginPotentiallyTrustworthy");
2999
- function isUrlPotentiallyTrustworthy(c) {
3000
- return /^about:(blank|srcdoc)$/.test(c) || c.protocol === "data:" || /^(blob|filesystem):$/.test(c.protocol) ? true : isOriginPotentiallyTrustworthy(c);
3001
- }
3002
- u(isUrlPotentiallyTrustworthy, "isUrlPotentiallyTrustworthy");
3003
- function determineRequestsReferrer(c, { referrerURLCallback: l, referrerOriginCallback: d } = {}) {
3004
- if (c.referrer === "no-referrer" || c.referrerPolicy === "") return null;
3005
- const y = c.referrerPolicy;
3006
- if (c.referrer === "about:client") return "no-referrer";
3007
- const b = c.referrer;
3008
- let R = stripURLForUseAsAReferrer(b), w = stripURLForUseAsAReferrer(b, true);
3009
- R.toString().length > 4096 && (R = w), l && (R = l(R)), d && (w = d(w));
3010
- const A = new URL(c.url);
3011
- switch (y) {
3012
- case "no-referrer":
3013
- return "no-referrer";
3014
- case "origin":
3015
- return w;
3016
- case "unsafe-url":
3017
- return R;
3018
- case "strict-origin":
3019
- return isUrlPotentiallyTrustworthy(R) && !isUrlPotentiallyTrustworthy(A) ? "no-referrer" : w.toString();
3020
- case "strict-origin-when-cross-origin":
3021
- return R.origin === A.origin ? R : isUrlPotentiallyTrustworthy(R) && !isUrlPotentiallyTrustworthy(A) ? "no-referrer" : w;
3022
- case "same-origin":
3023
- return R.origin === A.origin ? R : "no-referrer";
3024
- case "origin-when-cross-origin":
3025
- return R.origin === A.origin ? R : w;
3026
- case "no-referrer-when-downgrade":
3027
- return isUrlPotentiallyTrustworthy(R) && !isUrlPotentiallyTrustworthy(A) ? "no-referrer" : R;
3028
- default:
3029
- throw new TypeError(`Invalid referrerPolicy: ${y}`);
3030
- }
3031
- }
3032
- u(determineRequestsReferrer, "determineRequestsReferrer");
3033
- function parseReferrerPolicyFromHeader(c) {
3034
- const l = (c.get("referrer-policy") || "").split(/[,\s]+/);
3035
- let d = "";
3036
- for (const y of l) y && ReferrerPolicy.has(y) && (d = y);
3037
- return d;
3038
- }
3039
- u(parseReferrerPolicyFromHeader, "parseReferrerPolicyFromHeader");
3040
- var INTERNALS = Symbol("Request internals");
3041
- var isRequest = u((c) => typeof c == "object" && typeof c[INTERNALS] == "object", "isRequest");
3042
- var doBadDataWarn = require$$0$1.deprecate(() => {
3043
- }, ".data is not a valid RequestInit property, use .body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (request)");
3044
- var Request = class _Request extends Body {
3045
- static {
3046
- u(this, "Request");
3047
- }
3048
- constructor(l, d = {}) {
3049
- let y;
3050
- if (isRequest(l) ? y = new URL(l.url) : (y = new URL(l), l = {}), y.username !== "" || y.password !== "") throw new TypeError(`${y} is an url with embedded credentials.`);
3051
- let b = d.method || l.method || "GET";
3052
- if (/^(delete|get|head|options|post|put)$/i.test(b) && (b = b.toUpperCase()), !isRequest(d) && "data" in d && doBadDataWarn(), (d.body != null || isRequest(l) && l.body !== null) && (b === "GET" || b === "HEAD")) throw new TypeError("Request with GET/HEAD method cannot have body");
3053
- const R = d.body ? d.body : isRequest(l) && l.body !== null ? clone(l) : null;
3054
- super(R, { size: d.size || l.size || 0 });
3055
- const w = new Headers(d.headers || l.headers || {});
3056
- if (R !== null && !w.has("Content-Type")) {
3057
- const B = extractContentType(R, this);
3058
- B && w.set("Content-Type", B);
3059
- }
3060
- let A = isRequest(l) ? l.signal : null;
3061
- if ("signal" in d && (A = d.signal), A != null && !isAbortSignal(A)) throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
3062
- let F = d.referrer == null ? l.referrer : d.referrer;
3063
- if (F === "") F = "no-referrer";
3064
- else if (F) {
3065
- const B = new URL(F);
3066
- F = /^about:(\/\/)?client$/.test(B) ? "client" : B;
3067
- } else F = void 0;
3068
- this[INTERNALS] = { method: b, redirect: d.redirect || l.redirect || "follow", headers: w, parsedURL: y, signal: A, referrer: F }, this.follow = d.follow === void 0 ? l.follow === void 0 ? 20 : l.follow : d.follow, this.compress = d.compress === void 0 ? l.compress === void 0 ? true : l.compress : d.compress, this.counter = d.counter || l.counter || 0, this.agent = d.agent || l.agent, this.highWaterMark = d.highWaterMark || l.highWaterMark || 16384, this.insecureHTTPParser = d.insecureHTTPParser || l.insecureHTTPParser || false, this.referrerPolicy = d.referrerPolicy || l.referrerPolicy || "";
3069
- }
3070
- get method() {
3071
- return this[INTERNALS].method;
3072
- }
3073
- get url() {
3074
- return require$$1.format(this[INTERNALS].parsedURL);
3075
- }
3076
- get headers() {
3077
- return this[INTERNALS].headers;
3078
- }
3079
- get redirect() {
3080
- return this[INTERNALS].redirect;
3081
- }
3082
- get signal() {
3083
- return this[INTERNALS].signal;
3084
- }
3085
- get referrer() {
3086
- if (this[INTERNALS].referrer === "no-referrer") return "";
3087
- if (this[INTERNALS].referrer === "client") return "about:client";
3088
- if (this[INTERNALS].referrer) return this[INTERNALS].referrer.toString();
3089
- }
3090
- get referrerPolicy() {
3091
- return this[INTERNALS].referrerPolicy;
3092
- }
3093
- set referrerPolicy(l) {
3094
- this[INTERNALS].referrerPolicy = validateReferrerPolicy(l);
3095
- }
3096
- clone() {
3097
- return new _Request(this);
3098
- }
3099
- get [Symbol.toStringTag]() {
3100
- return "Request";
3101
- }
3102
- };
3103
- Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, referrer: { enumerable: true }, referrerPolicy: { enumerable: true } });
3104
- var getNodeRequestOptions = u((c) => {
3105
- const { parsedURL: l } = c[INTERNALS], d = new Headers(c[INTERNALS].headers);
3106
- d.has("Accept") || d.set("Accept", "*/*");
3107
- let y = null;
3108
- if (c.body === null && /^(post|put)$/i.test(c.method) && (y = "0"), c.body !== null) {
3109
- const A = getTotalBytes(c);
3110
- typeof A == "number" && !Number.isNaN(A) && (y = String(A));
3111
- }
3112
- y && d.set("Content-Length", y), c.referrerPolicy === "" && (c.referrerPolicy = DEFAULT_REFERRER_POLICY), c.referrer && c.referrer !== "no-referrer" ? c[INTERNALS].referrer = determineRequestsReferrer(c) : c[INTERNALS].referrer = "no-referrer", c[INTERNALS].referrer instanceof URL && d.set("Referer", c.referrer), d.has("User-Agent") || d.set("User-Agent", "node-fetch"), c.compress && !d.has("Accept-Encoding") && d.set("Accept-Encoding", "gzip, deflate, br");
3113
- let { agent: b } = c;
3114
- typeof b == "function" && (b = b(l));
3115
- const R = getSearch(l), w = { path: l.pathname + R, method: c.method, headers: d[Symbol.for("nodejs.util.inspect.custom")](), insecureHTTPParser: c.insecureHTTPParser, agent: b };
3116
- return { parsedURL: l, options: w };
3117
- }, "getNodeRequestOptions");
3118
- var AbortError = class extends FetchBaseError {
3119
- static {
3120
- u(this, "AbortError");
3121
- }
3122
- constructor(l, d = "aborted") {
3123
- super(l, d);
3124
- }
3125
- };
3126
- var nodeDomexception;
3127
- var hasRequiredNodeDomexception;
3128
- function requireNodeDomexception() {
3129
- if (hasRequiredNodeDomexception) return nodeDomexception;
3130
- if (hasRequiredNodeDomexception = 1, !globalThis.DOMException) try {
3131
- const { MessageChannel: c } = _chunkIG6EXAQUcjs.__require.call(void 0, "worker_threads"), l = new c().port1, d = new ArrayBuffer();
3132
- l.postMessage(d, [d, d]);
3133
- } catch (c) {
3134
- c.constructor.name === "DOMException" && (globalThis.DOMException = c.constructor);
3135
- }
3136
- return nodeDomexception = globalThis.DOMException, nodeDomexception;
3137
- }
3138
- u(requireNodeDomexception, "requireNodeDomexception");
3139
- var nodeDomexceptionExports = requireNodeDomexception();
3140
- var DOMException = _commonjsHelpers.getDefaultExportFromCjs(nodeDomexceptionExports);
3141
- var { stat } = node_fs.promises;
3142
- var blobFromSync = u((c, l) => fromBlob(node_fs.statSync(c), c, l), "blobFromSync");
3143
- var blobFrom = u((c, l) => stat(c).then((d) => fromBlob(d, c, l)), "blobFrom");
3144
- var fileFrom = u((c, l) => stat(c).then((d) => fromFile(d, c, l)), "fileFrom");
3145
- var fileFromSync = u((c, l) => fromFile(node_fs.statSync(c), c, l), "fileFromSync");
3146
- var fromBlob = u((c, l, d = "") => new Blob([new BlobDataItem({ path: l, size: c.size, lastModified: c.mtimeMs, start: 0 })], { type: d }), "fromBlob");
3147
- var fromFile = u((c, l, d = "") => new File([new BlobDataItem({ path: l, size: c.size, lastModified: c.mtimeMs, start: 0 })], node_path.basename(l), { type: d, lastModified: c.mtimeMs }), "fromFile");
3148
- var BlobDataItem = class _BlobDataItem {
3149
- static {
3150
- u(this, "BlobDataItem");
3151
- }
3152
- #e;
3153
- #t;
3154
- constructor(l) {
3155
- this.#e = l.path, this.#t = l.start, this.size = l.size, this.lastModified = l.lastModified;
3156
- }
3157
- slice(l, d) {
3158
- return new _BlobDataItem({ path: this.#e, lastModified: this.lastModified, size: d - l, start: this.#t + l });
3159
- }
3160
- async *stream() {
3161
- const { mtimeMs: l } = await stat(this.#e);
3162
- if (l > this.lastModified) throw new DOMException("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
3163
- yield* node_fs.createReadStream(this.#e, { start: this.#t, end: this.#t + this.size - 1 });
3164
- }
3165
- get [Symbol.toStringTag]() {
3166
- return "Blob";
3167
- }
3168
- };
3169
- var supportedSchemas = /* @__PURE__ */ new Set(["data:", "http:", "https:"]);
3170
- async function fetch$1(c, l) {
3171
- return new Promise((d, y) => {
3172
- const b = new Request(c, l), { parsedURL: R, options: w } = getNodeRequestOptions(b);
3173
- if (!supportedSchemas.has(R.protocol)) throw new TypeError(`node-fetch cannot load ${c}. URL scheme "${R.protocol.replace(/:$/, "")}" is not supported.`);
3174
- if (R.protocol === "data:") {
3175
- const E = dataUriToBuffer(b.url), Z = new Response(E, { headers: { "Content-Type": E.typeFull } });
3176
- d(Z);
3177
- return;
3178
- }
3179
- const A = (R.protocol === "https:" ? https__default : http__default).request, { signal: F } = b;
3180
- let B = null;
3181
- const z = u(() => {
3182
- const E = new AbortError("The operation was aborted.");
3183
- y(E), b.body && b.body instanceof Stream__default.Readable && b.body.destroy(E), !(!B || !B.body) && B.body.emit("error", E);
3184
- }, "abort");
3185
- if (F && F.aborted) {
3186
- z();
3187
- return;
3188
- }
3189
- const W = u(() => {
3190
- z(), D();
3191
- }, "abortAndFinalize"), T = A(R.toString(), w);
3192
- F && F.addEventListener("abort", W);
3193
- const D = u(() => {
3194
- T.abort(), F && F.removeEventListener("abort", W);
3195
- }, "finalize");
3196
- T.on("error", (E) => {
3197
- y(new FetchError(`request to ${b.url} failed, reason: ${E.message}`, "system", E)), D();
3198
- }), fixResponseChunkedTransferBadEnding(T, (E) => {
3199
- B && B.body && B.body.destroy(E);
3200
- }), process.version < "v14" && T.on("socket", (E) => {
3201
- let Z;
3202
- E.prependListener("end", () => {
3203
- Z = E._eventsCount;
3204
- }), E.prependListener("close", (M) => {
3205
- if (B && Z < E._eventsCount && !M) {
3206
- const U = new Error("Premature close");
3207
- U.code = "ERR_STREAM_PREMATURE_CLOSE", B.body.emit("error", U);
3208
- }
3209
- });
3210
- }), T.on("response", (E) => {
3211
- T.setTimeout(0);
3212
- const Z = fromRawHeaders(E.rawHeaders);
3213
- if (isRedirect(E.statusCode)) {
3214
- const $ = Z.get("Location");
3215
- let N = null;
3216
- try {
3217
- N = $ === null ? null : new URL($, b.url);
3218
- } catch (e9) {
3219
- if (b.redirect !== "manual") {
3220
- y(new FetchError(`uri requested responds with an invalid redirect URL: ${$}`, "invalid-redirect")), D();
3221
- return;
3222
- }
3223
- }
3224
- switch (b.redirect) {
3225
- case "error":
3226
- y(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${b.url}`, "no-redirect")), D();
3227
- return;
3228
- case "manual":
3229
- break;
3230
- case "follow": {
3231
- if (N === null) break;
3232
- if (b.counter >= b.follow) {
3233
- y(new FetchError(`maximum redirect reached at: ${b.url}`, "max-redirect")), D();
3234
- return;
3235
- }
3236
- const V = { headers: new Headers(b.headers), follow: b.follow, counter: b.counter + 1, agent: b.agent, compress: b.compress, method: b.method, body: clone(b), signal: b.signal, size: b.size, referrer: b.referrer, referrerPolicy: b.referrerPolicy };
3237
- if (!isDomainOrSubdomain(b.url, N) || !isSameProtocol(b.url, N)) for (const rt of ["authorization", "www-authenticate", "cookie", "cookie2"]) V.headers.delete(rt);
3238
- if (E.statusCode !== 303 && b.body && l.body instanceof Stream__default.Readable) {
3239
- y(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), D();
3240
- return;
3241
- }
3242
- (E.statusCode === 303 || (E.statusCode === 301 || E.statusCode === 302) && b.method === "POST") && (V.method = "GET", V.body = void 0, V.headers.delete("content-length"));
3243
- const Q = parseReferrerPolicyFromHeader(Z);
3244
- Q && (V.referrerPolicy = Q), d(fetch$1(new Request(N, V))), D();
3245
- return;
3246
- }
3247
- default:
3248
- return y(new TypeError(`Redirect option '${b.redirect}' is not a valid value of RequestRedirect`));
3249
- }
3250
- }
3251
- F && E.once("end", () => {
3252
- F.removeEventListener("abort", W);
3253
- });
3254
- let M = Stream.pipeline(E, new Stream.PassThrough(), ($) => {
3255
- $ && y($);
3256
- });
3257
- process.version < "v12.10" && E.on("aborted", W);
3258
- const U = { url: b.url, status: E.statusCode, statusText: E.statusMessage, headers: Z, size: b.size, counter: b.counter, highWaterMark: b.highWaterMark }, K = Z.get("Content-Encoding");
3259
- if (!b.compress || b.method === "HEAD" || K === null || E.statusCode === 204 || E.statusCode === 304) {
3260
- B = new Response(M, U), d(B);
3261
- return;
3262
- }
3263
- const se = { flush: zlib__default.Z_SYNC_FLUSH, finishFlush: zlib__default.Z_SYNC_FLUSH };
3264
- if (K === "gzip" || K === "x-gzip") {
3265
- M = Stream.pipeline(M, zlib__default.createGunzip(se), ($) => {
3266
- $ && y($);
3267
- }), B = new Response(M, U), d(B);
3268
- return;
3269
- }
3270
- if (K === "deflate" || K === "x-deflate") {
3271
- const $ = Stream.pipeline(E, new Stream.PassThrough(), (N) => {
3272
- N && y(N);
3273
- });
3274
- $.once("data", (N) => {
3275
- (N[0] & 15) === 8 ? M = Stream.pipeline(M, zlib__default.createInflate(), (V) => {
3276
- V && y(V);
3277
- }) : M = Stream.pipeline(M, zlib__default.createInflateRaw(), (V) => {
3278
- V && y(V);
3279
- }), B = new Response(M, U), d(B);
3280
- }), $.once("end", () => {
3281
- B || (B = new Response(M, U), d(B));
3282
- });
3283
- return;
3284
- }
3285
- if (K === "br") {
3286
- M = Stream.pipeline(M, zlib__default.createBrotliDecompress(), ($) => {
3287
- $ && y($);
3288
- }), B = new Response(M, U), d(B);
3289
- return;
3290
- }
3291
- B = new Response(M, U), d(B);
3292
- }), writeToStream(T, b).catch(y);
3293
- });
3294
- }
3295
- u(fetch$1, "fetch$1");
3296
- function fixResponseChunkedTransferBadEnding(c, l) {
3297
- const d = require$$0.Buffer.from(`0\r
3298
- \r
3299
- `);
3300
- let y = false, b = false, R;
3301
- c.on("response", (w) => {
3302
- const { headers: A } = w;
3303
- y = A["transfer-encoding"] === "chunked" && !A["content-length"];
3304
- }), c.on("socket", (w) => {
3305
- const A = u(() => {
3306
- if (y && !b) {
3307
- const B = new Error("Premature close");
3308
- B.code = "ERR_STREAM_PREMATURE_CLOSE", l(B);
3309
- }
3310
- }, "onSocketClose"), F = u((B) => {
3311
- b = require$$0.Buffer.compare(B.slice(-5), d) === 0, !b && R && (b = require$$0.Buffer.compare(R.slice(-3), d.slice(0, 3)) === 0 && require$$0.Buffer.compare(B.slice(-2), d.slice(3)) === 0), R = B;
3312
- }, "onData");
3313
- w.prependListener("close", A), w.on("data", F), c.on("close", () => {
3314
- w.removeListener("close", A), w.removeListener("data", F);
3315
- });
3316
- });
3317
- }
3318
- u(fixResponseChunkedTransferBadEnding, "fixResponseChunkedTransferBadEnding");
3319
- var privateData = /* @__PURE__ */ new WeakMap();
3320
- var wrappers = /* @__PURE__ */ new WeakMap();
3321
- function pd(c) {
3322
- const l = privateData.get(c);
3323
- return console.assert(l != null, "'this' is expected an Event object, but got", c), l;
3324
- }
3325
- u(pd, "pd");
3326
- function setCancelFlag(c) {
3327
- if (c.passiveListener != null) {
3328
- typeof console < "u" && typeof console.error == "function" && console.error("Unable to preventDefault inside passive event listener invocation.", c.passiveListener);
3329
- return;
3330
- }
3331
- c.event.cancelable && (c.canceled = true, typeof c.event.preventDefault == "function" && c.event.preventDefault());
3332
- }
3333
- u(setCancelFlag, "setCancelFlag");
3334
- function Event(c, l) {
3335
- privateData.set(this, { eventTarget: c, event: l, eventPhase: 2, currentTarget: c, canceled: false, stopped: false, immediateStopped: false, passiveListener: null, timeStamp: l.timeStamp || Date.now() }), Object.defineProperty(this, "isTrusted", { value: false, enumerable: true });
3336
- const d = Object.keys(l);
3337
- for (let y = 0; y < d.length; ++y) {
3338
- const b = d[y];
3339
- b in this || Object.defineProperty(this, b, defineRedirectDescriptor(b));
3340
- }
3341
- }
3342
- u(Event, "Event"), Event.prototype = { get type() {
3343
- return pd(this).event.type;
3344
- }, get target() {
3345
- return pd(this).eventTarget;
3346
- }, get currentTarget() {
3347
- return pd(this).currentTarget;
3348
- }, composedPath() {
3349
- const c = pd(this).currentTarget;
3350
- return c == null ? [] : [c];
3351
- }, get NONE() {
3352
- return 0;
3353
- }, get CAPTURING_PHASE() {
3354
- return 1;
3355
- }, get AT_TARGET() {
3356
- return 2;
3357
- }, get BUBBLING_PHASE() {
3358
- return 3;
3359
- }, get eventPhase() {
3360
- return pd(this).eventPhase;
3361
- }, stopPropagation() {
3362
- const c = pd(this);
3363
- c.stopped = true, typeof c.event.stopPropagation == "function" && c.event.stopPropagation();
3364
- }, stopImmediatePropagation() {
3365
- const c = pd(this);
3366
- c.stopped = true, c.immediateStopped = true, typeof c.event.stopImmediatePropagation == "function" && c.event.stopImmediatePropagation();
3367
- }, get bubbles() {
3368
- return !!pd(this).event.bubbles;
3369
- }, get cancelable() {
3370
- return !!pd(this).event.cancelable;
3371
- }, preventDefault() {
3372
- setCancelFlag(pd(this));
3373
- }, get defaultPrevented() {
3374
- return pd(this).canceled;
3375
- }, get composed() {
3376
- return !!pd(this).event.composed;
3377
- }, get timeStamp() {
3378
- return pd(this).timeStamp;
3379
- }, get srcElement() {
3380
- return pd(this).eventTarget;
3381
- }, get cancelBubble() {
3382
- return pd(this).stopped;
3383
- }, set cancelBubble(c) {
3384
- if (!c) return;
3385
- const l = pd(this);
3386
- l.stopped = true, typeof l.event.cancelBubble == "boolean" && (l.event.cancelBubble = true);
3387
- }, get returnValue() {
3388
- return !pd(this).canceled;
3389
- }, set returnValue(c) {
3390
- c || setCancelFlag(pd(this));
3391
- }, initEvent() {
3392
- } }, Object.defineProperty(Event.prototype, "constructor", { value: Event, configurable: true, writable: true }), typeof window < "u" && typeof window.Event < "u" && (Object.setPrototypeOf(Event.prototype, window.Event.prototype), wrappers.set(window.Event.prototype, Event));
3393
- function defineRedirectDescriptor(c) {
3394
- return { get() {
3395
- return pd(this).event[c];
3396
- }, set(l) {
3397
- pd(this).event[c] = l;
3398
- }, configurable: true, enumerable: true };
3399
- }
3400
- u(defineRedirectDescriptor, "defineRedirectDescriptor");
3401
- function defineCallDescriptor(c) {
3402
- return { value() {
3403
- const l = pd(this).event;
3404
- return l[c].apply(l, arguments);
3405
- }, configurable: true, enumerable: true };
3406
- }
3407
- u(defineCallDescriptor, "defineCallDescriptor");
3408
- function defineWrapper(c, l) {
3409
- const d = Object.keys(l);
3410
- if (d.length === 0) return c;
3411
- function y(b, R) {
3412
- c.call(this, b, R);
3413
- }
3414
- u(y, "CustomEvent"), y.prototype = Object.create(c.prototype, { constructor: { value: y, configurable: true, writable: true } });
3415
- for (let b = 0; b < d.length; ++b) {
3416
- const R = d[b];
3417
- if (!(R in c.prototype)) {
3418
- const A = typeof Object.getOwnPropertyDescriptor(l, R).value == "function";
3419
- Object.defineProperty(y.prototype, R, A ? defineCallDescriptor(R) : defineRedirectDescriptor(R));
3420
- }
3421
- }
3422
- return y;
3423
- }
3424
- u(defineWrapper, "defineWrapper");
3425
- function getWrapper(c) {
3426
- if (c == null || c === Object.prototype) return Event;
3427
- let l = wrappers.get(c);
3428
- return l == null && (l = defineWrapper(getWrapper(Object.getPrototypeOf(c)), c), wrappers.set(c, l)), l;
3429
- }
3430
- u(getWrapper, "getWrapper");
3431
- function wrapEvent(c, l) {
3432
- const d = getWrapper(Object.getPrototypeOf(l));
3433
- return new d(c, l);
3434
- }
3435
- u(wrapEvent, "wrapEvent");
3436
- function isStopped(c) {
3437
- return pd(c).immediateStopped;
3438
- }
3439
- u(isStopped, "isStopped");
3440
- function setEventPhase(c, l) {
3441
- pd(c).eventPhase = l;
3442
- }
3443
- u(setEventPhase, "setEventPhase");
3444
- function setCurrentTarget(c, l) {
3445
- pd(c).currentTarget = l;
3446
- }
3447
- u(setCurrentTarget, "setCurrentTarget");
3448
- function setPassiveListener(c, l) {
3449
- pd(c).passiveListener = l;
3450
- }
3451
- u(setPassiveListener, "setPassiveListener");
3452
- var listenersMap = /* @__PURE__ */ new WeakMap();
3453
- var CAPTURE = 1;
3454
- var BUBBLE = 2;
3455
- var ATTRIBUTE = 3;
3456
- function isObject(c) {
3457
- return c !== null && typeof c == "object";
3458
- }
3459
- u(isObject, "isObject");
3460
- function getListeners(c) {
3461
- const l = listenersMap.get(c);
3462
- if (l == null) throw new TypeError("'this' is expected an EventTarget object, but got another value.");
3463
- return l;
3464
- }
3465
- u(getListeners, "getListeners");
3466
- function defineEventAttributeDescriptor(c) {
3467
- return { get() {
3468
- let d = getListeners(this).get(c);
3469
- for (; d != null; ) {
3470
- if (d.listenerType === ATTRIBUTE) return d.listener;
3471
- d = d.next;
3472
- }
3473
- return null;
3474
- }, set(l) {
3475
- typeof l != "function" && !isObject(l) && (l = null);
3476
- const d = getListeners(this);
3477
- let y = null, b = d.get(c);
3478
- for (; b != null; ) b.listenerType === ATTRIBUTE ? y !== null ? y.next = b.next : b.next !== null ? d.set(c, b.next) : d.delete(c) : y = b, b = b.next;
3479
- if (l !== null) {
3480
- const R = { listener: l, listenerType: ATTRIBUTE, passive: false, once: false, next: null };
3481
- y === null ? d.set(c, R) : y.next = R;
3482
- }
3483
- }, configurable: true, enumerable: true };
3484
- }
3485
- u(defineEventAttributeDescriptor, "defineEventAttributeDescriptor");
3486
- function defineEventAttribute(c, l) {
3487
- Object.defineProperty(c, `on${l}`, defineEventAttributeDescriptor(l));
3488
- }
3489
- u(defineEventAttribute, "defineEventAttribute");
3490
- function defineCustomEventTarget(c) {
3491
- function l() {
3492
- EventTarget.call(this);
3493
- }
3494
- u(l, "CustomEventTarget"), l.prototype = Object.create(EventTarget.prototype, { constructor: { value: l, configurable: true, writable: true } });
3495
- for (let d = 0; d < c.length; ++d) defineEventAttribute(l.prototype, c[d]);
3496
- return l;
3497
- }
3498
- u(defineCustomEventTarget, "defineCustomEventTarget");
3499
- function EventTarget() {
3500
- if (this instanceof EventTarget) {
3501
- listenersMap.set(this, /* @__PURE__ */ new Map());
3502
- return;
3503
- }
3504
- if (arguments.length === 1 && Array.isArray(arguments[0])) return defineCustomEventTarget(arguments[0]);
3505
- if (arguments.length > 0) {
3506
- const c = new Array(arguments.length);
3507
- for (let l = 0; l < arguments.length; ++l) c[l] = arguments[l];
3508
- return defineCustomEventTarget(c);
3509
- }
3510
- throw new TypeError("Cannot call a class as a function");
3511
- }
3512
- u(EventTarget, "EventTarget"), EventTarget.prototype = { addEventListener(c, l, d) {
3513
- if (l == null) return;
3514
- if (typeof l != "function" && !isObject(l)) throw new TypeError("'listener' should be a function or an object.");
3515
- const y = getListeners(this), b = isObject(d), w = (b ? !!d.capture : !!d) ? CAPTURE : BUBBLE, A = { listener: l, listenerType: w, passive: b && !!d.passive, once: b && !!d.once, next: null };
3516
- let F = y.get(c);
3517
- if (F === void 0) {
3518
- y.set(c, A);
3519
- return;
3520
- }
3521
- let B = null;
3522
- for (; F != null; ) {
3523
- if (F.listener === l && F.listenerType === w) return;
3524
- B = F, F = F.next;
3525
- }
3526
- B.next = A;
3527
- }, removeEventListener(c, l, d) {
3528
- if (l == null) return;
3529
- const y = getListeners(this), R = (isObject(d) ? !!d.capture : !!d) ? CAPTURE : BUBBLE;
3530
- let w = null, A = y.get(c);
3531
- for (; A != null; ) {
3532
- if (A.listener === l && A.listenerType === R) {
3533
- w !== null ? w.next = A.next : A.next !== null ? y.set(c, A.next) : y.delete(c);
3534
- return;
3535
- }
3536
- w = A, A = A.next;
3537
- }
3538
- }, dispatchEvent(c) {
3539
- if (c == null || typeof c.type != "string") throw new TypeError('"event.type" should be a string.');
3540
- const l = getListeners(this), d = c.type;
3541
- let y = l.get(d);
3542
- if (y == null) return true;
3543
- const b = wrapEvent(this, c);
3544
- let R = null;
3545
- for (; y != null; ) {
3546
- if (y.once ? R !== null ? R.next = y.next : y.next !== null ? l.set(d, y.next) : l.delete(d) : R = y, setPassiveListener(b, y.passive ? y.listener : null), typeof y.listener == "function") try {
3547
- y.listener.call(this, b);
3548
- } catch (w) {
3549
- typeof console < "u" && typeof console.error == "function" && console.error(w);
3550
- }
3551
- else y.listenerType !== ATTRIBUTE && typeof y.listener.handleEvent == "function" && y.listener.handleEvent(b);
3552
- if (isStopped(b)) break;
3553
- y = y.next;
3554
- }
3555
- return setPassiveListener(b, null), setEventPhase(b, 0), setCurrentTarget(b, null), !b.defaultPrevented;
3556
- } }, Object.defineProperty(EventTarget.prototype, "constructor", { value: EventTarget, configurable: true, writable: true }), typeof window < "u" && typeof window.EventTarget < "u" && Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);
3557
- var AbortSignal = class extends EventTarget {
3558
- static {
3559
- u(this, "AbortSignal");
3560
- }
3561
- constructor() {
3562
- throw super(), new TypeError("AbortSignal cannot be constructed directly");
3563
- }
3564
- get aborted() {
3565
- const l = abortedFlags.get(this);
3566
- if (typeof l != "boolean") throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`);
3567
- return l;
3568
- }
3569
- };
3570
- defineEventAttribute(AbortSignal.prototype, "abort");
3571
- function createAbortSignal() {
3572
- const c = Object.create(AbortSignal.prototype);
3573
- return EventTarget.call(c), abortedFlags.set(c, false), c;
3574
- }
3575
- u(createAbortSignal, "createAbortSignal");
3576
- function abortSignal(c) {
3577
- abortedFlags.get(c) === false && (abortedFlags.set(c, true), c.dispatchEvent({ type: "abort" }));
3578
- }
3579
- u(abortSignal, "abortSignal");
3580
- var abortedFlags = /* @__PURE__ */ new WeakMap();
3581
- Object.defineProperties(AbortSignal.prototype, { aborted: { enumerable: true } }), typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol" && Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { configurable: true, value: "AbortSignal" });
3582
- var AbortController$1 = class {
3583
- static {
3584
- u(this, "AbortController");
3585
- }
3586
- constructor() {
3587
- signals.set(this, createAbortSignal());
3588
- }
3589
- get signal() {
3590
- return getSignal(this);
3591
- }
3592
- abort() {
3593
- abortSignal(getSignal(this));
3594
- }
3595
- };
3596
- var signals = /* @__PURE__ */ new WeakMap();
3597
- function getSignal(c) {
3598
- const l = signals.get(c);
3599
- if (l == null) throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${c === null ? "null" : typeof c}`);
3600
- return l;
3601
- }
3602
- u(getSignal, "getSignal"), Object.defineProperties(AbortController$1.prototype, { signal: { enumerable: true }, abort: { enumerable: true } }), typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol" && Object.defineProperty(AbortController$1.prototype, Symbol.toStringTag, { configurable: true, value: "AbortController" });
3603
- var t = Object.defineProperty;
3604
- var e = u((c, l) => t(c, "name", { value: l, configurable: true }), "e");
3605
- var fetch = fetch$1;
3606
- s();
3607
- function s() {
3608
- !_optionalChain([globalThis, 'access', _31 => _31.process, 'optionalAccess', _32 => _32.versions, 'optionalAccess', _33 => _33.node]) && !_optionalChain([globalThis, 'access', _34 => _34.process, 'optionalAccess', _35 => _35.env, 'optionalAccess', _36 => _36.DISABLE_NODE_FETCH_NATIVE_WARN]) && console.warn("[node-fetch-native] Node.js compatible build of `node-fetch-native` is being used in a non-Node.js environment. Please make sure you are using proper export conditions or report this issue to https://github.com/unjs/node-fetch-native. You can set `process.env.DISABLE_NODE_FETCH_NATIVE_WARN` to disable this warning.");
3609
- }
3610
- u(s, "s"), e(s, "checkNodeEnvironment"), exports.AbortController = AbortController$1, exports.AbortError = AbortError, exports.Blob = Blob, exports.FetchError = FetchError, exports.File = File, exports.FormData = FormData, exports.Headers = Headers, exports.Request = Request, exports.Response = Response, exports.blobFrom = blobFrom, exports.blobFromSync = blobFromSync, exports.default = fetch, exports.fetch = fetch, exports.fileFrom = fileFrom, exports.fileFromSync = fileFromSync, exports.isRedirect = isRedirect;
3611
- }
3612
- });
3613
-
3614
-
3615
-
3616
-
3617
- exports.require_node_fetch_native_DhEqb06g = require_node_fetch_native_DhEqb06g; exports.require_node = require_node;
3618
- /*! Bundled license information:
3619
-
3620
- node-fetch-native/dist/node.cjs:
3621
- (**
3622
- * @license
3623
- * web-streams-polyfill v3.3.3
3624
- * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
3625
- * This code is released under the MIT license.
3626
- * SPDX-License-Identifier: MIT
3627
- *)
3628
- (*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
3629
- (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
3630
- (*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
3631
- */