@rife/logger 0.0.6-beta.1 → 0.0.6-beta.11

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 (55) hide show
  1. package/dist/cjs/common.cjs +51 -0
  2. package/dist/cjs/env.cjs +40 -0
  3. package/dist/cjs/index.cjs +60 -0
  4. package/dist/cjs/pino/index.cjs +158 -0
  5. package/dist/cjs/pino/rotate.cjs +72 -0
  6. package/dist/cjs/pino/worker/pino-file.cjs +3353 -0
  7. package/dist/cjs/pino/worker/pino-pretty.cjs +2870 -0
  8. package/dist/cjs/pino/worker/pino-rotate.cjs +604 -0
  9. package/dist/cjs/pino/worker/pino-worker.cjs +3666 -0
  10. package/dist/cjs/pino/worker/thread-stream.cjs +172 -0
  11. package/dist/cjs/test.cjs +36 -0
  12. package/dist/cjs/trace.cjs +52 -0
  13. package/dist/esm/common.mjs +8 -0
  14. package/dist/esm/env.mjs +5 -0
  15. package/dist/esm/index.mjs +3 -0
  16. package/dist/esm/pino/index.mjs +116 -0
  17. package/dist/esm/pino/rotate.mjs +40 -0
  18. package/dist/esm/pino/worker/pino-file.cjs +3353 -0
  19. package/dist/esm/pino/worker/pino-pretty.cjs +2870 -0
  20. package/dist/esm/pino/worker/pino-rotate.cjs +604 -0
  21. package/dist/esm/pino/worker/pino-worker.cjs +3666 -0
  22. package/dist/esm/pino/worker/thread-stream.cjs +172 -0
  23. package/dist/esm/test.mjs +32 -0
  24. package/dist/esm/trace.mjs +14 -0
  25. package/dist/worker/pino-file.cjs +3353 -0
  26. package/dist/worker/pino-pretty.cjs +2870 -0
  27. package/dist/worker/pino-rotate.cjs +604 -0
  28. package/dist/worker/pino-worker.cjs +3666 -0
  29. package/dist/worker/thread-stream.cjs +172 -0
  30. package/package.json +16 -19
  31. package/src/common.ts +4 -0
  32. package/src/pino/index.ts +120 -0
  33. package/src/test.ts +8 -3
  34. package/src/trace.ts +1 -2
  35. package/tsconfig.json +12 -12
  36. package/dist/env.d.ts +0 -2
  37. package/dist/env.js +0 -22
  38. package/dist/env.js.map +0 -1
  39. package/dist/index.d.ts +0 -1
  40. package/dist/index.js +0 -8
  41. package/dist/index.js.map +0 -1
  42. package/dist/pino.d.ts +0 -8
  43. package/dist/pino.js +0 -88
  44. package/dist/pino.js.map +0 -1
  45. package/dist/rotate.d.ts +0 -6
  46. package/dist/rotate.js +0 -35
  47. package/dist/rotate.js.map +0 -1
  48. package/dist/test.d.ts +0 -1
  49. package/dist/test.js +0 -23
  50. package/dist/test.js.map +0 -1
  51. package/dist/trace.d.ts +0 -3
  52. package/dist/trace.js +0 -35
  53. package/dist/trace.js.map +0 -1
  54. package/src/pino.ts +0 -80
  55. /package/src/{rotate.ts → pino/rotate.ts} +0 -0
