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