@agentdocumentformat/cli 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/adf.mjs +162 -0
  4. package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
  5. package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
  6. package/dist/chunks/App-L5L37JI5.mjs +16747 -0
  7. package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
  8. package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
  9. package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
  10. package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
  11. package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
  12. package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
  13. package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
  14. package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
  15. package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
  16. package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
  17. package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
  18. package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
  19. package/dist/chunks/build-QF5W473T.mjs +60 -0
  20. package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
  21. package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
  22. package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
  23. package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
  24. package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
  25. package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
  26. package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
  27. package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
  28. package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
  29. package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
  30. package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
  31. package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
  32. package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
  33. package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
  34. package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
  35. package/dist/chunks/chunk-776TSXEP.mjs +43 -0
  36. package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
  37. package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
  38. package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
  39. package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
  40. package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
  41. package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
  42. package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
  43. package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
  44. package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
  45. package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
  46. package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
  47. package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
  48. package/dist/chunks/chunk-G426FACA.mjs +49 -0
  49. package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
  50. package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
  51. package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
  52. package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
  53. package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
  54. package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
  55. package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
  56. package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
  57. package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
  58. package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
  59. package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
  60. package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
  61. package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
  62. package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
  63. package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
  64. package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
  65. package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
  66. package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
  67. package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
  68. package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
  69. package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
  70. package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
  71. package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
  72. package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
  73. package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
  74. package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
  75. package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
  76. package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
  77. package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
  78. package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
  79. package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
  80. package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
  81. package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
  82. package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
  83. package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
  84. package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
  85. package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
  86. package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
  87. package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
  88. package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
  89. package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
  90. package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
  91. package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
  92. package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
  93. package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
  94. package/dist/chunks/environment-NX277MQG.mjs +15 -0
  95. package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
  96. package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
  97. package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
  98. package/dist/chunks/open-OTQDGDH5.mjs +36 -0
  99. package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
  100. package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
  101. package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
  102. package/dist/chunks/screen-54BUTYCW.mjs +27 -0
  103. package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
  104. package/dist/chunks/store-WR7TZJZS.mjs +32 -0
  105. package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
  106. package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
  107. package/dist/chunks/theme-NORU4J74.mjs +20 -0
  108. package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
  109. package/dist/chunks/token-6G3HCMNX.mjs +54 -0
  110. package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
  111. package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
  112. package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
  113. package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
  114. package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
  115. package/package.json +53 -0
  116. package/resources/wasm/coreutils.LICENSE +18 -0
  117. package/resources/wasm/coreutils.wasm +0 -0
