@rg-dev/stdlib 1.0.42 → 1.0.44

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.
@@ -1,9 +1,30 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
8
  var __getProtoOf = Object.getPrototypeOf;
6
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
12
+ var __typeError = (msg) => {
13
+ throw TypeError(msg);
14
+ };
15
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
+ var __spreadValues = (a, b) => {
17
+ for (var prop in b || (b = {}))
18
+ if (__hasOwnProp.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ if (__getOwnPropSymbols)
21
+ for (var prop of __getOwnPropSymbols(b)) {
22
+ if (__propIsEnum.call(b, prop))
23
+ __defNormalProp(a, prop, b[prop]);
24
+ }
25
+ return a;
26
+ };
27
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7
28
  var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
8
29
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
30
  }) : x2)(function(x2) {
@@ -36,6 +57,54 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
57
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
58
  mod
38
59
  ));
60
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
61
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
62
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
63
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
64
+ var __await = function(promise, isYieldStar) {
65
+ this[0] = promise;
66
+ this[1] = isYieldStar;
67
+ };
68
+ var __asyncGenerator = (__this, __arguments, generator) => {
69
+ var resume = (k, v, yes, no) => {
70
+ try {
71
+ var x2 = generator[k](v), isAwait = (v = x2.value) instanceof __await, done = x2.done;
72
+ Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e2) => resume("throw", e2, yes, no));
73
+ } catch (e2) {
74
+ no(e2);
75
+ }
76
+ }, method = (k) => it[k] = (x2) => new Promise((yes, no) => resume(k, x2, yes, no)), it = {};
77
+ return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
78
+ };
79
+ var __yieldStar = (value) => {
80
+ var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
81
+ if (obj == null) {
82
+ obj = value[__knownSymbol("iterator")]();
83
+ method = (k) => it[k] = (x2) => obj[k](x2);
84
+ } else {
85
+ obj = obj.call(value);
86
+ method = (k) => it[k] = (v) => {
87
+ if (isAwait) {
88
+ isAwait = false;
89
+ if (k === "throw") throw v;
90
+ return v;
91
+ }
92
+ isAwait = true;
93
+ return {
94
+ done: false,
95
+ value: new __await(new Promise((resolve) => {
96
+ var x2 = obj[k](v);
97
+ if (!(x2 instanceof Object)) __typeError("Object expected");
98
+ resolve(x2);
99
+ }), 1)
100
+ };
101
+ };
102
+ }
103
+ return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x2) => {
104
+ throw x2;
105
+ }, "return" in obj && method("return"), it;
106
+ };
107
+ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
39
108
 
40
109
  // node_modules/data-uri-to-buffer/dist/index.js
