@genai-fi/nanogpt 0.2.12 → 0.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 (115) hide show
  1. package/dist/Generator.js +30 -25
  2. package/dist/NanoGPTModel.d.ts +13 -14
  3. package/dist/NanoGPTModel.js +167 -85
  4. package/dist/TeachableLLM.d.ts +3 -5
  5. package/dist/TeachableLLM.js +47 -35
  6. package/dist/Trainer.js +8 -8
  7. package/dist/concat-BIZS_td9.js +33 -0
  8. package/dist/data/parquet.js +1 -1
  9. package/dist/exports_layers-7idKoYqh.js +25 -0
  10. package/dist/{sum-D7fu15XL.js → gather-BPGW8RsB.js} +6 -8
  11. package/dist/index-C4L8Cm77.js +349 -0
  12. package/dist/{index-YPKosni4.js → index-pWA4_lUh.js} +1020 -782
  13. package/dist/layers/CausalSelfAttention.d.ts +11 -11
  14. package/dist/layers/CausalSelfAttention.js +71 -63
  15. package/dist/layers/MLP.d.ts +6 -7
  16. package/dist/layers/MLP.js +18 -16
  17. package/dist/layers/RMSNorm.d.ts +6 -7
  18. package/dist/layers/RMSNorm.js +15 -13
  19. package/dist/layers/RoPECache.d.ts +4 -5
  20. package/dist/layers/RoPECache.js +36 -12
  21. package/dist/layers/TiedEmbedding.d.ts +7 -8
  22. package/dist/layers/TiedEmbedding.js +16 -418
  23. package/dist/layers/TransformerBlock.d.ts +8 -9
  24. package/dist/layers/TransformerBlock.js +12 -12
  25. package/dist/main.d.ts +1 -0
  26. package/dist/main.js +35 -21
  27. package/dist/{mat_mul-Bu7bhLms.js → mat_mul-D7_a4KJn.js} +5 -5
  28. package/dist/moments-DfcpfwKi.js +132 -0
  29. package/dist/ones-Cog-G2ag.js +29 -0
  30. package/dist/ops/appendCache.d.ts +2 -0
  31. package/dist/ops/appendCache.js +9 -0
  32. package/dist/ops/attentionMask.d.ts +1 -1
  33. package/dist/ops/attentionMask.js +7 -85
  34. package/dist/ops/cpu/appendCache.d.ts +2 -0
  35. package/dist/ops/cpu/appendCache.js +28 -0
  36. package/dist/ops/cpu/attentionMask.js +18 -0
  37. package/dist/ops/cpu/gatherSub.d.ts +1 -0
  38. package/dist/ops/cpu/gatherSub.js +34 -0
  39. package/dist/ops/cpu/qkv.d.ts +5 -0
  40. package/dist/ops/cpu/qkv.js +38 -0
  41. package/dist/ops/cpu/rope.d.ts +6 -0
  42. package/dist/ops/cpu/rope.js +38 -0
  43. package/dist/ops/cpu/scatterSub.d.ts +1 -0
  44. package/dist/ops/cpu/scatterSub.js +70 -0
  45. package/dist/ops/gatherSub.d.ts +1 -1
  46. package/dist/ops/gatherSub.js +6 -63
  47. package/dist/ops/grads/attentionMask.d.ts +1 -0
  48. package/dist/ops/grads/attentionMask.js +21 -0
  49. package/dist/ops/grads/qkv.d.ts +1 -0
  50. package/dist/ops/grads/qkv.js +20 -0
  51. package/dist/ops/grads/rope.d.ts +1 -0
  52. package/dist/ops/grads/rope.js +14 -0
  53. package/dist/ops/node/sparseCrossEntropy.js +1 -1
  54. package/dist/ops/qkv.d.ts +1 -6
  55. package/dist/ops/qkv.js +7 -124
  56. package/dist/ops/rope.d.ts +0 -5
  57. package/dist/ops/rope.js +7 -151
  58. package/dist/ops/scatterSub.d.ts +1 -1
  59. package/dist/ops/scatterSub.js +6 -147
  60. package/dist/ops/webgl/appendCache.d.ts +1 -0
  61. package/dist/ops/webgl/appendCache.js +43 -0
  62. package/dist/ops/webgl/attentionMask.d.ts +1 -0
  63. package/dist/ops/webgl/attentionMask.js +43 -0
  64. package/dist/ops/webgl/gatherSub.d.ts +1 -0
  65. package/dist/ops/webgl/gatherSub.js +27 -0
  66. package/dist/ops/webgl/qkv.d.ts +1 -0
  67. package/dist/ops/webgl/qkv.js +46 -0
  68. package/dist/ops/webgl/rope.d.ts +1 -0
  69. package/dist/ops/webgl/rope.js +56 -0
  70. package/dist/ops/webgl/scatterSub.d.ts +1 -0
  71. package/dist/ops/webgl/scatterSub.js +27 -0
  72. package/dist/{parquet-BRl5lE_I.js → parquet-C0Tlmv9c.js} +3045 -3048
  73. package/dist/random_width-PbCt7RXv.js +15489 -0
  74. package/dist/range-CcDl05lo.js +26 -0
  75. package/dist/{reshape-DmnmKT6r.js → reshape-C8CR_Bad.js} +3 -3
  76. package/dist/sin-BJIrfnj7.js +47 -0
  77. package/dist/softmax-Be_lsqUc.js +105 -0
  78. package/dist/{complex-CJ-qCcLB.js → split-DZbvruEP.js} +6 -8
  79. package/dist/stack-BMm-efee.js +27 -0
  80. package/dist/sum-C7Mgy9Bw.js +104 -0
  81. package/dist/tensor-DJVbYhh1.js +24 -0
  82. package/dist/tensor2d-ZuQSh2D-.js +30 -0
  83. package/dist/tokeniser/bpe.d.ts +17 -6
  84. package/dist/tokeniser/bpe.js +88 -60
  85. package/dist/training/AdamExt.js +1 -1
  86. package/dist/training/DatasetBuilder.d.ts +6 -6
  87. package/dist/training/DatasetBuilder.js +1262 -17
  88. package/dist/training/Evaluator.d.ts +3 -2
  89. package/dist/training/FullTrainer.d.ts +9 -8
  90. package/dist/training/FullTrainer.js +26 -25
  91. package/dist/training/LayerTrainer.d.ts +9 -8
  92. package/dist/training/LayerTrainer.js +34 -33
  93. package/dist/training/Trainer.d.ts +22 -21
  94. package/dist/training/Trainer.js +21 -18
  95. package/dist/training/sparseCrossEntropy.js +22 -166
  96. package/dist/utilities/dummy.js +10 -8
  97. package/dist/utilities/generate.js +14 -11
  98. package/dist/utilities/load.d.ts +1 -2
  99. package/dist/utilities/load.js +37 -35
  100. package/dist/utilities/profile.js +1 -1
  101. package/dist/utilities/save.js +14 -9
  102. package/dist/utilities/tokenParse.d.ts +1 -1
  103. package/dist/utilities/tokenParse.js +7 -61
  104. package/dist/utilities/weights.d.ts +3 -3
  105. package/dist/utilities/weights.js +21 -19
  106. package/dist/variable-Dl_ub3pk.js +23 -0
  107. package/dist/{stack-BtKpB0Ry.js → zeros-CCy9C3uU.js} +18 -16
  108. package/package.json +2 -1
  109. package/dist/assets/worker-BYeSPNkq.js +0 -1
  110. package/dist/tokeniser/NodeTokeniser.d.ts +0 -20
  111. package/dist/tokeniser/NodeTokeniser.js +0 -46
  112. package/dist/tokeniser/WebTokeniser.d.ts +0 -18
  113. package/dist/tokeniser/WebTokeniser.js +0 -96
  114. package/dist/tokeniser/worker.js +0 -53
  115. /package/dist/{tokeniser/worker.d.ts → ops/cpu/attentionMask.d.ts} +0 -0