@@ -0,0 +1,1434 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ __commonJS,
9
+ __require
10
+ } from "./chunk-M2RX3S2T.mjs";
11
+
12
+ // node_modules/pino-std-serializers/lib/err-helpers.js
13
+ var require_err_helpers = __commonJS({
14
+ "node_modules/pino-std-serializers/lib/err-helpers.js"(exports, module) {
15
+ "use strict";
16
+ var isErrorLike = (err) => err && typeof err.message == "string", getErrorCause = (err) => {
17
+ if (!err) return;
18
+ let cause = err.cause;
19
+ if (typeof cause == "function") {
20
+ let causeResult = err.cause();
21
+ return isErrorLike(causeResult) ? causeResult : void 0;
22
+ } else
23
+ return isErrorLike(cause) ? cause : void 0;
24
+ }, _stackWithCauses = (err, seen) => {
25
+ if (!isErrorLike(err)) return "";
26
+ let stack = err.stack || "";
27
+ if (seen.has(err))
28
+ return stack + `
29
+ causes have become circular...`;
30
+ let cause = getErrorCause(err);
31
+ return cause ? (seen.add(err), stack + `
32
+ caused by: ` + _stackWithCauses(cause, seen)) : stack;
33
+ }, stackWithCauses = (err) => _stackWithCauses(err, /* @__PURE__ */ new Set()), _messageWithCauses = (err, seen, skip) => {
34
+ if (!isErrorLike(err)) return "";
35
+ let message = skip ? "" : err.message || "";
36
+ if (seen.has(err))
37
+ return message + ": ...";
38
+ let cause = getErrorCause(err);
39
+ if (cause) {
40
+ seen.add(err);
41
+ let skipIfVErrorStyleCause = typeof err.cause == "function";
42
+ return message + (skipIfVErrorStyleCause ? "" : ": ") + _messageWithCauses(cause, seen, skipIfVErrorStyleCause);
43
+ } else
44
+ return message;
45
+ }, messageWithCauses = (err) => _messageWithCauses(err, /* @__PURE__ */ new Set());
46
+ module.exports = {
47
+ isErrorLike,
48
+ getErrorCause,
49
+ stackWithCauses,
50
+ messageWithCauses
51
+ };
52
+ }
53
+ });
54
+
55
+ // node_modules/pino-std-serializers/lib/err-proto.js
56
+ var require_err_proto = __commonJS({
57
+ "node_modules/pino-std-serializers/lib/err-proto.js"(exports, module) {
58
+ "use strict";
59
+ var seen = /* @__PURE__ */ Symbol("circular-ref-tag"), rawSymbol = /* @__PURE__ */ Symbol("pino-raw-err-ref"), pinoErrProto = Object.create({}, {
60
+ type: {
61
+ enumerable: !0,
62
+ writable: !0,
63
+ value: void 0
64
+ },
65
+ message: {
66
+ enumerable: !0,
67
+ writable: !0,
68
+ value: void 0
69
+ },
70
+ stack: {
71
+ enumerable: !0,
72
+ writable: !0,
73
+ value: void 0
74
+ },
75
+ aggregateErrors: {
76
+ enumerable: !0,
77
+ writable: !0,
78
+ value: void 0
79
+ },
80
+ raw: {
81
+ enumerable: !1,
82
+ get: function() {
83
+ return this[rawSymbol];
84
+ },
85
+ set: function(val) {
86
+ this[rawSymbol] = val;
87
+ }
88
+ }
89
+ });
90
+ Object.defineProperty(pinoErrProto, rawSymbol, {
91
+ writable: !0,
92
+ value: {}
93
+ });
94
+ module.exports = {
95
+ pinoErrProto,
96
+ pinoErrorSymbols: {
97
+ seen,
98
+ rawSymbol
99
+ }
100
+ };
101
+ }
102
+ });
103
+
104
+ // node_modules/pino-std-serializers/lib/err.js
105
+ var require_err = __commonJS({
106
+ "node_modules/pino-std-serializers/lib/err.js"(exports, module) {
107
+ "use strict";
108
+ module.exports = errSerializer;
109
+ var { messageWithCauses, stackWithCauses, isErrorLike } = require_err_helpers(), { pinoErrProto, pinoErrorSymbols } = require_err_proto(), { seen } = pinoErrorSymbols, { toString } = Object.prototype;
110
+ function errSerializer(err) {
111
+ if (!isErrorLike(err))
112
+ return err;
113
+ err[seen] = void 0;
114
+ let _err = Object.create(pinoErrProto);
115
+ _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name, _err.message = messageWithCauses(err), _err.stack = stackWithCauses(err), Array.isArray(err.errors) && (_err.aggregateErrors = err.errors.map((err2) => errSerializer(err2)));
116
+ for (let key in err)
117
+ if (_err[key] === void 0) {
118
+ let val = err[key];
119
+ isErrorLike(val) ? key !== "cause" && !Object.prototype.hasOwnProperty.call(val, seen) && (_err[key] = errSerializer(val)) : _err[key] = val;
120
+ }
121
+ return delete err[seen], _err.raw = err, _err;
122
+ }
123
+ }
124
+ });
125
+
126
+ // node_modules/pino-std-serializers/lib/err-with-cause.js
127
+ var require_err_with_cause = __commonJS({
128
+ "node_modules/pino-std-serializers/lib/err-with-cause.js"(exports, module) {
129
+ "use strict";
130
+ module.exports = errWithCauseSerializer;
131
+ var { isErrorLike } = require_err_helpers(), { pinoErrProto, pinoErrorSymbols } = require_err_proto(), { seen } = pinoErrorSymbols, { toString } = Object.prototype;
132
+ function errWithCauseSerializer(err) {
133
+ if (!isErrorLike(err))
134
+ return err;
135
+ err[seen] = void 0;
136
+ let _err = Object.create(pinoErrProto);
137
+ _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name, _err.message = err.message, _err.stack = err.stack, Array.isArray(err.errors) && (_err.aggregateErrors = err.errors.map((err2) => errWithCauseSerializer(err2))), isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen) && (_err.cause = errWithCauseSerializer(err.cause));
138
+ for (let key in err)
139
+ if (_err[key] === void 0) {
140
+ let val = err[key];
141
+ isErrorLike(val) ? Object.prototype.hasOwnProperty.call(val, seen) || (_err[key] = errWithCauseSerializer(val)) : _err[key] = val;
142
+ }
143
+ return delete err[seen], _err.raw = err, _err;
144
+ }
145
+ }
146
+ });
147
+
148
+ // node_modules/pino-std-serializers/lib/req.js
149
+ var require_req = __commonJS({
150
+ "node_modules/pino-std-serializers/lib/req.js"(exports, module) {
151
+ "use strict";
152
+ module.exports = {
153
+ mapHttpRequest,
154
+ reqSerializer
155
+ };
156
+ var rawSymbol = /* @__PURE__ */ Symbol("pino-raw-req-ref"), pinoReqProto = Object.create({}, {
157
+ id: {
158
+ enumerable: !0,
159
+ writable: !0,
160
+ value: ""
161
+ },
162
+ method: {
163
+ enumerable: !0,
164
+ writable: !0,
165
+ value: ""
166
+ },
167
+ url: {
168
+ enumerable: !0,
169
+ writable: !0,
170
+ value: ""
171
+ },
172
+ query: {
173
+ enumerable: !0,
174
+ writable: !0,
175
+ value: ""
176
+ },
177
+ params: {
178
+ enumerable: !0,
179
+ writable: !0,
180
+ value: ""
181
+ },
182
+ headers: {
183
+ enumerable: !0,
184
+ writable: !0,
185
+ value: {}
186
+ },
187
+ remoteAddress: {
188
+ enumerable: !0,
189
+ writable: !0,
190
+ value: ""
191
+ },
192
+ remotePort: {
193
+ enumerable: !0,
194
+ writable: !0,
195
+ value: ""
196
+ },
197
+ raw: {
198
+ enumerable: !1,
199
+ get: function() {
200
+ return this[rawSymbol];
201
+ },
202
+ set: function(val) {
203
+ this[rawSymbol] = val;
204
+ }
205
+ }
206
+ });
207
+ Object.defineProperty(pinoReqProto, rawSymbol, {
208
+ writable: !0,
209
+ value: {}
210
+ });
211
+ function reqSerializer(req) {
212
+ let connection = req.info || req.socket, _req = Object.create(pinoReqProto);
213
+ if (_req.id = typeof req.id == "function" ? req.id() : req.id || (req.info ? req.info.id : void 0), _req.method = req.method, req.originalUrl)
214
+ _req.url = req.originalUrl;
215
+ else {
216
+ let path = req.path;
217
+ _req.url = typeof path == "string" ? path : req.url ? req.url.path || req.url : void 0;
218
+ }
219
+ return req.query && (_req.query = req.query), req.params && (_req.params = req.params), _req.headers = req.headers, _req.remoteAddress = connection && connection.remoteAddress, _req.remotePort = connection && connection.remotePort, _req.raw = req.raw || req, _req;
220
+ }
221
+ function mapHttpRequest(req) {
222
+ return {
223
+ req: reqSerializer(req)
224
+ };
225
+ }
226
+ }
227
+ });
228
+
229
+ // node_modules/pino-std-serializers/lib/res.js
230
+ var require_res = __commonJS({
231
+ "node_modules/pino-std-serializers/lib/res.js"(exports, module) {
232
+ "use strict";
233
+ module.exports = {
234
+ mapHttpResponse,
235
+ resSerializer
236
+ };
237
+ var rawSymbol = /* @__PURE__ */ Symbol("pino-raw-res-ref"), pinoResProto = Object.create({}, {
238
+ statusCode: {
239
+ enumerable: !0,
240
+ writable: !0,
241
+ value: 0
242
+ },
243
+ headers: {
244
+ enumerable: !0,
245
+ writable: !0,
246
+ value: ""
247
+ },
248
+ raw: {
249
+ enumerable: !1,
250
+ get: function() {
251
+ return this[rawSymbol];
252
+ },
253
+ set: function(val) {
254
+ this[rawSymbol] = val;
255
+ }
256
+ }
257
+ });
258
+ Object.defineProperty(pinoResProto, rawSymbol, {
259
+ writable: !0,
260
+ value: {}
261
+ });
262
+ function resSerializer(res) {
263
+ let _res = Object.create(pinoResProto);
264
+ return _res.statusCode = res.headersSent ? res.statusCode : null, _res.headers = res.getHeaders ? res.getHeaders() : res._headers, _res.raw = res, _res;
265
+ }
266
+ function mapHttpResponse(res) {
267
+ return {
268
+ res: resSerializer(res)
269
+ };
270
+ }
271
+ }
272
+ });
273
+
274
+ // node_modules/pino-std-serializers/index.js
275
+ var require_pino_std_serializers = __commonJS({
276
+ "node_modules/pino-std-serializers/index.js"(exports, module) {
277
+ "use strict";
278
+ var errSerializer = require_err(), errWithCauseSerializer = require_err_with_cause(), reqSerializers = require_req(), resSerializers = require_res();
279
+ module.exports = {
280
+ err: errSerializer,
281
+ errWithCause: errWithCauseSerializer,
282
+ mapHttpRequest: reqSerializers.mapHttpRequest,
283
+ mapHttpResponse: resSerializers.mapHttpResponse,
284
+ req: reqSerializers.reqSerializer,
285
+ res: resSerializers.resSerializer,
286
+ wrapErrorSerializer: function(customSerializer) {
287
+ return customSerializer === errSerializer ? customSerializer : function(err) {
288
+ return customSerializer(errSerializer(err));
289
+ };
290
+ },
291
+ wrapRequestSerializer: function(customSerializer) {
292
+ return customSerializer === reqSerializers.reqSerializer ? customSerializer : function(req) {
293
+ return customSerializer(reqSerializers.reqSerializer(req));
294
+ };
295
+ },
296
+ wrapResponseSerializer: function(customSerializer) {
297
+ return customSerializer === resSerializers.resSerializer ? customSerializer : function(res) {
298
+ return customSerializer(resSerializers.resSerializer(res));
299
+ };
300
+ }
301
+ };
302
+ }
303
+ });
304
+
305
+ // node_modules/safe-stable-stringify/index.js
306
+ var require_safe_stable_stringify = __commonJS({
307
+ "node_modules/safe-stable-stringify/index.js"(exports, module) {
308
+ "use strict";
309
+ var { hasOwnProperty } = Object.prototype, stringify = configure();
310
+ stringify.configure = configure;
311
+ stringify.stringify = stringify;
312
+ stringify.default = stringify;
313
+ exports.stringify = stringify;
314
+ exports.configure = configure;
315
+ module.exports = stringify;
316
+ var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
317
+ function strEscape(str) {
318
+ return str.length < 5e3 && !strEscapeSequencesRegExp.test(str) ? `"${str}"` : JSON.stringify(str);
319
+ }
320
+ function sort(array, comparator) {
321
+ if (array.length > 200 || comparator)
322
+ return array.sort(comparator);
323
+ for (let i = 1; i < array.length; i++) {
324
+ let currentValue = array[i], position = i;
325
+ for (; position !== 0 && array[position - 1] > currentValue; )
326
+ array[position] = array[position - 1], position--;
327
+ array[position] = currentValue;
328
+ }
329
+ return array;
330
+ }
331
+ var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
332
+ Object.getPrototypeOf(
333
+ Object.getPrototypeOf(
334
+ new Int8Array()
335
+ )
336
+ ),
337
+ Symbol.toStringTag
338
+ ).get;
339
+ function isTypedArrayWithEntries(value) {
340
+ return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0;
341
+ }
342
+ function stringifyTypedArray(array, separator, maximumBreadth) {
343
+ array.length < maximumBreadth && (maximumBreadth = array.length);
344
+ let whitespace = separator === "," ? "" : " ", res = `"0":${whitespace}${array[0]}`;
345
+ for (let i = 1; i < maximumBreadth; i++)
346
+ res += `${separator}"${i}":${whitespace}${array[i]}`;
347
+ return res;
348
+ }
349
+ function getCircularValueOption(options) {
350
+ if (hasOwnProperty.call(options, "circularValue")) {
351
+ let circularValue = options.circularValue;
352
+ if (typeof circularValue == "string")
353
+ return `"${circularValue}"`;
354
+ if (circularValue == null)
355
+ return circularValue;
356
+ if (circularValue === Error || circularValue === TypeError)
357
+ return {
358
+ toString() {
359
+ throw new TypeError("Converting circular structure to JSON");
360
+ }
361
+ };
362
+ throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
363
+ }
364
+ return '"[Circular]"';
365
+ }
366
+ function getDeterministicOption(options) {
367
+ let value;
368
+ if (hasOwnProperty.call(options, "deterministic") && (value = options.deterministic, typeof value != "boolean" && typeof value != "function"))
369
+ throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
370
+ return value === void 0 ? !0 : value;
371
+ }
372
+ function getBooleanOption(options, key) {
373
+ let value;
374
+ if (hasOwnProperty.call(options, key) && (value = options[key], typeof value != "boolean"))
375
+ throw new TypeError(`The "${key}" argument must be of type boolean`);
376
+ return value === void 0 ? !0 : value;
377
+ }
378
+ function getPositiveIntegerOption(options, key) {
379
+ let value;
380
+ if (hasOwnProperty.call(options, key)) {
381
+ if (value = options[key], typeof value != "number")
382
+ throw new TypeError(`The "${key}" argument must be of type number`);
383
+ if (!Number.isInteger(value))
384
+ throw new TypeError(`The "${key}" argument must be an integer`);
385
+ if (value < 1)
386
+ throw new RangeError(`The "${key}" argument must be >= 1`);
387
+ }
388
+ return value === void 0 ? 1 / 0 : value;
389
+ }
390
+ function getItemCount(number) {
391
+ return number === 1 ? "1 item" : `${number} items`;
392
+ }
393
+ function getUniqueReplacerSet(replacerArray) {
394
+ let replacerSet = /* @__PURE__ */ new Set();
395
+ for (let value of replacerArray)
396
+ (typeof value == "string" || typeof value == "number") && replacerSet.add(String(value));
397
+ return replacerSet;
398
+ }
399
+ function getStrictOption(options) {
400
+ if (hasOwnProperty.call(options, "strict")) {
401
+ let value = options.strict;
402
+ if (typeof value != "boolean")
403
+ throw new TypeError('The "strict" argument must be of type boolean');
404
+ if (value)
405
+ return (value2) => {
406
+ let message = `Object can not safely be stringified. Received type ${typeof value2}`;
407
+ throw typeof value2 != "function" && (message += ` (${value2.toString()})`), new Error(message);
408
+ };
409
+ }
410
+ }
411
+ function configure(options) {
412
+ options = { ...options };
413
+ let fail = getStrictOption(options);
414
+ fail && (options.bigint === void 0 && (options.bigint = !1), "circularValue" in options || (options.circularValue = Error));
415
+ let circularValue = getCircularValueOption(options), bigint = getBooleanOption(options, "bigint"), deterministic = getDeterministicOption(options), comparator = typeof deterministic == "function" ? deterministic : void 0, maximumDepth = getPositiveIntegerOption(options, "maximumDepth"), maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
416
+ function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
417
+ let value = parent[key];
418
+ switch (typeof value == "object" && value !== null && typeof value.toJSON == "function" && (value = value.toJSON(key)), value = replacer.call(parent, key, value), typeof value) {
419
+ case "string":
420
+ return strEscape(value);
421
+ case "object": {
422
+ if (value === null)
423
+ return "null";
424
+ if (stack.indexOf(value) !== -1)
425
+ return circularValue;
426
+ let res = "", join = ",", originalIndentation = indentation;
427
+ if (Array.isArray(value)) {
428
+ if (value.length === 0)
429
+ return "[]";
430
+ if (maximumDepth < stack.length + 1)
431
+ return '"[Array]"';
432
+ stack.push(value), spacer !== "" && (indentation += spacer, res += `
433
+ ${indentation}`, join = `,
434
+ ${indentation}`);
435
+ let maximumValuesToStringify = Math.min(value.length, maximumBreadth), i = 0;
436
+ for (; i < maximumValuesToStringify - 1; i++) {
437
+ let tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
438
+ res += tmp2 !== void 0 ? tmp2 : "null", res += join;
439
+ }
440
+ let tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
441
+ if (res += tmp !== void 0 ? tmp : "null", value.length - 1 > maximumBreadth) {
442
+ let removedKeys = value.length - maximumBreadth - 1;
443
+ res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
444
+ }
445
+ return spacer !== "" && (res += `
446
+ ${originalIndentation}`), stack.pop(), `[${res}]`;
447
+ }
448
+ let keys = Object.keys(value), keyLength = keys.length;
449
+ if (keyLength === 0)
450
+ return "{}";
451
+ if (maximumDepth < stack.length + 1)
452
+ return '"[Object]"';
453
+ let whitespace = "", separator = "";
454
+ spacer !== "" && (indentation += spacer, join = `,
455
+ ${indentation}`, whitespace = " ");
456
+ let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
457
+ deterministic && !isTypedArrayWithEntries(value) && (keys = sort(keys, comparator)), stack.push(value);
458
+ for (let i = 0; i < maximumPropertiesToStringify; i++) {
459
+ let key2 = keys[i], tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
460
+ tmp !== void 0 && (res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`, separator = join);
461
+ }
462
+ if (keyLength > maximumBreadth) {
463
+ let removedKeys = keyLength - maximumBreadth;
464
+ res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`, separator = join;
465
+ }
466
+ return spacer !== "" && separator.length > 1 && (res = `
467
+ ${indentation}${res}
468
+ ${originalIndentation}`), stack.pop(), `{${res}}`;
469
+ }
470
+ case "number":
471
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
472
+ case "boolean":
473
+ return value === !0 ? "true" : "false";
474
+ case "undefined":
475
+ return;
476
+ case "bigint":
477
+ if (bigint)
478
+ return String(value);
479
+ // fallthrough
480
+ default:
481
+ return fail ? fail(value) : void 0;
482
+ }
483
+ }
484
+ function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
485
+ switch (typeof value == "object" && value !== null && typeof value.toJSON == "function" && (value = value.toJSON(key)), typeof value) {
486
+ case "string":
487
+ return strEscape(value);
488
+ case "object": {
489
+ if (value === null)
490
+ return "null";
491
+ if (stack.indexOf(value) !== -1)
492
+ return circularValue;
493
+ let originalIndentation = indentation, res = "", join = ",";
494
+ if (Array.isArray(value)) {
495
+ if (value.length === 0)
496
+ return "[]";
497
+ if (maximumDepth < stack.length + 1)
498
+ return '"[Array]"';
499
+ stack.push(value), spacer !== "" && (indentation += spacer, res += `
500
+ ${indentation}`, join = `,
501
+ ${indentation}`);
502
+ let maximumValuesToStringify = Math.min(value.length, maximumBreadth), i = 0;
503
+ for (; i < maximumValuesToStringify - 1; i++) {
504
+ let tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
505
+ res += tmp2 !== void 0 ? tmp2 : "null", res += join;
506
+ }
507
+ let tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
508
+ if (res += tmp !== void 0 ? tmp : "null", value.length - 1 > maximumBreadth) {
509
+ let removedKeys = value.length - maximumBreadth - 1;
510
+ res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
511
+ }
512
+ return spacer !== "" && (res += `
513
+ ${originalIndentation}`), stack.pop(), `[${res}]`;
514
+ }
515
+ stack.push(value);
516
+ let whitespace = "";
517
+ spacer !== "" && (indentation += spacer, join = `,
518
+ ${indentation}`, whitespace = " ");
519
+ let separator = "";
520
+ for (let key2 of replacer) {
521
+ let tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
522
+ tmp !== void 0 && (res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`, separator = join);
523
+ }
524
+ return spacer !== "" && separator.length > 1 && (res = `
525
+ ${indentation}${res}
526
+ ${originalIndentation}`), stack.pop(), `{${res}}`;
527
+ }
528
+ case "number":
529
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
530
+ case "boolean":
531
+ return value === !0 ? "true" : "false";
532
+ case "undefined":
533
+ return;
534
+ case "bigint":
535
+ if (bigint)
536
+ return String(value);
537
+ // fallthrough
538
+ default:
539
+ return fail ? fail(value) : void 0;
540
+ }
541
+ }
542
+ function stringifyIndent(key, value, stack, spacer, indentation) {
543
+ switch (typeof value) {
544
+ case "string":
545
+ return strEscape(value);
546
+ case "object": {
547
+ if (value === null)
548
+ return "null";
549
+ if (typeof value.toJSON == "function") {
550
+ if (value = value.toJSON(key), typeof value != "object")
551
+ return stringifyIndent(key, value, stack, spacer, indentation);
552
+ if (value === null)
553
+ return "null";
554
+ }
555
+ if (stack.indexOf(value) !== -1)
556
+ return circularValue;
557
+ let originalIndentation = indentation;
558
+ if (Array.isArray(value)) {
559
+ if (value.length === 0)
560
+ return "[]";
561
+ if (maximumDepth < stack.length + 1)
562
+ return '"[Array]"';
563
+ stack.push(value), indentation += spacer;
564
+ let res2 = `
565
+ ${indentation}`, join2 = `,
566
+ ${indentation}`, maximumValuesToStringify = Math.min(value.length, maximumBreadth), i = 0;
567
+ for (; i < maximumValuesToStringify - 1; i++) {
568
+ let tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
569
+ res2 += tmp2 !== void 0 ? tmp2 : "null", res2 += join2;
570
+ }
571
+ let tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
572
+ if (res2 += tmp !== void 0 ? tmp : "null", value.length - 1 > maximumBreadth) {
573
+ let removedKeys = value.length - maximumBreadth - 1;
574
+ res2 += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
575
+ }
576
+ return res2 += `
577
+ ${originalIndentation}`, stack.pop(), `[${res2}]`;
578
+ }
579
+ let keys = Object.keys(value), keyLength = keys.length;
580
+ if (keyLength === 0)
581
+ return "{}";
582
+ if (maximumDepth < stack.length + 1)
583
+ return '"[Object]"';
584
+ indentation += spacer;
585
+ let join = `,
586
+ ${indentation}`, res = "", separator = "", maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
587
+ isTypedArrayWithEntries(value) && (res += stringifyTypedArray(value, join, maximumBreadth), keys = keys.slice(value.length), maximumPropertiesToStringify -= value.length, separator = join), deterministic && (keys = sort(keys, comparator)), stack.push(value);
588
+ for (let i = 0; i < maximumPropertiesToStringify; i++) {
589
+ let key2 = keys[i], tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
590
+ tmp !== void 0 && (res += `${separator}${strEscape(key2)}: ${tmp}`, separator = join);
591
+ }
592
+ if (keyLength > maximumBreadth) {
593
+ let removedKeys = keyLength - maximumBreadth;
594
+ res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`, separator = join;
595
+ }
596
+ return separator !== "" && (res = `
597
+ ${indentation}${res}
598
+ ${originalIndentation}`), stack.pop(), `{${res}}`;
599
+ }
600
+ case "number":
601
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
602
+ case "boolean":
603
+ return value === !0 ? "true" : "false";
604
+ case "undefined":
605
+ return;
606
+ case "bigint":
607
+ if (bigint)
608
+ return String(value);
609
+ // fallthrough
610
+ default:
611
+ return fail ? fail(value) : void 0;
612
+ }
613
+ }
614
+ function stringifySimple(key, value, stack) {
615
+ switch (typeof value) {
616
+ case "string":
617
+ return strEscape(value);
618
+ case "object": {
619
+ if (value === null)
620
+ return "null";
621
+ if (typeof value.toJSON == "function") {
622
+ if (value = value.toJSON(key), typeof value != "object")
623
+ return stringifySimple(key, value, stack);
624
+ if (value === null)
625
+ return "null";
626
+ }
627
+ if (stack.indexOf(value) !== -1)
628
+ return circularValue;
629
+ let res = "", hasLength = value.length !== void 0;
630
+ if (hasLength && Array.isArray(value)) {
631
+ if (value.length === 0)
632
+ return "[]";
633
+ if (maximumDepth < stack.length + 1)
634
+ return '"[Array]"';
635
+ stack.push(value);
636
+ let maximumValuesToStringify = Math.min(value.length, maximumBreadth), i = 0;
637
+ for (; i < maximumValuesToStringify - 1; i++) {
638
+ let tmp2 = stringifySimple(String(i), value[i], stack);
639
+ res += tmp2 !== void 0 ? tmp2 : "null", res += ",";
640
+ }
641
+ let tmp = stringifySimple(String(i), value[i], stack);
642
+ if (res += tmp !== void 0 ? tmp : "null", value.length - 1 > maximumBreadth) {
643
+ let removedKeys = value.length - maximumBreadth - 1;
644
+ res += `,"... ${getItemCount(removedKeys)} not stringified"`;
645
+ }
646
+ return stack.pop(), `[${res}]`;
647
+ }
648
+ let keys = Object.keys(value), keyLength = keys.length;
649
+ if (keyLength === 0)
650
+ return "{}";
651
+ if (maximumDepth < stack.length + 1)
652
+ return '"[Object]"';
653
+ let separator = "", maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
654
+ hasLength && isTypedArrayWithEntries(value) && (res += stringifyTypedArray(value, ",", maximumBreadth), keys = keys.slice(value.length), maximumPropertiesToStringify -= value.length, separator = ","), deterministic && (keys = sort(keys, comparator)), stack.push(value);
655
+ for (let i = 0; i < maximumPropertiesToStringify; i++) {
656
+ let key2 = keys[i], tmp = stringifySimple(key2, value[key2], stack);
657
+ tmp !== void 0 && (res += `${separator}${strEscape(key2)}:${tmp}`, separator = ",");
658
+ }
659
+ if (keyLength > maximumBreadth) {
660
+ let removedKeys = keyLength - maximumBreadth;
661
+ res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
662
+ }
663
+ return stack.pop(), `{${res}}`;
664
+ }
665
+ case "number":
666
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
667
+ case "boolean":
668
+ return value === !0 ? "true" : "false";
669
+ case "undefined":
670
+ return;
671
+ case "bigint":
672
+ if (bigint)
673
+ return String(value);
674
+ // fallthrough
675
+ default:
676
+ return fail ? fail(value) : void 0;
677
+ }
678
+ }
679
+ function stringify2(value, replacer, space) {
680
+ if (arguments.length > 1) {
681
+ let spacer = "";
682
+ if (typeof space == "number" ? spacer = " ".repeat(Math.min(space, 10)) : typeof space == "string" && (spacer = space.slice(0, 10)), replacer != null) {
683
+ if (typeof replacer == "function")
684
+ return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
685
+ if (Array.isArray(replacer))
686
+ return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, "");
687
+ }
688
+ if (spacer.length !== 0)
689
+ return stringifyIndent("", value, [], spacer, "");
690
+ }
691
+ return stringifySimple("", value, []);
692
+ }
693
+ return stringify2;
694
+ }
695
+ }
696
+ });
697
+
698
+ // node_modules/@pinojs/redact/index.js
699
+ var require_redact = __commonJS({
700
+ "node_modules/@pinojs/redact/index.js"(exports, module) {
701
+ "use strict";
702
+ function deepClone(obj) {
703
+ if (obj === null || typeof obj != "object")
704
+ return obj;
705
+ if (obj instanceof Date)
706
+ return new Date(obj.getTime());
707
+ if (obj instanceof Array) {
708
+ let cloned = [];
709
+ for (let i = 0; i < obj.length; i++)
710
+ cloned[i] = deepClone(obj[i]);
711
+ return cloned;
712
+ }
713
+ if (typeof obj == "object") {
714
+ let cloned = Object.create(Object.getPrototypeOf(obj));
715
+ for (let key in obj)
716
+ Object.prototype.hasOwnProperty.call(obj, key) && (cloned[key] = deepClone(obj[key]));
717
+ return cloned;
718
+ }
719
+ return obj;
720
+ }
721
+ function parsePath(path) {
722
+ let parts = [], current = "", inBrackets = !1, inQuotes = !1, quoteChar = "";
723
+ for (let i = 0; i < path.length; i++) {
724
+ let char = path[i];
725
+ !inBrackets && char === "." ? current && (parts.push(current), current = "") : char === "[" ? (current && (parts.push(current), current = ""), inBrackets = !0) : char === "]" && inBrackets ? (parts.push(current), current = "", inBrackets = !1, inQuotes = !1) : (char === '"' || char === "'") && inBrackets ? inQuotes ? char === quoteChar ? (inQuotes = !1, quoteChar = "") : current += char : (inQuotes = !0, quoteChar = char) : current += char;
726
+ }
727
+ return current && parts.push(current), parts;
728
+ }
729
+ function setValue(obj, parts, value) {
730
+ let current = obj;
731
+ for (let i = 0; i < parts.length - 1; i++) {
732
+ let key = parts[i];
733
+ if (typeof current != "object" || current === null || !(key in current) || typeof current[key] != "object" || current[key] === null)
734
+ return !1;
735
+ current = current[key];
736
+ }
737
+ let lastKey = parts[parts.length - 1];
738
+ if (lastKey === "*") {
739
+ if (Array.isArray(current))
740
+ for (let i = 0; i < current.length; i++)
741
+ current[i] = value;
742
+ else if (typeof current == "object" && current !== null)
743
+ for (let key in current)
744
+ Object.prototype.hasOwnProperty.call(current, key) && (current[key] = value);
745
+ } else
746
+ typeof current == "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey) && (current[lastKey] = value);
747
+ return !0;
748
+ }
749
+ function removeKey(obj, parts) {
750
+ let current = obj;
751
+ for (let i = 0; i < parts.length - 1; i++) {
752
+ let key = parts[i];
753
+ if (typeof current != "object" || current === null || !(key in current) || typeof current[key] != "object" || current[key] === null)
754
+ return !1;
755
+ current = current[key];
756
+ }
757
+ let lastKey = parts[parts.length - 1];
758
+ if (lastKey === "*") {
759
+ if (Array.isArray(current))
760
+ for (let i = 0; i < current.length; i++)
761
+ current[i] = void 0;
762
+ else if (typeof current == "object" && current !== null)
763
+ for (let key in current)
764
+ Object.prototype.hasOwnProperty.call(current, key) && delete current[key];
765
+ } else
766
+ typeof current == "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey) && delete current[lastKey];
767
+ return !0;
768
+ }
769
+ var PATH_NOT_FOUND = /* @__PURE__ */ Symbol("PATH_NOT_FOUND");
770
+ function getValueIfExists(obj, parts) {
771
+ let current = obj;
772
+ for (let part of parts) {
773
+ if (current == null || typeof current != "object" || current === null || !(part in current))
774
+ return PATH_NOT_FOUND;
775
+ current = current[part];
776
+ }
777
+ return current;
778
+ }
779
+ function getValue(obj, parts) {
780
+ let current = obj;
781
+ for (let part of parts) {
782
+ if (current == null || typeof current != "object" || current === null)
783
+ return;
784
+ current = current[part];
785
+ }
786
+ return current;
787
+ }
788
+ function redactPaths(obj, paths, censor, remove = !1) {
789
+ for (let path of paths) {
790
+ let parts = parsePath(path);
791
+ if (parts.includes("*"))
792
+ redactWildcardPath(obj, parts, censor, path, remove);
793
+ else if (remove)
794
+ removeKey(obj, parts);
795
+ else {
796
+ let value = getValueIfExists(obj, parts);
797
+ if (value === PATH_NOT_FOUND)
798
+ continue;
799
+ let actualCensor = typeof censor == "function" ? censor(value, parts) : censor;
800
+ setValue(obj, parts, actualCensor);
801
+ }
802
+ }
803
+ }
804
+ function redactWildcardPath(obj, parts, censor, originalPath, remove = !1) {
805
+ let wildcardIndex = parts.indexOf("*");
806
+ if (wildcardIndex === parts.length - 1) {
807
+ let parentParts = parts.slice(0, -1), current = obj;
808
+ for (let part of parentParts) {
809
+ if (current == null || typeof current != "object" || current === null) return;
810
+ current = current[part];
811
+ }
812
+ if (Array.isArray(current))
813
+ if (remove)
814
+ for (let i = 0; i < current.length; i++)
815
+ current[i] = void 0;
816
+ else
817
+ for (let i = 0; i < current.length; i++) {
818
+ let indexPath = [...parentParts, i.toString()], actualCensor = typeof censor == "function" ? censor(current[i], indexPath) : censor;
819
+ current[i] = actualCensor;
820
+ }
821
+ else if (typeof current == "object" && current !== null)
822
+ if (remove) {
823
+ let keysToDelete = [];
824
+ for (let key in current)
825
+ Object.prototype.hasOwnProperty.call(current, key) && keysToDelete.push(key);
826
+ for (let key of keysToDelete)
827
+ delete current[key];
828
+ } else
829
+ for (let key in current) {
830
+ let keyPath = [...parentParts, key], actualCensor = typeof censor == "function" ? censor(current[key], keyPath) : censor;
831
+ current[key] = actualCensor;
832
+ }
833
+ } else
834
+ redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove);
835
+ }
836
+ function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = !1) {
837
+ let beforeWildcard = parts.slice(0, wildcardIndex), afterWildcard = parts.slice(wildcardIndex + 1), pathArray = [];
838
+ function traverse(current, pathLength) {
839
+ if (pathLength === beforeWildcard.length) {
840
+ if (Array.isArray(current))
841
+ for (let i = 0; i < current.length; i++)
842
+ pathArray[pathLength] = i.toString(), traverse(current[i], pathLength + 1);
843
+ else if (typeof current == "object" && current !== null)
844
+ for (let key in current)
845
+ pathArray[pathLength] = key, traverse(current[key], pathLength + 1);
846
+ } else if (pathLength < beforeWildcard.length) {
847
+ let nextKey = beforeWildcard[pathLength];
848
+ current && typeof current == "object" && current !== null && nextKey in current && (pathArray[pathLength] = nextKey, traverse(current[nextKey], pathLength + 1));
849
+ } else if (afterWildcard.includes("*"))
850
+ redactWildcardPath(current, afterWildcard, typeof censor == "function" ? (value, path) => {
851
+ let fullPath = [...pathArray.slice(0, pathLength), ...path];
852
+ return censor(value, fullPath);
853
+ } : censor, originalPath, remove);
854
+ else if (remove)
855
+ removeKey(current, afterWildcard);
856
+ else {
857
+ let actualCensor = typeof censor == "function" ? censor(getValue(current, afterWildcard), [...pathArray.slice(0, pathLength), ...afterWildcard]) : censor;
858
+ setValue(current, afterWildcard, actualCensor);
859
+ }
860
+ }
861
+ if (beforeWildcard.length === 0)
862
+ traverse(obj, 0);
863
+ else {
864
+ let current = obj;
865
+ for (let i = 0; i < beforeWildcard.length; i++) {
866
+ let part = beforeWildcard[i];
867
+ if (current == null || typeof current != "object" || current === null) return;
868
+ current = current[part], pathArray[i] = part;
869
+ }
870
+ current != null && traverse(current, beforeWildcard.length);
871
+ }
872
+ }
873
+ function buildPathStructure(pathsToClone) {
874
+ if (pathsToClone.length === 0)
875
+ return null;
876
+ let pathStructure = /* @__PURE__ */ new Map();
877
+ for (let path of pathsToClone) {
878
+ let parts = parsePath(path), current = pathStructure;
879
+ for (let i = 0; i < parts.length; i++) {
880
+ let part = parts[i];
881
+ current.has(part) || current.set(part, /* @__PURE__ */ new Map()), current = current.get(part);
882
+ }
883
+ }
884
+ return pathStructure;
885
+ }
886
+ function selectiveClone(obj, pathStructure) {
887
+ if (!pathStructure)
888
+ return obj;
889
+ function cloneSelectively(source, pathMap, depth = 0) {
890
+ if (!pathMap || pathMap.size === 0 || source === null || typeof source != "object")
891
+ return source;
892
+ if (source instanceof Date)
893
+ return new Date(source.getTime());
894
+ if (Array.isArray(source)) {
895
+ let cloned2 = [];
896
+ for (let i = 0; i < source.length; i++) {
897
+ let indexStr = i.toString();
898
+ pathMap.has(indexStr) || pathMap.has("*") ? cloned2[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get("*")) : cloned2[i] = source[i];
899
+ }
900
+ return cloned2;
901
+ }
902
+ let cloned = Object.create(Object.getPrototypeOf(source));
903
+ for (let key in source)
904
+ Object.prototype.hasOwnProperty.call(source, key) && (pathMap.has(key) || pathMap.has("*") ? cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get("*")) : cloned[key] = source[key]);
905
+ return cloned;
906
+ }
907
+ return cloneSelectively(obj, pathStructure);
908
+ }
909
+ function validatePath(path) {
910
+ if (typeof path != "string")
911
+ throw new Error("Paths must be (non-empty) strings");
912
+ if (path === "")
913
+ throw new Error("Invalid redaction path ()");
914
+ if (path.includes(".."))
915
+ throw new Error(`Invalid redaction path (${path})`);
916
+ if (path.includes(","))
917
+ throw new Error(`Invalid redaction path (${path})`);
918
+ let bracketCount = 0, inQuotes = !1, quoteChar = "";
919
+ for (let i = 0; i < path.length; i++) {
920
+ let char = path[i];
921
+ if ((char === '"' || char === "'") && bracketCount > 0)
922
+ inQuotes ? char === quoteChar && (inQuotes = !1, quoteChar = "") : (inQuotes = !0, quoteChar = char);
923
+ else if (char === "[" && !inQuotes)
924
+ bracketCount++;
925
+ else if (char === "]" && !inQuotes && (bracketCount--, bracketCount < 0))
926
+ throw new Error(`Invalid redaction path (${path})`);
927
+ }
928
+ if (bracketCount !== 0)
929
+ throw new Error(`Invalid redaction path (${path})`);
930
+ }
931
+ function validatePaths(paths) {
932
+ if (!Array.isArray(paths))
933
+ throw new TypeError("paths must be an array");
934
+ for (let path of paths)
935
+ validatePath(path);
936
+ }
937
+ function slowRedact(options = {}) {
938
+ let {
939
+ paths = [],
940
+ censor = "[REDACTED]",
941
+ serialize = JSON.stringify,
942
+ strict = !0,
943
+ remove = !1
944
+ } = options;
945
+ validatePaths(paths);
946
+ let pathStructure = buildPathStructure(paths);
947
+ return function(obj) {
948
+ if (strict && (obj === null || typeof obj != "object") && (obj == null || typeof obj != "object"))
949
+ return serialize ? serialize(obj) : obj;
950
+ let cloned = selectiveClone(obj, pathStructure), original = obj, actualCensor = censor;
951
+ return typeof censor == "function" && (actualCensor = censor), redactPaths(cloned, paths, actualCensor, remove), serialize === !1 ? (cloned.restore = function() {
952
+ return deepClone(original);
953
+ }, cloned) : typeof serialize == "function" ? serialize(cloned) : JSON.stringify(cloned);
954
+ };
955
+ }
956
+ module.exports = slowRedact;
957
+ }
958
+ });
959
+
960
+ // node_modules/quick-format-unescaped/index.js
961
+ var require_quick_format_unescaped = __commonJS({
962
+ "node_modules/quick-format-unescaped/index.js"(exports, module) {
963
+ "use strict";
964
+ function tryStringify(o) {
965
+ try {
966
+ return JSON.stringify(o);
967
+ } catch {
968
+ return '"[Circular]"';
969
+ }
970
+ }
971
+ module.exports = format;
972
+ function format(f, args, opts) {
973
+ var ss = opts && opts.stringify || tryStringify, offset = 1;
974
+ if (typeof f == "object" && f !== null) {
975
+ var len = args.length + offset;
976
+ if (len === 1) return f;
977
+ var objects = new Array(len);
978
+ objects[0] = ss(f);
979
+ for (var index = 1; index < len; index++)
980
+ objects[index] = ss(args[index]);
981
+ return objects.join(" ");
982
+ }
983
+ if (typeof f != "string")
984
+ return f;
985
+ var argLen = args.length;
986
+ if (argLen === 0) return f;
987
+ for (var str = "", a = 1 - offset, lastPos = -1, flen = f && f.length || 0, i = 0; i < flen; ) {
988
+ if (f.charCodeAt(i) === 37 && i + 1 < flen) {
989
+ switch (lastPos = lastPos > -1 ? lastPos : 0, f.charCodeAt(i + 1)) {
990
+ case 100:
991
+ // 'd'
992
+ case 102:
993
+ if (a >= argLen || args[a] == null) break;
994
+ lastPos < i && (str += f.slice(lastPos, i)), str += Number(args[a]), lastPos = i + 2, i++;
995
+ break;
996
+ case 105:
997
+ if (a >= argLen || args[a] == null) break;
998
+ lastPos < i && (str += f.slice(lastPos, i)), str += Math.floor(Number(args[a])), lastPos = i + 2, i++;
999
+ break;
1000
+ case 79:
1001
+ // 'O'
1002
+ case 111:
1003
+ // 'o'
1004
+ case 106:
1005
+ if (a >= argLen || args[a] === void 0) break;
1006
+ lastPos < i && (str += f.slice(lastPos, i));
1007
+ var type = typeof args[a];
1008
+ if (type === "string") {
1009
+ str += "'" + args[a] + "'", lastPos = i + 2, i++;
1010
+ break;
1011
+ }
1012
+ if (type === "function") {
1013
+ str += args[a].name || "<anonymous>", lastPos = i + 2, i++;
1014
+ break;
1015
+ }
1016
+ str += ss(args[a]), lastPos = i + 2, i++;
1017
+ break;
1018
+ case 115:
1019
+ if (a >= argLen)
1020
+ break;
1021
+ lastPos < i && (str += f.slice(lastPos, i)), str += String(args[a]), lastPos = i + 2, i++;
1022
+ break;
1023
+ case 37:
1024
+ lastPos < i && (str += f.slice(lastPos, i)), str += "%", lastPos = i + 2, i++, a--;
1025
+ break;
1026
+ }
1027
+ ++a;
1028
+ }
1029
+ ++i;
1030
+ }
1031
+ return lastPos === -1 ? f : (lastPos < flen && (str += f.slice(lastPos)), str);
1032
+ }
1033
+ }
1034
+ });
1035
+
1036
+ // node_modules/atomic-sleep/index.js
1037
+ var require_atomic_sleep = __commonJS({
1038
+ "node_modules/atomic-sleep/index.js"(exports, module) {
1039
+ "use strict";
1040
+ if (typeof SharedArrayBuffer < "u" && typeof Atomics < "u") {
1041
+ let sleep = function(ms) {
1042
+ if ((ms > 0 && ms < 1 / 0) === !1)
1043
+ throw typeof ms != "number" && typeof ms != "bigint" ? TypeError("sleep: ms must be a number") : RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
1044
+ Atomics.wait(nil, 0, 0, Number(ms));
1045
+ }, nil = new Int32Array(new SharedArrayBuffer(4));
1046
+ module.exports = sleep;
1047
+ } else {
1048
+ let sleep = function(ms) {
1049
+ if ((ms > 0 && ms < 1 / 0) === !1)
1050
+ throw typeof ms != "number" && typeof ms != "bigint" ? TypeError("sleep: ms must be a number") : RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
1051
+ let target = Date.now() + Number(ms);
1052
+ for (; target > Date.now(); )
1053
+ ;
1054
+ };
1055
+ module.exports = sleep;
1056
+ }
1057
+ }
1058
+ });
1059
+
1060
+ // node_modules/sonic-boom/index.js
1061
+ var require_sonic_boom = __commonJS({
1062
+ "node_modules/sonic-boom/index.js"(exports, module) {
1063
+ "use strict";
1064
+ var fs = __require("fs"), EventEmitter = __require("events"), inherits = __require("util").inherits, path = __require("path"), sleep = require_atomic_sleep(), assert = __require("assert"), BUSY_WRITE_TIMEOUT = 100, kEmptyBuffer = Buffer.allocUnsafe(0), MAX_WRITE = 16 * 1024, kContentModeBuffer = "buffer", kContentModeUtf8 = "utf8", [major, minor] = (process.versions.node || "0.0").split(".").map(Number), kCopyBuffer = major >= 22 && minor >= 7;
1065
+ function openFile(file, sonic) {
1066
+ sonic._opening = !0, sonic._writing = !0, sonic._asyncDrainScheduled = !1;
1067
+ function fileOpened(err, fd) {
1068
+ if (err) {
1069
+ sonic._reopening = !1, sonic._writing = !1, sonic._opening = !1, sonic.sync ? process.nextTick(() => {
1070
+ sonic.listenerCount("error") > 0 && sonic.emit("error", err);
1071
+ }) : sonic.emit("error", err);
1072
+ return;
1073
+ }
1074
+ let reopening = sonic._reopening;
1075
+ sonic.fd = fd, sonic.file = file, sonic._reopening = !1, sonic._opening = !1, sonic._writing = !1, sonic.sync ? process.nextTick(() => sonic.emit("ready")) : sonic.emit("ready"), !sonic.destroyed && (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending ? sonic._actualWrite() : reopening && process.nextTick(() => sonic.emit("drain")));
1076
+ }
1077
+ let flags = sonic.append ? "a" : "w", mode = sonic.mode;
1078
+ if (sonic.sync)
1079
+ try {
1080
+ sonic.mkdir && fs.mkdirSync(path.dirname(file), { recursive: !0 });
1081
+ let fd = fs.openSync(file, flags, mode);
1082
+ fileOpened(null, fd);
1083
+ } catch (err) {
1084
+ throw fileOpened(err), err;
1085
+ }
1086
+ else sonic.mkdir ? fs.mkdir(path.dirname(file), { recursive: !0 }, (err) => {
1087
+ if (err) return fileOpened(err);
1088
+ fs.open(file, flags, mode, fileOpened);
1089
+ }) : fs.open(file, flags, mode, fileOpened);
1090
+ }
1091
+ function SonicBoom(opts) {
1092
+ if (!(this instanceof SonicBoom))
1093
+ return new SonicBoom(opts);
1094
+ let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = !0, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {};
1095
+ fd = fd || dest, this._len = 0, this.fd = -1, this._bufs = [], this._lens = [], this._writing = !1, this._ending = !1, this._reopening = !1, this._asyncDrainScheduled = !1, this._flushPending = !1, this._hwm = Math.max(minLength || 0, 16387), this.file = null, this.destroyed = !1, this.minLength = minLength || 0, this.maxLength = maxLength || 0, this.maxWrite = maxWrite || MAX_WRITE, this._periodicFlush = periodicFlush || 0, this._periodicFlushTimer = void 0, this.sync = sync || !1, this.writable = !0, this._fsync = fsync || !1, this.append = append || !1, this.mode = mode, this.retryEAGAIN = retryEAGAIN || (() => !0), this.mkdir = mkdir || !1;
1096
+ let fsWriteSync, fsWrite;
1097
+ if (contentMode === kContentModeBuffer)
1098
+ this._writingBuf = kEmptyBuffer, this.write = writeBuffer, this.flush = flushBuffer, this.flushSync = flushBufferSync, this._actualWrite = actualWriteBuffer, fsWriteSync = () => fs.writeSync(this.fd, this._writingBuf), fsWrite = () => fs.write(this.fd, this._writingBuf, this.release);
1099
+ else if (contentMode === void 0 || contentMode === kContentModeUtf8)
1100
+ this._writingBuf = "", this.write = write, this.flush = flush, this.flushSync = flushSync, this._actualWrite = actualWrite, fsWriteSync = () => Buffer.isBuffer(this._writingBuf) ? fs.writeSync(this.fd, this._writingBuf) : fs.writeSync(this.fd, this._writingBuf, "utf8"), fsWrite = () => Buffer.isBuffer(this._writingBuf) ? fs.write(this.fd, this._writingBuf, this.release) : fs.write(this.fd, this._writingBuf, "utf8", this.release);
1101
+ else
1102
+ throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
1103
+ if (typeof fd == "number")
1104
+ this.fd = fd, process.nextTick(() => this.emit("ready"));
1105
+ else if (typeof fd == "string")
1106
+ openFile(fd, this);
1107
+ else
1108
+ throw new Error("SonicBoom supports only file descriptors and files");
1109
+ if (this.minLength >= this.maxWrite)
1110
+ throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);
1111
+ this.release = (err, n) => {
1112
+ if (err) {
1113
+ if ((err.code === "EAGAIN" || err.code === "EBUSY") && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length))
1114
+ if (this.sync)
1115
+ try {
1116
+ sleep(BUSY_WRITE_TIMEOUT), this.release(void 0, 0);
1117
+ } catch (err2) {
1118
+ this.release(err2);
1119
+ }
1120
+ else
1121
+ setTimeout(fsWrite, BUSY_WRITE_TIMEOUT);
1122
+ else
1123
+ this._writing = !1, this.emit("error", err);
1124
+ return;
1125
+ }
1126
+ this.emit("write", n);
1127
+ let releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n);
1128
+ if (this._len = releasedBufObj.len, this._writingBuf = releasedBufObj.writingBuf, this._writingBuf.length) {
1129
+ if (!this.sync) {
1130
+ fsWrite();
1131
+ return;
1132
+ }
1133
+ try {
1134
+ do {
1135
+ let n2 = fsWriteSync(), releasedBufObj2 = releaseWritingBuf(this._writingBuf, this._len, n2);
1136
+ this._len = releasedBufObj2.len, this._writingBuf = releasedBufObj2.writingBuf;
1137
+ } while (this._writingBuf.length);
1138
+ } catch (err2) {
1139
+ this.release(err2);
1140
+ return;
1141
+ }
1142
+ }
1143
+ this._fsync && fs.fsyncSync(this.fd);
1144
+ let len = this._len;
1145
+ this._reopening ? (this._writing = !1, this._reopening = !1, this.reopen()) : len > this.minLength ? this._actualWrite() : this._ending ? len > 0 ? this._actualWrite() : (this._writing = !1, actualClose(this)) : (this._writing = !1, this.sync ? this._asyncDrainScheduled || (this._asyncDrainScheduled = !0, process.nextTick(emitDrain, this)) : this.emit("drain"));
1146
+ }, this.on("newListener", function(name) {
1147
+ name === "drain" && (this._asyncDrainScheduled = !1);
1148
+ }), this._periodicFlush !== 0 && (this._periodicFlushTimer = setInterval(() => this.flush(null), this._periodicFlush), this._periodicFlushTimer.unref());
1149
+ }
1150
+ function releaseWritingBuf(writingBuf, len, n) {
1151
+ return typeof writingBuf == "string" && (writingBuf = Buffer.from(writingBuf)), len = Math.max(len - n, 0), writingBuf = writingBuf.subarray(n), { writingBuf, len };
1152
+ }
1153
+ function emitDrain(sonic) {
1154
+ sonic.listenerCount("drain") > 0 && (sonic._asyncDrainScheduled = !1, sonic.emit("drain"));
1155
+ }
1156
+ inherits(SonicBoom, EventEmitter);
1157
+ function mergeBuf(bufs, len) {
1158
+ return bufs.length === 0 ? kEmptyBuffer : bufs.length === 1 ? bufs[0] : Buffer.concat(bufs, len);
1159
+ }
1160
+ function write(data) {
1161
+ if (this.destroyed)
1162
+ throw new Error("SonicBoom destroyed");
1163
+ data = "" + data;
1164
+ let dataLen = Buffer.byteLength(data), len = this._len + dataLen, bufs = this._bufs;
1165
+ return this.maxLength && len > this.maxLength ? (this.emit("drop", data), this._len < this._hwm) : (bufs.length === 0 || Buffer.byteLength(bufs[bufs.length - 1]) + dataLen > this.maxWrite ? bufs.push(data) : bufs[bufs.length - 1] += data, this._len = len, !this._writing && this._len >= this.minLength && this._actualWrite(), this._len < this._hwm);
1166
+ }
1167
+ function writeBuffer(data) {
1168
+ if (this.destroyed)
1169
+ throw new Error("SonicBoom destroyed");
1170
+ let len = this._len + data.length, bufs = this._bufs, lens = this._lens;
1171
+ return this.maxLength && len > this.maxLength ? (this.emit("drop", data), this._len < this._hwm) : (bufs.length === 0 || lens[lens.length - 1] + data.length > this.maxWrite ? (bufs.push([data]), lens.push(data.length)) : (bufs[bufs.length - 1].push(data), lens[lens.length - 1] += data.length), this._len = len, !this._writing && this._len >= this.minLength && this._actualWrite(), this._len < this._hwm);
1172
+ }
1173
+ function callFlushCallbackOnDrain(cb) {
1174
+ this._flushPending = !0;
1175
+ let onDrain = () => {
1176
+ if (this._fsync)
1177
+ this._flushPending = !1, cb();
1178
+ else
1179
+ try {
1180
+ fs.fsync(this.fd, (err) => {
1181
+ this._flushPending = !1, cb(err);
1182
+ });
1183
+ } catch (err) {
1184
+ cb(err);
1185
+ }
1186
+ this.off("error", onError);
1187
+ }, onError = (err) => {
1188
+ this._flushPending = !1, cb(err), this.off("drain", onDrain);
1189
+ };
1190
+ this.once("drain", onDrain), this.once("error", onError);
1191
+ }
1192
+ function flush(cb) {
1193
+ if (cb != null && typeof cb != "function")
1194
+ throw new Error("flush cb must be a function");
1195
+ if (this.destroyed) {
1196
+ let error = new Error("SonicBoom destroyed");
1197
+ if (cb) {
1198
+ cb(error);
1199
+ return;
1200
+ }
1201
+ throw error;
1202
+ }
1203
+ if (this.minLength <= 0) {
1204
+ cb?.();
1205
+ return;
1206
+ }
1207
+ cb && callFlushCallbackOnDrain.call(this, cb), !this._writing && (this._bufs.length === 0 && this._bufs.push(""), this._actualWrite());
1208
+ }
1209
+ function flushBuffer(cb) {
1210
+ if (cb != null && typeof cb != "function")
1211
+ throw new Error("flush cb must be a function");
1212
+ if (this.destroyed) {
1213
+ let error = new Error("SonicBoom destroyed");
1214
+ if (cb) {
1215
+ cb(error);
1216
+ return;
1217
+ }
1218
+ throw error;
1219
+ }
1220
+ if (this.minLength <= 0) {
1221
+ cb?.();
1222
+ return;
1223
+ }
1224
+ cb && callFlushCallbackOnDrain.call(this, cb), !this._writing && (this._bufs.length === 0 && (this._bufs.push([]), this._lens.push(0)), this._actualWrite());
1225
+ }
1226
+ SonicBoom.prototype.reopen = function(file) {
1227
+ if (this.destroyed)
1228
+ throw new Error("SonicBoom destroyed");
1229
+ if (this._opening) {
1230
+ this.once("ready", () => {
1231
+ this.reopen(file);
1232
+ });
1233
+ return;
1234
+ }
1235
+ if (this._ending)
1236
+ return;
1237
+ if (!this.file)
1238
+ throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
1239
+ if (file && (this.file = file), this._reopening = !0, this._writing)
1240
+ return;
1241
+ let fd = this.fd;
1242
+ this.once("ready", () => {
1243
+ fd !== this.fd && fs.close(fd, (err) => {
1244
+ if (err)
1245
+ return this.emit("error", err);
1246
+ });
1247
+ }), openFile(this.file, this);
1248
+ };
1249
+ SonicBoom.prototype.end = function() {
1250
+ if (this.destroyed)
1251
+ throw new Error("SonicBoom destroyed");
1252
+ if (this._opening) {
1253
+ this.once("ready", () => {
1254
+ this.end();
1255
+ });
1256
+ return;
1257
+ }
1258
+ this._ending || (this._ending = !0, !this._writing && (this._len > 0 && this.fd >= 0 ? this._actualWrite() : actualClose(this)));
1259
+ };
1260
+ function flushSync() {
1261
+ if (this.destroyed)
1262
+ throw new Error("SonicBoom destroyed");
1263
+ if (this.fd < 0)
1264
+ throw new Error("sonic boom is not ready yet");
1265
+ !this._writing && this._writingBuf.length > 0 && (this._bufs.unshift(this._writingBuf), this._writingBuf = "");
1266
+ let buf = "";
1267
+ for (; this._bufs.length || buf.length; ) {
1268
+ buf.length <= 0 && (buf = this._bufs[0]);
1269
+ try {
1270
+ let n = Buffer.isBuffer(buf) ? fs.writeSync(this.fd, buf) : fs.writeSync(this.fd, buf, "utf8"), releasedBufObj = releaseWritingBuf(buf, this._len, n);
1271
+ buf = releasedBufObj.writingBuf, this._len = releasedBufObj.len, buf.length <= 0 && this._bufs.shift();
1272
+ } catch (err) {
1273
+ if ((err.code === "EAGAIN" || err.code === "EBUSY") && !this.retryEAGAIN(err, buf.length, this._len - buf.length))
1274
+ throw err;
1275
+ sleep(BUSY_WRITE_TIMEOUT);
1276
+ }
1277
+ }
1278
+ try {
1279
+ fs.fsyncSync(this.fd);
1280
+ } catch {
1281
+ }
1282
+ }
1283
+ function flushBufferSync() {
1284
+ if (this.destroyed)
1285
+ throw new Error("SonicBoom destroyed");
1286
+ if (this.fd < 0)
1287
+ throw new Error("sonic boom is not ready yet");
1288
+ !this._writing && this._writingBuf.length > 0 && (this._bufs.unshift([this._writingBuf]), this._writingBuf = kEmptyBuffer);
1289
+ let buf = kEmptyBuffer;
1290
+ for (; this._bufs.length || buf.length; ) {
1291
+ buf.length <= 0 && (buf = mergeBuf(this._bufs[0], this._lens[0]));
1292
+ try {
1293
+ let n = fs.writeSync(this.fd, buf);
1294
+ buf = buf.subarray(n), this._len = Math.max(this._len - n, 0), buf.length <= 0 && (this._bufs.shift(), this._lens.shift());
1295
+ } catch (err) {
1296
+ if ((err.code === "EAGAIN" || err.code === "EBUSY") && !this.retryEAGAIN(err, buf.length, this._len - buf.length))
1297
+ throw err;
1298
+ sleep(BUSY_WRITE_TIMEOUT);
1299
+ }
1300
+ }
1301
+ }
1302
+ SonicBoom.prototype.destroy = function() {
1303
+ this.destroyed || actualClose(this);
1304
+ };
1305
+ function actualWrite() {
1306
+ let release = this.release;
1307
+ if (this._writing = !0, this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "", this.sync)
1308
+ try {
1309
+ let written = Buffer.isBuffer(this._writingBuf) ? fs.writeSync(this.fd, this._writingBuf) : fs.writeSync(this.fd, this._writingBuf, "utf8");
1310
+ release(null, written);
1311
+ } catch (err) {
1312
+ release(err);
1313
+ }
1314
+ else
1315
+ fs.write(this.fd, this._writingBuf, release);
1316
+ }
1317
+ function actualWriteBuffer() {
1318
+ let release = this.release;
1319
+ if (this._writing = !0, this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift()), this.sync)
1320
+ try {
1321
+ let written = fs.writeSync(this.fd, this._writingBuf);
1322
+ release(null, written);
1323
+ } catch (err) {
1324
+ release(err);
1325
+ }
1326
+ else
1327
+ kCopyBuffer && (this._writingBuf = Buffer.from(this._writingBuf)), fs.write(this.fd, this._writingBuf, release);
1328
+ }
1329
+ function actualClose(sonic) {
1330
+ if (sonic.fd === -1) {
1331
+ sonic.once("ready", actualClose.bind(null, sonic));
1332
+ return;
1333
+ }
1334
+ sonic._periodicFlushTimer !== void 0 && clearInterval(sonic._periodicFlushTimer), sonic.destroyed = !0, sonic._bufs = [], sonic._lens = [], assert(typeof sonic.fd == "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
1335
+ try {
1336
+ fs.fsync(sonic.fd, closeWrapped);
1337
+ } catch {
1338
+ }
1339
+ function closeWrapped() {
1340
+ sonic.fd !== 1 && sonic.fd !== 2 ? fs.close(sonic.fd, done) : done();
1341
+ }
1342
+ function done(err) {
1343
+ if (err) {
1344
+ sonic.emit("error", err);
1345
+ return;
1346
+ }
1347
+ sonic._ending && !sonic._writing && sonic.emit("finish"), sonic.emit("close");
1348
+ }
1349
+ }
1350
+ SonicBoom.SonicBoom = SonicBoom;
1351
+ SonicBoom.default = SonicBoom;
1352
+ module.exports = SonicBoom;
1353
+ }
1354
+ });
1355
+
1356
+ // node_modules/on-exit-leak-free/index.js
1357
+ var require_on_exit_leak_free = __commonJS({
1358
+ "node_modules/on-exit-leak-free/index.js"(exports, module) {
1359
+ "use strict";
1360
+ var refs = {
1361
+ exit: [],
1362
+ beforeExit: []
1363
+ }, functions = {
1364
+ exit: onExit,
1365
+ beforeExit: onBeforeExit
1366
+ }, registry;
1367
+ function ensureRegistry() {
1368
+ registry === void 0 && (registry = new FinalizationRegistry(clear));
1369
+ }
1370
+ function install(event) {
1371
+ refs[event].length > 0 || process.on(event, functions[event]);
1372
+ }
1373
+ function uninstall(event) {
1374
+ refs[event].length > 0 || (process.removeListener(event, functions[event]), refs.exit.length === 0 && refs.beforeExit.length === 0 && (registry = void 0));
1375
+ }
1376
+ function onExit() {
1377
+ callRefs("exit");
1378
+ }
1379
+ function onBeforeExit() {
1380
+ callRefs("beforeExit");
1381
+ }
1382
+ function callRefs(event) {
1383
+ for (let ref of refs[event]) {
1384
+ let obj = ref.deref(), fn = ref.fn;
1385
+ obj !== void 0 && fn(obj, event);
1386
+ }
1387
+ refs[event] = [];
1388
+ }
1389
+ function clear(ref) {
1390
+ for (let event of ["exit", "beforeExit"]) {
1391
+ let index = refs[event].indexOf(ref);
1392
+ refs[event].splice(index, index + 1), uninstall(event);
1393
+ }
1394
+ }
1395
+ function _register(event, obj, fn) {
1396
+ if (obj === void 0)
1397
+ throw new Error("the object can't be undefined");
1398
+ install(event);
1399
+ let ref = new WeakRef(obj);
1400
+ ref.fn = fn, ensureRegistry(), registry.register(obj, ref), refs[event].push(ref);
1401
+ }
1402
+ function register(obj, fn) {
1403
+ _register("exit", obj, fn);
1404
+ }
1405
+ function registerBeforeExit(obj, fn) {
1406
+ _register("beforeExit", obj, fn);
1407
+ }
1408
+ function unregister(obj) {
1409
+ if (registry !== void 0) {
1410
+ registry.unregister(obj);
1411
+ for (let event of ["exit", "beforeExit"])
1412
+ refs[event] = refs[event].filter((ref) => {
1413
+ let _obj = ref.deref();
1414
+ return _obj && _obj !== obj;
1415
+ }), uninstall(event);
1416
+ }
1417
+ }
1418
+ module.exports = {
1419
+ register,
1420
+ registerBeforeExit,
1421
+ unregister
1422
+ };
1423
+ }
1424
+ });
1425
+
1426
+ export {
1427
+ require_pino_std_serializers,
1428
+ require_redact,
1429
+ require_quick_format_unescaped,
1430
+ require_atomic_sleep,
1431
+ require_sonic_boom,
1432
+ require_on_exit_leak_free,
1433
+ require_safe_stable_stringify
1434
+ };