@@ -0,0 +1,3353 @@
1
+ var __webpack_modules__ = {
2
+ "../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js": function(module1) {
3
+ "use strict";
4
+ function deepClone(obj) {
5
+ if (null === obj || 'object' != typeof obj) return obj;
6
+ if (obj instanceof Date) return new Date(obj.getTime());
7
+ if (obj instanceof Array) {
8
+ const cloned = [];
9
+ for(let i = 0; i < obj.length; i++)cloned[i] = deepClone(obj[i]);
10
+ return cloned;
11
+ }
12
+ if ('object' == typeof obj) {
13
+ const cloned = Object.create(Object.getPrototypeOf(obj));
14
+ for(const key in obj)if (Object.prototype.hasOwnProperty.call(obj, key)) cloned[key] = deepClone(obj[key]);
15
+ return cloned;
16
+ }
17
+ return obj;
18
+ }
19
+ function parsePath(path) {
20
+ const parts = [];
21
+ let current = '';
22
+ let inBrackets = false;
23
+ let inQuotes = false;
24
+ let quoteChar = '';
25
+ for(let i = 0; i < path.length; i++){
26
+ const char = path[i];
27
+ if (inBrackets || '.' !== char) if ('[' === char) {
28
+ if (current) {
29
+ parts.push(current);
30
+ current = '';
31
+ }
32
+ inBrackets = true;
33
+ } else if (']' === char && inBrackets) {
34
+ parts.push(current);
35
+ current = '';
36
+ inBrackets = false;
37
+ inQuotes = false;
38
+ } else if (('"' === char || "'" === char) && inBrackets) if (inQuotes) if (char === quoteChar) {
39
+ inQuotes = false;
40
+ quoteChar = '';
41
+ } else current += char;
42
+ else {
43
+ inQuotes = true;
44
+ quoteChar = char;
45
+ }
46
+ else current += char;
47
+ else if (current) {
48
+ parts.push(current);
49
+ current = '';
50
+ }
51
+ }
52
+ if (current) parts.push(current);
53
+ return parts;
54
+ }
55
+ function setValue(obj, parts, value) {
56
+ let current = obj;
57
+ for(let i = 0; i < parts.length - 1; i++){
58
+ const key = parts[i];
59
+ if ('object' != typeof current || null === current || !(key in current)) return false;
60
+ if ('object' != typeof current[key] || null === current[key]) return false;
61
+ current = current[key];
62
+ }
63
+ const lastKey = parts[parts.length - 1];
64
+ if ('*' === lastKey) {
65
+ if (Array.isArray(current)) for(let i = 0; i < current.length; i++)current[i] = value;
66
+ else if ('object' == typeof current && null !== current) {
67
+ for(const key in current)if (Object.prototype.hasOwnProperty.call(current, key)) current[key] = value;
68
+ }
69
+ } else if ('object' == typeof current && null !== current && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) current[lastKey] = value;
70
+ return true;
71
+ }
72
+ function removeKey(obj, parts) {
73
+ let current = obj;
74
+ for(let i = 0; i < parts.length - 1; i++){
75
+ const key = parts[i];
76
+ if ('object' != typeof current || null === current || !(key in current)) return false;
77
+ if ('object' != typeof current[key] || null === current[key]) return false;
78
+ current = current[key];
79
+ }
80
+ const lastKey = parts[parts.length - 1];
81
+ if ('*' === lastKey) {
82
+ if (Array.isArray(current)) for(let i = 0; i < current.length; i++)current[i] = void 0;
83
+ else if ('object' == typeof current && null !== current) {
84
+ for(const key in current)if (Object.prototype.hasOwnProperty.call(current, key)) delete current[key];
85
+ }
86
+ } else if ('object' == typeof current && null !== current && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) delete current[lastKey];
87
+ return true;
88
+ }
89
+ const PATH_NOT_FOUND = Symbol('PATH_NOT_FOUND');
90
+ function getValueIfExists(obj, parts) {
91
+ let current = obj;
92
+ for (const part of parts){
93
+ if (null == current) return PATH_NOT_FOUND;
94
+ if ('object' != typeof current || null === current) return PATH_NOT_FOUND;
95
+ if (!(part in current)) return PATH_NOT_FOUND;
96
+ current = current[part];
97
+ }
98
+ return current;
99
+ }
100
+ function getValue(obj, parts) {
101
+ let current = obj;
102
+ for (const part of parts){
103
+ if (null == current) return;
104
+ if ('object' != typeof current || null === current) return;
105
+ current = current[part];
106
+ }
107
+ return current;
108
+ }
109
+ function redactPaths(obj, paths, censor, remove = false) {
110
+ for (const path of paths){
111
+ const parts = parsePath(path);
112
+ if (parts.includes('*')) redactWildcardPath(obj, parts, censor, path, remove);
113
+ else if (remove) removeKey(obj, parts);
114
+ else {
115
+ const value = getValueIfExists(obj, parts);
116
+ if (value === PATH_NOT_FOUND) continue;
117
+ const actualCensor = 'function' == typeof censor ? censor(value, parts) : censor;
118
+ setValue(obj, parts, actualCensor);
119
+ }
120
+ }
121
+ }
122
+ function redactWildcardPath(obj, parts, censor, originalPath, remove = false) {
123
+ const wildcardIndex = parts.indexOf('*');
124
+ if (wildcardIndex === parts.length - 1) {
125
+ const parentParts = parts.slice(0, -1);
126
+ let current = obj;
127
+ for (const part of parentParts){
128
+ if (null == current) return;
129
+ if ('object' != typeof current || null === current) return;
130
+ current = current[part];
131
+ }
132
+ if (Array.isArray(current)) if (remove) for(let i = 0; i < current.length; i++)current[i] = void 0;
133
+ else for(let i = 0; i < current.length; i++){
134
+ const indexPath = [
135
+ ...parentParts,
136
+ i.toString()
137
+ ];
138
+ const actualCensor = 'function' == typeof censor ? censor(current[i], indexPath) : censor;
139
+ current[i] = actualCensor;
140
+ }
141
+ else if ('object' == typeof current && null !== current) if (remove) {
142
+ const keysToDelete = [];
143
+ for(const key in current)if (Object.prototype.hasOwnProperty.call(current, key)) keysToDelete.push(key);
144
+ for (const key of keysToDelete)delete current[key];
145
+ } else for(const key in current){
146
+ const keyPath = [
147
+ ...parentParts,
148
+ key
149
+ ];
150
+ const actualCensor = 'function' == typeof censor ? censor(current[key], keyPath) : censor;
151
+ current[key] = actualCensor;
152
+ }
153
+ } else redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove);
154
+ }
155
+ function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = false) {
156
+ const beforeWildcard = parts.slice(0, wildcardIndex);
157
+ const afterWildcard = parts.slice(wildcardIndex + 1);
158
+ const pathArray = [];
159
+ function traverse(current, pathLength) {
160
+ if (pathLength === beforeWildcard.length) {
161
+ if (Array.isArray(current)) for(let i = 0; i < current.length; i++){
162
+ pathArray[pathLength] = i.toString();
163
+ traverse(current[i], pathLength + 1);
164
+ }
165
+ else if ('object' == typeof current && null !== current) for(const key in current){
166
+ pathArray[pathLength] = key;
167
+ traverse(current[key], pathLength + 1);
168
+ }
169
+ } else if (pathLength < beforeWildcard.length) {
170
+ const nextKey = beforeWildcard[pathLength];
171
+ if (current && 'object' == typeof current && null !== current && nextKey in current) {
172
+ pathArray[pathLength] = nextKey;
173
+ traverse(current[nextKey], pathLength + 1);
174
+ }
175
+ } else if (afterWildcard.includes('*')) {
176
+ const wrappedCensor = 'function' == typeof censor ? (value, path)=>{
177
+ const fullPath = [
178
+ ...pathArray.slice(0, pathLength),
179
+ ...path
180
+ ];
181
+ return censor(value, fullPath);
182
+ } : censor;
183
+ redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
184
+ } else if (remove) removeKey(current, afterWildcard);
185
+ else {
186
+ const actualCensor = 'function' == typeof censor ? censor(getValue(current, afterWildcard), [
187
+ ...pathArray.slice(0, pathLength),
188
+ ...afterWildcard
189
+ ]) : censor;
190
+ setValue(current, afterWildcard, actualCensor);
191
+ }
192
+ }
193
+ if (0 === beforeWildcard.length) traverse(obj, 0);
194
+ else {
195
+ let current = obj;
196
+ for(let i = 0; i < beforeWildcard.length; i++){
197
+ const part = beforeWildcard[i];
198
+ if (null == current) return;
199
+ if ('object' != typeof current || null === current) return;
200
+ current = current[part];
201
+ pathArray[i] = part;
202
+ }
203
+ if (null != current) traverse(current, beforeWildcard.length);
204
+ }
205
+ }
206
+ function buildPathStructure(pathsToClone) {
207
+ if (0 === pathsToClone.length) return null;
208
+ const pathStructure = new Map();
209
+ for (const path of pathsToClone){
210
+ const parts = parsePath(path);
211
+ let current = pathStructure;
212
+ for(let i = 0; i < parts.length; i++){
213
+ const part = parts[i];
214
+ if (!current.has(part)) current.set(part, new Map());
215
+ current = current.get(part);
216
+ }
217
+ }
218
+ return pathStructure;
219
+ }
220
+ function selectiveClone(obj, pathStructure) {
221
+ if (!pathStructure) return obj;
222
+ function cloneSelectively(source, pathMap, depth = 0) {
223
+ if (!pathMap || 0 === pathMap.size) return source;
224
+ if (null === source || 'object' != typeof source) return source;
225
+ if (source instanceof Date) return new Date(source.getTime());
226
+ if (Array.isArray(source)) {
227
+ const cloned = [];
228
+ for(let i = 0; i < source.length; i++){
229
+ const indexStr = i.toString();
230
+ if (pathMap.has(indexStr) || pathMap.has('*')) cloned[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get('*'));
231
+ else cloned[i] = source[i];
232
+ }
233
+ return cloned;
234
+ }
235
+ const cloned = Object.create(Object.getPrototypeOf(source));
236
+ for(const key in source)if (Object.prototype.hasOwnProperty.call(source, key)) if (pathMap.has(key) || pathMap.has('*')) cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get('*'));
237
+ else cloned[key] = source[key];
238
+ return cloned;
239
+ }
240
+ return cloneSelectively(obj, pathStructure);
241
+ }
242
+ function validatePath(path) {
243
+ if ('string' != typeof path) throw new Error('Paths must be (non-empty) strings');
244
+ if ('' === path) throw new Error('Invalid redaction path ()');
245
+ if (path.includes('..')) throw new Error(`Invalid redaction path (${path})`);
246
+ if (path.includes(',')) throw new Error(`Invalid redaction path (${path})`);
247
+ let bracketCount = 0;
248
+ let inQuotes = false;
249
+ let quoteChar = '';
250
+ for(let i = 0; i < path.length; i++){
251
+ const char = path[i];
252
+ if (('"' === char || "'" === char) && bracketCount > 0) if (inQuotes) {
253
+ if (char === quoteChar) {
254
+ inQuotes = false;
255
+ quoteChar = '';
256
+ }
257
+ } else {
258
+ inQuotes = true;
259
+ quoteChar = char;
260
+ }
261
+ else if ('[' !== char || inQuotes) {
262
+ if (']' === char && !inQuotes) {
263
+ bracketCount--;
264
+ if (bracketCount < 0) throw new Error(`Invalid redaction path (${path})`);
265
+ }
266
+ } else bracketCount++;
267
+ }
268
+ if (0 !== bracketCount) throw new Error(`Invalid redaction path (${path})`);
269
+ }
270
+ function validatePaths(paths) {
271
+ if (!Array.isArray(paths)) throw new TypeError('paths must be an array');
272
+ for (const path of paths)validatePath(path);
273
+ }
274
+ function slowRedact(options = {}) {
275
+ const { paths = [], censor = '[REDACTED]', serialize = JSON.stringify, strict = true, remove = false } = options;
276
+ validatePaths(paths);
277
+ const pathStructure = buildPathStructure(paths);
278
+ return function(obj) {
279
+ if (strict && (null === obj || 'object' != typeof obj)) {
280
+ if (null == obj) return serialize ? serialize(obj) : obj;
281
+ if ('object' != typeof obj) return serialize ? serialize(obj) : obj;
282
+ }
283
+ const cloned = selectiveClone(obj, pathStructure);
284
+ const original = obj;
285
+ let actualCensor = censor;
286
+ if ('function' == typeof censor) actualCensor = censor;
287
+ redactPaths(cloned, paths, actualCensor, remove);
288
+ if (false === serialize) {
289
+ cloned.restore = function() {
290
+ return deepClone(original);
291
+ };
292
+ return cloned;
293
+ }
294
+ if ('function' == typeof serialize) return serialize(cloned);
295
+ return JSON.stringify(cloned);
296
+ };
297
+ }
298
+ module1.exports = slowRedact;
299
+ },
300
+ "../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js": function(module1) {
301
+ "use strict";
302
+ if ('undefined' != typeof SharedArrayBuffer && 'undefined' != typeof Atomics) {
303
+ const nil = new Int32Array(new SharedArrayBuffer(4));
304
+ function sleep(ms) {
305
+ const valid = ms > 0 && ms < 1 / 0;
306
+ if (false === valid) {
307
+ if ('number' != typeof ms && 'bigint' != typeof ms) throw TypeError('sleep: ms must be a number');
308
+ throw RangeError('sleep: ms must be a number that is greater than 0 but less than Infinity');
309
+ }
310
+ Atomics.wait(nil, 0, 0, Number(ms));
311
+ }
312
+ module1.exports = sleep;
313
+ } else {
314
+ function sleep1(ms) {
315
+ const valid = ms > 0 && ms < 1 / 0;
316
+ if (false === valid) {
317
+ if ('number' != typeof ms && 'bigint' != typeof ms) throw TypeError('sleep: ms must be a number');
318
+ throw RangeError('sleep: ms must be a number that is greater than 0 but less than Infinity');
319
+ }
320
+ const target = Date.now() + Number(ms);
321
+ while(target > Date.now());
322
+ }
323
+ module1.exports = sleep1;
324
+ }
325
+ },
326
+ "../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js": function(module1) {
327
+ "use strict";
328
+ const refs = {
329
+ exit: [],
330
+ beforeExit: []
331
+ };
332
+ const functions = {
333
+ exit: onExit,
334
+ beforeExit: onBeforeExit
335
+ };
336
+ let registry;
337
+ function ensureRegistry() {
338
+ if (void 0 === registry) registry = new FinalizationRegistry(clear);
339
+ }
340
+ function install(event) {
341
+ if (refs[event].length > 0) return;
342
+ process.on(event, functions[event]);
343
+ }
344
+ function uninstall(event) {
345
+ if (refs[event].length > 0) return;
346
+ process.removeListener(event, functions[event]);
347
+ if (0 === refs.exit.length && 0 === refs.beforeExit.length) registry = void 0;
348
+ }
349
+ function onExit() {
350
+ callRefs('exit');
351
+ }
352
+ function onBeforeExit() {
353
+ callRefs('beforeExit');
354
+ }
355
+ function callRefs(event) {
356
+ for (const ref of refs[event]){
357
+ const obj = ref.deref();
358
+ const fn = ref.fn;
359
+ if (void 0 !== obj) fn(obj, event);
360
+ }
361
+ refs[event] = [];
362
+ }
363
+ function clear(ref) {
364
+ for (const event of [
365
+ 'exit',
366
+ 'beforeExit'
367
+ ]){
368
+ const index = refs[event].indexOf(ref);
369
+ refs[event].splice(index, index + 1);
370
+ uninstall(event);
371
+ }
372
+ }
373
+ function _register(event, obj, fn) {
374
+ if (void 0 === obj) throw new Error('the object can\'t be undefined');
375
+ install(event);
376
+ const ref = new WeakRef(obj);
377
+ ref.fn = fn;
378
+ ensureRegistry();
379
+ registry.register(obj, ref);
380
+ refs[event].push(ref);
381
+ }
382
+ function register(obj, fn) {
383
+ _register('exit', obj, fn);
384
+ }
385
+ function registerBeforeExit(obj, fn) {
386
+ _register('beforeExit', obj, fn);
387
+ }
388
+ function unregister(obj) {
389
+ if (void 0 === registry) return;
390
+ registry.unregister(obj);
391
+ for (const event of [
392
+ 'exit',
393
+ 'beforeExit'
394
+ ]){
395
+ refs[event] = refs[event].filter((ref)=>{
396
+ const _obj = ref.deref();
397
+ return _obj && _obj !== obj;
398
+ });
399
+ uninstall(event);
400
+ }
401
+ }
402
+ module1.exports = {
403
+ register,
404
+ registerBeforeExit,
405
+ unregister
406
+ };
407
+ },
408
+ "../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js": function(module1) {
409
+ "use strict";
410
+ function tryStringify(o) {
411
+ try {
412
+ return JSON.stringify(o);
413
+ } catch (e) {
414
+ return '"[Circular]"';
415
+ }
416
+ }
417
+ module1.exports = format;
418
+ function format(f, args, opts) {
419
+ var ss = opts && opts.stringify || tryStringify;
420
+ var offset = 1;
421
+ if ('object' == typeof f && null !== f) {
422
+ var len = args.length + offset;
423
+ if (1 === len) return f;
424
+ var objects = new Array(len);
425
+ objects[0] = ss(f);
426
+ for(var index = 1; index < len; index++)objects[index] = ss(args[index]);
427
+ return objects.join(' ');
428
+ }
429
+ if ('string' != typeof f) return f;
430
+ var argLen = args.length;
431
+ if (0 === argLen) return f;
432
+ var str = '';
433
+ var a = 1 - offset;
434
+ var lastPos = -1;
435
+ var flen = f && f.length || 0;
436
+ for(var i = 0; i < flen;){
437
+ if (37 === f.charCodeAt(i) && i + 1 < flen) {
438
+ lastPos = lastPos > -1 ? lastPos : 0;
439
+ switch(f.charCodeAt(i + 1)){
440
+ case 100:
441
+ case 102:
442
+ if (a >= argLen) break;
443
+ if (null == args[a]) break;
444
+ if (lastPos < i) str += f.slice(lastPos, i);
445
+ str += Number(args[a]);
446
+ lastPos = i + 2;
447
+ i++;
448
+ break;
449
+ case 105:
450
+ if (a >= argLen) break;
451
+ if (null == args[a]) break;
452
+ if (lastPos < i) str += f.slice(lastPos, i);
453
+ str += Math.floor(Number(args[a]));
454
+ lastPos = i + 2;
455
+ i++;
456
+ break;
457
+ case 79:
458
+ case 111:
459
+ case 106:
460
+ if (a >= argLen) break;
461
+ if (void 0 === args[a]) break;
462
+ if (lastPos < i) str += f.slice(lastPos, i);
463
+ var type = typeof args[a];
464
+ if ('string' === type) {
465
+ str += '\'' + args[a] + '\'';
466
+ lastPos = i + 2;
467
+ i++;
468
+ break;
469
+ }
470
+ if ('function' === type) {
471
+ str += args[a].name || '<anonymous>';
472
+ lastPos = i + 2;
473
+ i++;
474
+ break;
475
+ }
476
+ str += ss(args[a]);
477
+ lastPos = i + 2;
478
+ i++;
479
+ break;
480
+ case 115:
481
+ if (a >= argLen) break;
482
+ if (lastPos < i) str += f.slice(lastPos, i);
483
+ str += String(args[a]);
484
+ lastPos = i + 2;
485
+ i++;
486
+ break;
487
+ case 37:
488
+ if (lastPos < i) str += f.slice(lastPos, i);
489
+ str += '%';
490
+ lastPos = i + 2;
491
+ i++;
492
+ a--;
493
+ break;
494
+ }
495
+ ++a;
496
+ }
497
+ ++i;
498
+ }
499
+ if (-1 === lastPos) return f;
500
+ if (lastPos < flen) str += f.slice(lastPos);
501
+ return str;
502
+ }
503
+ },
504
+ "../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js": function(module1, exports) {
505
+ "use strict";
506
+ const { hasOwnProperty } = Object.prototype;
507
+ const stringify = configure();
508
+ stringify.configure = configure;
509
+ stringify.stringify = stringify;
510
+ stringify.default = stringify;
511
+ exports.stringify = stringify;
512
+ exports.configure = configure;
513
+ module1.exports = stringify;
514
+ const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
515
+ function strEscape(str) {
516
+ if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) return `"${str}"`;
517
+ return JSON.stringify(str);
518
+ }
519
+ function sort(array, comparator) {
520
+ if (array.length > 2e2 || comparator) return array.sort(comparator);
521
+ for(let i = 1; i < array.length; i++){
522
+ const currentValue = array[i];
523
+ let position = i;
524
+ while(0 !== position && array[position - 1] > currentValue){
525
+ array[position] = array[position - 1];
526
+ position--;
527
+ }
528
+ array[position] = currentValue;
529
+ }
530
+ return array;
531
+ }
532
+ const typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array())), Symbol.toStringTag).get;
533
+ function isTypedArrayWithEntries(value) {
534
+ return void 0 !== typedArrayPrototypeGetSymbolToStringTag.call(value) && 0 !== value.length;
535
+ }
536
+ function stringifyTypedArray(array, separator, maximumBreadth) {
537
+ if (array.length < maximumBreadth) maximumBreadth = array.length;
538
+ const whitespace = ',' === separator ? '' : ' ';
539
+ let res = `"0":${whitespace}${array[0]}`;
540
+ for(let i = 1; i < maximumBreadth; i++)res += `${separator}"${i}":${whitespace}${array[i]}`;
541
+ return res;
542
+ }
543
+ function getCircularValueOption(options) {
544
+ if (hasOwnProperty.call(options, 'circularValue')) {
545
+ const circularValue = options.circularValue;
546
+ if ('string' == typeof circularValue) return `"${circularValue}"`;
547
+ if (null == circularValue) return circularValue;
548
+ if (circularValue === Error || circularValue === TypeError) return {
549
+ toString () {
550
+ throw new TypeError('Converting circular structure to JSON');
551
+ }
552
+ };
553
+ throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
554
+ }
555
+ return '"[Circular]"';
556
+ }
557
+ function getDeterministicOption(options) {
558
+ let value;
559
+ if (hasOwnProperty.call(options, 'deterministic')) {
560
+ value = options.deterministic;
561
+ if ('boolean' != typeof value && 'function' != typeof value) throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
562
+ }
563
+ return void 0 === value ? true : value;
564
+ }
565
+ function getBooleanOption(options, key) {
566
+ let value;
567
+ if (hasOwnProperty.call(options, key)) {
568
+ value = options[key];
569
+ if ('boolean' != typeof value) throw new TypeError(`The "${key}" argument must be of type boolean`);
570
+ }
571
+ return void 0 === value ? true : value;
572
+ }
573
+ function getPositiveIntegerOption(options, key) {
574
+ let value;
575
+ if (hasOwnProperty.call(options, key)) {
576
+ value = options[key];
577
+ if ('number' != typeof value) throw new TypeError(`The "${key}" argument must be of type number`);
578
+ if (!Number.isInteger(value)) throw new TypeError(`The "${key}" argument must be an integer`);
579
+ if (value < 1) throw new RangeError(`The "${key}" argument must be >= 1`);
580
+ }
581
+ return void 0 === value ? 1 / 0 : value;
582
+ }
583
+ function getItemCount(number) {
584
+ if (1 === number) return '1 item';
585
+ return `${number} items`;
586
+ }
587
+ function getUniqueReplacerSet(replacerArray) {
588
+ const replacerSet = new Set();
589
+ for (const value of replacerArray)if ('string' == typeof value || 'number' == typeof value) replacerSet.add(String(value));
590
+ return replacerSet;
591
+ }
592
+ function getStrictOption(options) {
593
+ if (hasOwnProperty.call(options, 'strict')) {
594
+ const value = options.strict;
595
+ if ('boolean' != typeof value) throw new TypeError('The "strict" argument must be of type boolean');
596
+ if (value) return (value)=>{
597
+ let message = `Object can not safely be stringified. Received type ${typeof value}`;
598
+ if ('function' != typeof value) message += ` (${value.toString()})`;
599
+ throw new Error(message);
600
+ };
601
+ }
602
+ }
603
+ function configure(options) {
604
+ options = {
605
+ ...options
606
+ };
607
+ const fail = getStrictOption(options);
608
+ if (fail) {
609
+ if (void 0 === options.bigint) options.bigint = false;
610
+ if (!('circularValue' in options)) options.circularValue = Error;
611
+ }
612
+ const circularValue = getCircularValueOption(options);
613
+ const bigint = getBooleanOption(options, 'bigint');
614
+ const deterministic = getDeterministicOption(options);
615
+ const comparator = 'function' == typeof deterministic ? deterministic : void 0;
616
+ const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth');
617
+ const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth');
618
+ function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
619
+ let value = parent[key];
620
+ if ('object' == typeof value && null !== value && 'function' == typeof value.toJSON) value = value.toJSON(key);
621
+ value = replacer.call(parent, key, value);
622
+ switch(typeof value){
623
+ case 'string':
624
+ return strEscape(value);
625
+ case 'object':
626
+ {
627
+ if (null === value) return 'null';
628
+ if (-1 !== stack.indexOf(value)) return circularValue;
629
+ let res = '';
630
+ let join = ',';
631
+ const originalIndentation = indentation;
632
+ if (Array.isArray(value)) {
633
+ if (0 === value.length) return '[]';
634
+ if (maximumDepth < stack.length + 1) return '"[Array]"';
635
+ stack.push(value);
636
+ if ('' !== spacer) {
637
+ indentation += spacer;
638
+ res += `\n${indentation}`;
639
+ join = `,\n${indentation}`;
640
+ }
641
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
642
+ let i = 0;
643
+ for(; i < maximumValuesToStringify - 1; i++){
644
+ const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
645
+ res += void 0 !== tmp ? tmp : 'null';
646
+ res += join;
647
+ }
648
+ const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
649
+ res += void 0 !== tmp ? tmp : 'null';
650
+ if (value.length - 1 > maximumBreadth) {
651
+ const removedKeys = value.length - maximumBreadth - 1;
652
+ res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
653
+ }
654
+ if ('' !== spacer) res += `\n${originalIndentation}`;
655
+ stack.pop();
656
+ return `[${res}]`;
657
+ }
658
+ let keys = Object.keys(value);
659
+ const keyLength = keys.length;
660
+ if (0 === keyLength) return '{}';
661
+ if (maximumDepth < stack.length + 1) return '"[Object]"';
662
+ let whitespace = '';
663
+ let separator = '';
664
+ if ('' !== spacer) {
665
+ indentation += spacer;
666
+ join = `,\n${indentation}`;
667
+ whitespace = ' ';
668
+ }
669
+ const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
670
+ if (deterministic && !isTypedArrayWithEntries(value)) keys = sort(keys, comparator);
671
+ stack.push(value);
672
+ for(let i = 0; i < maximumPropertiesToStringify; i++){
673
+ const key = keys[i];
674
+ const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation);
675
+ if (void 0 !== tmp) {
676
+ res += `${separator}${strEscape(key)}:${whitespace}${tmp}`;
677
+ separator = join;
678
+ }
679
+ }
680
+ if (keyLength > maximumBreadth) {
681
+ const removedKeys = keyLength - maximumBreadth;
682
+ res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
683
+ separator = join;
684
+ }
685
+ if ('' !== spacer && separator.length > 1) res = `\n${indentation}${res}\n${originalIndentation}`;
686
+ stack.pop();
687
+ return `{${res}}`;
688
+ }
689
+ case 'number':
690
+ return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
691
+ case 'boolean':
692
+ return true === value ? 'true' : 'false';
693
+ case 'undefined':
694
+ return;
695
+ case 'bigint':
696
+ if (bigint) return String(value);
697
+ default:
698
+ return fail ? fail(value) : void 0;
699
+ }
700
+ }
701
+ function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
702
+ if ('object' == typeof value && null !== value && 'function' == typeof value.toJSON) value = value.toJSON(key);
703
+ switch(typeof value){
704
+ case 'string':
705
+ return strEscape(value);
706
+ case 'object':
707
+ {
708
+ if (null === value) return 'null';
709
+ if (-1 !== stack.indexOf(value)) return circularValue;
710
+ const originalIndentation = indentation;
711
+ let res = '';
712
+ let join = ',';
713
+ if (Array.isArray(value)) {
714
+ if (0 === value.length) return '[]';
715
+ if (maximumDepth < stack.length + 1) return '"[Array]"';
716
+ stack.push(value);
717
+ if ('' !== spacer) {
718
+ indentation += spacer;
719
+ res += `\n${indentation}`;
720
+ join = `,\n${indentation}`;
721
+ }
722
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
723
+ let i = 0;
724
+ for(; i < maximumValuesToStringify - 1; i++){
725
+ const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
726
+ res += void 0 !== tmp ? tmp : 'null';
727
+ res += join;
728
+ }
729
+ const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
730
+ res += void 0 !== tmp ? tmp : 'null';
731
+ if (value.length - 1 > maximumBreadth) {
732
+ const removedKeys = value.length - maximumBreadth - 1;
733
+ res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
734
+ }
735
+ if ('' !== spacer) res += `\n${originalIndentation}`;
736
+ stack.pop();
737
+ return `[${res}]`;
738
+ }
739
+ stack.push(value);
740
+ let whitespace = '';
741
+ if ('' !== spacer) {
742
+ indentation += spacer;
743
+ join = `,\n${indentation}`;
744
+ whitespace = ' ';
745
+ }
746
+ let separator = '';
747
+ for (const key of replacer){
748
+ const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation);
749
+ if (void 0 !== tmp) {
750
+ res += `${separator}${strEscape(key)}:${whitespace}${tmp}`;
751
+ separator = join;
752
+ }
753
+ }
754
+ if ('' !== spacer && separator.length > 1) res = `\n${indentation}${res}\n${originalIndentation}`;
755
+ stack.pop();
756
+ return `{${res}}`;
757
+ }
758
+ case 'number':
759
+ return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
760
+ case 'boolean':
761
+ return true === value ? 'true' : 'false';
762
+ case 'undefined':
763
+ return;
764
+ case 'bigint':
765
+ if (bigint) return String(value);
766
+ default:
767
+ return fail ? fail(value) : void 0;
768
+ }
769
+ }
770
+ function stringifyIndent(key, value, stack, spacer, indentation) {
771
+ switch(typeof value){
772
+ case 'string':
773
+ return strEscape(value);
774
+ case 'object':
775
+ {
776
+ if (null === value) return 'null';
777
+ if ('function' == typeof value.toJSON) {
778
+ value = value.toJSON(key);
779
+ if ('object' != typeof value) return stringifyIndent(key, value, stack, spacer, indentation);
780
+ if (null === value) return 'null';
781
+ }
782
+ if (-1 !== stack.indexOf(value)) return circularValue;
783
+ const originalIndentation = indentation;
784
+ if (Array.isArray(value)) {
785
+ if (0 === value.length) return '[]';
786
+ if (maximumDepth < stack.length + 1) return '"[Array]"';
787
+ stack.push(value);
788
+ indentation += spacer;
789
+ let res = `\n${indentation}`;
790
+ const join = `,\n${indentation}`;
791
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
792
+ let i = 0;
793
+ for(; i < maximumValuesToStringify - 1; i++){
794
+ const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
795
+ res += void 0 !== tmp ? tmp : 'null';
796
+ res += join;
797
+ }
798
+ const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
799
+ res += void 0 !== tmp ? tmp : 'null';
800
+ if (value.length - 1 > maximumBreadth) {
801
+ const removedKeys = value.length - maximumBreadth - 1;
802
+ res += `${join}"... ${getItemCount(removedKeys)} not stringified"`;
803
+ }
804
+ res += `\n${originalIndentation}`;
805
+ stack.pop();
806
+ return `[${res}]`;
807
+ }
808
+ let keys = Object.keys(value);
809
+ const keyLength = keys.length;
810
+ if (0 === keyLength) return '{}';
811
+ if (maximumDepth < stack.length + 1) return '"[Object]"';
812
+ indentation += spacer;
813
+ const join = `,\n${indentation}`;
814
+ let res = '';
815
+ let separator = '';
816
+ let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
817
+ if (isTypedArrayWithEntries(value)) {
818
+ res += stringifyTypedArray(value, join, maximumBreadth);
819
+ keys = keys.slice(value.length);
820
+ maximumPropertiesToStringify -= value.length;
821
+ separator = join;
822
+ }
823
+ if (deterministic) keys = sort(keys, comparator);
824
+ stack.push(value);
825
+ for(let i = 0; i < maximumPropertiesToStringify; i++){
826
+ const key = keys[i];
827
+ const tmp = stringifyIndent(key, value[key], stack, spacer, indentation);
828
+ if (void 0 !== tmp) {
829
+ res += `${separator}${strEscape(key)}: ${tmp}`;
830
+ separator = join;
831
+ }
832
+ }
833
+ if (keyLength > maximumBreadth) {
834
+ const removedKeys = keyLength - maximumBreadth;
835
+ res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
836
+ separator = join;
837
+ }
838
+ if ('' !== separator) res = `\n${indentation}${res}\n${originalIndentation}`;
839
+ stack.pop();
840
+ return `{${res}}`;
841
+ }
842
+ case 'number':
843
+ return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
844
+ case 'boolean':
845
+ return true === value ? 'true' : 'false';
846
+ case 'undefined':
847
+ return;
848
+ case 'bigint':
849
+ if (bigint) return String(value);
850
+ default:
851
+ return fail ? fail(value) : void 0;
852
+ }
853
+ }
854
+ function stringifySimple(key, value, stack) {
855
+ switch(typeof value){
856
+ case 'string':
857
+ return strEscape(value);
858
+ case 'object':
859
+ {
860
+ if (null === value) return 'null';
861
+ if ('function' == typeof value.toJSON) {
862
+ value = value.toJSON(key);
863
+ if ('object' != typeof value) return stringifySimple(key, value, stack);
864
+ if (null === value) return 'null';
865
+ }
866
+ if (-1 !== stack.indexOf(value)) return circularValue;
867
+ let res = '';
868
+ const hasLength = void 0 !== value.length;
869
+ if (hasLength && Array.isArray(value)) {
870
+ if (0 === value.length) return '[]';
871
+ if (maximumDepth < stack.length + 1) return '"[Array]"';
872
+ stack.push(value);
873
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
874
+ let i = 0;
875
+ for(; i < maximumValuesToStringify - 1; i++){
876
+ const tmp = stringifySimple(String(i), value[i], stack);
877
+ res += void 0 !== tmp ? tmp : 'null';
878
+ res += ',';
879
+ }
880
+ const tmp = stringifySimple(String(i), value[i], stack);
881
+ res += void 0 !== tmp ? tmp : 'null';
882
+ if (value.length - 1 > maximumBreadth) {
883
+ const removedKeys = value.length - maximumBreadth - 1;
884
+ res += `,"... ${getItemCount(removedKeys)} not stringified"`;
885
+ }
886
+ stack.pop();
887
+ return `[${res}]`;
888
+ }
889
+ let keys = Object.keys(value);
890
+ const keyLength = keys.length;
891
+ if (0 === keyLength) return '{}';
892
+ if (maximumDepth < stack.length + 1) return '"[Object]"';
893
+ let separator = '';
894
+ let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
895
+ if (hasLength && isTypedArrayWithEntries(value)) {
896
+ res += stringifyTypedArray(value, ',', maximumBreadth);
897
+ keys = keys.slice(value.length);
898
+ maximumPropertiesToStringify -= value.length;
899
+ separator = ',';
900
+ }
901
+ if (deterministic) keys = sort(keys, comparator);
902
+ stack.push(value);
903
+ for(let i = 0; i < maximumPropertiesToStringify; i++){
904
+ const key = keys[i];
905
+ const tmp = stringifySimple(key, value[key], stack);
906
+ if (void 0 !== tmp) {
907
+ res += `${separator}${strEscape(key)}:${tmp}`;
908
+ separator = ',';
909
+ }
910
+ }
911
+ if (keyLength > maximumBreadth) {
912
+ const removedKeys = keyLength - maximumBreadth;
913
+ res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
914
+ }
915
+ stack.pop();
916
+ return `{${res}}`;
917
+ }
918
+ case 'number':
919
+ return isFinite(value) ? String(value) : fail ? fail(value) : 'null';
920
+ case 'boolean':
921
+ return true === value ? 'true' : 'false';
922
+ case 'undefined':
923
+ return;
924
+ case 'bigint':
925
+ if (bigint) return String(value);
926
+ default:
927
+ return fail ? fail(value) : void 0;
928
+ }
929
+ }
930
+ function stringify(value, replacer, space) {
931
+ if (arguments.length > 1) {
932
+ let spacer = '';
933
+ if ('number' == typeof space) spacer = ' '.repeat(Math.min(space, 10));
934
+ else if ('string' == typeof space) spacer = space.slice(0, 10);
935
+ if (null != replacer) {
936
+ if ('function' == typeof replacer) return stringifyFnReplacer('', {
937
+ '': value
938
+ }, [], replacer, spacer, '');
939
+ if (Array.isArray(replacer)) return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '');
940
+ }
941
+ if (0 !== spacer.length) return stringifyIndent('', value, [], spacer, '');
942
+ }
943
+ return stringifySimple('', value, []);
944
+ }
945
+ return stringify;
946
+ }
947
+ },
948
+ "../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
949
+ "use strict";
950
+ const { version } = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/package.json");
951
+ const { EventEmitter } = __webpack_require__("events");
952
+ const { Worker } = __webpack_require__("worker_threads");
953
+ const { join } = __webpack_require__("path");
954
+ const { pathToFileURL } = __webpack_require__("url");
955
+ const { wait } = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js");
956
+ const { WRITE_INDEX, READ_INDEX } = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js");
957
+ const buffer = __webpack_require__("buffer");
958
+ const assert = __webpack_require__("assert");
959
+ const kImpl = Symbol('kImpl');
960
+ const MAX_STRING = buffer.constants.MAX_STRING_LENGTH;
961
+ class FakeWeakRef {
962
+ constructor(value){
963
+ this._value = value;
964
+ }
965
+ deref() {
966
+ return this._value;
967
+ }
968
+ }
969
+ class FakeFinalizationRegistry {
970
+ register() {}
971
+ unregister() {}
972
+ }
973
+ const FinalizationRegistry1 = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry;
974
+ const WeakRef1 = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef;
975
+ const registry = new FinalizationRegistry1((worker)=>{
976
+ if (worker.exited) return;
977
+ worker.terminate();
978
+ });
979
+ function createWorker(stream, opts) {
980
+ const { filename, workerData } = opts;
981
+ const bundlerOverrides = '__bundlerPathsOverrides' in globalThis ? globalThis.__bundlerPathsOverrides : {};
982
+ const toExecute = bundlerOverrides['thread-stream-worker'] || join(__dirname, 'lib', 'worker.js');
983
+ const worker = new Worker(toExecute, {
984
+ ...opts.workerOpts,
985
+ trackUnmanagedFds: false,
986
+ workerData: {
987
+ filename: 0 === filename.indexOf('file://') ? filename : pathToFileURL(filename).href,
988
+ dataBuf: stream[kImpl].dataBuf,
989
+ stateBuf: stream[kImpl].stateBuf,
990
+ workerData: {
991
+ $context: {
992
+ threadStreamVersion: version
993
+ },
994
+ ...workerData
995
+ }
996
+ }
997
+ });
998
+ worker.stream = new FakeWeakRef(stream);
999
+ worker.on('message', onWorkerMessage);
1000
+ worker.on('exit', onWorkerExit);
1001
+ registry.register(stream, worker);
1002
+ return worker;
1003
+ }
1004
+ function drain(stream) {
1005
+ assert(!stream[kImpl].sync);
1006
+ if (stream[kImpl].needDrain) {
1007
+ stream[kImpl].needDrain = false;
1008
+ stream.emit('drain');
1009
+ }
1010
+ }
1011
+ function nextFlush(stream) {
1012
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1013
+ let leftover = stream[kImpl].data.length - writeIndex;
1014
+ if (leftover > 0) {
1015
+ if (0 === stream[kImpl].buf.length) {
1016
+ stream[kImpl].flushing = false;
1017
+ if (stream[kImpl].ending) end(stream);
1018
+ else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
1019
+ return;
1020
+ }
1021
+ let toWrite = stream[kImpl].buf.slice(0, leftover);
1022
+ let toWriteBytes = Buffer.byteLength(toWrite);
1023
+ if (toWriteBytes <= leftover) {
1024
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1025
+ write(stream, toWrite, nextFlush.bind(null, stream));
1026
+ } else stream.flush(()=>{
1027
+ if (stream.destroyed) return;
1028
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1029
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1030
+ while(toWriteBytes > stream[kImpl].data.length){
1031
+ leftover /= 2;
1032
+ toWrite = stream[kImpl].buf.slice(0, leftover);
1033
+ toWriteBytes = Buffer.byteLength(toWrite);
1034
+ }
1035
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1036
+ write(stream, toWrite, nextFlush.bind(null, stream));
1037
+ });
1038
+ } else if (0 === leftover) {
1039
+ if (0 === writeIndex && 0 === stream[kImpl].buf.length) return;
1040
+ stream.flush(()=>{
1041
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1042
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1043
+ nextFlush(stream);
1044
+ });
1045
+ } else destroy(stream, new Error('overwritten'));
1046
+ }
1047
+ function onWorkerMessage(msg) {
1048
+ const stream = this.stream.deref();
1049
+ if (void 0 === stream) {
1050
+ this.exited = true;
1051
+ this.terminate();
1052
+ return;
1053
+ }
1054
+ switch(msg.code){
1055
+ case 'READY':
1056
+ this.stream = new WeakRef1(stream);
1057
+ stream.flush(()=>{
1058
+ stream[kImpl].ready = true;
1059
+ stream.emit('ready');
1060
+ });
1061
+ break;
1062
+ case 'ERROR':
1063
+ destroy(stream, msg.err);
1064
+ break;
1065
+ case 'EVENT':
1066
+ if (Array.isArray(msg.args)) stream.emit(msg.name, ...msg.args);
1067
+ else stream.emit(msg.name, msg.args);
1068
+ break;
1069
+ case 'WARNING':
1070
+ process.emitWarning(msg.err);
1071
+ break;
1072
+ default:
1073
+ destroy(stream, new Error('this should not happen: ' + msg.code));
1074
+ }
1075
+ }
1076
+ function onWorkerExit(code) {
1077
+ const stream = this.stream.deref();
1078
+ if (void 0 === stream) return;
1079
+ registry.unregister(stream);
1080
+ stream.worker.exited = true;
1081
+ stream.worker.off('exit', onWorkerExit);
1082
+ destroy(stream, 0 !== code ? new Error('the worker thread exited') : null);
1083
+ }
1084
+ class ThreadStream extends EventEmitter {
1085
+ constructor(opts = {}){
1086
+ super();
1087
+ if (opts.bufferSize < 4) throw new Error('bufferSize must at least fit a 4-byte utf-8 char');
1088
+ this[kImpl] = {};
1089
+ this[kImpl].stateBuf = new SharedArrayBuffer(128);
1090
+ this[kImpl].state = new Int32Array(this[kImpl].stateBuf);
1091
+ this[kImpl].dataBuf = new SharedArrayBuffer(opts.bufferSize || 4194304);
1092
+ this[kImpl].data = Buffer.from(this[kImpl].dataBuf);
1093
+ this[kImpl].sync = opts.sync || false;
1094
+ this[kImpl].ending = false;
1095
+ this[kImpl].ended = false;
1096
+ this[kImpl].needDrain = false;
1097
+ this[kImpl].destroyed = false;
1098
+ this[kImpl].flushing = false;
1099
+ this[kImpl].ready = false;
1100
+ this[kImpl].finished = false;
1101
+ this[kImpl].errored = null;
1102
+ this[kImpl].closed = false;
1103
+ this[kImpl].buf = '';
1104
+ this.worker = createWorker(this, opts);
1105
+ this.on('message', (message, transferList)=>{
1106
+ this.worker.postMessage(message, transferList);
1107
+ });
1108
+ }
1109
+ write(data) {
1110
+ if (this[kImpl].destroyed) {
1111
+ error(this, new Error('the worker has exited'));
1112
+ return false;
1113
+ }
1114
+ if (this[kImpl].ending) {
1115
+ error(this, new Error('the worker is ending'));
1116
+ return false;
1117
+ }
1118
+ if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) try {
1119
+ writeSync(this);
1120
+ this[kImpl].flushing = true;
1121
+ } catch (err) {
1122
+ destroy(this, err);
1123
+ return false;
1124
+ }
1125
+ this[kImpl].buf += data;
1126
+ if (this[kImpl].sync) try {
1127
+ writeSync(this);
1128
+ return true;
1129
+ } catch (err) {
1130
+ destroy(this, err);
1131
+ return false;
1132
+ }
1133
+ if (!this[kImpl].flushing) {
1134
+ this[kImpl].flushing = true;
1135
+ setImmediate(nextFlush, this);
1136
+ }
1137
+ this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
1138
+ return !this[kImpl].needDrain;
1139
+ }
1140
+ end() {
1141
+ if (this[kImpl].destroyed) return;
1142
+ this[kImpl].ending = true;
1143
+ end(this);
1144
+ }
1145
+ flush(cb) {
1146
+ if (this[kImpl].destroyed) {
1147
+ if ('function' == typeof cb) process.nextTick(cb, new Error('the worker has exited'));
1148
+ return;
1149
+ }
1150
+ const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
1151
+ wait(this[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res)=>{
1152
+ if (err) {
1153
+ destroy(this, err);
1154
+ process.nextTick(cb, err);
1155
+ return;
1156
+ }
1157
+ if ('not-equal' === res) return void this.flush(cb);
1158
+ process.nextTick(cb);
1159
+ });
1160
+ }
1161
+ flushSync() {
1162
+ if (this[kImpl].destroyed) return;
1163
+ writeSync(this);
1164
+ flushSync(this);
1165
+ }
1166
+ unref() {
1167
+ this.worker.unref();
1168
+ }
1169
+ ref() {
1170
+ this.worker.ref();
1171
+ }
1172
+ get ready() {
1173
+ return this[kImpl].ready;
1174
+ }
1175
+ get destroyed() {
1176
+ return this[kImpl].destroyed;
1177
+ }
1178
+ get closed() {
1179
+ return this[kImpl].closed;
1180
+ }
1181
+ get writable() {
1182
+ return !this[kImpl].destroyed && !this[kImpl].ending;
1183
+ }
1184
+ get writableEnded() {
1185
+ return this[kImpl].ending;
1186
+ }
1187
+ get writableFinished() {
1188
+ return this[kImpl].finished;
1189
+ }
1190
+ get writableNeedDrain() {
1191
+ return this[kImpl].needDrain;
1192
+ }
1193
+ get writableObjectMode() {
1194
+ return false;
1195
+ }
1196
+ get writableErrored() {
1197
+ return this[kImpl].errored;
1198
+ }
1199
+ }
1200
+ function error(stream, err) {
1201
+ setImmediate(()=>{
1202
+ stream.emit('error', err);
1203
+ });
1204
+ }
1205
+ function destroy(stream, err) {
1206
+ if (stream[kImpl].destroyed) return;
1207
+ stream[kImpl].destroyed = true;
1208
+ if (err) {
1209
+ stream[kImpl].errored = err;
1210
+ error(stream, err);
1211
+ }
1212
+ if (stream.worker.exited) setImmediate(()=>{
1213
+ stream[kImpl].closed = true;
1214
+ stream.emit('close');
1215
+ });
1216
+ else stream.worker.terminate().catch(()=>{}).then(()=>{
1217
+ stream[kImpl].closed = true;
1218
+ stream.emit('close');
1219
+ });
1220
+ }
1221
+ function write(stream, data, cb) {
1222
+ const current = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1223
+ const length = Buffer.byteLength(data);
1224
+ stream[kImpl].data.write(data, current);
1225
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length);
1226
+ Atomics.notify(stream[kImpl].state, WRITE_INDEX);
1227
+ cb();
1228
+ return true;
1229
+ }
1230
+ function end(stream) {
1231
+ if (stream[kImpl].ended || !stream[kImpl].ending || stream[kImpl].flushing) return;
1232
+ stream[kImpl].ended = true;
1233
+ try {
1234
+ stream.flushSync();
1235
+ let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
1236
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
1237
+ Atomics.notify(stream[kImpl].state, WRITE_INDEX);
1238
+ let spins = 0;
1239
+ while(-1 !== readIndex){
1240
+ Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
1241
+ readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
1242
+ if (-2 === readIndex) return void destroy(stream, new Error('end() failed'));
1243
+ if (10 === ++spins) return void destroy(stream, new Error('end() took too long (10s)'));
1244
+ }
1245
+ process.nextTick(()=>{
1246
+ stream[kImpl].finished = true;
1247
+ stream.emit('finish');
1248
+ });
1249
+ } catch (err) {
1250
+ destroy(stream, err);
1251
+ }
1252
+ }
1253
+ function writeSync(stream) {
1254
+ const cb = ()=>{
1255
+ if (stream[kImpl].ending) end(stream);
1256
+ else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
1257
+ };
1258
+ stream[kImpl].flushing = false;
1259
+ while(0 !== stream[kImpl].buf.length){
1260
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1261
+ let leftover = stream[kImpl].data.length - writeIndex;
1262
+ if (0 === leftover) {
1263
+ flushSync(stream);
1264
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1265
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1266
+ continue;
1267
+ }
1268
+ if (leftover < 0) throw new Error('overwritten');
1269
+ let toWrite = stream[kImpl].buf.slice(0, leftover);
1270
+ let toWriteBytes = Buffer.byteLength(toWrite);
1271
+ if (toWriteBytes <= leftover) {
1272
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1273
+ write(stream, toWrite, cb);
1274
+ } else {
1275
+ flushSync(stream);
1276
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
1277
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
1278
+ while(toWriteBytes > stream[kImpl].buf.length){
1279
+ leftover /= 2;
1280
+ toWrite = stream[kImpl].buf.slice(0, leftover);
1281
+ toWriteBytes = Buffer.byteLength(toWrite);
1282
+ }
1283
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
1284
+ write(stream, toWrite, cb);
1285
+ }
1286
+ }
1287
+ }
1288
+ function flushSync(stream) {
1289
+ if (stream[kImpl].flushing) throw new Error('unable to flush while flushing');
1290
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
1291
+ let spins = 0;
1292
+ while(true){
1293
+ const readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
1294
+ if (-2 === readIndex) throw Error('_flushSync failed');
1295
+ if (readIndex !== writeIndex) Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
1296
+ else break;
1297
+ if (10 === ++spins) throw new Error('_flushSync took too long (10s)');
1298
+ }
1299
+ }
1300
+ module1.exports = ThreadStream;
1301
+ },
1302
+ "../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js": function(module1) {
1303
+ "use strict";
1304
+ const WRITE_INDEX = 4;
1305
+ const READ_INDEX = 8;
1306
+ module1.exports = {
1307
+ WRITE_INDEX,
1308
+ READ_INDEX
1309
+ };
1310
+ },
1311
+ "../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js": function(module1) {
1312
+ "use strict";
1313
+ const MAX_TIMEOUT = 1000;
1314
+ function wait(state, index, expected, timeout, done) {
1315
+ const max = Date.now() + timeout;
1316
+ let current = Atomics.load(state, index);
1317
+ if (current === expected) return void done(null, 'ok');
1318
+ let prior = current;
1319
+ const check = (backoff)=>{
1320
+ if (Date.now() > max) done(null, 'timed-out');
1321
+ else setTimeout(()=>{
1322
+ prior = current;
1323
+ current = Atomics.load(state, index);
1324
+ if (current === prior) check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : 2 * backoff);
1325
+ else current === expected ? done(null, 'ok') : done(null, 'not-equal');
1326
+ }, backoff);
1327
+ };
1328
+ check(1);
1329
+ }
1330
+ function waitDiff(state, index, expected, timeout, done) {
1331
+ const max = Date.now() + timeout;
1332
+ let current = Atomics.load(state, index);
1333
+ if (current !== expected) return void done(null, 'ok');
1334
+ const check = (backoff)=>{
1335
+ if (Date.now() > max) done(null, 'timed-out');
1336
+ else setTimeout(()=>{
1337
+ current = Atomics.load(state, index);
1338
+ if (current !== expected) done(null, 'ok');
1339
+ else check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : 2 * backoff);
1340
+ }, backoff);
1341
+ };
1342
+ check(1);
1343
+ }
1344
+ module1.exports = {
1345
+ wait,
1346
+ waitDiff
1347
+ };
1348
+ },
1349
+ assert: function(module1) {
1350
+ "use strict";
1351
+ module1.exports = require("assert");
1352
+ },
1353
+ buffer: function(module1) {
1354
+ "use strict";
1355
+ module1.exports = require("buffer");
1356
+ },
1357
+ events: function(module1) {
1358
+ "use strict";
1359
+ module1.exports = require("events");
1360
+ },
1361
+ fs: function(module1) {
1362
+ "use strict";
1363
+ module1.exports = require("fs");
1364
+ },
1365
+ module: function(module1) {
1366
+ "use strict";
1367
+ module1.exports = require("module");
1368
+ },
1369
+ "node:diagnostics_channel": function(module1) {
1370
+ "use strict";
1371
+ module1.exports = require("node:diagnostics_channel");
1372
+ },
1373
+ "node:events": function(module1) {
1374
+ "use strict";
1375
+ module1.exports = require("node:events");
1376
+ },
1377
+ "node:os": function(module1) {
1378
+ "use strict";
1379
+ module1.exports = require("node:os");
1380
+ },
1381
+ "node:path": function(module1) {
1382
+ "use strict";
1383
+ module1.exports = require("node:path");
1384
+ },
1385
+ path: function(module1) {
1386
+ "use strict";
1387
+ module1.exports = require("path");
1388
+ },
1389
+ url: function(module1) {
1390
+ "use strict";
1391
+ module1.exports = require("url");
1392
+ },
1393
+ util: function(module1) {
1394
+ "use strict";
1395
+ module1.exports = require("util");
1396
+ },
1397
+ worker_threads: function(module1) {
1398
+ "use strict";
1399
+ module1.exports = require("worker_threads");
1400
+ },
1401
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/file.js": function(module1, __unused_webpack_exports, __webpack_require__) {
1402
+ "use strict";
1403
+ const pino = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/pino.js");
1404
+ const { once } = __webpack_require__("node:events");
1405
+ module1.exports = async function(opts = {}) {
1406
+ const destOpts = Object.assign({}, opts, {
1407
+ dest: opts.destination || 1,
1408
+ sync: false
1409
+ });
1410
+ delete destOpts.destination;
1411
+ const destination = pino.destination(destOpts);
1412
+ await once(destination, 'ready');
1413
+ return destination;
1414
+ };
1415
+ },
1416
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
1417
+ "use strict";
1418
+ const errSerializer = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err.js");
1419
+ const errWithCauseSerializer = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-with-cause.js");
1420
+ const reqSerializers = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/req.js");
1421
+ const resSerializers = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/res.js");
1422
+ module1.exports = {
1423
+ err: errSerializer,
1424
+ errWithCause: errWithCauseSerializer,
1425
+ mapHttpRequest: reqSerializers.mapHttpRequest,
1426
+ mapHttpResponse: resSerializers.mapHttpResponse,
1427
+ req: reqSerializers.reqSerializer,
1428
+ res: resSerializers.resSerializer,
1429
+ wrapErrorSerializer: function(customSerializer) {
1430
+ if (customSerializer === errSerializer) return customSerializer;
1431
+ return function(err) {
1432
+ return customSerializer(errSerializer(err));
1433
+ };
1434
+ },
1435
+ wrapRequestSerializer: function(customSerializer) {
1436
+ if (customSerializer === reqSerializers.reqSerializer) return customSerializer;
1437
+ return function(req) {
1438
+ return customSerializer(reqSerializers.reqSerializer(req));
1439
+ };
1440
+ },
1441
+ wrapResponseSerializer: function(customSerializer) {
1442
+ if (customSerializer === resSerializers.resSerializer) return customSerializer;
1443
+ return function(res) {
1444
+ return customSerializer(resSerializers.resSerializer(res));
1445
+ };
1446
+ }
1447
+ };
1448
+ },
1449
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-helpers.js": function(module1) {
1450
+ "use strict";
1451
+ const isErrorLike = (err)=>err && 'string' == typeof err.message;
1452
+ const getErrorCause = (err)=>{
1453
+ if (!err) return;
1454
+ const cause = err.cause;
1455
+ if ('function' != typeof cause) return isErrorLike(cause) ? cause : void 0;
1456
+ {
1457
+ const causeResult = err.cause();
1458
+ return isErrorLike(causeResult) ? causeResult : void 0;
1459
+ }
1460
+ };
1461
+ const _stackWithCauses = (err, seen)=>{
1462
+ if (!isErrorLike(err)) return '';
1463
+ const stack = err.stack || '';
1464
+ if (seen.has(err)) return stack + '\ncauses have become circular...';
1465
+ const cause = getErrorCause(err);
1466
+ if (!cause) return stack;
1467
+ seen.add(err);
1468
+ return stack + '\ncaused by: ' + _stackWithCauses(cause, seen);
1469
+ };
1470
+ const stackWithCauses = (err)=>_stackWithCauses(err, new Set());
1471
+ const _messageWithCauses = (err, seen, skip)=>{
1472
+ if (!isErrorLike(err)) return '';
1473
+ const message = skip ? '' : err.message || '';
1474
+ if (seen.has(err)) return message + ': ...';
1475
+ const cause = getErrorCause(err);
1476
+ if (!cause) return message;
1477
+ {
1478
+ seen.add(err);
1479
+ const skipIfVErrorStyleCause = 'function' == typeof err.cause;
1480
+ return message + (skipIfVErrorStyleCause ? '' : ': ') + _messageWithCauses(cause, seen, skipIfVErrorStyleCause);
1481
+ }
1482
+ };
1483
+ const messageWithCauses = (err)=>_messageWithCauses(err, new Set());
1484
+ module1.exports = {
1485
+ isErrorLike,
1486
+ getErrorCause,
1487
+ stackWithCauses,
1488
+ messageWithCauses
1489
+ };
1490
+ },
1491
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-proto.js": function(module1) {
1492
+ "use strict";
1493
+ const seen = Symbol('circular-ref-tag');
1494
+ const rawSymbol = Symbol('pino-raw-err-ref');
1495
+ const pinoErrProto = Object.create({}, {
1496
+ type: {
1497
+ enumerable: true,
1498
+ writable: true,
1499
+ value: void 0
1500
+ },
1501
+ message: {
1502
+ enumerable: true,
1503
+ writable: true,
1504
+ value: void 0
1505
+ },
1506
+ stack: {
1507
+ enumerable: true,
1508
+ writable: true,
1509
+ value: void 0
1510
+ },
1511
+ aggregateErrors: {
1512
+ enumerable: true,
1513
+ writable: true,
1514
+ value: void 0
1515
+ },
1516
+ raw: {
1517
+ enumerable: false,
1518
+ get: function() {
1519
+ return this[rawSymbol];
1520
+ },
1521
+ set: function(val) {
1522
+ this[rawSymbol] = val;
1523
+ }
1524
+ }
1525
+ });
1526
+ Object.defineProperty(pinoErrProto, rawSymbol, {
1527
+ writable: true,
1528
+ value: {}
1529
+ });
1530
+ module1.exports = {
1531
+ pinoErrProto,
1532
+ pinoErrorSymbols: {
1533
+ seen,
1534
+ rawSymbol
1535
+ }
1536
+ };
1537
+ },
1538
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-with-cause.js": function(module1, __unused_webpack_exports, __webpack_require__) {
1539
+ "use strict";
1540
+ module1.exports = errWithCauseSerializer;
1541
+ const { isErrorLike } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-helpers.js");
1542
+ const { pinoErrProto, pinoErrorSymbols } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-proto.js");
1543
+ const { seen } = pinoErrorSymbols;
1544
+ const { toString } = Object.prototype;
1545
+ function errWithCauseSerializer(err) {
1546
+ if (!isErrorLike(err)) return err;
1547
+ err[seen] = void 0;
1548
+ const _err = Object.create(pinoErrProto);
1549
+ _err.type = '[object Function]' === toString.call(err.constructor) ? err.constructor.name : err.name;
1550
+ _err.message = err.message;
1551
+ _err.stack = err.stack;
1552
+ if (Array.isArray(err.errors)) _err.aggregateErrors = err.errors.map((err)=>errWithCauseSerializer(err));
1553
+ if (isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen)) _err.cause = errWithCauseSerializer(err.cause);
1554
+ for(const key in err)if (void 0 === _err[key]) {
1555
+ const val = err[key];
1556
+ if (isErrorLike(val)) {
1557
+ if (!Object.prototype.hasOwnProperty.call(val, seen)) _err[key] = errWithCauseSerializer(val);
1558
+ } else _err[key] = val;
1559
+ }
1560
+ delete err[seen];
1561
+ _err.raw = err;
1562
+ return _err;
1563
+ }
1564
+ },
1565
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err.js": function(module1, __unused_webpack_exports, __webpack_require__) {
1566
+ "use strict";
1567
+ module1.exports = errSerializer;
1568
+ const { messageWithCauses, stackWithCauses, isErrorLike } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-helpers.js");
1569
+ const { pinoErrProto, pinoErrorSymbols } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/err-proto.js");
1570
+ const { seen } = pinoErrorSymbols;
1571
+ const { toString } = Object.prototype;
1572
+ function errSerializer(err) {
1573
+ if (!isErrorLike(err)) return err;
1574
+ err[seen] = void 0;
1575
+ const _err = Object.create(pinoErrProto);
1576
+ _err.type = '[object Function]' === toString.call(err.constructor) ? err.constructor.name : err.name;
1577
+ _err.message = messageWithCauses(err);
1578
+ _err.stack = stackWithCauses(err);
1579
+ if (Array.isArray(err.errors)) _err.aggregateErrors = err.errors.map((err)=>errSerializer(err));
1580
+ for(const key in err)if (void 0 === _err[key]) {
1581
+ const val = err[key];
1582
+ if (isErrorLike(val)) {
1583
+ if ('cause' !== key && !Object.prototype.hasOwnProperty.call(val, seen)) _err[key] = errSerializer(val);
1584
+ } else _err[key] = val;
1585
+ }
1586
+ delete err[seen];
1587
+ _err.raw = err;
1588
+ return _err;
1589
+ }
1590
+ },
1591
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/req.js": function(module1) {
1592
+ "use strict";
1593
+ module1.exports = {
1594
+ mapHttpRequest,
1595
+ reqSerializer
1596
+ };
1597
+ const rawSymbol = Symbol('pino-raw-req-ref');
1598
+ const pinoReqProto = Object.create({}, {
1599
+ id: {
1600
+ enumerable: true,
1601
+ writable: true,
1602
+ value: ''
1603
+ },
1604
+ method: {
1605
+ enumerable: true,
1606
+ writable: true,
1607
+ value: ''
1608
+ },
1609
+ url: {
1610
+ enumerable: true,
1611
+ writable: true,
1612
+ value: ''
1613
+ },
1614
+ query: {
1615
+ enumerable: true,
1616
+ writable: true,
1617
+ value: ''
1618
+ },
1619
+ params: {
1620
+ enumerable: true,
1621
+ writable: true,
1622
+ value: ''
1623
+ },
1624
+ headers: {
1625
+ enumerable: true,
1626
+ writable: true,
1627
+ value: {}
1628
+ },
1629
+ remoteAddress: {
1630
+ enumerable: true,
1631
+ writable: true,
1632
+ value: ''
1633
+ },
1634
+ remotePort: {
1635
+ enumerable: true,
1636
+ writable: true,
1637
+ value: ''
1638
+ },
1639
+ raw: {
1640
+ enumerable: false,
1641
+ get: function() {
1642
+ return this[rawSymbol];
1643
+ },
1644
+ set: function(val) {
1645
+ this[rawSymbol] = val;
1646
+ }
1647
+ }
1648
+ });
1649
+ Object.defineProperty(pinoReqProto, rawSymbol, {
1650
+ writable: true,
1651
+ value: {}
1652
+ });
1653
+ function reqSerializer(req) {
1654
+ const connection = req.info || req.socket;
1655
+ const _req = Object.create(pinoReqProto);
1656
+ _req.id = 'function' == typeof req.id ? req.id() : req.id || (req.info ? req.info.id : void 0);
1657
+ _req.method = req.method;
1658
+ if (req.originalUrl) _req.url = req.originalUrl;
1659
+ else {
1660
+ const path = req.path;
1661
+ _req.url = 'string' == typeof path ? path : req.url ? req.url.path || req.url : void 0;
1662
+ }
1663
+ if (req.query) _req.query = req.query;
1664
+ if (req.params) _req.params = req.params;
1665
+ _req.headers = req.headers;
1666
+ _req.remoteAddress = connection && connection.remoteAddress;
1667
+ _req.remotePort = connection && connection.remotePort;
1668
+ _req.raw = req.raw || req;
1669
+ return _req;
1670
+ }
1671
+ function mapHttpRequest(req) {
1672
+ return {
1673
+ req: reqSerializer(req)
1674
+ };
1675
+ }
1676
+ },
1677
+ "../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/lib/res.js": function(module1) {
1678
+ "use strict";
1679
+ module1.exports = {
1680
+ mapHttpResponse,
1681
+ resSerializer
1682
+ };
1683
+ const rawSymbol = Symbol('pino-raw-res-ref');
1684
+ const pinoResProto = Object.create({}, {
1685
+ statusCode: {
1686
+ enumerable: true,
1687
+ writable: true,
1688
+ value: 0
1689
+ },
1690
+ headers: {
1691
+ enumerable: true,
1692
+ writable: true,
1693
+ value: ''
1694
+ },
1695
+ raw: {
1696
+ enumerable: false,
1697
+ get: function() {
1698
+ return this[rawSymbol];
1699
+ },
1700
+ set: function(val) {
1701
+ this[rawSymbol] = val;
1702
+ }
1703
+ }
1704
+ });
1705
+ Object.defineProperty(pinoResProto, rawSymbol, {
1706
+ writable: true,
1707
+ value: {}
1708
+ });
1709
+ function resSerializer(res) {
1710
+ const _res = Object.create(pinoResProto);
1711
+ _res.statusCode = res.headersSent ? res.statusCode : null;
1712
+ _res.headers = res.getHeaders ? res.getHeaders() : res._headers;
1713
+ _res.raw = res;
1714
+ return _res;
1715
+ }
1716
+ function mapHttpResponse(res) {
1717
+ return {
1718
+ res: resSerializer(res)
1719
+ };
1720
+ }
1721
+ },
1722
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/caller.js": function(module1) {
1723
+ "use strict";
1724
+ function noOpPrepareStackTrace(_, stack) {
1725
+ return stack;
1726
+ }
1727
+ module1.exports = function() {
1728
+ const originalPrepare = Error.prepareStackTrace;
1729
+ Error.prepareStackTrace = noOpPrepareStackTrace;
1730
+ const stack = new Error().stack;
1731
+ Error.prepareStackTrace = originalPrepare;
1732
+ if (!Array.isArray(stack)) return;
1733
+ const entries = stack.slice(2);
1734
+ const fileNames = [];
1735
+ for (const entry of entries)if (entry) fileNames.push(entry.getFileName());
1736
+ return fileNames;
1737
+ };
1738
+ },
1739
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js": function(module1) {
1740
+ const DEFAULT_LEVELS = {
1741
+ trace: 10,
1742
+ debug: 20,
1743
+ info: 30,
1744
+ warn: 40,
1745
+ error: 50,
1746
+ fatal: 60
1747
+ };
1748
+ const SORTING_ORDER = {
1749
+ ASC: 'ASC',
1750
+ DESC: 'DESC'
1751
+ };
1752
+ module1.exports = {
1753
+ DEFAULT_LEVELS,
1754
+ SORTING_ORDER
1755
+ };
1756
+ },
1757
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/levels.js": function(module1, __unused_webpack_exports, __webpack_require__) {
1758
+ "use strict";
1759
+ const { lsCacheSym, levelValSym, useOnlyCustomLevelsSym, streamSym, formattersSym, hooksSym, levelCompSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
1760
+ const { noop, genLog } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js");
1761
+ const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js");
1762
+ const levelMethods = {
1763
+ fatal: (hook)=>{
1764
+ const logFatal = genLog(DEFAULT_LEVELS.fatal, hook);
1765
+ return function(...args) {
1766
+ const stream = this[streamSym];
1767
+ logFatal.call(this, ...args);
1768
+ if ('function' == typeof stream.flushSync) try {
1769
+ stream.flushSync();
1770
+ } catch (e) {}
1771
+ };
1772
+ },
1773
+ error: (hook)=>genLog(DEFAULT_LEVELS.error, hook),
1774
+ warn: (hook)=>genLog(DEFAULT_LEVELS.warn, hook),
1775
+ info: (hook)=>genLog(DEFAULT_LEVELS.info, hook),
1776
+ debug: (hook)=>genLog(DEFAULT_LEVELS.debug, hook),
1777
+ trace: (hook)=>genLog(DEFAULT_LEVELS.trace, hook)
1778
+ };
1779
+ const nums = Object.keys(DEFAULT_LEVELS).reduce((o, k)=>{
1780
+ o[DEFAULT_LEVELS[k]] = k;
1781
+ return o;
1782
+ }, {});
1783
+ const initialLsCache = Object.keys(nums).reduce((o, k)=>{
1784
+ o[k] = '{"level":' + Number(k);
1785
+ return o;
1786
+ }, {});
1787
+ function genLsCache(instance) {
1788
+ const formatter = instance[formattersSym].level;
1789
+ const { labels } = instance.levels;
1790
+ const cache = {};
1791
+ for(const label in labels){
1792
+ const level = formatter(labels[label], Number(label));
1793
+ cache[label] = JSON.stringify(level).slice(0, -1);
1794
+ }
1795
+ instance[lsCacheSym] = cache;
1796
+ return instance;
1797
+ }
1798
+ function isStandardLevel(level, useOnlyCustomLevels) {
1799
+ if (useOnlyCustomLevels) return false;
1800
+ switch(level){
1801
+ case 'fatal':
1802
+ case 'error':
1803
+ case 'warn':
1804
+ case 'info':
1805
+ case 'debug':
1806
+ case 'trace':
1807
+ return true;
1808
+ default:
1809
+ return false;
1810
+ }
1811
+ }
1812
+ function setLevel(level) {
1813
+ const { labels, values } = this.levels;
1814
+ if ('number' == typeof level) {
1815
+ if (void 0 === labels[level]) throw Error('unknown level value' + level);
1816
+ level = labels[level];
1817
+ }
1818
+ if (void 0 === values[level]) throw Error('unknown level ' + level);
1819
+ const preLevelVal = this[levelValSym];
1820
+ const levelVal = this[levelValSym] = values[level];
1821
+ const useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym];
1822
+ const levelComparison = this[levelCompSym];
1823
+ const hook = this[hooksSym].logMethod;
1824
+ for(const key in values){
1825
+ if (false === levelComparison(values[key], levelVal)) {
1826
+ this[key] = noop;
1827
+ continue;
1828
+ }
1829
+ this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook);
1830
+ }
1831
+ this.emit('level-change', level, levelVal, labels[preLevelVal], preLevelVal, this);
1832
+ }
1833
+ function getLevel(level) {
1834
+ const { levels, levelVal } = this;
1835
+ return levels && levels.labels ? levels.labels[levelVal] : '';
1836
+ }
1837
+ function isLevelEnabled(logLevel) {
1838
+ const { values } = this.levels;
1839
+ const logLevelVal = values[logLevel];
1840
+ return void 0 !== logLevelVal && this[levelCompSym](logLevelVal, this[levelValSym]);
1841
+ }
1842
+ function compareLevel(direction, current, expected) {
1843
+ if (direction === SORTING_ORDER.DESC) return current <= expected;
1844
+ return current >= expected;
1845
+ }
1846
+ function genLevelComparison(levelComparison) {
1847
+ if ('string' == typeof levelComparison) return compareLevel.bind(null, levelComparison);
1848
+ return levelComparison;
1849
+ }
1850
+ function mappings(customLevels = null, useOnlyCustomLevels = false) {
1851
+ const customNums = customLevels ? Object.keys(customLevels).reduce((o, k)=>{
1852
+ o[customLevels[k]] = k;
1853
+ return o;
1854
+ }, {}) : null;
1855
+ const labels = Object.assign(Object.create(Object.prototype, {
1856
+ Infinity: {
1857
+ value: 'silent'
1858
+ }
1859
+ }), useOnlyCustomLevels ? null : nums, customNums);
1860
+ const values = Object.assign(Object.create(Object.prototype, {
1861
+ silent: {
1862
+ value: 1 / 0
1863
+ }
1864
+ }), useOnlyCustomLevels ? null : DEFAULT_LEVELS, customLevels);
1865
+ return {
1866
+ labels,
1867
+ values
1868
+ };
1869
+ }
1870
+ function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) {
1871
+ if ('number' == typeof defaultLevel) {
1872
+ const values = [].concat(Object.keys(customLevels || {}).map((key)=>customLevels[key]), useOnlyCustomLevels ? [] : Object.keys(nums).map((level)=>+level), 1 / 0);
1873
+ if (!values.includes(defaultLevel)) throw Error(`default level:${defaultLevel} must be included in custom levels`);
1874
+ return;
1875
+ }
1876
+ const labels = Object.assign(Object.create(Object.prototype, {
1877
+ silent: {
1878
+ value: 1 / 0
1879
+ }
1880
+ }), useOnlyCustomLevels ? null : DEFAULT_LEVELS, customLevels);
1881
+ if (!(defaultLevel in labels)) throw Error(`default level:${defaultLevel} must be included in custom levels`);
1882
+ }
1883
+ function assertNoLevelCollisions(levels, customLevels) {
1884
+ const { labels, values } = levels;
1885
+ for(const k in customLevels){
1886
+ if (k in values) throw Error('levels cannot be overridden');
1887
+ if (customLevels[k] in labels) throw Error('pre-existing level values cannot be used for new levels');
1888
+ }
1889
+ }
1890
+ function assertLevelComparison(levelComparison) {
1891
+ if ('function' == typeof levelComparison) return;
1892
+ if ('string' == typeof levelComparison && Object.values(SORTING_ORDER).includes(levelComparison)) return;
1893
+ throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type');
1894
+ }
1895
+ module1.exports = {
1896
+ initialLsCache,
1897
+ genLsCache,
1898
+ levelMethods,
1899
+ getLevel,
1900
+ setLevel,
1901
+ isLevelEnabled,
1902
+ mappings,
1903
+ assertNoLevelCollisions,
1904
+ assertDefaultLevelFound,
1905
+ genLevelComparison,
1906
+ assertLevelComparison
1907
+ };
1908
+ },
1909
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/meta.js": function(module1) {
1910
+ "use strict";
1911
+ module1.exports = {
1912
+ version: '10.1.0'
1913
+ };
1914
+ },
1915
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/multistream.js": function(module1, __unused_webpack_exports, __webpack_require__) {
1916
+ "use strict";
1917
+ const metadata = Symbol.for('pino.metadata');
1918
+ const { DEFAULT_LEVELS } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js");
1919
+ const DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info;
1920
+ function multistream(streamsArray, opts) {
1921
+ streamsArray = streamsArray || [];
1922
+ opts = opts || {
1923
+ dedupe: false
1924
+ };
1925
+ const streamLevels = Object.create(DEFAULT_LEVELS);
1926
+ streamLevels.silent = 1 / 0;
1927
+ if (opts.levels && 'object' == typeof opts.levels) Object.keys(opts.levels).forEach((i)=>{
1928
+ streamLevels[i] = opts.levels[i];
1929
+ });
1930
+ const res = {
1931
+ write,
1932
+ add,
1933
+ remove,
1934
+ emit,
1935
+ flushSync,
1936
+ end,
1937
+ minLevel: 0,
1938
+ lastId: 0,
1939
+ streams: [],
1940
+ clone,
1941
+ [metadata]: true,
1942
+ streamLevels
1943
+ };
1944
+ if (Array.isArray(streamsArray)) streamsArray.forEach(add, res);
1945
+ else add.call(res, streamsArray);
1946
+ streamsArray = null;
1947
+ return res;
1948
+ function write(data) {
1949
+ let dest;
1950
+ const level = this.lastLevel;
1951
+ const { streams } = this;
1952
+ let recordedLevel = 0;
1953
+ let stream;
1954
+ for(let i = initLoopVar(streams.length, opts.dedupe); checkLoopVar(i, streams.length, opts.dedupe); i = adjustLoopVar(i, opts.dedupe)){
1955
+ dest = streams[i];
1956
+ if (dest.level <= level) {
1957
+ if (0 !== recordedLevel && recordedLevel !== dest.level) break;
1958
+ stream = dest.stream;
1959
+ if (stream[metadata]) {
1960
+ const { lastTime, lastMsg, lastObj, lastLogger } = this;
1961
+ stream.lastLevel = level;
1962
+ stream.lastTime = lastTime;
1963
+ stream.lastMsg = lastMsg;
1964
+ stream.lastObj = lastObj;
1965
+ stream.lastLogger = lastLogger;
1966
+ }
1967
+ stream.write(data);
1968
+ if (opts.dedupe) recordedLevel = dest.level;
1969
+ } else if (!opts.dedupe) break;
1970
+ }
1971
+ }
1972
+ function emit(...args) {
1973
+ for (const { stream } of this.streams)if ('function' == typeof stream.emit) stream.emit(...args);
1974
+ }
1975
+ function flushSync() {
1976
+ for (const { stream } of this.streams)if ('function' == typeof stream.flushSync) stream.flushSync();
1977
+ }
1978
+ function add(dest) {
1979
+ if (!dest) return res;
1980
+ const isStream = 'function' == typeof dest.write || dest.stream;
1981
+ const stream_ = dest.write ? dest : dest.stream;
1982
+ if (!isStream) throw Error('stream object needs to implement either StreamEntry or DestinationStream interface');
1983
+ const { streams, streamLevels } = this;
1984
+ let level;
1985
+ level = 'number' == typeof dest.levelVal ? dest.levelVal : 'string' == typeof dest.level ? streamLevels[dest.level] : 'number' == typeof dest.level ? dest.level : DEFAULT_INFO_LEVEL;
1986
+ const dest_ = {
1987
+ stream: stream_,
1988
+ level,
1989
+ levelVal: void 0,
1990
+ id: ++res.lastId
1991
+ };
1992
+ streams.unshift(dest_);
1993
+ streams.sort(compareByLevel);
1994
+ this.minLevel = streams[0].level;
1995
+ return res;
1996
+ }
1997
+ function remove(id) {
1998
+ const { streams } = this;
1999
+ const index = streams.findIndex((s)=>s.id === id);
2000
+ if (index >= 0) {
2001
+ streams.splice(index, 1);
2002
+ streams.sort(compareByLevel);
2003
+ this.minLevel = streams.length > 0 ? streams[0].level : -1;
2004
+ }
2005
+ return res;
2006
+ }
2007
+ function end() {
2008
+ for (const { stream } of this.streams){
2009
+ if ('function' == typeof stream.flushSync) stream.flushSync();
2010
+ stream.end();
2011
+ }
2012
+ }
2013
+ function clone(level) {
2014
+ const streams = new Array(this.streams.length);
2015
+ for(let i = 0; i < streams.length; i++)streams[i] = {
2016
+ level,
2017
+ stream: this.streams[i].stream
2018
+ };
2019
+ return {
2020
+ write,
2021
+ add,
2022
+ remove,
2023
+ minLevel: level,
2024
+ streams,
2025
+ clone,
2026
+ emit,
2027
+ flushSync,
2028
+ [metadata]: true
2029
+ };
2030
+ }
2031
+ }
2032
+ function compareByLevel(a, b) {
2033
+ return a.level - b.level;
2034
+ }
2035
+ function initLoopVar(length, dedupe) {
2036
+ return dedupe ? length - 1 : 0;
2037
+ }
2038
+ function adjustLoopVar(i, dedupe) {
2039
+ return dedupe ? i - 1 : i + 1;
2040
+ }
2041
+ function checkLoopVar(i, length, dedupe) {
2042
+ return dedupe ? i >= 0 : i < length;
2043
+ }
2044
+ module1.exports = multistream;
2045
+ },
2046
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/proto.js": function(module1, __unused_webpack_exports, __webpack_require__) {
2047
+ "use strict";
2048
+ const { EventEmitter } = __webpack_require__("node:events");
2049
+ const { lsCacheSym, levelValSym, setLevelSym, getLevelSym, chindingsSym, mixinSym, asJsonSym, writeSym, mixinMergeStrategySym, timeSym, timeSliceIndexSym, streamSym, serializersSym, formattersSym, errorKeySym, messageKeySym, useOnlyCustomLevelsSym, needsMetadataGsym, redactFmtSym, stringifySym, formatOptsSym, stringifiersSym, msgPrefixSym, hooksSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
2050
+ const { getLevel, setLevel, isLevelEnabled, mappings, initialLsCache, genLsCache, assertNoLevelCollisions } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/levels.js");
2051
+ const { asChindings, asJson, buildFormatters, stringify, noop } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js");
2052
+ const { version } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/meta.js");
2053
+ const redaction = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/redaction.js");
2054
+ const constructor = class {
2055
+ };
2056
+ const prototype = {
2057
+ constructor,
2058
+ child,
2059
+ bindings,
2060
+ setBindings,
2061
+ flush,
2062
+ isLevelEnabled,
2063
+ version,
2064
+ get level () {
2065
+ return this[getLevelSym]();
2066
+ },
2067
+ set level (lvl){
2068
+ this[setLevelSym](lvl);
2069
+ },
2070
+ get levelVal () {
2071
+ return this[levelValSym];
2072
+ },
2073
+ set levelVal (n){
2074
+ throw Error('levelVal is read-only');
2075
+ },
2076
+ get msgPrefix () {
2077
+ return this[msgPrefixSym];
2078
+ },
2079
+ get [Symbol.toStringTag] () {
2080
+ return 'Pino';
2081
+ },
2082
+ [lsCacheSym]: initialLsCache,
2083
+ [writeSym]: write,
2084
+ [asJsonSym]: asJson,
2085
+ [getLevelSym]: getLevel,
2086
+ [setLevelSym]: setLevel
2087
+ };
2088
+ Object.setPrototypeOf(prototype, EventEmitter.prototype);
2089
+ module1.exports = function() {
2090
+ return Object.create(prototype);
2091
+ };
2092
+ const resetChildingsFormatter = (bindings)=>bindings;
2093
+ function child(bindings, options) {
2094
+ if (!bindings) throw Error('missing bindings for child Pino');
2095
+ const serializers = this[serializersSym];
2096
+ const formatters = this[formattersSym];
2097
+ const instance = Object.create(this);
2098
+ if (null == options) {
2099
+ if (instance[formattersSym].bindings !== resetChildingsFormatter) instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
2100
+ instance[chindingsSym] = asChindings(instance, bindings);
2101
+ if (this.onChild !== noop) this.onChild(instance);
2102
+ return instance;
2103
+ }
2104
+ if (true === options.hasOwnProperty('serializers')) {
2105
+ instance[serializersSym] = Object.create(null);
2106
+ for(const k in serializers)instance[serializersSym][k] = serializers[k];
2107
+ const parentSymbols = Object.getOwnPropertySymbols(serializers);
2108
+ for(var i = 0; i < parentSymbols.length; i++){
2109
+ const ks = parentSymbols[i];
2110
+ instance[serializersSym][ks] = serializers[ks];
2111
+ }
2112
+ for(const bk in options.serializers)instance[serializersSym][bk] = options.serializers[bk];
2113
+ const bindingsSymbols = Object.getOwnPropertySymbols(options.serializers);
2114
+ for(var bi = 0; bi < bindingsSymbols.length; bi++){
2115
+ const bks = bindingsSymbols[bi];
2116
+ instance[serializersSym][bks] = options.serializers[bks];
2117
+ }
2118
+ } else instance[serializersSym] = serializers;
2119
+ if (options.hasOwnProperty('formatters')) {
2120
+ const { level, bindings: chindings, log } = options.formatters;
2121
+ instance[formattersSym] = buildFormatters(level || formatters.level, chindings || resetChildingsFormatter, log || formatters.log);
2122
+ } else instance[formattersSym] = buildFormatters(formatters.level, resetChildingsFormatter, formatters.log);
2123
+ if (true === options.hasOwnProperty('customLevels')) {
2124
+ assertNoLevelCollisions(this.levels, options.customLevels);
2125
+ instance.levels = mappings(options.customLevels, instance[useOnlyCustomLevelsSym]);
2126
+ genLsCache(instance);
2127
+ }
2128
+ if ('object' == typeof options.redact && null !== options.redact || Array.isArray(options.redact)) {
2129
+ instance.redact = options.redact;
2130
+ const stringifiers = redaction(instance.redact, stringify);
2131
+ const formatOpts = {
2132
+ stringify: stringifiers[redactFmtSym]
2133
+ };
2134
+ instance[stringifySym] = stringify;
2135
+ instance[stringifiersSym] = stringifiers;
2136
+ instance[formatOptsSym] = formatOpts;
2137
+ }
2138
+ if ('string' == typeof options.msgPrefix) instance[msgPrefixSym] = (this[msgPrefixSym] || '') + options.msgPrefix;
2139
+ instance[chindingsSym] = asChindings(instance, bindings);
2140
+ if (void 0 !== options.level && options.level !== this.level || options.hasOwnProperty('customLevels')) {
2141
+ const childLevel = options.level || this.level;
2142
+ instance[setLevelSym](childLevel);
2143
+ }
2144
+ this.onChild(instance);
2145
+ return instance;
2146
+ }
2147
+ function bindings() {
2148
+ const chindings = this[chindingsSym];
2149
+ const chindingsJson = `{${chindings.substr(1)}}`;
2150
+ const bindingsFromJson = JSON.parse(chindingsJson);
2151
+ delete bindingsFromJson.pid;
2152
+ delete bindingsFromJson.hostname;
2153
+ return bindingsFromJson;
2154
+ }
2155
+ function setBindings(newBindings) {
2156
+ const chindings = asChindings(this, newBindings);
2157
+ this[chindingsSym] = chindings;
2158
+ }
2159
+ function defaultMixinMergeStrategy(mergeObject, mixinObject) {
2160
+ return Object.assign(mixinObject, mergeObject);
2161
+ }
2162
+ function write(_obj, msg, num) {
2163
+ const t = this[timeSym]();
2164
+ const mixin = this[mixinSym];
2165
+ const errorKey = this[errorKeySym];
2166
+ const messageKey = this[messageKeySym];
2167
+ const mixinMergeStrategy = this[mixinMergeStrategySym] || defaultMixinMergeStrategy;
2168
+ let obj;
2169
+ const streamWriteHook = this[hooksSym].streamWrite;
2170
+ if (null == _obj) obj = {};
2171
+ else if (_obj instanceof Error) {
2172
+ obj = {
2173
+ [errorKey]: _obj
2174
+ };
2175
+ if (void 0 === msg) msg = _obj.message;
2176
+ } else {
2177
+ obj = _obj;
2178
+ if (void 0 === msg && void 0 === _obj[messageKey] && _obj[errorKey]) msg = _obj[errorKey].message;
2179
+ }
2180
+ if (mixin) obj = mixinMergeStrategy(obj, mixin(obj, num, this));
2181
+ const s = this[asJsonSym](obj, msg, num, t);
2182
+ const stream = this[streamSym];
2183
+ if (true === stream[needsMetadataGsym]) {
2184
+ stream.lastLevel = num;
2185
+ stream.lastObj = obj;
2186
+ stream.lastMsg = msg;
2187
+ stream.lastTime = t.slice(this[timeSliceIndexSym]);
2188
+ stream.lastLogger = this;
2189
+ }
2190
+ stream.write(streamWriteHook ? streamWriteHook(s) : s);
2191
+ }
2192
+ function flush(cb) {
2193
+ if (null != cb && 'function' != typeof cb) throw Error('callback must be a function');
2194
+ const stream = this[streamSym];
2195
+ if ('function' == typeof stream.flush) stream.flush(cb || noop);
2196
+ else if (cb) cb();
2197
+ }
2198
+ },
2199
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/redaction.js": function(module1, __unused_webpack_exports, __webpack_require__) {
2200
+ "use strict";
2201
+ const Redact = __webpack_require__("../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js");
2202
+ const { redactFmtSym, wildcardFirstSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
2203
+ const rx = /[^.[\]]+|\[([^[\]]*?)\]/g;
2204
+ const CENSOR = '[Redacted]';
2205
+ const strict = false;
2206
+ function redaction(opts, serialize) {
2207
+ const { paths, censor, remove } = handle(opts);
2208
+ const shape = paths.reduce((o, str)=>{
2209
+ rx.lastIndex = 0;
2210
+ const first = rx.exec(str);
2211
+ const next = rx.exec(str);
2212
+ let ns = void 0 !== first[1] ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, '$1') : first[0];
2213
+ if ('*' === ns) ns = wildcardFirstSym;
2214
+ if (null === next) {
2215
+ o[ns] = null;
2216
+ return o;
2217
+ }
2218
+ if (null === o[ns]) return o;
2219
+ const { index } = next;
2220
+ const nextPath = `${str.substr(index, str.length - 1)}`;
2221
+ o[ns] = o[ns] || [];
2222
+ if (ns !== wildcardFirstSym && 0 === o[ns].length) o[ns].push(...o[wildcardFirstSym] || []);
2223
+ if (ns === wildcardFirstSym) Object.keys(o).forEach(function(k) {
2224
+ if (o[k]) o[k].push(nextPath);
2225
+ });
2226
+ o[ns].push(nextPath);
2227
+ return o;
2228
+ }, {});
2229
+ const result = {
2230
+ [redactFmtSym]: Redact({
2231
+ paths,
2232
+ censor,
2233
+ serialize,
2234
+ strict,
2235
+ remove
2236
+ })
2237
+ };
2238
+ const topCensor = (...args)=>'function' == typeof censor ? serialize(censor(...args)) : serialize(censor);
2239
+ return [
2240
+ ...Object.keys(shape),
2241
+ ...Object.getOwnPropertySymbols(shape)
2242
+ ].reduce((o, k)=>{
2243
+ if (null === shape[k]) o[k] = (value)=>topCensor(value, [
2244
+ k
2245
+ ]);
2246
+ else {
2247
+ const wrappedCensor = 'function' == typeof censor ? (value, path)=>censor(value, [
2248
+ k,
2249
+ ...path
2250
+ ]) : censor;
2251
+ o[k] = Redact({
2252
+ paths: shape[k],
2253
+ censor: wrappedCensor,
2254
+ serialize,
2255
+ strict,
2256
+ remove
2257
+ });
2258
+ }
2259
+ return o;
2260
+ }, result);
2261
+ }
2262
+ function handle(opts) {
2263
+ if (Array.isArray(opts)) {
2264
+ opts = {
2265
+ paths: opts,
2266
+ censor: CENSOR
2267
+ };
2268
+ return opts;
2269
+ }
2270
+ let { paths, censor = CENSOR, remove } = opts;
2271
+ if (false === Array.isArray(paths)) throw Error('pino – redact must contain an array of strings');
2272
+ if (true === remove) censor = void 0;
2273
+ return {
2274
+ paths,
2275
+ censor,
2276
+ remove
2277
+ };
2278
+ }
2279
+ module1.exports = redaction;
2280
+ },
2281
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js": function(module1) {
2282
+ "use strict";
2283
+ const setLevelSym = Symbol('pino.setLevel');
2284
+ const getLevelSym = Symbol('pino.getLevel');
2285
+ const levelValSym = Symbol('pino.levelVal');
2286
+ const levelCompSym = Symbol('pino.levelComp');
2287
+ const useLevelLabelsSym = Symbol('pino.useLevelLabels');
2288
+ const useOnlyCustomLevelsSym = Symbol('pino.useOnlyCustomLevels');
2289
+ const mixinSym = Symbol('pino.mixin');
2290
+ const lsCacheSym = Symbol('pino.lsCache');
2291
+ const chindingsSym = Symbol('pino.chindings');
2292
+ const asJsonSym = Symbol('pino.asJson');
2293
+ const writeSym = Symbol('pino.write');
2294
+ const redactFmtSym = Symbol('pino.redactFmt');
2295
+ const timeSym = Symbol('pino.time');
2296
+ const timeSliceIndexSym = Symbol('pino.timeSliceIndex');
2297
+ const streamSym = Symbol('pino.stream');
2298
+ const stringifySym = Symbol('pino.stringify');
2299
+ const stringifySafeSym = Symbol('pino.stringifySafe');
2300
+ const stringifiersSym = Symbol('pino.stringifiers');
2301
+ const endSym = Symbol('pino.end');
2302
+ const formatOptsSym = Symbol('pino.formatOpts');
2303
+ const messageKeySym = Symbol('pino.messageKey');
2304
+ const errorKeySym = Symbol('pino.errorKey');
2305
+ const nestedKeySym = Symbol('pino.nestedKey');
2306
+ const nestedKeyStrSym = Symbol('pino.nestedKeyStr');
2307
+ const mixinMergeStrategySym = Symbol('pino.mixinMergeStrategy');
2308
+ const msgPrefixSym = Symbol('pino.msgPrefix');
2309
+ const wildcardFirstSym = Symbol('pino.wildcardFirst');
2310
+ const serializersSym = Symbol.for('pino.serializers');
2311
+ const formattersSym = Symbol.for('pino.formatters');
2312
+ const hooksSym = Symbol.for('pino.hooks');
2313
+ const needsMetadataGsym = Symbol.for('pino.metadata');
2314
+ module1.exports = {
2315
+ setLevelSym,
2316
+ getLevelSym,
2317
+ levelValSym,
2318
+ levelCompSym,
2319
+ useLevelLabelsSym,
2320
+ mixinSym,
2321
+ lsCacheSym,
2322
+ chindingsSym,
2323
+ asJsonSym,
2324
+ writeSym,
2325
+ serializersSym,
2326
+ redactFmtSym,
2327
+ timeSym,
2328
+ timeSliceIndexSym,
2329
+ streamSym,
2330
+ stringifySym,
2331
+ stringifySafeSym,
2332
+ stringifiersSym,
2333
+ endSym,
2334
+ formatOptsSym,
2335
+ messageKeySym,
2336
+ errorKeySym,
2337
+ nestedKeySym,
2338
+ wildcardFirstSym,
2339
+ needsMetadataGsym,
2340
+ useOnlyCustomLevelsSym,
2341
+ formattersSym,
2342
+ hooksSym,
2343
+ nestedKeyStrSym,
2344
+ mixinMergeStrategySym,
2345
+ msgPrefixSym
2346
+ };
2347
+ },
2348
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/time.js": function(module1) {
2349
+ "use strict";
2350
+ const nullTime = ()=>'';
2351
+ const epochTime = ()=>`,"time":${Date.now()}`;
2352
+ const unixTime = ()=>`,"time":${Math.round(Date.now() / 1000.0)}`;
2353
+ const isoTime = ()=>`,"time":"${new Date(Date.now()).toISOString()}"`;
2354
+ const NS_PER_MS = 1000000n;
2355
+ const NS_PER_SEC = 1000000000n;
2356
+ const startWallTimeNs = BigInt(Date.now()) * NS_PER_MS;
2357
+ const startHrTime = process.hrtime.bigint();
2358
+ const isoTimeNano = ()=>{
2359
+ const elapsedNs = process.hrtime.bigint() - startHrTime;
2360
+ const currentTimeNs = startWallTimeNs + elapsedNs;
2361
+ const secondsSinceEpoch = currentTimeNs / NS_PER_SEC;
2362
+ const nanosWithinSecond = currentTimeNs % NS_PER_SEC;
2363
+ const msSinceEpoch = Number(1000n * secondsSinceEpoch + nanosWithinSecond / 1000000n);
2364
+ const date = new Date(msSinceEpoch);
2365
+ const year = date.getUTCFullYear();
2366
+ const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');
2367
+ const day = date.getUTCDate().toString().padStart(2, '0');
2368
+ const hours = date.getUTCHours().toString().padStart(2, '0');
2369
+ const minutes = date.getUTCMinutes().toString().padStart(2, '0');
2370
+ const seconds = date.getUTCSeconds().toString().padStart(2, '0');
2371
+ return `,"time":"${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${nanosWithinSecond.toString().padStart(9, '0')}Z"`;
2372
+ };
2373
+ module1.exports = {
2374
+ nullTime,
2375
+ epochTime,
2376
+ unixTime,
2377
+ isoTime,
2378
+ isoTimeNano
2379
+ };
2380
+ },
2381
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js": function(module1, __unused_webpack_exports, __webpack_require__) {
2382
+ "use strict";
2383
+ const diagChan = __webpack_require__("node:diagnostics_channel");
2384
+ const format = __webpack_require__("../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js");
2385
+ const { mapHttpRequest, mapHttpResponse } = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js");
2386
+ const SonicBoom = __webpack_require__("../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js");
2387
+ const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
2388
+ const { lsCacheSym, chindingsSym, writeSym, serializersSym, formatOptsSym, endSym, stringifiersSym, stringifySym, stringifySafeSym, wildcardFirstSym, nestedKeySym, formattersSym, messageKeySym, errorKeySym, nestedKeyStrSym, msgPrefixSym } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
2389
+ const { isMainThread } = __webpack_require__("worker_threads");
2390
+ const transport = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport.js");
2391
+ const asJsonChan = diagChan.tracingChannel('pino_asJson');
2392
+ function noop() {}
2393
+ function genLog(level, hook) {
2394
+ if (!hook) return LOG;
2395
+ return function(...args) {
2396
+ hook.call(this, args, LOG, level);
2397
+ };
2398
+ function LOG(o, ...n1) {
2399
+ if ('object' == typeof o) {
2400
+ let msg = o;
2401
+ if (null !== o) {
2402
+ if (o.method && o.headers && o.socket) o = mapHttpRequest(o);
2403
+ else if ('function' == typeof o.setHeader) o = mapHttpResponse(o);
2404
+ }
2405
+ let formatParams;
2406
+ if (null === msg && 0 === n1.length) formatParams = [
2407
+ null
2408
+ ];
2409
+ else {
2410
+ msg = n1.shift();
2411
+ formatParams = n1;
2412
+ }
2413
+ if ('string' == typeof this[msgPrefixSym] && null != msg) msg = this[msgPrefixSym] + msg;
2414
+ this[writeSym](o, format(msg, formatParams, this[formatOptsSym]), level);
2415
+ } else {
2416
+ let msg = void 0 === o ? n1.shift() : o;
2417
+ if ('string' == typeof this[msgPrefixSym] && null != msg) msg = this[msgPrefixSym] + msg;
2418
+ this[writeSym](null, format(msg, n1, this[formatOptsSym]), level);
2419
+ }
2420
+ }
2421
+ }
2422
+ function asString(str) {
2423
+ let result = '';
2424
+ let last = 0;
2425
+ let found = false;
2426
+ let point = 255;
2427
+ const l = str.length;
2428
+ if (l > 100) return JSON.stringify(str);
2429
+ for(var i = 0; i < l && point >= 32; i++){
2430
+ point = str.charCodeAt(i);
2431
+ if (34 === point || 92 === point) {
2432
+ result += str.slice(last, i) + '\\';
2433
+ last = i;
2434
+ found = true;
2435
+ }
2436
+ }
2437
+ if (found) result += str.slice(last);
2438
+ else result = str;
2439
+ return point < 32 ? JSON.stringify(str) : '"' + result + '"';
2440
+ }
2441
+ function asJson(obj, msg, num, time) {
2442
+ if (false === asJsonChan.hasSubscribers) return _asJson.call(this, obj, msg, num, time);
2443
+ const store = {
2444
+ instance: this,
2445
+ arguments
2446
+ };
2447
+ return asJsonChan.traceSync(_asJson, store, this, obj, msg, num, time);
2448
+ }
2449
+ function _asJson(obj, msg, num, time) {
2450
+ const stringify = this[stringifySym];
2451
+ const stringifySafe = this[stringifySafeSym];
2452
+ const stringifiers = this[stringifiersSym];
2453
+ const end = this[endSym];
2454
+ const chindings = this[chindingsSym];
2455
+ const serializers = this[serializersSym];
2456
+ const formatters = this[formattersSym];
2457
+ const messageKey = this[messageKeySym];
2458
+ const errorKey = this[errorKeySym];
2459
+ let data = this[lsCacheSym][num] + time;
2460
+ data += chindings;
2461
+ let value;
2462
+ if (formatters.log) obj = formatters.log(obj);
2463
+ const wildcardStringifier = stringifiers[wildcardFirstSym];
2464
+ let propStr = '';
2465
+ for(const key in obj){
2466
+ value = obj[key];
2467
+ if (Object.prototype.hasOwnProperty.call(obj, key) && void 0 !== value) {
2468
+ if (serializers[key]) value = serializers[key](value);
2469
+ else if (key === errorKey && serializers.err) value = serializers.err(value);
2470
+ const stringifier = stringifiers[key] || wildcardStringifier;
2471
+ switch(typeof value){
2472
+ case 'undefined':
2473
+ case 'function':
2474
+ continue;
2475
+ case 'number':
2476
+ if (false === Number.isFinite(value)) value = null;
2477
+ case 'boolean':
2478
+ if (stringifier) value = stringifier(value);
2479
+ break;
2480
+ case 'string':
2481
+ value = (stringifier || asString)(value);
2482
+ break;
2483
+ default:
2484
+ value = (stringifier || stringify)(value, stringifySafe);
2485
+ }
2486
+ if (void 0 === value) continue;
2487
+ const strKey = asString(key);
2488
+ propStr += ',' + strKey + ':' + value;
2489
+ }
2490
+ }
2491
+ let msgStr = '';
2492
+ if (void 0 !== msg) {
2493
+ value = serializers[messageKey] ? serializers[messageKey](msg) : msg;
2494
+ const stringifier = stringifiers[messageKey] || wildcardStringifier;
2495
+ switch(typeof value){
2496
+ case 'function':
2497
+ break;
2498
+ case 'number':
2499
+ if (false === Number.isFinite(value)) value = null;
2500
+ case 'boolean':
2501
+ if (stringifier) value = stringifier(value);
2502
+ msgStr = ',"' + messageKey + '":' + value;
2503
+ break;
2504
+ case 'string':
2505
+ value = (stringifier || asString)(value);
2506
+ msgStr = ',"' + messageKey + '":' + value;
2507
+ break;
2508
+ default:
2509
+ value = (stringifier || stringify)(value, stringifySafe);
2510
+ msgStr = ',"' + messageKey + '":' + value;
2511
+ }
2512
+ }
2513
+ if (this[nestedKeySym] && propStr) return data + this[nestedKeyStrSym] + propStr.slice(1) + '}' + msgStr + end;
2514
+ return data + propStr + msgStr + end;
2515
+ }
2516
+ function asChindings(instance, bindings) {
2517
+ let value;
2518
+ let data = instance[chindingsSym];
2519
+ const stringify = instance[stringifySym];
2520
+ const stringifySafe = instance[stringifySafeSym];
2521
+ const stringifiers = instance[stringifiersSym];
2522
+ const wildcardStringifier = stringifiers[wildcardFirstSym];
2523
+ const serializers = instance[serializersSym];
2524
+ const formatter = instance[formattersSym].bindings;
2525
+ bindings = formatter(bindings);
2526
+ for(const key in bindings){
2527
+ value = bindings[key];
2528
+ const valid = (key.length < 5 || 'level' !== key && 'serializers' !== key && 'formatters' !== key && 'customLevels' !== key) && bindings.hasOwnProperty(key) && void 0 !== value;
2529
+ if (true === valid) {
2530
+ value = serializers[key] ? serializers[key](value) : value;
2531
+ value = (stringifiers[key] || wildcardStringifier || stringify)(value, stringifySafe);
2532
+ if (void 0 === value) continue;
2533
+ data += ',"' + key + '":' + value;
2534
+ }
2535
+ }
2536
+ return data;
2537
+ }
2538
+ function hasBeenTampered(stream) {
2539
+ return stream.write !== stream.constructor.prototype.write;
2540
+ }
2541
+ function buildSafeSonicBoom(opts) {
2542
+ const stream = new SonicBoom(opts);
2543
+ stream.on('error', filterBrokenPipe);
2544
+ if (!opts.sync && isMainThread) {
2545
+ onExit.register(stream, autoEnd);
2546
+ stream.on('close', function() {
2547
+ onExit.unregister(stream);
2548
+ });
2549
+ }
2550
+ return stream;
2551
+ function filterBrokenPipe(err) {
2552
+ if ('EPIPE' === err.code) {
2553
+ stream.write = noop;
2554
+ stream.end = noop;
2555
+ stream.flushSync = noop;
2556
+ stream.destroy = noop;
2557
+ return;
2558
+ }
2559
+ stream.removeListener('error', filterBrokenPipe);
2560
+ stream.emit('error', err);
2561
+ }
2562
+ }
2563
+ function autoEnd(stream, eventName) {
2564
+ if (stream.destroyed) return;
2565
+ if ('beforeExit' === eventName) {
2566
+ stream.flush();
2567
+ stream.on('drain', function() {
2568
+ stream.end();
2569
+ });
2570
+ } else stream.flushSync();
2571
+ }
2572
+ function createArgsNormalizer(defaultOptions) {
2573
+ return function(instance, caller, opts = {}, stream) {
2574
+ if ('string' == typeof opts) {
2575
+ stream = buildSafeSonicBoom({
2576
+ dest: opts
2577
+ });
2578
+ opts = {};
2579
+ } else if ('string' == typeof stream) {
2580
+ if (opts && opts.transport) throw Error('only one of option.transport or stream can be specified');
2581
+ stream = buildSafeSonicBoom({
2582
+ dest: stream
2583
+ });
2584
+ } else if (opts instanceof SonicBoom || opts.writable || opts._writableState) {
2585
+ stream = opts;
2586
+ opts = {};
2587
+ } else if (opts.transport) {
2588
+ if (opts.transport instanceof SonicBoom || opts.transport.writable || opts.transport._writableState) throw Error('option.transport do not allow stream, please pass to option directly. e.g. pino(transport)');
2589
+ if (opts.transport.targets && opts.transport.targets.length && opts.formatters && 'function' == typeof opts.formatters.level) throw Error('option.transport.targets do not allow custom level formatters');
2590
+ let customLevels;
2591
+ if (opts.customLevels) customLevels = opts.useOnlyCustomLevels ? opts.customLevels : Object.assign({}, opts.levels, opts.customLevels);
2592
+ stream = transport({
2593
+ caller,
2594
+ ...opts.transport,
2595
+ levels: customLevels
2596
+ });
2597
+ }
2598
+ opts = Object.assign({}, defaultOptions, opts);
2599
+ opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers);
2600
+ opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters);
2601
+ if (opts.prettyPrint) throw new Error('prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)');
2602
+ const { enabled, onChild } = opts;
2603
+ if (false === enabled) opts.level = 'silent';
2604
+ if (!onChild) opts.onChild = noop;
2605
+ if (!stream) stream = hasBeenTampered(process.stdout) ? process.stdout : buildSafeSonicBoom({
2606
+ fd: process.stdout.fd || 1
2607
+ });
2608
+ return {
2609
+ opts,
2610
+ stream
2611
+ };
2612
+ };
2613
+ }
2614
+ function stringify(obj, stringifySafeFn) {
2615
+ try {
2616
+ return JSON.stringify(obj);
2617
+ } catch (_) {
2618
+ try {
2619
+ const stringify = stringifySafeFn || this[stringifySafeSym];
2620
+ return stringify(obj);
2621
+ } catch (_) {
2622
+ return '"[unable to serialize, circular reference is too complex to analyze]"';
2623
+ }
2624
+ }
2625
+ }
2626
+ function buildFormatters(level, bindings, log) {
2627
+ return {
2628
+ level,
2629
+ bindings,
2630
+ log
2631
+ };
2632
+ }
2633
+ function normalizeDestFileDescriptor(destination) {
2634
+ const fd = Number(destination);
2635
+ if ('string' == typeof destination && Number.isFinite(fd)) return fd;
2636
+ if (void 0 === destination) return 1;
2637
+ return destination;
2638
+ }
2639
+ module1.exports = {
2640
+ noop,
2641
+ buildSafeSonicBoom,
2642
+ asChindings,
2643
+ asJson,
2644
+ genLog,
2645
+ createArgsNormalizer,
2646
+ stringify,
2647
+ buildFormatters,
2648
+ normalizeDestFileDescriptor
2649
+ };
2650
+ },
2651
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport.js": function(module1, __unused_webpack_exports, __webpack_require__) {
2652
+ "use strict";
2653
+ const { createRequire } = __webpack_require__("module");
2654
+ const getCallers = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/caller.js");
2655
+ const { join, isAbsolute, sep } = __webpack_require__("node:path");
2656
+ const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
2657
+ const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
2658
+ const ThreadStream = __webpack_require__("../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/index.js");
2659
+ function setupOnExit(stream) {
2660
+ onExit.register(stream, autoEnd);
2661
+ onExit.registerBeforeExit(stream, flush);
2662
+ stream.on('close', function() {
2663
+ onExit.unregister(stream);
2664
+ });
2665
+ }
2666
+ function buildStream(filename, workerData, workerOpts, sync) {
2667
+ const stream = new ThreadStream({
2668
+ filename,
2669
+ workerData,
2670
+ workerOpts,
2671
+ sync
2672
+ });
2673
+ stream.on('ready', onReady);
2674
+ stream.on('close', function() {
2675
+ process.removeListener('exit', onExit);
2676
+ });
2677
+ process.on('exit', onExit);
2678
+ function onReady() {
2679
+ process.removeListener('exit', onExit);
2680
+ stream.unref();
2681
+ if (false !== workerOpts.autoEnd) setupOnExit(stream);
2682
+ }
2683
+ function onExit() {
2684
+ if (stream.closed) return;
2685
+ stream.flushSync();
2686
+ sleep(100);
2687
+ stream.end();
2688
+ }
2689
+ return stream;
2690
+ }
2691
+ function autoEnd(stream) {
2692
+ stream.ref();
2693
+ stream.flushSync();
2694
+ stream.end();
2695
+ stream.once('close', function() {
2696
+ stream.unref();
2697
+ });
2698
+ }
2699
+ function flush(stream) {
2700
+ stream.flushSync();
2701
+ }
2702
+ function transport(fullOptions) {
2703
+ const { pipeline, targets, levels, dedupe, worker = {}, caller = getCallers(), sync = false } = fullOptions;
2704
+ const options = {
2705
+ ...fullOptions.options
2706
+ };
2707
+ const callers = 'string' == typeof caller ? [
2708
+ caller
2709
+ ] : caller;
2710
+ const bundlerOverrides = '__bundlerPathsOverrides' in globalThis ? globalThis.__bundlerPathsOverrides : {};
2711
+ let target = fullOptions.target;
2712
+ if (target && targets) throw new Error('only one of target or targets can be specified');
2713
+ if (targets) {
2714
+ target = bundlerOverrides['pino-worker'] || join(__dirname, 'worker.js');
2715
+ options.targets = targets.filter((dest)=>dest.target).map((dest)=>({
2716
+ ...dest,
2717
+ target: fixTarget(dest.target)
2718
+ }));
2719
+ options.pipelines = targets.filter((dest)=>dest.pipeline).map((dest)=>dest.pipeline.map((t)=>({
2720
+ ...t,
2721
+ level: dest.level,
2722
+ target: fixTarget(t.target)
2723
+ })));
2724
+ } else if (pipeline) {
2725
+ target = bundlerOverrides['pino-worker'] || join(__dirname, 'worker.js');
2726
+ options.pipelines = [
2727
+ pipeline.map((dest)=>({
2728
+ ...dest,
2729
+ target: fixTarget(dest.target)
2730
+ }))
2731
+ ];
2732
+ }
2733
+ if (levels) options.levels = levels;
2734
+ if (dedupe) options.dedupe = dedupe;
2735
+ options.pinoWillSendConfig = true;
2736
+ return buildStream(fixTarget(target), options, worker, sync);
2737
+ function fixTarget(origin) {
2738
+ origin = bundlerOverrides[origin] || origin;
2739
+ if (isAbsolute(origin) || 0 === origin.indexOf('file://')) return origin;
2740
+ if ('pino/file' === origin) return join(__dirname, '..', 'file.js');
2741
+ let fixTarget;
2742
+ for (const filePath of callers)try {
2743
+ const context = 'node:repl' === filePath ? process.cwd() + sep : filePath;
2744
+ fixTarget = createRequire(context).resolve(origin);
2745
+ break;
2746
+ } catch (err) {
2747
+ continue;
2748
+ }
2749
+ if (!fixTarget) throw new Error(`unable to determine transport target for "${origin}"`);
2750
+ return fixTarget;
2751
+ }
2752
+ }
2753
+ module1.exports = transport;
2754
+ },
2755
+ "../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/pino.js": function(module1, __unused_webpack_exports, __webpack_require__) {
2756
+ "use strict";
2757
+ const os = __webpack_require__("node:os");
2758
+ const stdSerializers = __webpack_require__("../../node_modules/.pnpm/pino-std-serializers@7.0.0/node_modules/pino-std-serializers/index.js");
2759
+ const caller = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/caller.js");
2760
+ const redaction = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/redaction.js");
2761
+ const time = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/time.js");
2762
+ const proto = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/proto.js");
2763
+ const symbols = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/symbols.js");
2764
+ const { configure } = __webpack_require__("../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js");
2765
+ const { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/levels.js");
2766
+ const { DEFAULT_LEVELS, SORTING_ORDER } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/constants.js");
2767
+ const { createArgsNormalizer, asChindings, buildSafeSonicBoom, buildFormatters, stringify, normalizeDestFileDescriptor, noop } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/tools.js");
2768
+ const { version } = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/meta.js");
2769
+ const { chindingsSym, redactFmtSym, serializersSym, timeSym, timeSliceIndexSym, streamSym, stringifySym, stringifySafeSym, stringifiersSym, setLevelSym, endSym, formatOptsSym, messageKeySym, errorKeySym, nestedKeySym, mixinSym, levelCompSym, useOnlyCustomLevelsSym, formattersSym, hooksSym, nestedKeyStrSym, mixinMergeStrategySym, msgPrefixSym } = symbols;
2770
+ const { epochTime, nullTime } = time;
2771
+ const { pid } = process;
2772
+ const hostname = os.hostname();
2773
+ const defaultErrorSerializer = stdSerializers.err;
2774
+ const defaultOptions = {
2775
+ level: 'info',
2776
+ levelComparison: SORTING_ORDER.ASC,
2777
+ levels: DEFAULT_LEVELS,
2778
+ messageKey: 'msg',
2779
+ errorKey: 'err',
2780
+ nestedKey: null,
2781
+ enabled: true,
2782
+ base: {
2783
+ pid,
2784
+ hostname
2785
+ },
2786
+ serializers: Object.assign(Object.create(null), {
2787
+ err: defaultErrorSerializer
2788
+ }),
2789
+ formatters: Object.assign(Object.create(null), {
2790
+ bindings (bindings) {
2791
+ return bindings;
2792
+ },
2793
+ level (label, number) {
2794
+ return {
2795
+ level: number
2796
+ };
2797
+ }
2798
+ }),
2799
+ hooks: {
2800
+ logMethod: void 0,
2801
+ streamWrite: void 0
2802
+ },
2803
+ timestamp: epochTime,
2804
+ name: void 0,
2805
+ redact: null,
2806
+ customLevels: null,
2807
+ useOnlyCustomLevels: false,
2808
+ depthLimit: 5,
2809
+ edgeLimit: 100
2810
+ };
2811
+ const normalize = createArgsNormalizer(defaultOptions);
2812
+ const serializers = Object.assign(Object.create(null), stdSerializers);
2813
+ function pino(...args) {
2814
+ const instance = {};
2815
+ const { opts, stream } = normalize(instance, caller(), ...args);
2816
+ if (opts.level && 'string' == typeof opts.level && void 0 !== DEFAULT_LEVELS[opts.level.toLowerCase()]) opts.level = opts.level.toLowerCase();
2817
+ const { redact, crlf, serializers, timestamp, messageKey, errorKey, nestedKey, base, name, level, customLevels, levelComparison, mixin, mixinMergeStrategy, useOnlyCustomLevels, formatters, hooks, depthLimit, edgeLimit, onChild, msgPrefix } = opts;
2818
+ const stringifySafe = configure({
2819
+ maximumDepth: depthLimit,
2820
+ maximumBreadth: edgeLimit
2821
+ });
2822
+ const allFormatters = buildFormatters(formatters.level, formatters.bindings, formatters.log);
2823
+ const stringifyFn = stringify.bind({
2824
+ [stringifySafeSym]: stringifySafe
2825
+ });
2826
+ const stringifiers = redact ? redaction(redact, stringifyFn) : {};
2827
+ const formatOpts = redact ? {
2828
+ stringify: stringifiers[redactFmtSym]
2829
+ } : {
2830
+ stringify: stringifyFn
2831
+ };
2832
+ const end = '}' + (crlf ? '\r\n' : '\n');
2833
+ const coreChindings = asChindings.bind(null, {
2834
+ [chindingsSym]: '',
2835
+ [serializersSym]: serializers,
2836
+ [stringifiersSym]: stringifiers,
2837
+ [stringifySym]: stringify,
2838
+ [stringifySafeSym]: stringifySafe,
2839
+ [formattersSym]: allFormatters
2840
+ });
2841
+ let chindings = '';
2842
+ if (null !== base) chindings = void 0 === name ? coreChindings(base) : coreChindings(Object.assign({}, base, {
2843
+ name
2844
+ }));
2845
+ const time = timestamp instanceof Function ? timestamp : timestamp ? epochTime : nullTime;
2846
+ const timeSliceIndex = time().indexOf(':') + 1;
2847
+ if (useOnlyCustomLevels && !customLevels) throw Error('customLevels is required if useOnlyCustomLevels is set true');
2848
+ if (mixin && 'function' != typeof mixin) throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`);
2849
+ if (msgPrefix && 'string' != typeof msgPrefix) throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`);
2850
+ assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels);
2851
+ const levels = mappings(customLevels, useOnlyCustomLevels);
2852
+ if ('function' == typeof stream.emit) stream.emit('message', {
2853
+ code: 'PINO_CONFIG',
2854
+ config: {
2855
+ levels,
2856
+ messageKey,
2857
+ errorKey
2858
+ }
2859
+ });
2860
+ assertLevelComparison(levelComparison);
2861
+ const levelCompFunc = genLevelComparison(levelComparison);
2862
+ Object.assign(instance, {
2863
+ levels,
2864
+ [levelCompSym]: levelCompFunc,
2865
+ [useOnlyCustomLevelsSym]: useOnlyCustomLevels,
2866
+ [streamSym]: stream,
2867
+ [timeSym]: time,
2868
+ [timeSliceIndexSym]: timeSliceIndex,
2869
+ [stringifySym]: stringify,
2870
+ [stringifySafeSym]: stringifySafe,
2871
+ [stringifiersSym]: stringifiers,
2872
+ [endSym]: end,
2873
+ [formatOptsSym]: formatOpts,
2874
+ [messageKeySym]: messageKey,
2875
+ [errorKeySym]: errorKey,
2876
+ [nestedKeySym]: nestedKey,
2877
+ [nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : '',
2878
+ [serializersSym]: serializers,
2879
+ [mixinSym]: mixin,
2880
+ [mixinMergeStrategySym]: mixinMergeStrategy,
2881
+ [chindingsSym]: chindings,
2882
+ [formattersSym]: allFormatters,
2883
+ [hooksSym]: hooks,
2884
+ silent: noop,
2885
+ onChild,
2886
+ [msgPrefixSym]: msgPrefix
2887
+ });
2888
+ Object.setPrototypeOf(instance, proto());
2889
+ genLsCache(instance);
2890
+ instance[setLevelSym](level);
2891
+ return instance;
2892
+ }
2893
+ module1.exports = pino;
2894
+ module1.exports.destination = (dest = process.stdout.fd)=>{
2895
+ if ('object' != typeof dest) return buildSafeSonicBoom({
2896
+ dest: normalizeDestFileDescriptor(dest),
2897
+ minLength: 0
2898
+ });
2899
+ dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd);
2900
+ return buildSafeSonicBoom(dest);
2901
+ };
2902
+ module1.exports.transport = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/transport.js");
2903
+ module1.exports.multistream = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/lib/multistream.js");
2904
+ module1.exports.levels = mappings();
2905
+ module1.exports.stdSerializers = serializers;
2906
+ module1.exports.stdTimeFunctions = Object.assign({}, time);
2907
+ module1.exports.symbols = symbols;
2908
+ module1.exports.version = version;
2909
+ module1.exports["default"] = pino;
2910
+ module1.exports.pino = pino;
2911
+ },
2912
+ "../../node_modules/.pnpm/sonic-boom@4.2.0/node_modules/sonic-boom/index.js": function(module1, __unused_webpack_exports, __webpack_require__) {
2913
+ "use strict";
2914
+ const fs = __webpack_require__("fs");
2915
+ const EventEmitter = __webpack_require__("events");
2916
+ const inherits = __webpack_require__("util").inherits;
2917
+ const path = __webpack_require__("path");
2918
+ const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
2919
+ const assert = __webpack_require__("assert");
2920
+ const BUSY_WRITE_TIMEOUT = 100;
2921
+ const kEmptyBuffer = Buffer.allocUnsafe(0);
2922
+ const MAX_WRITE = 16384;
2923
+ const kContentModeBuffer = 'buffer';
2924
+ const kContentModeUtf8 = 'utf8';
2925
+ const [major, minor] = (process.versions.node || '0.0').split('.').map(Number);
2926
+ const kCopyBuffer = major >= 22 && minor >= 7;
2927
+ function openFile(file, sonic) {
2928
+ sonic._opening = true;
2929
+ sonic._writing = true;
2930
+ sonic._asyncDrainScheduled = false;
2931
+ function fileOpened(err, fd) {
2932
+ if (err) {
2933
+ sonic._reopening = false;
2934
+ sonic._writing = false;
2935
+ sonic._opening = false;
2936
+ if (sonic.sync) process.nextTick(()=>{
2937
+ if (sonic.listenerCount('error') > 0) sonic.emit('error', err);
2938
+ });
2939
+ else sonic.emit('error', err);
2940
+ return;
2941
+ }
2942
+ const reopening = sonic._reopening;
2943
+ sonic.fd = fd;
2944
+ sonic.file = file;
2945
+ sonic._reopening = false;
2946
+ sonic._opening = false;
2947
+ sonic._writing = false;
2948
+ if (sonic.sync) process.nextTick(()=>sonic.emit('ready'));
2949
+ else sonic.emit('ready');
2950
+ if (sonic.destroyed) return;
2951
+ if (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending) sonic._actualWrite();
2952
+ else if (reopening) process.nextTick(()=>sonic.emit('drain'));
2953
+ }
2954
+ const flags = sonic.append ? 'a' : 'w';
2955
+ const mode = sonic.mode;
2956
+ if (sonic.sync) try {
2957
+ if (sonic.mkdir) fs.mkdirSync(path.dirname(file), {
2958
+ recursive: true
2959
+ });
2960
+ const fd = fs.openSync(file, flags, mode);
2961
+ fileOpened(null, fd);
2962
+ } catch (err) {
2963
+ fileOpened(err);
2964
+ throw err;
2965
+ }
2966
+ else if (sonic.mkdir) fs.mkdir(path.dirname(file), {
2967
+ recursive: true
2968
+ }, (err)=>{
2969
+ if (err) return fileOpened(err);
2970
+ fs.open(file, flags, mode, fileOpened);
2971
+ });
2972
+ else fs.open(file, flags, mode, fileOpened);
2973
+ }
2974
+ function SonicBoom(opts) {
2975
+ if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
2976
+ let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {};
2977
+ fd = fd || dest;
2978
+ this._len = 0;
2979
+ this.fd = -1;
2980
+ this._bufs = [];
2981
+ this._lens = [];
2982
+ this._writing = false;
2983
+ this._ending = false;
2984
+ this._reopening = false;
2985
+ this._asyncDrainScheduled = false;
2986
+ this._flushPending = false;
2987
+ this._hwm = Math.max(minLength || 0, 16387);
2988
+ this.file = null;
2989
+ this.destroyed = false;
2990
+ this.minLength = minLength || 0;
2991
+ this.maxLength = maxLength || 0;
2992
+ this.maxWrite = maxWrite || MAX_WRITE;
2993
+ this._periodicFlush = periodicFlush || 0;
2994
+ this._periodicFlushTimer = void 0;
2995
+ this.sync = sync || false;
2996
+ this.writable = true;
2997
+ this._fsync = fsync || false;
2998
+ this.append = append || false;
2999
+ this.mode = mode;
3000
+ this.retryEAGAIN = retryEAGAIN || (()=>true);
3001
+ this.mkdir = mkdir || false;
3002
+ let fsWriteSync;
3003
+ let fsWrite;
3004
+ if (contentMode === kContentModeBuffer) {
3005
+ this._writingBuf = kEmptyBuffer;
3006
+ this.write = writeBuffer;
3007
+ this.flush = flushBuffer;
3008
+ this.flushSync = flushBufferSync;
3009
+ this._actualWrite = actualWriteBuffer;
3010
+ fsWriteSync = ()=>fs.writeSync(this.fd, this._writingBuf);
3011
+ fsWrite = ()=>fs.write(this.fd, this._writingBuf, this.release);
3012
+ } else if (void 0 === contentMode || contentMode === kContentModeUtf8) {
3013
+ this._writingBuf = '';
3014
+ this.write = write;
3015
+ this.flush = flush;
3016
+ this.flushSync = flushSync;
3017
+ this._actualWrite = actualWrite;
3018
+ fsWriteSync = ()=>fs.writeSync(this.fd, this._writingBuf, 'utf8');
3019
+ fsWrite = ()=>fs.write(this.fd, this._writingBuf, 'utf8', this.release);
3020
+ } else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
3021
+ if ('number' == typeof fd) {
3022
+ this.fd = fd;
3023
+ process.nextTick(()=>this.emit('ready'));
3024
+ } else if ('string' == typeof fd) openFile(fd, this);
3025
+ else throw new Error("SonicBoom supports only file descriptors and files");
3026
+ if (this.minLength >= this.maxWrite) throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);
3027
+ this.release = (err, n1)=>{
3028
+ if (err) {
3029
+ if (('EAGAIN' === err.code || 'EBUSY' === err.code) && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) if (this.sync) try {
3030
+ sleep(BUSY_WRITE_TIMEOUT);
3031
+ this.release(void 0, 0);
3032
+ } catch (err) {
3033
+ this.release(err);
3034
+ }
3035
+ else setTimeout(fsWrite, BUSY_WRITE_TIMEOUT);
3036
+ else {
3037
+ this._writing = false;
3038
+ this.emit('error', err);
3039
+ }
3040
+ return;
3041
+ }
3042
+ this.emit('write', n1);
3043
+ const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n1);
3044
+ this._len = releasedBufObj.len;
3045
+ this._writingBuf = releasedBufObj.writingBuf;
3046
+ if (this._writingBuf.length) {
3047
+ if (!this.sync) return void fsWrite();
3048
+ try {
3049
+ do {
3050
+ const n1 = fsWriteSync();
3051
+ const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n1);
3052
+ this._len = releasedBufObj.len;
3053
+ this._writingBuf = releasedBufObj.writingBuf;
3054
+ }while (this._writingBuf.length);
3055
+ } catch (err) {
3056
+ this.release(err);
3057
+ return;
3058
+ }
3059
+ }
3060
+ if (this._fsync) fs.fsyncSync(this.fd);
3061
+ const len = this._len;
3062
+ if (this._reopening) {
3063
+ this._writing = false;
3064
+ this._reopening = false;
3065
+ this.reopen();
3066
+ } else if (len > this.minLength) this._actualWrite();
3067
+ else if (this._ending) if (len > 0) this._actualWrite();
3068
+ else {
3069
+ this._writing = false;
3070
+ actualClose(this);
3071
+ }
3072
+ else {
3073
+ this._writing = false;
3074
+ if (this.sync) {
3075
+ if (!this._asyncDrainScheduled) {
3076
+ this._asyncDrainScheduled = true;
3077
+ process.nextTick(emitDrain, this);
3078
+ }
3079
+ } else this.emit('drain');
3080
+ }
3081
+ };
3082
+ this.on('newListener', function(name) {
3083
+ if ('drain' === name) this._asyncDrainScheduled = false;
3084
+ });
3085
+ if (0 !== this._periodicFlush) {
3086
+ this._periodicFlushTimer = setInterval(()=>this.flush(null), this._periodicFlush);
3087
+ this._periodicFlushTimer.unref();
3088
+ }
3089
+ }
3090
+ function releaseWritingBuf(writingBuf, len, n1) {
3091
+ if ('string' == typeof writingBuf && Buffer.byteLength(writingBuf) !== n1) n1 = Buffer.from(writingBuf).subarray(0, n1).toString().length;
3092
+ len = Math.max(len - n1, 0);
3093
+ writingBuf = writingBuf.slice(n1);
3094
+ return {
3095
+ writingBuf,
3096
+ len
3097
+ };
3098
+ }
3099
+ function emitDrain(sonic) {
3100
+ const hasListeners = sonic.listenerCount('drain') > 0;
3101
+ if (!hasListeners) return;
3102
+ sonic._asyncDrainScheduled = false;
3103
+ sonic.emit('drain');
3104
+ }
3105
+ inherits(SonicBoom, EventEmitter);
3106
+ function mergeBuf(bufs, len) {
3107
+ if (0 === bufs.length) return kEmptyBuffer;
3108
+ if (1 === bufs.length) return bufs[0];
3109
+ return Buffer.concat(bufs, len);
3110
+ }
3111
+ function write(data) {
3112
+ if (this.destroyed) throw new Error('SonicBoom destroyed');
3113
+ const len = this._len + data.length;
3114
+ const bufs = this._bufs;
3115
+ if (this.maxLength && len > this.maxLength) {
3116
+ this.emit('drop', data);
3117
+ return this._len < this._hwm;
3118
+ }
3119
+ if (0 === bufs.length || bufs[bufs.length - 1].length + data.length > this.maxWrite) bufs.push('' + data);
3120
+ else bufs[bufs.length - 1] += data;
3121
+ this._len = len;
3122
+ if (!this._writing && this._len >= this.minLength) this._actualWrite();
3123
+ return this._len < this._hwm;
3124
+ }
3125
+ function writeBuffer(data) {
3126
+ if (this.destroyed) throw new Error('SonicBoom destroyed');
3127
+ const len = this._len + data.length;
3128
+ const bufs = this._bufs;
3129
+ const lens = this._lens;
3130
+ if (this.maxLength && len > this.maxLength) {
3131
+ this.emit('drop', data);
3132
+ return this._len < this._hwm;
3133
+ }
3134
+ if (0 === bufs.length || lens[lens.length - 1] + data.length > this.maxWrite) {
3135
+ bufs.push([
3136
+ data
3137
+ ]);
3138
+ lens.push(data.length);
3139
+ } else {
3140
+ bufs[bufs.length - 1].push(data);
3141
+ lens[lens.length - 1] += data.length;
3142
+ }
3143
+ this._len = len;
3144
+ if (!this._writing && this._len >= this.minLength) this._actualWrite();
3145
+ return this._len < this._hwm;
3146
+ }
3147
+ function callFlushCallbackOnDrain(cb) {
3148
+ this._flushPending = true;
3149
+ const onDrain = ()=>{
3150
+ if (this._fsync) {
3151
+ this._flushPending = false;
3152
+ cb();
3153
+ } else try {
3154
+ fs.fsync(this.fd, (err)=>{
3155
+ this._flushPending = false;
3156
+ cb(err);
3157
+ });
3158
+ } catch (err) {
3159
+ cb(err);
3160
+ }
3161
+ this.off('error', onError);
3162
+ };
3163
+ const onError = (err)=>{
3164
+ this._flushPending = false;
3165
+ cb(err);
3166
+ this.off('drain', onDrain);
3167
+ };
3168
+ this.once('drain', onDrain);
3169
+ this.once('error', onError);
3170
+ }
3171
+ function flush(cb) {
3172
+ if (null != cb && 'function' != typeof cb) throw new Error('flush cb must be a function');
3173
+ if (this.destroyed) {
3174
+ const error = new Error('SonicBoom destroyed');
3175
+ if (cb) return void cb(error);
3176
+ throw error;
3177
+ }
3178
+ if (this.minLength <= 0) return void cb?.();
3179
+ if (cb) callFlushCallbackOnDrain.call(this, cb);
3180
+ if (this._writing) return;
3181
+ if (0 === this._bufs.length) this._bufs.push('');
3182
+ this._actualWrite();
3183
+ }
3184
+ function flushBuffer(cb) {
3185
+ if (null != cb && 'function' != typeof cb) throw new Error('flush cb must be a function');
3186
+ if (this.destroyed) {
3187
+ const error = new Error('SonicBoom destroyed');
3188
+ if (cb) return void cb(error);
3189
+ throw error;
3190
+ }
3191
+ if (this.minLength <= 0) return void cb?.();
3192
+ if (cb) callFlushCallbackOnDrain.call(this, cb);
3193
+ if (this._writing) return;
3194
+ if (0 === this._bufs.length) {
3195
+ this._bufs.push([]);
3196
+ this._lens.push(0);
3197
+ }
3198
+ this._actualWrite();
3199
+ }
3200
+ SonicBoom.prototype.reopen = function(file) {
3201
+ if (this.destroyed) throw new Error('SonicBoom destroyed');
3202
+ if (this._opening) return void this.once('ready', ()=>{
3203
+ this.reopen(file);
3204
+ });
3205
+ if (this._ending) return;
3206
+ if (!this.file) throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
3207
+ if (file) this.file = file;
3208
+ this._reopening = true;
3209
+ if (this._writing) return;
3210
+ const fd = this.fd;
3211
+ this.once('ready', ()=>{
3212
+ if (fd !== this.fd) fs.close(fd, (err)=>{
3213
+ if (err) return this.emit('error', err);
3214
+ });
3215
+ });
3216
+ openFile(this.file, this);
3217
+ };
3218
+ SonicBoom.prototype.end = function() {
3219
+ if (this.destroyed) throw new Error('SonicBoom destroyed');
3220
+ if (this._opening) return void this.once('ready', ()=>{
3221
+ this.end();
3222
+ });
3223
+ if (this._ending) return;
3224
+ this._ending = true;
3225
+ if (this._writing) return;
3226
+ if (this._len > 0 && this.fd >= 0) this._actualWrite();
3227
+ else actualClose(this);
3228
+ };
3229
+ function flushSync() {
3230
+ if (this.destroyed) throw new Error('SonicBoom destroyed');
3231
+ if (this.fd < 0) throw new Error('sonic boom is not ready yet');
3232
+ if (!this._writing && this._writingBuf.length > 0) {
3233
+ this._bufs.unshift(this._writingBuf);
3234
+ this._writingBuf = '';
3235
+ }
3236
+ let buf = '';
3237
+ while(this._bufs.length || buf){
3238
+ if (buf.length <= 0) buf = this._bufs[0];
3239
+ try {
3240
+ const n1 = fs.writeSync(this.fd, buf, 'utf8');
3241
+ const releasedBufObj = releaseWritingBuf(buf, this._len, n1);
3242
+ buf = releasedBufObj.writingBuf;
3243
+ this._len = releasedBufObj.len;
3244
+ if (buf.length <= 0) this._bufs.shift();
3245
+ } catch (err) {
3246
+ const shouldRetry = 'EAGAIN' === err.code || 'EBUSY' === err.code;
3247
+ if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) throw err;
3248
+ sleep(BUSY_WRITE_TIMEOUT);
3249
+ }
3250
+ }
3251
+ try {
3252
+ fs.fsyncSync(this.fd);
3253
+ } catch {}
3254
+ }
3255
+ function flushBufferSync() {
3256
+ if (this.destroyed) throw new Error('SonicBoom destroyed');
3257
+ if (this.fd < 0) throw new Error('sonic boom is not ready yet');
3258
+ if (!this._writing && this._writingBuf.length > 0) {
3259
+ this._bufs.unshift([
3260
+ this._writingBuf
3261
+ ]);
3262
+ this._writingBuf = kEmptyBuffer;
3263
+ }
3264
+ let buf = kEmptyBuffer;
3265
+ while(this._bufs.length || buf.length){
3266
+ if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
3267
+ try {
3268
+ const n1 = fs.writeSync(this.fd, buf);
3269
+ buf = buf.subarray(n1);
3270
+ this._len = Math.max(this._len - n1, 0);
3271
+ if (buf.length <= 0) {
3272
+ this._bufs.shift();
3273
+ this._lens.shift();
3274
+ }
3275
+ } catch (err) {
3276
+ const shouldRetry = 'EAGAIN' === err.code || 'EBUSY' === err.code;
3277
+ if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) throw err;
3278
+ sleep(BUSY_WRITE_TIMEOUT);
3279
+ }
3280
+ }
3281
+ }
3282
+ SonicBoom.prototype.destroy = function() {
3283
+ if (this.destroyed) return;
3284
+ actualClose(this);
3285
+ };
3286
+ function actualWrite() {
3287
+ const release = this.release;
3288
+ this._writing = true;
3289
+ this._writingBuf = this._writingBuf || this._bufs.shift() || '';
3290
+ if (this.sync) try {
3291
+ const written = fs.writeSync(this.fd, this._writingBuf, 'utf8');
3292
+ release(null, written);
3293
+ } catch (err) {
3294
+ release(err);
3295
+ }
3296
+ else fs.write(this.fd, this._writingBuf, 'utf8', release);
3297
+ }
3298
+ function actualWriteBuffer() {
3299
+ const release = this.release;
3300
+ this._writing = true;
3301
+ this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
3302
+ if (this.sync) try {
3303
+ const written = fs.writeSync(this.fd, this._writingBuf);
3304
+ release(null, written);
3305
+ } catch (err) {
3306
+ release(err);
3307
+ }
3308
+ else {
3309
+ if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
3310
+ fs.write(this.fd, this._writingBuf, release);
3311
+ }
3312
+ }
3313
+ function actualClose(sonic) {
3314
+ if (-1 === sonic.fd) return void sonic.once('ready', actualClose.bind(null, sonic));
3315
+ if (void 0 !== sonic._periodicFlushTimer) clearInterval(sonic._periodicFlushTimer);
3316
+ sonic.destroyed = true;
3317
+ sonic._bufs = [];
3318
+ sonic._lens = [];
3319
+ assert('number' == typeof sonic.fd, `sonic.fd must be a number, got ${typeof sonic.fd}`);
3320
+ try {
3321
+ fs.fsync(sonic.fd, closeWrapped);
3322
+ } catch {}
3323
+ function closeWrapped() {
3324
+ if (1 !== sonic.fd && 2 !== sonic.fd) fs.close(sonic.fd, done);
3325
+ else done();
3326
+ }
3327
+ function done(err) {
3328
+ if (err) return void sonic.emit('error', err);
3329
+ if (sonic._ending && !sonic._writing) sonic.emit('finish');
3330
+ sonic.emit('close');
3331
+ }
3332
+ }
3333
+ SonicBoom.SonicBoom = SonicBoom;
3334
+ SonicBoom.default = SonicBoom;
3335
+ module1.exports = SonicBoom;
3336
+ },
3337
+ "../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/package.json": function(module1) {
3338
+ "use strict";
3339
+ module1.exports = JSON.parse('{"name":"thread-stream","version":"3.1.0","description":"A streaming way to send data to a Node.js Worker Thread","main":"index.js","types":"index.d.ts","dependencies":{"real-require":"^0.2.0"},"devDependencies":{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5","desm":"^1.3.0","fastbench":"^1.0.1","husky":"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1","standard":"^17.0.0","tap":"^16.2.0","ts-node":"^10.8.0","typescript":"^5.3.2","why-is-node-running":"^2.2.2"},"scripts":{"build":"tsc --noEmit","test":"standard && npm run build && npm run transpile && tap \\"test/**/*.test.*js\\" && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":"tap --no-check-coverage --timeout=120 --coverage-report=lcovonly \\"test/**/*.test.*js\\"","test:ci:ts":"tap --ts --no-check-coverage --coverage-report=lcovonly \\"test/**/*.test.*ts\\"","test:yarn":"npm run transpile && tap \\"test/**/*.test.js\\" --no-check-coverage","transpile":"sh ./test/ts/transpile.sh","prepare":"husky install"},"standard":{"ignore":["test/ts/**/*","test/syntax-error.mjs"]},"repository":{"type":"git","url":"git+https://github.com/mcollina/thread-stream.git"},"keywords":["worker","thread","threads","stream"],"author":"Matteo Collina <hello@matteocollina.com>","license":"MIT","bugs":{"url":"https://github.com/mcollina/thread-stream/issues"},"homepage":"https://github.com/mcollina/thread-stream#readme"}');
3340
+ }
3341
+ };
3342
+ var __webpack_module_cache__ = {};
3343
+ function __webpack_require__(moduleId) {
3344
+ var cachedModule = __webpack_module_cache__[moduleId];
3345
+ if (void 0 !== cachedModule) return cachedModule.exports;
3346
+ var module1 = __webpack_module_cache__[moduleId] = {
3347
+ exports: {}
3348
+ };
3349
+ __webpack_modules__[moduleId](module1, module1.exports, __webpack_require__);
3350
+ return module1.exports;
3351
+ }
3352
+ var __webpack_exports__ = __webpack_require__("../../node_modules/.pnpm/pino@10.1.0/node_modules/pino/file.js");
3353
+ module.exports = __webpack_exports__;