@trading-boy/cli 1.2.12 → 1.2.13

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 (2) hide show
  1. package/dist/cli.bundle.js +4399 -15
  2. package/package.json +1 -1
@@ -5,6 +5,8 @@ import { dirname as __bundleDirname } from "node:path";
5
5
  const require = __bundleCreateRequire(import.meta.url);
6
6
  const __bundled_filename = __bundleFileURLToPath(import.meta.url);
7
7
  const __bundled_dirname = __bundleDirname(__bundled_filename);
8
+ process.env.TRADING_BOY_CLI = "1";
9
+ if (!process.env.LOG_LEVEL) process.env.LOG_LEVEL = "warn";
8
10
  var __create = Object.create;
9
11
  var __defProp = Object.defineProperty;
10
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -4247,6 +4249,4388 @@ var require_main = __commonJS({
4247
4249
  }
4248
4250
  });
4249
4251
 
4252
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-helpers.js
4253
+ var require_err_helpers = __commonJS({
4254
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-helpers.js"(exports, module) {
4255
+ "use strict";
4256
+ var isErrorLike = (err) => {
4257
+ return err && typeof err.message === "string";
4258
+ };
4259
+ var getErrorCause = (err) => {
4260
+ if (!err) return;
4261
+ const cause = err.cause;
4262
+ if (typeof cause === "function") {
4263
+ const causeResult = err.cause();
4264
+ return isErrorLike(causeResult) ? causeResult : void 0;
4265
+ } else {
4266
+ return isErrorLike(cause) ? cause : void 0;
4267
+ }
4268
+ };
4269
+ var _stackWithCauses = (err, seen) => {
4270
+ if (!isErrorLike(err)) return "";
4271
+ const stack = err.stack || "";
4272
+ if (seen.has(err)) {
4273
+ return stack + "\ncauses have become circular...";
4274
+ }
4275
+ const cause = getErrorCause(err);
4276
+ if (cause) {
4277
+ seen.add(err);
4278
+ return stack + "\ncaused by: " + _stackWithCauses(cause, seen);
4279
+ } else {
4280
+ return stack;
4281
+ }
4282
+ };
4283
+ var stackWithCauses = (err) => _stackWithCauses(err, /* @__PURE__ */ new Set());
4284
+ var _messageWithCauses = (err, seen, skip) => {
4285
+ if (!isErrorLike(err)) return "";
4286
+ const message = skip ? "" : err.message || "";
4287
+ if (seen.has(err)) {
4288
+ return message + ": ...";
4289
+ }
4290
+ const cause = getErrorCause(err);
4291
+ if (cause) {
4292
+ seen.add(err);
4293
+ const skipIfVErrorStyleCause = typeof err.cause === "function";
4294
+ return message + (skipIfVErrorStyleCause ? "" : ": ") + _messageWithCauses(cause, seen, skipIfVErrorStyleCause);
4295
+ } else {
4296
+ return message;
4297
+ }
4298
+ };
4299
+ var messageWithCauses = (err) => _messageWithCauses(err, /* @__PURE__ */ new Set());
4300
+ module.exports = {
4301
+ isErrorLike,
4302
+ getErrorCause,
4303
+ stackWithCauses,
4304
+ messageWithCauses
4305
+ };
4306
+ }
4307
+ });
4308
+
4309
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-proto.js
4310
+ var require_err_proto = __commonJS({
4311
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-proto.js"(exports, module) {
4312
+ "use strict";
4313
+ var seen = /* @__PURE__ */ Symbol("circular-ref-tag");
4314
+ var rawSymbol = /* @__PURE__ */ Symbol("pino-raw-err-ref");
4315
+ var pinoErrProto = Object.create({}, {
4316
+ type: {
4317
+ enumerable: true,
4318
+ writable: true,
4319
+ value: void 0
4320
+ },
4321
+ message: {
4322
+ enumerable: true,
4323
+ writable: true,
4324
+ value: void 0
4325
+ },
4326
+ stack: {
4327
+ enumerable: true,
4328
+ writable: true,
4329
+ value: void 0
4330
+ },
4331
+ aggregateErrors: {
4332
+ enumerable: true,
4333
+ writable: true,
4334
+ value: void 0
4335
+ },
4336
+ raw: {
4337
+ enumerable: false,
4338
+ get: function() {
4339
+ return this[rawSymbol];
4340
+ },
4341
+ set: function(val) {
4342
+ this[rawSymbol] = val;
4343
+ }
4344
+ }
4345
+ });
4346
+ Object.defineProperty(pinoErrProto, rawSymbol, {
4347
+ writable: true,
4348
+ value: {}
4349
+ });
4350
+ module.exports = {
4351
+ pinoErrProto,
4352
+ pinoErrorSymbols: {
4353
+ seen,
4354
+ rawSymbol
4355
+ }
4356
+ };
4357
+ }
4358
+ });
4359
+
4360
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err.js
4361
+ var require_err = __commonJS({
4362
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err.js"(exports, module) {
4363
+ "use strict";
4364
+ module.exports = errSerializer;
4365
+ var { messageWithCauses, stackWithCauses, isErrorLike } = require_err_helpers();
4366
+ var { pinoErrProto, pinoErrorSymbols } = require_err_proto();
4367
+ var { seen } = pinoErrorSymbols;
4368
+ var { toString } = Object.prototype;
4369
+ function errSerializer(err) {
4370
+ if (!isErrorLike(err)) {
4371
+ return err;
4372
+ }
4373
+ err[seen] = void 0;
4374
+ const _err = Object.create(pinoErrProto);
4375
+ _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name;
4376
+ _err.message = messageWithCauses(err);
4377
+ _err.stack = stackWithCauses(err);
4378
+ if (Array.isArray(err.errors)) {
4379
+ _err.aggregateErrors = err.errors.map((err2) => errSerializer(err2));
4380
+ }
4381
+ for (const key in err) {
4382
+ if (_err[key] === void 0) {
4383
+ const val = err[key];
4384
+ if (isErrorLike(val)) {
4385
+ if (key !== "cause" && !Object.prototype.hasOwnProperty.call(val, seen)) {
4386
+ _err[key] = errSerializer(val);
4387
+ }
4388
+ } else {
4389
+ _err[key] = val;
4390
+ }
4391
+ }
4392
+ }
4393
+ delete err[seen];
4394
+ _err.raw = err;
4395
+ return _err;
4396
+ }
4397
+ }
4398
+ });
4399
+
4400
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-with-cause.js
4401
+ var require_err_with_cause = __commonJS({
4402
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-with-cause.js"(exports, module) {
4403
+ "use strict";
4404
+ module.exports = errWithCauseSerializer;
4405
+ var { isErrorLike } = require_err_helpers();
4406
+ var { pinoErrProto, pinoErrorSymbols } = require_err_proto();
4407
+ var { seen } = pinoErrorSymbols;
4408
+ var { toString } = Object.prototype;
4409
+ function errWithCauseSerializer(err) {
4410
+ if (!isErrorLike(err)) {
4411
+ return err;
4412
+ }
4413
+ err[seen] = void 0;
4414
+ const _err = Object.create(pinoErrProto);
4415
+ _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name;
4416
+ _err.message = err.message;
4417
+ _err.stack = err.stack;
4418
+ if (Array.isArray(err.errors)) {
4419
+ _err.aggregateErrors = err.errors.map((err2) => errWithCauseSerializer(err2));
4420
+ }
4421
+ if (isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen)) {
4422
+ _err.cause = errWithCauseSerializer(err.cause);
4423
+ }
4424
+ for (const key in err) {
4425
+ if (_err[key] === void 0) {
4426
+ const val = err[key];
4427
+ if (isErrorLike(val)) {
4428
+ if (!Object.prototype.hasOwnProperty.call(val, seen)) {
4429
+ _err[key] = errWithCauseSerializer(val);
4430
+ }
4431
+ } else {
4432
+ _err[key] = val;
4433
+ }
4434
+ }
4435
+ }
4436
+ delete err[seen];
4437
+ _err.raw = err;
4438
+ return _err;
4439
+ }
4440
+ }
4441
+ });
4442
+
4443
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/req.js
4444
+ var require_req = __commonJS({
4445
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/req.js"(exports, module) {
4446
+ "use strict";
4447
+ module.exports = {
4448
+ mapHttpRequest,
4449
+ reqSerializer
4450
+ };
4451
+ var rawSymbol = /* @__PURE__ */ Symbol("pino-raw-req-ref");
4452
+ var pinoReqProto = Object.create({}, {
4453
+ id: {
4454
+ enumerable: true,
4455
+ writable: true,
4456
+ value: ""
4457
+ },
4458
+ method: {
4459
+ enumerable: true,
4460
+ writable: true,
4461
+ value: ""
4462
+ },
4463
+ url: {
4464
+ enumerable: true,
4465
+ writable: true,
4466
+ value: ""
4467
+ },
4468
+ query: {
4469
+ enumerable: true,
4470
+ writable: true,
4471
+ value: ""
4472
+ },
4473
+ params: {
4474
+ enumerable: true,
4475
+ writable: true,
4476
+ value: ""
4477
+ },
4478
+ headers: {
4479
+ enumerable: true,
4480
+ writable: true,
4481
+ value: {}
4482
+ },
4483
+ remoteAddress: {
4484
+ enumerable: true,
4485
+ writable: true,
4486
+ value: ""
4487
+ },
4488
+ remotePort: {
4489
+ enumerable: true,
4490
+ writable: true,
4491
+ value: ""
4492
+ },
4493
+ raw: {
4494
+ enumerable: false,
4495
+ get: function() {
4496
+ return this[rawSymbol];
4497
+ },
4498
+ set: function(val) {
4499
+ this[rawSymbol] = val;
4500
+ }
4501
+ }
4502
+ });
4503
+ Object.defineProperty(pinoReqProto, rawSymbol, {
4504
+ writable: true,
4505
+ value: {}
4506
+ });
4507
+ function reqSerializer(req) {
4508
+ const connection = req.info || req.socket;
4509
+ const _req = Object.create(pinoReqProto);
4510
+ _req.id = typeof req.id === "function" ? req.id() : req.id || (req.info ? req.info.id : void 0);
4511
+ _req.method = req.method;
4512
+ if (req.originalUrl) {
4513
+ _req.url = req.originalUrl;
4514
+ } else {
4515
+ const path4 = req.path;
4516
+ _req.url = typeof path4 === "string" ? path4 : req.url ? req.url.path || req.url : void 0;
4517
+ }
4518
+ if (req.query) {
4519
+ _req.query = req.query;
4520
+ }
4521
+ if (req.params) {
4522
+ _req.params = req.params;
4523
+ }
4524
+ _req.headers = req.headers;
4525
+ _req.remoteAddress = connection && connection.remoteAddress;
4526
+ _req.remotePort = connection && connection.remotePort;
4527
+ _req.raw = req.raw || req;
4528
+ return _req;
4529
+ }
4530
+ function mapHttpRequest(req) {
4531
+ return {
4532
+ req: reqSerializer(req)
4533
+ };
4534
+ }
4535
+ }
4536
+ });
4537
+
4538
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/res.js
4539
+ var require_res = __commonJS({
4540
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/res.js"(exports, module) {
4541
+ "use strict";
4542
+ module.exports = {
4543
+ mapHttpResponse,
4544
+ resSerializer
4545
+ };
4546
+ var rawSymbol = /* @__PURE__ */ Symbol("pino-raw-res-ref");
4547
+ var pinoResProto = Object.create({}, {
4548
+ statusCode: {
4549
+ enumerable: true,
4550
+ writable: true,
4551
+ value: 0
4552
+ },
4553
+ headers: {
4554
+ enumerable: true,
4555
+ writable: true,
4556
+ value: ""
4557
+ },
4558
+ raw: {
4559
+ enumerable: false,
4560
+ get: function() {
4561
+ return this[rawSymbol];
4562
+ },
4563
+ set: function(val) {
4564
+ this[rawSymbol] = val;
4565
+ }
4566
+ }
4567
+ });
4568
+ Object.defineProperty(pinoResProto, rawSymbol, {
4569
+ writable: true,
4570
+ value: {}
4571
+ });
4572
+ function resSerializer(res) {
4573
+ const _res = Object.create(pinoResProto);
4574
+ _res.statusCode = res.headersSent ? res.statusCode : null;
4575
+ _res.headers = res.getHeaders ? res.getHeaders() : res._headers;
4576
+ _res.raw = res;
4577
+ return _res;
4578
+ }
4579
+ function mapHttpResponse(res) {
4580
+ return {
4581
+ res: resSerializer(res)
4582
+ };
4583
+ }
4584
+ }
4585
+ });
4586
+
4587
+ // ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/index.js
4588
+ var require_pino_std_serializers = __commonJS({
4589
+ "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/index.js"(exports, module) {
4590
+ "use strict";
4591
+ var errSerializer = require_err();
4592
+ var errWithCauseSerializer = require_err_with_cause();
4593
+ var reqSerializers = require_req();
4594
+ var resSerializers = require_res();
4595
+ module.exports = {
4596
+ err: errSerializer,
4597
+ errWithCause: errWithCauseSerializer,
4598
+ mapHttpRequest: reqSerializers.mapHttpRequest,
4599
+ mapHttpResponse: resSerializers.mapHttpResponse,
4600
+ req: reqSerializers.reqSerializer,
4601
+ res: resSerializers.resSerializer,
4602
+ wrapErrorSerializer: function wrapErrorSerializer(customSerializer) {
4603
+ if (customSerializer === errSerializer) return customSerializer;
4604
+ return function wrapErrSerializer(err) {
4605
+ return customSerializer(errSerializer(err));
4606
+ };
4607
+ },
4608
+ wrapRequestSerializer: function wrapRequestSerializer(customSerializer) {
4609
+ if (customSerializer === reqSerializers.reqSerializer) return customSerializer;
4610
+ return function wrappedReqSerializer(req) {
4611
+ return customSerializer(reqSerializers.reqSerializer(req));
4612
+ };
4613
+ },
4614
+ wrapResponseSerializer: function wrapResponseSerializer(customSerializer) {
4615
+ if (customSerializer === resSerializers.resSerializer) return customSerializer;
4616
+ return function wrappedResSerializer(res) {
4617
+ return customSerializer(resSerializers.resSerializer(res));
4618
+ };
4619
+ }
4620
+ };
4621
+ }
4622
+ });
4623
+
4624
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/caller.js
4625
+ var require_caller = __commonJS({
4626
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/caller.js"(exports, module) {
4627
+ "use strict";
4628
+ function noOpPrepareStackTrace(_, stack) {
4629
+ return stack;
4630
+ }
4631
+ module.exports = function getCallers() {
4632
+ const originalPrepare = Error.prepareStackTrace;
4633
+ Error.prepareStackTrace = noOpPrepareStackTrace;
4634
+ const stack = new Error().stack;
4635
+ Error.prepareStackTrace = originalPrepare;
4636
+ if (!Array.isArray(stack)) {
4637
+ return void 0;
4638
+ }
4639
+ const entries = stack.slice(2);
4640
+ const fileNames = [];
4641
+ for (const entry of entries) {
4642
+ if (!entry) {
4643
+ continue;
4644
+ }
4645
+ fileNames.push(entry.getFileName());
4646
+ }
4647
+ return fileNames;
4648
+ };
4649
+ }
4650
+ });
4651
+
4652
+ // ../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js
4653
+ var require_redact = __commonJS({
4654
+ "../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js"(exports, module) {
4655
+ "use strict";
4656
+ function deepClone(obj) {
4657
+ if (obj === null || typeof obj !== "object") {
4658
+ return obj;
4659
+ }
4660
+ if (obj instanceof Date) {
4661
+ return new Date(obj.getTime());
4662
+ }
4663
+ if (obj instanceof Array) {
4664
+ const cloned = [];
4665
+ for (let i = 0; i < obj.length; i++) {
4666
+ cloned[i] = deepClone(obj[i]);
4667
+ }
4668
+ return cloned;
4669
+ }
4670
+ if (typeof obj === "object") {
4671
+ const cloned = Object.create(Object.getPrototypeOf(obj));
4672
+ for (const key in obj) {
4673
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
4674
+ cloned[key] = deepClone(obj[key]);
4675
+ }
4676
+ }
4677
+ return cloned;
4678
+ }
4679
+ return obj;
4680
+ }
4681
+ function parsePath(path4) {
4682
+ const parts = [];
4683
+ let current = "";
4684
+ let inBrackets = false;
4685
+ let inQuotes = false;
4686
+ let quoteChar = "";
4687
+ for (let i = 0; i < path4.length; i++) {
4688
+ const char = path4[i];
4689
+ if (!inBrackets && char === ".") {
4690
+ if (current) {
4691
+ parts.push(current);
4692
+ current = "";
4693
+ }
4694
+ } else if (char === "[") {
4695
+ if (current) {
4696
+ parts.push(current);
4697
+ current = "";
4698
+ }
4699
+ inBrackets = true;
4700
+ } else if (char === "]" && inBrackets) {
4701
+ parts.push(current);
4702
+ current = "";
4703
+ inBrackets = false;
4704
+ inQuotes = false;
4705
+ } else if ((char === '"' || char === "'") && inBrackets) {
4706
+ if (!inQuotes) {
4707
+ inQuotes = true;
4708
+ quoteChar = char;
4709
+ } else if (char === quoteChar) {
4710
+ inQuotes = false;
4711
+ quoteChar = "";
4712
+ } else {
4713
+ current += char;
4714
+ }
4715
+ } else {
4716
+ current += char;
4717
+ }
4718
+ }
4719
+ if (current) {
4720
+ parts.push(current);
4721
+ }
4722
+ return parts;
4723
+ }
4724
+ function setValue(obj, parts, value) {
4725
+ let current = obj;
4726
+ for (let i = 0; i < parts.length - 1; i++) {
4727
+ const key = parts[i];
4728
+ if (typeof current !== "object" || current === null || !(key in current)) {
4729
+ return false;
4730
+ }
4731
+ if (typeof current[key] !== "object" || current[key] === null) {
4732
+ return false;
4733
+ }
4734
+ current = current[key];
4735
+ }
4736
+ const lastKey = parts[parts.length - 1];
4737
+ if (lastKey === "*") {
4738
+ if (Array.isArray(current)) {
4739
+ for (let i = 0; i < current.length; i++) {
4740
+ current[i] = value;
4741
+ }
4742
+ } else if (typeof current === "object" && current !== null) {
4743
+ for (const key in current) {
4744
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
4745
+ current[key] = value;
4746
+ }
4747
+ }
4748
+ }
4749
+ } else {
4750
+ if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
4751
+ current[lastKey] = value;
4752
+ }
4753
+ }
4754
+ return true;
4755
+ }
4756
+ function removeKey(obj, parts) {
4757
+ let current = obj;
4758
+ for (let i = 0; i < parts.length - 1; i++) {
4759
+ const key = parts[i];
4760
+ if (typeof current !== "object" || current === null || !(key in current)) {
4761
+ return false;
4762
+ }
4763
+ if (typeof current[key] !== "object" || current[key] === null) {
4764
+ return false;
4765
+ }
4766
+ current = current[key];
4767
+ }
4768
+ const lastKey = parts[parts.length - 1];
4769
+ if (lastKey === "*") {
4770
+ if (Array.isArray(current)) {
4771
+ for (let i = 0; i < current.length; i++) {
4772
+ current[i] = void 0;
4773
+ }
4774
+ } else if (typeof current === "object" && current !== null) {
4775
+ for (const key in current) {
4776
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
4777
+ delete current[key];
4778
+ }
4779
+ }
4780
+ }
4781
+ } else {
4782
+ if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) {
4783
+ delete current[lastKey];
4784
+ }
4785
+ }
4786
+ return true;
4787
+ }
4788
+ var PATH_NOT_FOUND = /* @__PURE__ */ Symbol("PATH_NOT_FOUND");
4789
+ function getValueIfExists(obj, parts) {
4790
+ let current = obj;
4791
+ for (const part of parts) {
4792
+ if (current === null || current === void 0) {
4793
+ return PATH_NOT_FOUND;
4794
+ }
4795
+ if (typeof current !== "object" || current === null) {
4796
+ return PATH_NOT_FOUND;
4797
+ }
4798
+ if (!(part in current)) {
4799
+ return PATH_NOT_FOUND;
4800
+ }
4801
+ current = current[part];
4802
+ }
4803
+ return current;
4804
+ }
4805
+ function getValue(obj, parts) {
4806
+ let current = obj;
4807
+ for (const part of parts) {
4808
+ if (current === null || current === void 0) {
4809
+ return void 0;
4810
+ }
4811
+ if (typeof current !== "object" || current === null) {
4812
+ return void 0;
4813
+ }
4814
+ current = current[part];
4815
+ }
4816
+ return current;
4817
+ }
4818
+ function redactPaths(obj, paths, censor, remove = false) {
4819
+ for (const path4 of paths) {
4820
+ const parts = parsePath(path4);
4821
+ if (parts.includes("*")) {
4822
+ redactWildcardPath(obj, parts, censor, path4, remove);
4823
+ } else {
4824
+ if (remove) {
4825
+ removeKey(obj, parts);
4826
+ } else {
4827
+ const value = getValueIfExists(obj, parts);
4828
+ if (value === PATH_NOT_FOUND) {
4829
+ continue;
4830
+ }
4831
+ const actualCensor = typeof censor === "function" ? censor(value, parts) : censor;
4832
+ setValue(obj, parts, actualCensor);
4833
+ }
4834
+ }
4835
+ }
4836
+ }
4837
+ function redactWildcardPath(obj, parts, censor, originalPath, remove = false) {
4838
+ const wildcardIndex = parts.indexOf("*");
4839
+ if (wildcardIndex === parts.length - 1) {
4840
+ const parentParts = parts.slice(0, -1);
4841
+ let current = obj;
4842
+ for (const part of parentParts) {
4843
+ if (current === null || current === void 0) return;
4844
+ if (typeof current !== "object" || current === null) return;
4845
+ current = current[part];
4846
+ }
4847
+ if (Array.isArray(current)) {
4848
+ if (remove) {
4849
+ for (let i = 0; i < current.length; i++) {
4850
+ current[i] = void 0;
4851
+ }
4852
+ } else {
4853
+ for (let i = 0; i < current.length; i++) {
4854
+ const indexPath = [...parentParts, i.toString()];
4855
+ const actualCensor = typeof censor === "function" ? censor(current[i], indexPath) : censor;
4856
+ current[i] = actualCensor;
4857
+ }
4858
+ }
4859
+ } else if (typeof current === "object" && current !== null) {
4860
+ if (remove) {
4861
+ const keysToDelete = [];
4862
+ for (const key in current) {
4863
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
4864
+ keysToDelete.push(key);
4865
+ }
4866
+ }
4867
+ for (const key of keysToDelete) {
4868
+ delete current[key];
4869
+ }
4870
+ } else {
4871
+ for (const key in current) {
4872
+ const keyPath = [...parentParts, key];
4873
+ const actualCensor = typeof censor === "function" ? censor(current[key], keyPath) : censor;
4874
+ current[key] = actualCensor;
4875
+ }
4876
+ }
4877
+ }
4878
+ } else {
4879
+ redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove);
4880
+ }
4881
+ }
4882
+ function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = false) {
4883
+ const beforeWildcard = parts.slice(0, wildcardIndex);
4884
+ const afterWildcard = parts.slice(wildcardIndex + 1);
4885
+ const pathArray = [];
4886
+ function traverse(current, pathLength) {
4887
+ if (pathLength === beforeWildcard.length) {
4888
+ if (Array.isArray(current)) {
4889
+ for (let i = 0; i < current.length; i++) {
4890
+ pathArray[pathLength] = i.toString();
4891
+ traverse(current[i], pathLength + 1);
4892
+ }
4893
+ } else if (typeof current === "object" && current !== null) {
4894
+ for (const key in current) {
4895
+ pathArray[pathLength] = key;
4896
+ traverse(current[key], pathLength + 1);
4897
+ }
4898
+ }
4899
+ } else if (pathLength < beforeWildcard.length) {
4900
+ const nextKey = beforeWildcard[pathLength];
4901
+ if (current && typeof current === "object" && current !== null && nextKey in current) {
4902
+ pathArray[pathLength] = nextKey;
4903
+ traverse(current[nextKey], pathLength + 1);
4904
+ }
4905
+ } else {
4906
+ if (afterWildcard.includes("*")) {
4907
+ const wrappedCensor = typeof censor === "function" ? (value, path4) => {
4908
+ const fullPath = [...pathArray.slice(0, pathLength), ...path4];
4909
+ return censor(value, fullPath);
4910
+ } : censor;
4911
+ redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
4912
+ } else {
4913
+ if (remove) {
4914
+ removeKey(current, afterWildcard);
4915
+ } else {
4916
+ const actualCensor = typeof censor === "function" ? censor(getValue(current, afterWildcard), [...pathArray.slice(0, pathLength), ...afterWildcard]) : censor;
4917
+ setValue(current, afterWildcard, actualCensor);
4918
+ }
4919
+ }
4920
+ }
4921
+ }
4922
+ if (beforeWildcard.length === 0) {
4923
+ traverse(obj, 0);
4924
+ } else {
4925
+ let current = obj;
4926
+ for (let i = 0; i < beforeWildcard.length; i++) {
4927
+ const part = beforeWildcard[i];
4928
+ if (current === null || current === void 0) return;
4929
+ if (typeof current !== "object" || current === null) return;
4930
+ current = current[part];
4931
+ pathArray[i] = part;
4932
+ }
4933
+ if (current !== null && current !== void 0) {
4934
+ traverse(current, beforeWildcard.length);
4935
+ }
4936
+ }
4937
+ }
4938
+ function buildPathStructure(pathsToClone) {
4939
+ if (pathsToClone.length === 0) {
4940
+ return null;
4941
+ }
4942
+ const pathStructure = /* @__PURE__ */ new Map();
4943
+ for (const path4 of pathsToClone) {
4944
+ const parts = parsePath(path4);
4945
+ let current = pathStructure;
4946
+ for (let i = 0; i < parts.length; i++) {
4947
+ const part = parts[i];
4948
+ if (!current.has(part)) {
4949
+ current.set(part, /* @__PURE__ */ new Map());
4950
+ }
4951
+ current = current.get(part);
4952
+ }
4953
+ }
4954
+ return pathStructure;
4955
+ }
4956
+ function selectiveClone(obj, pathStructure) {
4957
+ if (!pathStructure) {
4958
+ return obj;
4959
+ }
4960
+ function cloneSelectively(source, pathMap, depth = 0) {
4961
+ if (!pathMap || pathMap.size === 0) {
4962
+ return source;
4963
+ }
4964
+ if (source === null || typeof source !== "object") {
4965
+ return source;
4966
+ }
4967
+ if (source instanceof Date) {
4968
+ return new Date(source.getTime());
4969
+ }
4970
+ if (Array.isArray(source)) {
4971
+ const cloned2 = [];
4972
+ for (let i = 0; i < source.length; i++) {
4973
+ const indexStr = i.toString();
4974
+ if (pathMap.has(indexStr) || pathMap.has("*")) {
4975
+ cloned2[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get("*"));
4976
+ } else {
4977
+ cloned2[i] = source[i];
4978
+ }
4979
+ }
4980
+ return cloned2;
4981
+ }
4982
+ const cloned = Object.create(Object.getPrototypeOf(source));
4983
+ for (const key in source) {
4984
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
4985
+ if (pathMap.has(key) || pathMap.has("*")) {
4986
+ cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get("*"));
4987
+ } else {
4988
+ cloned[key] = source[key];
4989
+ }
4990
+ }
4991
+ }
4992
+ return cloned;
4993
+ }
4994
+ return cloneSelectively(obj, pathStructure);
4995
+ }
4996
+ function validatePath(path4) {
4997
+ if (typeof path4 !== "string") {
4998
+ throw new Error("Paths must be (non-empty) strings");
4999
+ }
5000
+ if (path4 === "") {
5001
+ throw new Error("Invalid redaction path ()");
5002
+ }
5003
+ if (path4.includes("..")) {
5004
+ throw new Error(`Invalid redaction path (${path4})`);
5005
+ }
5006
+ if (path4.includes(",")) {
5007
+ throw new Error(`Invalid redaction path (${path4})`);
5008
+ }
5009
+ let bracketCount = 0;
5010
+ let inQuotes = false;
5011
+ let quoteChar = "";
5012
+ for (let i = 0; i < path4.length; i++) {
5013
+ const char = path4[i];
5014
+ if ((char === '"' || char === "'") && bracketCount > 0) {
5015
+ if (!inQuotes) {
5016
+ inQuotes = true;
5017
+ quoteChar = char;
5018
+ } else if (char === quoteChar) {
5019
+ inQuotes = false;
5020
+ quoteChar = "";
5021
+ }
5022
+ } else if (char === "[" && !inQuotes) {
5023
+ bracketCount++;
5024
+ } else if (char === "]" && !inQuotes) {
5025
+ bracketCount--;
5026
+ if (bracketCount < 0) {
5027
+ throw new Error(`Invalid redaction path (${path4})`);
5028
+ }
5029
+ }
5030
+ }
5031
+ if (bracketCount !== 0) {
5032
+ throw new Error(`Invalid redaction path (${path4})`);
5033
+ }
5034
+ }
5035
+ function validatePaths(paths) {
5036
+ if (!Array.isArray(paths)) {
5037
+ throw new TypeError("paths must be an array");
5038
+ }
5039
+ for (const path4 of paths) {
5040
+ validatePath(path4);
5041
+ }
5042
+ }
5043
+ function slowRedact(options = {}) {
5044
+ const {
5045
+ paths = [],
5046
+ censor = "[REDACTED]",
5047
+ serialize = JSON.stringify,
5048
+ strict = true,
5049
+ remove = false
5050
+ } = options;
5051
+ validatePaths(paths);
5052
+ const pathStructure = buildPathStructure(paths);
5053
+ return function redact(obj) {
5054
+ if (strict && (obj === null || typeof obj !== "object")) {
5055
+ if (obj === null || obj === void 0) {
5056
+ return serialize ? serialize(obj) : obj;
5057
+ }
5058
+ if (typeof obj !== "object") {
5059
+ return serialize ? serialize(obj) : obj;
5060
+ }
5061
+ }
5062
+ const cloned = selectiveClone(obj, pathStructure);
5063
+ const original = obj;
5064
+ let actualCensor = censor;
5065
+ if (typeof censor === "function") {
5066
+ actualCensor = censor;
5067
+ }
5068
+ redactPaths(cloned, paths, actualCensor, remove);
5069
+ if (serialize === false) {
5070
+ cloned.restore = function() {
5071
+ return deepClone(original);
5072
+ };
5073
+ return cloned;
5074
+ }
5075
+ if (typeof serialize === "function") {
5076
+ return serialize(cloned);
5077
+ }
5078
+ return JSON.stringify(cloned);
5079
+ };
5080
+ }
5081
+ module.exports = slowRedact;
5082
+ }
5083
+ });
5084
+
5085
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/symbols.js
5086
+ var require_symbols = __commonJS({
5087
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/symbols.js"(exports, module) {
5088
+ "use strict";
5089
+ var setLevelSym = /* @__PURE__ */ Symbol("pino.setLevel");
5090
+ var getLevelSym = /* @__PURE__ */ Symbol("pino.getLevel");
5091
+ var levelValSym = /* @__PURE__ */ Symbol("pino.levelVal");
5092
+ var levelCompSym = /* @__PURE__ */ Symbol("pino.levelComp");
5093
+ var useLevelLabelsSym = /* @__PURE__ */ Symbol("pino.useLevelLabels");
5094
+ var useOnlyCustomLevelsSym = /* @__PURE__ */ Symbol("pino.useOnlyCustomLevels");
5095
+ var mixinSym = /* @__PURE__ */ Symbol("pino.mixin");
5096
+ var lsCacheSym = /* @__PURE__ */ Symbol("pino.lsCache");
5097
+ var chindingsSym = /* @__PURE__ */ Symbol("pino.chindings");
5098
+ var asJsonSym = /* @__PURE__ */ Symbol("pino.asJson");
5099
+ var writeSym = /* @__PURE__ */ Symbol("pino.write");
5100
+ var redactFmtSym = /* @__PURE__ */ Symbol("pino.redactFmt");
5101
+ var timeSym = /* @__PURE__ */ Symbol("pino.time");
5102
+ var timeSliceIndexSym = /* @__PURE__ */ Symbol("pino.timeSliceIndex");
5103
+ var streamSym = /* @__PURE__ */ Symbol("pino.stream");
5104
+ var stringifySym = /* @__PURE__ */ Symbol("pino.stringify");
5105
+ var stringifySafeSym = /* @__PURE__ */ Symbol("pino.stringifySafe");
5106
+ var stringifiersSym = /* @__PURE__ */ Symbol("pino.stringifiers");
5107
+ var endSym = /* @__PURE__ */ Symbol("pino.end");
5108
+ var formatOptsSym = /* @__PURE__ */ Symbol("pino.formatOpts");
5109
+ var messageKeySym = /* @__PURE__ */ Symbol("pino.messageKey");
5110
+ var errorKeySym = /* @__PURE__ */ Symbol("pino.errorKey");
5111
+ var nestedKeySym = /* @__PURE__ */ Symbol("pino.nestedKey");
5112
+ var nestedKeyStrSym = /* @__PURE__ */ Symbol("pino.nestedKeyStr");
5113
+ var mixinMergeStrategySym = /* @__PURE__ */ Symbol("pino.mixinMergeStrategy");
5114
+ var msgPrefixSym = /* @__PURE__ */ Symbol("pino.msgPrefix");
5115
+ var wildcardFirstSym = /* @__PURE__ */ Symbol("pino.wildcardFirst");
5116
+ var serializersSym = /* @__PURE__ */ Symbol.for("pino.serializers");
5117
+ var formattersSym = /* @__PURE__ */ Symbol.for("pino.formatters");
5118
+ var hooksSym = /* @__PURE__ */ Symbol.for("pino.hooks");
5119
+ var needsMetadataGsym = /* @__PURE__ */ Symbol.for("pino.metadata");
5120
+ module.exports = {
5121
+ setLevelSym,
5122
+ getLevelSym,
5123
+ levelValSym,
5124
+ levelCompSym,
5125
+ useLevelLabelsSym,
5126
+ mixinSym,
5127
+ lsCacheSym,
5128
+ chindingsSym,
5129
+ asJsonSym,
5130
+ writeSym,
5131
+ serializersSym,
5132
+ redactFmtSym,
5133
+ timeSym,
5134
+ timeSliceIndexSym,
5135
+ streamSym,
5136
+ stringifySym,
5137
+ stringifySafeSym,
5138
+ stringifiersSym,
5139
+ endSym,
5140
+ formatOptsSym,
5141
+ messageKeySym,
5142
+ errorKeySym,
5143
+ nestedKeySym,
5144
+ wildcardFirstSym,
5145
+ needsMetadataGsym,
5146
+ useOnlyCustomLevelsSym,
5147
+ formattersSym,
5148
+ hooksSym,
5149
+ nestedKeyStrSym,
5150
+ mixinMergeStrategySym,
5151
+ msgPrefixSym
5152
+ };
5153
+ }
5154
+ });
5155
+
5156
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/redaction.js
5157
+ var require_redaction = __commonJS({
5158
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/redaction.js"(exports, module) {
5159
+ "use strict";
5160
+ var Redact = require_redact();
5161
+ var { redactFmtSym, wildcardFirstSym } = require_symbols();
5162
+ var rx = /[^.[\]]+|\[([^[\]]*?)\]/g;
5163
+ var CENSOR = "[Redacted]";
5164
+ var strict = false;
5165
+ function redaction(opts, serialize) {
5166
+ const { paths, censor, remove } = handle(opts);
5167
+ const shape = paths.reduce((o, str2) => {
5168
+ rx.lastIndex = 0;
5169
+ const first = rx.exec(str2);
5170
+ const next = rx.exec(str2);
5171
+ let ns = first[1] !== void 0 ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, "$1") : first[0];
5172
+ if (ns === "*") {
5173
+ ns = wildcardFirstSym;
5174
+ }
5175
+ if (next === null) {
5176
+ o[ns] = null;
5177
+ return o;
5178
+ }
5179
+ if (o[ns] === null) {
5180
+ return o;
5181
+ }
5182
+ const { index } = next;
5183
+ const nextPath = `${str2.substr(index, str2.length - 1)}`;
5184
+ o[ns] = o[ns] || [];
5185
+ if (ns !== wildcardFirstSym && o[ns].length === 0) {
5186
+ o[ns].push(...o[wildcardFirstSym] || []);
5187
+ }
5188
+ if (ns === wildcardFirstSym) {
5189
+ Object.keys(o).forEach(function(k) {
5190
+ if (o[k]) {
5191
+ o[k].push(nextPath);
5192
+ }
5193
+ });
5194
+ }
5195
+ o[ns].push(nextPath);
5196
+ return o;
5197
+ }, {});
5198
+ const result = {
5199
+ [redactFmtSym]: Redact({ paths, censor, serialize, strict, remove })
5200
+ };
5201
+ const topCensor = (...args) => {
5202
+ return typeof censor === "function" ? serialize(censor(...args)) : serialize(censor);
5203
+ };
5204
+ return [...Object.keys(shape), ...Object.getOwnPropertySymbols(shape)].reduce((o, k) => {
5205
+ if (shape[k] === null) {
5206
+ o[k] = (value) => topCensor(value, [k]);
5207
+ } else {
5208
+ const wrappedCensor = typeof censor === "function" ? (value, path4) => {
5209
+ return censor(value, [k, ...path4]);
5210
+ } : censor;
5211
+ o[k] = Redact({
5212
+ paths: shape[k],
5213
+ censor: wrappedCensor,
5214
+ serialize,
5215
+ strict,
5216
+ remove
5217
+ });
5218
+ }
5219
+ return o;
5220
+ }, result);
5221
+ }
5222
+ function handle(opts) {
5223
+ if (Array.isArray(opts)) {
5224
+ opts = { paths: opts, censor: CENSOR };
5225
+ return opts;
5226
+ }
5227
+ let { paths, censor = CENSOR, remove } = opts;
5228
+ if (Array.isArray(paths) === false) {
5229
+ throw Error("pino \u2013 redact must contain an array of strings");
5230
+ }
5231
+ if (remove === true) censor = void 0;
5232
+ return { paths, censor, remove };
5233
+ }
5234
+ module.exports = redaction;
5235
+ }
5236
+ });
5237
+
5238
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/time.js
5239
+ var require_time = __commonJS({
5240
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/time.js"(exports, module) {
5241
+ "use strict";
5242
+ var nullTime = () => "";
5243
+ var epochTime = () => `,"time":${Date.now()}`;
5244
+ var unixTime = () => `,"time":${Math.round(Date.now() / 1e3)}`;
5245
+ var isoTime = () => `,"time":"${new Date(Date.now()).toISOString()}"`;
5246
+ var NS_PER_MS = 1000000n;
5247
+ var NS_PER_SEC = 1000000000n;
5248
+ var startWallTimeNs = BigInt(Date.now()) * NS_PER_MS;
5249
+ var startHrTime = process.hrtime.bigint();
5250
+ var isoTimeNano = () => {
5251
+ const elapsedNs = process.hrtime.bigint() - startHrTime;
5252
+ const currentTimeNs = startWallTimeNs + elapsedNs;
5253
+ const secondsSinceEpoch = currentTimeNs / NS_PER_SEC;
5254
+ const nanosWithinSecond = currentTimeNs % NS_PER_SEC;
5255
+ const msSinceEpoch = Number(secondsSinceEpoch * 1000n + nanosWithinSecond / 1000000n);
5256
+ const date5 = new Date(msSinceEpoch);
5257
+ const year = date5.getUTCFullYear();
5258
+ const month = (date5.getUTCMonth() + 1).toString().padStart(2, "0");
5259
+ const day = date5.getUTCDate().toString().padStart(2, "0");
5260
+ const hours = date5.getUTCHours().toString().padStart(2, "0");
5261
+ const minutes = date5.getUTCMinutes().toString().padStart(2, "0");
5262
+ const seconds = date5.getUTCSeconds().toString().padStart(2, "0");
5263
+ return `,"time":"${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${nanosWithinSecond.toString().padStart(9, "0")}Z"`;
5264
+ };
5265
+ module.exports = { nullTime, epochTime, unixTime, isoTime, isoTimeNano };
5266
+ }
5267
+ });
5268
+
5269
+ // ../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js
5270
+ var require_quick_format_unescaped = __commonJS({
5271
+ "../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js"(exports, module) {
5272
+ "use strict";
5273
+ function tryStringify(o) {
5274
+ try {
5275
+ return JSON.stringify(o);
5276
+ } catch (e) {
5277
+ return '"[Circular]"';
5278
+ }
5279
+ }
5280
+ module.exports = format2;
5281
+ function format2(f, args, opts) {
5282
+ var ss = opts && opts.stringify || tryStringify;
5283
+ var offset = 1;
5284
+ if (typeof f === "object" && f !== null) {
5285
+ var len = args.length + offset;
5286
+ if (len === 1) return f;
5287
+ var objects = new Array(len);
5288
+ objects[0] = ss(f);
5289
+ for (var index = 1; index < len; index++) {
5290
+ objects[index] = ss(args[index]);
5291
+ }
5292
+ return objects.join(" ");
5293
+ }
5294
+ if (typeof f !== "string") {
5295
+ return f;
5296
+ }
5297
+ var argLen = args.length;
5298
+ if (argLen === 0) return f;
5299
+ var str2 = "";
5300
+ var a = 1 - offset;
5301
+ var lastPos = -1;
5302
+ var flen = f && f.length || 0;
5303
+ for (var i = 0; i < flen; ) {
5304
+ if (f.charCodeAt(i) === 37 && i + 1 < flen) {
5305
+ lastPos = lastPos > -1 ? lastPos : 0;
5306
+ switch (f.charCodeAt(i + 1)) {
5307
+ case 100:
5308
+ // 'd'
5309
+ case 102:
5310
+ if (a >= argLen)
5311
+ break;
5312
+ if (args[a] == null) break;
5313
+ if (lastPos < i)
5314
+ str2 += f.slice(lastPos, i);
5315
+ str2 += Number(args[a]);
5316
+ lastPos = i + 2;
5317
+ i++;
5318
+ break;
5319
+ case 105:
5320
+ if (a >= argLen)
5321
+ break;
5322
+ if (args[a] == null) break;
5323
+ if (lastPos < i)
5324
+ str2 += f.slice(lastPos, i);
5325
+ str2 += Math.floor(Number(args[a]));
5326
+ lastPos = i + 2;
5327
+ i++;
5328
+ break;
5329
+ case 79:
5330
+ // 'O'
5331
+ case 111:
5332
+ // 'o'
5333
+ case 106:
5334
+ if (a >= argLen)
5335
+ break;
5336
+ if (args[a] === void 0) break;
5337
+ if (lastPos < i)
5338
+ str2 += f.slice(lastPos, i);
5339
+ var type = typeof args[a];
5340
+ if (type === "string") {
5341
+ str2 += "'" + args[a] + "'";
5342
+ lastPos = i + 2;
5343
+ i++;
5344
+ break;
5345
+ }
5346
+ if (type === "function") {
5347
+ str2 += args[a].name || "<anonymous>";
5348
+ lastPos = i + 2;
5349
+ i++;
5350
+ break;
5351
+ }
5352
+ str2 += ss(args[a]);
5353
+ lastPos = i + 2;
5354
+ i++;
5355
+ break;
5356
+ case 115:
5357
+ if (a >= argLen)
5358
+ break;
5359
+ if (lastPos < i)
5360
+ str2 += f.slice(lastPos, i);
5361
+ str2 += String(args[a]);
5362
+ lastPos = i + 2;
5363
+ i++;
5364
+ break;
5365
+ case 37:
5366
+ if (lastPos < i)
5367
+ str2 += f.slice(lastPos, i);
5368
+ str2 += "%";
5369
+ lastPos = i + 2;
5370
+ i++;
5371
+ a--;
5372
+ break;
5373
+ }
5374
+ ++a;
5375
+ }
5376
+ ++i;
5377
+ }
5378
+ if (lastPos === -1)
5379
+ return f;
5380
+ else if (lastPos < flen) {
5381
+ str2 += f.slice(lastPos);
5382
+ }
5383
+ return str2;
5384
+ }
5385
+ }
5386
+ });
5387
+
5388
+ // ../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js
5389
+ var require_atomic_sleep = __commonJS({
5390
+ "../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js"(exports, module) {
5391
+ "use strict";
5392
+ if (typeof SharedArrayBuffer !== "undefined" && typeof Atomics !== "undefined") {
5393
+ let sleep3 = function(ms) {
5394
+ const valid = ms > 0 && ms < Infinity;
5395
+ if (valid === false) {
5396
+ if (typeof ms !== "number" && typeof ms !== "bigint") {
5397
+ throw TypeError("sleep: ms must be a number");
5398
+ }
5399
+ throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
5400
+ }
5401
+ Atomics.wait(nil, 0, 0, Number(ms));
5402
+ };
5403
+ const nil = new Int32Array(new SharedArrayBuffer(4));
5404
+ module.exports = sleep3;
5405
+ } else {
5406
+ let sleep3 = function(ms) {
5407
+ const valid = ms > 0 && ms < Infinity;
5408
+ if (valid === false) {
5409
+ if (typeof ms !== "number" && typeof ms !== "bigint") {
5410
+ throw TypeError("sleep: ms must be a number");
5411
+ }
5412
+ throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");
5413
+ }
5414
+ const target = Date.now() + Number(ms);
5415
+ while (target > Date.now()) {
5416
+ }
5417
+ };
5418
+ module.exports = sleep3;
5419
+ }
5420
+ }
5421
+ });
5422
+
5423
+ // ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
5424
+ var require_sonic_boom = __commonJS({
5425
+ "../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports, module) {
5426
+ "use strict";
5427
+ var fs6 = __require("fs");
5428
+ var EventEmitter = __require("events");
5429
+ var inherits = __require("util").inherits;
5430
+ var path4 = __require("path");
5431
+ var sleep3 = require_atomic_sleep();
5432
+ var assert2 = __require("assert");
5433
+ var BUSY_WRITE_TIMEOUT = 100;
5434
+ var kEmptyBuffer = Buffer.allocUnsafe(0);
5435
+ var MAX_WRITE = 16 * 1024;
5436
+ var kContentModeBuffer = "buffer";
5437
+ var kContentModeUtf8 = "utf8";
5438
+ var [major, minor] = (process.versions.node || "0.0").split(".").map(Number);
5439
+ var kCopyBuffer = major >= 22 && minor >= 7;
5440
+ function openFile(file2, sonic) {
5441
+ sonic._opening = true;
5442
+ sonic._writing = true;
5443
+ sonic._asyncDrainScheduled = false;
5444
+ function fileOpened(err, fd) {
5445
+ if (err) {
5446
+ sonic._reopening = false;
5447
+ sonic._writing = false;
5448
+ sonic._opening = false;
5449
+ if (sonic.sync) {
5450
+ process.nextTick(() => {
5451
+ if (sonic.listenerCount("error") > 0) {
5452
+ sonic.emit("error", err);
5453
+ }
5454
+ });
5455
+ } else {
5456
+ sonic.emit("error", err);
5457
+ }
5458
+ return;
5459
+ }
5460
+ const reopening = sonic._reopening;
5461
+ sonic.fd = fd;
5462
+ sonic.file = file2;
5463
+ sonic._reopening = false;
5464
+ sonic._opening = false;
5465
+ sonic._writing = false;
5466
+ if (sonic.sync) {
5467
+ process.nextTick(() => sonic.emit("ready"));
5468
+ } else {
5469
+ sonic.emit("ready");
5470
+ }
5471
+ if (sonic.destroyed) {
5472
+ return;
5473
+ }
5474
+ if (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending) {
5475
+ sonic._actualWrite();
5476
+ } else if (reopening) {
5477
+ process.nextTick(() => sonic.emit("drain"));
5478
+ }
5479
+ }
5480
+ const flags = sonic.append ? "a" : "w";
5481
+ const mode = sonic.mode;
5482
+ if (sonic.sync) {
5483
+ try {
5484
+ if (sonic.mkdir) fs6.mkdirSync(path4.dirname(file2), { recursive: true });
5485
+ const fd = fs6.openSync(file2, flags, mode);
5486
+ fileOpened(null, fd);
5487
+ } catch (err) {
5488
+ fileOpened(err);
5489
+ throw err;
5490
+ }
5491
+ } else if (sonic.mkdir) {
5492
+ fs6.mkdir(path4.dirname(file2), { recursive: true }, (err) => {
5493
+ if (err) return fileOpened(err);
5494
+ fs6.open(file2, flags, mode, fileOpened);
5495
+ });
5496
+ } else {
5497
+ fs6.open(file2, flags, mode, fileOpened);
5498
+ }
5499
+ }
5500
+ function SonicBoom(opts) {
5501
+ if (!(this instanceof SonicBoom)) {
5502
+ return new SonicBoom(opts);
5503
+ }
5504
+ let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {};
5505
+ fd = fd || dest;
5506
+ this._len = 0;
5507
+ this.fd = -1;
5508
+ this._bufs = [];
5509
+ this._lens = [];
5510
+ this._writing = false;
5511
+ this._ending = false;
5512
+ this._reopening = false;
5513
+ this._asyncDrainScheduled = false;
5514
+ this._flushPending = false;
5515
+ this._hwm = Math.max(minLength || 0, 16387);
5516
+ this.file = null;
5517
+ this.destroyed = false;
5518
+ this.minLength = minLength || 0;
5519
+ this.maxLength = maxLength || 0;
5520
+ this.maxWrite = maxWrite || MAX_WRITE;
5521
+ this._periodicFlush = periodicFlush || 0;
5522
+ this._periodicFlushTimer = void 0;
5523
+ this.sync = sync || false;
5524
+ this.writable = true;
5525
+ this._fsync = fsync || false;
5526
+ this.append = append || false;
5527
+ this.mode = mode;
5528
+ this.retryEAGAIN = retryEAGAIN || (() => true);
5529
+ this.mkdir = mkdir || false;
5530
+ let fsWriteSync;
5531
+ let fsWrite;
5532
+ if (contentMode === kContentModeBuffer) {
5533
+ this._writingBuf = kEmptyBuffer;
5534
+ this.write = writeBuffer;
5535
+ this.flush = flushBuffer;
5536
+ this.flushSync = flushBufferSync;
5537
+ this._actualWrite = actualWriteBuffer;
5538
+ fsWriteSync = () => fs6.writeSync(this.fd, this._writingBuf);
5539
+ fsWrite = () => fs6.write(this.fd, this._writingBuf, this.release);
5540
+ } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
5541
+ this._writingBuf = "";
5542
+ this.write = write;
5543
+ this.flush = flush;
5544
+ this.flushSync = flushSync;
5545
+ this._actualWrite = actualWrite;
5546
+ fsWriteSync = () => {
5547
+ if (Buffer.isBuffer(this._writingBuf)) {
5548
+ return fs6.writeSync(this.fd, this._writingBuf);
5549
+ }
5550
+ return fs6.writeSync(this.fd, this._writingBuf, "utf8");
5551
+ };
5552
+ fsWrite = () => {
5553
+ if (Buffer.isBuffer(this._writingBuf)) {
5554
+ return fs6.write(this.fd, this._writingBuf, this.release);
5555
+ }
5556
+ return fs6.write(this.fd, this._writingBuf, "utf8", this.release);
5557
+ };
5558
+ } else {
5559
+ throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
5560
+ }
5561
+ if (typeof fd === "number") {
5562
+ this.fd = fd;
5563
+ process.nextTick(() => this.emit("ready"));
5564
+ } else if (typeof fd === "string") {
5565
+ openFile(fd, this);
5566
+ } else {
5567
+ throw new Error("SonicBoom supports only file descriptors and files");
5568
+ }
5569
+ if (this.minLength >= this.maxWrite) {
5570
+ throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);
5571
+ }
5572
+ this.release = (err, n) => {
5573
+ if (err) {
5574
+ if ((err.code === "EAGAIN" || err.code === "EBUSY") && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) {
5575
+ if (this.sync) {
5576
+ try {
5577
+ sleep3(BUSY_WRITE_TIMEOUT);
5578
+ this.release(void 0, 0);
5579
+ } catch (err2) {
5580
+ this.release(err2);
5581
+ }
5582
+ } else {
5583
+ setTimeout(fsWrite, BUSY_WRITE_TIMEOUT);
5584
+ }
5585
+ } else {
5586
+ this._writing = false;
5587
+ this.emit("error", err);
5588
+ }
5589
+ return;
5590
+ }
5591
+ this.emit("write", n);
5592
+ const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n);
5593
+ this._len = releasedBufObj.len;
5594
+ this._writingBuf = releasedBufObj.writingBuf;
5595
+ if (this._writingBuf.length) {
5596
+ if (!this.sync) {
5597
+ fsWrite();
5598
+ return;
5599
+ }
5600
+ try {
5601
+ do {
5602
+ const n2 = fsWriteSync();
5603
+ const releasedBufObj2 = releaseWritingBuf(this._writingBuf, this._len, n2);
5604
+ this._len = releasedBufObj2.len;
5605
+ this._writingBuf = releasedBufObj2.writingBuf;
5606
+ } while (this._writingBuf.length);
5607
+ } catch (err2) {
5608
+ this.release(err2);
5609
+ return;
5610
+ }
5611
+ }
5612
+ if (this._fsync) {
5613
+ fs6.fsyncSync(this.fd);
5614
+ }
5615
+ const len = this._len;
5616
+ if (this._reopening) {
5617
+ this._writing = false;
5618
+ this._reopening = false;
5619
+ this.reopen();
5620
+ } else if (len > this.minLength) {
5621
+ this._actualWrite();
5622
+ } else if (this._ending) {
5623
+ if (len > 0) {
5624
+ this._actualWrite();
5625
+ } else {
5626
+ this._writing = false;
5627
+ actualClose(this);
5628
+ }
5629
+ } else {
5630
+ this._writing = false;
5631
+ if (this.sync) {
5632
+ if (!this._asyncDrainScheduled) {
5633
+ this._asyncDrainScheduled = true;
5634
+ process.nextTick(emitDrain, this);
5635
+ }
5636
+ } else {
5637
+ this.emit("drain");
5638
+ }
5639
+ }
5640
+ };
5641
+ this.on("newListener", function(name) {
5642
+ if (name === "drain") {
5643
+ this._asyncDrainScheduled = false;
5644
+ }
5645
+ });
5646
+ if (this._periodicFlush !== 0) {
5647
+ this._periodicFlushTimer = setInterval(() => this.flush(null), this._periodicFlush);
5648
+ this._periodicFlushTimer.unref();
5649
+ }
5650
+ }
5651
+ function releaseWritingBuf(writingBuf, len, n) {
5652
+ if (typeof writingBuf === "string") {
5653
+ writingBuf = Buffer.from(writingBuf);
5654
+ }
5655
+ len = Math.max(len - n, 0);
5656
+ writingBuf = writingBuf.subarray(n);
5657
+ return { writingBuf, len };
5658
+ }
5659
+ function emitDrain(sonic) {
5660
+ const hasListeners = sonic.listenerCount("drain") > 0;
5661
+ if (!hasListeners) return;
5662
+ sonic._asyncDrainScheduled = false;
5663
+ sonic.emit("drain");
5664
+ }
5665
+ inherits(SonicBoom, EventEmitter);
5666
+ function mergeBuf(bufs, len) {
5667
+ if (bufs.length === 0) {
5668
+ return kEmptyBuffer;
5669
+ }
5670
+ if (bufs.length === 1) {
5671
+ return bufs[0];
5672
+ }
5673
+ return Buffer.concat(bufs, len);
5674
+ }
5675
+ function write(data) {
5676
+ if (this.destroyed) {
5677
+ throw new Error("SonicBoom destroyed");
5678
+ }
5679
+ data = "" + data;
5680
+ const dataLen = Buffer.byteLength(data);
5681
+ const len = this._len + dataLen;
5682
+ const bufs = this._bufs;
5683
+ if (this.maxLength && len > this.maxLength) {
5684
+ this.emit("drop", data);
5685
+ return this._len < this._hwm;
5686
+ }
5687
+ if (bufs.length === 0 || Buffer.byteLength(bufs[bufs.length - 1]) + dataLen > this.maxWrite) {
5688
+ bufs.push(data);
5689
+ } else {
5690
+ bufs[bufs.length - 1] += data;
5691
+ }
5692
+ this._len = len;
5693
+ if (!this._writing && this._len >= this.minLength) {
5694
+ this._actualWrite();
5695
+ }
5696
+ return this._len < this._hwm;
5697
+ }
5698
+ function writeBuffer(data) {
5699
+ if (this.destroyed) {
5700
+ throw new Error("SonicBoom destroyed");
5701
+ }
5702
+ const len = this._len + data.length;
5703
+ const bufs = this._bufs;
5704
+ const lens = this._lens;
5705
+ if (this.maxLength && len > this.maxLength) {
5706
+ this.emit("drop", data);
5707
+ return this._len < this._hwm;
5708
+ }
5709
+ if (bufs.length === 0 || lens[lens.length - 1] + data.length > this.maxWrite) {
5710
+ bufs.push([data]);
5711
+ lens.push(data.length);
5712
+ } else {
5713
+ bufs[bufs.length - 1].push(data);
5714
+ lens[lens.length - 1] += data.length;
5715
+ }
5716
+ this._len = len;
5717
+ if (!this._writing && this._len >= this.minLength) {
5718
+ this._actualWrite();
5719
+ }
5720
+ return this._len < this._hwm;
5721
+ }
5722
+ function callFlushCallbackOnDrain(cb) {
5723
+ this._flushPending = true;
5724
+ const onDrain = () => {
5725
+ if (!this._fsync) {
5726
+ try {
5727
+ fs6.fsync(this.fd, (err) => {
5728
+ this._flushPending = false;
5729
+ cb(err);
5730
+ });
5731
+ } catch (err) {
5732
+ cb(err);
5733
+ }
5734
+ } else {
5735
+ this._flushPending = false;
5736
+ cb();
5737
+ }
5738
+ this.off("error", onError);
5739
+ };
5740
+ const onError = (err) => {
5741
+ this._flushPending = false;
5742
+ cb(err);
5743
+ this.off("drain", onDrain);
5744
+ };
5745
+ this.once("drain", onDrain);
5746
+ this.once("error", onError);
5747
+ }
5748
+ function flush(cb) {
5749
+ if (cb != null && typeof cb !== "function") {
5750
+ throw new Error("flush cb must be a function");
5751
+ }
5752
+ if (this.destroyed) {
5753
+ const error49 = new Error("SonicBoom destroyed");
5754
+ if (cb) {
5755
+ cb(error49);
5756
+ return;
5757
+ }
5758
+ throw error49;
5759
+ }
5760
+ if (this.minLength <= 0) {
5761
+ cb?.();
5762
+ return;
5763
+ }
5764
+ if (cb) {
5765
+ callFlushCallbackOnDrain.call(this, cb);
5766
+ }
5767
+ if (this._writing) {
5768
+ return;
5769
+ }
5770
+ if (this._bufs.length === 0) {
5771
+ this._bufs.push("");
5772
+ }
5773
+ this._actualWrite();
5774
+ }
5775
+ function flushBuffer(cb) {
5776
+ if (cb != null && typeof cb !== "function") {
5777
+ throw new Error("flush cb must be a function");
5778
+ }
5779
+ if (this.destroyed) {
5780
+ const error49 = new Error("SonicBoom destroyed");
5781
+ if (cb) {
5782
+ cb(error49);
5783
+ return;
5784
+ }
5785
+ throw error49;
5786
+ }
5787
+ if (this.minLength <= 0) {
5788
+ cb?.();
5789
+ return;
5790
+ }
5791
+ if (cb) {
5792
+ callFlushCallbackOnDrain.call(this, cb);
5793
+ }
5794
+ if (this._writing) {
5795
+ return;
5796
+ }
5797
+ if (this._bufs.length === 0) {
5798
+ this._bufs.push([]);
5799
+ this._lens.push(0);
5800
+ }
5801
+ this._actualWrite();
5802
+ }
5803
+ SonicBoom.prototype.reopen = function(file2) {
5804
+ if (this.destroyed) {
5805
+ throw new Error("SonicBoom destroyed");
5806
+ }
5807
+ if (this._opening) {
5808
+ this.once("ready", () => {
5809
+ this.reopen(file2);
5810
+ });
5811
+ return;
5812
+ }
5813
+ if (this._ending) {
5814
+ return;
5815
+ }
5816
+ if (!this.file) {
5817
+ throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");
5818
+ }
5819
+ if (file2) {
5820
+ this.file = file2;
5821
+ }
5822
+ this._reopening = true;
5823
+ if (this._writing) {
5824
+ return;
5825
+ }
5826
+ const fd = this.fd;
5827
+ this.once("ready", () => {
5828
+ if (fd !== this.fd) {
5829
+ fs6.close(fd, (err) => {
5830
+ if (err) {
5831
+ return this.emit("error", err);
5832
+ }
5833
+ });
5834
+ }
5835
+ });
5836
+ openFile(this.file, this);
5837
+ };
5838
+ SonicBoom.prototype.end = function() {
5839
+ if (this.destroyed) {
5840
+ throw new Error("SonicBoom destroyed");
5841
+ }
5842
+ if (this._opening) {
5843
+ this.once("ready", () => {
5844
+ this.end();
5845
+ });
5846
+ return;
5847
+ }
5848
+ if (this._ending) {
5849
+ return;
5850
+ }
5851
+ this._ending = true;
5852
+ if (this._writing) {
5853
+ return;
5854
+ }
5855
+ if (this._len > 0 && this.fd >= 0) {
5856
+ this._actualWrite();
5857
+ } else {
5858
+ actualClose(this);
5859
+ }
5860
+ };
5861
+ function flushSync() {
5862
+ if (this.destroyed) {
5863
+ throw new Error("SonicBoom destroyed");
5864
+ }
5865
+ if (this.fd < 0) {
5866
+ throw new Error("sonic boom is not ready yet");
5867
+ }
5868
+ if (!this._writing && this._writingBuf.length > 0) {
5869
+ this._bufs.unshift(this._writingBuf);
5870
+ this._writingBuf = "";
5871
+ }
5872
+ let buf = "";
5873
+ while (this._bufs.length || buf.length) {
5874
+ if (buf.length <= 0) {
5875
+ buf = this._bufs[0];
5876
+ }
5877
+ try {
5878
+ const n = Buffer.isBuffer(buf) ? fs6.writeSync(this.fd, buf) : fs6.writeSync(this.fd, buf, "utf8");
5879
+ const releasedBufObj = releaseWritingBuf(buf, this._len, n);
5880
+ buf = releasedBufObj.writingBuf;
5881
+ this._len = releasedBufObj.len;
5882
+ if (buf.length <= 0) {
5883
+ this._bufs.shift();
5884
+ }
5885
+ } catch (err) {
5886
+ const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY";
5887
+ if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
5888
+ throw err;
5889
+ }
5890
+ sleep3(BUSY_WRITE_TIMEOUT);
5891
+ }
5892
+ }
5893
+ try {
5894
+ fs6.fsyncSync(this.fd);
5895
+ } catch {
5896
+ }
5897
+ }
5898
+ function flushBufferSync() {
5899
+ if (this.destroyed) {
5900
+ throw new Error("SonicBoom destroyed");
5901
+ }
5902
+ if (this.fd < 0) {
5903
+ throw new Error("sonic boom is not ready yet");
5904
+ }
5905
+ if (!this._writing && this._writingBuf.length > 0) {
5906
+ this._bufs.unshift([this._writingBuf]);
5907
+ this._writingBuf = kEmptyBuffer;
5908
+ }
5909
+ let buf = kEmptyBuffer;
5910
+ while (this._bufs.length || buf.length) {
5911
+ if (buf.length <= 0) {
5912
+ buf = mergeBuf(this._bufs[0], this._lens[0]);
5913
+ }
5914
+ try {
5915
+ const n = fs6.writeSync(this.fd, buf);
5916
+ buf = buf.subarray(n);
5917
+ this._len = Math.max(this._len - n, 0);
5918
+ if (buf.length <= 0) {
5919
+ this._bufs.shift();
5920
+ this._lens.shift();
5921
+ }
5922
+ } catch (err) {
5923
+ const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY";
5924
+ if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
5925
+ throw err;
5926
+ }
5927
+ sleep3(BUSY_WRITE_TIMEOUT);
5928
+ }
5929
+ }
5930
+ }
5931
+ SonicBoom.prototype.destroy = function() {
5932
+ if (this.destroyed) {
5933
+ return;
5934
+ }
5935
+ actualClose(this);
5936
+ };
5937
+ function actualWrite() {
5938
+ const release = this.release;
5939
+ this._writing = true;
5940
+ this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
5941
+ if (this.sync) {
5942
+ try {
5943
+ const written = Buffer.isBuffer(this._writingBuf) ? fs6.writeSync(this.fd, this._writingBuf) : fs6.writeSync(this.fd, this._writingBuf, "utf8");
5944
+ release(null, written);
5945
+ } catch (err) {
5946
+ release(err);
5947
+ }
5948
+ } else {
5949
+ fs6.write(this.fd, this._writingBuf, release);
5950
+ }
5951
+ }
5952
+ function actualWriteBuffer() {
5953
+ const release = this.release;
5954
+ this._writing = true;
5955
+ this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
5956
+ if (this.sync) {
5957
+ try {
5958
+ const written = fs6.writeSync(this.fd, this._writingBuf);
5959
+ release(null, written);
5960
+ } catch (err) {
5961
+ release(err);
5962
+ }
5963
+ } else {
5964
+ if (kCopyBuffer) {
5965
+ this._writingBuf = Buffer.from(this._writingBuf);
5966
+ }
5967
+ fs6.write(this.fd, this._writingBuf, release);
5968
+ }
5969
+ }
5970
+ function actualClose(sonic) {
5971
+ if (sonic.fd === -1) {
5972
+ sonic.once("ready", actualClose.bind(null, sonic));
5973
+ return;
5974
+ }
5975
+ if (sonic._periodicFlushTimer !== void 0) {
5976
+ clearInterval(sonic._periodicFlushTimer);
5977
+ }
5978
+ sonic.destroyed = true;
5979
+ sonic._bufs = [];
5980
+ sonic._lens = [];
5981
+ assert2(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
5982
+ try {
5983
+ fs6.fsync(sonic.fd, closeWrapped);
5984
+ } catch {
5985
+ }
5986
+ function closeWrapped() {
5987
+ if (sonic.fd !== 1 && sonic.fd !== 2) {
5988
+ fs6.close(sonic.fd, done);
5989
+ } else {
5990
+ done();
5991
+ }
5992
+ }
5993
+ function done(err) {
5994
+ if (err) {
5995
+ sonic.emit("error", err);
5996
+ return;
5997
+ }
5998
+ if (sonic._ending && !sonic._writing) {
5999
+ sonic.emit("finish");
6000
+ }
6001
+ sonic.emit("close");
6002
+ }
6003
+ }
6004
+ SonicBoom.SonicBoom = SonicBoom;
6005
+ SonicBoom.default = SonicBoom;
6006
+ module.exports = SonicBoom;
6007
+ }
6008
+ });
6009
+
6010
+ // ../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js
6011
+ var require_on_exit_leak_free = __commonJS({
6012
+ "../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js"(exports, module) {
6013
+ "use strict";
6014
+ var refs = {
6015
+ exit: [],
6016
+ beforeExit: []
6017
+ };
6018
+ var functions = {
6019
+ exit: onExit2,
6020
+ beforeExit: onBeforeExit
6021
+ };
6022
+ var registry2;
6023
+ function ensureRegistry() {
6024
+ if (registry2 === void 0) {
6025
+ registry2 = new FinalizationRegistry(clear);
6026
+ }
6027
+ }
6028
+ function install(event) {
6029
+ if (refs[event].length > 0) {
6030
+ return;
6031
+ }
6032
+ process.on(event, functions[event]);
6033
+ }
6034
+ function uninstall(event) {
6035
+ if (refs[event].length > 0) {
6036
+ return;
6037
+ }
6038
+ process.removeListener(event, functions[event]);
6039
+ if (refs.exit.length === 0 && refs.beforeExit.length === 0) {
6040
+ registry2 = void 0;
6041
+ }
6042
+ }
6043
+ function onExit2() {
6044
+ callRefs("exit");
6045
+ }
6046
+ function onBeforeExit() {
6047
+ callRefs("beforeExit");
6048
+ }
6049
+ function callRefs(event) {
6050
+ for (const ref of refs[event]) {
6051
+ const obj = ref.deref();
6052
+ const fn = ref.fn;
6053
+ if (obj !== void 0) {
6054
+ fn(obj, event);
6055
+ }
6056
+ }
6057
+ refs[event] = [];
6058
+ }
6059
+ function clear(ref) {
6060
+ for (const event of ["exit", "beforeExit"]) {
6061
+ const index = refs[event].indexOf(ref);
6062
+ refs[event].splice(index, index + 1);
6063
+ uninstall(event);
6064
+ }
6065
+ }
6066
+ function _register(event, obj, fn) {
6067
+ if (obj === void 0) {
6068
+ throw new Error("the object can't be undefined");
6069
+ }
6070
+ install(event);
6071
+ const ref = new WeakRef(obj);
6072
+ ref.fn = fn;
6073
+ ensureRegistry();
6074
+ registry2.register(obj, ref);
6075
+ refs[event].push(ref);
6076
+ }
6077
+ function register(obj, fn) {
6078
+ _register("exit", obj, fn);
6079
+ }
6080
+ function registerBeforeExit(obj, fn) {
6081
+ _register("beforeExit", obj, fn);
6082
+ }
6083
+ function unregister(obj) {
6084
+ if (registry2 === void 0) {
6085
+ return;
6086
+ }
6087
+ registry2.unregister(obj);
6088
+ for (const event of ["exit", "beforeExit"]) {
6089
+ refs[event] = refs[event].filter((ref) => {
6090
+ const _obj = ref.deref();
6091
+ return _obj && _obj !== obj;
6092
+ });
6093
+ uninstall(event);
6094
+ }
6095
+ }
6096
+ module.exports = {
6097
+ register,
6098
+ registerBeforeExit,
6099
+ unregister
6100
+ };
6101
+ }
6102
+ });
6103
+
6104
+ // ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/package.json
6105
+ var require_package2 = __commonJS({
6106
+ "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/package.json"(exports, module) {
6107
+ module.exports = {
6108
+ name: "thread-stream",
6109
+ version: "4.0.0",
6110
+ description: "A streaming way to send data to a Node.js Worker Thread",
6111
+ main: "index.js",
6112
+ types: "index.d.ts",
6113
+ engines: {
6114
+ node: ">=20"
6115
+ },
6116
+ dependencies: {
6117
+ "real-require": "^0.2.0"
6118
+ },
6119
+ devDependencies: {
6120
+ "@types/node": "^22.0.0",
6121
+ "@yao-pkg/pkg": "^6.0.0",
6122
+ borp: "^0.21.0",
6123
+ desm: "^1.3.0",
6124
+ eslint: "^9.39.1",
6125
+ fastbench: "^1.0.1",
6126
+ husky: "^9.0.6",
6127
+ neostandard: "^0.12.2",
6128
+ "pino-elasticsearch": "^8.0.0",
6129
+ "sonic-boom": "^4.0.1",
6130
+ "ts-node": "^10.8.0",
6131
+ typescript: "~5.7.3"
6132
+ },
6133
+ scripts: {
6134
+ build: "tsc --noEmit",
6135
+ lint: "eslint",
6136
+ test: "npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'",
6137
+ "test:ci": "npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'",
6138
+ "test:yarn": "npm run transpile && borp --pattern 'test/*.test.js'",
6139
+ transpile: "sh ./test/ts/transpile.sh",
6140
+ prepare: "husky install"
6141
+ },
6142
+ repository: {
6143
+ type: "git",
6144
+ url: "git+https://github.com/mcollina/thread-stream.git"
6145
+ },
6146
+ keywords: [
6147
+ "worker",
6148
+ "thread",
6149
+ "threads",
6150
+ "stream"
6151
+ ],
6152
+ author: "Matteo Collina <hello@matteocollina.com>",
6153
+ license: "MIT",
6154
+ bugs: {
6155
+ url: "https://github.com/mcollina/thread-stream/issues"
6156
+ },
6157
+ homepage: "https://github.com/mcollina/thread-stream#readme"
6158
+ };
6159
+ }
6160
+ });
6161
+
6162
+ // ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/wait.js
6163
+ var require_wait = __commonJS({
6164
+ "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/wait.js"(exports, module) {
6165
+ "use strict";
6166
+ var WAIT_MS = 1e4;
6167
+ function wait(state, index, expected, timeout, done) {
6168
+ const max = timeout === Infinity ? Infinity : Date.now() + timeout;
6169
+ const check3 = () => {
6170
+ const current = Atomics.load(state, index);
6171
+ if (current === expected) {
6172
+ done(null, "ok");
6173
+ return;
6174
+ }
6175
+ if (max !== Infinity && Date.now() > max) {
6176
+ done(null, "timed-out");
6177
+ return;
6178
+ }
6179
+ const remaining = max === Infinity ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
6180
+ const result = Atomics.waitAsync(state, index, current, remaining);
6181
+ if (result.async) {
6182
+ result.value.then(check3);
6183
+ } else {
6184
+ setImmediate(check3);
6185
+ }
6186
+ };
6187
+ check3();
6188
+ }
6189
+ function waitDiff(state, index, expected, timeout, done) {
6190
+ const max = timeout === Infinity ? Infinity : Date.now() + timeout;
6191
+ const check3 = () => {
6192
+ const current = Atomics.load(state, index);
6193
+ if (current !== expected) {
6194
+ done(null, "ok");
6195
+ return;
6196
+ }
6197
+ if (max !== Infinity && Date.now() > max) {
6198
+ done(null, "timed-out");
6199
+ return;
6200
+ }
6201
+ const remaining = max === Infinity ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
6202
+ const result = Atomics.waitAsync(state, index, expected, remaining);
6203
+ if (result.async) {
6204
+ result.value.then(check3);
6205
+ } else {
6206
+ setImmediate(check3);
6207
+ }
6208
+ };
6209
+ check3();
6210
+ }
6211
+ module.exports = { wait, waitDiff };
6212
+ }
6213
+ });
6214
+
6215
+ // ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/indexes.js
6216
+ var require_indexes = __commonJS({
6217
+ "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/indexes.js"(exports, module) {
6218
+ "use strict";
6219
+ var WRITE_INDEX = 4;
6220
+ var READ_INDEX = 8;
6221
+ module.exports = {
6222
+ WRITE_INDEX,
6223
+ READ_INDEX
6224
+ };
6225
+ }
6226
+ });
6227
+
6228
+ // ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/index.js
6229
+ var require_thread_stream = __commonJS({
6230
+ "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/index.js"(exports, module) {
6231
+ "use strict";
6232
+ var { version: version2 } = require_package2();
6233
+ var { EventEmitter } = __require("events");
6234
+ var { Worker } = __require("worker_threads");
6235
+ var { join: join2 } = __require("path");
6236
+ var { pathToFileURL } = __require("url");
6237
+ var { wait } = require_wait();
6238
+ var {
6239
+ WRITE_INDEX,
6240
+ READ_INDEX
6241
+ } = require_indexes();
6242
+ var buffer = __require("buffer");
6243
+ var assert2 = __require("assert");
6244
+ var kImpl = /* @__PURE__ */ Symbol("kImpl");
6245
+ var MAX_STRING = buffer.constants.MAX_STRING_LENGTH;
6246
+ var FakeWeakRef = class {
6247
+ constructor(value) {
6248
+ this._value = value;
6249
+ }
6250
+ deref() {
6251
+ return this._value;
6252
+ }
6253
+ };
6254
+ var FakeFinalizationRegistry = class {
6255
+ register() {
6256
+ }
6257
+ unregister() {
6258
+ }
6259
+ };
6260
+ var FinalizationRegistry2 = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry;
6261
+ var WeakRef2 = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef;
6262
+ var registry2 = new FinalizationRegistry2((worker) => {
6263
+ if (worker.exited) {
6264
+ return;
6265
+ }
6266
+ worker.terminate();
6267
+ });
6268
+ function createWorker(stream, opts) {
6269
+ const { filename, workerData } = opts;
6270
+ const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
6271
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join2(__bundled_dirname, "lib", "worker.js");
6272
+ const worker = new Worker(toExecute, {
6273
+ ...opts.workerOpts,
6274
+ trackUnmanagedFds: false,
6275
+ workerData: {
6276
+ filename: filename.indexOf("file://") === 0 ? filename : pathToFileURL(filename).href,
6277
+ dataBuf: stream[kImpl].dataBuf,
6278
+ stateBuf: stream[kImpl].stateBuf,
6279
+ workerData: {
6280
+ $context: {
6281
+ threadStreamVersion: version2
6282
+ },
6283
+ ...workerData
6284
+ }
6285
+ }
6286
+ });
6287
+ worker.stream = new FakeWeakRef(stream);
6288
+ worker.on("message", onWorkerMessage);
6289
+ worker.on("exit", onWorkerExit);
6290
+ registry2.register(stream, worker);
6291
+ return worker;
6292
+ }
6293
+ function drain(stream) {
6294
+ assert2(!stream[kImpl].sync);
6295
+ if (stream[kImpl].needDrain) {
6296
+ stream[kImpl].needDrain = false;
6297
+ stream.emit("drain");
6298
+ }
6299
+ }
6300
+ function nextFlush(stream) {
6301
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
6302
+ let leftover = stream[kImpl].data.length - writeIndex;
6303
+ if (leftover > 0) {
6304
+ if (stream[kImpl].buf.length === 0) {
6305
+ stream[kImpl].flushing = false;
6306
+ if (stream[kImpl].ending) {
6307
+ end(stream);
6308
+ } else if (stream[kImpl].needDrain) {
6309
+ process.nextTick(drain, stream);
6310
+ }
6311
+ return;
6312
+ }
6313
+ let toWrite = stream[kImpl].buf.slice(0, leftover);
6314
+ let toWriteBytes = Buffer.byteLength(toWrite);
6315
+ if (toWriteBytes <= leftover) {
6316
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
6317
+ write(stream, toWrite, nextFlush.bind(null, stream));
6318
+ } else {
6319
+ stream.flush(() => {
6320
+ if (stream.destroyed) {
6321
+ return;
6322
+ }
6323
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
6324
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
6325
+ Atomics.notify(stream[kImpl].state, READ_INDEX);
6326
+ while (toWriteBytes > stream[kImpl].data.length) {
6327
+ leftover = leftover / 2;
6328
+ toWrite = stream[kImpl].buf.slice(0, leftover);
6329
+ toWriteBytes = Buffer.byteLength(toWrite);
6330
+ }
6331
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
6332
+ write(stream, toWrite, nextFlush.bind(null, stream));
6333
+ });
6334
+ }
6335
+ } else if (leftover === 0) {
6336
+ if (writeIndex === 0 && stream[kImpl].buf.length === 0) {
6337
+ return;
6338
+ }
6339
+ stream.flush(() => {
6340
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
6341
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
6342
+ Atomics.notify(stream[kImpl].state, READ_INDEX);
6343
+ nextFlush(stream);
6344
+ });
6345
+ } else {
6346
+ destroy(stream, new Error("overwritten"));
6347
+ }
6348
+ }
6349
+ function onWorkerMessage(msg) {
6350
+ const stream = this.stream.deref();
6351
+ if (stream === void 0) {
6352
+ this.exited = true;
6353
+ this.terminate();
6354
+ return;
6355
+ }
6356
+ switch (msg.code) {
6357
+ case "READY":
6358
+ this.stream = new WeakRef2(stream);
6359
+ stream.flush(() => {
6360
+ stream[kImpl].ready = true;
6361
+ stream.emit("ready");
6362
+ });
6363
+ break;
6364
+ case "ERROR":
6365
+ destroy(stream, msg.err);
6366
+ break;
6367
+ case "EVENT":
6368
+ if (Array.isArray(msg.args)) {
6369
+ stream.emit(msg.name, ...msg.args);
6370
+ } else {
6371
+ stream.emit(msg.name, msg.args);
6372
+ }
6373
+ break;
6374
+ case "WARNING":
6375
+ process.emitWarning(msg.err);
6376
+ break;
6377
+ default:
6378
+ destroy(stream, new Error("this should not happen: " + msg.code));
6379
+ }
6380
+ }
6381
+ function onWorkerExit(code) {
6382
+ const stream = this.stream.deref();
6383
+ if (stream === void 0) {
6384
+ return;
6385
+ }
6386
+ registry2.unregister(stream);
6387
+ stream.worker.exited = true;
6388
+ stream.worker.off("exit", onWorkerExit);
6389
+ destroy(stream, code !== 0 ? new Error("the worker thread exited") : null);
6390
+ }
6391
+ var ThreadStream = class extends EventEmitter {
6392
+ constructor(opts = {}) {
6393
+ super();
6394
+ if (opts.bufferSize < 4) {
6395
+ throw new Error("bufferSize must at least fit a 4-byte utf-8 char");
6396
+ }
6397
+ this[kImpl] = {};
6398
+ this[kImpl].stateBuf = new SharedArrayBuffer(128);
6399
+ this[kImpl].state = new Int32Array(this[kImpl].stateBuf);
6400
+ this[kImpl].dataBuf = new SharedArrayBuffer(opts.bufferSize || 4 * 1024 * 1024);
6401
+ this[kImpl].data = Buffer.from(this[kImpl].dataBuf);
6402
+ this[kImpl].sync = opts.sync || false;
6403
+ this[kImpl].ending = false;
6404
+ this[kImpl].ended = false;
6405
+ this[kImpl].needDrain = false;
6406
+ this[kImpl].destroyed = false;
6407
+ this[kImpl].flushing = false;
6408
+ this[kImpl].ready = false;
6409
+ this[kImpl].finished = false;
6410
+ this[kImpl].errored = null;
6411
+ this[kImpl].closed = false;
6412
+ this[kImpl].buf = "";
6413
+ this.worker = createWorker(this, opts);
6414
+ this.on("message", (message, transferList) => {
6415
+ this.worker.postMessage(message, transferList);
6416
+ });
6417
+ }
6418
+ write(data) {
6419
+ if (this[kImpl].destroyed) {
6420
+ error49(this, new Error("the worker has exited"));
6421
+ return false;
6422
+ }
6423
+ if (this[kImpl].ending) {
6424
+ error49(this, new Error("the worker is ending"));
6425
+ return false;
6426
+ }
6427
+ if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) {
6428
+ try {
6429
+ writeSync(this);
6430
+ this[kImpl].flushing = true;
6431
+ } catch (err) {
6432
+ destroy(this, err);
6433
+ return false;
6434
+ }
6435
+ }
6436
+ this[kImpl].buf += data;
6437
+ if (this[kImpl].sync) {
6438
+ try {
6439
+ writeSync(this);
6440
+ return true;
6441
+ } catch (err) {
6442
+ destroy(this, err);
6443
+ return false;
6444
+ }
6445
+ }
6446
+ if (!this[kImpl].flushing) {
6447
+ this[kImpl].flushing = true;
6448
+ setImmediate(nextFlush, this);
6449
+ }
6450
+ this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
6451
+ return !this[kImpl].needDrain;
6452
+ }
6453
+ end() {
6454
+ if (this[kImpl].destroyed) {
6455
+ return;
6456
+ }
6457
+ this[kImpl].ending = true;
6458
+ end(this);
6459
+ }
6460
+ flush(cb) {
6461
+ if (this[kImpl].destroyed) {
6462
+ if (typeof cb === "function") {
6463
+ process.nextTick(cb, new Error("the worker has exited"));
6464
+ }
6465
+ return;
6466
+ }
6467
+ const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
6468
+ wait(this[kImpl].state, READ_INDEX, writeIndex, Infinity, (err, res) => {
6469
+ if (err) {
6470
+ destroy(this, err);
6471
+ process.nextTick(cb, err);
6472
+ return;
6473
+ }
6474
+ if (res === "not-equal") {
6475
+ this.flush(cb);
6476
+ return;
6477
+ }
6478
+ process.nextTick(cb);
6479
+ });
6480
+ }
6481
+ flushSync() {
6482
+ if (this[kImpl].destroyed) {
6483
+ return;
6484
+ }
6485
+ writeSync(this);
6486
+ flushSync(this);
6487
+ }
6488
+ unref() {
6489
+ this.worker.unref();
6490
+ }
6491
+ ref() {
6492
+ this.worker.ref();
6493
+ }
6494
+ get ready() {
6495
+ return this[kImpl].ready;
6496
+ }
6497
+ get destroyed() {
6498
+ return this[kImpl].destroyed;
6499
+ }
6500
+ get closed() {
6501
+ return this[kImpl].closed;
6502
+ }
6503
+ get writable() {
6504
+ return !this[kImpl].destroyed && !this[kImpl].ending;
6505
+ }
6506
+ get writableEnded() {
6507
+ return this[kImpl].ending;
6508
+ }
6509
+ get writableFinished() {
6510
+ return this[kImpl].finished;
6511
+ }
6512
+ get writableNeedDrain() {
6513
+ return this[kImpl].needDrain;
6514
+ }
6515
+ get writableObjectMode() {
6516
+ return false;
6517
+ }
6518
+ get writableErrored() {
6519
+ return this[kImpl].errored;
6520
+ }
6521
+ };
6522
+ function error49(stream, err) {
6523
+ setImmediate(() => {
6524
+ stream.emit("error", err);
6525
+ });
6526
+ }
6527
+ function destroy(stream, err) {
6528
+ if (stream[kImpl].destroyed) {
6529
+ return;
6530
+ }
6531
+ stream[kImpl].destroyed = true;
6532
+ if (err) {
6533
+ stream[kImpl].errored = err;
6534
+ error49(stream, err);
6535
+ }
6536
+ if (!stream.worker.exited) {
6537
+ stream.worker.terminate().catch(() => {
6538
+ }).then(() => {
6539
+ stream[kImpl].closed = true;
6540
+ stream.emit("close");
6541
+ });
6542
+ } else {
6543
+ setImmediate(() => {
6544
+ stream[kImpl].closed = true;
6545
+ stream.emit("close");
6546
+ });
6547
+ }
6548
+ }
6549
+ function write(stream, data, cb) {
6550
+ const current = Atomics.load(stream[kImpl].state, WRITE_INDEX);
6551
+ const length = Buffer.byteLength(data);
6552
+ stream[kImpl].data.write(data, current);
6553
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length);
6554
+ Atomics.notify(stream[kImpl].state, WRITE_INDEX);
6555
+ cb();
6556
+ return true;
6557
+ }
6558
+ function end(stream) {
6559
+ if (stream[kImpl].ended || !stream[kImpl].ending || stream[kImpl].flushing) {
6560
+ return;
6561
+ }
6562
+ stream[kImpl].ended = true;
6563
+ try {
6564
+ stream.flushSync();
6565
+ let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
6566
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
6567
+ Atomics.notify(stream[kImpl].state, WRITE_INDEX);
6568
+ let spins = 0;
6569
+ while (readIndex !== -1) {
6570
+ Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1e3);
6571
+ readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
6572
+ if (readIndex === -2) {
6573
+ destroy(stream, new Error("end() failed"));
6574
+ return;
6575
+ }
6576
+ if (++spins === 10) {
6577
+ destroy(stream, new Error("end() took too long (10s)"));
6578
+ return;
6579
+ }
6580
+ }
6581
+ process.nextTick(() => {
6582
+ stream[kImpl].finished = true;
6583
+ stream.emit("finish");
6584
+ });
6585
+ } catch (err) {
6586
+ destroy(stream, err);
6587
+ }
6588
+ }
6589
+ function writeSync(stream) {
6590
+ const cb = () => {
6591
+ if (stream[kImpl].ending) {
6592
+ end(stream);
6593
+ } else if (stream[kImpl].needDrain) {
6594
+ process.nextTick(drain, stream);
6595
+ }
6596
+ };
6597
+ stream[kImpl].flushing = false;
6598
+ while (stream[kImpl].buf.length !== 0) {
6599
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
6600
+ let leftover = stream[kImpl].data.length - writeIndex;
6601
+ if (leftover === 0) {
6602
+ flushSync(stream);
6603
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
6604
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
6605
+ Atomics.notify(stream[kImpl].state, READ_INDEX);
6606
+ continue;
6607
+ } else if (leftover < 0) {
6608
+ throw new Error("overwritten");
6609
+ }
6610
+ let toWrite = stream[kImpl].buf.slice(0, leftover);
6611
+ let toWriteBytes = Buffer.byteLength(toWrite);
6612
+ if (toWriteBytes <= leftover) {
6613
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
6614
+ write(stream, toWrite, cb);
6615
+ } else {
6616
+ flushSync(stream);
6617
+ Atomics.store(stream[kImpl].state, READ_INDEX, 0);
6618
+ Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
6619
+ Atomics.notify(stream[kImpl].state, READ_INDEX);
6620
+ while (toWriteBytes > stream[kImpl].buf.length) {
6621
+ leftover = leftover / 2;
6622
+ toWrite = stream[kImpl].buf.slice(0, leftover);
6623
+ toWriteBytes = Buffer.byteLength(toWrite);
6624
+ }
6625
+ stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
6626
+ write(stream, toWrite, cb);
6627
+ }
6628
+ }
6629
+ }
6630
+ function flushSync(stream) {
6631
+ if (stream[kImpl].flushing) {
6632
+ throw new Error("unable to flush while flushing");
6633
+ }
6634
+ const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
6635
+ let spins = 0;
6636
+ while (true) {
6637
+ const readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
6638
+ if (readIndex === -2) {
6639
+ throw Error("_flushSync failed");
6640
+ }
6641
+ if (readIndex !== writeIndex) {
6642
+ Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1e3);
6643
+ } else {
6644
+ break;
6645
+ }
6646
+ if (++spins === 10) {
6647
+ throw new Error("_flushSync took too long (10s)");
6648
+ }
6649
+ }
6650
+ }
6651
+ module.exports = ThreadStream;
6652
+ }
6653
+ });
6654
+
6655
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/transport.js
6656
+ var require_transport = __commonJS({
6657
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/transport.js"(exports, module) {
6658
+ "use strict";
6659
+ var { createRequire } = __require("module");
6660
+ var { existsSync: existsSync3 } = __require("node:fs");
6661
+ var getCallers = require_caller();
6662
+ var { join: join2, isAbsolute, sep } = __require("node:path");
6663
+ var { fileURLToPath: fileURLToPath3 } = __require("node:url");
6664
+ var sleep3 = require_atomic_sleep();
6665
+ var onExit2 = require_on_exit_leak_free();
6666
+ var ThreadStream = require_thread_stream();
6667
+ function setupOnExit(stream) {
6668
+ onExit2.register(stream, autoEnd);
6669
+ onExit2.registerBeforeExit(stream, flush);
6670
+ stream.on("close", function() {
6671
+ onExit2.unregister(stream);
6672
+ });
6673
+ }
6674
+ function hasPreloadFlags() {
6675
+ const execArgv = process.execArgv;
6676
+ for (let i = 0; i < execArgv.length; i++) {
6677
+ const arg = execArgv[i];
6678
+ if (arg === "--import" || arg === "--require" || arg === "-r") {
6679
+ return true;
6680
+ }
6681
+ if (arg.startsWith("--import=") || arg.startsWith("--require=") || arg.startsWith("-r=")) {
6682
+ return true;
6683
+ }
6684
+ }
6685
+ return false;
6686
+ }
6687
+ function sanitizeNodeOptions(nodeOptions) {
6688
+ const tokens = nodeOptions.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);
6689
+ if (!tokens) {
6690
+ return nodeOptions;
6691
+ }
6692
+ const sanitized = [];
6693
+ let changed = false;
6694
+ for (let i = 0; i < tokens.length; i++) {
6695
+ const token = tokens[i];
6696
+ if (token === "--require" || token === "-r" || token === "--import") {
6697
+ const next = tokens[i + 1];
6698
+ if (next && shouldDropPreload(next)) {
6699
+ changed = true;
6700
+ i++;
6701
+ continue;
6702
+ }
6703
+ sanitized.push(token);
6704
+ if (next) {
6705
+ sanitized.push(next);
6706
+ i++;
6707
+ }
6708
+ continue;
6709
+ }
6710
+ if (token.startsWith("--require=") || token.startsWith("-r=") || token.startsWith("--import=")) {
6711
+ const value = token.slice(token.indexOf("=") + 1);
6712
+ if (shouldDropPreload(value)) {
6713
+ changed = true;
6714
+ continue;
6715
+ }
6716
+ }
6717
+ sanitized.push(token);
6718
+ }
6719
+ return changed ? sanitized.join(" ") : nodeOptions;
6720
+ }
6721
+ function shouldDropPreload(value) {
6722
+ const unquoted = stripQuotes(value);
6723
+ if (!unquoted) {
6724
+ return false;
6725
+ }
6726
+ let path4 = unquoted;
6727
+ if (path4.startsWith("file://")) {
6728
+ try {
6729
+ path4 = fileURLToPath3(path4);
6730
+ } catch {
6731
+ return false;
6732
+ }
6733
+ }
6734
+ return isAbsolute(path4) && !existsSync3(path4);
6735
+ }
6736
+ function stripQuotes(value) {
6737
+ const first = value[0];
6738
+ const last = value[value.length - 1];
6739
+ if (first === '"' && last === '"' || first === "'" && last === "'") {
6740
+ return value.slice(1, -1);
6741
+ }
6742
+ return value;
6743
+ }
6744
+ function buildStream(filename, workerData, workerOpts, sync, name) {
6745
+ if (!workerOpts.execArgv && hasPreloadFlags() && __require.main === void 0) {
6746
+ workerOpts = {
6747
+ ...workerOpts,
6748
+ execArgv: []
6749
+ };
6750
+ }
6751
+ if (!workerOpts.env && process.env.NODE_OPTIONS) {
6752
+ const nodeOptions = sanitizeNodeOptions(process.env.NODE_OPTIONS);
6753
+ if (nodeOptions !== process.env.NODE_OPTIONS) {
6754
+ workerOpts = {
6755
+ ...workerOpts,
6756
+ env: {
6757
+ ...process.env,
6758
+ NODE_OPTIONS: nodeOptions
6759
+ }
6760
+ };
6761
+ }
6762
+ }
6763
+ workerOpts = { ...workerOpts, name };
6764
+ const stream = new ThreadStream({
6765
+ filename,
6766
+ workerData,
6767
+ workerOpts,
6768
+ sync
6769
+ });
6770
+ stream.on("ready", onReady);
6771
+ stream.on("close", function() {
6772
+ process.removeListener("exit", onExit3);
6773
+ });
6774
+ process.on("exit", onExit3);
6775
+ function onReady() {
6776
+ process.removeListener("exit", onExit3);
6777
+ stream.unref();
6778
+ if (workerOpts.autoEnd !== false) {
6779
+ setupOnExit(stream);
6780
+ }
6781
+ }
6782
+ function onExit3() {
6783
+ if (stream.closed) {
6784
+ return;
6785
+ }
6786
+ stream.flushSync();
6787
+ sleep3(100);
6788
+ stream.end();
6789
+ }
6790
+ return stream;
6791
+ }
6792
+ function autoEnd(stream) {
6793
+ stream.ref();
6794
+ stream.flushSync();
6795
+ stream.end();
6796
+ stream.once("close", function() {
6797
+ stream.unref();
6798
+ });
6799
+ }
6800
+ function flush(stream) {
6801
+ stream.flushSync();
6802
+ }
6803
+ function transport(fullOptions) {
6804
+ const { pipeline, targets, levels, dedupe, worker = {}, caller = getCallers(), sync = false } = fullOptions;
6805
+ const options = {
6806
+ ...fullOptions.options
6807
+ };
6808
+ const callers = typeof caller === "string" ? [caller] : caller;
6809
+ const bundlerOverrides = typeof globalThis === "object" && Object.prototype.hasOwnProperty.call(globalThis, "__bundlerPathsOverrides") && globalThis.__bundlerPathsOverrides && typeof globalThis.__bundlerPathsOverrides === "object" ? globalThis.__bundlerPathsOverrides : /* @__PURE__ */ Object.create(null);
6810
+ let target = fullOptions.target;
6811
+ if (target && targets) {
6812
+ throw new Error("only one of target or targets can be specified");
6813
+ }
6814
+ if (targets) {
6815
+ target = bundlerOverrides["pino-worker"] || join2(__bundled_dirname, "worker.js");
6816
+ options.targets = targets.filter((dest) => dest.target).map((dest) => {
6817
+ return {
6818
+ ...dest,
6819
+ target: fixTarget(dest.target)
6820
+ };
6821
+ });
6822
+ options.pipelines = targets.filter((dest) => dest.pipeline).map((dest) => {
6823
+ return dest.pipeline.map((t) => {
6824
+ return {
6825
+ ...t,
6826
+ level: dest.level,
6827
+ // duplicate the pipeline `level` property defined in the upper level
6828
+ target: fixTarget(t.target)
6829
+ };
6830
+ });
6831
+ });
6832
+ } else if (pipeline) {
6833
+ target = bundlerOverrides["pino-worker"] || join2(__bundled_dirname, "worker.js");
6834
+ options.pipelines = [pipeline.map((dest) => {
6835
+ return {
6836
+ ...dest,
6837
+ target: fixTarget(dest.target)
6838
+ };
6839
+ })];
6840
+ }
6841
+ if (levels) {
6842
+ options.levels = levels;
6843
+ }
6844
+ if (dedupe) {
6845
+ options.dedupe = dedupe;
6846
+ }
6847
+ options.pinoWillSendConfig = true;
6848
+ const name = targets || pipeline ? "pino.transport" : target;
6849
+ return buildStream(fixTarget(target), options, worker, sync, name);
6850
+ function fixTarget(origin) {
6851
+ origin = bundlerOverrides[origin] || origin;
6852
+ if (isAbsolute(origin) || origin.indexOf("file://") === 0) {
6853
+ return origin;
6854
+ }
6855
+ if (origin === "pino/file") {
6856
+ return join2(__bundled_dirname, "..", "file.js");
6857
+ }
6858
+ let fixTarget2;
6859
+ for (const filePath of callers) {
6860
+ try {
6861
+ const context = filePath === "node:repl" ? process.cwd() + sep : filePath;
6862
+ fixTarget2 = createRequire(context).resolve(origin);
6863
+ break;
6864
+ } catch (err) {
6865
+ continue;
6866
+ }
6867
+ }
6868
+ if (!fixTarget2) {
6869
+ throw new Error(`unable to determine transport target for "${origin}"`);
6870
+ }
6871
+ return fixTarget2;
6872
+ }
6873
+ }
6874
+ module.exports = transport;
6875
+ }
6876
+ });
6877
+
6878
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/tools.js
6879
+ var require_tools = __commonJS({
6880
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/tools.js"(exports, module) {
6881
+ "use strict";
6882
+ var diagChan = __require("node:diagnostics_channel");
6883
+ var format2 = require_quick_format_unescaped();
6884
+ var { mapHttpRequest, mapHttpResponse } = require_pino_std_serializers();
6885
+ var SonicBoom = require_sonic_boom();
6886
+ var onExit2 = require_on_exit_leak_free();
6887
+ var {
6888
+ lsCacheSym,
6889
+ chindingsSym,
6890
+ writeSym,
6891
+ serializersSym,
6892
+ formatOptsSym,
6893
+ endSym,
6894
+ stringifiersSym,
6895
+ stringifySym,
6896
+ stringifySafeSym,
6897
+ wildcardFirstSym,
6898
+ nestedKeySym,
6899
+ formattersSym,
6900
+ messageKeySym,
6901
+ errorKeySym,
6902
+ nestedKeyStrSym,
6903
+ msgPrefixSym
6904
+ } = require_symbols();
6905
+ var { isMainThread } = __require("worker_threads");
6906
+ var transport = require_transport();
6907
+ var [nodeMajor] = process.versions.node.split(".").map((v) => Number(v));
6908
+ var asJsonChan = diagChan.tracingChannel("pino_asJson");
6909
+ var asString = nodeMajor >= 25 ? (str2) => JSON.stringify(str2) : _asString;
6910
+ function noop2() {
6911
+ }
6912
+ function genLog(level, hook) {
6913
+ if (!hook) return LOG;
6914
+ return function hookWrappedLog(...args) {
6915
+ hook.call(this, args, LOG, level);
6916
+ };
6917
+ function LOG(o, ...n) {
6918
+ if (typeof o === "object") {
6919
+ let msg = o;
6920
+ if (o !== null) {
6921
+ if (o.method && o.headers && o.socket) {
6922
+ o = mapHttpRequest(o);
6923
+ } else if (typeof o.setHeader === "function") {
6924
+ o = mapHttpResponse(o);
6925
+ }
6926
+ }
6927
+ let formatParams;
6928
+ if (msg === null && n.length === 0) {
6929
+ formatParams = [null];
6930
+ } else {
6931
+ msg = n.shift();
6932
+ formatParams = n;
6933
+ }
6934
+ if (typeof this[msgPrefixSym] === "string" && msg !== void 0 && msg !== null) {
6935
+ msg = this[msgPrefixSym] + msg;
6936
+ }
6937
+ this[writeSym](o, format2(msg, formatParams, this[formatOptsSym]), level);
6938
+ } else {
6939
+ let msg = o === void 0 ? n.shift() : o;
6940
+ if (typeof this[msgPrefixSym] === "string" && msg !== void 0 && msg !== null) {
6941
+ msg = this[msgPrefixSym] + msg;
6942
+ }
6943
+ this[writeSym](null, format2(msg, n, this[formatOptsSym]), level);
6944
+ }
6945
+ }
6946
+ }
6947
+ function _asString(str2) {
6948
+ let result = "";
6949
+ let last = 0;
6950
+ let found = false;
6951
+ let point = 255;
6952
+ const l = str2.length;
6953
+ if (l > 100) {
6954
+ return JSON.stringify(str2);
6955
+ }
6956
+ for (var i = 0; i < l && point >= 32; i++) {
6957
+ point = str2.charCodeAt(i);
6958
+ if (point === 34 || point === 92) {
6959
+ result += str2.slice(last, i) + "\\";
6960
+ last = i;
6961
+ found = true;
6962
+ }
6963
+ }
6964
+ if (!found) {
6965
+ result = str2;
6966
+ } else {
6967
+ result += str2.slice(last);
6968
+ }
6969
+ return point < 32 ? JSON.stringify(str2) : '"' + result + '"';
6970
+ }
6971
+ function asJson(obj, msg, num, time3) {
6972
+ if (asJsonChan.hasSubscribers === false) {
6973
+ return _asJson.call(this, obj, msg, num, time3);
6974
+ }
6975
+ const store = { instance: this, arguments };
6976
+ return asJsonChan.traceSync(_asJson, store, this, obj, msg, num, time3);
6977
+ }
6978
+ function _asJson(obj, msg, num, time3) {
6979
+ const stringify3 = this[stringifySym];
6980
+ const stringifySafe = this[stringifySafeSym];
6981
+ const stringifiers = this[stringifiersSym];
6982
+ const end = this[endSym];
6983
+ const chindings = this[chindingsSym];
6984
+ const serializers = this[serializersSym];
6985
+ const formatters2 = this[formattersSym];
6986
+ const messageKey = this[messageKeySym];
6987
+ const errorKey = this[errorKeySym];
6988
+ let data = this[lsCacheSym][num] + time3;
6989
+ data = data + chindings;
6990
+ let value;
6991
+ if (formatters2.log) {
6992
+ obj = formatters2.log(obj);
6993
+ }
6994
+ const wildcardStringifier = stringifiers[wildcardFirstSym];
6995
+ let propStr = "";
6996
+ for (const key in obj) {
6997
+ value = obj[key];
6998
+ if (Object.prototype.hasOwnProperty.call(obj, key) && value !== void 0) {
6999
+ if (serializers[key]) {
7000
+ value = serializers[key](value);
7001
+ } else if (key === errorKey && serializers.err) {
7002
+ value = serializers.err(value);
7003
+ }
7004
+ const stringifier = stringifiers[key] || wildcardStringifier;
7005
+ switch (typeof value) {
7006
+ case "undefined":
7007
+ case "function":
7008
+ continue;
7009
+ case "number":
7010
+ if (Number.isFinite(value) === false) {
7011
+ value = null;
7012
+ }
7013
+ // this case explicitly falls through to the next one
7014
+ case "boolean":
7015
+ if (stringifier) value = stringifier(value);
7016
+ break;
7017
+ case "string":
7018
+ value = (stringifier || asString)(value);
7019
+ break;
7020
+ default:
7021
+ value = (stringifier || stringify3)(value, stringifySafe);
7022
+ }
7023
+ if (value === void 0) continue;
7024
+ const strKey = asString(key);
7025
+ propStr += "," + strKey + ":" + value;
7026
+ }
7027
+ }
7028
+ let msgStr = "";
7029
+ if (msg !== void 0) {
7030
+ value = serializers[messageKey] ? serializers[messageKey](msg) : msg;
7031
+ const stringifier = stringifiers[messageKey] || wildcardStringifier;
7032
+ switch (typeof value) {
7033
+ case "function":
7034
+ break;
7035
+ case "number":
7036
+ if (Number.isFinite(value) === false) {
7037
+ value = null;
7038
+ }
7039
+ // this case explicitly falls through to the next one
7040
+ case "boolean":
7041
+ if (stringifier) value = stringifier(value);
7042
+ msgStr = ',"' + messageKey + '":' + value;
7043
+ break;
7044
+ case "string":
7045
+ value = (stringifier || asString)(value);
7046
+ msgStr = ',"' + messageKey + '":' + value;
7047
+ break;
7048
+ default:
7049
+ value = (stringifier || stringify3)(value, stringifySafe);
7050
+ msgStr = ',"' + messageKey + '":' + value;
7051
+ }
7052
+ }
7053
+ if (this[nestedKeySym] && propStr) {
7054
+ return data + this[nestedKeyStrSym] + propStr.slice(1) + "}" + msgStr + end;
7055
+ } else {
7056
+ return data + propStr + msgStr + end;
7057
+ }
7058
+ }
7059
+ function asChindings(instance, bindings) {
7060
+ let value;
7061
+ let data = instance[chindingsSym];
7062
+ const stringify3 = instance[stringifySym];
7063
+ const stringifySafe = instance[stringifySafeSym];
7064
+ const stringifiers = instance[stringifiersSym];
7065
+ const wildcardStringifier = stringifiers[wildcardFirstSym];
7066
+ const serializers = instance[serializersSym];
7067
+ const formatter = instance[formattersSym].bindings;
7068
+ bindings = formatter(bindings);
7069
+ for (const key in bindings) {
7070
+ value = bindings[key];
7071
+ const valid = (key.length < 5 || key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels") && bindings.hasOwnProperty(key) && value !== void 0;
7072
+ if (valid === true) {
7073
+ value = serializers[key] ? serializers[key](value) : value;
7074
+ value = (stringifiers[key] || wildcardStringifier || stringify3)(value, stringifySafe);
7075
+ if (value === void 0) continue;
7076
+ data += ',"' + key + '":' + value;
7077
+ }
7078
+ }
7079
+ return data;
7080
+ }
7081
+ function hasBeenTampered(stream) {
7082
+ return stream.write !== stream.constructor.prototype.write;
7083
+ }
7084
+ function buildSafeSonicBoom(opts) {
7085
+ const stream = new SonicBoom(opts);
7086
+ stream.on("error", filterBrokenPipe);
7087
+ if (!opts.sync && isMainThread) {
7088
+ onExit2.register(stream, autoEnd);
7089
+ stream.on("close", function() {
7090
+ onExit2.unregister(stream);
7091
+ });
7092
+ }
7093
+ return stream;
7094
+ function filterBrokenPipe(err) {
7095
+ if (err.code === "EPIPE") {
7096
+ stream.write = noop2;
7097
+ stream.end = noop2;
7098
+ stream.flushSync = noop2;
7099
+ stream.destroy = noop2;
7100
+ return;
7101
+ }
7102
+ stream.removeListener("error", filterBrokenPipe);
7103
+ stream.emit("error", err);
7104
+ }
7105
+ }
7106
+ function autoEnd(stream, eventName) {
7107
+ if (stream.destroyed) {
7108
+ return;
7109
+ }
7110
+ if (eventName === "beforeExit") {
7111
+ stream.flush();
7112
+ stream.on("drain", function() {
7113
+ stream.end();
7114
+ });
7115
+ } else {
7116
+ stream.flushSync();
7117
+ }
7118
+ }
7119
+ function createArgsNormalizer(defaultOptions) {
7120
+ return function normalizeArgs(instance, caller, opts = {}, stream) {
7121
+ if (typeof opts === "string") {
7122
+ stream = buildSafeSonicBoom({ dest: opts });
7123
+ opts = {};
7124
+ } else if (typeof stream === "string") {
7125
+ if (opts && opts.transport) {
7126
+ throw Error("only one of option.transport or stream can be specified");
7127
+ }
7128
+ stream = buildSafeSonicBoom({ dest: stream });
7129
+ } else if (opts instanceof SonicBoom || opts.writable || opts._writableState) {
7130
+ stream = opts;
7131
+ opts = {};
7132
+ } else if (opts.transport) {
7133
+ if (opts.transport instanceof SonicBoom || opts.transport.writable || opts.transport._writableState) {
7134
+ throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");
7135
+ }
7136
+ if (opts.transport.targets && opts.transport.targets.length && opts.formatters && typeof opts.formatters.level === "function") {
7137
+ throw Error("option.transport.targets do not allow custom level formatters");
7138
+ }
7139
+ let customLevels;
7140
+ if (opts.customLevels) {
7141
+ customLevels = opts.useOnlyCustomLevels ? opts.customLevels : Object.assign({}, opts.levels, opts.customLevels);
7142
+ }
7143
+ stream = transport({ caller, ...opts.transport, levels: customLevels });
7144
+ }
7145
+ opts = Object.assign({}, defaultOptions, opts);
7146
+ opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers);
7147
+ opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters);
7148
+ if (opts.prettyPrint) {
7149
+ throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");
7150
+ }
7151
+ const { enabled, onChild } = opts;
7152
+ if (enabled === false) opts.level = "silent";
7153
+ if (!onChild) opts.onChild = noop2;
7154
+ if (!stream) {
7155
+ if (!hasBeenTampered(process.stdout)) {
7156
+ stream = buildSafeSonicBoom({ fd: process.stdout.fd || 1 });
7157
+ } else {
7158
+ stream = process.stdout;
7159
+ }
7160
+ }
7161
+ return { opts, stream };
7162
+ };
7163
+ }
7164
+ function stringify2(obj, stringifySafeFn) {
7165
+ try {
7166
+ return JSON.stringify(obj);
7167
+ } catch (_) {
7168
+ try {
7169
+ const stringify3 = stringifySafeFn || this[stringifySafeSym];
7170
+ return stringify3(obj);
7171
+ } catch (_2) {
7172
+ return '"[unable to serialize, circular reference is too complex to analyze]"';
7173
+ }
7174
+ }
7175
+ }
7176
+ function buildFormatters(level, bindings, log) {
7177
+ return {
7178
+ level,
7179
+ bindings,
7180
+ log
7181
+ };
7182
+ }
7183
+ function normalizeDestFileDescriptor(destination) {
7184
+ const fd = Number(destination);
7185
+ if (typeof destination === "string" && Number.isFinite(fd)) {
7186
+ return fd;
7187
+ }
7188
+ if (destination === void 0) {
7189
+ return 1;
7190
+ }
7191
+ return destination;
7192
+ }
7193
+ module.exports = {
7194
+ noop: noop2,
7195
+ buildSafeSonicBoom,
7196
+ asChindings,
7197
+ asJson,
7198
+ genLog,
7199
+ createArgsNormalizer,
7200
+ stringify: stringify2,
7201
+ buildFormatters,
7202
+ normalizeDestFileDescriptor
7203
+ };
7204
+ }
7205
+ });
7206
+
7207
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/constants.js
7208
+ var require_constants = __commonJS({
7209
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/constants.js"(exports, module) {
7210
+ var DEFAULT_LEVELS = {
7211
+ trace: 10,
7212
+ debug: 20,
7213
+ info: 30,
7214
+ warn: 40,
7215
+ error: 50,
7216
+ fatal: 60
7217
+ };
7218
+ var SORTING_ORDER = {
7219
+ ASC: "ASC",
7220
+ DESC: "DESC"
7221
+ };
7222
+ module.exports = {
7223
+ DEFAULT_LEVELS,
7224
+ SORTING_ORDER
7225
+ };
7226
+ }
7227
+ });
7228
+
7229
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/levels.js
7230
+ var require_levels = __commonJS({
7231
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/levels.js"(exports, module) {
7232
+ "use strict";
7233
+ var {
7234
+ lsCacheSym,
7235
+ levelValSym,
7236
+ useOnlyCustomLevelsSym,
7237
+ streamSym,
7238
+ formattersSym,
7239
+ hooksSym,
7240
+ levelCompSym
7241
+ } = require_symbols();
7242
+ var { noop: noop2, genLog } = require_tools();
7243
+ var { DEFAULT_LEVELS, SORTING_ORDER } = require_constants();
7244
+ var levelMethods = {
7245
+ fatal: (hook) => {
7246
+ const logFatal = genLog(DEFAULT_LEVELS.fatal, hook);
7247
+ return function(...args) {
7248
+ const stream = this[streamSym];
7249
+ logFatal.call(this, ...args);
7250
+ if (typeof stream.flushSync === "function") {
7251
+ try {
7252
+ stream.flushSync();
7253
+ } catch (e) {
7254
+ }
7255
+ }
7256
+ };
7257
+ },
7258
+ error: (hook) => genLog(DEFAULT_LEVELS.error, hook),
7259
+ warn: (hook) => genLog(DEFAULT_LEVELS.warn, hook),
7260
+ info: (hook) => genLog(DEFAULT_LEVELS.info, hook),
7261
+ debug: (hook) => genLog(DEFAULT_LEVELS.debug, hook),
7262
+ trace: (hook) => genLog(DEFAULT_LEVELS.trace, hook)
7263
+ };
7264
+ var nums = Object.keys(DEFAULT_LEVELS).reduce((o, k) => {
7265
+ o[DEFAULT_LEVELS[k]] = k;
7266
+ return o;
7267
+ }, {});
7268
+ var initialLsCache = Object.keys(nums).reduce((o, k) => {
7269
+ o[k] = '{"level":' + Number(k);
7270
+ return o;
7271
+ }, {});
7272
+ function genLsCache(instance) {
7273
+ const formatter = instance[formattersSym].level;
7274
+ const { labels } = instance.levels;
7275
+ const cache = {};
7276
+ for (const label in labels) {
7277
+ const level = formatter(labels[label], Number(label));
7278
+ cache[label] = JSON.stringify(level).slice(0, -1);
7279
+ }
7280
+ instance[lsCacheSym] = cache;
7281
+ return instance;
7282
+ }
7283
+ function isStandardLevel(level, useOnlyCustomLevels) {
7284
+ if (useOnlyCustomLevels) {
7285
+ return false;
7286
+ }
7287
+ switch (level) {
7288
+ case "fatal":
7289
+ case "error":
7290
+ case "warn":
7291
+ case "info":
7292
+ case "debug":
7293
+ case "trace":
7294
+ return true;
7295
+ default:
7296
+ return false;
7297
+ }
7298
+ }
7299
+ function setLevel(level) {
7300
+ const { labels, values } = this.levels;
7301
+ if (typeof level === "number") {
7302
+ if (labels[level] === void 0) throw Error("unknown level value" + level);
7303
+ level = labels[level];
7304
+ }
7305
+ if (values[level] === void 0) throw Error("unknown level " + level);
7306
+ const preLevelVal = this[levelValSym];
7307
+ const levelVal = this[levelValSym] = values[level];
7308
+ const useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym];
7309
+ const levelComparison = this[levelCompSym];
7310
+ const hook = this[hooksSym].logMethod;
7311
+ for (const key in values) {
7312
+ if (levelComparison(values[key], levelVal) === false) {
7313
+ this[key] = noop2;
7314
+ continue;
7315
+ }
7316
+ this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook);
7317
+ }
7318
+ this.emit(
7319
+ "level-change",
7320
+ level,
7321
+ levelVal,
7322
+ labels[preLevelVal],
7323
+ preLevelVal,
7324
+ this
7325
+ );
7326
+ }
7327
+ function getLevel(level) {
7328
+ const { levels, levelVal } = this;
7329
+ return levels && levels.labels ? levels.labels[levelVal] : "";
7330
+ }
7331
+ function isLevelEnabled(logLevel) {
7332
+ const { values } = this.levels;
7333
+ const logLevelVal = values[logLevel];
7334
+ return logLevelVal !== void 0 && this[levelCompSym](logLevelVal, this[levelValSym]);
7335
+ }
7336
+ function compareLevel(direction, current, expected) {
7337
+ if (direction === SORTING_ORDER.DESC) {
7338
+ return current <= expected;
7339
+ }
7340
+ return current >= expected;
7341
+ }
7342
+ function genLevelComparison(levelComparison) {
7343
+ if (typeof levelComparison === "string") {
7344
+ return compareLevel.bind(null, levelComparison);
7345
+ }
7346
+ return levelComparison;
7347
+ }
7348
+ function mappings(customLevels = null, useOnlyCustomLevels = false) {
7349
+ const customNums = customLevels ? Object.keys(customLevels).reduce((o, k) => {
7350
+ o[customLevels[k]] = k;
7351
+ return o;
7352
+ }, {}) : null;
7353
+ const labels = Object.assign(
7354
+ Object.create(Object.prototype, { Infinity: { value: "silent" } }),
7355
+ useOnlyCustomLevels ? null : nums,
7356
+ customNums
7357
+ );
7358
+ const values = Object.assign(
7359
+ Object.create(Object.prototype, { silent: { value: Infinity } }),
7360
+ useOnlyCustomLevels ? null : DEFAULT_LEVELS,
7361
+ customLevels
7362
+ );
7363
+ return { labels, values };
7364
+ }
7365
+ function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) {
7366
+ if (typeof defaultLevel === "number") {
7367
+ const values = [].concat(
7368
+ Object.keys(customLevels || {}).map((key) => customLevels[key]),
7369
+ useOnlyCustomLevels ? [] : Object.keys(nums).map((level) => +level),
7370
+ Infinity
7371
+ );
7372
+ if (!values.includes(defaultLevel)) {
7373
+ throw Error(`default level:${defaultLevel} must be included in custom levels`);
7374
+ }
7375
+ return;
7376
+ }
7377
+ const labels = Object.assign(
7378
+ Object.create(Object.prototype, { silent: { value: Infinity } }),
7379
+ useOnlyCustomLevels ? null : DEFAULT_LEVELS,
7380
+ customLevels
7381
+ );
7382
+ if (!(defaultLevel in labels)) {
7383
+ throw Error(`default level:${defaultLevel} must be included in custom levels`);
7384
+ }
7385
+ }
7386
+ function assertNoLevelCollisions(levels, customLevels) {
7387
+ const { labels, values } = levels;
7388
+ for (const k in customLevels) {
7389
+ if (k in values) {
7390
+ throw Error("levels cannot be overridden");
7391
+ }
7392
+ if (customLevels[k] in labels) {
7393
+ throw Error("pre-existing level values cannot be used for new levels");
7394
+ }
7395
+ }
7396
+ }
7397
+ function assertLevelComparison(levelComparison) {
7398
+ if (typeof levelComparison === "function") {
7399
+ return;
7400
+ }
7401
+ if (typeof levelComparison === "string" && Object.values(SORTING_ORDER).includes(levelComparison)) {
7402
+ return;
7403
+ }
7404
+ throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type');
7405
+ }
7406
+ module.exports = {
7407
+ initialLsCache,
7408
+ genLsCache,
7409
+ levelMethods,
7410
+ getLevel,
7411
+ setLevel,
7412
+ isLevelEnabled,
7413
+ mappings,
7414
+ assertNoLevelCollisions,
7415
+ assertDefaultLevelFound,
7416
+ genLevelComparison,
7417
+ assertLevelComparison
7418
+ };
7419
+ }
7420
+ });
7421
+
7422
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/meta.js
7423
+ var require_meta = __commonJS({
7424
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/meta.js"(exports, module) {
7425
+ "use strict";
7426
+ module.exports = { version: "10.3.1" };
7427
+ }
7428
+ });
7429
+
7430
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/proto.js
7431
+ var require_proto = __commonJS({
7432
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/proto.js"(exports, module) {
7433
+ "use strict";
7434
+ var { EventEmitter } = __require("node:events");
7435
+ var {
7436
+ lsCacheSym,
7437
+ levelValSym,
7438
+ setLevelSym,
7439
+ getLevelSym,
7440
+ chindingsSym,
7441
+ mixinSym,
7442
+ asJsonSym,
7443
+ writeSym,
7444
+ mixinMergeStrategySym,
7445
+ timeSym,
7446
+ timeSliceIndexSym,
7447
+ streamSym,
7448
+ serializersSym,
7449
+ formattersSym,
7450
+ errorKeySym,
7451
+ messageKeySym,
7452
+ useOnlyCustomLevelsSym,
7453
+ needsMetadataGsym,
7454
+ redactFmtSym,
7455
+ stringifySym,
7456
+ formatOptsSym,
7457
+ stringifiersSym,
7458
+ msgPrefixSym,
7459
+ hooksSym
7460
+ } = require_symbols();
7461
+ var {
7462
+ getLevel,
7463
+ setLevel,
7464
+ isLevelEnabled,
7465
+ mappings,
7466
+ initialLsCache,
7467
+ genLsCache,
7468
+ assertNoLevelCollisions
7469
+ } = require_levels();
7470
+ var {
7471
+ asChindings,
7472
+ asJson,
7473
+ buildFormatters,
7474
+ stringify: stringify2,
7475
+ noop: noop2
7476
+ } = require_tools();
7477
+ var {
7478
+ version: version2
7479
+ } = require_meta();
7480
+ var redaction = require_redaction();
7481
+ var constructor = class Pino {
7482
+ };
7483
+ var prototype = {
7484
+ constructor,
7485
+ child,
7486
+ bindings,
7487
+ setBindings,
7488
+ flush,
7489
+ isLevelEnabled,
7490
+ version: version2,
7491
+ get level() {
7492
+ return this[getLevelSym]();
7493
+ },
7494
+ set level(lvl) {
7495
+ this[setLevelSym](lvl);
7496
+ },
7497
+ get levelVal() {
7498
+ return this[levelValSym];
7499
+ },
7500
+ set levelVal(n) {
7501
+ throw Error("levelVal is read-only");
7502
+ },
7503
+ get msgPrefix() {
7504
+ return this[msgPrefixSym];
7505
+ },
7506
+ get [Symbol.toStringTag]() {
7507
+ return "Pino";
7508
+ },
7509
+ [lsCacheSym]: initialLsCache,
7510
+ [writeSym]: write,
7511
+ [asJsonSym]: asJson,
7512
+ [getLevelSym]: getLevel,
7513
+ [setLevelSym]: setLevel
7514
+ };
7515
+ Object.setPrototypeOf(prototype, EventEmitter.prototype);
7516
+ module.exports = function() {
7517
+ return Object.create(prototype);
7518
+ };
7519
+ var resetChildingsFormatter = (bindings2) => bindings2;
7520
+ function child(bindings2, options) {
7521
+ if (!bindings2) {
7522
+ throw Error("missing bindings for child Pino");
7523
+ }
7524
+ const serializers = this[serializersSym];
7525
+ const formatters2 = this[formattersSym];
7526
+ const instance = Object.create(this);
7527
+ if (options == null) {
7528
+ if (instance[formattersSym].bindings !== resetChildingsFormatter) {
7529
+ instance[formattersSym] = buildFormatters(
7530
+ formatters2.level,
7531
+ resetChildingsFormatter,
7532
+ formatters2.log
7533
+ );
7534
+ }
7535
+ instance[chindingsSym] = asChindings(instance, bindings2);
7536
+ if (this.onChild !== noop2) {
7537
+ this.onChild(instance);
7538
+ }
7539
+ return instance;
7540
+ }
7541
+ if (options.hasOwnProperty("serializers") === true) {
7542
+ instance[serializersSym] = /* @__PURE__ */ Object.create(null);
7543
+ for (const k in serializers) {
7544
+ instance[serializersSym][k] = serializers[k];
7545
+ }
7546
+ const parentSymbols = Object.getOwnPropertySymbols(serializers);
7547
+ for (var i = 0; i < parentSymbols.length; i++) {
7548
+ const ks = parentSymbols[i];
7549
+ instance[serializersSym][ks] = serializers[ks];
7550
+ }
7551
+ for (const bk in options.serializers) {
7552
+ instance[serializersSym][bk] = options.serializers[bk];
7553
+ }
7554
+ const bindingsSymbols = Object.getOwnPropertySymbols(options.serializers);
7555
+ for (var bi = 0; bi < bindingsSymbols.length; bi++) {
7556
+ const bks = bindingsSymbols[bi];
7557
+ instance[serializersSym][bks] = options.serializers[bks];
7558
+ }
7559
+ } else instance[serializersSym] = serializers;
7560
+ if (options.hasOwnProperty("formatters")) {
7561
+ const { level, bindings: chindings, log } = options.formatters;
7562
+ instance[formattersSym] = buildFormatters(
7563
+ level || formatters2.level,
7564
+ chindings || resetChildingsFormatter,
7565
+ log || formatters2.log
7566
+ );
7567
+ } else {
7568
+ instance[formattersSym] = buildFormatters(
7569
+ formatters2.level,
7570
+ resetChildingsFormatter,
7571
+ formatters2.log
7572
+ );
7573
+ }
7574
+ if (options.hasOwnProperty("customLevels") === true) {
7575
+ assertNoLevelCollisions(this.levels, options.customLevels);
7576
+ instance.levels = mappings(options.customLevels, instance[useOnlyCustomLevelsSym]);
7577
+ genLsCache(instance);
7578
+ }
7579
+ if (typeof options.redact === "object" && options.redact !== null || Array.isArray(options.redact)) {
7580
+ instance.redact = options.redact;
7581
+ const stringifiers = redaction(instance.redact, stringify2);
7582
+ const formatOpts = { stringify: stringifiers[redactFmtSym] };
7583
+ instance[stringifySym] = stringify2;
7584
+ instance[stringifiersSym] = stringifiers;
7585
+ instance[formatOptsSym] = formatOpts;
7586
+ }
7587
+ if (typeof options.msgPrefix === "string") {
7588
+ instance[msgPrefixSym] = (this[msgPrefixSym] || "") + options.msgPrefix;
7589
+ }
7590
+ instance[chindingsSym] = asChindings(instance, bindings2);
7591
+ if (options.level !== void 0 && options.level !== this.level || options.hasOwnProperty("customLevels")) {
7592
+ const childLevel = options.level || this.level;
7593
+ instance[setLevelSym](childLevel);
7594
+ }
7595
+ this.onChild(instance);
7596
+ return instance;
7597
+ }
7598
+ function bindings() {
7599
+ const chindings = this[chindingsSym];
7600
+ const chindingsJson = `{${chindings.substr(1)}}`;
7601
+ const bindingsFromJson = JSON.parse(chindingsJson);
7602
+ delete bindingsFromJson.pid;
7603
+ delete bindingsFromJson.hostname;
7604
+ return bindingsFromJson;
7605
+ }
7606
+ function setBindings(newBindings) {
7607
+ const chindings = asChindings(this, newBindings);
7608
+ this[chindingsSym] = chindings;
7609
+ }
7610
+ function defaultMixinMergeStrategy(mergeObject, mixinObject) {
7611
+ return Object.assign(mixinObject, mergeObject);
7612
+ }
7613
+ function write(_obj, msg, num) {
7614
+ const t = this[timeSym]();
7615
+ const mixin = this[mixinSym];
7616
+ const errorKey = this[errorKeySym];
7617
+ const messageKey = this[messageKeySym];
7618
+ const mixinMergeStrategy = this[mixinMergeStrategySym] || defaultMixinMergeStrategy;
7619
+ let obj;
7620
+ const streamWriteHook = this[hooksSym].streamWrite;
7621
+ if (_obj === void 0 || _obj === null) {
7622
+ obj = {};
7623
+ } else if (_obj instanceof Error) {
7624
+ obj = { [errorKey]: _obj };
7625
+ if (msg === void 0) {
7626
+ msg = _obj.message;
7627
+ }
7628
+ } else {
7629
+ obj = _obj;
7630
+ if (msg === void 0 && _obj[messageKey] === void 0 && _obj[errorKey]) {
7631
+ msg = _obj[errorKey].message;
7632
+ }
7633
+ }
7634
+ if (mixin) {
7635
+ obj = mixinMergeStrategy(obj, mixin(obj, num, this));
7636
+ }
7637
+ const s = this[asJsonSym](obj, msg, num, t);
7638
+ const stream = this[streamSym];
7639
+ if (stream[needsMetadataGsym] === true) {
7640
+ stream.lastLevel = num;
7641
+ stream.lastObj = obj;
7642
+ stream.lastMsg = msg;
7643
+ stream.lastTime = t.slice(this[timeSliceIndexSym]);
7644
+ stream.lastLogger = this;
7645
+ }
7646
+ stream.write(streamWriteHook ? streamWriteHook(s) : s);
7647
+ }
7648
+ function flush(cb) {
7649
+ if (cb != null && typeof cb !== "function") {
7650
+ throw Error("callback must be a function");
7651
+ }
7652
+ const stream = this[streamSym];
7653
+ if (typeof stream.flush === "function") {
7654
+ stream.flush(cb || noop2);
7655
+ } else if (cb) cb();
7656
+ }
7657
+ }
7658
+ });
7659
+
7660
+ // ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
7661
+ var require_safe_stable_stringify = __commonJS({
7662
+ "../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
7663
+ "use strict";
7664
+ var { hasOwnProperty } = Object.prototype;
7665
+ var stringify2 = configure();
7666
+ stringify2.configure = configure;
7667
+ stringify2.stringify = stringify2;
7668
+ stringify2.default = stringify2;
7669
+ exports.stringify = stringify2;
7670
+ exports.configure = configure;
7671
+ module.exports = stringify2;
7672
+ var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;
7673
+ function strEscape(str2) {
7674
+ if (str2.length < 5e3 && !strEscapeSequencesRegExp.test(str2)) {
7675
+ return `"${str2}"`;
7676
+ }
7677
+ return JSON.stringify(str2);
7678
+ }
7679
+ function sort(array2, comparator) {
7680
+ if (array2.length > 200 || comparator) {
7681
+ return array2.sort(comparator);
7682
+ }
7683
+ for (let i = 1; i < array2.length; i++) {
7684
+ const currentValue = array2[i];
7685
+ let position = i;
7686
+ while (position !== 0 && array2[position - 1] > currentValue) {
7687
+ array2[position] = array2[position - 1];
7688
+ position--;
7689
+ }
7690
+ array2[position] = currentValue;
7691
+ }
7692
+ return array2;
7693
+ }
7694
+ var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor(
7695
+ Object.getPrototypeOf(
7696
+ Object.getPrototypeOf(
7697
+ new Int8Array()
7698
+ )
7699
+ ),
7700
+ Symbol.toStringTag
7701
+ ).get;
7702
+ function isTypedArrayWithEntries(value) {
7703
+ return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0;
7704
+ }
7705
+ function stringifyTypedArray(array2, separator, maximumBreadth) {
7706
+ if (array2.length < maximumBreadth) {
7707
+ maximumBreadth = array2.length;
7708
+ }
7709
+ const whitespace = separator === "," ? "" : " ";
7710
+ let res = `"0":${whitespace}${array2[0]}`;
7711
+ for (let i = 1; i < maximumBreadth; i++) {
7712
+ res += `${separator}"${i}":${whitespace}${array2[i]}`;
7713
+ }
7714
+ return res;
7715
+ }
7716
+ function getCircularValueOption(options) {
7717
+ if (hasOwnProperty.call(options, "circularValue")) {
7718
+ const circularValue = options.circularValue;
7719
+ if (typeof circularValue === "string") {
7720
+ return `"${circularValue}"`;
7721
+ }
7722
+ if (circularValue == null) {
7723
+ return circularValue;
7724
+ }
7725
+ if (circularValue === Error || circularValue === TypeError) {
7726
+ return {
7727
+ toString() {
7728
+ throw new TypeError("Converting circular structure to JSON");
7729
+ }
7730
+ };
7731
+ }
7732
+ throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined');
7733
+ }
7734
+ return '"[Circular]"';
7735
+ }
7736
+ function getDeterministicOption(options) {
7737
+ let value;
7738
+ if (hasOwnProperty.call(options, "deterministic")) {
7739
+ value = options.deterministic;
7740
+ if (typeof value !== "boolean" && typeof value !== "function") {
7741
+ throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
7742
+ }
7743
+ }
7744
+ return value === void 0 ? true : value;
7745
+ }
7746
+ function getBooleanOption(options, key) {
7747
+ let value;
7748
+ if (hasOwnProperty.call(options, key)) {
7749
+ value = options[key];
7750
+ if (typeof value !== "boolean") {
7751
+ throw new TypeError(`The "${key}" argument must be of type boolean`);
7752
+ }
7753
+ }
7754
+ return value === void 0 ? true : value;
7755
+ }
7756
+ function getPositiveIntegerOption(options, key) {
7757
+ let value;
7758
+ if (hasOwnProperty.call(options, key)) {
7759
+ value = options[key];
7760
+ if (typeof value !== "number") {
7761
+ throw new TypeError(`The "${key}" argument must be of type number`);
7762
+ }
7763
+ if (!Number.isInteger(value)) {
7764
+ throw new TypeError(`The "${key}" argument must be an integer`);
7765
+ }
7766
+ if (value < 1) {
7767
+ throw new RangeError(`The "${key}" argument must be >= 1`);
7768
+ }
7769
+ }
7770
+ return value === void 0 ? Infinity : value;
7771
+ }
7772
+ function getItemCount(number4) {
7773
+ if (number4 === 1) {
7774
+ return "1 item";
7775
+ }
7776
+ return `${number4} items`;
7777
+ }
7778
+ function getUniqueReplacerSet(replacerArray) {
7779
+ const replacerSet = /* @__PURE__ */ new Set();
7780
+ for (const value of replacerArray) {
7781
+ if (typeof value === "string" || typeof value === "number") {
7782
+ replacerSet.add(String(value));
7783
+ }
7784
+ }
7785
+ return replacerSet;
7786
+ }
7787
+ function getStrictOption(options) {
7788
+ if (hasOwnProperty.call(options, "strict")) {
7789
+ const value = options.strict;
7790
+ if (typeof value !== "boolean") {
7791
+ throw new TypeError('The "strict" argument must be of type boolean');
7792
+ }
7793
+ if (value) {
7794
+ return (value2) => {
7795
+ let message = `Object can not safely be stringified. Received type ${typeof value2}`;
7796
+ if (typeof value2 !== "function") message += ` (${value2.toString()})`;
7797
+ throw new Error(message);
7798
+ };
7799
+ }
7800
+ }
7801
+ }
7802
+ function configure(options) {
7803
+ options = { ...options };
7804
+ const fail = getStrictOption(options);
7805
+ if (fail) {
7806
+ if (options.bigint === void 0) {
7807
+ options.bigint = false;
7808
+ }
7809
+ if (!("circularValue" in options)) {
7810
+ options.circularValue = Error;
7811
+ }
7812
+ }
7813
+ const circularValue = getCircularValueOption(options);
7814
+ const bigint4 = getBooleanOption(options, "bigint");
7815
+ const deterministic = getDeterministicOption(options);
7816
+ const comparator = typeof deterministic === "function" ? deterministic : void 0;
7817
+ const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
7818
+ const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
7819
+ function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
7820
+ let value = parent[key];
7821
+ if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
7822
+ value = value.toJSON(key);
7823
+ }
7824
+ value = replacer.call(parent, key, value);
7825
+ switch (typeof value) {
7826
+ case "string":
7827
+ return strEscape(value);
7828
+ case "object": {
7829
+ if (value === null) {
7830
+ return "null";
7831
+ }
7832
+ if (stack.indexOf(value) !== -1) {
7833
+ return circularValue;
7834
+ }
7835
+ let res = "";
7836
+ let join2 = ",";
7837
+ const originalIndentation = indentation;
7838
+ if (Array.isArray(value)) {
7839
+ if (value.length === 0) {
7840
+ return "[]";
7841
+ }
7842
+ if (maximumDepth < stack.length + 1) {
7843
+ return '"[Array]"';
7844
+ }
7845
+ stack.push(value);
7846
+ if (spacer !== "") {
7847
+ indentation += spacer;
7848
+ res += `
7849
+ ${indentation}`;
7850
+ join2 = `,
7851
+ ${indentation}`;
7852
+ }
7853
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
7854
+ let i = 0;
7855
+ for (; i < maximumValuesToStringify - 1; i++) {
7856
+ const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
7857
+ res += tmp2 !== void 0 ? tmp2 : "null";
7858
+ res += join2;
7859
+ }
7860
+ const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
7861
+ res += tmp !== void 0 ? tmp : "null";
7862
+ if (value.length - 1 > maximumBreadth) {
7863
+ const removedKeys = value.length - maximumBreadth - 1;
7864
+ res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
7865
+ }
7866
+ if (spacer !== "") {
7867
+ res += `
7868
+ ${originalIndentation}`;
7869
+ }
7870
+ stack.pop();
7871
+ return `[${res}]`;
7872
+ }
7873
+ let keys = Object.keys(value);
7874
+ const keyLength = keys.length;
7875
+ if (keyLength === 0) {
7876
+ return "{}";
7877
+ }
7878
+ if (maximumDepth < stack.length + 1) {
7879
+ return '"[Object]"';
7880
+ }
7881
+ let whitespace = "";
7882
+ let separator = "";
7883
+ if (spacer !== "") {
7884
+ indentation += spacer;
7885
+ join2 = `,
7886
+ ${indentation}`;
7887
+ whitespace = " ";
7888
+ }
7889
+ const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
7890
+ if (deterministic && !isTypedArrayWithEntries(value)) {
7891
+ keys = sort(keys, comparator);
7892
+ }
7893
+ stack.push(value);
7894
+ for (let i = 0; i < maximumPropertiesToStringify; i++) {
7895
+ const key2 = keys[i];
7896
+ const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
7897
+ if (tmp !== void 0) {
7898
+ res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
7899
+ separator = join2;
7900
+ }
7901
+ }
7902
+ if (keyLength > maximumBreadth) {
7903
+ const removedKeys = keyLength - maximumBreadth;
7904
+ res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
7905
+ separator = join2;
7906
+ }
7907
+ if (spacer !== "" && separator.length > 1) {
7908
+ res = `
7909
+ ${indentation}${res}
7910
+ ${originalIndentation}`;
7911
+ }
7912
+ stack.pop();
7913
+ return `{${res}}`;
7914
+ }
7915
+ case "number":
7916
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
7917
+ case "boolean":
7918
+ return value === true ? "true" : "false";
7919
+ case "undefined":
7920
+ return void 0;
7921
+ case "bigint":
7922
+ if (bigint4) {
7923
+ return String(value);
7924
+ }
7925
+ // fallthrough
7926
+ default:
7927
+ return fail ? fail(value) : void 0;
7928
+ }
7929
+ }
7930
+ function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
7931
+ if (typeof value === "object" && value !== null && typeof value.toJSON === "function") {
7932
+ value = value.toJSON(key);
7933
+ }
7934
+ switch (typeof value) {
7935
+ case "string":
7936
+ return strEscape(value);
7937
+ case "object": {
7938
+ if (value === null) {
7939
+ return "null";
7940
+ }
7941
+ if (stack.indexOf(value) !== -1) {
7942
+ return circularValue;
7943
+ }
7944
+ const originalIndentation = indentation;
7945
+ let res = "";
7946
+ let join2 = ",";
7947
+ if (Array.isArray(value)) {
7948
+ if (value.length === 0) {
7949
+ return "[]";
7950
+ }
7951
+ if (maximumDepth < stack.length + 1) {
7952
+ return '"[Array]"';
7953
+ }
7954
+ stack.push(value);
7955
+ if (spacer !== "") {
7956
+ indentation += spacer;
7957
+ res += `
7958
+ ${indentation}`;
7959
+ join2 = `,
7960
+ ${indentation}`;
7961
+ }
7962
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
7963
+ let i = 0;
7964
+ for (; i < maximumValuesToStringify - 1; i++) {
7965
+ const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
7966
+ res += tmp2 !== void 0 ? tmp2 : "null";
7967
+ res += join2;
7968
+ }
7969
+ const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
7970
+ res += tmp !== void 0 ? tmp : "null";
7971
+ if (value.length - 1 > maximumBreadth) {
7972
+ const removedKeys = value.length - maximumBreadth - 1;
7973
+ res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
7974
+ }
7975
+ if (spacer !== "") {
7976
+ res += `
7977
+ ${originalIndentation}`;
7978
+ }
7979
+ stack.pop();
7980
+ return `[${res}]`;
7981
+ }
7982
+ stack.push(value);
7983
+ let whitespace = "";
7984
+ if (spacer !== "") {
7985
+ indentation += spacer;
7986
+ join2 = `,
7987
+ ${indentation}`;
7988
+ whitespace = " ";
7989
+ }
7990
+ let separator = "";
7991
+ for (const key2 of replacer) {
7992
+ const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
7993
+ if (tmp !== void 0) {
7994
+ res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
7995
+ separator = join2;
7996
+ }
7997
+ }
7998
+ if (spacer !== "" && separator.length > 1) {
7999
+ res = `
8000
+ ${indentation}${res}
8001
+ ${originalIndentation}`;
8002
+ }
8003
+ stack.pop();
8004
+ return `{${res}}`;
8005
+ }
8006
+ case "number":
8007
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
8008
+ case "boolean":
8009
+ return value === true ? "true" : "false";
8010
+ case "undefined":
8011
+ return void 0;
8012
+ case "bigint":
8013
+ if (bigint4) {
8014
+ return String(value);
8015
+ }
8016
+ // fallthrough
8017
+ default:
8018
+ return fail ? fail(value) : void 0;
8019
+ }
8020
+ }
8021
+ function stringifyIndent(key, value, stack, spacer, indentation) {
8022
+ switch (typeof value) {
8023
+ case "string":
8024
+ return strEscape(value);
8025
+ case "object": {
8026
+ if (value === null) {
8027
+ return "null";
8028
+ }
8029
+ if (typeof value.toJSON === "function") {
8030
+ value = value.toJSON(key);
8031
+ if (typeof value !== "object") {
8032
+ return stringifyIndent(key, value, stack, spacer, indentation);
8033
+ }
8034
+ if (value === null) {
8035
+ return "null";
8036
+ }
8037
+ }
8038
+ if (stack.indexOf(value) !== -1) {
8039
+ return circularValue;
8040
+ }
8041
+ const originalIndentation = indentation;
8042
+ if (Array.isArray(value)) {
8043
+ if (value.length === 0) {
8044
+ return "[]";
8045
+ }
8046
+ if (maximumDepth < stack.length + 1) {
8047
+ return '"[Array]"';
8048
+ }
8049
+ stack.push(value);
8050
+ indentation += spacer;
8051
+ let res2 = `
8052
+ ${indentation}`;
8053
+ const join3 = `,
8054
+ ${indentation}`;
8055
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
8056
+ let i = 0;
8057
+ for (; i < maximumValuesToStringify - 1; i++) {
8058
+ const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
8059
+ res2 += tmp2 !== void 0 ? tmp2 : "null";
8060
+ res2 += join3;
8061
+ }
8062
+ const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
8063
+ res2 += tmp !== void 0 ? tmp : "null";
8064
+ if (value.length - 1 > maximumBreadth) {
8065
+ const removedKeys = value.length - maximumBreadth - 1;
8066
+ res2 += `${join3}"... ${getItemCount(removedKeys)} not stringified"`;
8067
+ }
8068
+ res2 += `
8069
+ ${originalIndentation}`;
8070
+ stack.pop();
8071
+ return `[${res2}]`;
8072
+ }
8073
+ let keys = Object.keys(value);
8074
+ const keyLength = keys.length;
8075
+ if (keyLength === 0) {
8076
+ return "{}";
8077
+ }
8078
+ if (maximumDepth < stack.length + 1) {
8079
+ return '"[Object]"';
8080
+ }
8081
+ indentation += spacer;
8082
+ const join2 = `,
8083
+ ${indentation}`;
8084
+ let res = "";
8085
+ let separator = "";
8086
+ let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
8087
+ if (isTypedArrayWithEntries(value)) {
8088
+ res += stringifyTypedArray(value, join2, maximumBreadth);
8089
+ keys = keys.slice(value.length);
8090
+ maximumPropertiesToStringify -= value.length;
8091
+ separator = join2;
8092
+ }
8093
+ if (deterministic) {
8094
+ keys = sort(keys, comparator);
8095
+ }
8096
+ stack.push(value);
8097
+ for (let i = 0; i < maximumPropertiesToStringify; i++) {
8098
+ const key2 = keys[i];
8099
+ const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
8100
+ if (tmp !== void 0) {
8101
+ res += `${separator}${strEscape(key2)}: ${tmp}`;
8102
+ separator = join2;
8103
+ }
8104
+ }
8105
+ if (keyLength > maximumBreadth) {
8106
+ const removedKeys = keyLength - maximumBreadth;
8107
+ res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
8108
+ separator = join2;
8109
+ }
8110
+ if (separator !== "") {
8111
+ res = `
8112
+ ${indentation}${res}
8113
+ ${originalIndentation}`;
8114
+ }
8115
+ stack.pop();
8116
+ return `{${res}}`;
8117
+ }
8118
+ case "number":
8119
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
8120
+ case "boolean":
8121
+ return value === true ? "true" : "false";
8122
+ case "undefined":
8123
+ return void 0;
8124
+ case "bigint":
8125
+ if (bigint4) {
8126
+ return String(value);
8127
+ }
8128
+ // fallthrough
8129
+ default:
8130
+ return fail ? fail(value) : void 0;
8131
+ }
8132
+ }
8133
+ function stringifySimple(key, value, stack) {
8134
+ switch (typeof value) {
8135
+ case "string":
8136
+ return strEscape(value);
8137
+ case "object": {
8138
+ if (value === null) {
8139
+ return "null";
8140
+ }
8141
+ if (typeof value.toJSON === "function") {
8142
+ value = value.toJSON(key);
8143
+ if (typeof value !== "object") {
8144
+ return stringifySimple(key, value, stack);
8145
+ }
8146
+ if (value === null) {
8147
+ return "null";
8148
+ }
8149
+ }
8150
+ if (stack.indexOf(value) !== -1) {
8151
+ return circularValue;
8152
+ }
8153
+ let res = "";
8154
+ const hasLength = value.length !== void 0;
8155
+ if (hasLength && Array.isArray(value)) {
8156
+ if (value.length === 0) {
8157
+ return "[]";
8158
+ }
8159
+ if (maximumDepth < stack.length + 1) {
8160
+ return '"[Array]"';
8161
+ }
8162
+ stack.push(value);
8163
+ const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
8164
+ let i = 0;
8165
+ for (; i < maximumValuesToStringify - 1; i++) {
8166
+ const tmp2 = stringifySimple(String(i), value[i], stack);
8167
+ res += tmp2 !== void 0 ? tmp2 : "null";
8168
+ res += ",";
8169
+ }
8170
+ const tmp = stringifySimple(String(i), value[i], stack);
8171
+ res += tmp !== void 0 ? tmp : "null";
8172
+ if (value.length - 1 > maximumBreadth) {
8173
+ const removedKeys = value.length - maximumBreadth - 1;
8174
+ res += `,"... ${getItemCount(removedKeys)} not stringified"`;
8175
+ }
8176
+ stack.pop();
8177
+ return `[${res}]`;
8178
+ }
8179
+ let keys = Object.keys(value);
8180
+ const keyLength = keys.length;
8181
+ if (keyLength === 0) {
8182
+ return "{}";
8183
+ }
8184
+ if (maximumDepth < stack.length + 1) {
8185
+ return '"[Object]"';
8186
+ }
8187
+ let separator = "";
8188
+ let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
8189
+ if (hasLength && isTypedArrayWithEntries(value)) {
8190
+ res += stringifyTypedArray(value, ",", maximumBreadth);
8191
+ keys = keys.slice(value.length);
8192
+ maximumPropertiesToStringify -= value.length;
8193
+ separator = ",";
8194
+ }
8195
+ if (deterministic) {
8196
+ keys = sort(keys, comparator);
8197
+ }
8198
+ stack.push(value);
8199
+ for (let i = 0; i < maximumPropertiesToStringify; i++) {
8200
+ const key2 = keys[i];
8201
+ const tmp = stringifySimple(key2, value[key2], stack);
8202
+ if (tmp !== void 0) {
8203
+ res += `${separator}${strEscape(key2)}:${tmp}`;
8204
+ separator = ",";
8205
+ }
8206
+ }
8207
+ if (keyLength > maximumBreadth) {
8208
+ const removedKeys = keyLength - maximumBreadth;
8209
+ res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`;
8210
+ }
8211
+ stack.pop();
8212
+ return `{${res}}`;
8213
+ }
8214
+ case "number":
8215
+ return isFinite(value) ? String(value) : fail ? fail(value) : "null";
8216
+ case "boolean":
8217
+ return value === true ? "true" : "false";
8218
+ case "undefined":
8219
+ return void 0;
8220
+ case "bigint":
8221
+ if (bigint4) {
8222
+ return String(value);
8223
+ }
8224
+ // fallthrough
8225
+ default:
8226
+ return fail ? fail(value) : void 0;
8227
+ }
8228
+ }
8229
+ function stringify3(value, replacer, space) {
8230
+ if (arguments.length > 1) {
8231
+ let spacer = "";
8232
+ if (typeof space === "number") {
8233
+ spacer = " ".repeat(Math.min(space, 10));
8234
+ } else if (typeof space === "string") {
8235
+ spacer = space.slice(0, 10);
8236
+ }
8237
+ if (replacer != null) {
8238
+ if (typeof replacer === "function") {
8239
+ return stringifyFnReplacer("", { "": value }, [], replacer, spacer, "");
8240
+ }
8241
+ if (Array.isArray(replacer)) {
8242
+ return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, "");
8243
+ }
8244
+ }
8245
+ if (spacer.length !== 0) {
8246
+ return stringifyIndent("", value, [], spacer, "");
8247
+ }
8248
+ }
8249
+ return stringifySimple("", value, []);
8250
+ }
8251
+ return stringify3;
8252
+ }
8253
+ }
8254
+ });
8255
+
8256
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/multistream.js
8257
+ var require_multistream = __commonJS({
8258
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/multistream.js"(exports, module) {
8259
+ "use strict";
8260
+ var metadata = /* @__PURE__ */ Symbol.for("pino.metadata");
8261
+ var { DEFAULT_LEVELS } = require_constants();
8262
+ var DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info;
8263
+ function multistream(streamsArray, opts) {
8264
+ streamsArray = streamsArray || [];
8265
+ opts = opts || { dedupe: false };
8266
+ const streamLevels = Object.create(DEFAULT_LEVELS);
8267
+ streamLevels.silent = Infinity;
8268
+ if (opts.levels && typeof opts.levels === "object") {
8269
+ Object.keys(opts.levels).forEach((i) => {
8270
+ streamLevels[i] = opts.levels[i];
8271
+ });
8272
+ }
8273
+ const res = {
8274
+ write,
8275
+ add,
8276
+ remove,
8277
+ emit,
8278
+ flushSync,
8279
+ end,
8280
+ minLevel: 0,
8281
+ lastId: 0,
8282
+ streams: [],
8283
+ clone: clone2,
8284
+ [metadata]: true,
8285
+ streamLevels
8286
+ };
8287
+ if (Array.isArray(streamsArray)) {
8288
+ streamsArray.forEach(add, res);
8289
+ } else {
8290
+ add.call(res, streamsArray);
8291
+ }
8292
+ streamsArray = null;
8293
+ return res;
8294
+ function write(data) {
8295
+ let dest;
8296
+ const level = this.lastLevel;
8297
+ const { streams } = this;
8298
+ let recordedLevel = 0;
8299
+ let stream;
8300
+ for (let i = initLoopVar(streams.length, opts.dedupe); checkLoopVar(i, streams.length, opts.dedupe); i = adjustLoopVar(i, opts.dedupe)) {
8301
+ dest = streams[i];
8302
+ if (dest.level <= level) {
8303
+ if (recordedLevel !== 0 && recordedLevel !== dest.level) {
8304
+ break;
8305
+ }
8306
+ stream = dest.stream;
8307
+ if (stream[metadata]) {
8308
+ const { lastTime, lastMsg, lastObj, lastLogger } = this;
8309
+ stream.lastLevel = level;
8310
+ stream.lastTime = lastTime;
8311
+ stream.lastMsg = lastMsg;
8312
+ stream.lastObj = lastObj;
8313
+ stream.lastLogger = lastLogger;
8314
+ }
8315
+ stream.write(data);
8316
+ if (opts.dedupe) {
8317
+ recordedLevel = dest.level;
8318
+ }
8319
+ } else if (!opts.dedupe) {
8320
+ break;
8321
+ }
8322
+ }
8323
+ }
8324
+ function emit(...args) {
8325
+ for (const { stream } of this.streams) {
8326
+ if (typeof stream.emit === "function") {
8327
+ stream.emit(...args);
8328
+ }
8329
+ }
8330
+ }
8331
+ function flushSync() {
8332
+ for (const { stream } of this.streams) {
8333
+ if (typeof stream.flushSync === "function") {
8334
+ stream.flushSync();
8335
+ }
8336
+ }
8337
+ }
8338
+ function add(dest) {
8339
+ if (!dest) {
8340
+ return res;
8341
+ }
8342
+ const isStream = typeof dest.write === "function" || dest.stream;
8343
+ const stream_ = dest.write ? dest : dest.stream;
8344
+ if (!isStream) {
8345
+ throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");
8346
+ }
8347
+ const { streams, streamLevels: streamLevels2 } = this;
8348
+ let level;
8349
+ if (typeof dest.levelVal === "number") {
8350
+ level = dest.levelVal;
8351
+ } else if (typeof dest.level === "string") {
8352
+ level = streamLevels2[dest.level];
8353
+ } else if (typeof dest.level === "number") {
8354
+ level = dest.level;
8355
+ } else {
8356
+ level = DEFAULT_INFO_LEVEL;
8357
+ }
8358
+ const dest_ = {
8359
+ stream: stream_,
8360
+ level,
8361
+ levelVal: void 0,
8362
+ id: ++res.lastId
8363
+ };
8364
+ streams.unshift(dest_);
8365
+ streams.sort(compareByLevel);
8366
+ this.minLevel = streams[0].level;
8367
+ return res;
8368
+ }
8369
+ function remove(id) {
8370
+ const { streams } = this;
8371
+ const index = streams.findIndex((s) => s.id === id);
8372
+ if (index >= 0) {
8373
+ streams.splice(index, 1);
8374
+ streams.sort(compareByLevel);
8375
+ this.minLevel = streams.length > 0 ? streams[0].level : -1;
8376
+ }
8377
+ return res;
8378
+ }
8379
+ function end() {
8380
+ for (const { stream } of this.streams) {
8381
+ if (typeof stream.flushSync === "function") {
8382
+ stream.flushSync();
8383
+ }
8384
+ stream.end();
8385
+ }
8386
+ }
8387
+ function clone2(level) {
8388
+ const streams = new Array(this.streams.length);
8389
+ for (let i = 0; i < streams.length; i++) {
8390
+ streams[i] = {
8391
+ level,
8392
+ stream: this.streams[i].stream
8393
+ };
8394
+ }
8395
+ return {
8396
+ write,
8397
+ add,
8398
+ remove,
8399
+ minLevel: level,
8400
+ streams,
8401
+ clone: clone2,
8402
+ emit,
8403
+ flushSync,
8404
+ [metadata]: true
8405
+ };
8406
+ }
8407
+ }
8408
+ function compareByLevel(a, b) {
8409
+ return a.level - b.level;
8410
+ }
8411
+ function initLoopVar(length, dedupe) {
8412
+ return dedupe ? length - 1 : 0;
8413
+ }
8414
+ function adjustLoopVar(i, dedupe) {
8415
+ return dedupe ? i - 1 : i + 1;
8416
+ }
8417
+ function checkLoopVar(i, length, dedupe) {
8418
+ return dedupe ? i >= 0 : i < length;
8419
+ }
8420
+ module.exports = multistream;
8421
+ }
8422
+ });
8423
+
8424
+ // ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/pino.js
8425
+ var require_pino = __commonJS({
8426
+ "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/pino.js"(exports, module) {
8427
+ "use strict";
8428
+ var os4 = __require("node:os");
8429
+ var stdSerializers = require_pino_std_serializers();
8430
+ var caller = require_caller();
8431
+ var redaction = require_redaction();
8432
+ var time3 = require_time();
8433
+ var proto2 = require_proto();
8434
+ var symbols = require_symbols();
8435
+ var { configure } = require_safe_stable_stringify();
8436
+ var { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = require_levels();
8437
+ var { DEFAULT_LEVELS, SORTING_ORDER } = require_constants();
8438
+ var {
8439
+ createArgsNormalizer,
8440
+ asChindings,
8441
+ buildSafeSonicBoom,
8442
+ buildFormatters,
8443
+ stringify: stringify2,
8444
+ normalizeDestFileDescriptor,
8445
+ noop: noop2
8446
+ } = require_tools();
8447
+ var { version: version2 } = require_meta();
8448
+ var {
8449
+ chindingsSym,
8450
+ redactFmtSym,
8451
+ serializersSym,
8452
+ timeSym,
8453
+ timeSliceIndexSym,
8454
+ streamSym,
8455
+ stringifySym,
8456
+ stringifySafeSym,
8457
+ stringifiersSym,
8458
+ setLevelSym,
8459
+ endSym,
8460
+ formatOptsSym,
8461
+ messageKeySym,
8462
+ errorKeySym,
8463
+ nestedKeySym,
8464
+ mixinSym,
8465
+ levelCompSym,
8466
+ useOnlyCustomLevelsSym,
8467
+ formattersSym,
8468
+ hooksSym,
8469
+ nestedKeyStrSym,
8470
+ mixinMergeStrategySym,
8471
+ msgPrefixSym
8472
+ } = symbols;
8473
+ var { epochTime, nullTime } = time3;
8474
+ var { pid } = process;
8475
+ var hostname3 = os4.hostname();
8476
+ var defaultErrorSerializer = stdSerializers.err;
8477
+ var defaultOptions = {
8478
+ level: "info",
8479
+ levelComparison: SORTING_ORDER.ASC,
8480
+ levels: DEFAULT_LEVELS,
8481
+ messageKey: "msg",
8482
+ errorKey: "err",
8483
+ nestedKey: null,
8484
+ enabled: true,
8485
+ base: { pid, hostname: hostname3 },
8486
+ serializers: Object.assign(/* @__PURE__ */ Object.create(null), {
8487
+ err: defaultErrorSerializer
8488
+ }),
8489
+ formatters: Object.assign(/* @__PURE__ */ Object.create(null), {
8490
+ bindings(bindings) {
8491
+ return bindings;
8492
+ },
8493
+ level(label, number4) {
8494
+ return { level: number4 };
8495
+ }
8496
+ }),
8497
+ hooks: {
8498
+ logMethod: void 0,
8499
+ streamWrite: void 0
8500
+ },
8501
+ timestamp: epochTime,
8502
+ name: void 0,
8503
+ redact: null,
8504
+ customLevels: null,
8505
+ useOnlyCustomLevels: false,
8506
+ depthLimit: 5,
8507
+ edgeLimit: 100
8508
+ };
8509
+ var normalize = createArgsNormalizer(defaultOptions);
8510
+ var serializers = Object.assign(/* @__PURE__ */ Object.create(null), stdSerializers);
8511
+ function pino2(...args) {
8512
+ const instance = {};
8513
+ const { opts, stream } = normalize(instance, caller(), ...args);
8514
+ if (opts.level && typeof opts.level === "string" && DEFAULT_LEVELS[opts.level.toLowerCase()] !== void 0) opts.level = opts.level.toLowerCase();
8515
+ const {
8516
+ redact,
8517
+ crlf,
8518
+ serializers: serializers2,
8519
+ timestamp,
8520
+ messageKey,
8521
+ errorKey,
8522
+ nestedKey,
8523
+ base,
8524
+ name,
8525
+ level,
8526
+ customLevels,
8527
+ levelComparison,
8528
+ mixin,
8529
+ mixinMergeStrategy,
8530
+ useOnlyCustomLevels,
8531
+ formatters: formatters2,
8532
+ hooks,
8533
+ depthLimit,
8534
+ edgeLimit,
8535
+ onChild,
8536
+ msgPrefix
8537
+ } = opts;
8538
+ const stringifySafe = configure({
8539
+ maximumDepth: depthLimit,
8540
+ maximumBreadth: edgeLimit
8541
+ });
8542
+ const allFormatters = buildFormatters(
8543
+ formatters2.level,
8544
+ formatters2.bindings,
8545
+ formatters2.log
8546
+ );
8547
+ const stringifyFn = stringify2.bind({
8548
+ [stringifySafeSym]: stringifySafe
8549
+ });
8550
+ const stringifiers = redact ? redaction(redact, stringifyFn) : {};
8551
+ const formatOpts = redact ? { stringify: stringifiers[redactFmtSym] } : { stringify: stringifyFn };
8552
+ const end = "}" + (crlf ? "\r\n" : "\n");
8553
+ const coreChindings = asChindings.bind(null, {
8554
+ [chindingsSym]: "",
8555
+ [serializersSym]: serializers2,
8556
+ [stringifiersSym]: stringifiers,
8557
+ [stringifySym]: stringify2,
8558
+ [stringifySafeSym]: stringifySafe,
8559
+ [formattersSym]: allFormatters
8560
+ });
8561
+ let chindings = "";
8562
+ if (base !== null) {
8563
+ if (name === void 0) {
8564
+ chindings = coreChindings(base);
8565
+ } else {
8566
+ chindings = coreChindings(Object.assign({}, base, { name }));
8567
+ }
8568
+ }
8569
+ const time4 = timestamp instanceof Function ? timestamp : timestamp ? epochTime : nullTime;
8570
+ const timeSliceIndex = time4().indexOf(":") + 1;
8571
+ if (useOnlyCustomLevels && !customLevels) throw Error("customLevels is required if useOnlyCustomLevels is set true");
8572
+ if (mixin && typeof mixin !== "function") throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`);
8573
+ if (msgPrefix && typeof msgPrefix !== "string") throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`);
8574
+ assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels);
8575
+ const levels = mappings(customLevels, useOnlyCustomLevels);
8576
+ if (typeof stream.emit === "function") {
8577
+ stream.emit("message", { code: "PINO_CONFIG", config: { levels, messageKey, errorKey } });
8578
+ }
8579
+ assertLevelComparison(levelComparison);
8580
+ const levelCompFunc = genLevelComparison(levelComparison);
8581
+ Object.assign(instance, {
8582
+ levels,
8583
+ [levelCompSym]: levelCompFunc,
8584
+ [useOnlyCustomLevelsSym]: useOnlyCustomLevels,
8585
+ [streamSym]: stream,
8586
+ [timeSym]: time4,
8587
+ [timeSliceIndexSym]: timeSliceIndex,
8588
+ [stringifySym]: stringify2,
8589
+ [stringifySafeSym]: stringifySafe,
8590
+ [stringifiersSym]: stringifiers,
8591
+ [endSym]: end,
8592
+ [formatOptsSym]: formatOpts,
8593
+ [messageKeySym]: messageKey,
8594
+ [errorKeySym]: errorKey,
8595
+ [nestedKeySym]: nestedKey,
8596
+ // protect against injection
8597
+ [nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : "",
8598
+ [serializersSym]: serializers2,
8599
+ [mixinSym]: mixin,
8600
+ [mixinMergeStrategySym]: mixinMergeStrategy,
8601
+ [chindingsSym]: chindings,
8602
+ [formattersSym]: allFormatters,
8603
+ [hooksSym]: hooks,
8604
+ silent: noop2,
8605
+ onChild,
8606
+ [msgPrefixSym]: msgPrefix
8607
+ });
8608
+ Object.setPrototypeOf(instance, proto2());
8609
+ genLsCache(instance);
8610
+ instance[setLevelSym](level);
8611
+ return instance;
8612
+ }
8613
+ module.exports = pino2;
8614
+ module.exports.destination = (dest = process.stdout.fd) => {
8615
+ if (typeof dest === "object") {
8616
+ dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd);
8617
+ return buildSafeSonicBoom(dest);
8618
+ } else {
8619
+ return buildSafeSonicBoom({ dest: normalizeDestFileDescriptor(dest), minLength: 0 });
8620
+ }
8621
+ };
8622
+ module.exports.transport = require_transport();
8623
+ module.exports.multistream = require_multistream();
8624
+ module.exports.levels = mappings();
8625
+ module.exports.stdSerializers = serializers;
8626
+ module.exports.stdTimeFunctions = Object.assign({}, time3);
8627
+ module.exports.symbols = symbols;
8628
+ module.exports.version = version2;
8629
+ module.exports.default = pino2;
8630
+ module.exports.pino = pino2;
8631
+ }
8632
+ });
8633
+
4250
8634
  // ../../node_modules/.pnpm/mimic-function@5.0.1/node_modules/mimic-function/index.js
4251
8635
  function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
4252
8636
  const { name } = to;
@@ -4365,13 +8749,13 @@ var init_signals = __esm({
4365
8749
  });
4366
8750
 
4367
8751
  // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
4368
- var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process4, onExit, load, unload;
8752
+ var processOk, kExitEmitter, global2, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process4, onExit, load, unload;
4369
8753
  var init_mjs = __esm({
4370
8754
  "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
4371
8755
  init_signals();
4372
8756
  processOk = (process17) => !!process17 && typeof process17 === "object" && typeof process17.removeListener === "function" && typeof process17.emit === "function" && typeof process17.reallyExit === "function" && typeof process17.listeners === "function" && typeof process17.kill === "function" && typeof process17.pid === "number" && typeof process17.on === "function";
4373
8757
  kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
4374
- global = globalThis;
8758
+ global2 = globalThis;
4375
8759
  ObjectDefineProperty = Object.defineProperty.bind(Object);
4376
8760
  Emitter = class {
4377
8761
  emitted = {
@@ -4385,10 +8769,10 @@ var init_mjs = __esm({
4385
8769
  count = 0;
4386
8770
  id = Math.random();
4387
8771
  constructor() {
4388
- if (global[kExitEmitter]) {
4389
- return global[kExitEmitter];
8772
+ if (global2[kExitEmitter]) {
8773
+ return global2[kExitEmitter];
4390
8774
  }
4391
- ObjectDefineProperty(global, kExitEmitter, {
8775
+ ObjectDefineProperty(global2, kExitEmitter, {
4392
8776
  value: this,
4393
8777
  writable: false,
4394
8778
  enumerable: false,
@@ -21034,7 +25418,7 @@ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
21034
25418
  }
21035
25419
  return detectArchBinary(platformBinary);
21036
25420
  }
21037
- var execFile5, __dirname, localXdgOpenPath, platform, arch, pTryEach, baseOpen, open, openApp, apps, open_default;
25421
+ var execFile5, __dirname2, localXdgOpenPath, platform, arch, pTryEach, baseOpen, open, openApp, apps, open_default;
21038
25422
  var init_open = __esm({
21039
25423
  "../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js"() {
21040
25424
  init_wsl_utils();
@@ -21042,8 +25426,8 @@ var init_open = __esm({
21042
25426
  init_default_browser();
21043
25427
  init_is_inside_container();
21044
25428
  execFile5 = promisify5(childProcess.execFile);
21045
- __dirname = path3.dirname(fileURLToPath(import.meta.url));
21046
- localXdgOpenPath = path3.join(__dirname, "xdg-open");
25429
+ __dirname2 = path3.dirname(fileURLToPath(import.meta.url));
25430
+ localXdgOpenPath = path3.join(__dirname2, "xdg-open");
21047
25431
  ({ platform, arch } = process16);
21048
25432
  pTryEach = async (array2, mapper) => {
21049
25433
  let latestError;
@@ -21165,7 +25549,7 @@ var init_open = __esm({
21165
25549
  if (app) {
21166
25550
  command = app;
21167
25551
  } else {
21168
- const isBundled = !__dirname || __dirname === "/";
25552
+ const isBundled = !__dirname2 || __dirname2 === "/";
21169
25553
  let exeLocalXdgOpen = false;
21170
25554
  try {
21171
25555
  await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
@@ -35484,7 +39868,7 @@ ${messages}`);
35484
39868
  }
35485
39869
 
35486
39870
  // ../core/dist/logging/logger.js
35487
- import pino from "pino";
39871
+ var import_pino = __toESM(require_pino(), 1);
35488
39872
  var isDev = process.env.NODE_ENV !== "production";
35489
39873
  var isCli = process.env.TRADING_BOY_CLI === "1";
35490
39874
  var SENSITIVE_FIELDS = [
@@ -35529,9 +39913,9 @@ function getBaseLogger() {
35529
39913
  }
35530
39914
  };
35531
39915
  if (isCli) {
35532
- _baseLogger = pino(opts, process.stderr);
39916
+ _baseLogger = (0, import_pino.default)(opts, process.stderr);
35533
39917
  } else if (isDev) {
35534
- _baseLogger = pino({
39918
+ _baseLogger = (0, import_pino.default)({
35535
39919
  ...opts,
35536
39920
  transport: {
35537
39921
  target: "pino-pretty",
@@ -35539,7 +39923,7 @@ function getBaseLogger() {
35539
39923
  }
35540
39924
  });
35541
39925
  } else {
35542
- _baseLogger = pino(opts);
39926
+ _baseLogger = (0, import_pino.default)(opts);
35543
39927
  }
35544
39928
  }
35545
39929
  return _baseLogger;
@@ -48000,8 +52384,8 @@ if (!process.stdout.isTTY) {
48000
52384
  process.env.NO_COLOR = "1";
48001
52385
  }
48002
52386
  function getVersion() {
48003
- const __dirname2 = dirname(fileURLToPath2(import.meta.url));
48004
- const pkgPath = resolve2(__dirname2, "..", "package.json");
52387
+ const __dirname3 = dirname(fileURLToPath2(import.meta.url));
52388
+ const pkgPath = resolve2(__dirname3, "..", "package.json");
48005
52389
  const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
48006
52390
  return pkg.version;
48007
52391
  }