@inlang/paraglide-js 1.2.9 → 1.3.0

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/index.js +2923 -378
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -5536,6 +5536,378 @@ var require_compiler2 = __commonJS({
5536
5536
  }
5537
5537
  });
5538
5538
 
5539
+ // ../../../../node_modules/.pnpm/murmurhash3js@3.0.1/node_modules/murmurhash3js/lib/murmurHash3js.js
5540
+ var require_murmurHash3js = __commonJS({
5541
+ "../../../../node_modules/.pnpm/murmurhash3js@3.0.1/node_modules/murmurhash3js/lib/murmurHash3js.js"(exports, module) {
5542
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
5543
+ (function(root, undefined2) {
5544
+ "use strict";
5545
+ var library = {
5546
+ "version": "3.0.1",
5547
+ "x86": {},
5548
+ "x64": {}
5549
+ };
5550
+ function _x86Multiply(m, n) {
5551
+ return (m & 65535) * n + (((m >>> 16) * n & 65535) << 16);
5552
+ }
5553
+ function _x86Rotl(m, n) {
5554
+ return m << n | m >>> 32 - n;
5555
+ }
5556
+ function _x86Fmix(h) {
5557
+ h ^= h >>> 16;
5558
+ h = _x86Multiply(h, 2246822507);
5559
+ h ^= h >>> 13;
5560
+ h = _x86Multiply(h, 3266489909);
5561
+ h ^= h >>> 16;
5562
+ return h;
5563
+ }
5564
+ function _x64Add(m, n) {
5565
+ m = [m[0] >>> 16, m[0] & 65535, m[1] >>> 16, m[1] & 65535];
5566
+ n = [n[0] >>> 16, n[0] & 65535, n[1] >>> 16, n[1] & 65535];
5567
+ var o = [0, 0, 0, 0];
5568
+ o[3] += m[3] + n[3];
5569
+ o[2] += o[3] >>> 16;
5570
+ o[3] &= 65535;
5571
+ o[2] += m[2] + n[2];
5572
+ o[1] += o[2] >>> 16;
5573
+ o[2] &= 65535;
5574
+ o[1] += m[1] + n[1];
5575
+ o[0] += o[1] >>> 16;
5576
+ o[1] &= 65535;
5577
+ o[0] += m[0] + n[0];
5578
+ o[0] &= 65535;
5579
+ return [o[0] << 16 | o[1], o[2] << 16 | o[3]];
5580
+ }
5581
+ function _x64Multiply(m, n) {
5582
+ m = [m[0] >>> 16, m[0] & 65535, m[1] >>> 16, m[1] & 65535];
5583
+ n = [n[0] >>> 16, n[0] & 65535, n[1] >>> 16, n[1] & 65535];
5584
+ var o = [0, 0, 0, 0];
5585
+ o[3] += m[3] * n[3];
5586
+ o[2] += o[3] >>> 16;
5587
+ o[3] &= 65535;
5588
+ o[2] += m[2] * n[3];
5589
+ o[1] += o[2] >>> 16;
5590
+ o[2] &= 65535;
5591
+ o[2] += m[3] * n[2];
5592
+ o[1] += o[2] >>> 16;
5593
+ o[2] &= 65535;
5594
+ o[1] += m[1] * n[3];
5595
+ o[0] += o[1] >>> 16;
5596
+ o[1] &= 65535;
5597
+ o[1] += m[2] * n[2];
5598
+ o[0] += o[1] >>> 16;
5599
+ o[1] &= 65535;
5600
+ o[1] += m[3] * n[1];
5601
+ o[0] += o[1] >>> 16;
5602
+ o[1] &= 65535;
5603
+ o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];
5604
+ o[0] &= 65535;
5605
+ return [o[0] << 16 | o[1], o[2] << 16 | o[3]];
5606
+ }
5607
+ function _x64Rotl(m, n) {
5608
+ n %= 64;
5609
+ if (n === 32) {
5610
+ return [m[1], m[0]];
5611
+ } else if (n < 32) {
5612
+ return [m[0] << n | m[1] >>> 32 - n, m[1] << n | m[0] >>> 32 - n];
5613
+ } else {
5614
+ n -= 32;
5615
+ return [m[1] << n | m[0] >>> 32 - n, m[0] << n | m[1] >>> 32 - n];
5616
+ }
5617
+ }
5618
+ function _x64LeftShift(m, n) {
5619
+ n %= 64;
5620
+ if (n === 0) {
5621
+ return m;
5622
+ } else if (n < 32) {
5623
+ return [m[0] << n | m[1] >>> 32 - n, m[1] << n];
5624
+ } else {
5625
+ return [m[1] << n - 32, 0];
5626
+ }
5627
+ }
5628
+ function _x64Xor(m, n) {
5629
+ return [m[0] ^ n[0], m[1] ^ n[1]];
5630
+ }
5631
+ function _x64Fmix(h) {
5632
+ h = _x64Xor(h, [0, h[0] >>> 1]);
5633
+ h = _x64Multiply(h, [4283543511, 3981806797]);
5634
+ h = _x64Xor(h, [0, h[0] >>> 1]);
5635
+ h = _x64Multiply(h, [3301882366, 444984403]);
5636
+ h = _x64Xor(h, [0, h[0] >>> 1]);
5637
+ return h;
5638
+ }
5639
+ library.x86.hash32 = function(key, seed) {
5640
+ key = key || "";
5641
+ seed = seed || 0;
5642
+ var remainder = key.length % 4;
5643
+ var bytes = key.length - remainder;
5644
+ var h1 = seed;
5645
+ var k1 = 0;
5646
+ var c1 = 3432918353;
5647
+ var c2 = 461845907;
5648
+ for (var i2 = 0; i2 < bytes; i2 = i2 + 4) {
5649
+ k1 = key.charCodeAt(i2) & 255 | (key.charCodeAt(i2 + 1) & 255) << 8 | (key.charCodeAt(i2 + 2) & 255) << 16 | (key.charCodeAt(i2 + 3) & 255) << 24;
5650
+ k1 = _x86Multiply(k1, c1);
5651
+ k1 = _x86Rotl(k1, 15);
5652
+ k1 = _x86Multiply(k1, c2);
5653
+ h1 ^= k1;
5654
+ h1 = _x86Rotl(h1, 13);
5655
+ h1 = _x86Multiply(h1, 5) + 3864292196;
5656
+ }
5657
+ k1 = 0;
5658
+ switch (remainder) {
5659
+ case 3:
5660
+ k1 ^= (key.charCodeAt(i2 + 2) & 255) << 16;
5661
+ case 2:
5662
+ k1 ^= (key.charCodeAt(i2 + 1) & 255) << 8;
5663
+ case 1:
5664
+ k1 ^= key.charCodeAt(i2) & 255;
5665
+ k1 = _x86Multiply(k1, c1);
5666
+ k1 = _x86Rotl(k1, 15);
5667
+ k1 = _x86Multiply(k1, c2);
5668
+ h1 ^= k1;
5669
+ }
5670
+ h1 ^= key.length;
5671
+ h1 = _x86Fmix(h1);
5672
+ return h1 >>> 0;
5673
+ };
5674
+ library.x86.hash128 = function(key, seed) {
5675
+ key = key || "";
5676
+ seed = seed || 0;
5677
+ var remainder = key.length % 16;
5678
+ var bytes = key.length - remainder;
5679
+ var h1 = seed;
5680
+ var h2 = seed;
5681
+ var h3 = seed;
5682
+ var h4 = seed;
5683
+ var k1 = 0;
5684
+ var k2 = 0;
5685
+ var k3 = 0;
5686
+ var k4 = 0;
5687
+ var c1 = 597399067;
5688
+ var c2 = 2869860233;
5689
+ var c3 = 951274213;
5690
+ var c4 = 2716044179;
5691
+ for (var i2 = 0; i2 < bytes; i2 = i2 + 16) {
5692
+ k1 = key.charCodeAt(i2) & 255 | (key.charCodeAt(i2 + 1) & 255) << 8 | (key.charCodeAt(i2 + 2) & 255) << 16 | (key.charCodeAt(i2 + 3) & 255) << 24;
5693
+ k2 = key.charCodeAt(i2 + 4) & 255 | (key.charCodeAt(i2 + 5) & 255) << 8 | (key.charCodeAt(i2 + 6) & 255) << 16 | (key.charCodeAt(i2 + 7) & 255) << 24;
5694
+ k3 = key.charCodeAt(i2 + 8) & 255 | (key.charCodeAt(i2 + 9) & 255) << 8 | (key.charCodeAt(i2 + 10) & 255) << 16 | (key.charCodeAt(i2 + 11) & 255) << 24;
5695
+ k4 = key.charCodeAt(i2 + 12) & 255 | (key.charCodeAt(i2 + 13) & 255) << 8 | (key.charCodeAt(i2 + 14) & 255) << 16 | (key.charCodeAt(i2 + 15) & 255) << 24;
5696
+ k1 = _x86Multiply(k1, c1);
5697
+ k1 = _x86Rotl(k1, 15);
5698
+ k1 = _x86Multiply(k1, c2);
5699
+ h1 ^= k1;
5700
+ h1 = _x86Rotl(h1, 19);
5701
+ h1 += h2;
5702
+ h1 = _x86Multiply(h1, 5) + 1444728091;
5703
+ k2 = _x86Multiply(k2, c2);
5704
+ k2 = _x86Rotl(k2, 16);
5705
+ k2 = _x86Multiply(k2, c3);
5706
+ h2 ^= k2;
5707
+ h2 = _x86Rotl(h2, 17);
5708
+ h2 += h3;
5709
+ h2 = _x86Multiply(h2, 5) + 197830471;
5710
+ k3 = _x86Multiply(k3, c3);
5711
+ k3 = _x86Rotl(k3, 17);
5712
+ k3 = _x86Multiply(k3, c4);
5713
+ h3 ^= k3;
5714
+ h3 = _x86Rotl(h3, 15);
5715
+ h3 += h4;
5716
+ h3 = _x86Multiply(h3, 5) + 2530024501;
5717
+ k4 = _x86Multiply(k4, c4);
5718
+ k4 = _x86Rotl(k4, 18);
5719
+ k4 = _x86Multiply(k4, c1);
5720
+ h4 ^= k4;
5721
+ h4 = _x86Rotl(h4, 13);
5722
+ h4 += h1;
5723
+ h4 = _x86Multiply(h4, 5) + 850148119;
5724
+ }
5725
+ k1 = 0;
5726
+ k2 = 0;
5727
+ k3 = 0;
5728
+ k4 = 0;
5729
+ switch (remainder) {
5730
+ case 15:
5731
+ k4 ^= key.charCodeAt(i2 + 14) << 16;
5732
+ case 14:
5733
+ k4 ^= key.charCodeAt(i2 + 13) << 8;
5734
+ case 13:
5735
+ k4 ^= key.charCodeAt(i2 + 12);
5736
+ k4 = _x86Multiply(k4, c4);
5737
+ k4 = _x86Rotl(k4, 18);
5738
+ k4 = _x86Multiply(k4, c1);
5739
+ h4 ^= k4;
5740
+ case 12:
5741
+ k3 ^= key.charCodeAt(i2 + 11) << 24;
5742
+ case 11:
5743
+ k3 ^= key.charCodeAt(i2 + 10) << 16;
5744
+ case 10:
5745
+ k3 ^= key.charCodeAt(i2 + 9) << 8;
5746
+ case 9:
5747
+ k3 ^= key.charCodeAt(i2 + 8);
5748
+ k3 = _x86Multiply(k3, c3);
5749
+ k3 = _x86Rotl(k3, 17);
5750
+ k3 = _x86Multiply(k3, c4);
5751
+ h3 ^= k3;
5752
+ case 8:
5753
+ k2 ^= key.charCodeAt(i2 + 7) << 24;
5754
+ case 7:
5755
+ k2 ^= key.charCodeAt(i2 + 6) << 16;
5756
+ case 6:
5757
+ k2 ^= key.charCodeAt(i2 + 5) << 8;
5758
+ case 5:
5759
+ k2 ^= key.charCodeAt(i2 + 4);
5760
+ k2 = _x86Multiply(k2, c2);
5761
+ k2 = _x86Rotl(k2, 16);
5762
+ k2 = _x86Multiply(k2, c3);
5763
+ h2 ^= k2;
5764
+ case 4:
5765
+ k1 ^= key.charCodeAt(i2 + 3) << 24;
5766
+ case 3:
5767
+ k1 ^= key.charCodeAt(i2 + 2) << 16;
5768
+ case 2:
5769
+ k1 ^= key.charCodeAt(i2 + 1) << 8;
5770
+ case 1:
5771
+ k1 ^= key.charCodeAt(i2);
5772
+ k1 = _x86Multiply(k1, c1);
5773
+ k1 = _x86Rotl(k1, 15);
5774
+ k1 = _x86Multiply(k1, c2);
5775
+ h1 ^= k1;
5776
+ }
5777
+ h1 ^= key.length;
5778
+ h2 ^= key.length;
5779
+ h3 ^= key.length;
5780
+ h4 ^= key.length;
5781
+ h1 += h2;
5782
+ h1 += h3;
5783
+ h1 += h4;
5784
+ h2 += h1;
5785
+ h3 += h1;
5786
+ h4 += h1;
5787
+ h1 = _x86Fmix(h1);
5788
+ h2 = _x86Fmix(h2);
5789
+ h3 = _x86Fmix(h3);
5790
+ h4 = _x86Fmix(h4);
5791
+ h1 += h2;
5792
+ h1 += h3;
5793
+ h1 += h4;
5794
+ h2 += h1;
5795
+ h3 += h1;
5796
+ h4 += h1;
5797
+ return ("00000000" + (h1 >>> 0).toString(16)).slice(-8) + ("00000000" + (h2 >>> 0).toString(16)).slice(-8) + ("00000000" + (h3 >>> 0).toString(16)).slice(-8) + ("00000000" + (h4 >>> 0).toString(16)).slice(-8);
5798
+ };
5799
+ library.x64.hash128 = function(key, seed) {
5800
+ key = key || "";
5801
+ seed = seed || 0;
5802
+ var remainder = key.length % 16;
5803
+ var bytes = key.length - remainder;
5804
+ var h1 = [0, seed];
5805
+ var h2 = [0, seed];
5806
+ var k1 = [0, 0];
5807
+ var k2 = [0, 0];
5808
+ var c1 = [2277735313, 289559509];
5809
+ var c2 = [1291169091, 658871167];
5810
+ for (var i2 = 0; i2 < bytes; i2 = i2 + 16) {
5811
+ k1 = [key.charCodeAt(i2 + 4) & 255 | (key.charCodeAt(i2 + 5) & 255) << 8 | (key.charCodeAt(i2 + 6) & 255) << 16 | (key.charCodeAt(i2 + 7) & 255) << 24, key.charCodeAt(i2) & 255 | (key.charCodeAt(i2 + 1) & 255) << 8 | (key.charCodeAt(i2 + 2) & 255) << 16 | (key.charCodeAt(i2 + 3) & 255) << 24];
5812
+ k2 = [key.charCodeAt(i2 + 12) & 255 | (key.charCodeAt(i2 + 13) & 255) << 8 | (key.charCodeAt(i2 + 14) & 255) << 16 | (key.charCodeAt(i2 + 15) & 255) << 24, key.charCodeAt(i2 + 8) & 255 | (key.charCodeAt(i2 + 9) & 255) << 8 | (key.charCodeAt(i2 + 10) & 255) << 16 | (key.charCodeAt(i2 + 11) & 255) << 24];
5813
+ k1 = _x64Multiply(k1, c1);
5814
+ k1 = _x64Rotl(k1, 31);
5815
+ k1 = _x64Multiply(k1, c2);
5816
+ h1 = _x64Xor(h1, k1);
5817
+ h1 = _x64Rotl(h1, 27);
5818
+ h1 = _x64Add(h1, h2);
5819
+ h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 1390208809]);
5820
+ k2 = _x64Multiply(k2, c2);
5821
+ k2 = _x64Rotl(k2, 33);
5822
+ k2 = _x64Multiply(k2, c1);
5823
+ h2 = _x64Xor(h2, k2);
5824
+ h2 = _x64Rotl(h2, 31);
5825
+ h2 = _x64Add(h2, h1);
5826
+ h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 944331445]);
5827
+ }
5828
+ k1 = [0, 0];
5829
+ k2 = [0, 0];
5830
+ switch (remainder) {
5831
+ case 15:
5832
+ k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i2 + 14)], 48));
5833
+ case 14:
5834
+ k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i2 + 13)], 40));
5835
+ case 13:
5836
+ k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i2 + 12)], 32));
5837
+ case 12:
5838
+ k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i2 + 11)], 24));
5839
+ case 11:
5840
+ k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i2 + 10)], 16));
5841
+ case 10:
5842
+ k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i2 + 9)], 8));
5843
+ case 9:
5844
+ k2 = _x64Xor(k2, [0, key.charCodeAt(i2 + 8)]);
5845
+ k2 = _x64Multiply(k2, c2);
5846
+ k2 = _x64Rotl(k2, 33);
5847
+ k2 = _x64Multiply(k2, c1);
5848
+ h2 = _x64Xor(h2, k2);
5849
+ case 8:
5850
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 7)], 56));
5851
+ case 7:
5852
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 6)], 48));
5853
+ case 6:
5854
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 5)], 40));
5855
+ case 5:
5856
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 4)], 32));
5857
+ case 4:
5858
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 3)], 24));
5859
+ case 3:
5860
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 2)], 16));
5861
+ case 2:
5862
+ k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i2 + 1)], 8));
5863
+ case 1:
5864
+ k1 = _x64Xor(k1, [0, key.charCodeAt(i2)]);
5865
+ k1 = _x64Multiply(k1, c1);
5866
+ k1 = _x64Rotl(k1, 31);
5867
+ k1 = _x64Multiply(k1, c2);
5868
+ h1 = _x64Xor(h1, k1);
5869
+ }
5870
+ h1 = _x64Xor(h1, [0, key.length]);
5871
+ h2 = _x64Xor(h2, [0, key.length]);
5872
+ h1 = _x64Add(h1, h2);
5873
+ h2 = _x64Add(h2, h1);
5874
+ h1 = _x64Fmix(h1);
5875
+ h2 = _x64Fmix(h2);
5876
+ h1 = _x64Add(h1, h2);
5877
+ h2 = _x64Add(h2, h1);
5878
+ return ("00000000" + (h1[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h1[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (h2[1] >>> 0).toString(16)).slice(-8);
5879
+ };
5880
+ if (typeof exports !== "undefined") {
5881
+ if (typeof module !== "undefined" && module.exports) {
5882
+ exports = module.exports = library;
5883
+ }
5884
+ exports.murmurHash3 = library;
5885
+ } else if (typeof define === "function" && define.amd) {
5886
+ define([], function() {
5887
+ return library;
5888
+ });
5889
+ } else {
5890
+ library._murmurHash3 = root.murmurHash3;
5891
+ library.noConflict = function() {
5892
+ root.murmurHash3 = library._murmurHash3;
5893
+ library._murmurHash3 = undefined2;
5894
+ library.noConflict = undefined2;
5895
+ return library;
5896
+ };
5897
+ root.murmurHash3 = library;
5898
+ }
5899
+ })(exports);
5900
+ }
5901
+ });
5902
+
5903
+ // ../../../../node_modules/.pnpm/murmurhash3js@3.0.1/node_modules/murmurhash3js/index.js
5904
+ var require_murmurhash3js = __commonJS({
5905
+ "../../../../node_modules/.pnpm/murmurhash3js@3.0.1/node_modules/murmurhash3js/index.js"(exports, module) {
5906
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
5907
+ module.exports = require_murmurHash3js();
5908
+ }
5909
+ });
5910
+
5539
5911
  // ../../../../node_modules/.pnpm/universal-user-agent@6.0.1/node_modules/universal-user-agent/dist-node/index.js