package/dist/Trainer.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { E as l } from "./index-Dwqa6Zy2.js";
2
2
  import h from "./training/FullTrainer.js";
3
- class m extends l {
3
+ class c extends l {
4
4
  trainer;
5
5
  hasTrained = !1;
6
- constructor(a, t) {
7
- super(), this.trainer = new h(a.tf, a, t, 1e-3);
6
+ constructor(e, t) {
7
+ super(), this.trainer = new h(e, t, 1e-3);
8
8
  }
9
9
  stop() {
10
10
  this.trainer.stop();
@@ -12,14 +12,14 @@ class m extends l {
12
12
  reset() {
13
13
  this.hasTrained = !1, this.trainer.reset();
14
14
  }
15
- async train(a, t) {
16
- const { trainDataset: e, validationDataset: r } = await this.trainer.createTrainValidationSplit(
17
- a,
15
+ async train(e, t) {
16
+ const { trainDataset: a, validationDataset: r } = await this.trainer.createTrainValidationSplit(
17
+ e,
18
18
  t?.batchSize || 32,
19
19
  t?.validationSplit || 0.1
20
20
  );
21
21
  this.hasTrained || this.trainer.setLearningRate(t?.learningRate || 1e-3), this.hasTrained = !0, this.emit("start"), await this.trainer.trainOnDataset(
22
- e,
22
+ a,
23
23
  {
24
24
  prompt: t?.prompt,
25
25
  logInterval: t?.logInterval || 10,
@@ -36,5 +36,5 @@ class m extends l {
36
36
  }
37
37
  }
38
38
  export {
39
- m as default
39
+ c as default
40
40
  };
@@ -0,0 +1,33 @@
1
+ import { o as s, j as a, i, u as p, E as l, C as u } from "./index-pWA4_lUh.js";
2
+ /**
3
+ * @license
4
+ * Copyright 2020 Google LLC. All Rights Reserved.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ * =============================================================================
17
+ */
18
+ function f(o, e = 0) {
19
+ a(o.length >= 1, () => "Pass at least one tensor to concat");
20
+ const t = i(o, "tensors", "concat", "string_or_numeric");
21
+ if (t[0].dtype === "complex64" && t.forEach((n) => {
22
+ if (n.dtype !== "complex64")
23
+ throw new Error(`Cannot concatenate complex64 tensors with a tensor
24
+ with dtype ${n.dtype}. `);
25
+ }), t.length === 1)
26
+ return p(t[0]);
27
+ const r = t, c = { axis: e };
28
+ return l.runKernel(u, r, c);
29
+ }
30
+ const m = /* @__PURE__ */ s({ concat_: f });
31
+ export {
32
+ m as c
33
+ };
@@ -1,7 +1,7 @@
1
1
  import { B as n } from "../index-Tf7vU29b.js";
2
2
  const p = 100 * 1024 * 1024;
3
3
  async function w(s, f = p, r = "text") {
4
- const e = await (await import("../parquet-BRl5lE_I.js").then((t) => t.p)).ParquetReader.openBuffer(n.from(await s.arrayBuffer())), a = [], i = e.getCursor([[r]]);
4
+ const e = await (await import("../parquet-C0Tlmv9c.js").then((t) => t.p)).ParquetReader.openBuffer(n.from(await s.arrayBuffer())), a = [], i = e.getCursor([[r]]);
5
5
  let o = 0;
6
6
  for (; ; ) {
7
7
  const t = await i.next();
@@ -0,0 +1,25 @@
1
+ import { E as e, D as r, a as o } from "./random_width-PbCt7RXv.js";
2
+ import "./index-pWA4_lUh.js";
3
+ /**
4
+ * @license
5
+ * Copyright 2018 Google LLC
6
+ *
7
+ * Use of this source code is governed by an MIT-style
8
+ * license that can be found in the LICENSE file or at
9
+ * https://opensource.org/licenses/MIT.
10
+ * =============================================================================
11
+ */
12
+ function s(n) {
13
+ return new o(n);
14
+ }
15
+ function u(n) {
16
+ return new r(n);
17
+ }
18
+ function d(n) {
19
+ return new e(n);
20
+ }
21
+ export {
22
+ u as a,
23
+ s as d,
24
+ d as e
25
+ };
@@ -1,4 +1,4 @@
1
- import { o as e, d as u, h as c, E as l, S as m } from "./index-YPKosni4.js";
1
+ import { o as h, h as t, E as g, G as p } from "./index-pWA4_lUh.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -15,13 +15,11 @@ import { o as e, d as u, h as c, E as l, S as m } from "./index-YPKosni4.js";
15
15
  * limitations under the License.
16
16
  * =============================================================================
17
17
  */
18
- function i(t, o = null, n = !1) {
19
- let s = u(t, "x", "sum");
20
- s.dtype === "bool" && (s = c(s, "int32"));
21
- const r = { x: s }, a = { axis: o, keepDims: n };
22
- return l.runKernel(m, r, a);
18
+ function u(n, s, r = 0, e = 0) {
19
+ const o = t(n, "x", "gather"), a = t(s, "indices", "gather", "int32"), c = { x: o, indices: a }, i = { axis: r, batchDims: e };
20
+ return g.runKernel(p, c, i);
23
21
  }
24
- const f = /* @__PURE__ */ e({ sum_: i });
22
+ const d = /* @__PURE__ */ h({ gather_: u });
25
23
  export {
26
- f as s
24
+ d as g
27
25
  };
@@ -0,0 +1,349 @@
1
+ var D = { exports: {} }, Q = D.exports, H;
2
+ function W() {
3
+ return H || (H = 1, function(w) {
4
+ (function(d, f, g) {
5
+ function v(r) {
6
+ var e = this, i = u();
7
+ e.next = function() {
8
+ var n = 2091639 * e.s0 + e.c * 23283064365386963e-26;
9
+ return e.s0 = e.s1, e.s1 = e.s2, e.s2 = n - (e.c = n | 0);
10
+ }, e.c = 1, e.s0 = i(" "), e.s1 = i(" "), e.s2 = i(" "), e.s0 -= i(r), e.s0 < 0 && (e.s0 += 1), e.s1 -= i(r), e.s1 < 0 && (e.s1 += 1), e.s2 -= i(r), e.s2 < 0 && (e.s2 += 1), i = null;
11
+ }
12
+ function h(r, e) {
13
+ return e.c = r.c, e.s0 = r.s0, e.s1 = r.s1, e.s2 = r.s2, e;
14
+ }
15
+ function c(r, e) {
16
+ var i = new v(r), n = e && e.state, t = i.next;
17
+ return t.int32 = function() {
18
+ return i.next() * 4294967296 | 0;
19
+ }, t.double = function() {
20
+ return t() + (t() * 2097152 | 0) * 11102230246251565e-32;
21
+ }, t.quick = t, n && (typeof n == "object" && h(n, i), t.state = function() {
22
+ return h(i, {});
23
+ }), t;
24
+ }
25
+ function u() {
26
+ var r = 4022871197, e = function(i) {
27
+ i = String(i);
28
+ for (var n = 0; n < i.length; n++) {
29
+ r += i.charCodeAt(n);
30
+ var t = 0.02519603282416938 * r;
31
+ r = t >>> 0, t -= r, t *= r, r = t >>> 0, t -= r, r += t * 4294967296;
32
+ }
33
+ return (r >>> 0) * 23283064365386963e-26;
34
+ };
35
+ return e;
36
+ }
37
+ f && f.exports ? f.exports = c : this.alea = c;
38
+ })(
39
+ Q,
40
+ w
41
+ );
42
+ }(D)), D.exports;
43
+ }
44
+ var T = { exports: {} }, Y = T.exports, I;
45
+ function Z() {
46
+ return I || (I = 1, function(w) {
47
+ (function(d, f, g) {
48
+ function v(u) {
49
+ var r = this, e = "";
50
+ r.x = 0, r.y = 0, r.z = 0, r.w = 0, r.next = function() {
51
+ var n = r.x ^ r.x << 11;
52
+ return r.x = r.y, r.y = r.z, r.z = r.w, r.w ^= r.w >>> 19 ^ n ^ n >>> 8;
53
+ }, u === (u | 0) ? r.x = u : e += u;
54
+ for (var i = 0; i < e.length + 64; i++)
55
+ r.x ^= e.charCodeAt(i) | 0, r.next();
56
+ }
57
+ function h(u, r) {
58
+ return r.x = u.x, r.y = u.y, r.z = u.z, r.w = u.w, r;
59
+ }
60
+ function c(u, r) {
61
+ var e = new v(u), i = r && r.state, n = function() {
62
+ return (e.next() >>> 0) / 4294967296;
63
+ };
64
+ return n.double = function() {
65
+ do
66
+ var t = e.next() >>> 11, o = (e.next() >>> 0) / 4294967296, a = (t + o) / (1 << 21);
67
+ while (a === 0);
68
+ return a;
69
+ }, n.int32 = e.next, n.quick = n, i && (typeof i == "object" && h(i, e), n.state = function() {
70
+ return h(e, {});
71
+ }), n;
72
+ }
73
+ f && f.exports ? f.exports = c : this.xor128 = c;
74
+ })(
75
+ Y,
76
+ w
77
+ );
78
+ }(T)), T.exports;
79
+ }
80
+ var k = { exports: {} }, _ = k.exports, J;
81
+ function rr() {
82
+ return J || (J = 1, function(w) {
83
+ (function(d, f, g) {
84
+ function v(u) {
85
+ var r = this, e = "";
86
+ r.next = function() {
87
+ var n = r.x ^ r.x >>> 2;
88
+ return r.x = r.y, r.y = r.z, r.z = r.w, r.w = r.v, (r.d = r.d + 362437 | 0) + (r.v = r.v ^ r.v << 4 ^ (n ^ n << 1)) | 0;
89
+ }, r.x = 0, r.y = 0, r.z = 0, r.w = 0, r.v = 0, u === (u | 0) ? r.x = u : e += u;
90
+ for (var i = 0; i < e.length + 64; i++)
91
+ r.x ^= e.charCodeAt(i) | 0, i == e.length && (r.d = r.x << 10 ^ r.x >>> 4), r.next();
92
+ }
93
+ function h(u, r) {
94
+ return r.x = u.x, r.y = u.y, r.z = u.z, r.w = u.w, r.v = u.v, r.d = u.d, r;
95
+ }
96
+ function c(u, r) {
97
+ var e = new v(u), i = r && r.state, n = function() {
98
+ return (e.next() >>> 0) / 4294967296;
99
+ };
100
+ return n.double = function() {
101
+ do
102
+ var t = e.next() >>> 11, o = (e.next() >>> 0) / 4294967296, a = (t + o) / (1 << 21);
103
+ while (a === 0);
104
+ return a;
105
+ }, n.int32 = e.next, n.quick = n, i && (typeof i == "object" && h(i, e), n.state = function() {
106
+ return h(e, {});
107
+ }), n;
108
+ }
109
+ f && f.exports ? f.exports = c : this.xorwow = c;
110
+ })(
111
+ _,
112
+ w
113
+ );
114
+ }(k)), k.exports;
115
+ }
116
+ var B = { exports: {} }, nr = B.exports, K;
117
+ function tr() {
118
+ return K || (K = 1, function(w) {
119
+ (function(d, f, g) {
120
+ function v(u) {
121
+ var r = this;
122
+ r.next = function() {
123
+ var i = r.x, n = r.i, t, o;
124
+ return t = i[n], t ^= t >>> 7, o = t ^ t << 24, t = i[n + 1 & 7], o ^= t ^ t >>> 10, t = i[n + 3 & 7], o ^= t ^ t >>> 3, t = i[n + 4 & 7], o ^= t ^ t << 7, t = i[n + 7 & 7], t = t ^ t << 13, o ^= t ^ t << 9, i[n] = o, r.i = n + 1 & 7, o;
125
+ };
126
+ function e(i, n) {
127
+ var t, o = [];
128
+ if (n === (n | 0))
129
+ o[0] = n;
130
+ else
131
+ for (n = "" + n, t = 0; t < n.length; ++t)
132
+ o[t & 7] = o[t & 7] << 15 ^ n.charCodeAt(t) + o[t + 1 & 7] << 13;
133
+ for (; o.length < 8; ) o.push(0);
134
+ for (t = 0; t < 8 && o[t] === 0; ++t) ;
135
+ for (t == 8 ? o[7] = -1 : o[t], i.x = o, i.i = 0, t = 256; t > 0; --t)
136
+ i.next();
137
+ }
138
+ e(r, u);
139
+ }
140
+ function h(u, r) {
141
+ return r.x = u.x.slice(), r.i = u.i, r;
142
+ }
143
+ function c(u, r) {
144
+ u == null && (u = +/* @__PURE__ */ new Date());
145
+ var e = new v(u), i = r && r.state, n = function() {
146
+ return (e.next() >>> 0) / 4294967296;
147
+ };
148
+ return n.double = function() {
149
+ do
150
+ var t = e.next() >>> 11, o = (e.next() >>> 0) / 4294967296, a = (t + o) / (1 << 21);
151
+ while (a === 0);
152
+ return a;
153
+ }, n.int32 = e.next, n.quick = n, i && (i.x && h(i, e), n.state = function() {
154
+ return h(e, {});
155
+ }), n;
156
+ }
157
+ f && f.exports ? f.exports = c : this.xorshift7 = c;
158
+ })(
159
+ nr,
160
+ w
161
+ );
162
+ }(B)), B.exports;
163
+ }
164
+ var E = { exports: {} }, er = E.exports, L;
165
+ function ir() {
166
+ return L || (L = 1, function(w) {
167
+ (function(d, f, g) {
168
+ function v(u) {
169
+ var r = this;
170
+ r.next = function() {
171
+ var i = r.w, n = r.X, t = r.i, o, a;
172
+ return r.w = i = i + 1640531527 | 0, a = n[t + 34 & 127], o = n[t = t + 1 & 127], a ^= a << 13, o ^= o << 17, a ^= a >>> 15, o ^= o >>> 12, a = n[t] = a ^ o, r.i = t, a + (i ^ i >>> 16) | 0;
173
+ };
174
+ function e(i, n) {
175
+ var t, o, a, q, C, A = [], R = 128;
176
+ for (n === (n | 0) ? (o = n, n = null) : (n = n + "\0", o = 0, R = Math.max(R, n.length)), a = 0, q = -32; q < R; ++q)
177
+ n && (o ^= n.charCodeAt((q + 32) % n.length)), q === 0 && (C = o), o ^= o << 10, o ^= o >>> 15, o ^= o << 4, o ^= o >>> 13, q >= 0 && (C = C + 1640531527 | 0, t = A[q & 127] ^= o + C, a = t == 0 ? a + 1 : 0);
178
+ for (a >= 128 && (A[(n && n.length || 0) & 127] = -1), a = 127, q = 512; q > 0; --q)
179
+ o = A[a + 34 & 127], t = A[a = a + 1 & 127], o ^= o << 13, t ^= t << 17, o ^= o >>> 15, t ^= t >>> 12, A[a] = o ^ t;
180
+ i.w = C, i.X = A, i.i = a;
181
+ }
182
+ e(r, u);
183
+ }
184
+ function h(u, r) {
185
+ return r.i = u.i, r.w = u.w, r.X = u.X.slice(), r;
186
+ }
187
+ function c(u, r) {
188
+ u == null && (u = +/* @__PURE__ */ new Date());
189
+ var e = new v(u), i = r && r.state, n = function() {
190
+ return (e.next() >>> 0) / 4294967296;
191
+ };
192
+ return n.double = function() {
193
+ do
194
+ var t = e.next() >>> 11, o = (e.next() >>> 0) / 4294967296, a = (t + o) / (1 << 21);
195
+ while (a === 0);
196
+ return a;
197
+ }, n.int32 = e.next, n.quick = n, i && (i.X && h(i, e), n.state = function() {
198
+ return h(e, {});
199
+ }), n;
200
+ }
201
+ f && f.exports ? f.exports = c : this.xor4096 = c;
202
+ })(
203
+ er,
204
+ // window object or global
205
+ w
206
+ );
207
+ }(E)), E.exports;
208
+ }
209
+ var U = { exports: {} }, or = U.exports, N;
210
+ function ur() {
211
+ return N || (N = 1, function(w) {
212
+ (function(d, f, g) {
213
+ function v(u) {
214
+ var r = this, e = "";
215
+ r.next = function() {
216
+ var n = r.b, t = r.c, o = r.d, a = r.a;
217
+ return n = n << 25 ^ n >>> 7 ^ t, t = t - o | 0, o = o << 24 ^ o >>> 8 ^ a, a = a - n | 0, r.b = n = n << 20 ^ n >>> 12 ^ t, r.c = t = t - o | 0, r.d = o << 16 ^ t >>> 16 ^ a, r.a = a - n | 0;
218
+ }, r.a = 0, r.b = 0, r.c = -1640531527, r.d = 1367130551, u === Math.floor(u) ? (r.a = u / 4294967296 | 0, r.b = u | 0) : e += u;
219
+ for (var i = 0; i < e.length + 20; i++)
220
+ r.b ^= e.charCodeAt(i) | 0, r.next();
221
+ }
222
+ function h(u, r) {
223
+ return r.a = u.a, r.b = u.b, r.c = u.c, r.d = u.d, r;
224
+ }
225
+ function c(u, r) {
226
+ var e = new v(u), i = r && r.state, n = function() {
227
+ return (e.next() >>> 0) / 4294967296;
228
+ };
229
+ return n.double = function() {
230
+ do
231
+ var t = e.next() >>> 11, o = (e.next() >>> 0) / 4294967296, a = (t + o) / (1 << 21);
232
+ while (a === 0);
233
+ return a;
234
+ }, n.int32 = e.next, n.quick = n, i && (typeof i == "object" && h(i, e), n.state = function() {
235
+ return h(e, {});
236
+ }), n;
237
+ }
238
+ f && f.exports ? f.exports = c : this.tychei = c;
239
+ })(
240
+ or,
241
+ w
242
+ );
243
+ }(U)), U.exports;
244
+ }
245
+ var V = { exports: {} }, ar = V.exports, O;
246
+ function fr() {
247
+ return O || (O = 1, function(w) {
248
+ (function(d, f, g) {
249
+ var v = 256, h = 6, c = 52, u = "random", r = g.pow(v, h), e = g.pow(2, c), i = e * 2, n = v - 1, t;
250
+ function o(x, s, y) {
251
+ var p = [];
252
+ s = s == !0 ? { entropy: !0 } : s || {};
253
+ var l = A(C(
254
+ s.entropy ? [x, $(f)] : x ?? R(),
255
+ 3
256
+ ), p), X = new a(p), m = function() {
257
+ for (var b = X.g(h), j = r, S = 0; b < e; )
258
+ b = (b + S) * v, j *= v, S = X.g(1);
259
+ for (; b >= i; )
260
+ b /= 2, j /= 2, S >>>= 1;
261
+ return (b + S) / j;
262
+ };
263
+ return m.int32 = function() {
264
+ return X.g(4) | 0;
265
+ }, m.quick = function() {
266
+ return X.g(4) / 4294967296;
267
+ }, m.double = m, A($(X.S), f), (s.pass || y || function(b, j, S, z) {
268
+ return z && (z.S && q(z, X), b.state = function() {
269
+ return q(X, {});
270
+ }), S ? (g[u] = b, j) : b;
271
+ })(
272
+ m,
273
+ l,
274
+ "global" in s ? s.global : this == g,
275
+ s.state
276
+ );
277
+ }
278
+ function a(x) {
279
+ var s, y = x.length, p = this, l = 0, X = p.i = p.j = 0, m = p.S = [];
280
+ for (y || (x = [y++]); l < v; )
281
+ m[l] = l++;
282
+ for (l = 0; l < v; l++)
283
+ m[l] = m[X = n & X + x[l % y] + (s = m[l])], m[X] = s;
284
+ (p.g = function(b) {
285
+ for (var j, S = 0, z = p.i, M = p.j, G = p.S; b--; )
286
+ j = G[z = n & z + 1], S = S * v + G[n & (G[z] = G[M = n & M + j]) + (G[M] = j)];
287
+ return p.i = z, p.j = M, S;
288
+ })(v);
289
+ }
290
+ function q(x, s) {
291
+ return s.i = x.i, s.j = x.j, s.S = x.S.slice(), s;
292
+ }
293
+ function C(x, s) {
294
+ var y = [], p = typeof x, l;
295
+ if (s && p == "object")
296
+ for (l in x)
297
+ try {
298
+ y.push(C(x[l], s - 1));
299
+ } catch {
300
+ }
301
+ return y.length ? y : p == "string" ? x : x + "\0";
302
+ }
303
+ function A(x, s) {
304
+ for (var y = x + "", p, l = 0; l < y.length; )
305
+ s[n & l] = n & (p ^= s[n & l] * 19) + y.charCodeAt(l++);
306
+ return $(s);
307
+ }
308
+ function R() {
309
+ try {
310
+ var x;
311
+ return t && (x = t.randomBytes) ? x = x(v) : (x = new Uint8Array(v), (d.crypto || d.msCrypto).getRandomValues(x)), $(x);
312
+ } catch {
313
+ var s = d.navigator, y = s && s.plugins;
314
+ return [+/* @__PURE__ */ new Date(), d, y, d.screen, $(f)];
315
+ }
316
+ }
317
+ function $(x) {
318
+ return String.fromCharCode.apply(0, x);
319
+ }
320
+ if (A(g.random(), f), w.exports) {
321
+ w.exports = o;
322
+ try {
323
+ t = require("crypto");
324
+ } catch {
325
+ }
326
+ } else
327
+ g["seed" + u] = o;
328
+ })(
329
+ // global: `self` in browsers (including strict mode and web workers),
330
+ // otherwise `this` in Node and other environments
331
+ typeof self < "u" ? self : ar,
332
+ [],
333
+ // pool: entropy pool starts empty
334
+ Math
335
+ // math: package containing random, pow, and seedrandom
336
+ );
337
+ }(V)), V.exports;
338
+ }
339
+ var F, P;
340
+ function xr() {
341
+ if (P) return F;
342
+ P = 1;
343
+ var w = W(), d = Z(), f = rr(), g = tr(), v = ir(), h = ur(), c = fr();
344
+ return c.alea = w, c.xor128 = d, c.xorwow = f, c.xorshift7 = g, c.xor4096 = v, c.tychei = h, F = c, F;
345
+ }
346
+ var cr = xr();
347
+ export {
348
+ cr as s
349
+ };