@popcorn245/cornfield-components 0.52.1 → 0.53.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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/around-BcnegEdS.js +99 -0
  3. package/dist/chunks/connection-KDiWvV19.js +23 -0
  4. package/dist/chunks/{engine-BmXtSISH.js → engine-xmHJvQY9.js} +1188 -1186
  5. package/dist/chunks/{layers-Bj4Tluxe.js → layers-ho10a2y7.js} +48 -48
  6. package/dist/chunks/{map-BZRFOYkt.js → map-DbfPgQRe.js} +385 -385
  7. package/dist/chunks/node-panel-CC8UrSzJ.js +410 -0
  8. package/dist/chunks/panel-review-ih7RlfkH.js +884 -0
  9. package/dist/chunks/review-pieces-DtRxCDMr.js +2523 -0
  10. package/dist/chunks/{review-source-CK5tYIqk.js → review-source-CmbwaPCM.js} +1 -1
  11. package/dist/chunks/scope-2m2VmJXn.js +185 -0
  12. package/dist/chunks/scope-proposal-T06ndbin.js +116 -0
  13. package/dist/chunks/{sheets-D-sMZzSs.js → sheets-BWANwtZP.js} +7 -2
  14. package/dist/chunks/source-address-DXanAREm.js +57 -0
  15. package/dist/chunks/{status-DI5QLlAp.js → status-DM-iIEsg.js} +4 -3
  16. package/dist/corn-changes.js +43 -0
  17. package/dist/corn-decision.js +52 -0
  18. package/dist/corn-layers.js +275 -1
  19. package/dist/corn-map.js +125 -1
  20. package/dist/corn-node-panel.js +42 -1
  21. package/dist/corn-proposal.js +50 -0
  22. package/dist/corn-review.js +425 -1
  23. package/dist/corn-scope.js +33 -9
  24. package/dist/corn-search.js +484 -1
  25. package/dist/index.js +11 -8
  26. package/dist/manifest.json +95 -70
  27. package/dist/tokens.css +6 -0
  28. package/dist/types/components.d.ts +111 -5
  29. package/dist/types/corn-changes.d.ts +2 -0
  30. package/dist/types/corn-decision.d.ts +2 -0
  31. package/dist/types/corn-proposal.d.ts +2 -0
  32. package/dist/types/index.d.ts +3 -0
  33. package/dist/version.json +1 -1
  34. package/package.json +17 -5
  35. package/dist/chunks/around-BFqYTZ0K.js +0 -78
  36. package/dist/chunks/corn-layers-Cni5rISZ.js +0 -275
  37. package/dist/chunks/corn-map-B2-YxiEL.js +0 -125
  38. package/dist/chunks/corn-node-panel-BkvJThlp.js +0 -42
  39. package/dist/chunks/corn-review-5wf7AT4o.js +0 -2900
  40. package/dist/chunks/corn-search-CXs5d06S.js +0 -484
  41. package/dist/chunks/node-panel-BdvFvWCE.js +0 -1291
  42. package/dist/chunks/scope-CqPbHcKL.js +0 -137
  43. package/dist/chunks/source-address-C70zNPIj.js +0 -79
@@ -1,4 +1,4 @@
1
- import { $t as e, C as t, Cn as n, D as r, Dn as i, En as a, G as o, Gt as s, H as c, J as l, K as u, Kt as d, M as f, Mn as p, Mt as m, Nt as h, Pt as g, Qt as _, Sn as v, T as y, Tt as b, U as x, Wt as S, X as C, Xt as w, Y as T, Yt as E, Z as D, Zt as O, _ as k, _n as A, b as j, c as M, d as N, en as P, et as ee, f as F, g as I, i as L, it as R, j as z, k as B, l as te, ln as ne, m as V, n as H, nn as U, p as W, q as re, r as G, rn as ie, tn as K, u as ae, v as q, vn as oe, w as se, wn as ce, x as J } from "./engine-BmXtSISH.js";
1
+ import { $t as e, At as t, B as n, C as r, Cn as i, D as a, Dn as o, En as s, Et as c, G as l, Gt as u, H as d, I as f, Kt as p, L as m, M as h, Mn as g, Mt as _, Qt as v, Sn as y, St as b, T as x, U as S, V as C, W as w, Wt as T, Xt as E, Yt as D, Zt as O, _ as ee, _n as te, b as k, c as A, d as j, en as M, f as N, g as P, ht as F, i as I, j as L, jt as R, k as z, l as ne, ln as re, m as B, n as V, nn as H, p as U, r as W, rn as G, tn as ie, u as K, v as q, vn as ae, w as oe, wn as se, x as J, z as ce } from "./engine-xmHJvQY9.js";
2
2
  var le = 96, ue = "letters:", de = (e) => `${ue}${e}`, fe = (e) => typeof e == "string" && e.startsWith(ue), pe = (e) => e.slice(8), me = (e, t) => !!e.letters && !e.icon && e.r * 2 * t >= 14, he = /* @__PURE__ */ new Map();
3
3
  function ge(e, t = null) {
4
4
  if (typeof e != "string" || !e) return null;
@@ -12,9 +12,9 @@ function ge(e, t = null) {
12
12
  height: le
13
13
  }) : null, i = n && n.getContext && n.getContext("2d");
