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