5540
5912
  var require_dist_node = __commonJS({
5541
5913
  "../../../../node_modules/.pnpm/universal-user-agent@6.0.1/node_modules/universal-user-agent/dist-node/index.js"(exports) {
@@ -10918,10 +11290,10 @@ var require_dist_node12 = __commonJS({
10918
11290
  async function wrapRequest(state, octokit, request, options) {
10919
11291
  const limiter = new import_light.default();
10920
11292
  limiter.on("failed", function(error, info) {
10921
- const maxRetries = ~~error.request.request.retries;
11293
+ const maxRetries2 = ~~error.request.request.retries;
10922
11294
  const after = ~~error.request.request.retryAfter;
10923
11295
  options.request.retryCount = info.retryCount + 1;
10924
- if (maxRetries > info.retryCount) {
11296
+ if (maxRetries2 > info.retryCount) {
10925
11297
  return after * state.retryAfterBaseValue;
10926
11298
  }
10927
11299
  });
@@ -13163,9 +13535,9 @@ var require_constants = __commonJS({
13163
13535
  var require_debug = __commonJS({
13164
13536
  "../../../../node_modules/.pnpm/semver@7.6.0/node_modules/semver/internal/debug.js"(exports, module) {
13165
13537
  init_define_ENV_DEFINED_IN_BUILD_STEP();
13166
- var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
13538
+ var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
13167
13539
  };
13168
- module.exports = debug;
13540
+ module.exports = debug2;
13169
13541
  }
13170
13542
  });
13171
13543
 
@@ -13178,7 +13550,7 @@ var require_re = __commonJS({
13178
13550
  MAX_SAFE_BUILD_LENGTH,
13179
13551
  MAX_LENGTH
13180
13552
  } = require_constants();
13181
- var debug = require_debug();
13553
+ var debug2 = require_debug();
13182
13554
  exports = module.exports = {};
13183
13555
  var re = exports.re = [];
13184
13556
  var safeRe = exports.safeRe = [];
@@ -13200,7 +13572,7 @@ var require_re = __commonJS({
13200
13572
  var createToken = (name, value, isGlobal) => {
13201
13573
  const safe = makeSafeRegex(value);
13202
13574
  const index = R++;
13203
- debug(name, index, value);
13575
+ debug2(name, index, value);
13204
13576
  t[name] = index;
13205
13577
  src[index] = value;
13206
13578
  re[index] = new RegExp(value, isGlobal ? "g" : void 0);
@@ -13300,7 +13672,7 @@ var require_identifiers = __commonJS({
13300
13672
  var require_semver = __commonJS({
13301
13673
  "../../../../node_modules/.pnpm/semver@7.6.0/node_modules/semver/classes/semver.js"(exports, module) {
13302
13674
  init_define_ENV_DEFINED_IN_BUILD_STEP();
13303
- var debug = require_debug();
13675
+ var debug2 = require_debug();
13304
13676
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
13305
13677
  var { safeRe: re, t } = require_re();
13306
13678
  var parseOptions = require_parse_options();
@@ -13322,7 +13694,7 @@ var require_semver = __commonJS({
13322
13694
  `version is longer than ${MAX_LENGTH} characters`
13323
13695
  );
13324
13696
  }
13325
- debug("SemVer", version2, options);
13697
+ debug2("SemVer", version2, options);
13326
13698
  this.options = options;
13327
13699
  this.loose = !!options.loose;
13328
13700
  this.includePrerelease = !!options.includePrerelease;
@@ -13370,7 +13742,7 @@ var require_semver = __commonJS({
13370
13742
  return this.version;
13371
13743
  }
13372
13744
  compare(other) {
13373
- debug("SemVer.compare", this.version, this.options, other);
13745
+ debug2("SemVer.compare", this.version, this.options, other);
13374
13746
  if (!(other instanceof _SemVer)) {
13375
13747
  if (typeof other === "string" && other === this.version) {
13376
13748
  return 0;
@@ -13403,7 +13775,7 @@ var require_semver = __commonJS({
13403
13775
  do {
13404
13776
  const a = this.prerelease[i2];
13405
13777
  const b = other.prerelease[i2];
13406
- debug("prerelease compare", i2, a, b);
13778
+ debug2("prerelease compare", i2, a, b);
13407
13779
  if (a === void 0 && b === void 0) {
13408
13780
  return 0;
13409
13781
  } else if (b === void 0) {
@@ -13425,7 +13797,7 @@ var require_semver = __commonJS({
13425
13797
  do {
13426
13798
  const a = this.build[i2];
13427
13799
  const b = other.build[i2];
13428
- debug("prerelease compare", i2, a, b);
13800
+ debug2("prerelease compare", i2, a, b);
13429
13801
  if (a === void 0 && b === void 0) {
13430
13802
  return 0;
13431
13803
  } else if (b === void 0) {
@@ -14636,21 +15008,21 @@ var require_range = __commonJS({
14636
15008
  const loose = this.options.loose;
14637
15009
  const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
14638
15010
  range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
14639
- debug("hyphen replace", range);
15011
+ debug2("hyphen replace", range);
14640
15012
  range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
14641
- debug("comparator trim", range);
15013
+ debug2("comparator trim", range);
14642
15014
  range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
14643
- debug("tilde trim", range);
15015
+ debug2("tilde trim", range);
14644
15016
  range = range.replace(re[t.CARETTRIM], caretTrimReplace);
14645
- debug("caret trim", range);
15017
+ debug2("caret trim", range);
14646
15018
  let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
14647
15019
  if (loose) {
14648
15020
  rangeList = rangeList.filter((comp) => {
14649
- debug("loose invalid filter", comp, this.options);
15021
+ debug2("loose invalid filter", comp, this.options);
14650
15022
  return !!comp.match(re[t.COMPARATORLOOSE]);
14651
15023
  });
14652
15024
  }
14653
- debug("range list", rangeList);
15025
+ debug2("range list", rangeList);
14654
15026
  const rangeMap = /* @__PURE__ */ new Map();
14655
15027
  const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
14656
15028
  for (const comp of comparators) {
@@ -14705,7 +15077,7 @@ var require_range = __commonJS({
14705
15077
  var cache = new LRU({ max: 1e3 });
14706
15078
  var parseOptions = require_parse_options();
14707
15079
  var Comparator = require_comparator();
14708
- var debug = require_debug();
15080
+ var debug2 = require_debug();
14709
15081
  var SemVer = require_semver();
14710
15082
  var {
14711
15083
  safeRe: re,
@@ -14730,15 +15102,15 @@ var require_range = __commonJS({
14730
15102
  return result;
14731
15103
  };
14732
15104
  var parseComparator = (comp, options) => {
14733
- debug("comp", comp, options);
15105
+ debug2("comp", comp, options);
14734
15106
  comp = replaceCarets(comp, options);
14735
- debug("caret", comp);
15107
+ debug2("caret", comp);
14736
15108
  comp = replaceTildes(comp, options);
14737
- debug("tildes", comp);
15109
+ debug2("tildes", comp);
14738
15110
  comp = replaceXRanges(comp, options);
14739
- debug("xrange", comp);
15111
+ debug2("xrange", comp);
14740
15112
  comp = replaceStars(comp, options);
14741
- debug("stars", comp);
15113
+ debug2("stars", comp);
14742
15114
  return comp;
14743
15115
  };
14744
15116
  var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
@@ -14748,7 +15120,7 @@ var require_range = __commonJS({
14748
15120
  var replaceTilde = (comp, options) => {
14749
15121
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
14750
15122
  return comp.replace(r, (_, M, m, p, pr) => {
14751
- debug("tilde", comp, _, M, m, p, pr);
15123
+ debug2("tilde", comp, _, M, m, p, pr);
14752
15124
  let ret;
14753
15125
  if (isX(M)) {
14754
15126
  ret = "";
@@ -14757,12 +15129,12 @@ var require_range = __commonJS({
14757
15129
  } else if (isX(p)) {
14758
15130
  ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
14759
15131
  } else if (pr) {
14760
- debug("replaceTilde pr", pr);
15132
+ debug2("replaceTilde pr", pr);
14761
15133
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
14762
15134
  } else {
14763
15135
  ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
14764
15136
  }
14765
- debug("tilde return", ret);
15137
+ debug2("tilde return", ret);
14766
15138
  return ret;
14767
15139
  });
14768
15140
  };
@@ -14770,11 +15142,11 @@ var require_range = __commonJS({
14770
15142
  return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
14771
15143
  };
14772
15144
  var replaceCaret = (comp, options) => {
14773
- debug("caret", comp, options);
15145
+ debug2("caret", comp, options);
14774
15146
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
14775
15147
  const z2 = options.includePrerelease ? "-0" : "";
14776
15148
  return comp.replace(r, (_, M, m, p, pr) => {
14777
- debug("caret", comp, _, M, m, p, pr);
15149
+ debug2("caret", comp, _, M, m, p, pr);
14778
15150
  let ret;
14779
15151
  if (isX(M)) {
14780
15152
  ret = "";
@@ -14787,7 +15159,7 @@ var require_range = __commonJS({
14787
15159
  ret = `>=${M}.${m}.0${z2} <${+M + 1}.0.0-0`;
14788
15160
  }
14789
15161
  } else if (pr) {
14790
- debug("replaceCaret pr", pr);
15162
+ debug2("replaceCaret pr", pr);
14791
15163
  if (M === "0") {
14792
15164
  if (m === "0") {
14793
15165
  ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
@@ -14798,7 +15170,7 @@ var require_range = __commonJS({
14798
15170
  ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
14799
15171
  }
14800
15172
  } else {
14801
- debug("no pr");
15173
+ debug2("no pr");
14802
15174
  if (M === "0") {
14803
15175
  if (m === "0") {
14804
15176
  ret = `>=${M}.${m}.${p}${z2} <${M}.${m}.${+p + 1}-0`;
@@ -14809,19 +15181,19 @@ var require_range = __commonJS({
14809
15181
  ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
14810
15182
  }
14811
15183
  }
14812
- debug("caret return", ret);
15184
+ debug2("caret return", ret);
14813
15185
  return ret;
14814
15186
  });
14815
15187
  };
14816
15188
  var replaceXRanges = (comp, options) => {
14817
- debug("replaceXRanges", comp, options);
15189
+ debug2("replaceXRanges", comp, options);
14818
15190
  return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
14819
15191
  };
14820
15192
  var replaceXRange = (comp, options) => {
14821
15193
  comp = comp.trim();
14822
15194
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
14823
15195
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
14824
- debug("xRange", comp, ret, gtlt, M, m, p, pr);
15196
+ debug2("xRange", comp, ret, gtlt, M, m, p, pr);
14825
15197
  const xM = isX(M);
14826
15198
  const xm = xM || isX(m);
14827
15199
  const xp = xm || isX(p);
@@ -14868,16 +15240,16 @@ var require_range = __commonJS({
14868
15240
  } else if (xp) {
14869
15241
  ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
14870
15242
  }
14871
- debug("xRange return", ret);
15243
+ debug2("xRange return", ret);
14872
15244
  return ret;
14873
15245
  });
14874
15246
  };
14875
15247
  var replaceStars = (comp, options) => {
14876
- debug("replaceStars", comp, options);
15248
+ debug2("replaceStars", comp, options);
14877
15249
  return comp.trim().replace(re[t.STAR], "");
14878
15250
  };
14879
15251
  var replaceGTE0 = (comp, options) => {
14880
- debug("replaceGTE0", comp, options);
15252
+ debug2("replaceGTE0", comp, options);
14881
15253
  return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
14882
15254
  };
14883
15255
  var hyphenReplace = (incPr) => ($0, from3, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
@@ -14915,7 +15287,7 @@ var require_range = __commonJS({
14915
15287
  }
14916
15288
  if (version2.prerelease.length && !options.includePrerelease) {
14917
15289
  for (let i2 = 0; i2 < set.length; i2++) {
14918
- debug(set[i2].semver);
15290
+ debug2(set[i2].semver);
14919
15291
  if (set[i2].semver === Comparator.ANY) {
14920
15292
  continue;
14921
15293
  }
@@ -14952,7 +15324,7 @@ var require_comparator = __commonJS({
14952
15324
  }
14953
15325
  }
14954
15326
  comp = comp.trim().split(/\s+/).join(" ");
14955
- debug("comparator", comp, options);
15327
+ debug2("comparator", comp, options);
14956
15328
  this.options = options;
14957
15329
  this.loose = !!options.loose;
14958
15330
  this.parse(comp);
@@ -14961,7 +15333,7 @@ var require_comparator = __commonJS({
14961
15333
  } else {
14962
15334
  this.value = this.operator + this.semver.version;
14963
15335
  }
14964
- debug("comp", this);
15336
+ debug2("comp", this);
14965
15337
  }
14966
15338
  parse(comp) {
14967
15339
  const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
@@ -14983,7 +15355,7 @@ var require_comparator = __commonJS({
14983
15355
  return this.value;
14984
15356
  }
14985
15357
  test(version2) {
14986
- debug("Comparator.test", version2, this.options.loose);
15358
+ debug2("Comparator.test", version2, this.options.loose);
14987
15359
  if (this.semver === ANY || version2 === ANY) {
14988
15360
  return true;
14989
15361
  }
@@ -15040,7 +15412,7 @@ var require_comparator = __commonJS({
15040
15412
  var parseOptions = require_parse_options();
15041
15413
  var { safeRe: re, t } = require_re();
15042
15414
  var cmp = require_cmp();
15043
- var debug = require_debug();
15415
+ var debug2 = require_debug();
15044
15416
  var SemVer = require_semver();
15045
15417
  var Range = require_range();
15046
15418
  }
@@ -20473,173 +20845,940 @@ var require_dist_node26 = __commonJS({
20473
20845
  }
20474
20846
  });
20475
20847
 
20476
- // ../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json
20477
- var require_package = __commonJS({
20478
- "../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json"(exports, module) {
20479
- module.exports = {
20480
- name: "dotenv",
20481
- version: "16.4.5",
20482
- description: "Loads environment variables from .env file",
20483
- main: "lib/main.js",
20484
- types: "lib/main.d.ts",
20485
- exports: {
20486
- ".": {
20487
- types: "./lib/main.d.ts",
20488
- require: "./lib/main.js",
20489
- default: "./lib/main.js"
20490
- },
20491
- "./config": "./config.js",
20492
- "./config.js": "./config.js",
20493
- "./lib/env-options": "./lib/env-options.js",
20494
- "./lib/env-options.js": "./lib/env-options.js",
20495
- "./lib/cli-options": "./lib/cli-options.js",
20496
- "./lib/cli-options.js": "./lib/cli-options.js",
20497
- "./package.json": "./package.json"
20498
- },
20499
- scripts: {
20500
- "dts-check": "tsc --project tests/types/tsconfig.json",
20501
- lint: "standard",
20502
- "lint-readme": "standard-markdown",
20503
- pretest: "npm run lint && npm run dts-check",
20504
- test: "tap tests/*.js --100 -Rspec",
20505
- "test:coverage": "tap --coverage-report=lcov",
20506
- prerelease: "npm test",
20507
- release: "standard-version"
20508
- },
20509
- repository: {
20510
- type: "git",
20511
- url: "git://github.com/motdotla/dotenv.git"
20512
- },
20513
- funding: "https://dotenvx.com",
20514
- keywords: [
20515
- "dotenv",
20516
- "env",
20517
- ".env",
20518
- "environment",
20519
- "variables",
20520
- "config",
20521
- "settings"
20522
- ],
20523
- readmeFilename: "README.md",
20524
- license: "BSD-2-Clause",
20525
- devDependencies: {
20526
- "@definitelytyped/dtslint": "^0.0.133",
20527
- "@types/node": "^18.11.3",
20528
- decache: "^4.6.1",
20529
- sinon: "^14.0.1",
20530
- standard: "^17.0.0",
20531
- "standard-markdown": "^7.1.0",
20532
- "standard-version": "^9.5.0",
20533
- tap: "^16.3.0",
20534
- tar: "^6.1.11",
20535
- typescript: "^4.8.4"
20536
- },
20537
- engines: {
20538
- node: ">=12"
20539
- },
20540
- browser: {
20541
- fs: false
20848
+ // ../../../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
20849
+ var require_ms2 = __commonJS({
20850
+ "../../../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports, module) {
20851
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
20852
+ var s = 1e3;
20853
+ var m = s * 60;
20854
+ var h = m * 60;
20855
+ var d = h * 24;
20856
+ var w = d * 7;
20857
+ var y = d * 365.25;
20858
+ module.exports = function(val, options) {
20859
+ options = options || {};
20860
+ var type = typeof val;
20861
+ if (type === "string" && val.length > 0) {
20862
+ return parse(val);
20863
+ } else if (type === "number" && isFinite(val)) {
20864
+ return options.long ? fmtLong(val) : fmtShort(val);
20542
20865
  }
20866
+ throw new Error(
20867
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
20868
+ );
20543
20869
  };
20544
- }
20545
- });
20546
-
20547
- // ../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js
20548
- var require_main = __commonJS({
20549
- "../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js"(exports, module) {
20550
- init_define_ENV_DEFINED_IN_BUILD_STEP();
20551
- var fs3 = __require("fs");
20552
- var path4 = __require("path");
20553
- var os = __require("os");
20554
- var crypto3 = __require("crypto");
20555
- var packageJson = require_package();
20556
- var version2 = packageJson.version;
20557
- var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
20558
- function parse(src) {
20559
- const obj = {};
20560
- let lines = src.toString();
20561
- lines = lines.replace(/\r\n?/mg, "\n");
20562
- let match;
20563
- while ((match = LINE.exec(lines)) != null) {
20564
- const key = match[1];
20565
- let value = match[2] || "";
20566
- value = value.trim();
20567
- const maybeQuote = value[0];
20568
- value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
20569
- if (maybeQuote === '"') {
20570
- value = value.replace(/\\n/g, "\n");
20571
- value = value.replace(/\\r/g, "\r");
20572
- }
20573
- obj[key] = value;
20870
+ function parse(str) {
20871
+ str = String(str);
20872
+ if (str.length > 100) {
20873
+ return;
20574
20874
  }
20575
- return obj;
20576
- }
20577
- function _parseVault(options) {
20578
- const vaultPath = _vaultPath(options);
20579
- const result = DotenvModule.configDotenv({ path: vaultPath });
20580
- if (!result.parsed) {
20581
- const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
20582
- err.code = "MISSING_DATA";
20583
- throw err;
20875
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
20876
+ str
20877
+ );
20878
+ if (!match) {
20879
+ return;
20584
20880
  }
20585
- const keys = _dotenvKey(options).split(",");
20586
- const length = keys.length;
20587
- let decrypted;
20588
- for (let i2 = 0; i2 < length; i2++) {
20589
- try {
20590
- const key = keys[i2].trim();
20591
- const attrs = _instructions(result, key);
20592
- decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
20593
- break;
20594
- } catch (error) {
20595
- if (i2 + 1 >= length) {
20596
- throw error;
20597
- }
20598
- }
20881
+ var n = parseFloat(match[1]);
20882
+ var type = (match[2] || "ms").toLowerCase();
20883
+ switch (type) {
20884
+ case "years":
20885
+ case "year":
20886
+ case "yrs":
20887
+ case "yr":
20888
+ case "y":
20889
+ return n * y;
20890
+ case "weeks":
20891
+ case "week":
20892
+ case "w":
20893
+ return n * w;
20894
+ case "days":
20895
+ case "day":
20896
+ case "d":
20897
+ return n * d;
20898
+ case "hours":
20899
+ case "hour":
20900
+ case "hrs":
20901
+ case "hr":
20902
+ case "h":
20903
+ return n * h;
20904
+ case "minutes":
20905
+ case "minute":
20906
+ case "mins":
20907
+ case "min":
20908
+ case "m":
20909
+ return n * m;
20910
+ case "seconds":
20911
+ case "second":
20912
+ case "secs":
20913
+ case "sec":
20914
+ case "s":
20915
+ return n * s;
20916
+ case "milliseconds":
20917
+ case "millisecond":
20918
+ case "msecs":
20919
+ case "msec":
20920
+ case "ms":
20921
+ return n;
20922
+ default:
20923
+ return void 0;
20599
20924
  }
20600
- return DotenvModule.parse(decrypted);
20601
- }
20602
- function _log(message) {
20603
- console.log(`[dotenv@${version2}][INFO] ${message}`);
20604
- }
20605
- function _warn(message) {
20606
- console.log(`[dotenv@${version2}][WARN] ${message}`);
20607
20925
  }
20608
- function _debug(message) {
20609
- console.log(`[dotenv@${version2}][DEBUG] ${message}`);
20610
- }
20611
- function _dotenvKey(options) {
20612
- if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
20613
- return options.DOTENV_KEY;
20926
+ function fmtShort(ms) {
20927
+ var msAbs = Math.abs(ms);
20928
+ if (msAbs >= d) {
20929
+ return Math.round(ms / d) + "d";
20614
20930
  }
20615
- if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
20616
- return process.env.DOTENV_KEY;
20931
+ if (msAbs >= h) {
20932
+ return Math.round(ms / h) + "h";
20617
20933
  }
20618
- return "";
20619
- }
20620
- function _instructions(result, dotenvKey) {
20621
- let uri;
20622
- try {
20623
- uri = new URL(dotenvKey);
20624
- } catch (error) {
20625
- if (error.code === "ERR_INVALID_URL") {
20626
- const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
20627
- err.code = "INVALID_DOTENV_KEY";
20628
- throw err;
20629
- }
20630
- throw error;
20934
+ if (msAbs >= m) {
20935
+ return Math.round(ms / m) + "m";
20631
20936
  }
20632
- const key = uri.password;
20633
- if (!key) {
20634
- const err = new Error("INVALID_DOTENV_KEY: Missing key part");
20635
- err.code = "INVALID_DOTENV_KEY";
20636
- throw err;
20937
+ if (msAbs >= s) {
20938
+ return Math.round(ms / s) + "s";
20637
20939
  }
20638
- const environment = uri.searchParams.get("environment");
20639
- if (!environment) {
20640
- const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
20641
- err.code = "INVALID_DOTENV_KEY";
20642
- throw err;
20940
+ return ms + "ms";
20941
+ }
20942
+ function fmtLong(ms) {
20943
+ var msAbs = Math.abs(ms);
20944
+ if (msAbs >= d) {
20945
+ return plural(ms, msAbs, d, "day");
20946
+ }
20947
+ if (msAbs >= h) {
20948
+ return plural(ms, msAbs, h, "hour");
20949
+ }
20950
+ if (msAbs >= m) {
20951
+ return plural(ms, msAbs, m, "minute");
20952
+ }
20953
+ if (msAbs >= s) {
20954
+ return plural(ms, msAbs, s, "second");
20955
+ }
20956
+ return ms + " ms";
20957
+ }
20958
+ function plural(ms, msAbs, n, name) {
20959
+ var isPlural = msAbs >= n * 1.5;
20960
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
20961
+ }
20962
+ }
20963
+ });
20964
+
20965
+ // ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js
20966
+ var require_common = __commonJS({
20967
+ "../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/common.js"(exports, module) {
20968
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
20969
+ function setup(env) {
20970
+ createDebug.debug = createDebug;
20971
+ createDebug.default = createDebug;
20972
+ createDebug.coerce = coerce2;
20973
+ createDebug.disable = disable;
20974
+ createDebug.enable = enable;
20975
+ createDebug.enabled = enabled;
20976
+ createDebug.humanize = require_ms2();
20977
+ createDebug.destroy = destroy;
20978
+ Object.keys(env).forEach((key) => {
20979
+ createDebug[key] = env[key];
20980
+ });
20981
+ createDebug.names = [];
20982
+ createDebug.skips = [];
20983
+ createDebug.formatters = {};
20984
+ function selectColor(namespace) {
20985
+ let hash2 = 0;
20986
+ for (let i2 = 0; i2 < namespace.length; i2++) {
20987
+ hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i2);
20988
+ hash2 |= 0;
20989
+ }
20990
+ return createDebug.colors[Math.abs(hash2) % createDebug.colors.length];
20991
+ }
20992
+ createDebug.selectColor = selectColor;
20993
+ function createDebug(namespace) {
20994
+ let prevTime;
20995
+ let enableOverride = null;
20996
+ let namespacesCache;
20997
+ let enabledCache;
20998
+ function debug2(...args) {
20999
+ if (!debug2.enabled) {
21000
+ return;
21001
+ }
21002
+ const self2 = debug2;
21003
+ const curr = Number(/* @__PURE__ */ new Date());
21004
+ const ms = curr - (prevTime || curr);
21005
+ self2.diff = ms;
21006
+ self2.prev = prevTime;
21007
+ self2.curr = curr;
21008
+ prevTime = curr;
21009
+ args[0] = createDebug.coerce(args[0]);
21010
+ if (typeof args[0] !== "string") {
21011
+ args.unshift("%O");
21012
+ }
21013
+ let index = 0;
21014
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
21015
+ if (match === "%%") {
21016
+ return "%";
21017
+ }
21018
+ index++;
21019
+ const formatter = createDebug.formatters[format];
21020
+ if (typeof formatter === "function") {
21021
+ const val = args[index];
21022
+ match = formatter.call(self2, val);
21023
+ args.splice(index, 1);
21024
+ index--;
21025
+ }
21026
+ return match;
21027
+ });
21028
+ createDebug.formatArgs.call(self2, args);
21029
+ const logFn = self2.log || createDebug.log;
21030
+ logFn.apply(self2, args);
21031
+ }
21032
+ debug2.namespace = namespace;
21033
+ debug2.useColors = createDebug.useColors();
21034
+ debug2.color = createDebug.selectColor(namespace);
21035
+ debug2.extend = extend;
21036
+ debug2.destroy = createDebug.destroy;
21037
+ Object.defineProperty(debug2, "enabled", {
21038
+ enumerable: true,
21039
+ configurable: false,
21040
+ get: () => {
21041
+ if (enableOverride !== null) {
21042
+ return enableOverride;
21043
+ }
21044
+ if (namespacesCache !== createDebug.namespaces) {
21045
+ namespacesCache = createDebug.namespaces;
21046
+ enabledCache = createDebug.enabled(namespace);
21047
+ }
21048
+ return enabledCache;
21049
+ },
21050
+ set: (v) => {
21051
+ enableOverride = v;
21052
+ }
21053
+ });
21054
+ if (typeof createDebug.init === "function") {
21055
+ createDebug.init(debug2);
21056
+ }
21057
+ return debug2;
21058
+ }
21059
+ function extend(namespace, delimiter) {
21060
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
21061
+ newDebug.log = this.log;
21062
+ return newDebug;
21063
+ }
21064
+ function enable(namespaces) {
21065
+ createDebug.save(namespaces);
21066
+ createDebug.namespaces = namespaces;
21067
+ createDebug.names = [];
21068
+ createDebug.skips = [];
21069
+ let i2;
21070
+ const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
21071
+ const len = split.length;
21072
+ for (i2 = 0; i2 < len; i2++) {
21073
+ if (!split[i2]) {
21074
+ continue;
21075
+ }
21076
+ namespaces = split[i2].replace(/\*/g, ".*?");
21077
+ if (namespaces[0] === "-") {
21078
+ createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
21079
+ } else {
21080
+ createDebug.names.push(new RegExp("^" + namespaces + "$"));
21081
+ }
21082
+ }
21083
+ }
21084
+ function disable() {
21085
+ const namespaces = [
21086
+ ...createDebug.names.map(toNamespace),
21087
+ ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
21088
+ ].join(",");
21089
+ createDebug.enable("");
21090
+ return namespaces;
21091
+ }
21092
+ function enabled(name) {
21093
+ if (name[name.length - 1] === "*") {
21094
+ return true;
21095
+ }
21096
+ let i2;
21097
+ let len;
21098
+ for (i2 = 0, len = createDebug.skips.length; i2 < len; i2++) {
21099
+ if (createDebug.skips[i2].test(name)) {
21100
+ return false;
21101
+ }
21102
+ }
21103
+ for (i2 = 0, len = createDebug.names.length; i2 < len; i2++) {
21104
+ if (createDebug.names[i2].test(name)) {
21105
+ return true;
21106
+ }
21107
+ }
21108
+ return false;
21109
+ }
21110
+ function toNamespace(regexp) {
21111
+ return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
21112
+ }
21113
+ function coerce2(val) {
21114
+ if (val instanceof Error) {
21115
+ return val.stack || val.message;
21116
+ }
21117
+ return val;
21118
+ }
21119
+ function destroy() {
21120
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
21121
+ }
21122
+ createDebug.enable(createDebug.load());
21123
+ return createDebug;
21124
+ }
21125
+ module.exports = setup;
21126
+ }
21127
+ });
21128
+
21129
+ // ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js
21130
+ var require_browser = __commonJS({
21131
+ "../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports, module) {
21132
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
21133
+ exports.formatArgs = formatArgs;
21134
+ exports.save = save;
21135
+ exports.load = load;
21136
+ exports.useColors = useColors;
21137
+ exports.storage = localstorage();
21138
+ exports.destroy = /* @__PURE__ */ (() => {
21139
+ let warned = false;
21140
+ return () => {
21141
+ if (!warned) {
21142
+ warned = true;
21143
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
21144
+ }
21145
+ };
21146
+ })();
21147
+ exports.colors = [
21148
+ "#0000CC",
21149
+ "#0000FF",
21150
+ "#0033CC",
21151
+ "#0033FF",
21152
+ "#0066CC",
21153
+ "#0066FF",
21154
+ "#0099CC",
21155
+ "#0099FF",
21156
+ "#00CC00",
21157
+ "#00CC33",
21158
+ "#00CC66",
21159
+ "#00CC99",
21160
+ "#00CCCC",
21161
+ "#00CCFF",
21162
+ "#3300CC",
21163
+ "#3300FF",
21164
+ "#3333CC",
21165
+ "#3333FF",
21166
+ "#3366CC",
21167
+ "#3366FF",
21168
+ "#3399CC",
21169
+ "#3399FF",
21170
+ "#33CC00",
21171
+ "#33CC33",
21172
+ "#33CC66",
21173
+ "#33CC99",
21174
+ "#33CCCC",
21175
+ "#33CCFF",
21176
+ "#6600CC",
21177
+ "#6600FF",
21178
+ "#6633CC",
21179
+ "#6633FF",
21180
+ "#66CC00",
21181
+ "#66CC33",
21182
+ "#9900CC",
21183
+ "#9900FF",
21184
+ "#9933CC",
21185
+ "#9933FF",
21186
+ "#99CC00",
21187
+ "#99CC33",
21188
+ "#CC0000",
21189
+ "#CC0033",
21190
+ "#CC0066",
21191
+ "#CC0099",
21192
+ "#CC00CC",
21193
+ "#CC00FF",
21194
+ "#CC3300",
21195
+ "#CC3333",
21196
+ "#CC3366",
21197
+ "#CC3399",
21198
+ "#CC33CC",
21199
+ "#CC33FF",
21200
+ "#CC6600",
21201
+ "#CC6633",
21202
+ "#CC9900",
21203
+ "#CC9933",
21204
+ "#CCCC00",
21205
+ "#CCCC33",
21206
+ "#FF0000",
21207
+ "#FF0033",
21208
+ "#FF0066",
21209
+ "#FF0099",
21210
+ "#FF00CC",
21211
+ "#FF00FF",
21212
+ "#FF3300",
21213
+ "#FF3333",
21214
+ "#FF3366",
21215
+ "#FF3399",
21216
+ "#FF33CC",
21217
+ "#FF33FF",
21218
+ "#FF6600",
21219
+ "#FF6633",
21220
+ "#FF9900",
21221
+ "#FF9933",
21222
+ "#FFCC00",
21223
+ "#FFCC33"
21224
+ ];
21225
+ function useColors() {
21226
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
21227
+ return true;
21228
+ }
21229
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
21230
+ return false;
21231
+ }
21232
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
21233
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
21234
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
21235
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
21236
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
21237
+ }
21238
+ function formatArgs(args) {
21239
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
21240
+ if (!this.useColors) {
21241
+ return;
21242
+ }
21243
+ const c = "color: " + this.color;
21244
+ args.splice(1, 0, c, "color: inherit");
21245
+ let index = 0;
21246
+ let lastC = 0;
21247
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
21248
+ if (match === "%%") {
21249
+ return;
21250
+ }
21251
+ index++;
21252
+ if (match === "%c") {
21253
+ lastC = index;
21254
+ }
21255
+ });
21256
+ args.splice(lastC, 0, c);
21257
+ }
21258
+ exports.log = console.debug || console.log || (() => {
21259
+ });
21260
+ function save(namespaces) {
21261
+ try {
21262
+ if (namespaces) {
21263
+ exports.storage.setItem("debug", namespaces);
21264
+ } else {
21265
+ exports.storage.removeItem("debug");
21266
+ }
21267
+ } catch (error) {
21268
+ }
21269
+ }
21270
+ function load() {
21271
+ let r;
21272
+ try {
21273
+ r = exports.storage.getItem("debug");
21274
+ } catch (error) {
21275
+ }
21276
+ if (!r && typeof process !== "undefined" && "env" in process) {
21277
+ r = process.env.DEBUG;
21278
+ }
21279
+ return r;
21280
+ }
21281
+ function localstorage() {
21282
+ try {
21283
+ return localStorage;
21284
+ } catch (error) {
21285
+ }
21286
+ }
21287
+ module.exports = require_common()(exports);
21288
+ var { formatters } = module.exports;
21289
+ formatters.j = function(v) {
21290
+ try {
21291
+ return JSON.stringify(v);
21292
+ } catch (error) {
21293
+ return "[UnexpectedJSONParseError]: " + error.message;
21294
+ }
21295
+ };
21296
+ }
21297
+ });
21298
+
21299
+ // ../../../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
21300
+ var require_has_flag = __commonJS({
21301
+ "../../../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
21302
+ "use strict";
21303
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
21304
+ module.exports = (flag, argv = process.argv) => {
21305
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
21306
+ const position = argv.indexOf(prefix + flag);
21307
+ const terminatorPosition = argv.indexOf("--");
21308
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
21309
+ };
21310
+ }
21311
+ });
21312
+
21313
+ // ../../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
21314
+ var require_supports_color = __commonJS({
21315
+ "../../../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module) {
21316
+ "use strict";
21317
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
21318
+ var os = __require("os");
21319
+ var tty = __require("tty");
21320
+ var hasFlag = require_has_flag();
21321
+ var { env } = process;
21322
+ var flagForceColor;
21323
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
21324
+ flagForceColor = 0;
21325
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
21326
+ flagForceColor = 1;
21327
+ }
21328
+ function envForceColor() {
21329
+ if ("FORCE_COLOR" in env) {
21330
+ if (env.FORCE_COLOR === "true") {
21331
+ return 1;
21332
+ }
21333
+ if (env.FORCE_COLOR === "false") {
21334
+ return 0;
21335
+ }
21336
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
21337
+ }
21338
+ }
21339
+ function translateLevel(level) {
21340
+ if (level === 0) {
21341
+ return false;
21342
+ }
21343
+ return {
21344
+ level,
21345
+ hasBasic: true,
21346
+ has256: level >= 2,
21347
+ has16m: level >= 3
21348
+ };
21349
+ }
21350
+ function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
21351
+ const noFlagForceColor = envForceColor();
21352
+ if (noFlagForceColor !== void 0) {
21353
+ flagForceColor = noFlagForceColor;
21354
+ }
21355
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
21356
+ if (forceColor === 0) {
21357
+ return 0;
21358
+ }
21359
+ if (sniffFlags) {
21360
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
21361
+ return 3;
21362
+ }
21363
+ if (hasFlag("color=256")) {
21364
+ return 2;
21365
+ }
21366
+ }
21367
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
21368
+ return 0;
21369
+ }
21370
+ const min = forceColor || 0;
21371
+ if (env.TERM === "dumb") {
21372
+ return min;
21373
+ }
21374
+ if (process.platform === "win32") {
21375
+ const osRelease = os.release().split(".");
21376
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
21377
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
21378
+ }
21379
+ return 1;
21380
+ }
21381
+ if ("CI" in env) {
21382
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
21383
+ return 1;
21384
+ }
21385
+ return min;
21386
+ }
21387
+ if ("TEAMCITY_VERSION" in env) {
21388
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
21389
+ }
21390
+ if (env.COLORTERM === "truecolor") {
21391
+ return 3;
21392
+ }
21393
+ if ("TERM_PROGRAM" in env) {
21394
+ const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
21395
+ switch (env.TERM_PROGRAM) {
21396
+ case "iTerm.app":
21397
+ return version2 >= 3 ? 3 : 2;
21398
+ case "Apple_Terminal":
21399
+ return 2;
21400
+ }
21401
+ }
21402
+ if (/-256(color)?$/i.test(env.TERM)) {
21403
+ return 2;
21404
+ }
21405
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
21406
+ return 1;
21407
+ }
21408
+ if ("COLORTERM" in env) {
21409
+ return 1;
21410
+ }
21411
+ return min;
21412
+ }
21413
+ function getSupportLevel(stream, options = {}) {
21414
+ const level = supportsColor(stream, {
21415
+ streamIsTTY: stream && stream.isTTY,
21416
+ ...options
21417
+ });
21418
+ return translateLevel(level);
21419
+ }
21420
+ module.exports = {
21421
+ supportsColor: getSupportLevel,
21422
+ stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
21423
+ stderr: getSupportLevel({ isTTY: tty.isatty(2) })
21424
+ };
21425
+ }
21426
+ });
21427
+
21428
+ // ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js
21429
+ var require_node = __commonJS({
21430
+ "../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/node.js"(exports, module) {
21431
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
21432
+ var tty = __require("tty");
21433
+ var util2 = __require("util");
21434
+ exports.init = init;
21435
+ exports.log = log2;
21436
+ exports.formatArgs = formatArgs;
21437
+ exports.save = save;
21438
+ exports.load = load;
21439
+ exports.useColors = useColors;
21440
+ exports.destroy = util2.deprecate(
21441
+ () => {
21442
+ },
21443
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
21444
+ );
21445
+ exports.colors = [6, 2, 3, 4, 5, 1];
21446
+ try {
21447
+ const supportsColor = require_supports_color();
21448
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
21449
+ exports.colors = [
21450
+ 20,
21451
+ 21,
21452
+ 26,
21453
+ 27,
21454
+ 32,
21455
+ 33,
21456
+ 38,
21457
+ 39,
21458
+ 40,
21459
+ 41,
21460
+ 42,
21461
+ 43,
21462
+ 44,
21463
+ 45,
21464
+ 56,
21465
+ 57,
21466
+ 62,
21467
+ 63,
21468
+ 68,
21469
+ 69,
21470
+ 74,
21471
+ 75,
21472
+ 76,
21473
+ 77,
21474
+ 78,
21475
+ 79,
21476
+ 80,
21477
+ 81,
21478
+ 92,
21479
+ 93,
21480
+ 98,
21481
+ 99,
21482
+ 112,
21483
+ 113,
21484
+ 128,
21485
+ 129,
21486
+ 134,
21487
+ 135,
21488
+ 148,
21489
+ 149,
21490
+ 160,
21491
+ 161,
21492
+ 162,
21493
+ 163,
21494
+ 164,
21495
+ 165,
21496
+ 166,
21497
+ 167,
21498
+ 168,
21499
+ 169,
21500
+ 170,
21501
+ 171,
21502
+ 172,
21503
+ 173,
21504
+ 178,
21505
+ 179,
21506
+ 184,
21507
+ 185,
21508
+ 196,
21509
+ 197,
21510
+ 198,
21511
+ 199,
21512
+ 200,
21513
+ 201,
21514
+ 202,
21515
+ 203,
21516
+ 204,
21517
+ 205,
21518
+ 206,
21519
+ 207,
21520
+ 208,
21521
+ 209,
21522
+ 214,
21523
+ 215,
21524
+ 220,
21525
+ 221
21526
+ ];
21527
+ }
21528
+ } catch (error) {
21529
+ }
21530
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
21531
+ return /^debug_/i.test(key);
21532
+ }).reduce((obj, key) => {
21533
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
21534
+ return k.toUpperCase();
21535
+ });
21536
+ let val = process.env[key];
21537
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
21538
+ val = true;
21539
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
21540
+ val = false;
21541
+ } else if (val === "null") {
21542
+ val = null;
21543
+ } else {
21544
+ val = Number(val);
21545
+ }
21546
+ obj[prop] = val;
21547
+ return obj;
21548
+ }, {});
21549
+ function useColors() {
21550
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
21551
+ }
21552
+ function formatArgs(args) {
21553
+ const { namespace: name, useColors: useColors2 } = this;
21554
+ if (useColors2) {
21555
+ const c = this.color;
21556
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
21557
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
21558
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
21559
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
21560
+ } else {
21561
+ args[0] = getDate() + name + " " + args[0];
21562
+ }
21563
+ }
21564
+ function getDate() {
21565
+ if (exports.inspectOpts.hideDate) {
21566
+ return "";
21567
+ }
21568
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
21569
+ }
21570
+ function log2(...args) {
21571
+ return process.stderr.write(util2.format(...args) + "\n");
21572
+ }
21573
+ function save(namespaces) {
21574
+ if (namespaces) {
21575
+ process.env.DEBUG = namespaces;
21576
+ } else {
21577
+ delete process.env.DEBUG;
21578
+ }
21579
+ }
21580
+ function load() {
21581
+ return process.env.DEBUG;
21582
+ }
21583
+ function init(debug2) {
21584
+ debug2.inspectOpts = {};
21585
+ const keys = Object.keys(exports.inspectOpts);
21586
+ for (let i2 = 0; i2 < keys.length; i2++) {
21587
+ debug2.inspectOpts[keys[i2]] = exports.inspectOpts[keys[i2]];
21588
+ }
21589
+ }
21590
+ module.exports = require_common()(exports);
21591
+ var { formatters } = module.exports;
21592
+ formatters.o = function(v) {
21593
+ this.inspectOpts.colors = this.useColors;
21594
+ return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
21595
+ };
21596
+ formatters.O = function(v) {
21597
+ this.inspectOpts.colors = this.useColors;
21598
+ return util2.inspect(v, this.inspectOpts);
21599
+ };
21600
+ }
21601
+ });
21602
+
21603
+ // ../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js
21604
+ var require_src = __commonJS({
21605
+ "../../../../node_modules/.pnpm/debug@4.3.4_supports-color@8.1.1/node_modules/debug/src/index.js"(exports, module) {
21606
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
21607
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
21608
+ module.exports = require_browser();
21609
+ } else {
21610
+ module.exports = require_node();
21611
+ }
21612
+ }
21613
+ });
21614
+
21615
+ // ../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json
21616
+ var require_package = __commonJS({
21617
+ "../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/package.json"(exports, module) {
21618
+ module.exports = {
21619
+ name: "dotenv",
21620
+ version: "16.4.5",
21621
+ description: "Loads environment variables from .env file",
21622
+ main: "lib/main.js",
21623
+ types: "lib/main.d.ts",
21624
+ exports: {
21625
+ ".": {
21626
+ types: "./lib/main.d.ts",
21627
+ require: "./lib/main.js",
21628
+ default: "./lib/main.js"
21629
+ },
21630
+ "./config": "./config.js",
21631
+ "./config.js": "./config.js",
21632
+ "./lib/env-options": "./lib/env-options.js",
21633
+ "./lib/env-options.js": "./lib/env-options.js",
21634
+ "./lib/cli-options": "./lib/cli-options.js",
21635
+ "./lib/cli-options.js": "./lib/cli-options.js",
21636
+ "./package.json": "./package.json"
21637
+ },
21638
+ scripts: {
21639
+ "dts-check": "tsc --project tests/types/tsconfig.json",
21640
+ lint: "standard",
21641
+ "lint-readme": "standard-markdown",
21642
+ pretest: "npm run lint && npm run dts-check",
21643
+ test: "tap tests/*.js --100 -Rspec",
21644
+ "test:coverage": "tap --coverage-report=lcov",
21645
+ prerelease: "npm test",
21646
+ release: "standard-version"
21647
+ },
21648
+ repository: {
21649
+ type: "git",
21650
+ url: "git://github.com/motdotla/dotenv.git"
21651
+ },
21652
+ funding: "https://dotenvx.com",
21653
+ keywords: [
21654
+ "dotenv",
21655
+ "env",
21656
+ ".env",
21657
+ "environment",
21658
+ "variables",
21659
+ "config",
21660
+ "settings"
21661
+ ],
21662
+ readmeFilename: "README.md",
21663
+ license: "BSD-2-Clause",
21664
+ devDependencies: {
21665
+ "@definitelytyped/dtslint": "^0.0.133",
21666
+ "@types/node": "^18.11.3",
21667
+ decache: "^4.6.1",
21668
+ sinon: "^14.0.1",
21669
+ standard: "^17.0.0",
21670
+ "standard-markdown": "^7.1.0",
21671
+ "standard-version": "^9.5.0",
21672
+ tap: "^16.3.0",
21673
+ tar: "^6.1.11",
21674
+ typescript: "^4.8.4"
21675
+ },
21676
+ engines: {
21677
+ node: ">=12"
21678
+ },
21679
+ browser: {
21680
+ fs: false
21681
+ }
21682
+ };
21683
+ }
21684
+ });
21685
+
21686
+ // ../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js
21687
+ var require_main = __commonJS({
21688
+ "../../../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js"(exports, module) {
21689
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
21690
+ var fs3 = __require("fs");
21691
+ var path4 = __require("path");
21692
+ var os = __require("os");
21693
+ var crypto3 = __require("crypto");
21694
+ var packageJson = require_package();
21695
+ var version2 = packageJson.version;
21696
+ var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
21697
+ function parse(src) {
21698
+ const obj = {};
21699
+ let lines = src.toString();
21700
+ lines = lines.replace(/\r\n?/mg, "\n");
21701
+ let match;
21702
+ while ((match = LINE.exec(lines)) != null) {
21703
+ const key = match[1];
21704
+ let value = match[2] || "";
21705
+ value = value.trim();
21706
+ const maybeQuote = value[0];
21707
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
21708
+ if (maybeQuote === '"') {
21709
+ value = value.replace(/\\n/g, "\n");
21710
+ value = value.replace(/\\r/g, "\r");
21711
+ }
21712
+ obj[key] = value;
21713
+ }
21714
+ return obj;
21715
+ }
21716
+ function _parseVault(options) {
21717
+ const vaultPath = _vaultPath(options);
21718
+ const result = DotenvModule.configDotenv({ path: vaultPath });
21719
+ if (!result.parsed) {
21720
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
21721
+ err.code = "MISSING_DATA";
21722
+ throw err;
21723
+ }
21724
+ const keys = _dotenvKey(options).split(",");
21725
+ const length = keys.length;
21726
+ let decrypted;
21727
+ for (let i2 = 0; i2 < length; i2++) {
21728
+ try {
21729
+ const key = keys[i2].trim();
21730
+ const attrs = _instructions(result, key);
21731
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
21732
+ break;
21733
+ } catch (error) {
21734
+ if (i2 + 1 >= length) {
21735
+ throw error;
21736
+ }
21737
+ }
21738
+ }
21739
+ return DotenvModule.parse(decrypted);
21740
+ }
21741
+ function _log(message) {
21742
+ console.log(`[dotenv@${version2}][INFO] ${message}`);
21743
+ }
21744
+ function _warn(message) {
21745
+ console.log(`[dotenv@${version2}][WARN] ${message}`);
21746
+ }
21747
+ function _debug2(message) {
21748
+ console.log(`[dotenv@${version2}][DEBUG] ${message}`);
21749
+ }
21750
+ function _dotenvKey(options) {
21751
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
21752
+ return options.DOTENV_KEY;
21753
+ }
21754
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
21755
+ return process.env.DOTENV_KEY;
21756
+ }
21757
+ return "";
21758
+ }
21759
+ function _instructions(result, dotenvKey) {
21760
+ let uri;
21761
+ try {
21762
+ uri = new URL(dotenvKey);
21763
+ } catch (error) {
21764
+ if (error.code === "ERR_INVALID_URL") {
21765
+ const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
21766
+ err.code = "INVALID_DOTENV_KEY";
21767
+ throw err;
21768
+ }
21769
+ throw error;
21770
+ }
21771
+ const key = uri.password;
21772
+ if (!key) {
21773
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
21774
+ err.code = "INVALID_DOTENV_KEY";
21775
+ throw err;
21776
+ }
21777
+ const environment = uri.searchParams.get("environment");
21778
+ if (!environment) {
21779
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
21780
+ err.code = "INVALID_DOTENV_KEY";
21781
+ throw err;
20643
21782
  }
20644
21783
  const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
20645
21784
  const ciphertext = result.parsed[environmentKey];
@@ -20686,12 +21825,12 @@ var require_main = __commonJS({
20686
21825
  function configDotenv(options) {
20687
21826
  const dotenvPath = path4.resolve(process.cwd(), ".env");
20688
21827
  let encoding = "utf8";
20689
- const debug = Boolean(options && options.debug);
21828
+ const debug2 = Boolean(options && options.debug);
20690
21829
  if (options && options.encoding) {
20691
21830
  encoding = options.encoding;
20692
21831
  } else {
20693
- if (debug) {
20694
- _debug("No encoding is specified. UTF-8 is used by default");
21832
+ if (debug2) {
21833
+ _debug2("No encoding is specified. UTF-8 is used by default");
20695
21834
  }
20696
21835
  }
20697
21836
  let optionPaths = [dotenvPath];
@@ -20712,8 +21851,8 @@ var require_main = __commonJS({
20712
21851
  const parsed = DotenvModule.parse(fs3.readFileSync(path5, { encoding }));
20713
21852
  DotenvModule.populate(parsedAll, parsed, options);
20714
21853
  } catch (e) {
20715
- if (debug) {
20716
- _debug(`Failed to load ${path5} ${e.message}`);
21854
+ if (debug2) {
21855
+ _debug2(`Failed to load ${path5} ${e.message}`);
20717
21856
  }
20718
21857
  lastError = e;
20719
21858
  }
@@ -20768,7 +21907,7 @@ var require_main = __commonJS({
20768
21907
  }
20769
21908
  }
20770
21909
  function populate(processEnv, parsed, options = {}) {
20771
- const debug = Boolean(options && options.debug);
21910
+ const debug2 = Boolean(options && options.debug);
20772
21911
  const override = Boolean(options && options.override);
20773
21912
  if (typeof parsed !== "object") {
20774
21913
  const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
@@ -20780,11 +21919,11 @@ var require_main = __commonJS({
20780
21919
  if (override === true) {
20781
21920
  processEnv[key] = parsed[key];
20782
21921
  }
20783
- if (debug) {
21922
+ if (debug2) {
20784
21923
  if (override === true) {
20785
- _debug(`"${key}" is already defined and WAS overwritten`);
21924
+ _debug2(`"${key}" is already defined and WAS overwritten`);
20786
21925
  } else {
20787
- _debug(`"${key}" is already defined and was NOT overwritten`);
21926
+ _debug2(`"${key}" is already defined and was NOT overwritten`);
20788
21927
  }
20789
21928
  }
20790
21929
  } else {
@@ -20968,7 +22107,8 @@ var InternalProjectSettings = import_typebox4.Type.Object({
20968
22107
  "messageLintRule.inlang.patternInvalid": "warning"
20969
22108
  }
20970
22109
  ]
20971
- }))
22110
+ })),
22111
+ experimental: import_typebox4.Type.Optional(import_typebox4.Type.Record(import_typebox4.Type.String(), import_typebox4.Type.Literal(true)))
20972
22112
  });
20973
22113
  var ExternalProjectSettings = import_typebox4.Type.Record(
20974
22114
  import_typebox4.Type.String({
@@ -21123,6 +22263,7 @@ var Variant = import_typebox8.Type.Object({
21123
22263
  });
21124
22264
  var Message = import_typebox8.Type.Object({
21125
22265
  id: import_typebox8.Type.String(),
22266
+ alias: import_typebox8.Type.Record(import_typebox8.Type.String(), import_typebox8.Type.String()),
21126
22267
  /**
21127
22268
  * The order in which the selectors are placed determines the precedence of patterns.
21128
22269
  */
@@ -22526,23 +23667,34 @@ var ReactiveMap = class extends Map {
22526
23667
  // ../../sdk/dist/createMessagesQuery.js
22527
23668
  function createMessagesQuery(messages) {
22528
23669
  const index = new ReactiveMap();
23670
+ const defaultAliasIndex = new ReactiveMap();
22529
23671
  createEffect2(() => {
22530
23672
  index.clear();
22531
23673
  for (const message of structuredClone(messages())) {
22532
23674
  index.set(message.id, message);
23675
+ if ("default" in message.alias) {
23676
+ defaultAliasIndex.set(message.alias.default, message);
23677
+ }
22533
23678
  }
22534
23679
  });
22535
23680
  const get = (args) => index.get(args.where.id);
23681
+ const getByDefaultAlias = (alias) => defaultAliasIndex.get(alias);
22536
23682
  return {
22537
23683
  create: ({ data }) => {
22538
23684
  if (index.has(data.id))
22539
23685
  return false;
22540
23686
  index.set(data.id, data);
23687
+ if ("default" in data.alias) {
23688
+ defaultAliasIndex.set(data.alias.default, data);
23689
+ }
22541
23690
  return true;
22542
23691
  },
22543
23692
  get: Object.assign(get, {
22544
23693
  subscribe: (args, callback) => createSubscribable(() => get(args)).subscribe(callback)
22545
23694
  }),
23695
+ getByDefaultAlias: Object.assign(getByDefaultAlias, {
23696
+ subscribe: (alias, callback) => createSubscribable(() => getByDefaultAlias(alias)).subscribe(callback)
23697
+ }),
22546
23698
  includedMessageIds: createSubscribable(() => {
22547
23699
  return [...index.keys()];
22548
23700
  }),
@@ -22560,80 +23712,27 @@ function createMessagesQuery(messages) {
22560
23712
  const message = index.get(where.id);
22561
23713
  if (message === void 0) {
22562
23714
  index.set(where.id, data);
23715
+ if ("default" in data.alias) {
23716
+ defaultAliasIndex.set(data.alias.default, data);
23717
+ }
22563
23718
  } else {
22564
23719
  index.set(where.id, { ...message, ...data });
22565
23720
  }
22566
23721
  return true;
22567
23722
  },
22568
23723
  delete: ({ where }) => {
22569
- if (!index.has(where.id))
23724
+ const message = index.get(where.id);
23725
+ if (message === void 0)
22570
23726
  return false;
23727
+ if ("default" in message.alias) {
23728
+ defaultAliasIndex.delete(message.alias.default);
23729
+ }
22571
23730
  index.delete(where.id);
22572
23731
  return true;
22573
23732
  }
22574
23733
  };
22575
23734
  }
22576
23735
 
22577
- // ../../../../node_modules/.pnpm/throttle-debounce@5.0.0/node_modules/throttle-debounce/esm/index.js
22578
- init_define_ENV_DEFINED_IN_BUILD_STEP();
22579
- function throttle(delay, callback, options) {
22580
- var _ref = options || {}, _ref$noTrailing = _ref.noTrailing, noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing, _ref$noLeading = _ref.noLeading, noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading, _ref$debounceMode = _ref.debounceMode, debounceMode = _ref$debounceMode === void 0 ? void 0 : _ref$debounceMode;
22581
- var timeoutID;
22582
- var cancelled = false;
22583
- var lastExec = 0;
22584
- function clearExistingTimeout() {
22585
- if (timeoutID) {
22586
- clearTimeout(timeoutID);
22587
- }
22588
- }
22589
- function cancel(options2) {
22590
- var _ref2 = options2 || {}, _ref2$upcomingOnly = _ref2.upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
22591
- clearExistingTimeout();
22592
- cancelled = !upcomingOnly;
22593
- }
22594
- function wrapper() {
22595
- for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
22596
- arguments_[_key] = arguments[_key];
22597
- }
22598
- var self2 = this;
22599
- var elapsed = Date.now() - lastExec;
22600
- if (cancelled) {
22601
- return;
22602
- }
22603
- function exec() {
22604
- lastExec = Date.now();
22605
- callback.apply(self2, arguments_);
22606
- }
22607
- function clear() {
22608
- timeoutID = void 0;
22609
- }
22610
- if (!noLeading && debounceMode && !timeoutID) {
22611
- exec();
22612
- }
22613
- clearExistingTimeout();
22614
- if (debounceMode === void 0 && elapsed > delay) {
22615
- if (noLeading) {
22616
- lastExec = Date.now();
22617
- if (!noTrailing) {
22618
- timeoutID = setTimeout(debounceMode ? clear : exec, delay);
22619
- }
22620
- } else {
22621
- exec();
22622
- }
22623
- } else if (noTrailing !== true) {
22624
- timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
22625
- }
22626
- }
22627
- wrapper.cancel = cancel;
22628
- return wrapper;
22629
- }
22630
- function debounce(delay, callback, options) {
22631
- var _ref = options || {}, _ref$atBegin = _ref.atBegin, atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
22632
- return throttle(delay, callback, {
22633
- debounceMode: atBegin !== false
22634
- });
22635
- }
22636
-
22637
23736
  // ../../sdk/dist/createMessageLintReportsQuery.js
22638
23737
  init_define_ENV_DEFINED_IN_BUILD_STEP();
22639
23738
 
@@ -22688,7 +23787,7 @@ var lintSingleMessage = async (args) => {
22688
23787
  init_define_ENV_DEFINED_IN_BUILD_STEP();
22689
23788
 
22690
23789
  // ../../sdk/dist/createMessageLintReportsQuery.js
22691
- function createMessageLintReportsQuery(messagesQuery, settings, installedMessageLintRules, resolvedModules, hasWatcher) {
23790
+ function createMessageLintReportsQuery(messagesQuery, settings, installedMessageLintRules, resolvedModules) {
22692
23791
  const index = new ReactiveMap();
22693
23792
  const modules = resolvedModules();
22694
23793
  const rulesArray = modules == null ? void 0 : modules.messageLintRules;
@@ -22700,37 +23799,44 @@ function createMessageLintReportsQuery(messagesQuery, settings, installedMessage
22700
23799
  };
22701
23800
  };
22702
23801
  const messages = messagesQuery.getAll();
23802
+ const trackedMessages = /* @__PURE__ */ new Map();
22703
23803
  createEffect2(() => {
23804
+ const currentMessageIds = new Set(messagesQuery.includedMessageIds());
23805
+ const deletedTrackedMessages = [...trackedMessages].filter((tracked) => !currentMessageIds.has(tracked[0]));
22704
23806
  if (rulesArray) {
22705
- for (const messageId of messagesQuery.includedMessageIds()) {
22706
- createEffect2(() => {
22707
- const message = messagesQuery.get({ where: { id: messageId } });
22708
- if (hasWatcher) {
22709
- lintSingleMessage({
22710
- rules: rulesArray,
22711
- settings: settingsObject(),
22712
- messages,
22713
- message
22714
- }).then((report) => {
22715
- if (report.errors.length === 0 && index.get(messageId) !== report.data) {
22716
- index.set(messageId, report.data);
23807
+ for (const messageId of currentMessageIds) {
23808
+ if (!trackedMessages.has(messageId)) {
23809
+ createRoot2((dispose) => {
23810
+ createEffect2(() => {
23811
+ const message = messagesQuery.get({ where: { id: messageId } });
23812
+ if (!message) {
23813
+ return;
23814
+ }
23815
+ if (!(trackedMessages == null ? void 0 : trackedMessages.has(messageId))) {
23816
+ trackedMessages == null ? void 0 : trackedMessages.set(messageId, dispose);
22717
23817
  }
22718
- });
22719
- } else {
22720
- debounce(500, (message2) => {
22721
23818
  lintSingleMessage({
22722
23819
  rules: rulesArray,
22723
23820
  settings: settingsObject(),
22724
23821
  messages,
22725
- message: message2
23822
+ message
22726
23823
  }).then((report) => {
22727
23824
  if (report.errors.length === 0 && index.get(messageId) !== report.data) {
22728
23825
  index.set(messageId, report.data);
22729
23826
  }
22730
23827
  });
22731
- }, { atBegin: false })(message);
22732
- }
22733
- });
23828
+ });
23829
+ });
23830
+ }
23831
+ }
23832
+ for (const deletedMessage of deletedTrackedMessages) {
23833
+ const deletedMessageId = deletedMessage[0];
23834
+ const messageEffectDisposeFunction = trackedMessages.get(deletedMessageId);
23835
+ if (messageEffectDisposeFunction) {
23836
+ messageEffectDisposeFunction();
23837
+ trackedMessages.delete(deletedMessageId);
23838
+ index.delete(deletedMessageId);
23839
+ }
22734
23840
  }
22735
23841
  }
22736
23842
  });
@@ -22867,12 +23973,1128 @@ var createNodeishFsWithAbsolutePaths = (args) => {
22867
23973
  // @ts-expect-error
22868
23974
  readFile: (path4, options) => args.nodeishFs.readFile(makeAbsolute(path4), options),
22869
23975
  readdir: (path4) => args.nodeishFs.readdir(makeAbsolute(path4)),
22870
- mkdir: (path4) => args.nodeishFs.mkdir(makeAbsolute(path4)),
23976
+ mkdir: (path4, options) => args.nodeishFs.mkdir(makeAbsolute(path4), options),
22871
23977
  writeFile: (path4, data) => args.nodeishFs.writeFile(makeAbsolute(path4), data),
22872
- watch: (path4, options) => args.nodeishFs.watch(makeAbsolute(path4), options)
23978
+ stat: (path4) => args.nodeishFs.stat(makeAbsolute(path4)),
23979
+ rm: (path4) => args.nodeishFs.rm(makeAbsolute(path4)),
23980
+ rmdir: (path4) => args.nodeishFs.rmdir(makeAbsolute(path4)),
23981
+ watch: (path4, options) => args.nodeishFs.watch(makeAbsolute(path4), options),
23982
+ // This might be surprising when symlinks were intended to be relative
23983
+ symlink: (target, path4) => args.nodeishFs.symlink(makeAbsolute(target), makeAbsolute(path4)),
23984
+ unlink: (path4) => args.nodeishFs.unlink(makeAbsolute(path4)),
23985
+ readlink: (path4) => args.nodeishFs.readlink(makeAbsolute(path4)),
23986
+ lstat: (path4) => args.nodeishFs.lstat(makeAbsolute(path4))
22873
23987
  };
22874
23988
  };
22875
23989
 
23990
+ // ../../sdk/dist/migrations/migrateToDirectory.js
23991
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
23992
+ var maybeMigrateToDirectory = async (args) => {
23993
+ if (args.projectPath.endsWith("project.inlang") === false) {
23994
+ return;
23995
+ }
23996
+ const projectDirectory = await tryCatch(() => args.nodeishFs.stat(args.projectPath));
23997
+ if (projectDirectory.data) {
23998
+ return;
23999
+ }
24000
+ const settingsFile = await tryCatch(() => args.nodeishFs.readFile(args.projectPath + ".json", { encoding: "utf-8" }));
24001
+ if (settingsFile.error) {
24002
+ return;
24003
+ }
24004
+ await args.nodeishFs.mkdir(args.projectPath);
24005
+ await args.nodeishFs.writeFile(`${args.projectPath}/settings.json`, settingsFile.data);
24006
+ await args.nodeishFs.writeFile(args.projectPath + ".README.md", readme);
24007
+ };
24008
+ var readme = `
24009
+ # DELETE THE \`project.inlang.json\` FILE
24010
+
24011
+ The \`project.inlang.json\` file is now contained in a project directory e.g. \`project.inlang/settings.json\`.
24012
+
24013
+
24014
+ ## What you need to do
24015
+
24016
+ 1. Update the inlang CLI (if you use it) to use the new path \`project.inlang\` instead of \`project.inlang.json\`.
24017
+ 2. Delete the \`project.inlang.json\` file.
24018
+
24019
+
24020
+ ## Why is this happening?
24021
+
24022
+ See this RFC https://docs.google.com/document/d/1OYyA1wYfQRbIJOIBDliYoWjiUlkFBNxH_U2R4WpVRZ4/edit#heading=h.pecv6xb7ial6
24023
+ and the following GitHub issue for more information https://github.com/opral/monorepo/issues/1678.
24024
+
24025
+ - Monorepo support https://github.com/opral/monorepo/discussions/258.
24026
+ - Required for many other future features like caching, first class offline support, and more.
24027
+ - Stablize the inlang project format.
24028
+ `;
24029
+
24030
+ // ../../sdk/dist/storage/helper.js
24031
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
24032
+ function stringifyMessage(message) {
24033
+ const messageWithSortedKeys = {};
24034
+ for (const key of Object.keys(message).sort()) {
24035
+ messageWithSortedKeys[key] = message[key];
24036
+ }
24037
+ messageWithSortedKeys["variants"] = messageWithSortedKeys["variants"].sort((variantA, variantB) => {
24038
+ const languageComparison = variantA.languageTag.localeCompare(variantB.languageTag);
24039
+ if (languageComparison === 0) {
24040
+ return variantA.match.join("-").localeCompare(variantB.match.join("-"));
24041
+ }
24042
+ return languageComparison;
24043
+ });
24044
+ return JSON.stringify(messageWithSortedKeys, void 0, 4);
24045
+ }
24046
+
24047
+ // ../../sdk/dist/storage/human-id/human-readable-id.js
24048
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
24049
+ var import_murmurhash3js = __toESM(require_murmurhash3js(), 1);
24050
+
24051
+ // ../../sdk/dist/storage/human-id/words.js
24052
+ init_define_ENV_DEFINED_IN_BUILD_STEP();
24053
+ var animals = [
24054
+ "albatross",
24055
+ "alligator",
24056
+ "alpaca",
24057
+ "anaconda",
24058
+ "angelfish",
24059
+ "ant",
24060
+ "anteater",
24061
+ "antelope",
24062
+ "ape",
24063
+ "baboon",
24064
+ "badger",
24065
+ "barbel",
24066
+ "bat",
24067
+ "bear",
24068
+ "beaver",
24069
+ "bee",
24070
+ "beetle",
24071
+ "bird",
24072
+ "bison",
24073
+ "blackbird",
24074
+ "boar",
24075
+ "bobcat",
24076
+ "bulldog",
24077
+ "bullock",
24078
+ "bumblebee",
24079
+ "butterfly",
24080
+ "buzzard",
24081
+ "camel",
24082
+ "canary",
24083
+ "capybara",
24084
+ "carp",
24085
+ "cat",
24086
+ "cheetah",
24087
+ "chicken",
24088
+ "chipmunk",
24089
+ "clownfish",
24090
+ "cobra",
24091
+ "cockroach",
24092
+ "cod",
24093
+ "cougar",
24094
+ "cow",
24095
+ "cowfish",
24096
+ "coyote",
24097
+ "crab",
24098
+ "crocodile",
24099
+ "crossbill",
24100
+ "crow",
24101
+ "cuckoo",
24102
+ "dachshund",
24103
+ "deer",
24104
+ "dingo",
24105
+ "dog",
24106
+ "dolphin",
24107
+ "donkey",
24108
+ "dove",
24109
+ "dragonfly",
24110
+ "duck",
24111
+ "eagle",
24112
+ "earthworm",
24113
+ "eel",
24114
+ "elephant",
24115
+ "elk",
24116
+ "emu",
24117
+ "falcon",
24118
+ "felix",
24119
+ "finch",
24120
+ "fireant",
24121
+ "firefox",
24122
+ "fish",
24123
+ "flamingo",
24124
+ "flea",
24125
+ "florian",
24126
+ "fly",
24127
+ "fox",
24128
+ "frog",
24129
+ "gadfly",
24130
+ "gazelle",
24131
+ "gecko",
24132
+ "gibbon",
24133
+ "giraffe",
24134
+ "goat",
24135
+ "goldfish",
24136
+ "goose",
24137
+ "gopher",
24138
+ "gorilla",
24139
+ "grebe",
24140
+ "grizzly",
24141
+ "gull",
24142
+ "guppy",
24143
+ "haddock",
24144
+ "halibut",
24145
+ "hamster",
24146
+ "hare",
24147
+ "hawk",
24148
+ "hedgehog",
24149
+ "herring",
24150
+ "hornet",
24151
+ "horse",
24152
+ "hound",
24153
+ "husky",
24154
+ "hyena",
24155
+ "ibex",
24156
+ "iguana",
24157
+ "impala",
24158
+ "insect",
24159
+ "jackal",
24160
+ "jackdaw",
24161
+ "jaguar",
24162
+ "jan",
24163
+ "jannes",
24164
+ "javelina",
24165
+ "jay",
24166
+ "jellyfish",
24167
+ "jurgen",
24168
+ "kangaroo",
24169
+ "kestrel",
24170
+ "kitten",
24171
+ "koala",
24172
+ "kudu",
24173
+ "ladybug",
24174
+ "lamb",
24175
+ "lark",
24176
+ "larva",
24177
+ "lemming",
24178
+ "lemur",
24179
+ "leopard",
24180
+ "liger",
24181
+ "lion",
24182
+ "lionfish",
24183
+ "lizard",
24184
+ "llama",
24185
+ "lobster",
24186
+ "loris",
24187
+ "lynx",
24188
+ "macaw",
24189
+ "maggot",
24190
+ "mallard",
24191
+ "mammoth",
24192
+ "manatee",
24193
+ "mantis",
24194
+ "mare",
24195
+ "marlin",
24196
+ "marmot",
24197
+ "marten",
24198
+ "martin",
24199
+ "mayfly",
24200
+ "meerkat",
24201
+ "midge",
24202
+ "millipede",
24203
+ "mink",
24204
+ "mole",
24205
+ "mongoose",
24206
+ "monkey",
24207
+ "moose",
24208
+ "moth",
24209
+ "mouse",
24210
+ "mule",
24211
+ "myna",
24212
+ "newt",
24213
+ "niklas",
24214
+ "nils",
24215
+ "nuthatch",
24216
+ "ocelot",
24217
+ "octopus",
24218
+ "okapi",
24219
+ "opossum",
24220
+ "orangutan",
24221
+ "oryx",
24222
+ "osprey",
24223
+ "ostrich",
24224
+ "otter",
24225
+ "owl",
24226
+ "ox",
24227
+ "panda",
24228
+ "panther",
24229
+ "parakeet",
24230
+ "parrot",
24231
+ "peacock",
24232
+ "pelican",
24233
+ "penguin",
24234
+ "pig",
24235
+ "pigeon",
24236
+ "piranha",
24237
+ "platypus",
24238
+ "polecat",
24239
+ "pony",
24240
+ "poodle",
24241
+ "porpoise",
24242
+ "puffin",
24243
+ "pug",
24244
+ "puma",
24245
+ "quail",
24246
+ "rabbit",
24247
+ "racoon",
24248
+ "rat",
24249
+ "raven",
24250
+ "ray",
24251
+ "reindeer",
24252
+ "robin",
24253
+ "rook",
24254
+ "rooster",
24255
+ "salmon",
24256
+ "samuel",
24257
+ "sawfish",
24258
+ "scallop",
24259
+ "seahorse",
24260
+ "seal",
24261
+ "shad",
24262
+ "shark",
24263
+ "sheep",
24264
+ "shell",
24265
+ "shrike",
24266
+ "shrimp",
24267
+ "skate",
24268
+ "skunk",
24269
+ "sloth",
24270
+ "slug",
24271
+ "snail",
24272
+ "snake",
24273
+ "sparrow",
24274
+ "spider",
24275
+ "squid",
24276
+ "squirrel",
24277
+ "starfish",
24278
+ "stingray",
24279
+ "stork",
24280
+ "swallow",
24281
+ "swan",
24282
+ "tadpole",
24283
+ "tapir",
24284
+ "termite",
24285
+ "tern",
24286
+ "thrush",
24287
+ "tiger",
24288
+ "toad",
24289
+ "tortoise",
24290
+ "toucan",
24291
+ "trout",
24292
+ "tuna",
24293
+ "turkey",
24294
+ "turtle",
24295
+ "vole",
24296
+ "vulture",
24297
+ "wallaby",
24298
+ "walrus",
24299
+ "warbler",
24300
+ "warthog",
24301
+ "wasp",
24302
+ "weasel",
24303
+ "whale",
24304
+ "wolf",
24305
+ "wombat",
24306
+ "worm",
24307
+ "wren",
24308
+ "yak",
24309
+ "zebra"
24310
+ ];
24311
+ var adjectives = [
24312
+ "acidic",
24313
+ "active",
24314
+ "actual",
24315
+ "agent",
24316
+ "ago",
24317
+ "alert",
24318
+ "alive",
24319
+ "aloof",
24320
+ "antsy",
24321
+ "any",
24322
+ "aqua",
24323
+ "arable",
24324
+ "awake",
24325
+ "aware",
24326
+ "away",
24327
+ "awful",
24328
+ "bad",
24329
+ "bald",
24330
+ "basic",
24331
+ "best",
24332
+ "big",
24333
+ "bland",
24334
+ "blue",
24335
+ "bold",
24336
+ "born",
24337
+ "brave",
24338
+ "brief",
24339
+ "bright",
24340
+ "broad",
24341
+ "busy",
24342
+ "calm",
24343
+ "candid",
24344
+ "careful",
24345
+ "caring",
24346
+ "chunky",
24347
+ "civil",
24348
+ "clean",
24349
+ "clear",
24350
+ "close",
24351
+ "cool",
24352
+ "cozy",
24353
+ "crazy",
24354
+ "crisp",
24355
+ "cuddly",
24356
+ "curly",
24357
+ "cute",
24358
+ "dark",
24359
+ "day",
24360
+ "deft",
24361
+ "direct",
24362
+ "dirty",
24363
+ "dizzy",
24364
+ "drab",
24365
+ "dry",
24366
+ "due",
24367
+ "dull",
24368
+ "each",
24369
+ "early",
24370
+ "east",
24371
+ "elegant",
24372
+ "empty",
24373
+ "equal",
24374
+ "even",
24375
+ "every",
24376
+ "extra",
24377
+ "factual",
24378
+ "fair",
24379
+ "fancy",
24380
+ "few",
24381
+ "fine",
24382
+ "fit",
24383
+ "flaky",
24384
+ "flat",
24385
+ "fluffy",
24386
+ "formal",
24387
+ "frail",
24388
+ "free",
24389
+ "fresh",
24390
+ "front",
24391
+ "full",
24392
+ "fun",
24393
+ "funny",
24394
+ "fuzzy",
24395
+ "game",
24396
+ "gaudy",
24397
+ "giant",
24398
+ "glad",
24399
+ "good",
24400
+ "grand",
24401
+ "grassy",
24402
+ "gray",
24403
+ "great",
24404
+ "green",
24405
+ "gross",
24406
+ "happy",
24407
+ "heavy",
24408
+ "helpful",
24409
+ "heroic",
24410
+ "home",
24411
+ "honest",
24412
+ "hour",
24413
+ "house",
24414
+ "icy",
24415
+ "ideal",
24416
+ "inclusive",
24417
+ "inner",
24418
+ "jolly",
24419
+ "jumpy",
24420
+ "just",
24421
+ "keen",
24422
+ "key",
24423
+ "kind",
24424
+ "knotty",
24425
+ "known",
24426
+ "large",
24427
+ "last",
24428
+ "late",
24429
+ "lazy",
24430
+ "least",
24431
+ "left",
24432
+ "legal",
24433
+ "less",
24434
+ "level",
24435
+ "light",
24436
+ "lime",
24437
+ "livid",
24438
+ "lofty",
24439
+ "long",
24440
+ "loose",
24441
+ "lost",
24442
+ "loud",
24443
+ "loved",
24444
+ "low",
24445
+ "lower",
24446
+ "lucky",
24447
+ "mad",
24448
+ "main",
24449
+ "major",
24450
+ "male",
24451
+ "many",
24452
+ "maroon",
24453
+ "mealy",
24454
+ "mean",
24455
+ "mellow",
24456
+ "merry",
24457
+ "mild",
24458
+ "minor",
24459
+ "misty",
24460
+ "moving",
24461
+ "muddy",
24462
+ "mushy",
24463
+ "neat",
24464
+ "new",
24465
+ "next",
24466
+ "nice",
24467
+ "nimble",
24468
+ "noble",
24469
+ "noisy",
24470
+ "north",
24471
+ "novel",
24472
+ "odd",
24473
+ "ok",
24474
+ "only",
24475
+ "orange",
24476
+ "ornate",
24477
+ "patchy",
24478
+ "patient",
24479
+ "petty",
24480
+ "pink",
24481
+ "plain",
24482
+ "plane",
24483
+ "polite",
24484
+ "pretty",
24485
+ "proof",
24486
+ "proud",
24487
+ "quaint",
24488
+ "quick",
24489
+ "quiet",
24490
+ "raw",
24491
+ "real",
24492
+ "red",
24493
+ "round",
24494
+ "royal",
24495
+ "sad",
24496
+ "safe",
24497
+ "salty",
24498
+ "same",
24499
+ "sea",
24500
+ "seemly",
24501
+ "sharp",
24502
+ "short",
24503
+ "shy",
24504
+ "silly",
24505
+ "simple",
24506
+ "sleek",
24507
+ "slimy",
24508
+ "slow",
24509
+ "small",
24510
+ "smart",
24511
+ "smug",
24512
+ "soft",
24513
+ "solid",
24514
+ "sound",
24515
+ "sour",
24516
+ "spare",
24517
+ "spicy",
24518
+ "spry",
24519
+ "stale",
24520
+ "steep",
24521
+ "still",
24522
+ "stock",
24523
+ "stout",
24524
+ "strong",
24525
+ "suave",
24526
+ "such",
24527
+ "sunny",
24528
+ "super",
24529
+ "sweet",
24530
+ "swift",
24531
+ "tame",
24532
+ "tangy",
24533
+ "tasty",
24534
+ "teal",
24535
+ "teary",
24536
+ "tense",
24537
+ "that",
24538
+ "these",
24539
+ "this",
24540
+ "tidy",
24541
+ "tiny",
24542
+ "tired",
24543
+ "top",
24544
+ "topical",
24545
+ "tough",
24546
+ "trick",
24547
+ "trite",
24548
+ "true",
24549
+ "upper",
24550
+ "vexed",
24551
+ "vivid",
24552
+ "wacky",
24553
+ "warm",
24554
+ "watery",
24555
+ "weak",
24556
+ "weary",
24557
+ "weird",
24558
+ "white",
24559
+ "whole",
24560
+ "wide",
24561
+ "wild",
24562
+ "wise",
24563
+ "witty",
24564
+ "yummy",
24565
+ "zany",
24566
+ "zesty",
24567
+ "zippy"
24568
+ ];
24569
+ var adverbs = [
24570
+ "ablaze",
24571
+ "about",
24572
+ "above",
24573
+ "abroad",
24574
+ "across",
24575
+ "adrift",
24576
+ "afloat",
24577
+ "after",
24578
+ "again",
24579
+ "ahead",
24580
+ "alike",
24581
+ "all",
24582
+ "almost",
24583
+ "alone",
24584
+ "along",
24585
+ "aloud",
24586
+ "always",
24587
+ "amazing",
24588
+ "anxious",
24589
+ "anywhere",
24590
+ "apart",
24591
+ "around",
24592
+ "arrogant",
24593
+ "aside",
24594
+ "asleep",
24595
+ "awkward",
24596
+ "back",
24597
+ "bashful",
24598
+ "beautiful",
24599
+ "before",
24600
+ "behind",
24601
+ "below",
24602
+ "beside",
24603
+ "besides",
24604
+ "beyond",
24605
+ "bitter",
24606
+ "bleak",
24607
+ "blissful",
24608
+ "boldly",
24609
+ "bravely",
24610
+ "briefly",
24611
+ "brightly",
24612
+ "brisk",
24613
+ "busily",
24614
+ "calmly",
24615
+ "carefully",
24616
+ "careless",
24617
+ "cautious",
24618
+ "certain",
24619
+ "cheerful",
24620
+ "clearly",
24621
+ "clever",
24622
+ "closely",
24623
+ "closer",
24624
+ "colorful",
24625
+ "common",
24626
+ "correct",
24627
+ "cross",
24628
+ "cruel",
24629
+ "curious",
24630
+ "daily",
24631
+ "dainty",
24632
+ "daring",
24633
+ "dear",
24634
+ "desperate",
24635
+ "diligent",
24636
+ "doubtful",
24637
+ "doubtless",
24638
+ "down",
24639
+ "downwards",
24640
+ "dreamily",
24641
+ "eager",
24642
+ "easily",
24643
+ "either",
24644
+ "elegantly",
24645
+ "else",
24646
+ "elsewhere",
24647
+ "enormous",
24648
+ "enough",
24649
+ "ever",
24650
+ "famous",
24651
+ "far",
24652
+ "fast",
24653
+ "fervent",
24654
+ "fierce",
24655
+ "fondly",
24656
+ "foolish",
24657
+ "forever",
24658
+ "forth",
24659
+ "fortunate",
24660
+ "forward",
24661
+ "frank",
24662
+ "freely",
24663
+ "frequent",
24664
+ "fully",
24665
+ "general",
24666
+ "generous",
24667
+ "gladly",
24668
+ "graceful",
24669
+ "grateful",
24670
+ "gratis",
24671
+ "half",
24672
+ "happily",
24673
+ "hard",
24674
+ "harsh",
24675
+ "hearty",
24676
+ "helpless",
24677
+ "here",
24678
+ "highly",
24679
+ "hitherto",
24680
+ "how",
24681
+ "however",
24682
+ "hurried",
24683
+ "immediate",
24684
+ "in",
24685
+ "indeed",
24686
+ "inland",
24687
+ "innocent",
24688
+ "inside",
24689
+ "instant",
24690
+ "intense",
24691
+ "inward",
24692
+ "jealous",
24693
+ "jovial",
24694
+ "joyful",
24695
+ "jubilant",
24696
+ "keenly",
24697
+ "kindly",
24698
+ "knowing",
24699
+ "lately",
24700
+ "lazily",
24701
+ "lightly",
24702
+ "likely",
24703
+ "little",
24704
+ "live",
24705
+ "loftily",
24706
+ "longing",
24707
+ "loosely",
24708
+ "loudly",
24709
+ "loving",
24710
+ "loyal",
24711
+ "luckily",
24712
+ "madly",
24713
+ "maybe",
24714
+ "meanwhile",
24715
+ "mocking",
24716
+ "monthly",
24717
+ "moreover",
24718
+ "much",
24719
+ "near",
24720
+ "neatly",
24721
+ "neither",
24722
+ "nervous",
24723
+ "never",
24724
+ "noisily",
24725
+ "normal",
24726
+ "not",
24727
+ "now",
24728
+ "nowadays",
24729
+ "nowhere",
24730
+ "oddly",
24731
+ "off",
24732
+ "official",
24733
+ "often",
24734
+ "on",
24735
+ "once",
24736
+ "open",
24737
+ "openly",
24738
+ "opposite",
24739
+ "otherwise",
24740
+ "out",
24741
+ "outside",
24742
+ "over",
24743
+ "overall",
24744
+ "overhead",
24745
+ "overnight",
24746
+ "overseas",
24747
+ "parallel",
24748
+ "partial",
24749
+ "past",
24750
+ "patiently",
24751
+ "perfect",
24752
+ "perhaps",
24753
+ "physical",
24754
+ "playful",
24755
+ "politely",
24756
+ "potential",
24757
+ "powerful",
24758
+ "presto",
24759
+ "profound",
24760
+ "prompt",
24761
+ "proper",
24762
+ "proudly",
24763
+ "punctual",
24764
+ "quickly",
24765
+ "quizzical",
24766
+ "rare",
24767
+ "ravenous",
24768
+ "ready",
24769
+ "really",
24770
+ "reckless",
24771
+ "regular",
24772
+ "repeated",
24773
+ "restful",
24774
+ "rightful",
24775
+ "rigid",
24776
+ "rude",
24777
+ "sadly",
24778
+ "safely",
24779
+ "scarce",
24780
+ "scary",
24781
+ "searching",
24782
+ "seeming",
24783
+ "seldom",
24784
+ "selfish",
24785
+ "separate",
24786
+ "serious",
24787
+ "shaky",
24788
+ "sheepish",
24789
+ "silent",
24790
+ "sleepy",
24791
+ "smooth",
24792
+ "softly",
24793
+ "solemn",
24794
+ "solidly",
24795
+ "sometimes",
24796
+ "speedy",
24797
+ "stealthy",
24798
+ "stern",
24799
+ "strict",
24800
+ "stubborn",
24801
+ "sudden",
24802
+ "supposed",
24803
+ "sweetly",
24804
+ "swiftly",
24805
+ "tender",
24806
+ "tensely",
24807
+ "thankful",
24808
+ "tight",
24809
+ "too",
24810
+ "twice",
24811
+ "under",
24812
+ "untrue",
24813
+ "uphill",
24814
+ "upward",
24815
+ "vaguely",
24816
+ "vainly",
24817
+ "vastly",
24818
+ "warmly",
24819
+ "wearily",
24820
+ "weekly",
24821
+ "well",
24822
+ "wisely",
24823
+ "within",
24824
+ "wrongly",
24825
+ "yonder"
24826
+ ];
24827
+ var verbs = [
24828
+ "absorb",
24829
+ "accept",
24830
+ "achieve",
24831
+ "adapt",
24832
+ "adore",
24833
+ "advise",
24834
+ "affirm",
24835
+ "agree",
24836
+ "aid",
24837
+ "aim",
24838
+ "amaze",
24839
+ "amuse",
24840
+ "animate",
24841
+ "approve",
24842
+ "arise",
24843
+ "arrive",
24844
+ "ascend",
24845
+ "ask",
24846
+ "aspire",
24847
+ "assure",
24848
+ "attend",
24849
+ "bake",
24850
+ "bask",
24851
+ "beam",
24852
+ "believe",
24853
+ "belong",
24854
+ "bend",
24855
+ "blend",
24856
+ "bless",
24857
+ "blink",
24858
+ "bloom",
24859
+ "boil",
24860
+ "boost",
24861
+ "borrow",
24862
+ "breathe",
24863
+ "bubble",
24864
+ "build",
24865
+ "bump",
24866
+ "burn",
24867
+ "buy",
24868
+ "buzz",
24869
+ "care",
24870
+ "catch",
24871
+ "charm",
24872
+ "cheer",
24873
+ "cherish",
24874
+ "chop",
24875
+ "clap",
24876
+ "clasp",
24877
+ "climb",
24878
+ "clip",
24879
+ "coax",
24880
+ "comfort",
24881
+ "commend",
24882
+ "compose",
24883
+ "conquer",
24884
+ "cook",
24885
+ "create",
24886
+ "cry",
24887
+ "cuddle",
24888
+ "cure",
24889
+ "cut",
24890
+ "dance",
24891
+ "dare",
24892
+ "dart",
24893
+ "dash",
24894
+ "dazzle",
24895
+ "delight",
24896
+ "devour",
24897
+ "dial",
24898
+ "dig",
24899
+ "dine",
24900
+ "dream",
24901
+ "drip",
24902
+ "drop",
24903
+ "drum",
24904
+ "dust",
24905
+ "earn",
24906
+ "edit",
24907
+ "embrace",
24908
+ "emerge",
24909
+ "empower",
24910
+ "enchant",
24911
+ "endure",
24912
+ "engage",
24913
+ "enjoy",
24914
+ "enrich",
24915
+ "evoke",
24916
+ "exhale",
24917
+ "expand",
24918
+ "explore",
24919
+ "express",
24920
+ "fade",
24921
+ "fall",
24922
+ "favor",
24923
+ "fear",
24924
+ "feast",
24925
+ "feel",
24926
+ "fetch",
24927
+ "file",
24928
+ "find",
24929
+ "flip",
24930
+ "flop",
24931
+ "flow",
24932
+ "fold",
24933
+ "fond",
24934
+ "forgive",
24935
+ "foster",
24936
+ "fry",
24937
+ "fulfill",
24938
+ "gasp",
24939
+ "gaze",
24940
+ "gleam",
24941
+ "glow",
24942
+ "grace",
24943
+ "grasp",
24944
+ "greet",
24945
+ "grin",
24946
+ "grip",
24947
+ "grow",
24948
+ "gulp",
24949
+ "hack",
24950
+ "harbor",
24951
+ "heal",
24952
+ "heart",
24953
+ "hike",
24954
+ "hint",
24955
+ "honor",
24956
+ "hope",
24957
+ "hug",
24958
+ "hunt",
24959
+ "hurl",
24960
+ "hush",
24961
+ "imagine",
24962
+ "inspire",
24963
+ "intend",
24964
+ "jest",
24965
+ "jolt",
24966
+ "jump",
24967
+ "kick",
24968
+ "kiss",
24969
+ "laugh",
24970
+ "launch",
24971
+ "lead",
24972
+ "leap",
24973
+ "learn",
24974
+ "lend",
24975
+ "lift",
24976
+ "link",
24977
+ "list",
24978
+ "lock",
24979
+ "loop",
24980
+ "love",
24981
+ "mend",
24982
+ "mix",
24983
+ "mop",
24984
+ "nail",
24985
+ "nourish",
24986
+ "nudge",
24987
+ "nurture",
24988
+ "offer",
24989
+ "pat",
24990
+ "pause",
24991
+ "pave",
24992
+ "peek",
24993
+ "peel",
24994
+ "persist",
24995
+ "pet",
24996
+ "pick",
24997
+ "pinch",
24998
+ "play",
24999
+ "pop",
25000
+ "pout",
25001
+ "praise",
25002
+ "pray",
25003
+ "pride",
25004
+ "promise",
25005
+ "propel",
25006
+ "prosper",
25007
+ "pull",
25008
+ "push",
25009
+ "quell",
25010
+ "quiz",
25011
+ "race",
25012
+ "radiate",
25013
+ "read",
25014
+ "reap",
25015
+ "relish",
25016
+ "renew",
25017
+ "reside",
25018
+ "rest",
25019
+ "revive",
25020
+ "ripple",
25021
+ "rise",
25022
+ "roam",
25023
+ "roar",
25024
+ "rush",
25025
+ "sail",
25026
+ "savor",
25027
+ "scold",
25028
+ "scoop",
25029
+ "seek",
25030
+ "sew",
25031
+ "shine",
25032
+ "sing",
25033
+ "skip",
25034
+ "slide",
25035
+ "slurp",
25036
+ "smile",
25037
+ "snap",
25038
+ "snip",
25039
+ "soar",
25040
+ "spark",
25041
+ "spin",
25042
+ "splash",
25043
+ "sprout",
25044
+ "spur",
25045
+ "stab",
25046
+ "startle",
25047
+ "stir",
25048
+ "stop",
25049
+ "strive",
25050
+ "succeed",
25051
+ "support",
25052
+ "surge",
25053
+ "sway",
25054
+ "swim",
25055
+ "talk",
25056
+ "tap",
25057
+ "taste",
25058
+ "tear",
25059
+ "tend",
25060
+ "thrive",
25061
+ "tickle",
25062
+ "transform",
25063
+ "treasure",
25064
+ "treat",
25065
+ "trim",
25066
+ "trip",
25067
+ "trust",
25068
+ "twirl",
25069
+ "twist",
25070
+ "type",
25071
+ "urge",
25072
+ "value",
25073
+ "vent",
25074
+ "view",
25075
+ "walk",
25076
+ "wave",
25077
+ "win",
25078
+ "wish",
25079
+ "work",
25080
+ "yell",
25081
+ "zap",
25082
+ "zip",
25083
+ "zoom"
25084
+ ];
25085
+
25086
+ // ../../sdk/dist/storage/human-id/human-readable-id.js
25087
+ function humanIdHash(value, offset = 0) {
25088
+ const seed = 42;
25089
+ const hash32 = import_murmurhash3js.default.x86.hash32(value, seed);
25090
+ const hash32WithOffset = hash32 + offset >>> 0;
25091
+ const part1 = hash32WithOffset >>> 24 & 255;
25092
+ const part2 = hash32WithOffset >>> 16 & 255;
25093
+ const part3 = hash32WithOffset >>> 8 & 255;
25094
+ const part4 = hash32WithOffset & 255;
25095
+ return `${adjectives[part1]}_${animals[part2]}_${verbs[part3]}_${adverbs[part4]}`;
25096
+ }
25097
+
22876
25098
  // ../../sdk/dist/createNodeishFsWithWatcher.js
22877
25099
  init_define_ENV_DEFINED_IN_BUILD_STEP();
22878
25100
  var createNodeishFsWithWatcher = (args) => {
@@ -22909,53 +25131,16 @@ var createNodeishFsWithWatcher = (args) => {
22909
25131
  return {
22910
25132
  // @ts-expect-error
22911
25133
  readFile: (path4, options) => readFileAndExtractPath(path4, options),
25134
+ rm: args.nodeishFs.rm,
22912
25135
  readdir: args.nodeishFs.readdir,
22913
25136
  mkdir: args.nodeishFs.mkdir,
25137
+ rmdir: args.nodeishFs.rmdir,
22914
25138
  writeFile: args.nodeishFs.writeFile,
22915
- watch: args.nodeishFs.watch
25139
+ watch: args.nodeishFs.watch,
25140
+ stat: args.nodeishFs.stat
22916
25141
  };
22917
25142
  };
22918
25143
 
22919
- // ../../sdk/dist/migrations/migrateToDirectory.js
22920
- init_define_ENV_DEFINED_IN_BUILD_STEP();
22921
- var maybeMigrateToDirectory = async (args) => {
22922
- if (args.projectPath.endsWith("project.inlang") === false) {
22923
- return;
22924
- }
22925
- const projectDirectory = await tryCatch(() => args.nodeishFs.stat(args.projectPath));
22926
- if (projectDirectory.data) {
22927
- return;
22928
- }
22929
- const settingsFile = await tryCatch(() => args.nodeishFs.readFile(args.projectPath + ".json", { encoding: "utf-8" }));
22930
- if (settingsFile.error) {
22931
- return;
22932
- }
22933
- await args.nodeishFs.mkdir(args.projectPath);
22934
- await args.nodeishFs.writeFile(`${args.projectPath}/settings.json`, settingsFile.data);
22935
- await args.nodeishFs.writeFile(args.projectPath + ".README.md", readme);
22936
- };
22937
- var readme = `
22938
- # DELETE THE \`project.inlang.json\` FILE
22939
-
22940
- The \`project.inlang.json\` file is now contained in a project directory e.g. \`project.inlang/settings.json\`.
22941
-
22942
-
22943
- ## What you need to do
22944
-
22945
- 1. Update the inlang CLI (if you use it) to use the new path \`project.inlang\` instead of \`project.inlang.json\`.
22946
- 2. Delete the \`project.inlang.json\` file.
22947
-
22948
-
22949
- ## Why is this happening?
22950
-
22951
- See this RFC https://docs.google.com/document/d/1OYyA1wYfQRbIJOIBDliYoWjiUlkFBNxH_U2R4WpVRZ4/edit#heading=h.pecv6xb7ial6
22952
- and the following GitHub issue for more information https://github.com/opral/monorepo/issues/1678.
22953
-
22954
- - Monorepo support https://github.com/opral/monorepo/discussions/258.
22955
- - Required for many other future features like caching, first class offline support, and more.
22956
- - Stablize the inlang project format.
22957
- `;
22958
-
22959
25144
  // ../../sdk/dist/migrations/maybeCreateFirstProjectId.js
22960
25145
  init_define_ENV_DEFINED_IN_BUILD_STEP();
22961
25146
 
@@ -24681,9 +26866,20 @@ var identifyProject = async (args) => {
24681
26866
  };
24682
26867
 
24683
26868
  // ../../sdk/dist/loadProject.js
26869
+ var import_debug = __toESM(require_src(), 1);
26870
+ var debug = (0, import_debug.default)("loadProject");
24684
26871
  var settingsCompiler = import_compiler3.TypeCompiler.Compile(ProjectSettings);
24685
26872
  async function loadProject(args) {
24686
26873
  const projectPath = normalizePath(args.projectPath);
26874
+ const messageStates = {
26875
+ messageDirtyFlags: {},
26876
+ messageLoadHash: {},
26877
+ isSaving: false,
26878
+ currentSaveMessagesViaPlugin: void 0,
26879
+ sheduledSaveMessages: void 0,
26880
+ isLoading: false,
26881
+ sheduledLoadMessagesViaPlugin: void 0
26882
+ };
24687
26883
  if (!isAbsolutePath(args.projectPath)) {
24688
26884
  throw new LoadProjectInvalidArgument(`Expected an absolute path but received "${args.projectPath}".`, { argument: "projectPath" });
24689
26885
  } else if (/[^\\/]+\.inlang$/.test(projectPath) === false) {
@@ -24735,7 +26931,11 @@ Valid examples:
24735
26931
  });
24736
26932
  let settingsValue;
24737
26933
  createEffect2(() => settingsValue = settings());
24738
- const [messages, setMessages] = createSignal2();
26934
+ const [messages, setMessages] = createSignal2([]);
26935
+ const [loadMessagesViaPluginError, setLoadMessagesViaPluginError] = createSignal2();
26936
+ const [saveMessagesViaPluginError, setSaveMessagesViaPluginError] = createSignal2();
26937
+ const messagesQuery = createMessagesQuery(() => messages());
26938
+ const messageLockDirPath = projectPath + "/messagelock";
24739
26939
  createEffect2(() => {
24740
26940
  const _resolvedModules = resolvedModules();
24741
26941
  if (!_resolvedModules)
@@ -24744,22 +26944,36 @@ Valid examples:
24744
26944
  markInitAsFailed(void 0);
24745
26945
  return;
24746
26946
  }
24747
- const loadAndSetMessages = async (fs4) => {
24748
- makeTrulyAsync(_resolvedModules.resolvedPluginApi.loadMessages({
24749
- settings: settingsValue,
24750
- nodeishFs: fs4
24751
- })).then((messages2) => {
24752
- setMessages(messages2);
24753
- markInitAsComplete();
24754
- }).catch((err) => markInitAsFailed(new PluginLoadMessagesError({ cause: err })));
24755
- };
26947
+ const _settings = settings();
26948
+ if (!_settings)
26949
+ return;
26950
+ const loadMessagePlugin = _resolvedModules.plugins.find((plugin) => plugin.loadMessages !== void 0);
24756
26951
  const fsWithWatcher = createNodeishFsWithWatcher({
24757
26952
  nodeishFs,
26953
+ // this message is called whenever a file changes that was read earlier by this filesystem
26954
+ // - the plugin loads messages -> reads the file messages.json -> start watching on messages.json -> updateMessages
24758
26955
  updateMessages: () => {
24759
- loadAndSetMessages(nodeishFs);
26956
+ debug("load messages because of a change in the message.json files");
26957
+ loadMessagesViaPlugin(
26958
+ fsWithWatcher,
26959
+ messageLockDirPath,
26960
+ messageStates,
26961
+ messagesQuery,
26962
+ settings(),
26963
+ // NOTE we bang here - we don't expect the settings to become null during the livetime of a project
26964
+ loadMessagePlugin
26965
+ ).catch((e) => setLoadMessagesViaPluginError(new PluginLoadMessagesError({ cause: e }))).then(() => {
26966
+ if (loadMessagesViaPluginError() !== void 0) {
26967
+ setLoadMessagesViaPluginError(void 0);
26968
+ }
26969
+ });
24760
26970
  }
24761
26971
  });
24762
- loadAndSetMessages(fsWithWatcher);
26972
+ loadMessagesViaPlugin(fsWithWatcher, messageLockDirPath, messageStates, messagesQuery, _settings, loadMessagePlugin).then(() => {
26973
+ markInitAsComplete();
26974
+ }).catch((err) => {
26975
+ markInitAsFailed(new PluginLoadMessagesError({ cause: err }));
26976
+ });
24763
26977
  });
24764
26978
  const installedMessageLintRules = () => {
24765
26979
  if (!resolvedModules())
@@ -24791,31 +27005,59 @@ Valid examples:
24791
27005
  };
24792
27006
  const initializeError = await initialized.catch((error) => error);
24793
27007
  const abortController = new AbortController();
24794
- const hasWatcher = nodeishFs.watch("/", { signal: abortController.signal }) !== void 0;
24795
- const messagesQuery = createMessagesQuery(() => messages() || []);
24796
- const lintReportsQuery = createMessageLintReportsQuery(messagesQuery, settings, installedMessageLintRules, resolvedModules, hasWatcher);
24797
- const debouncedSave = skipFirst(debounce(500, async (newMessages) => {
24798
- var _a;
24799
- try {
24800
- if (JSON.stringify(newMessages) !== JSON.stringify(messages())) {
24801
- await ((_a = resolvedModules()) == null ? void 0 : _a.resolvedPluginApi.saveMessages({
24802
- settings: settingsValue,
24803
- messages: newMessages
24804
- }));
27008
+ nodeishFs.watch("/", { signal: abortController.signal }) !== void 0;
27009
+ const trackedMessages = /* @__PURE__ */ new Map();
27010
+ let initialSetup = true;
27011
+ createEffect2(() => {
27012
+ const _resolvedModules = resolvedModules();
27013
+ if (!_resolvedModules)
27014
+ return;
27015
+ const currentMessageIds = new Set(messagesQuery.includedMessageIds());
27016
+ const deletedTrackedMessages = [...trackedMessages].filter((tracked) => !currentMessageIds.has(tracked[0]));
27017
+ const saveMessagesPlugin = _resolvedModules.plugins.find((plugin) => plugin.saveMessages !== void 0);
27018
+ const loadMessagesPlugin = _resolvedModules.plugins.find((plugin) => plugin.loadMessages !== void 0);
27019
+ for (const messageId of currentMessageIds) {
27020
+ if (!trackedMessages.has(messageId)) {
27021
+ createRoot2((dispose) => {
27022
+ createEffect2(() => {
27023
+ const message = messagesQuery.get({ where: { id: messageId } });
27024
+ if (!message) {
27025
+ return;
27026
+ }
27027
+ if (!(trackedMessages == null ? void 0 : trackedMessages.has(messageId))) {
27028
+ trackedMessages == null ? void 0 : trackedMessages.set(messageId, dispose);
27029
+ }
27030
+ if (!initialSetup) {
27031
+ messageStates.messageDirtyFlags[message.id] = true;
27032
+ saveMessagesViaPlugin(fs3, messageLockDirPath, messageStates, messagesQuery, settings(), saveMessagesPlugin, loadMessagesPlugin).catch((e) => setSaveMessagesViaPluginError(new PluginSaveMessagesError({ cause: e }))).then(() => {
27033
+ if (saveMessagesViaPluginError() !== void 0) {
27034
+ setSaveMessagesViaPluginError(void 0);
27035
+ }
27036
+ });
27037
+ }
27038
+ });
27039
+ });
24805
27040
  }
24806
- } catch (err) {
24807
- throw new PluginSaveMessagesError({
24808
- cause: err
24809
- });
24810
27041
  }
24811
- const abortController2 = new AbortController();
24812
- if (newMessages.length !== 0 && JSON.stringify(newMessages) !== JSON.stringify(messages()) && nodeishFs.watch("/", { signal: abortController2.signal }) !== void 0) {
24813
- setMessages(newMessages);
27042
+ for (const deletedMessage of deletedTrackedMessages) {
27043
+ const deletedMessageId = deletedMessage[0];
27044
+ const messageEffectDisposeFunction = trackedMessages.get(deletedMessageId);
27045
+ if (messageEffectDisposeFunction) {
27046
+ messageEffectDisposeFunction();
27047
+ trackedMessages.delete(deletedMessageId);
27048
+ }
27049
+ messageStates.messageDirtyFlags[deletedMessageId] = true;
24814
27050
  }
24815
- }, { atBegin: false }));
24816
- createEffect2(() => {
24817
- debouncedSave(messagesQuery.getAll());
27051
+ if (deletedTrackedMessages.length > 0) {
27052
+ saveMessagesViaPlugin(nodeishFs, messageLockDirPath, messageStates, messagesQuery, settings(), saveMessagesPlugin, loadMessagesPlugin).catch((e) => setSaveMessagesViaPluginError(new PluginSaveMessagesError({ cause: e }))).then(() => {
27053
+ if (saveMessagesViaPluginError() !== void 0) {
27054
+ setSaveMessagesViaPluginError(void 0);
27055
+ }
27056
+ });
27057
+ }
27058
+ initialSetup = false;
24818
27059
  });
27060
+ const lintReportsQuery = createMessageLintReportsQuery(messagesQuery, settings, installedMessageLintRules, resolvedModules);
24819
27061
  let projectLoadedCapturedAlready = false;
24820
27062
  if (projectId && projectLoadedCapturedAlready === false) {
24821
27063
  projectLoadedCapturedAlready = true;
@@ -24846,7 +27088,11 @@ Valid examples:
24846
27088
  },
24847
27089
  errors: createSubscribable(() => [
24848
27090
  ...initializeError ? [initializeError] : [],
24849
- ...resolvedModules() ? resolvedModules().errors : []
27091
+ ...resolvedModules() ? resolvedModules().errors : [],
27092
+ ...loadMessagesViaPluginError() ? [loadMessagesViaPluginError()] : [],
27093
+ ...saveMessagesViaPluginError() ? [saveMessagesViaPluginError()] : []
27094
+ // have a query error exposed
27095
+ //...(lintErrors() ?? []),
24850
27096
  ]),
24851
27097
  settings: createSubscribable(() => settings()),
24852
27098
  setSettings,
@@ -24944,6 +27190,271 @@ function createSubscribable(signal) {
24944
27190
  }
24945
27191
  });
24946
27192
  }
27193
+ async function loadMessagesViaPlugin(fs3, lockDirPath, messageState, messagesQuery, settingsValue, loadPlugin) {
27194
+ var _a;
27195
+ const experimentalAliases = !!((_a = settingsValue.experimental) == null ? void 0 : _a.aliases);
27196
+ if (messageState.isLoading) {
27197
+ if (!messageState.sheduledLoadMessagesViaPlugin) {
27198
+ messageState.sheduledLoadMessagesViaPlugin = createAwaitable();
27199
+ }
27200
+ return messageState.sheduledLoadMessagesViaPlugin[0];
27201
+ }
27202
+ messageState.isLoading = true;
27203
+ let lockTime = void 0;
27204
+ try {
27205
+ lockTime = await acquireFileLock(fs3, lockDirPath, "loadMessage");
27206
+ const loadedMessages = await makeTrulyAsync(loadPlugin.loadMessages({
27207
+ settings: settingsValue,
27208
+ nodeishFs: fs3
27209
+ }));
27210
+ for (const loadedMessage of loadedMessages) {
27211
+ const loadedMessageClone = structuredClone(loadedMessage);
27212
+ const currentMessages = messagesQuery.getAll().filter((message) => (experimentalAliases ? message.alias["default"] : message.id) === loadedMessage.id);
27213
+ if (currentMessages.length > 1) {
27214
+ throw new Error("more than one message with the same id or alias found ");
27215
+ } else if (currentMessages.length === 1) {
27216
+ loadedMessageClone.alias = {};
27217
+ if (experimentalAliases) {
27218
+ loadedMessageClone.alias["default"] = loadedMessageClone.id;
27219
+ loadedMessageClone.id = currentMessages[0].id;
27220
+ }
27221
+ const importedEnecoded = stringifyMessage(loadedMessageClone);
27222
+ if (messageState.messageLoadHash[loadedMessageClone.id] === importedEnecoded) {
27223
+ debug("skipping upsert!");
27224
+ continue;
27225
+ }
27226
+ messagesQuery.update({ where: { id: loadedMessageClone.id }, data: loadedMessageClone });
27227
+ delete messageState.messageDirtyFlags[loadedMessageClone.id];
27228
+ messageState.messageLoadHash[loadedMessageClone.id] = importedEnecoded;
27229
+ } else {
27230
+ loadedMessageClone.alias = {};
27231
+ if (experimentalAliases) {
27232
+ loadedMessageClone.alias["default"] = loadedMessageClone.id;
27233
+ let currentOffset = 0;
27234
+ let messsageId;
27235
+ do {
27236
+ messsageId = humanIdHash(loadedMessageClone.id, currentOffset);
27237
+ if (messagesQuery.get({ where: { id: messsageId } })) {
27238
+ currentOffset += 1;
27239
+ messsageId = void 0;
27240
+ }
27241
+ } while (messsageId === void 0);
27242
+ loadedMessageClone.id = messsageId;
27243
+ }
27244
+ const importedEnecoded = stringifyMessage(loadedMessageClone);
27245
+ messagesQuery.create({ data: loadedMessageClone });
27246
+ delete messageState.messageDirtyFlags[loadedMessageClone.id];
27247
+ messageState.messageLoadHash[loadedMessageClone.id] = importedEnecoded;
27248
+ }
27249
+ }
27250
+ await releaseLock(fs3, lockDirPath, "loadMessage", lockTime);
27251
+ lockTime = void 0;
27252
+ debug("loadMessagesViaPlugin: " + loadedMessages.length + " Messages processed ");
27253
+ messageState.isLoading = false;
27254
+ } finally {
27255
+ if (lockTime !== void 0) {
27256
+ await releaseLock(fs3, lockDirPath, "loadMessage", lockTime);
27257
+ }
27258
+ messageState.isLoading = false;
27259
+ }
27260
+ const executingScheduledMessages = messageState.sheduledLoadMessagesViaPlugin;
27261
+ if (executingScheduledMessages) {
27262
+ messageState.sheduledLoadMessagesViaPlugin = void 0;
27263
+ loadMessagesViaPlugin(fs3, lockDirPath, messageState, messagesQuery, settingsValue, loadPlugin).then(() => {
27264
+ executingScheduledMessages[1]();
27265
+ }).catch((e) => {
27266
+ executingScheduledMessages[2](e);
27267
+ });
27268
+ }
27269
+ }
27270
+ async function saveMessagesViaPlugin(fs3, lockDirPath, messageState, messagesQuery, settingsValue, savePlugin, loadPlugin) {
27271
+ if (messageState.isSaving) {
27272
+ if (!messageState.sheduledSaveMessages) {
27273
+ messageState.sheduledSaveMessages = createAwaitable();
27274
+ }
27275
+ return messageState.sheduledSaveMessages[0];
27276
+ }
27277
+ messageState.isSaving = true;
27278
+ messageState.currentSaveMessagesViaPlugin = async function() {
27279
+ var _a;
27280
+ const saveMessageHashes = {};
27281
+ if (Object.keys(messageState.messageDirtyFlags).length == 0) {
27282
+ debug("save was skipped - no messages marked as dirty... build!");
27283
+ messageState.isSaving = false;
27284
+ return;
27285
+ }
27286
+ let messageDirtyFlagsBeforeSave;
27287
+ let lockTime;
27288
+ try {
27289
+ lockTime = await acquireFileLock(fs3, lockDirPath, "saveMessage");
27290
+ if (Object.keys(messageState.messageDirtyFlags).length == 0) {
27291
+ debug("save was skipped - no messages marked as dirty... releasing lock again");
27292
+ messageState.isSaving = false;
27293
+ return;
27294
+ }
27295
+ const currentMessages = messagesQuery.getAll();
27296
+ const messagesToExport = [];
27297
+ for (const message of currentMessages) {
27298
+ if (messageState.messageDirtyFlags[message.id]) {
27299
+ const importedEnecoded = stringifyMessage(message);
27300
+ saveMessageHashes[message.id] = importedEnecoded;
27301
+ }
27302
+ const fixedExportMessage = { ...message };
27303
+ if ((_a = settingsValue.experimental) == null ? void 0 : _a.aliases) {
27304
+ fixedExportMessage.id = fixedExportMessage.alias["default"] ?? fixedExportMessage.id;
27305
+ }
27306
+ messagesToExport.push(fixedExportMessage);
27307
+ }
27308
+ messageDirtyFlagsBeforeSave = { ...messageState.messageDirtyFlags };
27309
+ messageState.messageDirtyFlags = {};
27310
+ await savePlugin.saveMessages({
27311
+ settings: settingsValue,
27312
+ messages: messagesToExport,
27313
+ nodeishFs: fs3
27314
+ });
27315
+ for (const [messageId, messageHash] of Object.entries(saveMessageHashes)) {
27316
+ messageState.messageLoadHash[messageId] = messageHash;
27317
+ }
27318
+ if (lockTime !== void 0) {
27319
+ await releaseLock(fs3, lockDirPath, "saveMessage", lockTime);
27320
+ lockTime = void 0;
27321
+ }
27322
+ if (messageState.sheduledLoadMessagesViaPlugin) {
27323
+ debug("saveMessagesViaPlugin calling queued loadMessagesViaPlugin to share lock");
27324
+ await loadMessagesViaPlugin(fs3, lockDirPath, messageState, messagesQuery, settingsValue, loadPlugin);
27325
+ }
27326
+ messageState.isSaving = false;
27327
+ } catch (err) {
27328
+ if (messageDirtyFlagsBeforeSave !== void 0) {
27329
+ for (const dirtyMessageId of Object.keys(messageDirtyFlagsBeforeSave)) {
27330
+ messageState.messageDirtyFlags[dirtyMessageId] = true;
27331
+ }
27332
+ }
27333
+ if (lockTime !== void 0) {
27334
+ await releaseLock(fs3, lockDirPath, "saveMessage", lockTime);
27335
+ lockTime = void 0;
27336
+ }
27337
+ messageState.isSaving = false;
27338
+ throw new PluginSaveMessagesError({
27339
+ cause: err
27340
+ });
27341
+ } finally {
27342
+ if (lockTime !== void 0) {
27343
+ await releaseLock(fs3, lockDirPath, "saveMessage", lockTime);
27344
+ lockTime = void 0;
27345
+ }
27346
+ messageState.isSaving = false;
27347
+ }
27348
+ }();
27349
+ await messageState.currentSaveMessagesViaPlugin;
27350
+ if (messageState.sheduledSaveMessages) {
27351
+ const executingSheduledSaveMessages = messageState.sheduledSaveMessages;
27352
+ messageState.sheduledSaveMessages = void 0;
27353
+ saveMessagesViaPlugin(fs3, lockDirPath, messageState, messagesQuery, settingsValue, savePlugin, loadPlugin).then(() => {
27354
+ executingSheduledSaveMessages[1]();
27355
+ }).catch((e) => {
27356
+ executingSheduledSaveMessages[2](e);
27357
+ });
27358
+ }
27359
+ }
27360
+ var maxRetries = 5;
27361
+ var nProbes = 50;
27362
+ var probeInterval = 100;
27363
+ async function acquireFileLock(fs3, lockDirPath, lockOrigin, tryCount = 0) {
27364
+ if (tryCount > maxRetries) {
27365
+ throw new Error(lockOrigin + " exceeded maximum Retries (5) to acquire lockfile " + tryCount);
27366
+ }
27367
+ try {
27368
+ debug(lockOrigin + " tries to acquire a lockfile Retry Nr.: " + tryCount);
27369
+ await fs3.mkdir(lockDirPath);
27370
+ const stats = await fs3.stat(lockDirPath);
27371
+ debug(lockOrigin + " acquired a lockfile Retry Nr.: " + tryCount);
27372
+ return stats.mtimeMs;
27373
+ } catch (error) {
27374
+ if (error.code !== "EEXIST") {
27375
+ throw error;
27376
+ }
27377
+ }
27378
+ let currentLockTime;
27379
+ try {
27380
+ const stats = await fs3.stat(lockDirPath);
27381
+ currentLockTime = stats.mtimeMs;
27382
+ } catch (fstatError) {
27383
+ if (fstatError.code === "ENOENT") {
27384
+ debug(lockOrigin + " tryCount++ lock file seems to be gone :) - lets try again " + tryCount);
27385
+ return acquireFileLock(fs3, lockDirPath, lockOrigin, tryCount + 1);
27386
+ }
27387
+ throw fstatError;
27388
+ }
27389
+ debug(lockOrigin + " tries to acquire a lockfile - lock currently in use... starting probe phase " + tryCount);
27390
+ return new Promise((resolve3, reject) => {
27391
+ let probeCounts = 0;
27392
+ const scheduleProbationTimeout = () => {
27393
+ setTimeout(async () => {
27394
+ probeCounts += 1;
27395
+ let lockFileStats = void 0;
27396
+ try {
27397
+ debug(lockOrigin + " tries to acquire a lockfile - check if the lock is free now " + tryCount);
27398
+ lockFileStats = await fs3.stat(lockDirPath);
27399
+ } catch (fstatError) {
27400
+ if (fstatError.code === "ENOENT") {
27401
+ debug(lockOrigin + " tryCount++ in Promise - tries to acquire a lockfile - lock file seems to be free now - try to acquire " + tryCount);
27402
+ const lock = acquireFileLock(fs3, lockDirPath, lockOrigin, tryCount + 1);
27403
+ return resolve3(lock);
27404
+ }
27405
+ return reject(fstatError);
27406
+ }
27407
+ if (lockFileStats.mtimeMs === currentLockTime) {
27408
+ if (probeCounts >= nProbes) {
27409
+ debug(lockOrigin + " tries to acquire a lockfile - lock not free - but stale lets drop it" + tryCount);
27410
+ try {
27411
+ await fs3.rmdir(lockDirPath);
27412
+ } catch (rmLockError) {
27413
+ if (rmLockError.code === "ENOENT") {
27414
+ }
27415
+ return reject(rmLockError);
27416
+ }
27417
+ try {
27418
+ debug(lockOrigin + " tryCount++ same locker - try to acquire again after removing stale lock " + tryCount);
27419
+ const lock = await acquireFileLock(fs3, lockDirPath, lockOrigin, tryCount + 1);
27420
+ return resolve3(lock);
27421
+ } catch (lockAquireException) {
27422
+ return reject(lockAquireException);
27423
+ }
27424
+ } else {
27425
+ return scheduleProbationTimeout();
27426
+ }
27427
+ } else {
27428
+ try {
27429
+ debug(lockOrigin + " tryCount++ different locker - try to acquire again " + tryCount);
27430
+ const lock = await acquireFileLock(fs3, lockDirPath, lockOrigin, tryCount + 1);
27431
+ return resolve3(lock);
27432
+ } catch (error) {
27433
+ return reject(error);
27434
+ }
27435
+ }
27436
+ }, probeInterval);
27437
+ };
27438
+ scheduleProbationTimeout();
27439
+ });
27440
+ }
27441
+ async function releaseLock(fs3, lockDirPath, lockOrigin, lockTime) {
27442
+ debug(lockOrigin + " releasing the lock ");
27443
+ try {
27444
+ const stats = await fs3.stat(lockDirPath);
27445
+ if (stats.mtimeMs === lockTime) {
27446
+ await fs3.rmdir(lockDirPath);
27447
+ }
27448
+ } catch (statError) {
27449
+ debug(lockOrigin + " couldn't release the lock");
27450
+ if (statError.code === "ENOENT") {
27451
+ debug(lockOrigin + " WARNING - the lock was released by a different process");
27452
+ return;
27453
+ }
27454
+ debug(statError);
27455
+ throw statError;
27456
+ }
27457
+ }
24947
27458
 
24948
27459
  // ../../sdk/dist/listProjects.js
24949
27460
  init_define_ENV_DEFINED_IN_BUILD_STEP();
@@ -25164,11 +27675,7 @@ To detect this issue during linting, use the valid-js-identifier lint rule: http
25164
27675
  defaultLanguageTag: sourceLanguageTag
25165
27676
  });
25166
27677
  const compiledFallbackPattern = compiledPatterns[fallbackLanguage];
25167
- if (compiledFallbackPattern) {
25168
- resource[languageTag] = reexportMessage(message.id, fallbackLanguage);
25169
- } else {
25170
- resource[languageTag] = messageIdFallback(message.id, languageTag);
25171
- }
27678
+ resource[languageTag] = compiledFallbackPattern ? reexportMessage(message, fallbackLanguage) : messageIdFallback(message, languageTag);
25172
27679
  }
25173
27680
  }
25174
27681
  return resource;
@@ -25192,28 +27699,66 @@ export const ${args.message.id} = (params ${hasParams ? "" : "= {}"}, options =
25192
27699
  return {
25193
27700
  ${args.availableLanguageTags.sort((a, b) => a.localeCompare(b)).map((tag) => ` ${isValidJSIdentifier(tag) ? tag : `"${tag}"`}: ${i(tag)}.${args.message.id}`).join(",\n")}
25194
27701
  }[options.languageTag ?? languageTag()](${hasParams ? "params" : ""})
25195
- }`;
27702
+ }
27703
+ ${reexportAliases(args.message)}
27704
+ `;
25196
27705
  };
25197
27706
  var messageFunction = (args) => {
25198
27707
  const hasParams = Object.keys(args.params).length > 0;
25199
27708
  return `
27709
+
25200
27710
  /**
25201
27711
  * ${paramsType(args.params, false)}
25202
27712
  * @returns {string}
25203
27713
  */
25204
27714
  /* @__NO_SIDE_EFFECTS__ */
25205
- export const ${args.message.id} = (${hasParams ? "params" : ""}) => ${args.compiledPattern}`;
27715
+ export const ${args.message.id} = (${hasParams ? "params" : ""}) => ${args.compiledPattern}
27716
+ ${reexportAliases(args.message)}
27717
+ `;
25206
27718
  };
25207
- function reexportMessage(messageId, fromLanguageTag) {
25208
- return `export { ${messageId} } from "./${fromLanguageTag}.js"`;
27719
+ function reexportMessage(message, fromLanguageTag) {
27720
+ const exports = [message.id];
27721
+ if (message.alias["default"] && message.id !== message.alias["default"]) {
27722
+ exports.push(message.alias["default"]);
27723
+ }
27724
+ return `export { ${exports.join(", ")} } from "./${fromLanguageTag}.js"`;
25209
27725
  }
25210
- function messageIdFallback(messageId, languageTag) {
27726
+ function messageIdFallback(message, languageTag) {
25211
27727
  return `/**
25212
- * Failed to resolve message ${messageId} for languageTag "${languageTag}".
27728
+ * Failed to resolve message ${message.id} for languageTag "${languageTag}".
25213
27729
  * @returns {string}
25214
27730
  */
25215
27731
  /* @__NO_SIDE_EFFECTS__ */
25216
- export const ${messageId} = () => "${escapeForDoubleQuoteString(messageId)}"`;
27732
+ export const ${message.id} = () => "${escapeForDoubleQuoteString(message.id)}"
27733
+ ${reexportAliases(message)}
27734
+ `;
27735
+ }
27736
+ function reexportAliases(message) {
27737
+ let code = "";
27738
+ if (message.alias["default"] && message.id !== message.alias["default"]) {
27739
+ code += `
27740
+ /**
27741
+ * Change the reference from the alias \`m.${message.alias["default"]}()\` to \`m.${message.id}()\`:
27742
+ * \`\`\`diff
27743
+ * - m.${message.alias["default"]}()
27744
+ * + m.${message.id}()
27745
+ * \`\`\`
27746
+ * ---
27747
+ * \`${message.alias["default"]}\` is an alias for the message \`${message.id}\`.
27748
+ * Referencing aliases instead of the message ID has downsides like:
27749
+ *
27750
+ * - The alias might be renamed in the future, breaking the code.
27751
+ * - Constant naming convention discussions.
27752
+ *
27753
+ * Read more about aliases and their downsides here
27754
+ * @see inlang.com/link.
27755
+ * ---
27756
+ * @deprecated reference the message by id \`m.${message.id}()\` instead
27757
+ */
27758
+ export const ${message.alias["default"]} = ${message.id};
27759
+ `;
27760
+ }
27761
+ return code;
25217
27762
  }
25218
27763
 
25219
27764
  // src/services/telemetry/implementation.ts