14
14
  if (i && i.fillText) {
15
- i.font = `700 ${e.length > 1 ? 56 : 72}px ${I}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
- let a = typeof t == "string" ? t : x;
17
- i.strokeStyle = T(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, le / 2, 51), i.fillStyle = a, i.fillText(e, le / 2, 51), r = n;
15
+ i.font = `700 ${e.length > 1 ? 56 : 72}px ${P}`, i.textAlign = "center", i.textBaseline = "middle", i.lineJoin = "round", i.lineWidth = 10;
16
+ let a = typeof t == "string" ? t : m;
17
+ i.strokeStyle = S(a) === "#ffffff" ? "rgba(11, 18, 32, 0.92)" : "rgba(255, 255, 255, 0.92)", i.strokeText(e, le / 2, 51), i.fillStyle = a, i.fillText(e, le / 2, 51), r = n;
18
18
  }
19
19
  } catch {
20
20
  r = null;
@@ -25,7 +25,7 @@ function ge(e, t = null) {
25
25
  var _e = Math.PI * 2, ve = 1.5, ye = /* @__PURE__ */ new Map();
26
26
  function be(e) {
27
27
  let t = ye.get(e);
28
- return t === void 0 && (ye.size > 512 && ye.clear(), t = R(e)[3], ye.set(e, t)), t;
28
+ return t === void 0 && (ye.size > 512 && ye.clear(), t = c(e)[3], ye.set(e, t)), t;
29
29
  }
30
30
  var Y = (e, t, n, r) => {
31
31
  e.beginPath(), e.arc(t, n, r, 0, _e);
@@ -73,8 +73,8 @@ function Te(e, t, n, r, i = !0) {
73
73
  e.save(), e.globalAlpha = t.alpha * .3, e.strokeStyle = t.glowColor || t.color, e.lineWidth = n + t.glow * .6, e.stroke(), e.restore();
74
74
  }
75
75
  if (e.stroke(), e.setLineDash([]), t.mark === "removed") {
76
- let n = y(t, .5), i = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [a, o] = i > 0 ? [(t.x2 - t.x1) / i, (t.y2 - t.y1) / i] : [1, 0];
77
- e.beginPath(), e.moveTo(n.x - o * W.halfLength, n.y + a * W.halfLength), e.lineTo(n.x + o * W.halfLength, n.y - a * W.halfLength), e.lineWidth = Math.max(W.width, 1.5 / r), e.stroke();
76
+ let n = x(t, .5), i = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [a, o] = i > 0 ? [(t.x2 - t.x1) / i, (t.y2 - t.y1) / i] : [1, 0];
77
+ e.beginPath(), e.moveTo(n.x - o * U.halfLength, n.y + a * U.halfLength), e.lineTo(n.x + o * U.halfLength, n.y - a * U.halfLength), e.lineWidth = Math.max(U.width, 1.5 / r), e.stroke();
78
78
  }
79
79
  if (t.ticks && De(e, t, r), t.arrow) {
80
80
  let { cx: n, cy: i } = t.curve || {
@@ -86,31 +86,31 @@ function Te(e, t, n, r, i = !0) {
86
86
  i && t.packet && Oe(e, t, n, r), e.restore();
87
87
  }
88
88
  function Ee(e, t, n, r) {
89
- let i = t.end || "triangle", { x2: a, y2: o, color: s } = t, c = Math.cos(n), l = Math.sin(n), u = (e, t) => [a - c * e - l * t, o - l * e + c * t], d = Math.max(V.strokeWidth, 1.2 / r);
90
- if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - N.spread) * N.length, o - Math.sin(n - N.spread) * N.length), e.lineTo(a - Math.cos(n + N.spread) * N.length, o - Math.sin(n + N.spread) * N.length), e.closePath(), e.fillStyle = s, e.fill();
89
+ let i = t.end || "triangle", { x2: a, y2: o, color: s } = t, c = Math.cos(n), l = Math.sin(n), u = (e, t) => [a - c * e - l * t, o - l * e + c * t], d = Math.max(B.strokeWidth, 1.2 / r);
90
+ if (e.beginPath(), i === "triangle") e.moveTo(a, o), e.lineTo(a - Math.cos(n - j.spread) * j.length, o - Math.sin(n - j.spread) * j.length), e.lineTo(a - Math.cos(n + j.spread) * j.length, o - Math.sin(n + j.spread) * j.length), e.closePath(), e.fillStyle = s, e.fill();
91
91
  else {
92
92
  if (e.strokeStyle = s, e.lineWidth = d, e.lineJoin = "miter", i === "chevron") {
93
- let t = N.length * Math.cos(N.spread), n = N.length * Math.sin(N.spread);
93
+ let t = j.length * Math.cos(j.spread), n = j.length * Math.sin(j.spread);
94
94
  e.moveTo(...u(t, n)), e.lineTo(a, o), e.lineTo(...u(t, -n));
95
- } else if (i === "bar") e.moveTo(...u(d / 2, V.barHalf)), e.lineTo(...u(d / 2, -V.barHalf));
95
+ } else if (i === "bar") e.moveTo(...u(d / 2, B.barHalf)), e.lineTo(...u(d / 2, -B.barHalf));
96
96
  else {
97
- let t = V.diamondHalf;
98
- e.moveTo(a, o), e.lineTo(...u(t, V.diamondAcross)), e.lineTo(...u(2 * t, 0)), e.lineTo(...u(t, -V.diamondAcross)), e.closePath();
97
+ let t = B.diamondHalf;
98
+ e.moveTo(a, o), e.lineTo(...u(t, B.diamondAcross)), e.lineTo(...u(2 * t, 0)), e.lineTo(...u(t, -B.diamondAcross)), e.closePath();
99
99
  }
100
100
  e.stroke();
101
101
  }
102
102
  }
103
103
  function De(e, t, n) {
104
- let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o = y(t, .5);
104
+ let r = Math.hypot(t.x2 - t.x1, t.y2 - t.y1), [i, a] = r > 0 ? [(t.x2 - t.x1) / r, (t.y2 - t.y1) / r] : [1, 0], o = x(t, .5);
105
105
  e.beginPath();
106
106
  for (let n = 0; n < t.ticks; n++) {
107
- let r = (n - (t.ticks - 1) / 2) * V.tickGap, s = o.x + i * r, c = o.y + a * r;
108
- e.moveTo(s - a * V.tickHalf, c + i * V.tickHalf), e.lineTo(s + a * V.tickHalf, c - i * V.tickHalf);
107
+ let r = (n - (t.ticks - 1) / 2) * B.tickGap, s = o.x + i * r, c = o.y + a * r;
108
+ e.moveTo(s - a * B.tickHalf, c + i * B.tickHalf), e.lineTo(s + a * B.tickHalf, c - i * B.tickHalf);
109
109
  }
110
- e.strokeStyle = t.color, e.lineWidth = Math.max(V.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
110
+ e.strokeStyle = t.color, e.lineWidth = Math.max(B.tickWidth, 1.5 / n), e.setLineDash([]), e.stroke();
111
111
  }
112
112
  function Oe(e, t, n, r) {
113
- let i = f(t, n), { packet: a } = t;
113
+ let i = h(t, n), { packet: a } = t;
114
114
  a.glow && a.glow * r >= ve && (e.beginPath(), e.arc(i.x, i.y, a.radius + a.glow * .5, 0, _e), e.globalAlpha = t.alpha * .3, e.fillStyle = a.glowColor || a.color, e.fill(), e.globalAlpha = t.alpha), e.beginPath(), e.arc(i.x, i.y, a.radius, 0, _e), e.fillStyle = a.color, e.fill();
115
115
  }
116
116
  function ke(e, t, n, r) {
@@ -129,20 +129,20 @@ function Ne(e, t, n, r) {
129
129
  for (let t = 0; t < e.edges.length; t++) i[t * 4 + 2] < s || i[t * 4] > l || i[t * 4 + 3] < c || i[t * 4 + 1] > u || d.push(e.edges[t]);
130
130
  return d;
131
131
  }
132
- function Pe(e, t, n, r, i, a) {
132
+ function Pe(e, t, r, i, a, o) {
133
133
  e.save(), e.globalAlpha = t.alpha;
134
- let s = r.halo[t.halo];
134
+ let s = i.halo[t.halo];
135
135
  s && (s.fill && (Y(e, t.x, t.y, t.r + s.fillR), e.fillStyle = s.fill, e.fill()), Y(e, t.x, t.y, t.r + s.ringR), e.strokeStyle = s.ring, e.lineWidth = s.ringWidth, e.stroke());
136
- let l = r.mark[t.mark];
137
- if (l) {
138
- let r = t.r + Math.max(l.ringR, q.gap / n);
139
- Y(e, t.x, t.y, r), e.strokeStyle = l.color, e.lineWidth = Math.max(l.ringWidth, q.ring / n), e.setLineDash(l.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - r, t.y), e.lineTo(t.x + r, t.y), e.stroke());
136
+ let c = i.mark[t.mark];
137
+ if (c) {
138
+ let n = t.r + Math.max(c.ringR, q.gap / r);
139
+ Y(e, t.x, t.y, n), e.strokeStyle = c.color, e.lineWidth = Math.max(c.ringWidth, q.ring / r), e.setLineDash(c.ringDash || []), e.stroke(), e.setLineDash([]), t.mark === "removed" && (e.beginPath(), e.moveTo(t.x - n, t.y), e.lineTo(t.x + n, t.y), e.stroke());
140
140
  }
141
- if (xe(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * n >= ve) {
141
+ if (xe(e, t.shape, t.x, t.y, t.r), t.glow && t.glow * r >= ve) {
142
142
  e.save(), e.globalAlpha = t.alpha * .28;
143
143
  let n = t.r + t.glow * .7;
144
144
  if (e.fillStyle = t.color, be(t.color) < 1) {
145
- if (t.r * (j[t.shape] || 1) < n) Y(e, t.x, t.y, n), xe(e, t.shape, t.x, t.y, t.r, !0), e.fill("evenodd");
145
+ if (t.r * (k[t.shape] || 1) < n) Y(e, t.x, t.y, n), xe(e, t.shape, t.x, t.y, t.r, !0), e.fill("evenodd");
146
146
  else {
147
147
  let r = n + t.r;
148
148
  e.beginPath(), e.rect(t.x - r, t.y - r, r * 2, r * 2), xe(e, t.shape, t.x, t.y, t.r, !0), e.clip("evenodd"), Y(e, t.x, t.y, n), e.fill();
@@ -151,24 +151,24 @@ function Pe(e, t, n, r, i, a) {
151
151
  e.restore(), xe(e, t.shape, t.x, t.y, t.r);
152
152
  }
153
153
  e.fillStyle = t.color, e.fill();
154
- let d = t.icon && i.icons ? i.icons.get(t.icon) : null, f = !d && me(t, n), p = !d && !f && D(t, n) ? o(t.glyph, u(t, i, a)) : null;
155
- if (p || (Y(e, t.x, t.y, t.r * F), e.fillStyle = r.core, e.fill()), t.stroke && (xe(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), d) {
156
- let n = t.r * G;
157
- e.imageSmoothingEnabled = !i.pixelated, e.drawImage(d, t.x - n / 2, t.y - n / 2, n, n);
158
- } else if (f) {
159
- let n = ge(t.letters, i.values && i.values["--corn-map-glyph"]);
154
+ let u = t.icon && a.icons ? a.icons.get(t.icon) : null, d = !u && me(t, r), p = !u && !d && l(t, r) ? ce(t.glyph, n(t, a, o)) : null;
155
+ if (p || (Y(e, t.x, t.y, t.r * N), e.fillStyle = i.core, e.fill()), t.stroke && (xe(e, t.shape, t.x, t.y, Math.max(0, t.r - t.stroke.width / 2)), e.strokeStyle = t.stroke.color, e.lineWidth = t.stroke.width, e.stroke()), u) {
156
+ let n = t.r * W;
157
+ e.imageSmoothingEnabled = !a.pixelated, e.drawImage(u, t.x - n / 2, t.y - n / 2, n, n);
158
+ } else if (d) {
159
+ let n = ge(t.letters, a.values && a.values["--corn-map-glyph"]);
160
160
  if (n) {
161
161
  let r = t.r * 1;
162
162
  e.imageSmoothingEnabled = !0, e.drawImage(n, t.x - r / 2, t.y - r / 2, r, r);
163
163
  }
164
164
  } else if (p) {
165
- let n = t.r * c;
165
+ let n = t.r * f;
166
166
  e.imageSmoothingEnabled = !0, e.drawImage(p, t.x - n / 2, t.y - n / 2, n, n);
167
167
  }
168
168
  e.restore();
169
169
  }
170
170
  function Fe(e, t = {}) {
171
- let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
171
+ let n = t.mapStyle || (() => I), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c = null, l = null, u = () => {
172
172
  if (s) return s;
173
173
  try {
174
174
  s = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e.width || 1, e.height || 1) : e.ownerDocument ? e.ownerDocument.createElement("canvas") : null, c = s && s.getContext ? s.getContext("2d") : null;
@@ -188,9 +188,9 @@ function Fe(e, t = {}) {
188
188
  i = t, a = n, o = u, e.width = t * u, e.height = n * u, r.setTransform(u, 0, 0, u, 0, 0), l = null, s && (s.width = e.width, s.height = e.height, c.setTransform(u, 0, 0, u, 0, 0));
189
189
  },
190
190
  draw(t, f, h) {
191
- let g = n(), _ = ae(t, g);
191
+ let g = n(), _ = K(t, g);
192
192
  r.clearRect(0, 0, i, a);
193
- let v = M(z(_.theme), g), y = Ne(_, f, i, a);
193
+ let v = A(L(_.theme), g), y = Ne(_, f, i, a);
194
194
  if (p(_) && y.length > d && u()) {
195
195
  l && l.scene === _ && l.x === f.x && l.y === f.y && l.zoom === f.zoom && l.w === e.width && l.h === e.height || ((s.width !== e.width || s.height !== e.height) && (s.width = e.width, s.height = e.height), c.setTransform(o, 0, 0, o, 0, 0), c.clearRect(0, 0, i, a), m(c, _, f), l = {
196
196
  scene: _,
@@ -364,7 +364,7 @@ var Ke = 1, qe = .3, Je = .58, Ye = 3, Xe = 100, X = 64, Z = {
364
364
  hub: 5,
365
365
  rest: 6,
366
366
  greyed: 7
367
- }, Ze = 1.5, Qe = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, $e = (e) => Qe(e.labelMin), et = (e) => k.includes(e.type) && !e.greyed, tt = (e, t) => e.selected ? Z.selected : e.current ? Z.current : e.match ? Z.match : t && e.connected ? Z.lit : e.mark && e.mark !== "none" || e.labelKeep && !et(e) ? Z.marked : e.greyed ? Z.greyed : et(e) ? Z.hub : Z.rest;
367
+ }, Ze = 1.5, Qe = (e) => Number.isFinite(e) && e >= 9 ? Math.max(11, e) : 11, $e = (e) => Qe(e.labelMin), et = (e) => ee.includes(e.type) && !e.greyed, tt = (e, t) => e.selected ? Z.selected : e.current ? Z.current : e.match ? Z.match : t && e.connected ? Z.lit : e.mark && e.mark !== "none" || e.labelKeep && !et(e) ? Z.marked : e.greyed ? Z.greyed : et(e) ? Z.hub : Z.rest;
368
368
  function nt(e, t, n = {}) {
369
369
  let { measure: r = null } = n, i = $e(e), a = e.nodes.some((e) => e.selected || !e.connected), o = [];
370
370
  e.nodes.forEach((e, t) => {
@@ -406,8 +406,8 @@ function nt(e, t, n = {}) {
406
406
  b: y
407
407
  };
408
408
  l.push(E);
409
- let D = Math.floor(g / X), O = Math.floor(_ / X), k = Math.floor(v / X), A = Math.floor(y / X);
410
- for (let e = D; e <= O; e++) for (let t = k; t <= A; t++) {
409
+ let D = Math.floor(g / X), O = Math.floor(_ / X), ee = Math.floor(v / X), te = Math.floor(y / X);
410
+ for (let e = D; e <= O; e++) for (let t = ee; t <= te; t++) {
411
411
  let n = c(e, t), r = s.get(n);
412
412
  r ? r.push(E) : s.set(n, [E]);
413
413
  }
@@ -415,7 +415,7 @@ function nt(e, t, n = {}) {
415
415
  return l;
416
416
  }
417
417
  function rt(e, t, n, r = {}) {
418
- let { max: i = 400, margin: a = 32, measure: o = null, hover: s = null } = r, c = [], l = e.labelOutline || z(e.theme).labelOutline;
418
+ let { max: i = 400, margin: a = 32, measure: o = null, hover: s = null } = r, c = [], l = e.labelOutline || L(e.theme).labelOutline;
419
419
  for (let t of e.decor.lanes) for (let n of [
420
420
  t.title,
421
421
  t.note,
@@ -577,7 +577,7 @@ function lt(e, t, n, r) {
577
577
  return i ? i.id : null;
578
578
  }
579
579
  function ut(e, t = {}) {
580
- let n = t.mapStyle || (() => L), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v = I, y = (e, t, n) => {
580
+ let n = t.mapStyle || (() => I), r = e.getContext("2d"), i = 0, a = 0, o = 1, s = null, c, l, u, d, f, p, m = null, h = !0, g = !1, _ = /* @__PURE__ */ new Map(), v = P, y = (e, t, n) => {
581
581
  let i = `${n ? "b" : "n"}${t}|${v}|${e}`, a = _.get(i);
582
582
  return a === void 0 && (_.size > 2e4 && _.clear(), r.font = it({
583
583
  italic: !1,
@@ -603,7 +603,7 @@ function ut(e, t = {}) {
603
603
  if (!h && e === s && e.version === c && t.x === l && t.y === u && t.zoom === d && x === f && S === p) return !1;
604
604
  let C = m && e === s && e.version === c && t.zoom === d && x === f && !h;
605
605
  s = e, c = e.version, l = t.x, u = t.y, d = t.zoom, f = x, p = S, h = !1;
606
- let w = ae(e, b);
606
+ let w = K(e, b);
607
607
  v = w.labelFont || "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", r.setTransform(o, 0, 0, o, 0, 0), r.clearRect(0, 0, i, a), r.save(), r.translate(t.x, t.y), r.scale(t.zoom, t.zoom), C || (m = nt(w, t.zoom, { measure: y }));
608
608
  let T = rt(w, t, {
609
609
  width: i,
@@ -643,65 +643,65 @@ var dt = [
643
643
  "touchmove",
644
644
  "keydown"
645
645
  ];
646
- function ft(e, n = {}) {
646
+ function ft(e, t = {}) {
647
647
  if (e.map) return e.map;
648
- let { state: i } = e, a = n.measureCovered || (() => i.coveredBottom || 0), o = te(e).get, s = !1, c = (e) => B(i, e), l = (e) => B(i, e, { viewer: !0 }), u = (t, n = e.viewEdges(), a = {
649
- throughChildren: !!i.throughChildren,
650
- kind: i.selectedKind || null
651
- }) => r(t, n, a), d = se((n) => t(n, { reduceMotion: e.reducedMotion })), f = () => d.get(i), p = () => d.builds, m = ze(), h = () => m.get(f()), g = () => m.builds, _ = null, v = null;
648
+ let { state: n } = e, i = t.measureCovered || (() => n.coveredBottom || 0), o = ne(e).get, s = !1, c = (e) => z(n, e), l = (e) => z(n, e, { viewer: !0 }), u = (t, r = e.viewEdges(), i = {
649
+ throughChildren: !!n.throughChildren,
650
+ kind: n.selectedKind || null
651
+ }) => a(t, r, i), d = oe((t) => r(t, { reduceMotion: e.reducedMotion })), f = () => d.get(n), p = () => d.builds, m = ze(), h = () => m.get(f()), g = () => m.builds, _ = null, v = null;
652
652
  function y() {
653
- return _ && v === i.canvas || (_ && _.destroy(), _ = Fe(i.canvas, { mapStyle: o }), v = i.canvas, i.width && _.resize(i.width, i.height, e.dpr())), _;
653
+ return _ && v === n.canvas || (_ && _.destroy(), _ = Fe(n.canvas, { mapStyle: o }), v = n.canvas, n.width && _.resize(n.width, n.height, e.dpr())), _;
654
654
  }
655
655
  let b = null, x = null;
656
656
  function S() {
657
- return i.labelCanvas ? (b && x === i.labelCanvas || (b && b.destroy(), b = ut(i.labelCanvas, { mapStyle: o }), x = i.labelCanvas, i.width && b.resize(i.width, i.height, e.dpr())), b) : null;
657
+ return n.labelCanvas ? (b && x === n.labelCanvas || (b && b.destroy(), b = ut(n.labelCanvas, { mapStyle: o }), x = n.labelCanvas, n.width && b.resize(n.width, n.height, e.dpr())), b) : null;
658
658
  }
659
659
  function C(t) {
660
- _ && _ !== t && _.destroy(), _ = t, v = i.canvas, i.width && _.resize(i.width, i.height, e.dpr()), U();
660
+ _ && _ !== t && _.destroy(), _ = t, v = n.canvas, n.width && _.resize(n.width, n.height, e.dpr()), H();
661
661
  }
662
662
  function w() {
663
- let { canvas: t } = i, n = `${i.width}x${i.height}`;
664
- i.width = t.parentElement.clientWidth, i.height = t.parentElement.clientHeight, y().resize(i.width, i.height, e.dpr());
665
- let r = S();
666
- r && r.resize(i.width, i.height, e.dpr()), n !== `${i.width}x${i.height}` && E(), U();
663
+ let { canvas: t } = n, r = `${n.width}x${n.height}`;
664
+ n.width = t.parentElement.clientWidth, n.height = t.parentElement.clientHeight, y().resize(n.width, n.height, e.dpr());
665
+ let i = S();
666
+ i && i.resize(n.width, n.height, e.dpr()), r !== `${n.width}x${n.height}` && E(), H();
667
667
  }
668
668
  let T = e.slot("fit", () => ({
669
669
  lastFit: null,
670
670
  waiting: null
671
671
  }));
672
672
  function E() {
673
- if (!i.width || !i.height) return;
673
+ if (!n.width || !n.height) return;
674
674
  if (T.waiting) {
675
675
  let { padding: e, only: t } = T.waiting;
676
- N(e === null ? P() : e, t);
676
+ j(e === null ? M() : e, t);
677
677
  return;
678
678
  }
679
- let { camera: e } = i, t = T.lastFit;
680
- t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && N(t.auto ? P() : t.padding, t.only);
679
+ let { camera: e } = n, t = T.lastFit;
680
+ t && e.x === t.x && e.y === t.y && e.zoom === t.zoom && j(t.auto ? M() : t.padding, t.only);
681
681
  }
682
682
  function D() {
683
- let t = i.canvas && i.canvas.parentElement, n = e.win && e.win.ResizeObserver;
684
- if (!t || !n) return () => {};
685
- let r = new n(() => {
686
- i.canvas && (t.clientWidth !== i.width || t.clientHeight !== i.height) && w();
683
+ let t = n.canvas && n.canvas.parentElement, r = e.win && e.win.ResizeObserver;
684
+ if (!t || !r) return () => {};
685
+ let i = new r(() => {
686
+ n.canvas && (t.clientWidth !== n.width || t.clientHeight !== n.height) && w();
687
687
  });
688
- r.observe(t);
689
- let a = () => r.disconnect();
688
+ i.observe(t);
689
+ let a = () => i.disconnect();
690
690
  return e.own(a), a;
691
691
  }
692
692
  function O(e, t = null) {
693
- let { nodes: n, width: r, height: o } = i, s = n.filter(c);
693
+ let { nodes: r, width: a, height: o } = n, s = r.filter(c);
694
694
  if (t) {
695
695
  let e = s.filter((e) => t.has(e.id));
696
696
  e.length && (s = e);
697
697
  }
698
698
  if (s.length === 0) return null;
699
- let l = Math.max(160, o - a()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
699
+ let l = Math.max(160, o - i()), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
700
700
  s.forEach((e) => {
701
701
  let t = e.r || 18;
702
702
  u = Math.min(u, e.x - t - 25), d = Math.max(d, e.x + t + 25), f = Math.min(f, e.y - t - 25), p = Math.max(p, e.y + t + 35);
703
- }), i.view === "dataflow" && i.flow && (f = Math.min(f, i.flow.top - 10)), i.view === "house" && i.house && i.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = i.house.fit);
704
- let m = Math.max(160, r - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
703
+ }), n.view === "dataflow" && n.flow && (f = Math.min(f, n.flow.top - 10)), n.view === "house" && n.house && n.house.fit && !t && ({minX: u, maxX: d, minY: f, maxY: p} = n.house.fit);
704
+ let m = Math.max(160, a - e * 2), h = Math.max(160, l - e * 2), g = Math.min(m / (d - u), h / (p - f));
705
705
  return {
706
706
  minX: u,
707
707
  maxX: d,
@@ -711,21 +711,21 @@ function ft(e, n = {}) {
711
711
  raw: g
712
712
  };
713
713
  }
714
- let k = "", j = oe;
715
- function M() {
716
- let e = `${i.sceneVersion}|${i.width}|${i.height}|${i.view}|${a()}`;
717
- if (e !== k) {
718
- k = e;
719
- let t = O(P());
720
- j = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(A, Math.min(oe, t.raw)) : oe;
714
+ let ee = "", k = ae;
715
+ function A() {
716
+ let e = `${n.sceneVersion}|${n.width}|${n.height}|${n.view}|${i()}`;
717
+ if (e !== ee) {
718
+ ee = e;
719
+ let t = O(M());
720
+ k = t && t.raw > 0 && Number.isFinite(t.raw) ? Math.max(te, Math.min(ae, t.raw)) : ae;
721
721
  }
722
- return j;
722
+ return k;
723
723
  }
724
- function N(e = 40, t = null) {
725
- let { width: n, height: r, camera: a } = i;
726
- if (!n || !r) {
727
- i.nodes.length && (T.waiting = {
728
- padding: e === P() ? null : e,
724
+ function j(e = 40, t = null) {
725
+ let { width: r, height: i, camera: a } = n;
726
+ if (!r || !i) {
727
+ n.nodes.length && (T.waiting = {
728
+ padding: e === M() ? null : e,
729
729
  only: t
730
730
  });
731
731
  return;
@@ -733,80 +733,80 @@ function ft(e, n = {}) {
733
733
  T.waiting = null;
734
734
  let o = O(e, t);
735
735
  if (!o) return;
736
- let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(A, o.raw));
737
- a.zoom = f, a.x = n / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, T.lastFit = {
736
+ let { minX: s, maxX: c, minY: l, maxY: u, mapHeight: d } = o, f = Math.min(1, Math.max(te, o.raw));
737
+ a.zoom = f, a.x = r / 2 - (s + c) / 2 * f, a.y = d / 2 - (l + u) / 2 * f, T.lastFit = {
738
738
  padding: e,
739
- auto: e === P(),
739
+ auto: e === M(),
740
740
  only: t,
741
741
  x: a.x,
742
742
  y: a.y,
743
743
  zoom: a.zoom
744
- }, U();
745
- }
746
- let P = () => i.width < 640 ? 24 : 48, ee = (e, t) => ({
747
- x: (e - i.camera.x) / i.camera.zoom,
748
- y: (t - i.camera.y) / i.camera.zoom
749
- }), F = -1;
750
- function I() {
751
- if (!i.canvas) return;
744
+ }, H();
745
+ }
746
+ let M = () => n.width < 640 ? 24 : 48, N = (e, t) => ({
747
+ x: (e - n.camera.x) / n.camera.zoom,
748
+ y: (t - n.camera.y) / n.camera.zoom
749
+ }), P = -1;
750
+ function F() {
751
+ if (!n.canvas) return;
752
752
  let e = f();
753
- F = e.version, y().draw(e, i.camera, performance.now());
753
+ P = e.version, y().draw(e, n.camera, performance.now());
754
754
  let t = S();
755
- t && t.draw(e, i.camera, { hover: i.hoverNodeId }), z.forEach((t) => t(e, i.camera));
755
+ t && t.draw(e, n.camera, { hover: n.hoverNodeId }), R.forEach((t) => t(e, n.camera));
756
756
  }
757
- function L(e, t) {
757
+ function I(e, t) {
758
758
  let n = S();
759
759
  return n ? n.hit(e, t) : null;
760
760
  }
761
- function R(e) {
761
+ function L(e) {
762
762
  let t = e || null;
763
- if (i.hoverNodeId === t) return;
764
- i.hoverNodeId = t;
765
- let n = S();
766
- n && i.canvas && i.width && n.draw(f(), i.camera, { hover: t });
763
+ if (n.hoverNodeId === t) return;
764
+ n.hoverNodeId = t;
765
+ let r = S();
766
+ r && n.canvas && n.width && r.draw(f(), n.camera, { hover: t });
767
767
  }
768
- let z = /* @__PURE__ */ new Set(), ne = (e) => (z.add(e), () => z.delete(e)), V = /* @__PURE__ */ new Set(), H = Ge({
769
- draw: I,
770
- packetsVisible: () => !!i.canvas && He(f(), i.camera, i.width, i.height),
768
+ let R = /* @__PURE__ */ new Set(), re = (e) => (R.add(e), () => R.delete(e)), B = /* @__PURE__ */ new Set(), V = Ge({
769
+ draw: F,
770
+ packetsVisible: () => !!n.canvas && He(f(), n.camera, n.width, n.height),
771
771
  isHidden: () => e.hidden(),
772
772
  tickClients: (e) => {
773
773
  let t = !1;
774
- return V.forEach((n) => {
774
+ return B.forEach((n) => {
775
775
  n.tick(e), n.wants() && (t = !0);
776
776
  }), t;
777
777
  },
778
- clientsWant: () => [...V].some((e) => e.wants()),
778
+ clientsWant: () => [...B].some((e) => e.wants()),
779
779
  reduceMotion: () => e.reducedMotion,
780
- extraDirty: () => i.sceneVersion !== F,
780
+ extraDirty: () => n.sceneVersion !== P,
781
781
  now: () => performance.now(),
782
782
  raf: (e) => requestAnimationFrame(e),
783
783
  caf: (e) => cancelAnimationFrame(e)
784
784
  });
785
- function U() {
786
- !s && i.canvas && H.markDirty();
785
+ function H() {
786
+ !s && n.canvas && V.markDirty();
787
787
  }
788
- function W() {
789
- !s && i.canvas && H.drawNow();
788
+ function U() {
789
+ !s && n.canvas && V.drawNow();
790
790
  }
791
- function re(e) {
792
- return V.add(e), () => V.delete(e);
791
+ function W(e) {
792
+ return B.add(e), () => B.delete(e);
793
793
  }
794
794
  let G = [];
795
795
  if (e.root) {
796
- let t = () => H.noteInput();
796
+ let t = () => V.noteInput();
797
797
  for (let n of dt) G.push(e.listen(e.root, n, t, {
798
798
  passive: !0,
799
799
  capture: !0
800
800
  }));
801
801
  }
802
- G.push(e.onShown(() => H.shown())), G.push(e.onShown(() => {
803
- let e = i.canvas && i.canvas.parentElement;
804
- !s && e && e.clientWidth && e.clientHeight && (e.clientWidth !== i.width || e.clientHeight !== i.height) && w();
802
+ G.push(e.onShown(() => V.shown())), G.push(e.onShown(() => {
803
+ let e = n.canvas && n.canvas.parentElement;
804
+ !s && e && e.clientWidth && e.clientHeight && (e.clientWidth !== n.width || e.clientHeight !== n.height) && w();
805
805
  }));
806
806
  function ie() {
807
807
  s = !0;
808
808
  for (let e of G.splice(0)) e();
809
- e.map === K && (e.map = null), H.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), z.clear(), V.clear();
809
+ e.map === K && (e.map = null), V.cancel(), _ && (_.release ? _.release() : _.destroy(), _ = null, v = null), b && (b.destroy(), b = null, x = null), R.clear(), B.clear();
810
810
  }
811
811
  let K = {
812
812
  isNodeVisible: c,
@@ -820,29 +820,29 @@ function ft(e, n = {}) {
820
820
  setRenderer: C,
821
821
  resize: w,
822
822
  watchSize: D,
823
- getMinZoom: M,
824
- fitGraphToViewport: N,
825
- fitPadding: P,
826
- screenToWorld: ee,
827
- labelNodeAt: L,
828
- setHoverNode: R,
829
- onPaint: ne,
830
- render: U,
831
- renderNow: W,
832
- addFrameClient: re,
823
+ getMinZoom: A,
824
+ fitGraphToViewport: j,
825
+ fitPadding: M,
826
+ screenToWorld: N,
827
+ labelNodeAt: I,
828
+ setHoverNode: L,
829
+ onPaint: re,
830
+ render: H,
831
+ renderNow: U,
832
+ addFrameClient: W,
833
833
  queueFrameWork: (e, t) => {
834
- s || H.queue(e, t);
834
+ s || V.queue(e, t);
835
835
  },
836
836
  frameStats: () => ({
837
- frames: H.frames,
838
- draws: H.draws
837
+ frames: V.frames,
838
+ draws: V.draws
839
839
  }),
840
840
  holdFrames: (e) => {
841
- s || H.hold(e);
841
+ s || V.hold(e);
842
842
  },
843
- cancelFrame: () => H.cancel(),
843
+ cancelFrame: () => V.cancel(),
844
844
  ensureFlowLoop: () => {
845
- s || H.wake();
845
+ s || V.wake();
846
846
  },
847
847
  destroy: ie
848
848
  };
@@ -951,25 +951,25 @@ function ht(e, t) {
951
951
  }
952
952
  function gt(t, { placeLive: n } = {}) {
953
953
  let { state: r } = t;
954
- _(t), r.view === "dataflow" && r.flow ? (r.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
954
+ v(t), r.view === "dataflow" && r.flow ? (r.flow.tiers.forEach((e) => e.nodes.forEach((e) => {
955
955
  e.r = Math.min(e.r, 13);
956
- })), r.proposal && r.baseNodes && vt(t) || e(t, r.flow)) : r.baseNodes && (r.proposal || r.nodes.some((e) => e.live)) ? yt(t, n) : P(t);
956
+ })), r.proposal && r.baseNodes && vt(t) || e(t, r.flow)) : r.baseNodes && (r.proposal || r.nodes.some((e) => e.live)) ? yt(t, n) : M(t);
957
957
  }
958
- function _t(e, t, n) {
959
- let { state: r } = e;
960
- r.mapNodes = t, r.mapEdges = n, r.nodes = t, r.edges = n, r.flow = pt(t, n), m(r.flow), e.touchScene(), gt(e);
958
+ function _t(e, n, r) {
959
+ let { state: i } = e;
960
+ i.mapNodes = n, i.mapEdges = r, i.nodes = n, i.edges = r, i.flow = pt(n, r), t(i.flow), e.touchScene(), gt(e);
961
961
  }
962
962
  function vt(t) {
963
963
  let { state: n } = t, r = {
964
964
  nodes: n.nodes,
965
965
  edges: n.edges
966
966
  }, i = n.baseNodes.map((e) => ({ ...e }));
967
- n.nodes = i, n.edges = n.baseEdges, _(t);
967
+ n.nodes = i, n.edges = n.baseEdges, v(t);
968
968
  let a = pt(i, n.baseEdges);
969
969
  a.tiers.forEach((e) => e.nodes.forEach((e) => {
970
970
  e.r = Math.min(e.r, 13);
971
971
  })), e(t, a), n.nodes = r.nodes, n.edges = r.edges;
972
- let o = h(n.flow, a);
972
+ let o = R(n.flow, a);
973
973
  return t.touchScene(), o;
974
974
  }
975
975
  function yt(e, t) {
@@ -977,12 +977,12 @@ function yt(e, t) {
977
977
  nodes: n.nodes,
978
978
  edges: n.edges
979
979
  }, i = n.baseNodes.map((e) => ({ ...e }));
980
- n.nodes = i, n.edges = n.baseEdges, _(e), P(e);
980
+ n.nodes = i, n.edges = n.baseEdges, v(e), M(e);
981
981
  let a = new Map(i.map((e) => [e.id, e]));
982
- n.nodes = r.nodes, n.edges = r.edges, _(e), n.nodes.forEach((e) => {
982
+ n.nodes = r.nodes, n.edges = r.edges, v(e), n.nodes.forEach((e) => {
983
983
  let t = a.get(e.id);
984
984
  t && (e.x = t.x, e.y = t.y, e.r = t.r);
985
- }), g(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
985
+ }), _(n.nodes, n.edges), t && t(n.nodes, n.edges), e.touchScene();
986
986
  }
987
987
  // ../explorer/shaders.js
988
988
  var Q = "#version 300 es\nprecision highp float;\nuniform vec2 u_viewport;\nuniform vec3 u_cam;\nuniform float u_dpr;\n", bt = "\nvec4 toClip(vec2 pos) {\n return vec4(pos.x / u_viewport.x * 2.0 - 1.0, 1.0 - pos.y / u_viewport.y * 2.0, 0.0, 1.0);\n}\n", xt = "\nout vec4 outColor;\n\n// Coverage of one device pixel by the half plane d < 0 (d: signed distance in CSS px, pix: the pixel's size)\nfloat coverEdge(float d, float pix) {\n return clamp(0.5 - d / pix, 0.0, 1.0);\n}\n\n// Coverage of one pixel by a band of half width hw around dist = 0 (dist >= 0: distance from the centre line)\nfloat coverBand(float dist, float hw, float pix) {\n float hi = min(hw, dist + 0.5 * pix);\n float lo = max(-hw, dist - 0.5 * pix);\n return clamp((hi - lo) / pix, 0.0, 1.0);\n}\n\n// Coverage by a dash pattern along an arc (on / off in world units; on <= 0 or off <= 0 is solid)\nfloat coverDash(float arc, float on, float off, float pixWorld) {\n if (on <= 0.0 || off <= 0.0) return 1.0;\n float period = on + off;\n float u = mod(arc - on * 0.5 + period * 0.5, period) - period * 0.5;\n return clamp((on * 0.5 - abs(u)) / pixWorld + 0.5, 0.0, 1.0);\n}\n\n// Straight colour at alpha a, composited over acc (premultiplied)\nvoid over(inout vec4 acc, vec3 rgb, float a) {\n acc = vec4(rgb * a, a) + acc * (1.0 - a);\n}\n\n// What Canvas 2D's shadowBlur gives a disc of radius R at distance len from its centre: a blurred copy\n// of the disc. s is the blur's sigma in CSS px (shadowBlur is in DEVICE px and sigma = blur / 2). A big\n// disc has a straight-edge profile (a logistic stands in for the Gaussian's CDF); a small one is a\n// Gaussian bump whose height is what the blur leaves of it.\nfloat glowDisc(float len, float R, float s) {\n float wide = 1.0 / (1.0 + exp(clamp(1.702 * (len - R) / s, -30.0, 30.0)));\n float narrow = (1.0 - exp(-R * R / (2.0 * s * s))) * exp(-len * len / (2.0 * s * s));\n return mix(narrow, wide, smoothstep(0.5 * s, 2.5 * s, R));\n}\n\n// The normal distribution's CDF, as the same logistic (error under 0.01)\nfloat phi(float x) {\n return 1.0 / (1.0 + exp(clamp(-1.702 * x, -30.0, 30.0)));\n}\n", St = `${Q}
@@ -1455,14 +1455,14 @@ void main() {
1455
1455
  bar: 4,
1456
1456
  diamond: 5,
1457
1457
  tick: 6
1458
- }, Ht = Object.freeze(Object.fromEntries(b.map((e, t) => [e, t]))), Ut = {
1458
+ }, Ht = Object.freeze(Object.fromEntries(F.map((e, t) => [e, t]))), Ut = {
1459
1459
  none: 0,
1460
1460
  added: 1,
1461
1461
  changed: 2,
1462
1462
  removed: 3,
1463
1463
  edit: 4
1464
1464
  }, $ = (e) => {
1465
- let [t, n, r, i] = R(e);
1465
+ let [t, n, r, i] = c(e);
1466
1466
  return [
1467
1467
  t / 255,
1468
1468
  n / 255,
@@ -1595,9 +1595,9 @@ function qt(e) {
1595
1595
  ]);
1596
1596
  }
1597
1597
  if (e.ticks) {
1598
- let a = y(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1598
+ let a = x(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1599
1599
  for (let o = 0; o < e.ticks; o++) {
1600
- let u = (o - (e.ticks - 1) / 2) * V.tickGap;
1600
+ let u = (o - (e.ticks - 1) / 2) * B.tickGap;
1601
1601
  t.tips.push([
1602
1602
  a.x + c * u,
1603
1603
  a.y + l * u,
@@ -1612,7 +1612,7 @@ function qt(e) {
1612
1612
  }
1613
1613
  }
1614
1614
  if (e.mark === "removed") {
1615
- let a = y(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1615
+ let a = x(e, .5), o = Math.hypot(e.x2 - e.x1, e.y2 - e.y1), [c, l] = o > 0 ? [(e.x2 - e.x1) / o, (e.y2 - e.y1) / o] : [1, 0];
1616
1616
  t.tips.push([
1617
1617
  a.x,
1618
1618
  a.y,
@@ -1694,46 +1694,46 @@ function Yt(e) {
1694
1694
  stride: 10
1695
1695
  };
1696
1696
  }
1697
- function Xt(e, t, n = null) {
1698
- let r = /* @__PURE__ */ new Map();
1699
- e.nodes.forEach((i) => {
1700
- let a = i.icon && t(i.icon) ? i.icon : null, o = i.r * G;
1701
- if (!a && !i.icon && i.letters && t(de(i.letters)) && (a = de(i.letters), o = i.r * 1), !a && !i.icon && !i.letters && i.glyph) {
1702
- let r = re(i.glyph, u(i, n, e.theme));
1703
- t(r) && (a = r, o = i.r * c);
1697
+ function Xt(e, t, r = null) {
1698
+ let i = /* @__PURE__ */ new Map();
1699
+ e.nodes.forEach((a) => {
1700
+ let o = a.icon && t(a.icon) ? a.icon : null, s = a.r * W;
1701
+ if (!o && !a.icon && a.letters && t(de(a.letters)) && (o = de(a.letters), s = a.r * 1), !o && !a.icon && !a.letters && a.glyph) {
1702
+ let i = C(a.glyph, n(a, r, e.theme));
1703
+ t(i) && (o = i, s = a.r * f);
1704
1704
  }
1705
- if (!a) return;
1706
- r.has(a) || r.set(a, {
1705
+ if (!o) return;
1706
+ i.has(o) || i.set(o, {
1707
1707
  rows: [],
1708
1708
  minR: Infinity,
1709
1709
  maxR: 0
1710
1710
  });
1711
- let s = r.get(a);
1712
- s.maxR = Math.max(s.maxR, i.r), s.rows.push([
1713
- i.x,
1714
- i.y,
1715
- o,
1716
- i.alpha
1717
- ]), s.minR = Math.min(s.minR, i.r);
1711
+ let c = i.get(o);
1712
+ c.maxR = Math.max(c.maxR, a.r), c.rows.push([
1713
+ a.x,
1714
+ a.y,
1715
+ s,
1716
+ a.alpha
1717
+ ]), c.minR = Math.min(c.minR, a.r);
1718
1718
  });
1719
- let i = [], a = [];
1720
- for (let [e, { rows: t, minR: n, maxR: o }] of r) i.push({
1719
+ let a = [], o = [];
1720
+ for (let [e, { rows: t, minR: n, maxR: r }] of i) a.push({
1721
1721
  kind: e,
1722
- first: a.length,
1722
+ first: o.length,
1723
1723
  count: t.length,
1724
1724
  minR: n,
1725
- maxR: o
1726
- }), a.push(...t);
1727
- let o = new Float32Array(a.length * 4);
1728
- return a.forEach((e, t) => o.set(e, t * 4)), {
1729
- data: o,
1730
- count: a.length,
1725
+ maxR: r
1726
+ }), o.push(...t);
1727
+ let s = new Float32Array(o.length * 4);
1728
+ return o.forEach((e, t) => s.set(e, t * 4)), {
1729
+ data: s,
1730
+ count: o.length,
1731
1731
  stride: 4,
1732
- groups: i
1732
+ groups: a
1733
1733
  };
1734
1734
  }
1735
1735
  function Zt(e = "dark", t = null) {
1736
- let { halo: n, mark: r, core: i } = t ? M(z(e), t) : z(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
1736
+ let { halo: n, mark: r, core: i } = t ? A(L(e), t) : L(e), a = /* @__PURE__ */ new Float32Array(16), o = /* @__PURE__ */ new Float32Array(16), s = /* @__PURE__ */ new Float32Array(16);
1737
1737
  Object.entries(Bt).forEach(([e, t]) => {
1738
1738
  let r = n[e];
1739
1739
  t && r && (a.set($(r.fill), t * 4), o.set($(r.ring), t * 4), s.set([
@@ -1767,7 +1767,7 @@ function Zt(e = "dark", t = null) {
1767
1767
  q.gap
1768
1768
  ]),
1769
1769
  core: new Float32Array($(i)),
1770
- coreRatio: F
1770
+ coreRatio: N
1771
1771
  };
1772
1772
  }
1773
1773
  var Qt = [
@@ -2007,7 +2007,7 @@ var Qt = [
2007
2007
  e.uniform3fv(t("u_markMin"), n.markMin);
2008
2008
  },
2009
2009
  tips(e, t) {
2010
- e.uniform4f(t("u_tip"), N.length, N.spread, W.halfLength, W.width), e.uniform4f(t("u_end"), V.strokeWidth, V.barHalf, V.diamondHalf, V.diamondAcross), e.uniform2f(t("u_tick"), V.tickHalf, V.tickWidth);
2010
+ e.uniform4f(t("u_tip"), j.length, j.spread, U.halfLength, U.width), e.uniform4f(t("u_end"), B.strokeWidth, B.barHalf, B.diamondHalf, B.diamondAcross), e.uniform2f(t("u_tick"), B.tickHalf, B.tickWidth);
2011
2011
  }
2012
2012
  }, en = {
2013
2013
  alpha: !0,
@@ -2132,30 +2132,30 @@ function ln(e, t) {
2132
2132
  function un(e, t = {}) {
2133
2133
  let n = t.gl || e.getContext("webgl2", en);
2134
2134
  if (!n) throw Error("WebGL2 is not available");
2135
- let r = t.mapStyle || (() => L), i = {
2135
+ let r = t.mapStyle || (() => I), i = {
2136
2136
  uploads: 0,
2137
2137
  draws: 0
2138
- }, a = cn(n), s = !1, u = 0, d = 0, f = null, p = null, m, h = null, g = null;
2139
- function _(e) {
2138
+ }, a = cn(n), o = !1, s = 0, c = 0, l = null, u = null, p, m = null, h = null;
2139
+ function g(e) {
2140
2140
  return a.extras[e] || (a.extras[e] = on(n, sn[e], a.corners)), a.extras[e];
2141
2141
  }
2142
- function v() {
2142
+ function _() {
2143
2143
  a.passes.forEach((e) => {
2144
- let t = f[e.spec.name];
2144
+ let t = l[e.spec.name];
2145
2145
  e.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, e.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2146
2146
  });
2147
2147
  for (let e of Object.keys(sn)) {
2148
- let t = f[e];
2148
+ let t = l[e];
2149
2149
  if (!t.count && !a.extras[e]) continue;
2150
- let r = _(e);
2150
+ let r = g(e);
2151
2151
  r.count = t.count, t.count && (n.bindBuffer(n.ARRAY_BUFFER, r.buffer), n.bufferData(n.ARRAY_BUFFER, t.data, n.DYNAMIC_DRAW));
2152
2152
  }
2153
2153
  i.uploads++;
2154
2154
  }
2155
- function y(e, t) {
2155
+ function v(e, t) {
2156
2156
  n.bindTexture(n.TEXTURE_2D, e), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, t ? n.NEAREST : n.LINEAR_MIPMAP_LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, t ? n.NEAREST : n.LINEAR);
2157
2157
  }
2158
- function b(e, t, r) {
2158
+ function y(e, t, r) {
2159
2159
  let i = a.textures.get(e);
2160
2160
  if (!i || i.image !== t) {
2161
2161
  i && n.deleteTexture(i.texture);
@@ -2166,67 +2166,67 @@ function un(e, t = {}) {
2166
2166
  pixelated: null
2167
2167
  }, a.textures.set(e, i);
2168
2168
  }
2169
- return i.pixelated !== r && (y(i.texture, r), i.pixelated = r), i.texture;
2169
+ return i.pixelated !== r && (v(i.texture, r), i.pixelated = r), i.texture;
2170
2170
  }
2171
- function x(t, _, y) {
2172
- if (g = [
2171
+ function b(t, g, v) {
2172
+ if (h = [
2173
2173
  t,
2174
- _,
2175
- y
2176
- ], s || !a || !u || !d) return;
2177
- let x = r(), S = ae(t, x), w = x.values ? x.values[H] : void 0;
2178
- (a.iconStore !== x.icons || a.glyphInk !== w) && (a.textures.forEach(({ texture: e }) => n.deleteTexture(e)), a.textures.clear(), a.iconStore = x.icons, a.glyphInk = w, p = null), h !== x.ground && (h = x.ground, p = null), (S !== p || S.version !== m) && (f = {
2179
- ...Jt(S),
2180
- strokes: Yt(S),
2181
- icons: Xt(S, (e) => fe(e) ? !!ge(pe(e), w) : C(e) ? !!o(l(e).type, l(e).ink) : !!(x.icons && x.icons.get(e)), x)
2182
- }, p = S, m = S.version, v());
2183
- let T = S.theme || "dark";
2184
- (a.theme !== T || a.styleKey !== rn(x)) && an(n, a, T, x), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), a.passes.forEach((t) => {
2185
- t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, u, d), n.uniform3f(t.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(t.uniforms.dpr, e.width / u), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (y || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2174
+ g,
2175
+ v
2176
+ ], o || !a || !s || !c) return;
2177
+ let b = r(), x = K(t, b), S = b.values ? b.values[V] : void 0;
2178
+ (a.iconStore !== b.icons || a.glyphInk !== S) && (a.textures.forEach(({ texture: e }) => n.deleteTexture(e)), a.textures.clear(), a.iconStore = b.icons, a.glyphInk = S, u = null), m !== b.ground && (m = b.ground, u = null), (x !== u || x.version !== p) && (l = {
2179
+ ...Jt(x),
2180
+ strokes: Yt(x),
2181
+ icons: Xt(x, (e) => fe(e) ? !!ge(pe(e), S) : w(e) ? !!ce(d(e).type, d(e).ink) : !!(b.icons && b.icons.get(e)), b)
2182
+ }, u = x, p = x.version, _());
2183
+ let C = x.theme || "dark";
2184
+ (a.theme !== C || a.styleKey !== rn(b)) && an(n, a, C, b), n.viewport(0, 0, e.width, e.height), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, n.ONE_MINUS_SRC_ALPHA), a.passes.forEach((t) => {
2185
+ t.count && (n.useProgram(t.program), n.uniform2f(t.uniforms.viewport, s, c), n.uniform3f(t.uniforms.cam, g.x, g.y, g.zoom), n.uniform1f(t.uniforms.dpr, e.width / s), n.bindVertexArray(t.vao), t.uniforms.time && n.uniform1f(t.uniforms.time, (v || 0) / 1e3), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, t.spec.verts || 4, t.count), i.draws++);
2186
2186
  });
2187
- let E = a.extras.strokes;
2188
- E && E.count && (n.useProgram(E.program), n.uniform2f(E.uniforms.viewport, u, d), n.uniform3f(E.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(E.uniforms.dpr, e.width / u), n.bindVertexArray(E.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, E.count), i.draws++);
2189
- let D = a.extras.icons;
2190
- if (D && D.count) {
2191
- n.useProgram(D.program), n.uniform2f(D.uniforms.viewport, u, d), n.uniform3f(D.uniforms.cam, _.x, _.y, _.zoom), n.uniform1f(D.uniforms.dpr, e.width / u), n.uniform1i(D.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(D.vao), n.bindBuffer(n.ARRAY_BUFFER, D.buffer);
2192
- for (let e of f.icons.groups) {
2193
- let t = fe(e.kind), r = C(e.kind), a = t || r ? 14 : 0;
2194
- if (a && e.maxR * 2 * _.zoom < a) continue;
2195
- n.uniform1f(D.at("u_minR"), a / 2), n.uniform1f(D.at("u_sideRatio"), t ? 1 : r ? c : 1);
2196
- let s = t ? ge(pe(e.kind), x.values && x.values["--corn-map-glyph"]) : r ? o(l(e.kind).type, l(e.kind).ink) : x.icons && x.icons.get(e.kind);
2197
- s && (n.bindTexture(n.TEXTURE_2D, b(e.kind, s, !!x.pixelated && !t && !r)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), i.draws++);
2187
+ let T = a.extras.strokes;
2188
+ T && T.count && (n.useProgram(T.program), n.uniform2f(T.uniforms.viewport, s, c), n.uniform3f(T.uniforms.cam, g.x, g.y, g.zoom), n.uniform1f(T.uniforms.dpr, e.width / s), n.bindVertexArray(T.vao), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, T.count), i.draws++);
2189
+ let E = a.extras.icons;
2190
+ if (E && E.count) {
2191
+ n.useProgram(E.program), n.uniform2f(E.uniforms.viewport, s, c), n.uniform3f(E.uniforms.cam, g.x, g.y, g.zoom), n.uniform1f(E.uniforms.dpr, e.width / s), n.uniform1i(E.at("u_tex"), 0), n.activeTexture(n.TEXTURE0), n.bindVertexArray(E.vao), n.bindBuffer(n.ARRAY_BUFFER, E.buffer);
2192
+ for (let e of l.icons.groups) {
2193
+ let t = fe(e.kind), r = w(e.kind), a = t || r ? 14 : 0;
2194
+ if (a && e.maxR * 2 * g.zoom < a) continue;
2195
+ n.uniform1f(E.at("u_minR"), a / 2), n.uniform1f(E.at("u_sideRatio"), t ? 1 : r ? f : 1);
2196
+ let o = t ? ge(pe(e.kind), b.values && b.values["--corn-map-glyph"]) : r ? ce(d(e.kind).type, d(e.kind).ink) : b.icons && b.icons.get(e.kind);
2197
+ o && (n.bindTexture(n.TEXTURE_2D, y(e.kind, o, !!b.pixelated && !t && !r)), n.vertexAttribPointer(1, 4, n.FLOAT, !1, 16, e.first * 4 * 4), n.drawArraysInstanced(n.TRIANGLE_STRIP, 0, 4, e.count), i.draws++);
2198
2198
  }
2199
2199
  }
2200
2200
  n.bindVertexArray(null);
2201
2201
  }
2202
- let S = (e) => {
2203
- e.preventDefault(), s = !0, a = null;
2204
- }, w = () => {
2202
+ let x = (e) => {
2203
+ e.preventDefault(), o = !0, a = null;
2204
+ }, S = () => {
2205
2205
  try {
2206
- a = cn(n, g && g[0].theme || "dark", r()), s = !1, f && v(), g && x(...g);
2206
+ a = cn(n, h && h[0].theme || "dark", r()), o = !1, l && _(), h && b(...h);
2207
2207
  } catch (e) {
2208
2208
  console.warn("WebGL2 context restored but the renderer could not be rebuilt:", e.message);
2209
2209
  }
2210
2210
  };
2211
- return e.addEventListener("webglcontextlost", S), e.addEventListener("webglcontextrestored", w), {
2211
+ return e.addEventListener("webglcontextlost", x), e.addEventListener("webglcontextrestored", S), {
2212
2212
  kind: "webgl2",
2213
2213
  stats: i,
2214
2214
  resize(t, n, r) {
2215
- u = t, d = n, e.width = Math.round(t * r), e.height = Math.round(n * r), g && x(...g);
2215
+ s = t, c = n, e.width = Math.round(t * r), e.height = Math.round(n * r), h && b(...h);
2216
2216
  },
2217
- draw: x,
2218
- destroy: T,
2217
+ draw: b,
2218
+ destroy: C,
2219
2219
  release() {
2220
- let e = s;
2221
- T();
2220
+ let e = o;
2221
+ C();
2222
2222
  try {
2223
2223
  let t = !e && n.getExtension ? n.getExtension("WEBGL_lose_context") : null;
2224
2224
  t && t.loseContext();
2225
2225
  } catch {}
2226
2226
  }
2227
2227
  };
2228
- function T() {
2229
- e.removeEventListener("webglcontextlost", S), e.removeEventListener("webglcontextrestored", w), a && !s && ln(n, a), a = null, s = !0;
2228
+ function C() {
2229
+ e.removeEventListener("webglcontextlost", x), e.removeEventListener("webglcontextrestored", S), a && !o && ln(n, a), a = null, o = !0;
2230
2230
  }
2231
2231
  }
2232
2232
  // ../explorer/renderer.js
@@ -2268,154 +2268,154 @@ function pn(e, t) {
2268
2268
  }
2269
2269
  // ../explorer/input.js
2270
2270
  function mn(e) {
2271
- let { state: t } = e, { render: r, getSpatialIndex: i, queueFrameWork: a, screenToWorld: o, getMinZoom: s, setHoverNode: c, labelNodeAt: l, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), h = !1, g = null, _ = {
2271
+ let { state: t } = e, { render: n, getSpatialIndex: r, queueFrameWork: a, screenToWorld: o, getMinZoom: s, setHoverNode: c, labelNodeAt: l, fitGraphToViewport: u, fitPadding: d } = e.map, f = (t) => e.emit("select", t), p = () => e.emit("background"), m = () => e.emit("grab"), h = !1, g = null, _ = {
2272
2272
  x: 0,
2273
2273
  y: 0
2274
- }, y = {
2274
+ }, v = {
2275
2275
  x: 0,
2276
2276
  y: 0
2277
- }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, A = !1, j = "", M = () => t.isFreeform && t.view === "orbit";
2278
- function N(e) {
2277
+ }, b = !1, x = null, S = null, C = 0, w = null, T = !1, E = null, D = null, O = null, te = !1, k = "", A = () => t.isFreeform && t.view === "orbit";
2278
+ function j(e) {
2279
2279
  let n = t.canvas.getBoundingClientRect(), r = e.touches ? e.touches[0] : e, i = n.width && t.width ? t.width / n.width : 1, a = n.height && t.height ? t.height / n.height : 1;
2280
2280
  return {
2281
2281
  x: (r.clientX - n.left) * i,
2282
2282
  y: (r.clientY - n.top) * a
2283
2283
  };
2284
2284
  }
2285
- let P = {
2285
+ let M = {
2286
2286
  nodes: null,
2287
2287
  size: -1,
2288
2288
  map: null
2289
2289
  };
2290
- function ee(e) {
2291
- return (P.nodes !== t.nodes || P.size !== t.nodes.length) && (P = {
2290
+ function N(e) {
2291
+ return (M.nodes !== t.nodes || M.size !== t.nodes.length) && (M = {
2292
2292
  nodes: t.nodes,
2293
2293
  size: t.nodes.length,
2294
2294
  map: new Map(t.nodes.map((e) => [e.id, e]))
2295
- }), P.map.get(e) || null;
2295
+ }), M.map.get(e) || null;
2296
2296
  }
2297
- function F(e, n, r) {
2298
- let a = Re(i(), t.camera, e, n, r);
2299
- return a ? ee(a.id) : null;
2297
+ function P(e, n, i) {
2298
+ let a = Re(r(), t.camera, e, n, i);
2299
+ return a ? N(a.id) : null;
2300
2300
  }
2301
- let I = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2302
- function L(e) {
2301
+ let F = (e) => Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY);
2302
+ function I(e) {
2303
2303
  let n = t.canvas.getBoundingClientRect();
2304
2304
  return {
2305
2305
  x: (e.touches[0].clientX + e.touches[1].clientX) / 2 - n.left,
2306
2306
  y: (e.touches[0].clientY + e.touches[1].clientY) / 2 - n.top
2307
2307
  };
2308
2308
  }
2309
- function R(e) {
2309
+ function L(e) {
2310
2310
  if (T = !0, m(), c(null), e.touches && e.touches.length === 2) {
2311
- w = n(t.camera, I(e), L(e)), E = null, h = !1, g = null, x = null;
2311
+ w = i(t.camera, F(e), I(e)), E = null, h = !1, g = null, x = null;
2312
2312
  return;
2313
2313
  }
2314
- let r = !!(e.touches && e.touches.length > 0), i = N(e);
2315
- y = {
2316
- x: i.x,
2317
- y: i.y
2318
- }, b = !1, E = null, x = F(i.x, i.y, r), M() && x ? (g = x, e.cancelable && e.preventDefault()) : (h = !0, _ = i);
2319
- }
2320
- function z() {
2321
- D && w && Object.assign(t.camera, v(w, D.dist, D.mid, s())), D = null;
2314
+ let n = !!(e.touches && e.touches.length > 0), r = j(e);
2315
+ v = {
2316
+ x: r.x,
2317
+ y: r.y
2318
+ }, b = !1, E = null, x = P(r.x, r.y, n), A() && x ? (g = x, e.cancelable && e.preventDefault()) : (h = !0, _ = r);
2319
+ }
2320
+ function R() {
2321
+ D && w && Object.assign(t.camera, y(w, D.dist, D.mid, s())), D = null;
2322
2322
  let n = E;
2323
2323
  if (E = null, n) {
2324
- if (g && M()) {
2324
+ if (g && A()) {
2325
2325
  let r = o(n.x, n.y);
2326
2326
  g.x = r.x, g.y = r.y, t.freeformPositions[g.id] = {
2327
2327
  x: r.x,
2328
2328
  y: r.y
2329
- }, e.touchScene(), K(e);
2329
+ }, e.touchScene(), ie(e);
2330
2330
  } else h && (t.camera.x += n.x - _.x, t.camera.y += n.y - _.y, _ = n);
2331
2331
  }
2332
2332
  }
2333
- function B() {
2333
+ function z() {
2334
2334
  let e = O;
2335
2335
  if (O = null, !e || h || g) return;
2336
- let t = F(e.x, e.y, !1);
2337
- te(!!t), c(t ? t.id : null);
2338
- }
2339
- function te(e) {
2340
- e !== A && t.canvas && (e && (j = t.canvas.style.cursor), A = e, t.canvas.style.cursor = e ? "pointer" : j);
2336
+ let t = P(e.x, e.y, !1);
2337
+ ne(!!t), c(t ? t.id : null);
2341
2338
  }
2342
2339
  function ne(e) {
2340
+ e !== te && t.canvas && (e && (k = t.canvas.style.cursor), te = e, t.canvas.style.cursor = e ? "pointer" : k);
2341
+ }
2342
+ function re(e) {
2343
2343
  if (e.touches && e.touches.length === 2 && w) {
2344
2344
  e.cancelable && e.preventDefault(), D = {
2345
- dist: I(e),
2346
- mid: L(e)
2347
- }, a(z);
2345
+ dist: F(e),
2346
+ mid: I(e)
2347
+ }, a(R);
2348
2348
  return;
2349
2349
  }
2350
- let t = N(e);
2351
- Math.hypot(t.x - y.x, t.y - y.y) > 8 && (b = !0), g && M() || h ? (e.cancelable && e.preventDefault(), E = t, a(z)) : e.touches || (O = t, a(B, { draw: !1 }));
2350
+ let t = j(e);
2351
+ Math.hypot(t.x - v.x, t.y - v.y) > 8 && (b = !0), g && A() || h ? (e.cancelable && e.preventDefault(), E = t, a(R)) : e.touches || (O = t, a(z, { draw: !1 }));
2352
2352
  }
2353
- function V(e) {
2354
- z();
2353
+ function B(e) {
2354
+ R();
2355
2355
  let n = !!(e.changedTouches && e.changedTouches.length > 0), r = t.canvas.getBoundingClientRect(), i = n ? {
2356
2356
  x: e.changedTouches[0].clientX - r.left,
2357
2357
  y: e.changedTouches[0].clientY - r.top
2358
- } : N(e);
2358
+ } : j(e);
2359
2359
  if (!b && T) {
2360
2360
  if (x) {
2361
- let e = F(i.x, i.y, n);
2361
+ let e = P(i.x, i.y, n);
2362
2362
  if (e && e.id === x.id) {
2363
- if (!M()) f(x);
2363
+ if (!A()) f(x);
2364
2364
  else {
2365
2365
  let e = Date.now();
2366
2366
  S && S.id === x.id && e - C < 380 ? (f(x), S = null, C = 0) : (S = x, C = e);
2367
2367
  }
2368
2368
  }
2369
2369
  } else {
2370
- let e = ee(l(i.x, i.y));
2371
- e && k.includes(e.type) && e.id !== "root" ? u(d(), pn(e.id, t.edges)) : t.selectedNode && p();
2370
+ let e = N(l(i.x, i.y));
2371
+ e && ee.includes(e.type) && e.id !== "root" ? u(d(), pn(e.id, t.edges)) : t.selectedNode && p();
2372
2372
  }
2373
2373
  }
2374
2374
  h = !1, g = null, x = null, w = null, D = null, T = !1;
2375
2375
  }
2376
- let { canvas: H } = t, U = !(e.root && e.root.nodeType === 9), W = (n) => {
2377
- if (U && !n.ctrlKey && !n.metaKey && e.active() !== t.canvas) return;
2378
- n.preventDefault(), m();
2379
- let i = N(n);
2380
- Object.assign(t.camera, ce(t.camera, n.deltaY < 0 ? 1.12 : .88, i.x, i.y, s())), r();
2381
- }, re = e.root || H, G = [
2382
- e.listen(H, "mousedown", R),
2383
- e.listen(H, "mousemove", ne),
2384
- e.listen(H, "mouseleave", () => {
2385
- O = null, te(!1), c(null);
2376
+ let { canvas: V } = t, H = !(e.root && e.root.nodeType === 9), U = (r) => {
2377
+ if (H && !r.ctrlKey && !r.metaKey && e.active() !== t.canvas) return;
2378
+ r.preventDefault(), m();
2379
+ let i = j(r);
2380
+ Object.assign(t.camera, se(t.camera, r.deltaY < 0 ? 1.12 : .88, i.x, i.y, s())), n();
2381
+ }, W = e.root || V, G = [
2382
+ e.listen(V, "mousedown", L),
2383
+ e.listen(V, "mousemove", re),
2384
+ e.listen(V, "mouseleave", () => {
2385
+ O = null, ne(!1), c(null);
2386
2386
  }),
2387
- e.listen(re, "mouseup", V),
2388
- e.listen(H, "touchstart", R, { passive: !1 }),
2389
- e.listen(H, "touchmove", ne, { passive: !1 }),
2390
- e.listen(re, "touchend", V, { passive: !1 }),
2391
- e.listen(re, "touchcancel", V, { passive: !1 }),
2392
- e.listen(H, "wheel", W, { passive: !1 })
2387
+ e.listen(W, "mouseup", B),
2388
+ e.listen(V, "touchstart", L, { passive: !1 }),
2389
+ e.listen(V, "touchmove", re, { passive: !1 }),
2390
+ e.listen(W, "touchend", B, { passive: !1 }),
2391
+ e.listen(W, "touchcancel", B, { passive: !1 }),
2392
+ e.listen(V, "wheel", U, { passive: !1 })
2393
2393
  ];
2394
2394
  return () => G.forEach((e) => e());
2395
2395
  }
2396
2396
  // ../explorer/pieces/map.js
2397
2397
  var hn = "Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. F frames the selected node and what it lights. Escape clears the selection.", gn = "<canvas id=\"graph-canvas\" data-corn=\"map-canvas\" tabindex=\"0\" role=\"application\" aria-roledescription=\"map\" aria-label=\"Topology map\" aria-describedby=\"map-keys-help\"></canvas>", _n = ({ keysHelp: e = hn } = {}) => ({ stage: `${gn}
2398
- <p id="map-keys-help" class="hx-sr-only">${d(e)}</p>
2398
+ <p id="map-keys-help" class="hx-sr-only">${p(e)}</p>
2399
2399
  <p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
2400
2400
  <canvas id="label-canvas" data-corn="label-canvas" aria-hidden="true"></canvas>` });
2401
2401
  function vn(e, t, n) {
2402
- let r = a(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2402
+ let r = s(t, e, "<div data-corn=\"map-stage\"></div>", null, "stage"), i = n.mountStatus(r[0], t, { follow: !1 });
2403
2403
  i.refuse("second-map"), t.emit("piece:refused", {
2404
2404
  piece: "map",
2405
2405
  reason: "second-map",
2406
2406
  message: "A scope holds one map.",
2407
2407
  host: e.nodeType === 11 ? e.host : e
2408
2408
  });
2409
- let o = () => {};
2409
+ let a = () => {};
2410
2410
  return {
2411
2411
  inst: t,
2412
2412
  refused: !0,
2413
2413
  selection: () => null,
2414
- update: o,
2415
- fit: o,
2416
- refresh: o,
2414
+ update: a,
2415
+ fit: a,
2416
+ refresh: a,
2417
2417
  focusNode: () => !1,
2418
- applyTheme: o,
2418
+ applyTheme: a,
2419
2419
  destroy() {
2420
2420
  i.destroy();
2421
2421
  for (let e of r) e.remove();
@@ -2431,7 +2431,7 @@ function bn(e, t, n = {}) {
2431
2431
  }
2432
2432
  function xn(e, t) {
2433
2433
  let n = e.nodeType === 11 ? e.host : e, r = {}, i = null, a = !1;
2434
- return import("./scope-CqPbHcKL.js").then((e) => e.n).then(({ mountScope: o }) => {
2434
+ return import("./scope-2m2VmJXn.js").then((e) => e.n).then(({ mountScope: o }) => {
2435
2435
  if (a) return;
2436
2436
  let s = o(n, {
2437
2437
  src: t.src,
@@ -2483,82 +2483,82 @@ function xn(e, t) {
2483
2483
  };
2484
2484
  }
2485
2485
  function Sn(e, t, n, r) {
2486
- let o = !t;
2487
- o && (t = p({
2486
+ let i = !t;
2487
+ i && (t = g({
2488
2488
  root: e,
2489
2489
  base: n.base || "",
2490
2490
  fetch: n.fetch,
2491
2491
  strings: n.strings
2492
2492
  }));
2493
- let c = S(t), l = () => {};
2494
- if (c) try {
2495
- l = t.attach(e);
2493
+ let a = T(t), c = () => {};
2494
+ if (a) try {
2495
+ c = t.attach(e);
2496
2496
  } catch {
2497
- return r && r.destroy(), vn(e, t, c);
2497
+ return r && r.destroy(), vn(e, t, a);
2498
2498
  }
2499
- let { state: u } = t, d = c ? c.source : null;
2499
+ let { state: l } = t, d = a ? a.source : null;
2500
2500
  if (n.tokens) {
2501
2501
  let t = yn(e);
2502
- t && s(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && s(t, n.tokens);
2502
+ t && u(t.nodeType === 9 ? t : t.ownerDocument, n.tokens), t && t.nodeType === 11 && u(t, n.tokens);
2503
2503
  }
2504
- let f = i(t);
2505
- f.own(l), r && f.own(() => r.destroy());
2506
- let m = (e) => e === "canvas2d" ? "canvas2d" : "auto", h = (e) => e === "light" || e === "dark" ? e : "auto", g = {
2507
- renderer: m(n.renderer),
2508
- theme: h(n.theme),
2504
+ let f = o(t);
2505
+ f.own(c), r && f.own(() => r.destroy()), a && f.on("map:set", ({ nodes: e, edges: n }) => (_t(t, e, n), !0));
2506
+ let p = (e) => e === "canvas2d" ? "canvas2d" : "auto", m = (e) => e === "light" || e === "dark" ? e : "auto", h = {
2507
+ renderer: p(n.renderer),
2508
+ theme: m(n.theme),
2509
2509
  topology: void 0
2510
- }, _ = n.topology !== void 0 && n.topology !== null, v = !1, y = !1, b = _n({ keysHelp: n.keysHelp }).stage, x = n.slots && n.slots.stage ? n.slots : null, C = a(t, e, x ? b : `<div data-corn="map-stage">${b}</div>`, x, "stage"), T = (e) => C.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2510
+ }, _ = n.topology !== void 0 && n.topology !== null, v = !1, y = !1, x = _n({ keysHelp: n.keysHelp }).stage, S = n.slots && n.slots.stage ? n.slots : null, C = s(t, e, S ? x : `<div data-corn="map-stage">${x}</div>`, S, "stage"), w = (e) => C.map((t) => t.matches(e) ? t : t.querySelector(e)).find(Boolean);
2511
2511
  f.own(() => {
2512
- for (let e of [...C, u.canvas]) e && e.remove();
2512
+ for (let e of [...C, l.canvas]) e && e.remove();
2513
2513
  });
2514
- let D = T("#map-announcer");
2515
- if (D) {
2516
- let e = O(t, D);
2514
+ let ee = w("#map-announcer");
2515
+ if (ee) {
2516
+ let e = O(t, ee);
2517
2517
  f.on("announce:write", (t) => (e(t), !0));
2518
2518
  }
2519
- let k = C.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2520
- if (d && k) {
2521
- let e = c.mountStatus(k, t, {
2519
+ let te = C.find((e) => e.matches("[data-corn=\"map-stage\"]")) || null;
2520
+ if (d && te) {
2521
+ let e = a.mountStatus(te, t, {
2522
2522
  onRetry: () => d.load(),
2523
2523
  focusMap: () => {
2524
- u.canvas && u.canvas.focus();
2524
+ l.canvas && l.canvas.focus();
2525
2525
  }
2526
2526
  });
2527
2527
  f.own(e.destroy);
2528
2528
  }
2529
- u.canvas = T("[data-corn=\"map-canvas\"]"), u.labelCanvas = T("[data-corn=\"label-canvas\"]"), u.ctx = t.doc.createElement("canvas").getContext("2d");
2530
- let A = ft(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), j = te(t);
2531
- f.own(j.watch()), f.own(j.onChange(() => A.render()));
2532
- let M = () => g.renderer === "canvas2d" ? "canvas2d" : null, N = () => A.setRenderer(fn(u.canvas, {
2533
- prefer: M(),
2534
- mapStyle: j.get
2535
- })), P = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2536
- function F() {
2537
- if (g.theme === "light" || g.theme === "dark") return g.theme;
2538
- if (c && (c.theme === "light" || c.theme === "dark")) return c.theme;
2529
+ l.canvas = w("[data-corn=\"map-canvas\"]"), l.labelCanvas = w("[data-corn=\"label-canvas\"]"), l.ctx = t.doc.createElement("canvas").getContext("2d");
2530
+ let k = ft(t, n.measureCovered ? { measureCovered: n.measureCovered } : {}), A = ne(t);
2531
+ f.own(A.watch()), f.own(A.onChange(() => k.render()));
2532
+ let j = () => h.renderer === "canvas2d" ? "canvas2d" : null, M = () => k.setRenderer(fn(l.canvas, {
2533
+ prefer: j(),
2534
+ mapStyle: A.get
2535
+ })), N = t.win && t.win.matchMedia ? t.win.matchMedia("(prefers-color-scheme: light)") : null;
2536
+ function P() {
2537
+ if (h.theme === "light" || h.theme === "dark") return h.theme;
2538
+ if (a && (a.theme === "light" || a.theme === "dark")) return a.theme;
2539
2539
  let e = t.doc && t.doc.documentElement, n = e ? e.getAttribute("data-theme") : null;
2540
- return n === "light" || n === "dark" ? n : ee("system", !!(P && P.matches));
2540
+ return n === "light" || n === "dark" ? n : b("system", !!(N && N.matches));
2541
2541
  }
2542
- function I() {
2542
+ function F() {
2543
2543
  if (v) return;
2544
- let e = F();
2545
- j.refresh(), u.theme !== e && (u.theme = e, t.touchScene()), A.render();
2544
+ let e = P();
2545
+ A.refresh(), l.theme !== e && (l.theme = e, t.touchScene()), k.render();
2546
2546
  }
2547
- u.theme = F(), c && f.own(c.serverTheme.adopt(e)), c && (f.on("theme", () => I()), f.on("scope:theme", () => I())), P && P.addEventListener && (P.addEventListener("change", I), f.own(() => P.removeEventListener("change", I)));
2548
- let L = t.win && t.win.MutationObserver;
2549
- if (L && t.doc && t.doc.documentElement) {
2550
- let e = new L(I);
2547
+ l.theme = P(), a && f.own(a.serverTheme.adopt(e)), a && (f.on("theme", () => F()), f.on("scope:theme", () => F())), N && N.addEventListener && (N.addEventListener("change", F), f.own(() => N.removeEventListener("change", F)));
2548
+ let I = t.win && t.win.MutationObserver;
2549
+ if (I && t.doc && t.doc.documentElement) {
2550
+ let e = new I(F);
2551
2551
  e.observe(t.doc.documentElement, {
2552
2552
  attributes: !0,
2553
2553
  attributeFilter: ["data-theme", "class"]
2554
2554
  }), f.own(() => e.disconnect());
2555
2555
  }
2556
- N();
2557
- let R = () => gt(t), z = () => {
2558
- u.nodes.length && A.fitGraphToViewport(A.fitPadding());
2559
- }, B = (e) => u.nodes.find((t) => t.id === e) || null, V = null;
2560
- f.on("select", (e) => ie(t, e, { source: "tap" })), f.on("background", () => U(t, { source: "tap" })), f.on("grab", () => ne(t)), f.on("selection", ({ node: e, edge: t, source: r }) => {
2561
- v || ((e || t) && (V = null), n.onSelect && (e ? n.onSelect({
2556
+ M();
2557
+ let L = () => gt(t), R = () => {
2558
+ l.nodes.length && k.fitGraphToViewport(k.fitPadding());
2559
+ }, z = (e) => l.nodes.find((t) => t.id === e) || null, B = null;
2560
+ f.on("select", (e) => G(t, e, { source: "tap" })), f.on("background", () => H(t, { source: "tap" })), f.on("grab", () => re(t)), f.on("selection", ({ node: e, edge: t, source: r }) => {
2561
+ v || ((e || t) && (B = null), n.onSelect && (e ? n.onSelect({
2562
2562
  id: e.id,
2563
2563
  kind: "node",
2564
2564
  source: r
@@ -2574,100 +2574,100 @@ function Sn(e, t, n, r) {
2574
2574
  source: r
2575
2575
  })));
2576
2576
  });
2577
- function H(e) {
2578
- let n = B(String(e));
2579
- return !n || v ? !1 : (ie(t, n, {
2577
+ function V(e) {
2578
+ let n = z(String(e));
2579
+ return !n || v ? !1 : (G(t, n, {
2580
2580
  frame: !0,
2581
2581
  source: "api"
2582
2582
  }), !0);
2583
2583
  }
2584
- let W = () => {}, re = !!t.root && t.root.nodeType === 9;
2585
- function G() {
2586
- let e = u.canvas, n = [mn(t)];
2587
- re || n.push(t.listen(e, "pointerdown", (t) => {
2584
+ let U = () => {}, W = !!t.root && t.root.nodeType === 9;
2585
+ function ie() {
2586
+ let e = l.canvas, n = [mn(t)];
2587
+ W || n.push(t.listen(e, "pointerdown", (t) => {
2588
2588
  if (t.pointerType === "mouse" && e.setPointerCapture) try {
2589
2589
  e.setPointerCapture(t.pointerId);
2590
2590
  } catch {}
2591
- })), w(t), E(t), n.push(() => w(t)), W = () => n.forEach((e) => e());
2591
+ })), E(t), D(t), n.push(() => E(t)), U = () => n.forEach((e) => e());
2592
2592
  }
2593
- f.own(A.onPaint(() => {
2594
- !y && u.nodes.length && (y = !0, n.onReady && n.onReady());
2595
- })), G(), f.own(() => W());
2593
+ f.own(k.onPaint(() => {
2594
+ !y && l.nodes.length && (y = !0, n.onReady && n.onReady());
2595
+ })), ie(), f.own(() => U());
2596
2596
  let K = () => {
2597
- !_ && d && d.topology && d.topology !== g.topology && (g.topology = d.topology, ae(d.topology));
2597
+ !_ && d && d.topology && d.topology !== h.topology && (h.topology = d.topology, q(d.topology));
2598
2598
  };
2599
2599
  d && f.on("source", (e) => {
2600
2600
  e.state === "ready" && K();
2601
- }), f.own(A.watchSize()), A.resize();
2602
- function ae(e) {
2603
- let n = u.selectedNode ? u.selectedNode.id : null;
2601
+ }), f.own(k.watchSize()), k.resize();
2602
+ function q(e) {
2603
+ let n = l.selectedNode ? l.selectedNode.id : null;
2604
2604
  ht(t, e);
2605
- let r = n ? B(n) : null;
2606
- u.nodes.length && (R(), z());
2607
- let i = !r && V ? B(V) : null;
2608
- i && ie(t, i, { source: "api" }), A.render(), A.ensureFlowLoop();
2605
+ let r = n ? z(n) : null;
2606
+ l.nodes.length && (L(), R());
2607
+ let i = !r && B ? z(B) : null;
2608
+ i && G(t, i, { source: "api" }), k.render(), k.ensureFlowLoop(), t.emit("map:topology");
2609
2609
  }
2610
- function q(e) {
2610
+ function ae(e) {
2611
2611
  let n = e === "dataflow" ? "dataflow" : "orbit";
2612
- u.view !== n && (u.view = n, t.touchScene(), u.nodes.length && (R(), z(), A.ensureFlowLoop()));
2612
+ l.view !== n && (l.view = n, t.touchScene(), l.nodes.length && (L(), R(), k.ensureFlowLoop()));
2613
2613
  }
2614
2614
  function oe() {
2615
- let e = A.getRenderer();
2616
- e.release ? e.release() : e.destroy(), W();
2615
+ let e = k.getRenderer();
2616
+ e.release ? e.release() : e.destroy(), U();
2617
2617
  let n = t.doc.createElement("template");
2618
2618
  n.innerHTML = gn;
2619
2619
  let r = n.content.firstElementChild;
2620
2620
  r.setAttribute("part", "map-canvas");
2621
- let i = t.active() === u.canvas;
2622
- u.canvas.replaceWith(r), u.canvas = r, G(), N(), A.resize(), i && r.focus();
2621
+ let i = t.active() === l.canvas;
2622
+ l.canvas.replaceWith(r), l.canvas = r, ie(), M(), k.resize(), i && r.focus(), t.emit("map:canvas");
2623
2623
  }
2624
2624
  function se(e = {}) {
2625
2625
  if (!v) {
2626
2626
  if ("renderer" in e) {
2627
- let t = m(e.renderer);
2628
- t !== g.renderer && (g.renderer = t, oe());
2627
+ let t = p(e.renderer);
2628
+ t !== h.renderer && (h.renderer = t, oe());
2629
2629
  }
2630
2630
  if ("theme" in e) {
2631
- let t = h(e.theme);
2632
- t !== g.theme && (g.theme = t, I());
2631
+ let t = m(e.theme);
2632
+ t !== h.theme && (h.theme = t, F());
2633
2633
  }
2634
- if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== g.topology ? (g.topology = e.topology, ae(e.topology)) : !_ && d && d.topology ? (g.topology = void 0, K()) : !_ && e.topology !== g.topology && (g.topology = e.topology, ae(e.topology))), "view" in e && q(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2634
+ if ("topology" in e && (_ = e.topology !== void 0 && e.topology !== null, _ && e.topology !== h.topology ? (h.topology = e.topology, q(e.topology)) : !_ && d && d.topology ? (h.topology = void 0, K()) : !_ && e.topology !== h.topology && (h.topology = e.topology, q(e.topology))), "view" in e && ae(e.view === "dataflow" ? "dataflow" : "orbit"), "node" in e) {
2635
2635
  let n = e.node == null || e.node === "" ? null : String(e.node);
2636
- if (n === null) V = null, (u.selectedNode || u.selectedEdge) && U(t, { source: "api" });
2636
+ if (n === null) B = null, (l.selectedNode || l.selectedEdge) && H(t, { source: "api" });
2637
2637
  else {
2638
- let e = B(n);
2639
- e ? u.selectedNode && u.selectedNode.id === n || ie(t, e, { source: "api" }) : V = n;
2638
+ let e = z(n);
2639
+ e ? l.selectedNode && l.selectedNode.id === n || G(t, e, { source: "api" }) : B = n;
2640
2640
  }
2641
2641
  }
2642
2642
  }
2643
2643
  }
2644
- function ce() {
2645
- v || (v = !0, f.destroy(), A.destroy(), o && t.destroy());
2644
+ function J() {
2645
+ v || (v = !0, f.destroy(), k.destroy(), i && t.destroy());
2646
2646
  }
2647
- let J = {};
2647
+ let ce = {};
2648
2648
  for (let e of [
2649
2649
  "topology",
2650
2650
  "view",
2651
2651
  "node"
2652
- ]) n[e] !== void 0 && (J[e] = n[e]);
2653
- return se(J), K(), I(), f.own(() => t.emit("map:gone")), t.emit("map:ready"), {
2652
+ ]) n[e] !== void 0 && (ce[e] = n[e]);
2653
+ return se(ce), K(), F(), f.own(() => t.emit("map:gone")), t.emit("map:ready"), {
2654
2654
  inst: t,
2655
- map: A,
2655
+ map: k,
2656
2656
  selection() {
2657
- return u.selectedNode ? {
2658
- id: u.selectedNode.id,
2657
+ return l.selectedNode ? {
2658
+ id: l.selectedNode.id,
2659
2659
  kind: "node"
2660
- } : u.selectedEdge ? {
2661
- id: `${u.selectedEdge.from}->${u.selectedEdge.to}`,
2660
+ } : l.selectedEdge ? {
2661
+ id: `${l.selectedEdge.from}->${l.selectedEdge.to}`,
2662
2662
  kind: "edge"
2663
2663
  } : null;
2664
2664
  },
2665
2665
  update: se,
2666
- destroy: ce,
2667
- fit: z,
2668
- focusNode: H,
2669
- refresh: I,
2670
- applyTheme: (e) => j.applyTheme(e)
2666
+ destroy: J,
2667
+ fit: R,
2668
+ focusNode: V,
2669
+ refresh: F,
2670
+ applyTheme: (e) => A.applyTheme(e)
2671
2671
  };
2672
2672
  }
2673
2673
  export { ht as i, gt as n, _t as r, bn as t };