agentglow 0.4.3 → 0.4.5

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.
@@ -1,18 +1,18 @@
1
- var Ge = Object.defineProperty;
2
- var ke = (t, e, s) => e in t ? Ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var k = (t, e, s) => ke(t, typeof e != "symbol" ? e + "" : e, s);
1
+ var ke = Object.defineProperty;
2
+ var Le = (t, e, s) => e in t ? ke(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var k = (t, e, s) => Le(t, typeof e != "symbol" ? e + "" : e, s);
4
4
  import { jsxs as lt, Fragment as Kt, jsx as b } from "react/jsx-runtime";
5
- import { EffectComposer as Le, Bloom as Oe, Vignette as Ee } from "@react-three/postprocessing";
5
+ import { EffectComposer as Oe, Bloom as Ee, Vignette as Fe } from "@react-three/postprocessing";
6
6
  import * as r from "three";
7
- import { useFrame as ht, useThree as Fe } from "@react-three/fiber";
7
+ import { useFrame as dt, useThree as je } from "@react-three/fiber";
8
8
  import { useMemo as D, useRef as I, useEffect as ce } from "react";
9
- import { T as le, h as et, f as Rt, K as je, w as L, F as qe, a as St, P as We, L as Bt, C as Ke, u as _e, A as st, d as ve, k as Ue, H as Ne, R as Xe, E as $e, W as He, e as Ze, s as Ye, j as Qe, n as Je, o as to, x as eo } from "./KitScene-DsZmpTf7.js";
10
- var Pe;
11
- const nt = typeof window < "u" && !!((Pe = window.matchMedia) != null && Pe.call(window, "(prefers-reduced-motion: reduce)").matches), rt = (t) => t < 0 ? 0 : t > 1 ? 1 : t, jt = (t) => 1 - Math.pow(1 - rt(t), 3), ne = (t) => (t = rt(t), t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2), pt = () => performance.now() / 1e3, N = new r.Color(1, 1, 1), X = new r.Color("#bff3ff");
9
+ import { T as le, h as ot, f as Rt, K as qe, w as L, F as We, a as St, Q as Ke, L as Bt, C as Ue, u as Re, A as Q, d as ve, k as Xe, H as Ne, R as $e, E as He, X as Ze, e as Ye, s as Qe, j as Je, n as to, o as eo, x as oo } from "./KitScene-DNk9wirq.js";
10
+ var _e;
11
+ const st = typeof window < "u" && !!((_e = window.matchMedia) != null && _e.call(window, "(prefers-reduced-motion: reduce)").matches), rt = (t) => t < 0 ? 0 : t > 1 ? 1 : t, jt = (t) => 1 - Math.pow(1 - rt(t), 3), ne = (t) => (t = rt(t), t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2), mt = () => performance.now() / 1e3, N = new r.Color(1, 1, 1), $ = new r.Color("#bff3ff");
12
12
  new r.Color("#2dd4bf");
13
- const Xt = new r.Color("#fbbf24"), _t = new r.Color("#ff3048"), It = Object.fromEntries(Object.entries(le).map(([t, e]) => [t, new r.Color(e).lerp(X, 0.38)])), oo = Object.fromEntries(Object.entries(le).map(([t, e]) => [t, new r.Color(e)]));
13
+ const Nt = new r.Color("#fbbf24"), _t = new r.Color("#ff3048"), It = Object.fromEntries(Object.entries(le).map(([t, e]) => [t, new r.Color(e).lerp($, 0.38)])), no = Object.fromEntries(Object.entries(le).map(([t, e]) => [t, new r.Color(e)]));
14
14
  let Dt = null;
15
- function no() {
15
+ function so() {
16
16
  if (Dt) return Dt;
17
17
  const t = document.createElement("canvas");
18
18
  t.width = t.height = 128;
@@ -20,12 +20,12 @@ function no() {
20
20
  return s.addColorStop(0, "rgba(255,255,255,1)"), s.addColorStop(0.1, "rgba(255,255,255,0.7)"), s.addColorStop(0.35, "rgba(255,255,255,0.14)"), s.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = s, e.fillRect(0, 0, 128, 128), Dt = new r.CanvasTexture(t), Dt.colorSpace = r.SRGBColorSpace, Dt;
21
21
  }
22
22
  function se(t = "#fff") {
23
- return new r.SpriteMaterial({ map: no(), color: t, blending: r.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
23
+ return new r.SpriteMaterial({ map: so(), color: t, blending: r.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
24
24
  }
25
- function so(t = "#fff") {
25
+ function ro(t = "#fff") {
26
26
  return new r.MeshBasicMaterial({ color: t, blending: r.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, side: r.DoubleSide });
27
27
  }
28
- function ot(t) {
28
+ function nt(t) {
29
29
  return new r.LineBasicMaterial({ color: t ?? "#fff", vertexColors: t === void 0, transparent: !0, blending: r.AdditiveBlending, depthWrite: !1, toneMapped: !1 });
30
30
  }
31
31
  const be = (() => {
@@ -35,16 +35,16 @@ const be = (() => {
35
35
  t.push(Math.cos(o), Math.sin(o), 0, Math.cos(d), Math.sin(d), 0);
36
36
  }
37
37
  return new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
38
- })(), ro = new r.SphereGeometry(1, 12, 8);
38
+ })(), ao = new r.SphereGeometry(1, 12, 8);
39
39
  function Ut(t, e, s, o, d) {
40
- const c = 1 - o;
41
- return d.set(c * c * t.x + 2 * c * o * e.x + o * o * s.x, c * c * t.y + 2 * c * o * e.y + o * o * s.y, c * c * t.z + 2 * c * o * e.z + o * o * s.z);
40
+ const f = 1 - o;
41
+ return d.set(f * f * t.x + 2 * f * o * e.x + o * o * s.x, f * f * t.y + 2 * f * o * e.y + o * o * s.y, f * f * t.z + 2 * f * o * e.z + o * o * s.z);
42
42
  }
43
43
  function qt(t, e, s, o) {
44
- const d = e.x - t.x, c = e.y - t.y;
45
- return o.copy(t).add(e).multiplyScalar(0.5), o.x += -c * s, o.y += d * s, o;
44
+ const d = e.x - t.x, f = e.y - t.y;
45
+ return o.copy(t).add(e).multiplyScalar(0.5), o.x += -f * s, o.y += d * s, o;
46
46
  }
47
- const ao = (
47
+ const io = (
48
48
  /* glsl */
49
49
  `
50
50
  attribute vec4 aData; attribute vec3 aColor;
@@ -74,7 +74,7 @@ void main(){
74
74
  gl_PointSize = clamp(px, 0.0, 256.0);
75
75
  gl_Position = projectionMatrix * mv;
76
76
  }`
77
- ), io = (
77
+ ), co = (
78
78
  /* glsl */
79
79
  `
80
80
  varying vec3 vC; varying float vKind;
@@ -93,11 +93,11 @@ void main(){
93
93
  }
94
94
  gl_FragColor = vec4(vC * k, 1.0);
95
95
  }`
96
- ), co = 32768;
97
- class lo {
98
- constructor(e = co) {
96
+ ), lo = 32768;
97
+ class fo {
98
+ constructor(e = lo) {
99
99
  k(this, "geo", new r.BufferGeometry());
100
- k(this, "mat", new r.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 }, uMinPx: { value: 2.4 } }, vertexShader: ao, fragmentShader: io, transparent: !0, depthWrite: !1, blending: r.AdditiveBlending }));
100
+ k(this, "mat", new r.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 }, uMinPx: { value: 2.4 } }, vertexShader: io, fragmentShader: co, transparent: !0, depthWrite: !1, blending: r.AdditiveBlending }));
101
101
  k(this, "obj");
102
102
  k(this, "P");
103
103
  k(this, "D");
@@ -111,11 +111,11 @@ class lo {
111
111
  this.D = new r.BufferAttribute(s, 4).setUsage(r.DynamicDrawUsage), this.C = new r.BufferAttribute(new Float32Array(e * 3), 3).setUsage(r.DynamicDrawUsage), this.geo.setAttribute("position", this.P), this.geo.setAttribute("aData", this.D), this.geo.setAttribute("aColor", this.C), this.geo.boundingSphere = new r.Sphere(new r.Vector3(), 1e5), this.obj = new r.Points(this.geo, this.mat), this.obj.frustumCulled = !1, this.obj.renderOrder = 2;
112
112
  }
113
113
  /** one bubble/flash; `birth` in nowS() seconds (future = drawn later), colour premultiplied by `k` */
114
- emit(e, s, o, d, c, a, l, f, u = 0) {
114
+ emit(e, s, o, d, f, a, c, l, u = 0) {
115
115
  const i = this.head;
116
116
  this.head = (i + 1) % this.max, this.lo < 0 && (this.lo = i), this.n++;
117
117
  const p = this.P.array, h = this.D.array, m = this.C.array;
118
- p[i * 3] = e, p[i * 3 + 1] = s, p[i * 3 + 2] = o, h[i * 4] = f, h[i * 4 + 1] = l, h[i * 4 + 2] = d, h[i * 4 + 3] = u, m[i * 3] = c.r * a, m[i * 3 + 1] = c.g * a, m[i * 3 + 2] = c.b * a;
118
+ p[i * 3] = e, p[i * 3 + 1] = s, p[i * 3 + 2] = o, h[i * 4] = l, h[i * 4 + 1] = c, h[i * 4 + 2] = d, h[i * 4 + 3] = u, m[i * 3] = f.r * a, m[i * 3 + 1] = f.g * a, m[i * 3 + 2] = f.b * a;
119
119
  }
120
120
  /** upload the slots written since the last flush (one or two ranges) */
121
121
  flush() {
@@ -132,20 +132,20 @@ class lo {
132
132
  this.mat.uniforms.uScale.value = e * s / (2 * Math.tan(o * Math.PI / 360)), this.mat.uniforms.uMinPx.value = 2.4 * s;
133
133
  }
134
134
  }
135
- let fo = null;
136
- const Z = () => fo ?? (fo = new lo());
137
- function re(t, e, s, o, d, c, a, l) {
138
- const f = Z();
135
+ let uo = null;
136
+ const Z = () => uo ?? (uo = new fo());
137
+ function re(t, e, s, o, d, f, a, c) {
138
+ const l = Z();
139
139
  for (let u = 0; u < e; u++) {
140
140
  const i = Math.random() * 2 - 1, p = Math.random() * Math.PI * 2, h = Math.sqrt(1 - i * i), m = s * Math.cbrt(Math.random());
141
- f.emit(t.x + Math.cos(p) * h * m, t.y + Math.sin(p) * h * m, t.z + i * m, o * (0.7 + Math.random() * 0.7), d, c * (0.7 + Math.random() * 0.5), a * (0.8 + Math.random() * 0.4), l + Math.random() * 0.08, 0);
141
+ l.emit(t.x + Math.cos(p) * h * m, t.y + Math.sin(p) * h * m, t.z + i * m, o * (0.7 + Math.random() * 0.7), d, f * (0.7 + Math.random() * 0.5), a * (0.8 + Math.random() * 0.4), c + Math.random() * 0.08, 0);
142
142
  }
143
143
  }
144
- function Re(t, e, s, o, d, c, a, l, f, u, i, p = 0) {
144
+ function Ie(t, e, s, o, d, f, a, c, l, u, i, p = 0) {
145
145
  const h = Z(), m = t.x + Math.cos(e + i * Math.PI * 0.5) * s, w = t.y + Math.sin(e + i * Math.PI * 0.5) * s, n = e - i * Math.PI * 0.5;
146
146
  for (let y = 0; y < d; y++) {
147
147
  const v = y / (d - 1), x = n + i * v * o * Math.PI * 2, B = s * (1 - 0.82 * v);
148
- h.emit(m + Math.cos(x) * B, w + Math.sin(x) * B, t.z + p * Math.sqrt(v), c * (1 - 0.35 * v), a, l, f, u + v * 0.35, 0);
148
+ h.emit(m + Math.cos(x) * B, w + Math.sin(x) * B, t.z + p * Math.sqrt(v), f * (1 - 0.35 * v), a, c, l, u + v * 0.35, 0);
149
149
  }
150
150
  }
151
151
  class Yt {
@@ -156,25 +156,25 @@ class Yt {
156
156
  k(this, "C");
157
157
  k(this, "n", 0);
158
158
  k(this, "p", new r.Vector3());
159
- this.max = e, this.seg = s, this.P = new r.BufferAttribute(new Float32Array(e * s * 6), 3).setUsage(r.DynamicDrawUsage), this.C = new r.BufferAttribute(new Float32Array(e * s * 6), 3).setUsage(r.DynamicDrawUsage), this.geo.setAttribute("position", this.P), this.geo.setAttribute("color", this.C), this.geo.boundingSphere = new r.Sphere(new r.Vector3(), 1e5), this.obj = new r.LineSegments(this.geo, ot()), this.obj.frustumCulled = !1;
159
+ this.max = e, this.seg = s, this.P = new r.BufferAttribute(new Float32Array(e * s * 6), 3).setUsage(r.DynamicDrawUsage), this.C = new r.BufferAttribute(new Float32Array(e * s * 6), 3).setUsage(r.DynamicDrawUsage), this.geo.setAttribute("position", this.P), this.geo.setAttribute("color", this.C), this.geo.boundingSphere = new r.Sphere(new r.Vector3(), 1e5), this.obj = new r.LineSegments(this.geo, nt()), this.obj.frustumCulled = !1;
160
160
  }
161
161
  begin() {
162
162
  this.n = 0;
163
163
  }
164
- add(e, s, o, d, c, a, l, f, u, i, p) {
165
- if (this.n >= this.max || l <= a || c < 3e-3 && p < 3e-3) return;
164
+ add(e, s, o, d, f, a, c, l, u, i, p) {
165
+ if (this.n >= this.max || c <= a || f < 3e-3 && p < 3e-3) return;
166
166
  const h = this.seg, m = this.P, w = this.C;
167
167
  for (let n = 0; n < h; n++) {
168
- const y = a + (l - a) * (n + 0.5) / h;
168
+ const y = a + (c - a) * (n + 0.5) / h;
169
169
  let v = 1;
170
- f > 0 && (v = Math.sin((y * f - u) * Math.PI * 2) > -0.1 ? 1 : 0);
170
+ l > 0 && (v = Math.sin((y * l - u) * Math.PI * 2) > -0.1 ? 1 : 0);
171
171
  for (let x = 0; x < 2; x++) {
172
- const B = a + (l - a) * (n + x) / h;
172
+ const B = a + (c - a) * (n + x) / h;
173
173
  Ut(e, s, o, B, this.p);
174
- const A = (this.n * h + n) * 2 + x;
175
- m.setXYZ(A, this.p.x, this.p.y, this.p.z);
176
- let S = c * v;
177
- i >= 0 && (S += p * Math.exp(-(((B - i) / 0.05) ** 2))), w.setXYZ(A, d.r * S, d.g * S, d.b * S);
174
+ const P = (this.n * h + n) * 2 + x;
175
+ m.setXYZ(P, this.p.x, this.p.y, this.p.z);
176
+ let z = f * v;
177
+ i >= 0 && (z += p * Math.exp(-(((B - i) / 0.05) ** 2))), w.setXYZ(P, d.r * z, d.g * z, d.b * z);
178
178
  }
179
179
  }
180
180
  this.n++;
@@ -194,7 +194,7 @@ class fe {
194
194
  reset() {
195
195
  this.started = !1, this.acc = 0;
196
196
  }
197
- step(e, s, o, d, c, a, l, f = 8) {
197
+ step(e, s, o, d, f, a, c, l = 8) {
198
198
  if (!this.started) {
199
199
  this.started = !0, this.x = e.x, this.y = e.y, this.z = e.z;
200
200
  return;
@@ -207,61 +207,65 @@ class fe {
207
207
  this.acc += h;
208
208
  const m = Z();
209
209
  let w = 0;
210
- for (; this.acc >= s && w < f; ) {
210
+ for (; this.acc >= s && w < l; ) {
211
211
  this.acc -= s;
212
212
  const n = h > 1e-6 ? 1 - this.acc / h : 1, y = (Math.random() - 0.5) * s * 0.35;
213
- m.emit(this.x + u * n + y, this.y + i * n - y, this.z + p * n, o * (0.65 + Math.random() * 0.7), d, c * (0.75 + Math.random() * 0.4), a, l, 0), w++;
213
+ m.emit(this.x + u * n + y, this.y + i * n - y, this.z + p * n, o * (0.65 + Math.random() * 0.7), d, f * (0.75 + Math.random() * 0.4), a, c, 0), w++;
214
214
  }
215
215
  this.acc > s && (this.acc = s), this.x = e.x, this.y = e.y, this.z = e.z;
216
216
  }
217
217
  }
218
218
  const Ht = /* @__PURE__ */ new Map();
219
219
  function te(t, e, s, o, d = performance.now()) {
220
- let c = Ht.get(t);
221
- c || Ht.set(t, c = { x: 0, y: 0, z: 0, at: -1e9 }), c.x = e, c.y = s, c.z = o, c.at = d;
220
+ let f = Ht.get(t);
221
+ f || Ht.set(t, f = { x: 0, y: 0, z: 0, at: -1e9 }), f.x = e, f.y = s, f.z = o, f.at = d;
222
222
  }
223
- const uo = (t) => t < 0 ? 0 : t < 50 ? t / 50 : Math.exp(-(t - 50) / 260), xt = /* @__PURE__ */ new Map(), R = { rx: 9, ry: 6, hz: 5 }, $t = /* @__PURE__ */ new Map();
224
- function ho(t, e) {
223
+ const ho = (t) => t < 0 ? 0 : t < 50 ? t / 50 : Math.exp(-(t - 50) / 260), xt = /* @__PURE__ */ new Map(), R = { rx: 9, ry: 6, hz: 5 }, $t = /* @__PURE__ */ new Map();
224
+ function po(t, e) {
225
225
  if (e < 2) return 0;
226
226
  const s = Math.min(2 * (R.hz - 2.6), (e - 1) * 5);
227
227
  return ((t % 2 === 0 ? t / 2 : e - 1 - (t - 1) / 2) / (e - 1) - 0.5) * s;
228
228
  }
229
- function Ie(t) {
230
- var a;
231
- const e = ((a = $t.get(t.run.id)) == null ? void 0 : a.z) ?? 0, s = et(t.id, 77) - 0.5, o = Math.max(t.inst.parent ? 2 : 1.2, R.hz * (t.inst.parent ? 0.34 + 0.05 * Math.min(2, t.depth - 1) : 0.14)), d = e + s * 2 * o * Math.max(0.85, Math.min(1.2, Rt.spread)), c = Math.max(0.5, R.hz - 1.1);
232
- return d < -c ? -c : d > c ? c : d;
229
+ function xe(t) {
230
+ var d;
231
+ const e = ((d = $t.get(t.run.id)) == null ? void 0 : d.z) ?? 0, s = ot(t.id, 77) - 0.5, o = Math.max(1.2, R.hz * 0.14);
232
+ return e + s * 2 * o * Math.max(0.85, Math.min(1.2, Rt.spread));
233
233
  }
234
- const zt = 7, Wt = 8, ue = 5, ft = 6.2, ut = 3.5, he = 0.08, Be = 0.92, Te = 0.52, po = 0.09, mo = 1.15, Et = Wt * ue, at = zt * Et, de = ft / Wt, pe = ut / ue, De = (zt - 1) / 2 * Be + ut / 2 * Math.sin(Te), Mo = Math.hypot(ft / 2 + 0.6, De + 0.4), go = 32, Nt = 3, Ve = new r.BoxGeometry(ft, he, ut), yo = new r.EdgesGeometry(Ve), wo = (() => {
234
+ function Be(t) {
235
+ const e = t.depth > 0 && t.tr ? xe(t.tr) + t.ew : xe(t), s = Math.max(0.5, R.hz - 1.1);
236
+ return e < -s ? -s : e > s ? s : e;
237
+ }
238
+ const zt = 7, Wt = 8, ue = 5, ut = 6.2, ht = 3.5, he = 0.08, Te = 0.92, De = 0.52, mo = 0.09, Mo = 1.15, Et = Wt * ue, at = zt * Et, de = ut / Wt, pe = ht / ue, Ve = (zt - 1) / 2 * Te + ht / 2 * Math.sin(De), go = Math.hypot(ut / 2 + 0.6, Ve + 0.4), yo = 32, Xt = 3, Ge = new r.BoxGeometry(ut, he, ht), wo = new r.EdgesGeometry(Ge), vo = (() => {
235
239
  const t = [], e = he / 2 + 4e-3;
236
240
  for (let s = 1; s < Wt; s++) {
237
- const o = -ft / 2 + s * de;
238
- t.push(o, e, -ut / 2, o, e, ut / 2);
241
+ const o = -ut / 2 + s * de;
242
+ t.push(o, e, -ht / 2, o, e, ht / 2);
239
243
  }
240
244
  for (let s = 1; s < ue; s++) {
241
- const o = -ut / 2 + s * pe;
242
- t.push(-ft / 2, e, o, ft / 2, e, o);
245
+ const o = -ht / 2 + s * pe;
246
+ t.push(-ut / 2, e, o, ut / 2, e, o);
243
247
  }
244
- return t.push(-ft / 2 + 0.15, e, ut / 2 - 0.14, -ft / 2 + 1.4, e, ut / 2 - 0.14), new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
245
- })(), vo = new r.PlaneGeometry(1, 1).rotateX(-Math.PI / 2), bo = (t, e, s) => {
246
- e.set(0, (t - (zt - 1) / 2) * Be, 0), ze.set(Te, (t - (zt - 1) / 2) * po, 0, "YXZ"), s.setFromEuler(ze);
247
- }, xe = (t, e) => {
248
+ return t.push(-ut / 2 + 0.15, e, ht / 2 - 0.14, -ut / 2 + 1.4, e, ht / 2 - 0.14), new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
249
+ })(), bo = new r.PlaneGeometry(1, 1).rotateX(-Math.PI / 2), xo = (t, e, s) => {
250
+ e.set(0, (t - (zt - 1) / 2) * Te, 0), Se.set(De, (t - (zt - 1) / 2) * mo, 0, "YXZ"), s.setFromEuler(Se);
251
+ }, ze = (t, e) => {
248
252
  const s = t % Et;
249
- return e.set(-ft / 2 + (s % Wt + 0.5) * de, he / 2 + 0.01, -ut / 2 + (Math.floor(s / Wt) + 0.5) * pe);
250
- }, ze = new r.Euler();
251
- function xo({ galaxy: t }) {
253
+ return e.set(-ut / 2 + (s % Wt + 0.5) * de, he / 2 + 0.01, -ht / 2 + (Math.floor(s / Wt) + 0.5) * pe);
254
+ }, Se = new r.Euler();
255
+ function zo({ galaxy: t }) {
252
256
  const e = t.nodes.length, s = D(() => {
253
257
  const y = new Int32Array(e), v = new Float32Array(at), x = Array.from({ length: at }, () => new r.Color(0, 0, 0)), B = new r.Color();
254
- t.nodes.forEach((A, S) => {
255
- const z = Math.floor(et(A.id, 9) * at) % at;
256
- y[S] = z, v[z]++, x[z].add(B.set(je[A.kind] ?? "#94a3b8"));
258
+ t.nodes.forEach((P, z) => {
259
+ const C = Math.floor(ot(P.id, 9) * at) % at;
260
+ y[z] = C, v[C]++, x[C].add(B.set(qe[P.kind] ?? "#94a3b8"));
257
261
  });
258
- for (let A = 0; A < at; A++) v[A] && x[A].multiplyScalar(1 / v[A]).lerp(X, 0.35);
262
+ for (let P = 0; P < at; P++) v[P] && x[P].multiplyScalar(1 / v[P]).lerp($, 0.35);
259
263
  return { cellOf: y, occ: v, base: x, dep: new Float32Array(at), white: new Float32Array(at), depC: Array.from({ length: at }, () => new r.Color()) };
260
264
  }, [t, e]), o = D(
261
265
  () => Array.from({ length: zt }, () => ({
262
- fill: so("#000"),
263
- edge: ot("#000"),
264
- grid: ot("#000"),
266
+ fill: ro("#000"),
267
+ edge: nt("#000"),
268
+ grid: nt("#000"),
265
269
  m: new r.Matrix4(),
266
270
  pos: new r.Vector3(),
267
271
  q: new r.Quaternion(),
@@ -272,96 +276,96 @@ function xo({ galaxy: t }) {
272
276
  want: new r.Color()
273
277
  })),
274
278
  []
275
- ), d = I([]), c = D(() => new r.MeshBasicMaterial({ blending: r.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, side: r.DoubleSide }), []), a = D(() => {
276
- const y = new r.InstancedMesh(vo, c, at);
279
+ ), d = I([]), f = D(() => new r.MeshBasicMaterial({ blending: r.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, side: r.DoubleSide }), []), a = D(() => {
280
+ const y = new r.InstancedMesh(bo, f, at);
277
281
  return y.instanceColor = new r.InstancedBufferAttribute(new Float32Array(at * 3), 3), y.frustumCulled = !1, y.renderOrder = 3, y;
278
- }, [c]), l = D(() => new Yt(go, 24), []), f = D(() => /* @__PURE__ */ new Map(), [t]), u = D(() => /* @__PURE__ */ new Set(), []), i = I([]), p = I([]), h = I(Array(Nt).fill("")), m = D(
282
+ }, [f]), c = D(() => new Yt(yo, 24), []), l = D(() => /* @__PURE__ */ new Map(), [t]), u = D(() => /* @__PURE__ */ new Set(), []), i = I([]), p = I([]), h = I(Array(Xt).fill("")), m = D(
279
283
  () => ({ v: new r.Vector3(), w: new r.Vector3(), ctrl: new r.Vector3(), h: new r.Vector3(), c: new r.Color(), cm: new r.Matrix4(), sm: new r.Matrix4(), off: new r.Vector3(), one: new r.Vector3(1, 1, 1) }),
280
284
  []
281
285
  ), w = (y) => {
282
- let v = f.get(y);
283
- return v === void 0 && f.set(y, v = Ke(t, y)), s.cellOf[v] ?? 0;
284
- }, n = (y, v) => xe(y, v).applyMatrix4(o[Math.floor(y / Et)].m);
285
- return ht(({ clock: y }, v) => {
286
+ let v = l.get(y);
287
+ return v === void 0 && l.set(y, v = Ue(t, y)), s.cellOf[v] ?? 0;
288
+ }, n = (y, v) => ze(y, v).applyMatrix4(o[Math.floor(y / Et)].m);
289
+ return dt(({ clock: y }, v) => {
286
290
  var H;
287
- const x = performance.now(), B = pt(), A = Math.min(0.05, v), S = nt ? 0 : y.elapsedTime, { occ: z, base: C, dep: F, white: E, depC: T } = s, { v: V, w: G, ctrl: W, h: Y, c: $, cm: mt, sm: Mt, off: gt, one: Ct } = m;
288
- F.fill(0), E.fill(0);
291
+ const x = performance.now(), B = mt(), P = Math.min(0.05, v), z = st ? 0 : y.elapsedTime, { occ: C, base: S, dep: E, white: W, depC: T } = s, { v: V, w: G, ctrl: K, h: Y, c: F, cm: ft, sm: Mt, off: gt, one: Ct } = m;
292
+ E.fill(0), W.fill(0);
289
293
  for (const g of o)
290
294
  g.act = 0, g.read = 0, g.want.setRGB(0, 0, 0);
291
295
  for (const g of L.flares) {
292
- const M = w(g.node), P = (x - g.start) / 1e3, K = L.instances.get(g.instance), O = K ? It[K.type] : X, j = g.op === "write", U = P < 0.25 ? P / 0.25 : Math.exp(-(P - 0.25) * 1.1);
293
- U > F[M] && (F[M] = U, T[M].copy(j ? N : O), E[M] = j ? 1 : 0);
294
- const J = o[Math.floor(M / Et)];
295
- U > J.act && (J.act = U, J.want.copy(j ? N : O)), !j && P < 2.2 && (J.read = Math.max(J.read, P < 0.2 ? P / 0.2 : rt((2.2 - P) / 0.8)));
296
+ const M = w(g.node), A = (x - g.start) / 1e3, U = L.instances.get(g.instance), O = U ? It[U.type] : $, j = g.op === "write", X = A < 0.25 ? A / 0.25 : Math.exp(-(A - 0.25) * 1.1);
297
+ X > E[M] && (E[M] = X, T[M].copy(j ? N : O), W[M] = j ? 1 : 0);
298
+ const tt = o[Math.floor(M / Et)];
299
+ X > tt.act && (tt.act = X, tt.want.copy(j ? N : O)), !j && A < 2.2 && (tt.read = Math.max(tt.read, A < 0.2 ? A / 0.2 : rt((2.2 - A) / 0.8)));
296
300
  }
297
301
  for (let g = 0; g < zt; g++) {
298
302
  const M = o[g];
299
- M.slide += (M.read - M.slide) * Math.min(1, A * (M.read > M.slide ? 7 : 2.5)), bo(g, M.pos, M.q), gt.set(0, 0.06, mo).applyQuaternion(M.q).multiplyScalar(zo(M.slide)), M.pos.add(gt), M.m.compose(M.pos, M.q, Ct);
300
- const P = d.current[g];
301
- P && (P.position.copy(M.pos), P.quaternion.copy(M.q)), M.tint.lerp(M.act > 0.02 ? M.want : X, Math.min(1, A * 6));
302
- const K = nt ? 1 : 0.9 + 0.1 * Math.sin(S * 0.7 + g * 1.3), O = M.act;
303
- M.edge.color.copy(X).lerp(M.tint, O).multiplyScalar((0.2 + 0.06 * g / zt) * K + O * 0.75 + M.slide * 0.2), M.grid.color.copy(X).lerp(M.tint, O).multiplyScalar(0.06 + O * 0.18), M.fill.color.copy($.set("#4fd1c5")).lerp(M.tint, O * 0.8).multiplyScalar(0.03 + O * 0.06 + M.slide * 0.03);
303
+ M.slide += (M.read - M.slide) * Math.min(1, P * (M.read > M.slide ? 7 : 2.5)), xo(g, M.pos, M.q), gt.set(0, 0.06, Mo).applyQuaternion(M.q).multiplyScalar(So(M.slide)), M.pos.add(gt), M.m.compose(M.pos, M.q, Ct);
304
+ const A = d.current[g];
305
+ A && (A.position.copy(M.pos), A.quaternion.copy(M.q)), M.tint.lerp(M.act > 0.02 ? M.want : $, Math.min(1, P * 6));
306
+ const U = st ? 1 : 0.9 + 0.1 * Math.sin(z * 0.7 + g * 1.3), O = M.act;
307
+ M.edge.color.copy($).lerp(M.tint, O).multiplyScalar((0.2 + 0.06 * g / zt) * U + O * 0.75 + M.slide * 0.2), M.grid.color.copy($).lerp(M.tint, O).multiplyScalar(0.06 + O * 0.18), M.fill.color.copy(F.set("#4fd1c5")).lerp(M.tint, O * 0.8).multiplyScalar(0.03 + O * 0.06 + M.slide * 0.03);
304
308
  }
305
- l.begin();
309
+ c.begin();
306
310
  for (const g of u) {
307
311
  let M = !1;
308
- for (const P of L.flares) P.id === g && (M = !0);
312
+ for (const A of L.flares) A.id === g && (M = !0);
309
313
  M || u.delete(g);
310
314
  }
311
315
  for (const g of L.flares) {
312
- const M = w(g.node), P = (x - g.start) / 1e3, K = L.instances.get(g.instance), O = K ? It[K.type] : X, j = g.op === "write";
313
- n(M, V), qe(V, G), j && !u.has(g.id) && P > 0.55 && (u.add(g.id), re(G, 12, 0.45, 0.1, N, 1, 2.2, B), Z().emit(G.x, G.y, G.z, 1.2, N, 0.9, 0.5, B, 2));
314
- const U = St(g.instance);
315
- if (U && P < 1.9) {
316
- qt(U, G, 0.1, W);
317
- const J = Math.min(1, P / 0.2) * Math.pow(1 - P / 1.9, 1.5), dt = j ? Math.min(1, P * 1.6) : 1 - Math.min(1, P * 1.6);
318
- $.copy(j ? N : O).lerp(N, 0.2), l.add(U, W, G, $, (j ? 0.32 : 0.24) * J, 0.03, 0.99, 0, 0, dt, 1.5 * J), dt > 0.02 && dt < 0.98 && (Ut(U, W, G, dt, Y), Z().emit(Y.x, Y.y, Y.z, 0.45, $, 1.3 * J, 0.12, B, 1));
316
+ const M = w(g.node), A = (x - g.start) / 1e3, U = L.instances.get(g.instance), O = U ? It[U.type] : $, j = g.op === "write";
317
+ n(M, V), We(V, G), j && !u.has(g.id) && A > 0.55 && (u.add(g.id), re(G, 12, 0.45, 0.1, N, 1, 2.2, B), Z().emit(G.x, G.y, G.z, 1.2, N, 0.9, 0.5, B, 2));
318
+ const X = St(g.instance);
319
+ if (X && A < 1.9) {
320
+ qt(X, G, 0.1, K);
321
+ const tt = Math.min(1, A / 0.2) * Math.pow(1 - A / 1.9, 1.5), pt = j ? Math.min(1, A * 1.6) : 1 - Math.min(1, A * 1.6);
322
+ F.copy(j ? N : O).lerp(N, 0.2), c.add(X, K, G, F, (j ? 0.32 : 0.24) * tt, 0.03, 0.99, 0, 0, pt, 1.5 * tt), pt > 0.02 && pt < 0.98 && (Ut(X, K, G, pt, Y), Z().emit(Y.x, Y.y, Y.z, 0.45, F, 1.3 * tt, 0.12, B, 1));
319
323
  }
320
324
  }
321
- l.end();
325
+ c.end();
322
326
  const yt = a.instanceColor;
323
327
  for (let g = 0; g < at; g++) {
324
- const M = F[g], P = z[g] > 0, K = nt ? 1 : 0.85 + 0.15 * Math.sin(S * 0.8 + g * 1.7), O = P || M > 0.01 ? 0.36 + 0.12 * Math.min(1, z[g] / 3) + 0.4 * M : 1e-4;
325
- xe(g, V), Mt.makeScale(O * de, 1, O * pe).setPosition(V), mt.multiplyMatrices(o[Math.floor(g / Et)].m, Mt), a.setMatrixAt(g, mt), $.copy(C[g]).multiplyScalar(P ? (0.3 + 0.15 * Math.min(1, z[g] / 3)) * K : 0), M > 0.01 && ($.r += T[g].r * M * 1.5 + M * 0.25 * (1 + E[g]), $.g += T[g].g * M * 1.5 + M * 0.25 * (1 + E[g]), $.b += T[g].b * M * 1.5 + M * 0.25 * (1 + E[g])), yt.setXYZ(g, $.r, $.g, $.b);
328
+ const M = E[g], A = C[g] > 0, U = st ? 1 : 0.85 + 0.15 * Math.sin(z * 0.8 + g * 1.7), O = A || M > 0.01 ? 0.36 + 0.12 * Math.min(1, C[g] / 3) + 0.4 * M : 1e-4;
329
+ ze(g, V), Mt.makeScale(O * de, 1, O * pe).setPosition(V), ft.multiplyMatrices(o[Math.floor(g / Et)].m, Mt), a.setMatrixAt(g, ft), F.copy(S[g]).multiplyScalar(A ? (0.3 + 0.15 * Math.min(1, C[g] / 3)) * U : 0), M > 0.01 && (F.r += T[g].r * M * 1.5 + M * 0.25 * (1 + W[g]), F.g += T[g].g * M * 1.5 + M * 0.25 * (1 + W[g]), F.b += T[g].b * M * 1.5 + M * 0.25 * (1 + W[g])), yt.setXYZ(g, F.r, F.g, F.b);
326
330
  }
327
331
  a.instanceMatrix.needsUpdate = !0, yt.needsUpdate = !0;
328
- let Q = 0;
329
- for (let g = L.flares.length - 1; g >= 0 && Q < Nt; g--) {
332
+ let J = 0;
333
+ for (let g = L.flares.length - 1; g >= 0 && J < Xt; g--) {
330
334
  const M = L.flares[g];
331
335
  if (x - M.start > 2200) break;
332
336
  if (M.area) continue;
333
- let P = !1;
337
+ let A = !1;
334
338
  n(w(M.node), V);
335
- for (let j = 0; j < Q; j++) {
336
- const U = p.current[j];
337
- (h.current[j] === M.node || U && Math.abs(U.position.y - V.y) < 0.55 && Math.abs(U.position.x - V.x) < 3.2) && (P = !0);
339
+ for (let j = 0; j < J; j++) {
340
+ const X = p.current[j];
341
+ (h.current[j] === M.node || X && Math.abs(X.position.y - V.y) < 0.55 && Math.abs(X.position.x - V.x) < 3.2) && (A = !0);
338
342
  }
339
- if (P) continue;
340
- const K = i.current[Q], O = p.current[Q];
341
- K && O && (O.position.copy(V), h.current[Q] !== M.node && (K.setText(`${M.op === "write" ? "wrote" : "read"} · ${M.node}`), K.setColor(M.op === "write" ? "#ffffff" : "#8fe9f5")), K.setOpacity(rt(1.4 - (x - M.start) / 1600))), h.current[Q] = M.node, Q++;
343
+ if (A) continue;
344
+ const U = i.current[J], O = p.current[J];
345
+ U && O && (O.position.copy(V), h.current[J] !== M.node && (U.setText(`${M.op === "write" ? "wrote" : "read"} · ${M.node}`), U.setColor(M.op === "write" ? "#ffffff" : "#8fe9f5")), U.setOpacity(rt(1.4 - (x - M.start) / 1600))), h.current[J] = M.node, J++;
342
346
  }
343
- for (let g = Q; g < Nt; g++)
347
+ for (let g = J; g < Xt; g++)
344
348
  (H = i.current[g]) == null || H.setOpacity(0), h.current[g] = "";
345
349
  }), /* @__PURE__ */ lt(Kt, { children: [
346
350
  o.map((y, v) => /* @__PURE__ */ lt("group", { ref: (x) => void (d.current[v] = x), children: [
347
- /* @__PURE__ */ b("mesh", { geometry: Ve, material: y.fill }),
348
- /* @__PURE__ */ b("lineSegments", { geometry: yo, material: y.edge }),
349
- /* @__PURE__ */ b("lineSegments", { geometry: wo, material: y.grid })
351
+ /* @__PURE__ */ b("mesh", { geometry: Ge, material: y.fill }),
352
+ /* @__PURE__ */ b("lineSegments", { geometry: wo, material: y.edge }),
353
+ /* @__PURE__ */ b("lineSegments", { geometry: vo, material: y.grid })
350
354
  ] }, v)),
351
355
  /* @__PURE__ */ b("primitive", { object: a }),
352
- /* @__PURE__ */ b(We, { children: /* @__PURE__ */ b("primitive", { object: l.obj }) }),
353
- Array.from({ length: Nt }, (y, v) => /* @__PURE__ */ b("group", { ref: (x) => void (p.current[v] = x), children: /* @__PURE__ */ b(Bt, { ref: (x) => void (i.current[v] = x), text: "", offset: [0, 0.45], size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 12] }) }, v)),
354
- /* @__PURE__ */ b(So, {})
356
+ /* @__PURE__ */ b(Ke, { children: /* @__PURE__ */ b("primitive", { object: c.obj }) }),
357
+ Array.from({ length: Xt }, (y, v) => /* @__PURE__ */ b("group", { ref: (x) => void (p.current[v] = x), children: /* @__PURE__ */ b(Bt, { ref: (x) => void (i.current[v] = x), text: "", offset: [0, 0.45], size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 12] }) }, v)),
358
+ /* @__PURE__ */ b(Co, {})
355
359
  ] });
356
360
  }
357
- const zo = (t) => 1 - Math.pow(1 - rt(t), 2);
358
- function So() {
359
- const t = _e(), e = t.graphLabel === "knowledge graph" ? "FalkorDB" : t.graphLabel;
361
+ const So = (t) => 1 - Math.pow(1 - rt(t), 2);
362
+ function Co() {
363
+ const t = Re(), e = t.graphLabel === "knowledge graph" ? "FalkorDB" : t.graphLabel;
360
364
  return /* @__PURE__ */ b(
361
365
  Bt,
362
366
  {
363
367
  declutter: "resource",
364
- position: [0, De + 0.75, 0],
368
+ position: [0, Ve + 0.75, 0],
365
369
  text: `${e} · event archive`,
366
370
  color: "#5eead4",
367
371
  letterSpacing: 0.04,
@@ -371,10 +375,10 @@ function So() {
371
375
  }
372
376
  );
373
377
  }
374
- const Co = (
378
+ const Ao = (
375
379
  /* glsl */
376
380
  "varying vec2 vW; void main(){ vW = position.xy; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }"
377
- ), Ao = (
381
+ ), Po = (
378
382
  /* glsl */
379
383
  `
380
384
  uniform float uTime; varying vec2 vW;
@@ -393,7 +397,7 @@ void main(){
393
397
  col += vec3(0.006, 0.011, 0.013) * g * 2.0;
394
398
  gl_FragColor = vec4(col, 1.0);
395
399
  }`
396
- ), Po = (
400
+ ), _o = (
397
401
  /* glsl */
398
402
  `
399
403
  varying vec3 vN; varying vec3 vV; varying float vZ;
@@ -402,7 +406,7 @@ void main(){
402
406
  vN = normalize(normalMatrix * normal); vV = normalize(-mv.xyz); vZ = position.y;
403
407
  gl_Position = projectionMatrix * mv;
404
408
  }`
405
- ), _o = (
409
+ ), Ro = (
406
410
  /* glsl */
407
411
  `
408
412
  uniform vec3 uC; varying vec3 vN; varying vec3 vV; varying float vZ;
@@ -414,7 +418,7 @@ void main(){
414
418
  gl_FragColor = vec4(uC * k, 1.0);
415
419
  }`
416
420
  ), Ft = Math.PI * 2;
417
- function Ro() {
421
+ function Io() {
418
422
  const t = (u, i, p, h = 128) => {
419
423
  for (let m = 0; m < h; m++) {
420
424
  const w = m / h * Ft, n = (m + 1) / h * Ft;
@@ -435,47 +439,47 @@ function Ro() {
435
439
  for (const u of [-0.34, 0.34]) t(s, 1.045, u, 96);
436
440
  const d = [];
437
441
  for (const u of [-0.72, 0.72]) for (let i = 0; i < 4; i++) t(d, 1.1 + i % 2 * 0.025, u + (i - 1.5) * 0.035, 128);
438
- const c = [];
442
+ const f = [];
439
443
  let a = 9001;
440
- const l = () => (a = a * 16807 % 2147483647) / 2147483647;
444
+ const c = () => (a = a * 16807 % 2147483647) / 2147483647;
441
445
  for (let u = 0; u < 14; u++) {
442
- const i = -0.85 + l() * 1.7, p = -0.92 + l() * 1.84, h = (6 + l() * 14) * (l() < 0.5 ? 1 : -1), m = 0.012;
446
+ const i = -0.85 + c() * 1.7, p = -0.92 + c() * 1.84, h = (6 + c() * 14) * (c() < 0.5 ? 1 : -1), m = 0.012;
443
447
  for (let w = -1.1; w < 1.1; w += m) {
444
- if (l() < 0.42) continue;
448
+ if (c() < 0.42) continue;
445
449
  const n = w + m * 0.45, y = i + w * w / (2 * h), v = i + n * n / (2 * h);
446
- w * w + y * y > 0.97 || n * n + v * v > 0.97 || c.push(w, y, p, n, v, p);
450
+ w * w + y * y > 0.97 || n * n + v * v > 0.97 || f.push(w, y, p, n, v, p);
447
451
  }
448
452
  }
449
- const f = (u) => new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(u, 3));
450
- return { steel: f(e), staves: f(s), coils: f(d), beams: f(c) };
453
+ const l = (u) => new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(u, 3));
454
+ return { steel: l(e), staves: l(s), coils: l(d), beams: l(f) };
451
455
  }
452
- function Io(t, e) {
456
+ function Bo(t, e) {
453
457
  const s = [];
454
- for (let c = -Math.floor(t / 3) * 3; c <= t; c += 3)
458
+ for (let f = -Math.floor(t / 3) * 3; f <= t; f += 3)
455
459
  for (let a = -Math.floor(e / 3) * 3; a <= e; a += 3)
456
- if (!((c / t) ** 2 + (a / e) ** 2 > 0.86))
457
- for (const l of [-1, 1]) s.push(c - 0.26, a, l, c + 0.26, a, l, c, a - 0.26, l, c, a + 0.26, l);
460
+ if (!((f / t) ** 2 + (a / e) ** 2 > 0.86))
461
+ for (const c of [-1, 1]) s.push(f - 0.26, a, c, f + 0.26, a, c, f, a - 0.26, c, f, a + 0.26, c);
458
462
  return new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(s, 3));
459
463
  }
460
- const Bo = (() => {
464
+ const To = (() => {
461
465
  const t = [];
462
466
  for (let e = 0; e < 24; e++) e % 2 === 0 && t.push(0, 0, -1 + e / 24 * 2, 0, 0, -1 + (e + 1) / 24 * 2);
463
467
  return t.push(0, 0, 1, 0.09, 0, 0.84, 0, 0, 1, -0.09, 0, 0.84, 0, 0, 1, 0, 0.09, 0.84, 0, 0, 1, 0, -0.09, 0.84), new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
464
468
  })();
465
- function To() {
466
- const t = D(Ro, []), e = D(
469
+ function Do() {
470
+ const t = D(Io, []), e = D(
467
471
  () => ({
468
- back: new r.ShaderMaterial({ uniforms: { uTime: { value: 0 } }, vertexShader: Co, fragmentShader: Ao, depthWrite: !1 }),
469
- steel: ot(new r.Color("#9fd8e0").multiplyScalar(0.15)),
470
- staves: ot(new r.Color("#7cc6d0").multiplyScalar(0.07)),
471
- coils: ot(new r.Color("#d79a52").multiplyScalar(0.12)),
472
- beams: ot(new r.Color("#8fdcea").multiplyScalar(0.07)),
473
- fid: ot(new r.Color("#4fd1c5").multiplyScalar(0.22)),
474
- arrow: ot(new r.Color("#d79a52").multiplyScalar(0.45)),
472
+ back: new r.ShaderMaterial({ uniforms: { uTime: { value: 0 } }, vertexShader: Ao, fragmentShader: Po, depthWrite: !1 }),
473
+ steel: nt(new r.Color("#9fd8e0").multiplyScalar(0.15)),
474
+ staves: nt(new r.Color("#7cc6d0").multiplyScalar(0.07)),
475
+ coils: nt(new r.Color("#d79a52").multiplyScalar(0.12)),
476
+ beams: nt(new r.Color("#8fdcea").multiplyScalar(0.07)),
477
+ fid: nt(new r.Color("#4fd1c5").multiplyScalar(0.22)),
478
+ arrow: nt(new r.Color("#d79a52").multiplyScalar(0.45)),
475
479
  glass: new r.ShaderMaterial({
476
480
  uniforms: { uC: { value: new r.Color("#6fd3e0").multiplyScalar(0.075) } },
477
- vertexShader: Po,
478
- fragmentShader: _o,
481
+ vertexShader: _o,
482
+ fragmentShader: Ro,
479
483
  transparent: !0,
480
484
  depthWrite: !1,
481
485
  blending: r.AdditiveBlending,
@@ -483,29 +487,32 @@ function To() {
483
487
  })
484
488
  }),
485
489
  []
486
- ), s = D(() => new r.CylinderGeometry(1.045, 1.045, 2, 96, 1, !0).rotateX(Math.PI / 2), []), o = I(null), d = I(null), c = I("");
490
+ ), s = D(() => new r.CylinderGeometry(1.045, 1.045, 2, 96, 1, !0).rotateX(Math.PI / 2), []), o = I(null), d = I(null), f = I("");
487
491
  ce(() => () => {
488
492
  var m;
489
493
  return (m = o.current) == null ? void 0 : m.dispose();
490
494
  }, []);
491
- const a = I(0), l = I(null), f = I(null), u = I(null), i = I(null), p = I(null), h = I(!1);
492
- return ht(({ clock: m, camera: w }, n) => {
493
- var V, G, W, Y;
494
- e.back.uniforms.uTime.value = nt ? 0 : m.elapsedTime, l.current && (w.getWorldDirection(Ce), l.current.position.copy(Ce).multiplyScalar(14), l.current.quaternion.copy(w.quaternion));
495
- const y = st.core, v = y.hw + 0.9, x = y.hh + 0.9, B = r.MathUtils.clamp(0.72 * Math.min(v, x), 5, 13), A = h.current ? Math.min(1, n * 2.5) : 1;
496
- h.current = !0, R.rx += (v - R.rx) * A, R.ry += (x - R.ry) * A, R.hz += (B - R.hz) * A, (V = f.current) == null || V.scale.set(R.rx, R.ry, R.hz), (G = u.current) == null || G.scale.set(1, 1, R.hz);
497
- const S = `${Math.round(R.rx * 2)}:${Math.round(R.ry * 2)}`;
498
- S !== c.current && d.current && (c.current = S, (W = o.current) == null || W.dispose(), o.current = Io(R.rx, R.ry), d.current.geometry = o.current), i.current && (i.current.position.set(0, R.ry * 1.13 + 0.25, 0), i.current.scale.set(1, 1, R.hz * 0.55)), (Y = p.current) == null || Y.position.set(0, R.ry * 1.13 + 0.62, R.hz * 0.55);
499
- const z = pt();
500
- if (nt || z < a.current) return;
501
- a.current = z + 1.4 + Math.random() * 2.2;
502
- const C = Math.random() * Ft, F = Math.sqrt(Math.random()) * 0.85;
503
- Se.set(Math.cos(C) * F * R.rx, Math.sin(C) * F * R.ry, (Math.random() - 0.5) * 1.7 * R.hz);
504
- const E = Math.random() < 0.3, T = Math.random() < 0.5 ? 1 : -1;
505
- Re(Se, Math.random() * Ft, E ? 0.9 + Math.random() * 0.8 : 0.3 + Math.random() * 0.4, E ? 2.4 : 1.6, E ? 70 : 30, 0.075, X, 0.3, 6, z, T, T * (E ? 1.4 : 0.6));
495
+ const a = I(0), c = I(null), l = I(null), u = I(null), i = I(null), p = I(null), h = I(!1);
496
+ return dt(({ clock: m, camera: w }, n) => {
497
+ var G, K, Y, F;
498
+ e.back.uniforms.uTime.value = st ? 0 : m.elapsedTime, c.current && (w.getWorldDirection(Ae), c.current.position.copy(Ae).multiplyScalar(14), c.current.quaternion.copy(w.quaternion));
499
+ const y = Q.core, v = y.hw + 0.9, x = y.hh + 0.9;
500
+ let B = 0;
501
+ for (const ft of Q.agents.values()) B = Math.max(B, Math.abs(ft.w));
502
+ const P = Math.max(r.MathUtils.clamp(0.72 * Math.min(v, x), 5, 13), B + 2), z = h.current ? Math.min(1, n * 2.5) : 1;
503
+ h.current = !0, R.rx += (v - R.rx) * z, R.ry += (x - R.ry) * z, R.hz += (P - R.hz) * z, (G = l.current) == null || G.scale.set(R.rx, R.ry, R.hz), (K = u.current) == null || K.scale.set(1, 1, R.hz);
504
+ const C = `${Math.round(R.rx * 2)}:${Math.round(R.ry * 2)}`;
505
+ C !== f.current && d.current && (f.current = C, (Y = o.current) == null || Y.dispose(), o.current = Bo(R.rx, R.ry), d.current.geometry = o.current), i.current && (i.current.position.set(0, R.ry * 1.13 + 0.25, 0), i.current.scale.set(1, 1, R.hz * 0.55)), (F = p.current) == null || F.position.set(0, R.ry * 1.13 + 0.62, R.hz * 0.55);
506
+ const S = mt();
507
+ if (st || S < a.current) return;
508
+ a.current = S + 1.4 + Math.random() * 2.2;
509
+ const E = Math.random() * Ft, W = Math.sqrt(Math.random()) * 0.85;
510
+ Ce.set(Math.cos(E) * W * R.rx, Math.sin(E) * W * R.ry, (Math.random() - 0.5) * 1.7 * R.hz);
511
+ const T = Math.random() < 0.3, V = Math.random() < 0.5 ? 1 : -1;
512
+ Ie(Ce, Math.random() * Ft, T ? 0.9 + Math.random() * 0.8 : 0.3 + Math.random() * 0.4, T ? 2.4 : 1.6, T ? 70 : 30, 0.075, $, 0.3, 6, S, V, V * (T ? 1.4 : 0.6));
506
513
  }), /* @__PURE__ */ lt(Kt, { children: [
507
- /* @__PURE__ */ b("mesh", { ref: l, material: e.back, position: [0, 0, -14], renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ b("planeGeometry", { args: [700, 500] }) }),
508
- /* @__PURE__ */ lt("group", { ref: f, children: [
514
+ /* @__PURE__ */ b("mesh", { ref: c, material: e.back, position: [0, 0, -14], renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ b("planeGeometry", { args: [700, 500] }) }),
515
+ /* @__PURE__ */ lt("group", { ref: l, children: [
509
516
  /* @__PURE__ */ b("mesh", { geometry: s, material: e.glass, renderOrder: -5, frustumCulled: !1 }),
510
517
  /* @__PURE__ */ b("lineSegments", { geometry: t.steel, material: e.steel, frustumCulled: !1 }),
511
518
  /* @__PURE__ */ b("lineSegments", { geometry: t.staves, material: e.staves, frustumCulled: !1 }),
@@ -513,32 +520,32 @@ function To() {
513
520
  /* @__PURE__ */ b("lineSegments", { geometry: t.beams, material: e.beams, frustumCulled: !1 })
514
521
  ] }),
515
522
  /* @__PURE__ */ b("group", { ref: u, children: /* @__PURE__ */ b("lineSegments", { ref: d, material: e.fid, frustumCulled: !1 }) }),
516
- /* @__PURE__ */ b("group", { ref: i, children: /* @__PURE__ */ b("lineSegments", { geometry: Bo, material: e.arrow, frustumCulled: !1 }) }),
523
+ /* @__PURE__ */ b("group", { ref: i, children: /* @__PURE__ */ b("lineSegments", { geometry: To, material: e.arrow, frustumCulled: !1 }) }),
517
524
  /* @__PURE__ */ b("group", { ref: p, children: /* @__PURE__ */ b(Bt, { text: "B field", color: "#e0a868", size: 0.26, plate: "none", opacity: 0.75, pxRange: [9, 12] }) })
518
525
  ] });
519
526
  }
520
- const Se = new r.Vector3(), Ce = new r.Vector3();
521
- function Do() {
522
- const { size: t, gl: e, camera: s } = Fe(), o = D(() => Z(), []);
523
- return ht(() => {
524
- o.flush(), o.mat.uniforms.uTime.value = pt(), o.setScale(t.height, e.getPixelRatio(), s.fov);
527
+ const Ce = new r.Vector3(), Ae = new r.Vector3();
528
+ function Vo() {
529
+ const { size: t, gl: e, camera: s } = je(), o = D(() => Z(), []);
530
+ return dt(() => {
531
+ o.flush(), o.mat.uniforms.uTime.value = mt(), o.setScale(t.height, e.getPixelRatio(), s.fov);
525
532
  }, -1), /* @__PURE__ */ b("primitive", { object: o.obj });
526
533
  }
527
- const Zt = 0.34, tt = 2.1, ae = 12;
534
+ const Zt = 0.34, et = 2.1, ae = 12;
528
535
  (() => {
529
- const t = [], e = (s, o, d, c) => t.push(s, o, 0, d, c, 0);
536
+ const t = [], e = (s, o, d, f) => t.push(s, o, 0, d, f, 0);
530
537
  for (const s of [-0.28, 0.28]) {
531
538
  const o = s - Zt / 2, d = s + Zt / 2;
532
- e(o, -tt / 2, d, -tt / 2), e(d, -tt / 2, d, tt / 2), e(d, tt / 2, o, tt / 2), e(o, tt / 2, o, -tt / 2);
533
- for (let c = 1; c < ae; c++) {
534
- const a = -tt / 2 + c / ae * tt;
539
+ e(o, -et / 2, d, -et / 2), e(d, -et / 2, d, et / 2), e(d, et / 2, o, et / 2), e(o, et / 2, o, -et / 2);
540
+ for (let f = 1; f < ae; f++) {
541
+ const a = -et / 2 + f / ae * et;
535
542
  e(o, a, d, a);
536
543
  }
537
544
  }
538
545
  return new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
539
546
  })();
540
- new r.PlaneGeometry(Zt, tt);
541
- new r.PlaneGeometry(Zt * 0.92, tt / ae * 0.8);
547
+ new r.PlaneGeometry(Zt, et);
548
+ new r.PlaneGeometry(Zt * 0.92, et / ae * 0.8);
542
549
  (() => {
543
550
  const t = [];
544
551
  for (let e = 0; e < 6; e++) {
@@ -548,99 +555,99 @@ new r.PlaneGeometry(Zt * 0.92, tt / ae * 0.8);
548
555
  return new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
549
556
  })();
550
557
  new r.CircleGeometry(1, 6, Math.PI / 6);
551
- const Vo = 48, Vt = new r.Vector3(), Gt = new r.Vector3(), wt = new r.Color();
552
- function Go() {
553
- const t = D(() => new Yt(Vo, 36), []), e = D(() => /* @__PURE__ */ new Map(), []);
554
- return ht(({ clock: s }) => {
555
- const o = performance.now(), d = pt(), c = nt ? 0 : s.elapsedTime;
558
+ const Go = 48, Vt = new r.Vector3(), Gt = new r.Vector3(), wt = new r.Color();
559
+ function ko() {
560
+ const t = D(() => new Yt(Go, 36), []), e = D(() => /* @__PURE__ */ new Map(), []);
561
+ return dt(({ clock: s }) => {
562
+ const o = performance.now(), d = mt(), f = st ? 0 : s.elapsedTime;
556
563
  t.begin();
557
564
  for (const a of L.mcpPending.values()) {
558
- const l = St(a.instance), f = ve(a.server), u = L.mcpServers.get(a.server);
559
- if (!l || !f || !u) continue;
560
- qt(l, f, 0.12, Vt);
561
- const i = Ue(a, o);
562
- wt.set(u.color).lerp(Xt, rt(i / 1.2)), i > 1.2 && wt.lerp(_t, rt((i - 1.2) / 1));
563
- const p = l.distanceTo(f), h = 0.04 + 0.92 * jt(i / 0.45);
564
- t.add(l, Vt, f, wt, (0.3 + Math.min(0.3, i * 0.12)) * jt(i / 0.3), 0.04, h, Math.max(4, Math.round(p / 0.5)), c * 1.4, i < 0.45 ? h : -1, 1);
565
+ const c = St(a.instance), l = ve(a.server), u = L.mcpServers.get(a.server);
566
+ if (!c || !l || !u) continue;
567
+ qt(c, l, 0.12, Vt);
568
+ const i = Xe(a, o);
569
+ wt.set(u.color).lerp(Nt, rt(i / 1.2)), i > 1.2 && wt.lerp(_t, rt((i - 1.2) / 1));
570
+ const p = c.distanceTo(l), h = 0.04 + 0.92 * jt(i / 0.45);
571
+ t.add(c, Vt, l, wt, (0.3 + Math.min(0.3, i * 0.12)) * jt(i / 0.3), 0.04, h, Math.max(4, Math.round(p / 0.5)), f * 1.4, i < 0.45 ? h : -1, 1);
565
572
  }
566
573
  for (const a of e.keys()) {
567
- let l = !1;
568
- for (const f of L.mcpCalls) f.id === a && (l = !0);
569
- l || e.delete(a);
574
+ let c = !1;
575
+ for (const l of L.mcpCalls) l.id === a && (c = !0);
576
+ c || e.delete(a);
570
577
  }
571
578
  for (const a of L.mcpCalls) {
572
579
  if (a.phase !== "result") continue;
573
- const l = rt((o - a.start) / a.dur);
574
- if (l >= 1) continue;
575
- const f = St(a.instance), u = ve(a.server), i = L.mcpServers.get(a.server);
576
- if (!f || !u || !i) continue;
580
+ const c = rt((o - a.start) / a.dur);
581
+ if (c >= 1) continue;
582
+ const l = St(a.instance), u = ve(a.server), i = L.mcpServers.get(a.server);
583
+ if (!l || !u || !i) continue;
577
584
  let p = e.get(a.id);
578
- p || e.set(a.id, p = new fe()), qt(f, u, 0.12, Vt);
579
- const h = ne(l);
580
- Ut(f, Vt, u, 1 - h, Gt), wt.set(i.color).lerp(N, 0.45);
585
+ p || e.set(a.id, p = new fe()), qt(l, u, 0.12, Vt);
586
+ const h = ne(c);
587
+ Ut(l, Vt, u, 1 - h, Gt), wt.set(i.color).lerp(N, 0.45);
581
588
  const m = 1 - Math.max(0, (h - 0.85) / 0.15);
582
- t.add(f, Vt, u, wt, 0.1 * m, 0.04, 0.96, 0, 0, 1 - h, 1.3 * m), p.step(Gt, 0.065, 0.08, wt, 0.95 * m, 2.6, d, 6), Z().emit(Gt.x, Gt.y, Gt.z, 0.5, wt, 1.3 * m, 0.12, d, 1);
589
+ t.add(l, Vt, u, wt, 0.1 * m, 0.04, 0.96, 0, 0, 1 - h, 1.3 * m), p.step(Gt, 0.065, 0.08, wt, 0.95 * m, 2.6, d, 6), Z().emit(Gt.x, Gt.y, Gt.z, 0.5, wt, 1.3 * m, 0.12, d, 1);
583
590
  }
584
591
  t.end();
585
592
  }), /* @__PURE__ */ b("primitive", { object: t.obj });
586
593
  }
587
- const ko = (() => {
594
+ const Lo = (() => {
588
595
  const t = [];
589
596
  for (let e = 0; e < 4; e++) {
590
597
  const s = Math.PI / 4 + e * Math.PI / 2;
591
598
  t.push(Math.cos(s) * 0.22, Math.sin(s) * 0.22, 0, Math.cos(s) * 0.55, Math.sin(s) * 0.55, 0);
592
599
  }
593
600
  return new r.BufferGeometry().setAttribute("position", new r.Float32BufferAttribute(t, 3));
594
- })(), Lo = new r.Vector3(1, 0.07, 0).normalize(), ee = new r.Vector3(), Oo = new r.Vector3();
595
- function Eo(t, e, s, o) {
596
- const d = Z(), c = pt();
597
- d.emit(t.x, t.y, t.z, 1.6 * o, N, 1.4, 0.6, c, 1), d.emit(t.x, t.y, t.z, 3.2 * o, s, 1, 0.9, c, 2);
598
- const a = 5 + Math.floor(et(e, 41) * 3);
599
- for (let l = 0; l < a; l++) {
600
- const f = l / a * Math.PI * 2 + et(e, 50 + l) * 0.9, u = (1.2 + et(e, 60 + l) * 4) * o, i = (1.1 + et(e, 70 + l) * 1.8) * o, p = et(e, 80 + l) < 0.5 ? 1 : -1, h = (et(e, 90 + l) - 0.5) * 1.6, m = Math.max(6, Math.round(i / (0.075 * o))), w = t.x + Math.cos(f + p * Math.PI * 0.5) * u, n = t.y + Math.sin(f + p * Math.PI * 0.5) * u, y = f - p * Math.PI * 0.5;
601
+ })(), Oo = new r.Vector3(1, 0.07, 0).normalize(), ee = new r.Vector3(), Eo = new r.Vector3();
602
+ function Fo(t, e, s, o) {
603
+ const d = Z(), f = mt();
604
+ d.emit(t.x, t.y, t.z, 1.6 * o, N, 1.4, 0.6, f, 1), d.emit(t.x, t.y, t.z, 3.2 * o, s, 1, 0.9, f, 2);
605
+ const a = 5 + Math.floor(ot(e, 41) * 3);
606
+ for (let c = 0; c < a; c++) {
607
+ const l = c / a * Math.PI * 2 + ot(e, 50 + c) * 0.9, u = (1.2 + ot(e, 60 + c) * 4) * o, i = (1.1 + ot(e, 70 + c) * 1.8) * o, p = ot(e, 80 + c) < 0.5 ? 1 : -1, h = (ot(e, 90 + c) - 0.5) * 1.6, m = Math.max(6, Math.round(i / (0.075 * o))), w = t.x + Math.cos(l + p * Math.PI * 0.5) * u, n = t.y + Math.sin(l + p * Math.PI * 0.5) * u, y = l - p * Math.PI * 0.5;
601
608
  for (let v = 1; v <= m; v++) {
602
609
  const x = v / m * i, B = y + p * x / u;
603
- d.emit(w + Math.cos(B) * u, n + Math.sin(B) * u, t.z + x * h, 0.085 * o * (0.7 + Math.random() * 0.6), s, 0.85, 5, c + x / (7 * o), 0);
610
+ d.emit(w + Math.cos(B) * u, n + Math.sin(B) * u, t.z + x * h, 0.085 * o * (0.7 + Math.random() * 0.6), s, 0.85, 5, f + x / (7 * o), 0);
604
611
  }
605
612
  }
606
613
  }
607
- function Fo({ run: t }) {
608
- const e = D(() => new r.Color(t.color).lerp(X, 0.35), [t.color]), s = D(() => se("#000"), []), o = D(() => ot("#000"), []), d = I(null), c = D(() => new Yt(1, 64), []), a = I(null), l = I(null), f = D(() => ({ p: new r.Vector3(), fired: !1, init: !1, dep: { z: 0, tz: 0 } }), []);
609
- return ce(() => (xt.set(t.id, f.p), $t.set(t.id, f.dep), () => {
610
- xt.get(t.id) === f.p && xt.delete(t.id), $t.get(t.id) === f.dep && $t.delete(t.id);
611
- }), [t.id, f]), ht(({ clock: u, camera: i }, p) => {
614
+ function jo({ run: t }) {
615
+ const e = D(() => new r.Color(t.color).lerp($, 0.35), [t.color]), s = D(() => se("#000"), []), o = D(() => nt("#000"), []), d = I(null), f = D(() => new Yt(1, 64), []), a = I(null), c = I(null), l = D(() => ({ p: new r.Vector3(), fired: !1, init: !1, dep: { z: 0, tz: 0 } }), []);
616
+ return ce(() => (xt.set(t.id, l.p), $t.set(t.id, l.dep), () => {
617
+ xt.get(t.id) === l.p && xt.delete(t.id), $t.get(t.id) === l.dep && $t.delete(t.id);
618
+ }), [t.id, l]), dt(({ clock: u, camera: i }, p) => {
612
619
  var G;
613
620
  const h = performance.now(), m = t.run ?? L.runs.get(t.id);
614
621
  let w = 0, n = 0, y = 1e9;
615
- for (const W of st.agents.values())
616
- W.run !== t || W.inst.parent || (w += W.eu, n++, W.ev < y && (y = W.ev));
622
+ for (const K of Q.agents.values())
623
+ K.run !== t || K.inst.parent || (w += K.eu, n++, K.ev < y && (y = K.ev));
617
624
  const v = n ? w / n : t.cu, x = (n ? y : t.cv - t.hv) - 1.55 * Rt.spread;
618
- Ne(t, v, x, f.p), f.dep.tz = ho(t.index, t.count), f.dep.z = f.init ? f.dep.z + (f.dep.tz - f.dep.z) * Math.min(1, Math.min(0.05, p) * 1.2) : f.dep.tz, f.p.z = f.dep.z, f.init = !0;
625
+ Ne(t, v, x, l.p), l.dep.tz = po(t.index, t.count), l.dep.z = l.init ? l.dep.z + (l.dep.tz - l.dep.z) * Math.min(1, Math.min(0.05, p) * 1.2) : l.dep.tz, l.p.z = l.dep.z, l.init = !0;
619
626
  const B = m ? (h - m.startedAt) / 1e3 : 99;
620
- f.fired || (f.fired = !0, B < 1.2 && Eo(f.p, t.id, e, Math.max(0.6, Rt.scale)));
621
- const A = jt(B / 0.8), S = m ? m.status !== "started" : !1, z = m != null && m.endedAt ? rt(1 - (h - m.endedAt - (Xe - 2500)) / 2500) : 1, C = nt || S ? 1 : 0.85 + 0.15 * Math.sin(u.elapsedTime * 2.2 + t.index);
622
- a.current && (a.current.position.copy(f.p), a.current.scale.setScalar((0.9 + (S ? 0 : 0.25)) * Math.max(0.7, Rt.scale))), d.current && (d.current.position.copy(f.p), d.current.quaternion.copy(i.quaternion), d.current.scale.setScalar(Math.max(0.7, Rt.scale))), o.color.copy(e).lerp(N, 0.3).multiplyScalar((S ? 0.3 : 0.75) * A * z), s.color.copy(e).lerp(N, 0.4).multiplyScalar((S ? 0.35 : 0.8) * C * A * z), c.begin();
623
- const F = 7 + st.core.hw * 0.6;
624
- ee.copy(f.p).addScaledVector(Lo, -F);
625
- const E = Oo.copy(ee).add(f.p).multiplyScalar(0.5);
626
- c.add(ee, E, f.p, e, 0.16 * A * z * (S ? 0.6 : 1), 0, 0.985 * A, Math.round(F / 0.16), 0, 1, 0.35 * z), c.end();
627
- const T = Math.abs(t.side.y) * t.hu + Math.abs(t.axis.y) * t.hv, V = Math.max(t.origin.y + T, f.p.y + 0.4);
628
- (G = l.current) == null || G.position.set(t.origin.x, V + 0.75, f.p.z);
627
+ l.fired || (l.fired = !0, B < 1.2 && Fo(l.p, t.id, e, Math.max(0.6, Rt.scale)));
628
+ const P = jt(B / 0.8), z = m ? m.status !== "started" : !1, C = m != null && m.endedAt ? rt(1 - (h - m.endedAt - ($e - 2500)) / 2500) : 1, S = st || z ? 1 : 0.85 + 0.15 * Math.sin(u.elapsedTime * 2.2 + t.index);
629
+ a.current && (a.current.position.copy(l.p), a.current.scale.setScalar((0.9 + (z ? 0 : 0.25)) * Math.max(0.7, Rt.scale))), d.current && (d.current.position.copy(l.p), d.current.quaternion.copy(i.quaternion), d.current.scale.setScalar(Math.max(0.7, Rt.scale))), o.color.copy(e).lerp(N, 0.3).multiplyScalar((z ? 0.3 : 0.75) * P * C), s.color.copy(e).lerp(N, 0.4).multiplyScalar((z ? 0.35 : 0.8) * S * P * C), f.begin();
630
+ const E = 7 + Q.core.hw * 0.6;
631
+ ee.copy(l.p).addScaledVector(Oo, -E);
632
+ const W = Eo.copy(ee).add(l.p).multiplyScalar(0.5);
633
+ f.add(ee, W, l.p, e, 0.16 * P * C * (z ? 0.6 : 1), 0, 0.985 * P, Math.round(E / 0.16), 0, 1, 0.35 * C), f.end();
634
+ const T = Math.abs(t.side.y) * t.hu + Math.abs(t.axis.y) * t.hv, V = Math.max(t.origin.y + T, l.p.y + 0.4);
635
+ (G = c.current) == null || G.position.set(t.origin.x, V + 0.75, l.p.z);
629
636
  }), /* @__PURE__ */ lt(Kt, { children: [
630
- /* @__PURE__ */ b("primitive", { object: c.obj }),
637
+ /* @__PURE__ */ b("primitive", { object: f.obj }),
631
638
  /* @__PURE__ */ b("sprite", { ref: a, material: s }),
632
- /* @__PURE__ */ b("lineSegments", { ref: d, geometry: ko, material: o }),
633
- /* @__PURE__ */ b("group", { ref: l, children: t.run && /* @__PURE__ */ b(jo, { run: t.run }) })
639
+ /* @__PURE__ */ b("lineSegments", { ref: d, geometry: Lo, material: o }),
640
+ /* @__PURE__ */ b("group", { ref: c, children: t.run && /* @__PURE__ */ b(qo, { run: t.run }) })
634
641
  ] });
635
642
  }
636
- function jo({ run: t }) {
637
- _e();
643
+ function qo({ run: t }) {
644
+ Re();
638
645
  const e = t.status !== "started";
639
646
  return /* @__PURE__ */ b(
640
647
  Bt,
641
648
  {
642
649
  text: t.topic,
643
- secondary: $e(t, { base: "#8fb3bd", current: "#fde68a", done: "#cfe9ee" }, ["running…", "run complete"]),
650
+ secondary: He(t, { base: "#8fb3bd", current: "#fde68a", done: "#cfe9ee" }, ["running…", "run complete"]),
644
651
  color: t.color,
645
652
  textColor: "#e3fbff",
646
653
  plate: "none",
@@ -657,46 +664,46 @@ function jo({ run: t }) {
657
664
  );
658
665
  }
659
666
  const oe = 4;
660
- function qo() {
667
+ function Wo() {
661
668
  const t = I(/* @__PURE__ */ new Set()), e = I([]), s = I([]), o = I([]), d = I([]);
662
- return ht(() => {
663
- const c = performance.now();
669
+ return dt(() => {
670
+ const f = performance.now();
664
671
  for (const a of L.runs.values()) {
665
672
  if (!a.final || t.current.has(a.id)) continue;
666
673
  t.current.add(a.id);
667
- const l = st.runs.get(a.id);
668
- if (!l) continue;
669
- let f;
670
- for (const z of L.instances.values()) z.run === a.id && !z.parent && (f = St(z.id) ?? f);
671
- const u = (f ?? xt.get(a.id) ?? l.origin).clone(), i = Math.abs(u.x) > 0.5 ? u.x < 0 ? -1 : 1 : et(a.id, 23) < 0.5 ? 1 : -1, p = Math.atan2(-0.35 - et(a.id, 22) * 0.4, i), h = 40 * (et(a.id, 24) < 0.5 ? 1 : -1), m = (et(a.id, 25) - 0.5) * 0.35, w = st.core.r + 9, n = new r.Color(a.color).lerp(N, 0.6), y = Z(), v = pt(), x = u.x + Math.cos(p + Math.PI * 0.5) * h, B = u.y + Math.sin(p + Math.PI * 0.5) * h, A = p - Math.PI * 0.5, S = Math.round(w / 0.085);
672
- for (let z = 1; z <= S; z++) {
673
- const C = z / S * w, F = A + C / h, E = x + Math.cos(F) * h, T = B + Math.sin(F) * h, V = v + C / 11, G = u.z + C * m;
674
- y.emit(E, T, G, 0.09 * (0.75 + Math.random() * 0.5), n, 0.7, 5.5, V, 0), z % 3 === 0 && y.emit(E, T, G, 0.6, N, 0.9, 0.16, V, 1);
674
+ const c = Q.runs.get(a.id);
675
+ if (!c) continue;
676
+ let l;
677
+ for (const C of L.instances.values()) C.run === a.id && !C.parent && (l = St(C.id) ?? l);
678
+ const u = (l ?? xt.get(a.id) ?? c.origin).clone(), i = Math.abs(u.x) > 0.5 ? u.x < 0 ? -1 : 1 : ot(a.id, 23) < 0.5 ? 1 : -1, p = Math.atan2(-0.35 - ot(a.id, 22) * 0.4, i), h = 40 * (ot(a.id, 24) < 0.5 ? 1 : -1), m = (ot(a.id, 25) - 0.5) * 0.35, w = Q.core.r + 9, n = new r.Color(a.color).lerp(N, 0.6), y = Z(), v = mt(), x = u.x + Math.cos(p + Math.PI * 0.5) * h, B = u.y + Math.sin(p + Math.PI * 0.5) * h, P = p - Math.PI * 0.5, z = Math.round(w / 0.085);
679
+ for (let C = 1; C <= z; C++) {
680
+ const S = C / z * w, E = P + S / h, W = x + Math.cos(E) * h, T = B + Math.sin(E) * h, V = v + S / 11, G = u.z + S * m;
681
+ y.emit(W, T, G, 0.09 * (0.75 + Math.random() * 0.5), n, 0.7, 5.5, V, 0), C % 3 === 0 && y.emit(W, T, G, 0.6, N, 0.9, 0.16, V, 1);
675
682
  }
676
- y.emit(u.x, u.y, u.z, 1.6, N, 1.3, 0.6, v, 1), e.current.push({ run: a.id, at: c, from: u, text: a.final }), e.current.length > oe && e.current.shift();
683
+ y.emit(u.x, u.y, u.z, 1.6, N, 1.3, 0.6, v, 1), e.current.push({ run: a.id, at: f, from: u, text: a.final }), e.current.length > oe && e.current.shift();
677
684
  }
678
685
  if (t.current.size > 200)
679
686
  for (const a of t.current) L.runs.has(a) || t.current.delete(a);
680
687
  for (let a = 0; a < oe; a++) {
681
- const l = e.current[a], f = s.current[a], u = o.current[a];
682
- if (!f || !u) continue;
683
- const i = l ? (c - l.at) / 1e3 : 99;
684
- if (!l || i > 5.5) {
685
- f.setOpacity(0);
688
+ const c = e.current[a], l = s.current[a], u = o.current[a];
689
+ if (!l || !u) continue;
690
+ const i = c ? (f - c.at) / 1e3 : 99;
691
+ if (!c || i > 5.5) {
692
+ l.setOpacity(0);
686
693
  continue;
687
694
  }
688
- u.position.set(l.from.x, l.from.y - 2.2, l.from.z), d.current[a] !== l.run + l.at && (d.current[a] = l.run + l.at, f.setText(`final answer - ${l.text.length > 64 ? l.text.slice(0, 62) + "…" : l.text}`)), f.setOpacity(rt(i / 0.3) * rt((5.5 - i) / 1.2));
695
+ u.position.set(c.from.x, c.from.y - 2.2, c.from.z), d.current[a] !== c.run + c.at && (d.current[a] = c.run + c.at, l.setText(`final answer - ${c.text.length > 64 ? c.text.slice(0, 62) + "…" : c.text}`)), l.setOpacity(rt(i / 0.3) * rt((5.5 - i) / 1.2));
689
696
  }
690
- }), /* @__PURE__ */ b(Kt, { children: Array.from({ length: oe }, (c, a) => /* @__PURE__ */ b("group", { ref: (l) => void (o.current[a] = l), children: /* @__PURE__ */ b(Bt, { ref: (l) => void (s.current[a] = l), text: "", color: "#cff8ff", size: 0.26, maxWidth: 11, opacity: 0, pxRange: [8, 12], renderOrder: 24 }) }, a)) });
697
+ }), /* @__PURE__ */ b(Kt, { children: Array.from({ length: oe }, (f, a) => /* @__PURE__ */ b("group", { ref: (c) => void (o.current[a] = c), children: /* @__PURE__ */ b(Bt, { ref: (c) => void (s.current[a] = c), text: "", color: "#cff8ff", size: 0.26, maxWidth: 11, opacity: 0, pxRange: [8, 12], renderOrder: 24 }) }, a)) });
691
698
  }
692
- const kt = Math.PI * 2, ie = 0.85, Ae = 6.5, Wo = new r.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 }), it = new r.Vector3(), bt = new r.Vector3(), Lt = new r.Vector3();
693
- function Ko({ agent: t, selected: e, onSelect: s }) {
694
- const o = t.inst, d = I(null), c = I(null), a = I(null), l = I(null), f = I(null), u = I(null), i = I(null), p = I(null), h = D(() => [...o.id].reduce((x, B) => (x * 31 + B.charCodeAt(0)) % 9973, 7) / 9973, [o.id]), m = oo[o.type], w = D(
699
+ const kt = Math.PI * 2, ie = 0.85, Pe = 6.5, Ko = new r.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 }), it = new r.Vector3(), bt = new r.Vector3(), Lt = new r.Vector3();
700
+ function Uo({ agent: t, selected: e, onSelect: s }) {
701
+ const o = t.inst, d = I(null), f = I(null), a = I(null), c = I(null), l = I(null), u = I(null), i = I(null), p = I(null), h = D(() => [...o.id].reduce((x, B) => (x * 31 + B.charCodeAt(0)) % 9973, 7) / 9973, [o.id]), m = no[o.type], w = D(
695
702
  () => ({
696
703
  halo: se(m),
697
704
  core: se("#fff"),
698
- sel: ot("#e6fbff"),
699
- wait: ot(Xt)
705
+ sel: nt("#e6fbff"),
706
+ wait: nt(Nt)
700
707
  }),
701
708
  [m]
702
709
  ), n = D(
@@ -731,25 +738,25 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
731
738
  // eslint-disable-next-line react-hooks/exhaustive-deps
732
739
  []
733
740
  );
734
- ce(() => () => void Ht.delete(o.id), [o.id]), ht(({ camera: x }, B) => {
741
+ ce(() => () => void Ht.delete(o.id), [o.id]), dt(({ camera: x }, B) => {
735
742
  var ge, ye;
736
- const A = performance.now(), S = pt(), z = Math.min(0.05, B), C = t.scale, F = nt ? 0.3 : 1, E = !o.exitAt, T = !E || o.doneAt > 0, V = !T && (o.status === "thinking" || o.status === "spawning");
743
+ const P = performance.now(), z = mt(), C = Math.min(0.05, B), S = t.scale, E = st ? 0.3 : 1, W = !o.exitAt, T = !W || o.doneAt > 0, V = !T && (o.status === "thinking" || o.status === "spawning");
737
744
  let G = !1;
738
745
  if (!T)
739
746
  for (const _ of L.mcpPending.values()) _.instance === o.id && (G = !0);
740
- const W = (A - o.bornAt) / 1e3;
741
- if (n.first && (n.first = !1, W < ie * 0.8 && !t.fresh)) {
747
+ const K = (P - o.bornAt) / 1e3;
748
+ if (n.first && (n.first = !1, K < ie * 0.8 && !t.fresh)) {
742
749
  const _ = o.parent ? St(o.parent) : void 0, q = xt.get(o.run), At = _ ?? q;
743
750
  if (At) {
744
751
  n.fly = !0, n.from.copy(At), it.subVectors(n.from, t.pos);
745
752
  const ct = 4.2 * Math.max(0.6, Rt.spread);
746
753
  it.length() > ct && n.from.copy(t.pos).addScaledVector(it.normalize(), ct);
747
754
  const Tt = Z(), Pt = n.from;
748
- if (Tt.emit(Pt.x, Pt.y, Pt.z, 0.9 * C, X, 1.3, 0.45, S, 1), Tt.emit(Pt.x, Pt.y, Pt.z, 1.5 * C, It[o.type], 0.9, 0.6, S, 2), _ && o.parent) {
749
- const we = st.agents.get(o.parent);
755
+ if (Tt.emit(Pt.x, Pt.y, Pt.z, 0.9 * S, $, 1.3, 0.45, z, 1), Tt.emit(Pt.x, Pt.y, Pt.z, 1.5 * S, It[o.type], 0.9, 0.6, z, 2), _ && o.parent) {
756
+ const we = Q.agents.get(o.parent);
750
757
  it.copy(t.pos).sub(n.from);
751
- const Qt = it.length() || 1, Jt = we ? we.scale : C;
752
- te(o.parent, -it.x / Qt * 0.32 * Jt, -it.y / Qt * 0.32 * Jt, -it.z / Qt * 0.32 * Jt, A);
758
+ const Qt = it.length() || 1, Jt = we ? we.scale : S;
759
+ te(o.parent, -it.x / Qt * 0.32 * Jt, -it.y / Qt * 0.32 * Jt, -it.z / Qt * 0.32 * Jt, P);
753
760
  }
754
761
  }
755
762
  }
@@ -758,78 +765,78 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
758
765
  const _ = Math.min(2.5, Math.max(0.6, o.pulse));
759
766
  n.boost = Math.min(1.1, n.boost + 0.25 + _ * 0.22);
760
767
  const q = t.live;
761
- re(q, Math.round(6 + _ * 7), (0.14 + _ * 0.12) * C, 0.12 * C, X, 1, 2.8, S), Z().emit(q.x, q.y, q.z, (0.7 + _ * 0.45) * C, X, 0.9, 0.45, S, 1), nt || Re(q, Y + n.q * 0.9, (0.14 + _ * 0.07) * C, 1.7, 22, 0.07 * C, X, 0.85, 3.4, S, -n.q, -n.q * (0.25 + _ * 0.1) * C);
768
+ re(q, Math.round(6 + _ * 7), (0.14 + _ * 0.12) * S, 0.12 * S, $, 1, 2.8, z), Z().emit(q.x, q.y, q.z, (0.7 + _ * 0.45) * S, $, 0.9, 0.45, z, 1), st || Ie(q, Y + n.q * 0.9, (0.14 + _ * 0.07) * S, 1.7, 22, 0.07 * S, $, 0.85, 3.4, z, -n.q, -n.q * (0.25 + _ * 0.1) * S);
762
769
  }
763
770
  if (o.toolCalls !== n.tools && (n.tools = o.toolCalls, !T)) {
764
771
  const _ = Math.random() < 0.5 ? 1 : -1;
765
- te(o.id, Math.cos(Y + _ * 1.4) * 0.2 * C, Math.sin(Y + _ * 1.4) * 0.2 * C, _ * 0.16 * C, A);
772
+ te(o.id, Math.cos(Y + _ * 1.4) * 0.2 * S, Math.sin(Y + _ * 1.4) * 0.2 * S, _ * 0.16 * S, P);
766
773
  const q = t.live;
767
- Z().emit(q.x, q.y, q.z, 0.55 * C, N, 1.1, 0.3, S + 0.05, 1);
774
+ Z().emit(q.x, q.y, q.z, 0.55 * S, N, 1.1, 0.3, z + 0.05, 1);
768
775
  }
769
- const $ = o.decisions;
770
- for (let _ = 0; _ < $.length; _++) {
771
- const q = $[_];
772
- if (q.at <= n.decAt || q.at > A || (n.decAt = q.at, q.hidden || !He(q) || T)) continue;
776
+ const F = o.decisions;
777
+ for (let _ = 0; _ < F.length; _++) {
778
+ const q = F[_];
779
+ if (q.at <= n.decAt || q.at > P || (n.decAt = q.at, q.hidden || !Ze(q) || T)) continue;
773
780
  const At = Math.random() < 0.5 ? 1 : -1;
774
- te(o.id, Math.cos(Y + At * 1.9) * 0.42 * C, Math.sin(Y + At * 1.9) * 0.42 * C, -At * 0.36 * C, A), n.red = 1;
781
+ te(o.id, Math.cos(Y + At * 1.9) * 0.42 * S, Math.sin(Y + At * 1.9) * 0.42 * S, -At * 0.36 * S, P), n.red = 1;
775
782
  const ct = t.live, Tt = Z();
776
- Tt.emit(ct.x, ct.y, ct.z, 1 * C, _t, 1.4, 0.55, S + 0.05, 1), Tt.emit(ct.x, ct.y, ct.z, 1.9 * C, _t, 1, 0.75, S + 0.05, 2), re(ct, 5, 0.18 * C, 0.11 * C, _t, 1, 2, S + 0.05);
783
+ Tt.emit(ct.x, ct.y, ct.z, 1 * S, _t, 1.4, 0.55, z + 0.05, 1), Tt.emit(ct.x, ct.y, ct.z, 1.9 * S, _t, 1, 0.75, z + 0.05, 2), re(ct, 5, 0.18 * S, 0.11 * S, _t, 1, 2, z + 0.05);
777
784
  }
778
- n.boost *= Math.exp(-z / 2.4), n.red *= Math.exp(-z / 0.6);
779
- let mt, Mt, gt, Ct, yt;
780
- T ? (mt = 0, Mt = 0, gt = kt * 0.95, Ct = 0, yt = 0.5) : V && !G ? (mt = 0.34, Mt = 0.28, gt = kt * 0.6, Ct = 1.5, yt = 0.5) : (mt = 0.15, Mt = 0.06, gt = kt * 0.22, Ct = 0.32, yt = 0.2);
781
- const Q = Math.min(1, z * (T ? 1.3 : 2.6));
782
- n.rc += (mt + (T ? 0 : n.boost * 0.4) - n.rc) * Q, n.rg += (Mt - n.rg) * Q, n.w += (gt - n.w) * Math.min(1, z * 2), n.lz += (Ct + (T ? 0 : n.boost * 0.5) - n.lz) * Q, n.th += n.q * n.w * z * F, n.ph += n.q * 0.42 * z * F, n.ps += yt * z * F;
785
+ n.boost *= Math.exp(-C / 2.4), n.red *= Math.exp(-C / 0.6);
786
+ let ft, Mt, gt, Ct, yt;
787
+ T ? (ft = 0, Mt = 0, gt = kt * 0.95, Ct = 0, yt = 0.5) : V && !G ? (ft = 0.34, Mt = 0.28, gt = kt * 0.6, Ct = 1.5, yt = 0.5) : (ft = 0.15, Mt = 0.06, gt = kt * 0.22, Ct = 0.32, yt = 0.2);
788
+ const J = Math.min(1, C * (T ? 1.3 : 2.6));
789
+ n.rc += (ft + (T ? 0 : n.boost * 0.4) - n.rc) * J, n.rg += (Mt - n.rg) * J, n.w += (gt - n.w) * Math.min(1, C * 2), n.lz += (Ct + (T ? 0 : n.boost * 0.5) - n.lz) * J, n.th += n.q * n.w * C * E, n.ph += n.q * 0.42 * C * E, n.ps += yt * C * E;
783
790
  const H = t.live;
784
791
  H.copy(t.pos);
785
- const g = Math.max(C, 0.72);
792
+ const g = Math.max(S, 0.72);
786
793
  H.x += (Math.cos(n.ph) * n.rg + Math.cos(n.th) * n.rc) * g, H.y += (Math.sin(n.ph) * n.rg * 0.7 + Math.sin(n.th) * n.rc) * g, H.z += Math.sin(n.ps) * n.lz * g;
787
794
  const M = Ht.get(o.id);
788
795
  if (M) {
789
- const _ = uo(A - M.at);
796
+ const _ = ho(P - M.at);
790
797
  H.x += M.x * _, H.y += M.y * _, H.z += M.z * _;
791
798
  }
792
- let P = !1;
799
+ let A = !1;
793
800
  if (n.fly) {
794
- const _ = W / ie;
795
- _ >= 1 ? n.fly = !1 : (P = !0, it.copy(H), qt(n.from, it, n.q * 0.24, bt), Ut(n.from, bt, it, jt(_ * 0.85 + 0.15 * _ * _), H));
801
+ const _ = K / ie;
802
+ _ >= 1 ? n.fly = !1 : (A = !0, it.copy(H), qt(n.from, it, n.q * 0.24, bt), Ut(n.from, bt, it, jt(_ * 0.85 + 0.15 * _ * _), H));
796
803
  }
797
- const K = Math.hypot(t.pos.x - n.hx, t.pos.y - n.hy) / Math.max(1e-3, z) / Math.max(0.3, C);
798
- n.hx = t.pos.x, n.hy = t.pos.y, n.move += (Math.min(1, Math.max(0, K - 0.4) * 0.5) - n.move) * Math.min(1, z * 8), n.waitK += ((G ? 1 : 0) - n.waitK) * Math.min(1, z * 4), n.col.copy(It[o.type]).lerp(Xt, n.waitK * 0.75).lerp(_t, n.red * 0.85), o.status === "failed" && n.col.lerp(_t, 0.5);
799
- const O = n.rc + n.rg + (P ? 1 : 0);
804
+ const U = Math.hypot(t.pos.x - n.hx, t.pos.y - n.hy) / Math.max(1e-3, C) / Math.max(0.3, S);
805
+ n.hx = t.pos.x, n.hy = t.pos.y, n.move += (Math.min(1, Math.max(0, U - 0.4) * 0.5) - n.move) * Math.min(1, C * 8), n.waitK += ((G ? 1 : 0) - n.waitK) * Math.min(1, C * 4), n.col.copy(It[o.type]).lerp(Nt, n.waitK * 0.75).lerp(_t, n.red * 0.85), o.status === "failed" && n.col.lerp(_t, 0.5);
806
+ const O = n.rc + n.rg + (A ? 1 : 0);
800
807
  if (!n.stopped) {
801
- const _ = (P ? 1.5 : T ? 0.7 : V ? 1.55 : 0.95) * (P ? 1 : 1 - 0.85 * n.move);
802
- n.trail.step(H, 0.065 * g, 0.13 * g, n.col, _, P ? Ae + 1 : Ae, S, 10), T && O < 0.015 && (n.stopped = !0);
808
+ const _ = (A ? 1.5 : T ? 0.7 : V ? 1.55 : 0.95) * (A ? 1 : 1 - 0.85 * n.move);
809
+ n.trail.step(H, 0.065 * g, 0.13 * g, n.col, _, A ? Pe + 1 : Pe, z, 10), T && O < 0.015 && (n.stopped = !0);
803
810
  }
804
811
  !T && n.stopped && (n.stopped = !1, n.trail.reset());
805
- const j = o.exitAt ? (A - o.exitAt) / 1e3 : -1, U = j >= 0 ? rt(j / 1.6) : 0, J = jt(W / 0.35), dt = Ze(o, A), me = ((T ? 0.45 : V ? 1 : 0.6) + dt * 0.25 + n.boost * 0.4 + (P ? 0.5 : 0)) * (1 - U);
806
- if (d.current && (d.current.position.copy(H), d.current.scale.setScalar(Math.max(1e-4, C * J))), l.current && (l.current.scale.setScalar(0.5 + dt * 0.1 + n.boost * 0.12), w.core.color.copy(N).lerp(n.col, 0.2).multiplyScalar(Math.min(2, 1.5 * me))), a.current) {
807
- const _ = Math.min(1, Math.sqrt(1.3 / Math.max(0.1, C)));
808
- a.current.scale.setScalar(((V ? 2 : 1.5) + dt * 0.4 + n.boost * 0.6) * _), w.halo.color.copy(m).lerp(n.col, 0.4).multiplyScalar(0.62 * me);
812
+ const j = o.exitAt ? (P - o.exitAt) / 1e3 : -1, X = j >= 0 ? rt(j / 1.6) : 0, tt = jt(K / 0.35), pt = Ye(o, P), me = ((T ? 0.45 : V ? 1 : 0.6) + pt * 0.25 + n.boost * 0.4 + (A ? 0.5 : 0)) * (1 - X);
813
+ if (d.current && (d.current.position.copy(H), d.current.scale.setScalar(Math.max(1e-4, S * tt))), c.current && (c.current.scale.setScalar(0.5 + pt * 0.1 + n.boost * 0.12), w.core.color.copy(N).lerp(n.col, 0.2).multiplyScalar(Math.min(2, 1.5 * me))), a.current) {
814
+ const _ = Math.min(1, Math.sqrt(1.3 / Math.max(0.1, S)));
815
+ a.current.scale.setScalar(((V ? 2 : 1.5) + pt * 0.4 + n.boost * 0.6) * _), w.halo.color.copy(m).lerp(n.col, 0.4).multiplyScalar(0.62 * me);
809
816
  }
810
- c.current && (c.current.position.copy(t.pos), c.current.quaternion.copy(x.quaternion), c.current.scale.setScalar(Math.max(1e-4, g)));
817
+ f.current && (f.current.position.copy(t.pos), f.current.quaternion.copy(x.quaternion), f.current.scale.setScalar(Math.max(1e-4, g)));
811
818
  const Me = 0.34 + 0.28 + 0.3;
812
- n.selK += ((e ? 1 : 0) - n.selK) * 0.14, f.current && (f.current.visible = n.selK > 0.02, f.current.scale.setScalar(Me + 0.18 + (1 - n.selK) * 0.3), f.current.rotation.z = nt ? 0 : S * 0.15, w.sel.color.setScalar(0.85 * n.selK)), u.current && (u.current.visible = n.waitK > 0.02, u.current.scale.setScalar(0.5 + 0.03 * Math.sin(S * 3)), u.current.rotation.z = nt ? 0 : -S * 0.8, w.wait.color.copy(Xt).multiplyScalar(0.9 * n.waitK)), (ge = i.current) == null || ge.position.set(t.pos.x, t.pos.y - (Me + 0.12) * g - 0.3, t.pos.z), (ye = p.current) == null || ye.setOpacity(Ye(o.id) ? J * (E ? 0.95 : 0.6 * (1 - U)) : 0);
819
+ n.selK += ((e ? 1 : 0) - n.selK) * 0.14, l.current && (l.current.visible = n.selK > 0.02, l.current.scale.setScalar(Me + 0.18 + (1 - n.selK) * 0.3), l.current.rotation.z = st ? 0 : z * 0.15, w.sel.color.setScalar(0.85 * n.selK)), u.current && (u.current.visible = n.waitK > 0.02, u.current.scale.setScalar(0.5 + 0.03 * Math.sin(z * 3)), u.current.rotation.z = st ? 0 : -z * 0.8, w.wait.color.copy(Nt).multiplyScalar(0.9 * n.waitK)), (ge = i.current) == null || ge.position.set(t.pos.x, t.pos.y - (Me + 0.12) * g - 0.3, t.pos.z), (ye = p.current) == null || ye.setOpacity(Qe(o.id) ? tt * (W ? 0.95 : 0.6 * (1 - X)) : 0);
813
820
  });
814
821
  const y = (x) => {
815
822
  x.stopPropagation(), s(o.id);
816
823
  }, v = o.id.split(":")[2];
817
824
  return /* @__PURE__ */ lt(Kt, { children: [
818
- /* @__PURE__ */ lt("group", { ref: c, scale: 1e-4, children: [
819
- /* @__PURE__ */ b("mesh", { geometry: ro, material: Wo, scale: 0.85, onClick: y, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
820
- /* @__PURE__ */ b("lineSegments", { ref: f, geometry: be, material: w.sel, visible: !1 }),
825
+ /* @__PURE__ */ lt("group", { ref: f, scale: 1e-4, children: [
826
+ /* @__PURE__ */ b("mesh", { geometry: ao, material: Ko, scale: 0.85, onClick: y, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
827
+ /* @__PURE__ */ b("lineSegments", { ref: l, geometry: be, material: w.sel, visible: !1 }),
821
828
  /* @__PURE__ */ b("lineSegments", { ref: u, geometry: be, material: w.wait, visible: !1 })
822
829
  ] }),
823
830
  /* @__PURE__ */ lt("group", { ref: d, scale: 1e-4, children: [
824
831
  /* @__PURE__ */ b("sprite", { ref: a, material: w.halo }),
825
- /* @__PURE__ */ b("sprite", { ref: l, material: w.core })
832
+ /* @__PURE__ */ b("sprite", { ref: c, material: w.core })
826
833
  ] }),
827
834
  /* @__PURE__ */ b("group", { ref: i, children: /* @__PURE__ */ b(
828
835
  Bt,
829
836
  {
830
837
  ref: p,
831
838
  text: `${o.name}${v !== void 0 ? ` ${Number(v) + 1}` : ""}`,
832
- live: o.job ? () => Qe(o) : null,
839
+ live: o.job ? () => Je(o) : null,
833
840
  color: le[o.type],
834
841
  size: o.subagent ? 0.22 : 0.28,
835
842
  letterSpacing: 0.02,
@@ -841,31 +848,31 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
841
848
  ] });
842
849
  }
843
850
  const Ot = /* @__PURE__ */ new Map();
844
- function Uo() {
845
- return ht((t, e) => {
851
+ function Xo() {
852
+ return dt((t, e) => {
846
853
  const s = Math.min(1, Math.min(0.05, e) * 1.6);
847
- for (const o of st.agents.values()) {
848
- const d = Ie(o), c = Ot.get(o.id), a = c === void 0 ? d : c + (d - c) * s;
854
+ for (const o of Q.agents.values()) {
855
+ const d = Be(o), f = Ot.get(o.id), a = f === void 0 ? d : f + (d - f) * s;
849
856
  Ot.set(o.id, a), o.pos.z = a, o.live.z = a;
850
857
  }
851
- if (Ot.size > st.agents.size + 64)
852
- for (const o of Ot.keys()) st.agents.has(o) || Ot.delete(o);
858
+ if (Ot.size > Q.agents.size + 64)
859
+ for (const o of Ot.keys()) Q.agents.has(o) || Ot.delete(o);
853
860
  }, -1), null;
854
861
  }
855
- const No = 160, Xo = 32;
856
- function $o() {
857
- const t = D(() => new Yt(No + Xo, 24), []), e = D(() => /* @__PURE__ */ new Map(), []), s = D(() => ({ a: new r.Vector3(), b: new r.Vector3(), col: new r.Color() }), []);
858
- return ht(({ clock: o }) => {
859
- const d = performance.now(), c = pt(), a = nt ? 0 : o.elapsedTime;
862
+ const No = 160, $o = 32;
863
+ function Ho() {
864
+ const t = D(() => new Yt(No + $o, 24), []), e = D(() => /* @__PURE__ */ new Map(), []), s = D(() => ({ a: new r.Vector3(), b: new r.Vector3(), col: new r.Color() }), []);
865
+ return dt(({ clock: o }) => {
866
+ const d = performance.now(), f = mt(), a = st ? 0 : o.elapsedTime;
860
867
  t.begin();
861
- const { a: l, b: f, col: u } = s;
862
- for (const i of st.agents.values()) {
863
- const p = i.inst, h = p.parent ? st.agents.get(p.parent) : void 0, m = h ? h.pos : p.parent ? void 0 : xt.get(p.run);
868
+ const { a: c, b: l, col: u } = s;
869
+ for (const i of Q.agents.values()) {
870
+ const p = i.inst, h = p.parent ? Q.agents.get(p.parent) : void 0, m = h ? h.pos : p.parent ? void 0 : xt.get(p.run);
864
871
  if (!m) continue;
865
872
  const w = i.pos.distanceTo(m);
866
873
  if (w < 0.5) continue;
867
874
  const n = Math.min(0.4, ((h ? 0.85 * h.scale : 0.25) + 0.05) / w), y = Math.max(n + 0.05, 1 - (0.85 * i.scale + 0.05) / w), v = (d - p.bornAt) / 1e3, x = ne(v / ie), B = (h ? 0.3 : 0.2) * (1 - 0.65 * i.dim) * x;
868
- u.copy(It[p.type]).lerp(X, 0.4), l.copy(m), f.copy(i.pos), bt.copy(l).add(f).multiplyScalar(0.5), t.add(l, bt, f, u, B, n, n + (y - n) * x, Math.max(3, Math.round(w / 0.42)), a * 0.35, -1, 0);
875
+ u.copy(It[p.type]).lerp($, 0.4), c.copy(m), l.copy(i.pos), bt.copy(c).add(l).multiplyScalar(0.5), t.add(c, bt, l, u, B, n, n + (y - n) * x, Math.max(3, Math.round(w / 0.42)), a * 0.35, -1, 0);
869
876
  }
870
877
  for (const i of e.keys()) {
871
878
  let p = !1;
@@ -875,67 +882,67 @@ function $o() {
875
882
  for (const i of L.comets) {
876
883
  const p = St(i.from), h = St(i.to);
877
884
  if (!p || !h) continue;
878
- const m = Je(i, d);
879
- if (!to(i, d)) continue;
885
+ const m = to(i, d);
886
+ if (!eo(i, d)) continue;
880
887
  let w = e.get(i.id);
881
888
  w || e.set(i.id, w = new fe()), qt(p, h, i.id % 2 ? 0.22 : -0.22, bt);
882
889
  const n = ne(m);
883
890
  Ut(p, bt, h, n, Lt);
884
891
  const y = L.instances.get(i.from);
885
- u.copy(y ? It[y.type] : X).lerp(N, 0.35);
892
+ u.copy(y ? It[y.type] : $).lerp(N, 0.35);
886
893
  const v = Math.min(1, m / 0.08) * Math.min(1, (1 - m) / 0.12);
887
- t.add(p, bt, h, u, 0, 0, 1, 0, 0, n, 1.1 * v), w.step(Lt, 0.06, 0.07, u, 0.9 * v, 2.4, c, 6), Z().emit(Lt.x, Lt.y, Lt.z, 0.42, u, 1.2 * v, 0.12, c, 1);
894
+ t.add(p, bt, h, u, 0, 0, 1, 0, 0, n, 1.1 * v), w.step(Lt, 0.06, 0.07, u, 0.9 * v, 2.4, f, 6), Z().emit(Lt.x, Lt.y, Lt.z, 0.42, u, 1.2 * v, 0.12, f, 1);
888
895
  }
889
896
  t.end();
890
897
  }), /* @__PURE__ */ b("primitive", { object: t.obj });
891
898
  }
892
- const Ho = { tint: "#7dd3fc", tintAmt: 0.3, gain: 0.6, halo: 0.4 }, Zo = {
899
+ const Zo = { tint: "#7dd3fc", tintAmt: 0.3, gain: 0.6, halo: 0.4 }, Yo = {
893
900
  minPolarAngle: Math.PI * 0.25,
894
901
  maxPolarAngle: Math.PI * 0.75
895
902
  };
896
- function Yo(t) {
903
+ function Qo(t) {
897
904
  for (const e of xt.values()) t(e, 0.9);
898
- for (const e of st.agents.values()) t(vt.set(e.target.x, e.target.y, Ie(e)), 1.1 * e.scale);
905
+ for (const e of Q.agents.values()) t(vt.set(e.target.x, e.target.y, Be(e)), 1.1 * e.scale);
899
906
  t(vt.set(R.rx, 0, 0), 0), t(vt.set(-R.rx, 0, 0), 0), t(vt.set(0, R.ry, 0), 0), t(vt.set(0, -R.ry, 0), 0), t(vt.set(0, 0, R.hz), 0), t(vt.set(0, 0, -R.hz), 0);
900
907
  }
901
908
  const vt = new r.Vector3();
902
- function sn() {
909
+ function rn() {
903
910
  return /* @__PURE__ */ lt(
904
- eo,
911
+ oo,
905
912
  {
906
913
  title: "bubble chamber · particle tracks",
907
914
  subtitle: "Agents are charged particles on helices along the field (tight = thinking, slow orbit = waiting, spiral in = done) · a spawn is a decay into a V · LLM calls burst bubbles, tools kink the track, a deny flashes red · each run is an event at its vertex · ▭ MCP detector plates, ⬡ backend cells · graph = event archive (a read pulls its plate out)",
908
915
  preset: "radial",
909
916
  plane: "xy",
910
917
  camera: { position: [0, 0, 34], fov: 46, far: 1200 },
911
- controls: Zo,
918
+ controls: Yo,
912
919
  bg: "#010406",
913
920
  gl: { antialias: !0 },
914
921
  fit: { nRef: 4, min: 0.62, max: 1.6, minRadius: 5.5 },
915
922
  agentRadius: 1.1,
916
- graph: { natural: Mo * 1.05, radius: 4.4 },
923
+ graph: { natural: go * 1.05, radius: 4.4 },
917
924
  peripheryGap: 3.8,
918
- extents: Yo,
919
- Background: /* @__PURE__ */ b(To, {}),
920
- Agent: Ko,
921
- RunMarker: Fo,
922
- mcpStyle: Ho,
923
- GraphResource: xo,
925
+ extents: Qo,
926
+ Background: /* @__PURE__ */ b(Do, {}),
927
+ Agent: Uo,
928
+ RunMarker: jo,
929
+ mcpStyle: Zo,
930
+ GraphResource: zo,
924
931
  cluster: { radius: 1.4, variant: "swarm", glowGain: 0.9 },
925
- PostFX: /* @__PURE__ */ lt(Le, { multisampling: 0, children: [
926
- /* @__PURE__ */ b(Oe, { mipmapBlur: !0, intensity: 0.9, luminanceThreshold: 0.2, luminanceSmoothing: 0.3, radius: 0.6 }),
927
- /* @__PURE__ */ b(Ee, { eskil: !1, offset: 0.22, darkness: 0.85 })
932
+ PostFX: /* @__PURE__ */ lt(Oe, { multisampling: 0, children: [
933
+ /* @__PURE__ */ b(Ee, { mipmapBlur: !0, intensity: 0.9, luminanceThreshold: 0.2, luminanceSmoothing: 0.3, radius: 0.6 }),
934
+ /* @__PURE__ */ b(Fe, { eskil: !1, offset: 0.22, darkness: 0.85 })
928
935
  ] }),
929
936
  children: [
930
- /* @__PURE__ */ b(Uo, {}),
931
- /* @__PURE__ */ b($o, {}),
932
- /* @__PURE__ */ b(Go, {}),
933
- /* @__PURE__ */ b(qo, {}),
934
- /* @__PURE__ */ b(Do, {})
937
+ /* @__PURE__ */ b(Xo, {}),
938
+ /* @__PURE__ */ b(Ho, {}),
939
+ /* @__PURE__ */ b(ko, {}),
940
+ /* @__PURE__ */ b(Wo, {}),
941
+ /* @__PURE__ */ b(Vo, {})
935
942
  ]
936
943
  }
937
944
  );
938
945
  }
939
946
  export {
940
- sn as default
947
+ rn as default
941
948
  };