create-vuetify0 0.0.6

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