41
110
  function dataUriToBuffer(uri) {
@@ -525,7 +594,9 @@ var require_ponyfill_es2018 = __commonJS({
525
594
  function defaultReaderBrandCheckException(name) {
526
595
  return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);
527
596
  }
528
- const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {
597
+ const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(function() {
598
+ return __asyncGenerator(this, null, function* () {
599
+ });
529
600
  }).prototype);
530
601
  class ReadableStreamAsyncIteratorImpl {
531
602
  constructor(reader, preventCancel) {
@@ -629,7 +700,7 @@ var require_ponyfill_es2018 = __commonJS({
629
700
  }
630
701
  try {
631
702
  return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
632
- } catch (_a) {
703
+ } catch (_a4) {
633
704
  return false;
634
705
  }
635
706
  }
@@ -1522,7 +1593,7 @@ var require_ponyfill_es2018 = __commonJS({
1522
1593
  }
1523
1594
  try {
1524
1595
  return typeof value.aborted === "boolean";
1525
- } catch (_a) {
1596
+ } catch (_a4) {
1526
1597
  return false;
1527
1598
  }
1528
1599
  }
@@ -1663,12 +1734,12 @@ var require_ponyfill_es2018 = __commonJS({
1663
1734
  return true;
1664
1735
  }
1665
1736
  function WritableStreamAbort(stream, reason) {
1666
- var _a;
1737
+ var _a4;
1667
1738
  if (stream._state === "closed" || stream._state === "errored") {
1668
1739
  return promiseResolvedWith(void 0);
1669
1740
  }
1670
1741
  stream._writableStreamController._abortReason = reason;
1671
- (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort();
1742
+ (_a4 = stream._writableStreamController._abortController) === null || _a4 === void 0 ? void 0 : _a4.abort();
1672
1743
  const state = stream._state;
1673
1744
  if (state === "closed" || state === "errored") {
1674
1745
  return promiseResolvedWith(void 0);
@@ -2398,7 +2469,7 @@ var require_ponyfill_es2018 = __commonJS({
2398
2469
  try {
2399
2470
  new ctor();
2400
2471
  return true;
2401
- } catch (_a) {
2472
+ } catch (_a4) {
2402
2473
  return false;
2403
2474
  }
2404
2475
  }
@@ -3454,7 +3525,7 @@ var require_ponyfill_es2018 = __commonJS({
3454
3525
  value: "size",
3455
3526
  configurable: true
3456
3527
  });
3457
- } catch (_a) {
3528
+ } catch (_a4) {
3458
3529
  }
3459
3530
  class ByteLengthQueuingStrategy {
3460
3531
  constructor(options) {
@@ -3511,7 +3582,7 @@ var require_ponyfill_es2018 = __commonJS({
3511
3582
  value: "size",
3512
3583
  configurable: true
3513
3584
  });
3514
- } catch (_a) {
3585
+ } catch (_a4) {
3515
3586
  }
3516
3587
  class CountQueuingStrategy {
3517
3588
  constructor(options) {
@@ -3913,9 +3984,9 @@ var require_streams = __commonJS({
3913
3984
  }
3914
3985
  }
3915
3986
  try {
3916
- const { Blob: Blob3 } = __require("buffer");
3917
- if (Blob3 && !Blob3.prototype.stream) {
3918
- Blob3.prototype.stream = function name(params) {
3987
+ const { Blob: Blob2 } = __require("buffer");
3988
+ if (Blob2 && !Blob2.prototype.stream) {
3989
+ Blob2.prototype.stream = function name(params) {
3919
3990
  let position = 0;
3920
3991
  const blob = this;
3921
3992
  return new ReadableStream({
@@ -3938,51 +4009,48 @@ var require_streams = __commonJS({
3938
4009
  });
3939
4010
 
3940
4011
  // node_modules/fetch-blob/index.js
3941
- async function* toIterator(parts, clone2 = true) {
3942
- for (const part of parts) {
3943
- if ("stream" in part) {
3944
- yield* (
3945
- /** @type {AsyncIterableIterator<Uint8Array>} */
3946
- part.stream()
3947
- );
3948
- } else if (ArrayBuffer.isView(part)) {
3949
- if (clone2) {
3950
- let position = part.byteOffset;
3951
- const end = part.byteOffset + part.byteLength;
3952
- while (position !== end) {
3953
- const size = Math.min(end - position, POOL_SIZE);
3954
- const chunk = part.buffer.slice(position, position + size);
3955
- position += chunk.byteLength;
3956
- yield new Uint8Array(chunk);
4012
+ function toIterator(parts, clone2 = true) {
4013
+ return __asyncGenerator(this, null, function* () {
4014
+ for (const part of parts) {
4015
+ if ("stream" in part) {
4016
+ yield* __yieldStar(
4017
+ /** @type {AsyncIterableIterator<Uint8Array>} */
4018
+ part.stream()
4019
+ );
4020
+ } else if (ArrayBuffer.isView(part)) {
4021
+ if (clone2) {
4022
+ let position = part.byteOffset;
4023
+ const end = part.byteOffset + part.byteLength;
4024
+ while (position !== end) {
4025
+ const size = Math.min(end - position, POOL_SIZE);
4026
+ const chunk = part.buffer.slice(position, position + size);
4027
+ position += chunk.byteLength;
4028
+ yield new Uint8Array(chunk);
4029
+ }
4030
+ } else {
4031
+ yield part;
3957
4032
  }
3958
4033
  } else {
3959
- yield part;
3960
- }
3961
- } else {
3962
- let position = 0, b = (
3963
- /** @type {Blob} */
3964
- part
3965
- );
3966
- while (position !== b.size) {
3967
- const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE));
3968
- const buffer = await chunk.arrayBuffer();
3969
- position += buffer.byteLength;
3970
- yield new Uint8Array(buffer);
4034
+ let position = 0, b = (
4035
+ /** @type {Blob} */
4036
+ part
4037
+ );
4038
+ while (position !== b.size) {
4039
+ const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE));
4040
+ const buffer = yield new __await(chunk.arrayBuffer());
4041
+ position += buffer.byteLength;
4042
+ yield new Uint8Array(buffer);
4043
+ }
3971
4044
  }
3972
4045
  }
3973
- }
4046
+ });
3974
4047
  }
3975
- var import_streams, POOL_SIZE, _Blob, Blob2, fetch_blob_default;
4048
+ var import_streams, POOL_SIZE, _parts, _type, _size, _endings, _a, _Blob, Blob, fetch_blob_default;
3976
4049
  var init_fetch_blob = __esm({
3977
4050
  "node_modules/fetch-blob/index.js"() {
3978
4051
  import_streams = __toESM(require_streams(), 1);
3979
4052
  POOL_SIZE = 65536;
3980
- _Blob = class Blob {
3981
- /** @type {Array.<(Blob|Uint8Array)>} */
3982
- #parts = [];
3983
- #type = "";
3984
- #size = 0;
3985
- #endings = "transparent";
4053
+ _Blob = (_a = class {
3986
4054
  /**
3987
4055
  * The Blob() constructor returns a new Blob object. The content
3988
4056
  * of the blob consists of the concatenation of the values given
@@ -3992,6 +4060,11 @@ var init_fetch_blob = __esm({
3992
4060
  * @param {{ type?: string, endings?: string }} [options]
3993
4061
  */
3994
4062
  constructor(blobParts = [], options = {}) {
4063
+ /** @type {Array.<(Blob|Uint8Array)>} */
4064
+ __privateAdd(this, _parts, []);
4065
+ __privateAdd(this, _type, "");
4066
+ __privateAdd(this, _size, 0);
4067
+ __privateAdd(this, _endings, "transparent");
3995
4068
  if (typeof blobParts !== "object" || blobParts === null) {
3996
4069
  throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
3997
4070
  }
@@ -4009,30 +4082,30 @@ var init_fetch_blob = __esm({
4009
4082
  part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength));
4010
4083
  } else if (element instanceof ArrayBuffer) {
4011
4084
  part = new Uint8Array(element.slice(0));
4012
- } else if (element instanceof Blob) {
4085
+ } else if (element instanceof _a) {
4013
4086
  part = element;
4014
4087
  } else {
4015
4088
  part = encoder.encode(`${element}`);
4016
4089
  }
4017
- this.#size += ArrayBuffer.isView(part) ? part.byteLength : part.size;
4018
- this.#parts.push(part);
4090
+ __privateSet(this, _size, __privateGet(this, _size) + (ArrayBuffer.isView(part) ? part.byteLength : part.size));
4091
+ __privateGet(this, _parts).push(part);
4019
4092
  }
4020
- this.#endings = `${options.endings === void 0 ? "transparent" : options.endings}`;
4093
+ __privateSet(this, _endings, `${options.endings === void 0 ? "transparent" : options.endings}`);
4021
4094
  const type = options.type === void 0 ? "" : String(options.type);
4022
- this.#type = /^[\x20-\x7E]*$/.test(type) ? type : "";
4095
+ __privateSet(this, _type, /^[\x20-\x7E]*$/.test(type) ? type : "");
4023
4096
  }
4024
4097
  /**
4025
4098
  * The Blob interface's size property returns the
4026
4099
  * size of the Blob in bytes.
4027
4100
  */
4028
4101
  get size() {
4029
- return this.#size;
4102
+ return __privateGet(this, _size);
4030
4103
  }
4031
4104
  /**
4032
4105
  * The type property of a Blob object returns the MIME type of the file.
4033
4106
  */
4034
4107
  get type() {
4035
- return this.#type;
4108
+ return __privateGet(this, _type);
4036
4109
  }
4037
4110
  /**
4038
4111
  * The text() method in the Blob interface returns a Promise
@@ -4044,8 +4117,20 @@ var init_fetch_blob = __esm({
4044
4117
  async text() {
4045
4118
  const decoder = new TextDecoder();
4046
4119
  let str = "";
4047
- for await (const part of toIterator(this.#parts, false)) {
4048
- str += decoder.decode(part, { stream: true });
4120
+ try {
4121
+ for (var iter = __forAwait(toIterator(__privateGet(this, _parts), false)), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
4122
+ const part = temp.value;
4123
+ str += decoder.decode(part, { stream: true });
4124
+ }
4125
+ } catch (temp) {
4126
+ error = [temp];
4127
+ } finally {
4128
+ try {
4129
+ more && (temp = iter.return) && await temp.call(iter);
4130
+ } finally {
4131
+ if (error)
4132
+ throw error[0];
4133
+ }
4049
4134
  }
4050
4135
  str += decoder.decode();
4051
4136
  return str;
@@ -4060,14 +4145,26 @@ var init_fetch_blob = __esm({
4060
4145
  async arrayBuffer() {
4061
4146
  const data = new Uint8Array(this.size);
4062
4147
  let offset = 0;
4063
- for await (const chunk of toIterator(this.#parts, false)) {
4064
- data.set(chunk, offset);
4065
- offset += chunk.length;
4148
+ try {
4149
+ for (var iter = __forAwait(toIterator(__privateGet(this, _parts), false)), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
4150
+ const chunk = temp.value;
4151
+ data.set(chunk, offset);
4152
+ offset += chunk.length;
4153
+ }
4154
+ } catch (temp) {
4155
+ error = [temp];
4156
+ } finally {
4157
+ try {
4158
+ more && (temp = iter.return) && await temp.call(iter);
4159
+ } finally {
4160
+ if (error)
4161
+ throw error[0];
4162
+ }
4066
4163
  }
4067
4164
  return data.buffer;
4068
4165
  }
4069
4166
  stream() {
4070
- const it = toIterator(this.#parts, true);
4167
+ const it = toIterator(__privateGet(this, _parts), true);
4071
4168
  return new globalThis.ReadableStream({
4072
4169
  // @ts-ignore
4073
4170
  type: "bytes",
@@ -4094,7 +4191,7 @@ var init_fetch_blob = __esm({
4094
4191
  let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);
4095
4192
  let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);
4096
4193
  const span = Math.max(relativeEnd - relativeStart, 0);
4097
- const parts = this.#parts;
4194
+ const parts = __privateGet(this, _parts);
4098
4195
  const blobParts = [];
4099
4196
  let added = 0;
4100
4197
  for (const part of parts) {
@@ -4119,9 +4216,9 @@ var init_fetch_blob = __esm({
4119
4216
  relativeStart = 0;
4120
4217
  }
4121
4218
  }
4122
- const blob = new Blob([], { type: String(type).toLowerCase() });
4123
- blob.#size = span;
4124
- blob.#parts = blobParts;
4219
+ const blob = new _a([], { type: String(type).toLowerCase() });
4220
+ __privateSet(blob, _size, span);
4221
+ __privateSet(blob, _parts, blobParts);
4125
4222
  return blob;
4126
4223
  }
4127
4224
  get [Symbol.toStringTag]() {
@@ -4130,25 +4227,23 @@ var init_fetch_blob = __esm({
4130
4227
  static [Symbol.hasInstance](object) {
4131
4228
  return object && typeof object === "object" && typeof object.constructor === "function" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);
4132
4229
  }
4133
- };
4230
+ }, _parts = new WeakMap(), _type = new WeakMap(), _size = new WeakMap(), _endings = new WeakMap(), _a);
4134
4231
  Object.defineProperties(_Blob.prototype, {
4135
4232
  size: { enumerable: true },
4136
4233
  type: { enumerable: true },
4137
4234
  slice: { enumerable: true }
4138
4235
  });
4139
- Blob2 = _Blob;
4140
- fetch_blob_default = Blob2;
4236
+ Blob = _Blob;
4237
+ fetch_blob_default = Blob;
4141
4238
  }
4142
4239
  });
4143
4240
 
4144
4241
  // node_modules/fetch-blob/file.js
4145
- var _File, File2, file_default;
4242
+ var _lastModified, _name, _a2, _File, File, file_default;
4146
4243
  var init_file = __esm({
4147
4244
  "node_modules/fetch-blob/file.js"() {
4148
4245
  init_fetch_blob();
4149
- _File = class File extends fetch_blob_default {
4150
- #lastModified = 0;
4151
- #name = "";
4246
+ _File = (_a2 = class extends fetch_blob_default {
4152
4247
  /**
4153
4248
  * @param {*[]} fileBits
4154
4249
  * @param {string} fileName
@@ -4160,18 +4255,20 @@ var init_file = __esm({
4160
4255
  throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
4161
4256
  }
4162
4257
  super(fileBits, options);
4258
+ __privateAdd(this, _lastModified, 0);
4259
+ __privateAdd(this, _name, "");
4163
4260
  if (options === null) options = {};
4164
4261
  const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified);
4165
4262
  if (!Number.isNaN(lastModified)) {
4166
- this.#lastModified = lastModified;
4263
+ __privateSet(this, _lastModified, lastModified);
4167
4264
  }
4168
- this.#name = String(fileName);
4265
+ __privateSet(this, _name, String(fileName));
4169
4266
  }
4170
4267
  get name() {
4171
- return this.#name;
4268
+ return __privateGet(this, _name);
4172
4269
  }
4173
4270
  get lastModified() {
4174
- return this.#lastModified;
4271
+ return __privateGet(this, _lastModified);
4175
4272
  }
4176
4273
  get [Symbol.toStringTag]() {
4177
4274
  return "File";
@@ -4179,9 +4276,9 @@ var init_file = __esm({
4179
4276
  static [Symbol.hasInstance](object) {
4180
4277
  return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]);
4181
4278
  }
4182
- };
4183
- File2 = _File;
4184
- file_default = File2;
4279
+ }, _lastModified = new WeakMap(), _name = new WeakMap(), _a2);
4280
+ File = _File;
4281
+ file_default = File;
4185
4282
  }
4186
4283
  });
4187
4284
 
@@ -4191,7 +4288,7 @@ function formDataToBlob(F2, B = fetch_blob_default) {
4191
4288
  Content-Disposition: form-data; name="`;
4192
4289
  F2.forEach((v, n) => typeof v == "string" ? c.push(p + e(n) + `"\r
4193
4290
  \r
4194
- ${v.replace(/\r(?!\n)|(?<!\r)\n/g, "\r\n")}\r
4291
+ ${v.replace(new RegExp("\\r(?!\\n)|(?<!\\r)\\n", "g"), "\r\n")}\r
4195
4292
  `) : c.push(p + e(n) + `"; filename="${e(v.name, 1)}"\r
4196
4293
  Content-Type: ${v.type || "application/octet-stream"}\r
4197
4294
  \r
@@ -4199,7 +4296,7 @@ Content-Type: ${v.type || "application/octet-stream"}\r
4199
4296
  c.push(`--${b}--`);
4200
4297
  return new B(c, { type: "multipart/form-data; boundary=" + b });
4201
4298
  }
4202
- var t, i, h, r, m, f, e, x, FormData;
4299
+ var t, i, h, r, m, f, e, x, _d, _a3, FormData;
4203
4300
  var init_esm_min = __esm({
4204
4301
  "node_modules/formdata-polyfill/esm.min.js"() {
4205
4302
  init_fetch_blob();
@@ -4214,9 +4311,9 @@ var init_esm_min = __esm({
4214
4311
  throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`);
4215
4312
  }
4216
4313
  };
4217
- FormData = class FormData2 {
4218
- #d = [];
4314
+ FormData = (_a3 = class {
4219
4315
  constructor(...a) {
4316
+ __privateAdd(this, _d, []);
4220
4317
  if (a.length) throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`);
4221
4318
  }
4222
4319
  get [t]() {
@@ -4230,30 +4327,30 @@ var init_esm_min = __esm({
4230
4327
  }
4231
4328
  append(...a) {
4232
4329
  x("append", arguments, 2);
4233
- this.#d.push(f(...a));
4330
+ __privateGet(this, _d).push(f(...a));
4234
4331
  }
4235
4332
  delete(a) {
4236
4333
  x("delete", arguments, 1);
4237
4334
  a += "";
4238
- this.#d = this.#d.filter(([b]) => b !== a);
4335
+ __privateSet(this, _d, __privateGet(this, _d).filter(([b]) => b !== a));
4239
4336
  }
4240
4337
  get(a) {
4241
4338
  x("get", arguments, 1);
4242
4339
  a += "";
4243
- for (var b = this.#d, l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1];
4340
+ for (var b = __privateGet(this, _d), l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1];
4244
4341
  return null;
4245
4342
  }
4246
4343
  getAll(a, b) {
4247
4344
  x("getAll", arguments, 1);
4248
4345
  b = [];
4249
4346
  a += "";
4250
- this.#d.forEach((c) => c[0] === a && b.push(c[1]));
4347
+ __privateGet(this, _d).forEach((c) => c[0] === a && b.push(c[1]));
4251
4348
  return b;
4252
4349
  }
4253
4350
  has(a) {
4254
4351
  x("has", arguments, 1);
4255
4352
  a += "";
4256
- return this.#d.some((b) => b[0] === a);
4353
+ return __privateGet(this, _d).some((b) => b[0] === a);
4257
4354
  }
4258
4355
  forEach(a, b) {
4259
4356
  x("forEach", arguments, 1);
@@ -4263,14 +4360,14 @@ var init_esm_min = __esm({
4263
4360
  x("set", arguments, 2);
4264
4361
  var b = [], c = true;
4265
4362
  a = f(...a);
4266
- this.#d.forEach((d) => {
4363
+ __privateGet(this, _d).forEach((d) => {
4267
4364
  d[0] === a[0] ? c && (c = !b.push(a)) : b.push(d);
4268
4365
  });
4269
4366
  c && b.push(a);
4270
- this.#d = b;
4367
+ __privateSet(this, _d, b);
4271
4368
  }
4272
4369
  *entries() {
4273
- yield* this.#d;
4370
+ yield* __yieldStar(__privateGet(this, _d));
4274
4371
  }
4275
4372
  *keys() {
4276
4373
  for (var [a] of this) yield a;
@@ -4278,7 +4375,7 @@ var init_esm_min = __esm({
4278
4375
  *values() {
4279
4376
  for (var [, a] of this) yield a;
4280
4377
  }
4281
- };
4378
+ }, _d = new WeakMap(), _a3);
4282
4379
  }
4283
4380
  });
4284
4381
 
@@ -4369,7 +4466,7 @@ var require_node_domexception = __commonJS({
4369
4466
  // node_modules/fetch-blob/from.js
4370
4467
  import { statSync, createReadStream, promises as fs } from "fs";
4371
4468
  import { basename } from "path";
4372
- var import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem;
4469
+ var import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, _path, _start, _BlobDataItem, BlobDataItem;
4373
4470
  var init_from = __esm({
4374
4471
  "node_modules/fetch-blob/from.js"() {
4375
4472
  import_node_domexception = __toESM(require_node_domexception(), 1);
@@ -4392,12 +4489,12 @@ var init_from = __esm({
4392
4489
  lastModified: stat2.mtimeMs,
4393
4490
  start: 0
4394
4491
  })], basename(path), { type, lastModified: stat2.mtimeMs });
4395
- BlobDataItem = class _BlobDataItem {
4396
- #path;
4397
- #start;
4492
+ _BlobDataItem = class _BlobDataItem {
4398
4493
  constructor(options) {
4399
- this.#path = options.path;
4400
- this.#start = options.start;
4494
+ __privateAdd(this, _path);
4495
+ __privateAdd(this, _start);
4496
+ __privateSet(this, _path, options.path);
4497
+ __privateSet(this, _start, options.start);
4401
4498
  this.size = options.size;
4402
4499
  this.lastModified = options.lastModified;
4403
4500
  }
@@ -4407,26 +4504,31 @@ var init_from = __esm({
4407
4504
  */
4408
4505
  slice(start, end) {
4409
4506
  return new _BlobDataItem({
4410
- path: this.#path,
4507
+ path: __privateGet(this, _path),
4411
4508
  lastModified: this.lastModified,
4412
4509
  size: end - start,
4413
- start: this.#start + start
4510
+ start: __privateGet(this, _start) + start
4414
4511
  });
4415
4512
  }
4416
- async *stream() {
4417
- const { mtimeMs } = await stat(this.#path);
4418
- if (mtimeMs > this.lastModified) {
4419
- throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
4420
- }
4421
- yield* createReadStream(this.#path, {
4422
- start: this.#start,
4423
- end: this.#start + this.size - 1
4513
+ stream() {
4514
+ return __asyncGenerator(this, null, function* () {
4515
+ const { mtimeMs } = yield new __await(stat(__privateGet(this, _path)));
4516
+ if (mtimeMs > this.lastModified) {
4517
+ throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
4518
+ }
4519
+ yield* __yieldStar(createReadStream(__privateGet(this, _path), {
4520
+ start: __privateGet(this, _start),
4521
+ end: __privateGet(this, _start) + this.size - 1
4522
+ }));
4424
4523
  });
4425
4524
  }
4426
4525
  get [Symbol.toStringTag]() {
4427
4526
  return "Blob";
4428
4527
  }
4429
4528
  };
4529
+ _path = new WeakMap();
4530
+ _start = new WeakMap();
4531
+ BlobDataItem = _BlobDataItem;
4430
4532
  }
4431
4533
  });
4432
4534
 
@@ -4516,8 +4618,20 @@ async function toFormData(Body2, ct) {
4516
4618
  headerValue = "";
4517
4619
  headerField = "";
4518
4620
  };
4519
- for await (const chunk of Body2) {
4520
- parser.write(chunk);
4621
+ try {
4622
+ for (var iter = __forAwait(Body2), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
4623
+ const chunk = temp.value;
4624
+ parser.write(chunk);
4625
+ }
4626
+ } catch (temp) {
4627
+ error = [temp];
4628
+ } finally {
4629
+ try {
4630
+ more && (temp = iter.return) && await temp.call(iter);
4631
+ } finally {
4632
+ if (error)
4633
+ throw error[0];
4634
+ }
4521
4635
  }
4522
4636
  parser.end();
4523
4637
  return formData;
@@ -4814,17 +4928,29 @@ async function consumeBody(data) {
4814
4928
  const accum = [];
4815
4929
  let accumBytes = 0;
4816
4930
  try {
4817
- for await (const chunk of body) {
4818
- if (data.size > 0 && accumBytes + chunk.length > data.size) {
4819
- const error = new FetchError(`content size at ${data.url} over limit: ${data.size}`, "max-size");
4820
- body.destroy(error);
4821
- throw error;
4931
+ try {
4932
+ for (var iter = __forAwait(body), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
4933
+ const chunk = temp.value;
4934
+ if (data.size > 0 && accumBytes + chunk.length > data.size) {
4935
+ const error2 = new FetchError(`content size at ${data.url} over limit: ${data.size}`, "max-size");
4936
+ body.destroy(error2);
4937
+ throw error2;
4938
+ }
4939
+ accumBytes += chunk.length;
4940
+ accum.push(chunk);
4941
+ }
4942
+ } catch (temp) {
4943
+ error = [temp];
4944
+ } finally {
4945
+ try {
4946
+ more && (temp = iter.return) && await temp.call(iter);
4947
+ } finally {
4948
+ if (error)
4949
+ throw error[0];
4822
4950
  }
4823
- accumBytes += chunk.length;
4824
- accum.push(chunk);
4825
4951
  }
4826
- } catch (error) {
4827
- const error_ = error instanceof FetchBaseError ? error : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error.message}`, "system", error);
4952
+ } catch (error2) {
4953
+ const error_ = error2 instanceof FetchBaseError ? error2 : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error2.message}`, "system", error2);
4828
4954
  throw error_;
4829
4955
  }
4830
4956
  if (body.readableEnded === true || body._readableState.ended === true) {
@@ -4833,8 +4959,8 @@ async function consumeBody(data) {
4833
4959
  return Buffer2.from(accum.join(""));
4834
4960
  }
4835
4961
  return Buffer2.concat(accum, accumBytes);
4836
- } catch (error) {
4837
- throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, "system", error);
4962
+ } catch (error2) {
4963
+ throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error2.message}`, "system", error2);
4838
4964
  }
4839
4965
  } else {
4840
4966
  throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`);
@@ -5065,7 +5191,7 @@ function fromRawHeaders(headers = []) {
5065
5191
  validateHeaderName(name);
5066
5192
  validateHeaderValue(name, String(value));
5067
5193
  return true;
5068
- } catch {
5194
+ } catch (e2) {
5069
5195
  return false;
5070
5196
  }
5071
5197
  })
@@ -5356,10 +5482,9 @@ var init_response = __esm({
5356
5482
  if (!headers.has("content-type")) {
5357
5483
  headers.set("content-type", "application/json");
5358
5484
  }
5359
- return new _Response(body, {
5360
- ...init,
5485
+ return new _Response(body, __spreadProps(__spreadValues({}, init), {
5361
5486
  headers
5362
- });
5487
+ }));
5363
5488
  }
5364
5489
  get [Symbol.toStringTag]() {
5365
5490
  return "Response";
@@ -5856,7 +5981,7 @@ async function fetch2(url, options_) {
5856
5981
  let locationURL = null;
5857
5982
  try {
5858
5983
  locationURL = location === null ? null : new URL(location, request.url);
5859
- } catch {
5984
+ } catch (e2) {
5860
5985
  if (request.redirect !== "manual") {
5861
5986
  reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect"));
5862
5987
  finalize();
@@ -6084,7 +6209,7 @@ function downloadFile(url, destination, headers) {
6084
6209
  async (resolve, reject) => {
6085
6210
  try {
6086
6211
  const fetcher = await getFetch();
6087
- const response = await fetcher(url, { headers: { ...headers || {} } });
6212
+ const response = await fetcher(url, { headers: __spreadValues({}, headers || {}) });
6088
6213
  if (!response.ok) {
6089
6214
  const { result: error } = await catchInline(response.text());
6090
6215
  throw new Error(`Error throwed while downloading file: ${error || "status code: " + response.status}`);
@@ -6097,10 +6222,13 @@ function downloadFile(url, destination, headers) {
6097
6222
  Readable.fromWeb(body).pipe(dest);
6098
6223
  }
6099
6224
  dest.on("finish", () => resolve(destination));
6100
- dest.on("error", (e2) => {
6101
- console.error("error downloading", url);
6102
- reject(e2);
6103
- });
6225
+ dest.on(
6226
+ "error",
6227
+ (e2) => {
6228
+ console.error("error downloading", url);
6229
+ reject(e2);
6230
+ }
6231
+ );
6104
6232
  } catch (e2) {
6105
6233
  console.error("error downloading", url);
6106
6234
  reject(e2);