@genome-spy/app 1.1.1 → 1.2.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 (45) hide show
  1. package/dist/{agentApi-sPuuT0KS.js → agentApi-8hMSlqAQ.js} +8307 -6861
  2. package/dist/agentApi.es.js +5569 -4250
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-Bd8H8MMo.js} +149 -134
  5. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-D6VYooRf.js} +136 -122
  6. package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
  7. package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
  8. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CRJSc4bM.js} +24 -31
  9. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-aEVmYmkA.js} +24 -31
  10. package/dist/{debug-DbigmdrK.js → debug-CQ0agCrd.js} +9 -9
  11. package/dist/{debug-BlqDxTw3.js → debug-DkIMiGdW.js} +10 -10
  12. package/dist/index.es.js +3582 -3566
  13. package/dist/index.js +698 -454
  14. package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
  15. package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
  16. package/dist/markUtils-CvLDz744.js +75 -0
  17. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  18. package/dist/{order-B4uR9Q04.js → order-BVvkjDRT.js} +369 -316
  19. package/dist/{order-BSPy5DI8.js → order-DmMoZsi1.js} +360 -308
  20. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-DxvowWjH.js} +3 -3
  21. package/dist/{rasterExport-B62RmAK1.js → rasterExport-jeRVq6kY.js} +4 -4
  22. package/dist/{rasterization-B05bDo5e.js → rasterization-DFj3Cvx4.js} +26 -19
  23. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  24. package/dist/rectangle-Dl4Dy0hS.js +191 -0
  25. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Bfm1NHFu.js} +96 -91
  26. package/dist/{renderCanvas2D-ChdoHGrU.js → renderCanvas2D-DVjhp834.js} +98 -93
  27. package/dist/{scalePosition-ByvlXaML.js → scalePosition-0aeqp_kz.js} +8 -1
  28. package/dist/schema.json +27198 -13709
  29. package/dist/style.css +1 -1
  30. package/dist/{svg-N3tj05-e.js → svg-Bm2zxBPu.js} +315 -316
  31. package/dist/{svg-DHsq1RpV.js → svg-CkfuhONt.js} +290 -291
  32. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-DoRQEqFA.js} +2 -2
  33. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-raDDhBF-.js} +3 -3
  34. package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
  35. package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
  36. package/dist/viewError-BkJeVYXA.js +33 -0
  37. package/dist/viewError-IYqyluc7.js +33 -0
  38. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-7LyasQN-.js} +498 -434
  39. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-CbmkSQRT.js} +549 -485
  40. package/dist/{viewUtils-JX6CMEYH.js → viewUtils-DuddMNNw.js} +2138 -2009
  41. package/dist/{webgl-Dw8xqZpX.js → webgl-CQfvgnxo.js} +1229 -1140
  42. package/dist/{webgl-DdmOwEH0.js → webgl-DVYkXtiZ.js} +1477 -1389
  43. package/package.json +4 -4
  44. package/src/spec/view.d.ts +44 -5
  45. package/dist/viewError-BiR9VCgL.js +0 -29
@@ -1,15 +1,15 @@
1
- import { $ as e, Jt as t, b as n, nn as r, pn as i } from "./clipOptions-B5PibDq3.js";
2
- import { a } from "./rasterization-B05bDo5e.js";
3
- import { t as o } from "./rectangle-DE98gIxF.js";
1
+ import { $ as e, Tn as t, et as n, mn as r, on as i, p as a } from "./clipOptions-DElJ8dTZ.js";
2
+ import { a as o } from "./rasterization-DFj3Cvx4.js";
3
+ import { c as s, l as c, t as l } from "./rectangle-Dl4Dy0hS.js";
4
4
  //#region ../core/src/rendering/immediate/markData.js
5
- var s = [], c = class {
5
+ var u = [], d = ["x", "y"], f = class {
6
6
  #e = {
7
7
  x: 0,
8
8
  y: 0,
9
9
  width: 0,
10
10
  height: 0
11
11
  };
12
- #t = new o(() => this.#e.x, () => this.#e.y, () => this.#e.width, () => this.#e.height);
12
+ #t = new l(() => this.#e.x, () => this.#e.y, () => this.#e.width, () => this.#e.height);
13
13
  #n;
14
14
  #r = 0;
15
15
  #i = 0;
@@ -33,22 +33,35 @@ var s = [], c = class {
33
33
  this.#e.y = this.#r + e * n * this.#i, this.#e.height = t * n * this.#i;
34
34
  }
35
35
  };
36
- function l(e, t) {
36
+ function p(e, t) {
37
37
  let n = e.unitView.getCollector();
38
38
  if (!n) throw Error(`Cannot render an uninitialized mark. View: ${e.unitView.getPathString()}`);
39
39
  let r = n.facetBatches.get(void 0);
40
- return r?.length ? r : n.facetBatches.get(t.facetId) ?? s;
41
- }
42
- function u(e, t, n, r, i, a) {
43
- let o = l(e, t);
44
- if (t.sampleFacetRenderingOptions) i(r.resolveFacet(n, t.sampleFacetRenderingOptions), o);
45
- else if (e.encoders.facetIndex) for (let [s, c] of d(e.encoders.facetIndex, o)) {
46
- let e = r.resolvePlacement(n, t.placement?.source, s);
47
- e ? i(e, c) : a(s);
40
+ return r?.length ? r : n.facetBatches.get(t.facetId) ?? u;
41
+ }
42
+ function m(e, t, n, r, i, a) {
43
+ let o = p(e, t);
44
+ if (t.sampleFacetRenderingOptions) {
45
+ let a = r.resolveFacet(n, t.sampleFacetRenderingOptions);
46
+ h(e, a) && i(a, o);
47
+ } else if (e.encoders.facetIndex) for (let [s, c] of g(e.encoders.facetIndex, o)) {
48
+ let o = r.resolvePlacement(n, t.placement?.source, s);
49
+ o ? h(e, o) && i(o, c) : a(s);
48
50
  }
49
- else i(n, o);
51
+ else h(e, n) && i(n, o);
52
+ }
53
+ function h(e, t) {
54
+ if (e.properties.clamp && t.height <= 0) return !1;
55
+ for (let n of d) {
56
+ let r = e.encoders[n]?.scale;
57
+ if (r && "gapMapping" in r) {
58
+ let e = n === "x" ? t.width : t.height;
59
+ if (r.gapMapping(e)?.fits === !1) return !1;
60
+ }
61
+ }
62
+ return !0;
50
63
  }
51
- function d(e, t) {
64
+ function g(e, t) {
52
65
  let n = /* @__PURE__ */ new Map();
53
66
  for (let r of t) {
54
67
  let t = +e(r), i = n.get(t);
@@ -58,7 +71,7 @@ function d(e, t) {
58
71
  }
59
72
  //#endregion
60
73
  //#region ../core/src/rendering/immediate/bounds.js
61
- function f(e, t, n) {
74
+ function _(e, t, n) {
62
75
  return {
63
76
  x1: n?.clipX ? Math.max(0, n.rect.x) : 0,
64
77
  y1: n?.clipY ? Math.max(0, n.rect.y) : 0,
@@ -66,7 +79,7 @@ function f(e, t, n) {
66
79
  y2: n?.clipY ? Math.min(t, n.rect.y2) : t
67
80
  };
68
81
  }
69
- function p(e, t, n) {
82
+ function v(e, t, n) {
70
83
  let r = n === !0 || n === "x", i = n === !0 || n === "y";
71
84
  return {
72
85
  x1: r ? t?.clipX ? t.rect.x : e.x : -Infinity,
@@ -75,19 +88,19 @@ function p(e, t, n) {
75
88
  y2: i ? t?.clipY ? t.rect.y2 : e.y2 : Infinity
76
89
  };
77
90
  }
78
- function m(e) {
91
+ function y(e) {
79
92
  return e.x1 <= e.x2 && e.y1 <= e.y2;
80
93
  }
81
- function h(e, t, n) {
94
+ function b(e, t, n) {
82
95
  return t < e.x1 || t > e.x2 || n < e.y1 || n > e.y2;
83
96
  }
84
- function g(e, t, n, r, i, a = 0) {
97
+ function x(e, t, n, r, i, a = 0) {
85
98
  return !(Math.max(t, r) + a < e.x1 || Math.min(t, r) - a > e.x2 || Math.max(n, i) + a < e.y1 || Math.min(n, i) - a > e.y2);
86
99
  }
87
100
  //#endregion
88
101
  //#region ../core/src/rendering/immediate/geometry/polygonUnion.js
89
- var _ = 1e-8;
90
- function v(e) {
102
+ var S = 1e-8;
103
+ function C(e) {
91
104
  let t = e.flatMap((e, t) => e.map((n, r) => ({
92
105
  a: n,
93
106
  b: e[(r + 1) % e.length],
@@ -95,55 +108,55 @@ function v(e) {
95
108
  }))), n = [];
96
109
  for (let r of t) {
97
110
  let i = [0, 1];
98
- for (let e of t) r.polygonIndex != e.polygonIndex && y(r, e, i);
111
+ for (let e of t) r.polygonIndex != e.polygonIndex && w(r, e, i);
99
112
  i.sort((e, t) => e - t);
100
113
  for (let t = 0; t < i.length - 1; t++) {
101
114
  let a = i[t], o = i[t + 1];
102
- if (o - a <= _) continue;
103
- let s = T(r.a, r.b, a), c = T(r.a, r.b, o), l = T(s, c, .5);
104
- e.some((e, t) => t != r.polygonIndex && C(l, e)) || n.push({
115
+ if (o - a <= S) continue;
116
+ let s = A(r.a, r.b, a), c = A(r.a, r.b, o), l = A(s, c, .5);
117
+ e.some((e, t) => t != r.polygonIndex && O(l, e)) || n.push({
105
118
  a: s,
106
119
  b: c,
107
120
  polygonIndex: r.polygonIndex
108
121
  });
109
122
  }
110
123
  }
111
- return S(x(n));
124
+ return D(E(n));
112
125
  }
113
- function y(e, t, n) {
114
- let r = D(e.b, e.a), i = D(t.b, t.a), a = D(t.a, e.a), o = k(r, i);
115
- if (Math.abs(o) > _) {
116
- let e = k(a, i) / o, t = k(a, r) / o;
117
- e > _ && e < .99999999 && t >= -1e-8 && t <= 1.00000001 && n.push(e);
118
- } else Math.abs(k(a, r)) <= _ && (b(e, t.a, n), b(e, t.b, n));
126
+ function w(e, t, n) {
127
+ let r = M(e.b, e.a), i = M(t.b, t.a), a = M(t.a, e.a), o = P(r, i);
128
+ if (Math.abs(o) > S) {
129
+ let e = P(a, i) / o, t = P(a, r) / o;
130
+ e > S && e < .99999999 && t >= -1e-8 && t <= 1.00000001 && n.push(e);
131
+ } else Math.abs(P(a, r)) <= S && (T(e, t.a, n), T(e, t.b, n));
119
132
  }
120
- function b(e, t, n) {
121
- let r = D(e.b, e.a), i = O(r, r), a = O(D(t, e.a), r) / i;
122
- a > _ && a < .99999999 && n.push(a);
133
+ function T(e, t, n) {
134
+ let r = M(e.b, e.a), i = N(r, r), a = N(M(t, e.a), r) / i;
135
+ a > S && a < .99999999 && n.push(a);
123
136
  }
124
- function x(e) {
137
+ function E(e) {
125
138
  let t = /* @__PURE__ */ new Map();
126
139
  for (let n of e) {
127
- let e = E(n.a) + ":" + E(n.b), r = E(n.b) + ":" + E(n.a);
140
+ let e = j(n.a) + ":" + j(n.b), r = j(n.b) + ":" + j(n.a);
128
141
  t.has(r) ? t.delete(r) : t.has(e) || t.set(e, n);
129
142
  }
130
143
  return Array.from(t.values());
131
144
  }
132
- function S(e) {
145
+ function D(e) {
133
146
  let t = /* @__PURE__ */ new Map();
134
147
  for (let n of e) {
135
- let e = E(n.a), r = t.get(e) ?? [];
148
+ let e = j(n.a), r = t.get(e) ?? [];
136
149
  r.push(n), t.set(e, r);
137
150
  }
138
151
  let n = new Set(e), r = [];
139
152
  for (; n.size;) {
140
153
  let e = n.values().next().value, i = [e.a], a = e;
141
154
  for (;;) {
142
- if (n.delete(a), i.push(a.b), E(a.b) == E(i[0])) {
155
+ if (n.delete(a), i.push(a.b), j(a.b) == j(i[0])) {
143
156
  i.pop();
144
157
  break;
145
158
  }
146
- let e = (t.get(E(a.b)) ?? []).find((e) => n.has(e));
159
+ let e = (t.get(j(a.b)) ?? []).find((e) => n.has(e));
147
160
  if (!e) throw Error("Cannot chain SVG polygon union boundary.");
148
161
  a = e;
149
162
  }
@@ -151,131 +164,133 @@ function S(e) {
151
164
  }
152
165
  return r;
153
166
  }
154
- function C(e, t) {
167
+ function O(e, t) {
155
168
  let n = !1;
156
169
  for (let r = 0, i = t.length - 1; r < t.length; i = r++) {
157
170
  let a = t[i], o = t[r];
158
- if (w(e, a, o)) return !1;
171
+ if (k(e, a, o)) return !1;
159
172
  a.y > e.y != o.y > e.y && e.x < (o.x - a.x) * (e.y - a.y) / (o.y - a.y) + a.x && (n = !n);
160
173
  }
161
174
  return n;
162
175
  }
163
- function w(e, t, n) {
164
- return Math.abs(k(D(e, t), D(n, t))) <= _ && O(D(e, t), D(e, n)) <= _;
176
+ function k(e, t, n) {
177
+ return Math.abs(P(M(e, t), M(n, t))) <= S && N(M(e, t), M(e, n)) <= S;
165
178
  }
166
- function T(e, t, n) {
179
+ function A(e, t, n) {
167
180
  return {
168
181
  x: e.x + (t.x - e.x) * n,
169
182
  y: e.y + (t.y - e.y) * n
170
183
  };
171
184
  }
172
- function E(e) {
173
- return `${Math.round(e.x / _)},${Math.round(e.y / _)}`;
185
+ function j(e) {
186
+ return `${Math.round(e.x / S)},${Math.round(e.y / S)}`;
174
187
  }
175
- function D(e, t) {
188
+ function M(e, t) {
176
189
  return {
177
190
  x: e.x - t.x,
178
191
  y: e.y - t.y
179
192
  };
180
193
  }
181
- function O(e, t) {
194
+ function N(e, t) {
182
195
  return e.x * t.x + e.y * t.y;
183
196
  }
184
- function k(e, t) {
197
+ function P(e, t) {
185
198
  return e.x * t.y - e.y * t.x;
186
199
  }
187
200
  //#endregion
188
201
  //#region ../core/src/rendering/immediate/markEncoding.js
189
- function A(e, t, n) {
190
- return e.x + t * e.width + n;
191
- }
192
- function j(e, t, n) {
193
- return e.y + (1 - t) * e.height + n;
194
- }
195
- function M(e, t, n, r = [0, 0]) {
196
- return F(e, t.x, t.x2, t.xOffset, t.x2Offset, n, A, r);
197
- }
198
- function N(e, t, n, r = [0, 0]) {
199
- return F(e, t.y, t.y2, t.yOffset, t.y2Offset, n, j, r);
200
- }
201
- function P(e, t, n, r) {
202
- let i = t[n], a = t[n + "2"], o = t[n + "Offset"], s = t[n + "2Offset"], c = n == "x" ? e.width : e.height, l = n == "x" ? e.x : e.y + c, u = n == "x" ? c : -c, d = R(i), f = a ? R(a) : 0, p = i.constant ? I(i, r) + d : 0, m = a?.constant ? I(a, r) + f : 0, h = o.constant ? I(o, r) : 0, g = a && s?.constant ? I(s, r) : 0;
202
+ function F(e, t, r, i, a = !1) {
203
+ let o = t[r], s = t[r + "2"], c = t[r + "Offset"], l = t[r + "2Offset"], u = r == "x" ? e.width : e.height, d = r == "x" ? e.x : e.y + u, f = r == "x" ? u : -u, p = r == "x" ? e.x : e.y, m = p + u, h = R(o), g = s ? R(s) : 0, _ = R(c), v = l ? R(l) : 0, y = L(o, u, s), b = s && L(s, u, o), x = o.constant && !y ? I(o, i) + h : 0, S = s?.constant && !b ? I(s, i) + g : 0, C = c.constant ? I(c, i) + _ : 0, w = s && l?.constant ? I(l, i) + v : 0;
203
204
  return (e, t) => {
204
- let n = o.constant ? h : I(o, e), r = i.constant ? p : I(i, e) + d, c = l + r * u + n, _ = c;
205
- if (a) {
206
- let t = a.constant ? m : I(a, e) + f, r = s ? s.constant ? g : I(s, e) : n;
207
- _ = l + t * u + r;
205
+ let r = c.constant ? C : I(c, e) + _, i = y ? y(e) : o.constant ? x : I(o, e) + h, u = d + i * f + r, T = u;
206
+ if (s) {
207
+ let t = b ? b(e) : s.constant ? S : I(s, e) + g, n = l ? l.constant ? w : I(l, e) + v : r;
208
+ T = d + t * f + n;
208
209
  }
209
- return t[0] = c, t[1] = _, t;
210
+ return t[0] = a ? n(u, p, m) : u, t[1] = a ? n(T, p, m) : T, t;
210
211
  };
211
212
  }
212
- function F(e, t, n, r, i, a, o, s) {
213
- let c = I(r, a), l = o(e, L(t, a), c), u = n ? o(e, L(n, a), i ? I(i, a) : c) : l;
214
- return s[0] = l, s[1] = u, s;
215
- }
216
213
  function I(e, t) {
217
214
  return e(t);
218
215
  }
219
- function L(e, t) {
220
- return I(e, t) + R(e);
216
+ function L(e, t, n) {
217
+ let r = e.scale;
218
+ if (!r || !("gapMapping" in r)) return;
219
+ let i = r.gapMapping(t);
220
+ if (!i) return;
221
+ let a = e.branches[0].accessor, o = a.channelDef, c = n && s(e.channelDef) && n.branches[0].accessor, l = c ? 0 : .5, u = "band" in o ? o.band ?? l : l;
222
+ return (e) => {
223
+ let t = Number(a(e)), n = !!c && t > Number(c(e));
224
+ return i.position(t, u, n);
225
+ };
221
226
  }
222
227
  function R(e) {
223
228
  let t = e.scale;
224
229
  if (!t) return 0;
225
230
  let n = e.channelDef, r = n && "band" in n ? n.band ?? .5 : .5;
226
- return a(t, r);
231
+ return o(t, r);
227
232
  }
228
233
  function z(e, t) {
229
- return V(e(t));
234
+ return H(e(t));
230
235
  }
231
236
  function B(e, t) {
232
- return n(t) ? e.unitView.paramRuntime.evaluateAndGet(t.expr) : t;
237
+ let n = t.start ?? 0;
238
+ if (!e.constant || n === (t.end ?? t.data.length)) return;
239
+ let r = e.branches[0].accessor, i = r.channelDef, o = "value" in i ? i.value : "datum" in i ? i.datum : i;
240
+ if (a(o)) {
241
+ let e = r;
242
+ if (!/^[$A-Z_a-z][$\w]*(?:\s*\.\s*[$A-Z_a-z][$\w]*)*(?:\s*\|\|\s*(?:"(?:[^"\\]|\\.)*"|null))?$/.test(o.expr.trim()) || !e.dependencies?.every((e) => e.batchStable)) return;
243
+ }
244
+ return H(e(t.data[n]));
245
+ }
246
+ function V(e, t) {
247
+ return a(t) ? e.unitView.paramRuntime.evaluateAndGet(t) : t;
233
248
  }
234
- function V(e) {
249
+ function H(e) {
235
250
  return e == null ? "none" : "" + e;
236
251
  }
237
252
  //#endregion
238
253
  //#region ../core/src/rendering/immediate/marks/arrow.js
239
- function H(e) {
240
- let t = e.properties, n = B(e, t.headSpacing);
254
+ function ee(e) {
255
+ let t = e.properties, n = V(e, t.headSpacing);
241
256
  return {
242
- configuredRHeadSlope: ce(B(e, t.headAngle)),
243
- configuredRHeadNotchSlope: ce(B(e, t.headNotchAngle)),
244
- headShape: B(e, t.headShape),
245
- headWidth: B(e, t.headWidth),
246
- minSize: B(e, t.minSize),
247
- stem: B(e, t.stem),
248
- startNotch: B(e, t.startNotch),
249
- minStemLength: B(e, t.minStemLength),
257
+ configuredRHeadSlope: le(V(e, t.headAngle)),
258
+ configuredRHeadNotchSlope: le(V(e, t.headNotchAngle)),
259
+ headShape: V(e, t.headShape),
260
+ headWidth: V(e, t.headWidth),
261
+ minSize: V(e, t.minSize),
262
+ stem: V(e, t.stem),
263
+ startNotch: V(e, t.startNotch),
264
+ minStemLength: V(e, t.minStemLength),
250
265
  headSpacing: n,
251
266
  repeatHeads: n != null && n >= 0,
252
- headPlacement: B(e, t.headPlacement)
267
+ headPlacement: V(e, t.headPlacement)
253
268
  };
254
269
  }
255
- function ee(e, t, n, r) {
256
- let { viewOpacity: i } = n, a = e.encoders;
257
- return U(e, t, n, (e) => {
258
- let n = t.stem ? re(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch && !e.bidirectional, e.bidirectional) : null, o = n ? [n] : [];
259
- W(e, (t, n, r, i) => {
270
+ function U(e, t, n, r, i) {
271
+ let { viewOpacity: a } = n, o = e.encoders;
272
+ return W(e, t, n, (e) => {
273
+ let n = t.stem ? ie(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch && !e.bidirectional, e.bidirectional) : null, s = n ? [n] : [];
274
+ ne(e, (t, n, r, i) => {
260
275
  let a = {
261
276
  x: t,
262
277
  y: n
263
278
  };
264
- o.push(e.renderedHeadShape == "open" ? ie(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : ne(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
279
+ s.push(e.renderedHeadShape == "open" ? ae(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : re(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
265
280
  });
266
- let s = V(a.stroke(e.datum)) != "none" && I(a.strokeOpacity, e.datum) * i > 0 && e.strokeWidth > 0;
281
+ let c = (i ?? H(o.stroke(e.datum))) != "none" && I(o.strokeOpacity, e.datum) * a > 0 && e.strokeWidth > 0;
267
282
  r({
268
283
  datum: e.datum,
269
- boundaryLoops: o.length == 1 || !s ? o : v(o),
284
+ boundaryLoops: s.length == 1 || !c ? s : C(s),
270
285
  strokeWidth: e.strokeWidth,
271
286
  headShapeFallback: e.headShapeFallback
272
287
  });
273
288
  });
274
289
  }
275
- function U(e, t, n, r) {
276
- let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, c = e.encoders;
290
+ function W(e, t, n, r) {
291
+ let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, l = e.encoders;
277
292
  if (a.length == 0) return 0;
278
- let l = P(i, c, "x", a[0]), u = P(i, c, "y", a[0]), d = [0, 0], f = [0, 0], p = {
293
+ let u = F(i, l, "x", a[0], c(e, "x")), d = F(i, l, "y", a[0], c(e, "y")), f = [0, 0], p = [0, 0], m = {
279
294
  datum: {},
280
295
  tail: {
281
296
  x: 0,
@@ -315,12 +330,12 @@ function U(e, t, n, r) {
315
330
  stemContainsHead: !1,
316
331
  renderedHeadShape: "triangle",
317
332
  headShapeFallback: !1
318
- }, m = 0;
333
+ }, h = 0;
319
334
  for (let e of a) {
320
- l(e, d), u(e, f);
321
- let n = te(c.direction, e), i = n == "reverse", a = n == "both", h = i ? d[1] : d[0], _ = i ? f[1] : f[0], v = i ? d[0] : d[1], y = i ? f[0] : f[1], b = v - h, x = y - _, S = Math.hypot(b, x);
335
+ u(e, f), d(e, p);
336
+ let n = te(l.direction, e), i = n == "reverse", a = n == "both", c = i ? f[1] : f[0], g = i ? p[1] : p[0], _ = i ? f[0] : f[1], v = i ? p[0] : p[1], y = _ - c, b = v - g, S = Math.hypot(y, b);
322
337
  if (S == 0) continue;
323
- let C = b / S, w = x / S, T = Math.max(I(c.size, e), t.minSize), E = T / 2, D = Math.max(t.headWidth * T, 0) / 2, O = ae({
338
+ let C = y / S, w = b / S, T = Math.max(I(l.size, e), t.minSize), E = T / 2, D = Math.max(t.headWidth * T, 0) / 2, O = oe({
324
339
  segmentLength: S,
325
340
  headHalfWidth: D,
326
341
  stemHalfWidth: t.stem ? E : -E,
@@ -332,14 +347,14 @@ function U(e, t, n, r) {
332
347
  minStemLength: t.minStemLength,
333
348
  headShape: t.headShape,
334
349
  bidirectional: a
335
- }), k = t.headShape == "open" ? O : Math.min(t.configuredRHeadNotchSlope, O), A = t.headShape == "open" ? T : 0, j = t.headPlacement == "outside" ? se(D, O, k, A) : 0, M = v + C * j, N = y + w * j;
336
- a && (h -= C * j, _ -= w * j);
337
- let P = D * O, F = Math.hypot(D, P), L = t.headShape == "open" && F > 0 ? T * D / F : 0, R = M - C * (P + L), z = N - w * (P + L), B = a ? h + C * (P + L) : h, V = a ? _ + w * (P + L) : _, H = I(c.strokeWidth, e), ee = Math.max(t.stem ? E : 0, D) + H * 2;
338
- if (!g(o, Math.min(h, M, R, B), Math.min(_, N, z, V), Math.max(h, M, R, B), Math.max(_, N, z, V), ee) || (m++, s)) continue;
350
+ }), k = t.headShape == "open" ? O : Math.min(t.configuredRHeadNotchSlope, O), A = t.headShape == "open" ? T : 0, j = t.headPlacement == "outside" ? ce(D, O, k, A) : 0, M = _ + C * j, N = v + w * j;
351
+ a && (c -= C * j, g -= w * j);
352
+ let P = D * O, F = Math.hypot(D, P), L = t.headShape == "open" && F > 0 ? T * D / F : 0, R = M - C * (P + L), z = N - w * (P + L), B = a ? c + C * (P + L) : c, V = a ? g + w * (P + L) : g, H = I(l.strokeWidth, e), ee = Math.max(t.stem ? E : 0, D) + H * 2;
353
+ if (!x(o, Math.min(c, M, R, B), Math.min(g, N, z, V), Math.max(c, M, R, B), Math.max(g, N, z, V), ee) || (h++, s)) continue;
339
354
  let U = t.headShape == "triangle" || t.headShape == "open" ? t.headShape : "triangle", W = P + A / Math.hypot(O, 1) + H, ne = !t.repeatHeads || a ? Infinity : Math.max((t.headSpacing ?? 0) * T, W);
340
- p.datum = e, q(p.tail, h, _), q(p.tip, M, N), q(p.tangent, C, w), q(p.normal, -w, C), q(p.reverseTangent, -C, -w), q(p.reverseNormal, w, -C), p.size = T, p.stemHalfWidth = E, p.headHalfWidth = D, p.headAxisLength = P, p.rHeadSlope = O, p.rHeadNotchSlope = k, p.strokeWidth = H, p.repeatSpacing = ne, p.headRepeatFootprint = W, p.geometryLength = Math.hypot(M - h, N - _), p.bidirectional = a, p.stemContainsHead = t.stem && U == "triangle" && (!t.repeatHeads || a) && D <= E, p.renderedHeadShape = U, p.headShapeFallback = U != t.headShape, r(p);
355
+ m.datum = e, q(m.tail, c, g), q(m.tip, M, N), q(m.tangent, C, w), q(m.normal, -w, C), q(m.reverseTangent, -C, -w), q(m.reverseNormal, w, -C), m.size = T, m.stemHalfWidth = E, m.headHalfWidth = D, m.headAxisLength = P, m.rHeadSlope = O, m.rHeadNotchSlope = k, m.strokeWidth = H, m.repeatSpacing = ne, m.headRepeatFootprint = W, m.geometryLength = Math.hypot(M - c, N - g), m.bidirectional = a, m.stemContainsHead = t.stem && U == "triangle" && (!t.repeatHeads || a) && D <= E, m.renderedHeadShape = U, m.headShapeFallback = U != t.headShape, r(m);
341
356
  }
342
- return m;
357
+ return h;
343
358
  }
344
359
  function te(e, t) {
345
360
  let n = z(e, t);
@@ -350,11 +365,11 @@ function te(e, t) {
350
365
  default: throw Error(`Invalid value for "direction" channel: ${n}`);
351
366
  }
352
367
  }
353
- function W(e, t) {
368
+ function ne(e, t) {
354
369
  e.bidirectional && !e.stemContainsHead && t(e.tail.x, e.tail.y, e.reverseTangent, e.reverseNormal);
355
370
  for (let n = 0; !e.stemContainsHead && !(n > 0 && n + e.headRepeatFootprint - e.strokeWidth / 2 > e.geometryLength || (t(e.tip.x - e.tangent.x * n, e.tip.y - e.tangent.y * n, e.tangent, e.normal), !(e.repeatSpacing > 0) || !Number.isFinite(e.repeatSpacing))); n += e.repeatSpacing);
356
371
  }
357
- function ne(e, t, n, r, i, a) {
372
+ function re(e, t, n, r, i, a) {
358
373
  let o = r * i, s = o - r * a, c = G(G(e, K(t, -o)), K(n, r)), l = G(G(e, K(t, -o)), K(n, -r));
359
374
  return [
360
375
  e,
@@ -363,7 +378,7 @@ function ne(e, t, n, r, i, a) {
363
378
  l
364
379
  ];
365
380
  }
366
- function re(e, t, n, r, i, a, o, s) {
381
+ function ie(e, t, n, r, i, a, o, s) {
367
382
  let c = i * a, l = G(G(t, K(n, -c)), K(r, i)), u = G(G(t, K(n, -c)), K(r, -i)), d = G(e, K(r, i)), f = G(e, K(r, -i));
368
383
  return s ? [
369
384
  t,
@@ -381,7 +396,7 @@ function re(e, t, n, r, i, a, o, s) {
381
396
  u
382
397
  ];
383
398
  }
384
- function ie(e, t, n, r, i, a, o) {
399
+ function ae(e, t, n, r, i, a, o) {
385
400
  let s = r * i, c = G(G(e, K(t, -s)), K(n, r)), l = G(G(e, K(t, -s)), K(n, -r)), u = Math.hypot(r, s), d = u > 0 ? o * r / u : 0, f = u > 0 ? o * s / u : 0, p = G(G(c, K(t, -d)), K(n, -f)), m = G(G(l, K(t, -d)), K(n, f));
386
401
  return [
387
402
  e,
@@ -392,23 +407,23 @@ function ie(e, t, n, r, i, a, o) {
392
407
  l
393
408
  ];
394
409
  }
395
- function ae({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l, bidirectional: u }) {
410
+ function oe({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l, bidirectional: u }) {
396
411
  if (a || n < 0) return r;
397
412
  if (o == "outside") return !s || n <= 0 ? r : Math.min(r, Math.max(e - c, 0) / n);
398
413
  if (l != "triangle") return r;
399
414
  let d = Math.max(e - c, 0) / (u ? 2 : 1);
400
- return oe(n, t, r, i) <= d ? r : d < n * i ? n > 0 ? le(d / n, 0, r) : 0 : le((d + (t - n) * i) / t, 0, r);
415
+ return se(n, t, r, i) <= d ? r : d < n * i ? n > 0 ? ue(d / n, 0, r) : 0 : ue((d + (t - n) * i) / t, 0, r);
401
416
  }
402
- function oe(e, t, n, r) {
417
+ function se(e, t, n, r) {
403
418
  return t * n - (t - e) * Math.min(r, n);
404
419
  }
405
- function se(e, t, n, r) {
420
+ function ce(e, t, n, r) {
406
421
  if (e <= 0) return 0;
407
422
  let i = e * t, a = Math.hypot(e, i);
408
423
  return i + r * e / a - (e - r * i / a) * n;
409
424
  }
410
- function ce(e) {
411
- let t = le(e, 1, 90) * Math.PI / 180;
425
+ function le(e) {
426
+ let t = ue(e, 1, 90) * Math.PI / 180;
412
427
  return 1 / Math.max(Math.tan(t), 1e-6);
413
428
  }
414
429
  function G(e, t) {
@@ -426,13 +441,13 @@ function K(e, t) {
426
441
  function q(e, t, n) {
427
442
  e.x = t, e.y = n;
428
443
  }
429
- function le(e, t, n) {
444
+ function ue(e, t, n) {
430
445
  return Math.min(Math.max(e, t), n);
431
446
  }
432
447
  //#endregion
433
448
  //#region ../core/src/rendering/immediate/linkFading.js
434
- var ue = 4;
435
- function de(e, t, n) {
449
+ var de = 4;
450
+ function fe(e, t, n) {
436
451
  let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
437
452
  if (a == 0) return;
438
453
  let o = -i / a, s = r / a;
@@ -453,23 +468,23 @@ function de(e, t, n) {
453
468
  key: d
454
469
  };
455
470
  }
456
- function fe(e, t, n = !1) {
457
- let r = B(e, e.properties.arcFadingDistance);
458
- return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n && B(e, e.properties.noFadingOnSecondPass) ? !1 : r;
471
+ function pe(e, t, n = !1) {
472
+ let r = V(e, e.properties.arcFadingDistance);
473
+ return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n && V(e, e.properties.noFadingOnSecondPass) ? !1 : r;
459
474
  }
460
- function pe(e, t) {
475
+ function me(e, t) {
461
476
  let n = [], r = (r) => {
462
- for (let i = 0; i <= ue; i++) {
463
- let a = i / ue, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
477
+ for (let i = 0; i <= de; i++) {
478
+ let a = i / de, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
464
479
  n.push({
465
480
  offset: s,
466
- opacity: 1 - me(c)
481
+ opacity: 1 - he(c)
467
482
  });
468
483
  }
469
484
  };
470
485
  return r(!0), r(!1), n;
471
486
  }
472
- function me(e) {
487
+ function he(e) {
473
488
  let t = Math.max(0, Math.min(1, e));
474
489
  return t * t * (3 - 2 * t);
475
490
  }
@@ -479,9 +494,22 @@ function J(e, t) {
479
494
  }
480
495
  //#endregion
481
496
  //#region ../core/src/rendering/immediate/geometry/linkGeometry.js
482
- function he(e, t, n, r) {
497
+ function ge(e, t, n, r) {
498
+ return r.shape == "orthogonal" ? {
499
+ type: "orthogonal",
500
+ points: [
501
+ e,
502
+ r.orient == "horizontal" ? [e[0], t[1]] : [t[0], e[1]],
503
+ t
504
+ ]
505
+ } : {
506
+ type: "cubic",
507
+ points: _e(e, t, n, r)
508
+ };
509
+ }
510
+ function _e(e, t, n, r) {
483
511
  if (r.shape == "arc") {
484
- let i = [...e], a = [...t], o = X(a, i), s = ye(o);
512
+ let i = [...e], a = [...t], o = X(a, i), s = xe(o);
485
513
  if (s == 0) return [
486
514
  i,
487
515
  i,
@@ -489,7 +517,7 @@ function he(e, t, n, r) {
489
517
  a
490
518
  ];
491
519
  let c = Z(o, 1 / s), l = [-c[1], c[0]];
492
- s = ge(i, a, s, r.maxChordLength, n);
520
+ s = ve(i, a, s, r.maxChordLength, n);
493
521
  let u = Z(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
494
522
  return [
495
523
  i,
@@ -501,8 +529,8 @@ function he(e, t, n, r) {
501
529
  if (r.shape == "dome") {
502
530
  let i, a, o;
503
531
  r.orient == "vertical" ? (i = [Math.min(e[0], t[0]), t[1]], a = [Math.max(e[0], t[0]), t[1]], o = [0, e[1] - t[1]]) : (i = [t[0], Math.min(e[1], t[1])], a = [t[0], Math.max(e[1], t[1])], o = [e[0] - t[0], 0]);
504
- let s = ye(X(a, i));
505
- ge(i, a, s, r.maxChordLength, n), r.clampApex && _e(i, a, r.orient, n);
532
+ let s = xe(X(a, i));
533
+ ve(i, a, s, r.maxChordLength, n), r.clampApex && ye(i, a, r.orient, n);
506
534
  let c = Z(o, 1 / .75);
507
535
  return [
508
536
  i,
@@ -542,15 +570,15 @@ function he(e, t, n, r) {
542
570
  }
543
571
  throw Error(`Unsupported link shape: ${r.shape}`);
544
572
  }
545
- function ge(e, t, n, r, i) {
573
+ function ve(e, t, n, r, i) {
546
574
  if (n <= r) return n;
547
575
  let a = Z(X(t, e), 1 / n);
548
- return ve(e, i, 2) ? (be(t, Y(e, Z(a, r))), r) : ve(t, i, 2) ? (be(e, X(t, Z(a, r))), r) : n;
576
+ return be(e, i, 2) ? (Se(t, Y(e, Z(a, r))), r) : be(t, i, 2) ? (Se(e, X(t, Z(a, r))), r) : n;
549
577
  }
550
- function _e(e, t, n, r) {
578
+ function ye(e, t, n, r) {
551
579
  n == "vertical" ? (t[0] > 0 && (e[0] = Math.max(e[0], -t[0])), e[0] < r.width && (t[0] = Math.min(t[0], 2 * r.width - e[0]))) : (t[1] > 0 && (e[1] = Math.max(e[1], -t[1])), e[1] < r.height && (t[1] = Math.min(t[1], 2 * r.height - e[1])));
552
580
  }
553
- function ve(e, t, n) {
581
+ function be(e, t, n) {
554
582
  return e[0] >= -t.width * n && e[0] <= t.width * (1 + n) && e[1] >= -t.height * n && e[1] <= t.height * (1 + n);
555
583
  }
556
584
  function Y(e, t) {
@@ -562,54 +590,54 @@ function X(e, t) {
562
590
  function Z(e, t) {
563
591
  return [e[0] * t, e[1] * t];
564
592
  }
565
- function ye(e) {
593
+ function xe(e) {
566
594
  return Math.hypot(e[0], e[1]);
567
595
  }
568
- function be(e, t) {
596
+ function Se(e, t) {
569
597
  e[0] = t[0], e[1] = t[1];
570
598
  }
571
599
  //#endregion
572
600
  //#region ../core/src/rendering/immediate/marks/link.js
573
- function xe(e) {
601
+ function Ce(e) {
574
602
  let t = e.properties;
575
603
  return {
576
- shape: B(e, t.linkShape),
577
- orient: B(e, t.orient),
578
- arcHeightFactor: B(e, t.arcHeightFactor),
579
- minArcHeight: B(e, t.minArcHeight),
580
- maxChordLength: B(e, t.maxChordLength),
581
- clampApex: B(e, t.clampApex)
604
+ shape: V(e, t.linkShape),
605
+ orient: V(e, t.orient),
606
+ arcHeightFactor: V(e, t.arcHeightFactor),
607
+ minArcHeight: V(e, t.minArcHeight),
608
+ maxChordLength: V(e, t.maxChordLength),
609
+ clampApex: V(e, t.clampApex)
582
610
  };
583
611
  }
584
- function Se(e, t, n, r) {
612
+ function we(e, t, n, r) {
585
613
  let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
586
614
  if (a.length == 0) return 0;
587
- let c = P(i, s, "x", a[0]), l = P(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = i.x, p = i.y, m = {
615
+ let l = F(i, s, "x", a[0], c(e, "x")), u = F(i, s, "y", a[0], c(e, "y")), d = [0, 0], f = [0, 0], p = i.x, m = i.y, h = {
588
616
  width: i.width,
589
617
  height: i.height
590
- }, h = p + m.height, _ = 0;
618
+ }, g = m + h.height, _ = c(e, "x") || c(e, "y"), v = 0;
591
619
  for (let e of a) {
592
- c(e, u), l(e, d);
593
- let [n, i] = u, [a, p] = d, v = he([n - f, h - a], [i - f, h - p], m, t);
594
- for (let e of v) e[0] += f, e[1] = h - e[1];
595
- let [y, b, x, S] = v, C = I(s.size, e);
596
- g(o, Math.min(y[0], b[0], x[0], S[0]), Math.min(y[1], b[1], x[1], S[1]), Math.max(y[0], b[0], x[0], S[0]), Math.max(y[1], b[1], x[1], S[1]), C / 2) && (_++, r({
620
+ if (l(e, d), u(e, f), (_ || t.shape == "orthogonal") && d[0] === d[1] && f[0] === f[1]) continue;
621
+ let [i, a] = d, [c, m] = f, y = ge([i - p, g - c], [a - p, g - m], h, t), b = Infinity, S = Infinity, C = -Infinity, w = -Infinity;
622
+ for (let e of y.points) e[0] += p, e[1] = g - e[1], b = Math.min(b, e[0]), S = Math.min(S, e[1]), C = Math.max(C, e[0]), w = Math.max(w, e[1]);
623
+ let T = I(s.size, e);
624
+ x(o, b, S, C, w, Math.max(T, n.minPickingSize ?? 0) / 2) && (v++, r({
597
625
  datum: e,
598
- points: v,
599
- strokeWidth: C
626
+ geometry: y,
627
+ strokeWidth: T
600
628
  }));
601
629
  }
602
- return _;
630
+ return v;
603
631
  }
604
632
  //#endregion
605
633
  //#region ../core/src/rendering/immediate/marks/point.js
606
- function Ce(e) {
607
- return { inwardStroke: B(e, e.properties.inwardStroke) };
634
+ function Te(e) {
635
+ return { inwardStroke: V(e, e.properties.inwardStroke) };
608
636
  }
609
- function we(e, t, n, r) {
610
- let { coords: i, data: a, visibleBounds: o, anchorCullBounds: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
611
- if (c === l) return 0;
612
- let d = P(i, u, "x", a[c]), f = P(i, u, "y", a[c]), p = [0, 0], m = [0, 0], _ = e.getSemanticThreshold(), v = {
637
+ function Ee(e, t, r, i) {
638
+ let { coords: a, data: o, visibleBounds: s, anchorCullBounds: l } = r, u = r.start ?? 0, d = r.end ?? o.length, f = e.encoders;
639
+ if (u === d) return 0;
640
+ let p = F(a, f, "x", o[u]), m = F(a, f, "y", o[u]), h = [0, 0], g = [0, 0], _ = e.getSemanticThreshold(), v = {
613
641
  datum: {},
614
642
  shape: "circle",
615
643
  x: 0,
@@ -619,23 +647,23 @@ function we(e, t, n, r) {
619
647
  angle: 0,
620
648
  strokeWidth: 0,
621
649
  lineShape: !1
622
- }, y = 0;
623
- for (let e = c; e < l; e++) {
624
- let n = a[e];
625
- if (I(u.semanticScore, n) < _) continue;
626
- d(n, p), f(n, m);
627
- let i = p[0] + I(u.dx, n), c = m[0] - I(u.dy, n);
628
- if (h(s, i, c)) continue;
629
- let l = Math.sqrt(I(u.size, n)) / 2;
630
- if (t.inwardStroke && l <= 0) continue;
631
- let b = z(u.shape, n), x = I(u.strokeWidth, n), S = b == "x" || b == "+", C = t.inwardStroke && !S ? Math.min(x, l) : x, w = t.inwardStroke && !S ? l - C / 2 : l, T = t.inwardStroke ? 0 : x / 2, E = l * Math.SQRT2 + T;
632
- g(o, i - E, c - E, i + E, c + E) && (y++, v.datum = n, v.shape = b, v.x = i, v.y = c, v.geometryRadius = w, v.boundsRadius = E, v.angle = I(u.angle, n), v.strokeWidth = C, v.lineShape = S, r(v));
650
+ }, y = c(e, "x"), S = c(e, "y"), C = 0;
651
+ for (let e = u; e < d; e++) {
652
+ let r = o[e];
653
+ if (I(f.semanticScore, r) < _) continue;
654
+ p(r, h), m(r, g);
655
+ let c = h[0] + I(f.dx, r), u = g[0] - I(f.dy, r);
656
+ if (y && (c = n(c, a.x, a.x2)), S && (u = n(u, a.y, a.y2)), b(l, c, u)) continue;
657
+ let d = Math.sqrt(I(f.size, r)) / 2;
658
+ if (t.inwardStroke && d <= 0) continue;
659
+ let w = z(f.shape, r), T = I(f.strokeWidth, r), E = w == "x" || w == "+", D = t.inwardStroke && !E ? Math.min(T, d) : T, O = t.inwardStroke && !E ? d - D / 2 : d, k = t.inwardStroke ? 0 : T / 2, A = d * Math.SQRT2 + k;
660
+ x(s, c - A, u - A, c + A, u + A) && (C++, v.datum = r, v.shape = w, v.x = c, v.y = u, v.geometryRadius = O, v.boundsRadius = A, v.angle = I(f.angle, r), v.strokeWidth = D, v.lineShape = E, i(v));
633
661
  }
634
- return y;
662
+ return C;
635
663
  }
636
664
  //#endregion
637
665
  //#region ../core/src/rendering/immediate/geometry/pointPath.js
638
- function Te(e, t, n, r, i) {
666
+ function De(e, t, n, r, i) {
639
667
  let a = r * .4, o = r * .15, s = Math.sqrt(3) * r / 2;
640
668
  switch (e) {
641
669
  case "diamond": return i.moveTo(t, n - r), i.lineTo(t + r, n), i.lineTo(t, n + r), i.lineTo(t - r, n), i.closePath(), !0;
@@ -658,35 +686,35 @@ function Q(e, t, n, r, i) {
658
686
  }
659
687
  //#endregion
660
688
  //#region ../core/src/rendering/immediate/marks/rect.js
661
- var Ee = .1;
662
- function De(e) {
663
- let t = e.properties, n = B(e, t.cornerRadius), r = {
664
- topLeft: B(e, t.cornerRadiusTopLeft ?? n),
665
- topRight: B(e, t.cornerRadiusTopRight ?? n),
666
- bottomRight: B(e, t.cornerRadiusBottomRight ?? n),
667
- bottomLeft: B(e, t.cornerRadiusBottomLeft ?? n)
689
+ var Oe = .1;
690
+ function ke(e) {
691
+ let t = e.properties, n = V(e, t.cornerRadius), r = {
692
+ topLeft: V(e, t.cornerRadiusTopLeft ?? n),
693
+ topRight: V(e, t.cornerRadiusTopRight ?? n),
694
+ bottomRight: V(e, t.cornerRadiusBottomRight ?? n),
695
+ bottomLeft: V(e, t.cornerRadiusBottomLeft ?? n)
668
696
  }, i = {
669
- blur: B(e, t.shadowBlur ?? 0),
670
- color: B(e, t.shadowColor ?? "black"),
671
- offsetX: B(e, t.shadowOffsetX ?? 0),
672
- offsetY: B(e, t.shadowOffsetY ?? 0),
673
- opacity: B(e, t.shadowOpacity ?? 0)
674
- }, a = B(e, t.hatch ?? "none"), o = !je(r);
697
+ blur: V(e, t.shadowBlur ?? 0),
698
+ color: V(e, t.shadowColor ?? "black"),
699
+ offsetX: V(e, t.shadowOffsetX ?? 0),
700
+ offsetY: V(e, t.shadowOffsetY ?? 0),
701
+ opacity: V(e, t.shadowOpacity ?? 0)
702
+ }, a = V(e, t.hatch ?? "none"), o = !Ne(r);
675
703
  return {
676
704
  cornerRadii: r,
677
- minWidth: B(e, t.minWidth),
678
- minHeight: B(e, t.minHeight),
679
- minOpacity: B(e, t.minOpacity),
705
+ minWidth: V(e, t.minWidth),
706
+ minHeight: V(e, t.minHeight),
707
+ minOpacity: V(e, t.minOpacity),
680
708
  shadow: i,
681
709
  hatch: a,
682
710
  hasCornerRadii: o,
683
711
  canPadSeams: a == "none" && i.opacity == 0 && !o
684
712
  };
685
713
  }
686
- function Oe(e, t, n, r) {
687
- let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
688
- if (c === l) return 0;
689
- let d = u.strokeWidth.constant, f = u.fillOpacity.constant, p = d ? I(u.strokeWidth, a[c]) : 0, m = f ? I(u.fillOpacity, a[c]) : 0, h = u.fill.constant, _ = h ? V(u.fill(a[c])) : "none", v = t.shadow.opacity > 0 ? t.shadow.blur + Math.max(Math.abs(t.shadow.offsetX), Math.abs(t.shadow.offsetY)) : 0, y = P(i, u, "x", a[c]), b = P(i, u, "y", a[c]), x = [0, 0], S = [0, 0], C = {
714
+ function Ae(e, t, n, r) {
715
+ let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, l = n.start ?? 0, u = n.end ?? a.length, d = e.encoders;
716
+ if (l === u) return 0;
717
+ let f = d.strokeWidth.constant, p = d.fillOpacity.constant, m = f ? I(d.strokeWidth, a[l]) : 0, h = p ? I(d.fillOpacity, a[l]) : 0, g = B(d.fill, n), _ = t.shadow.opacity > 0 ? t.shadow.blur + Math.max(Math.abs(t.shadow.offsetX), Math.abs(t.shadow.offsetY)) : 0, v = F(i, d, "x", a[l], c(e, "x")), y = F(i, d, "y", a[l], c(e, "y")), b = [0, 0], S = [0, 0], C = c(e, "x"), w = c(e, "y"), T = {
690
718
  datum: {},
691
719
  x: 0,
692
720
  y: 0,
@@ -702,90 +730,115 @@ function Oe(e, t, n, r) {
702
730
  strokeWidth: 0,
703
731
  fill: "none",
704
732
  fillOpacity: 0
705
- }, w = 0;
706
- for (let e = c; e < l; e++) {
733
+ }, E = 0;
734
+ for (let e = l; e < u; e++) {
707
735
  let n = a[e];
708
- y(n, x), b(n, S);
709
- let i = Math.min(x[0], x[1]), c = Math.min(S[0], S[1]), l = Math.abs(x[1] - x[0]), T = Math.abs(S[1] - S[0]), E = ke(l, t.minWidth), D = ke(T, t.minHeight), O = Math.max(t.minOpacity, E * D);
710
- l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth), T < t.minHeight && (c -= (t.minHeight - T) / 2, T = t.minHeight);
711
- let k = d ? p : I(u.strokeWidth, n), A = h ? _ : V(u.fill(n)), j = (f ? m : I(u.fillOpacity, n)) * s, M = k == 0 && j == 1 && O == 1 && t.canPadSeams && A != "none" ? Ee : 0;
712
- M && (i -= M, c -= M, l += M * 2, T += M * 2), g(o, i, c, i + l, c + T, k / 2 + v) && (w++, C.datum = n, C.x = i, C.y = c, C.width = l, C.height = T, C.opacityFactor = O, C.strokeWidth = k, C.fill = A, C.fillOpacity = j, t.hasCornerRadii && Ae(t.cornerRadii, l, T, C.radii), r(C));
736
+ if (v(n, b), y(n, S), C && b[0] === b[1] || w && S[0] === S[1]) continue;
737
+ let i = Math.min(b[0], b[1]), c = Math.min(S[0], S[1]), l = Math.abs(b[1] - b[0]), u = Math.abs(S[1] - S[0]), D = je(l, t.minWidth), O = je(u, t.minHeight), k = Math.max(t.minOpacity, D * O);
738
+ l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth), u < t.minHeight && (c -= (t.minHeight - u) / 2, u = t.minHeight);
739
+ let A = f ? m : I(d.strokeWidth, n), j = g ?? H(d.fill(n)), M = (p ? h : I(d.fillOpacity, n)) * s, N = A == 0 && M == 1 && k == 1 && t.canPadSeams && j != "none" ? Oe : 0;
740
+ N && (i -= N, c -= N, l += N * 2, u += N * 2), x(o, i, c, i + l, c + u, A / 2 + _) && (E++, T.datum = n, T.x = i, T.y = c, T.width = l, T.height = u, T.opacityFactor = k, T.strokeWidth = A, T.fill = j, T.fillOpacity = M, t.hasCornerRadii && Me(t.cornerRadii, l, u, T.radii), r(T));
713
741
  }
714
- return w;
742
+ return E;
715
743
  }
716
- function ke(e, t) {
744
+ function je(e, t) {
717
745
  return t > 0 && e < t ? e / t : 1;
718
746
  }
719
- function Ae(e, t, n, r) {
747
+ function Me(e, t, n, r) {
720
748
  let i = Math.min(t, n) / 2;
721
749
  r.topLeft = Math.max(0, Math.min(e.topLeft, i)), r.topRight = Math.max(0, Math.min(e.topRight, i)), r.bottomRight = Math.max(0, Math.min(e.bottomRight, i)), r.bottomLeft = Math.max(0, Math.min(e.bottomLeft, i));
722
750
  }
723
- function je(e) {
751
+ function Ne(e) {
724
752
  return e.topLeft == 0 && e.topRight == 0 && e.bottomRight == 0 && e.bottomLeft == 0;
725
753
  }
726
754
  //#endregion
755
+ //#region ../core/src/utils/clipSegment.js
756
+ function Pe(e, t, n, r, i, a, o, s, c) {
757
+ if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) return !1;
758
+ let l = n - e, u = r - t, d = 0, f = 1;
759
+ if (l == 0) {
760
+ if (e < i || e > o) return !1;
761
+ } else {
762
+ let t = (i - e) / l, n = (o - e) / l;
763
+ d = Math.max(d, Math.min(t, n)), f = Math.min(f, Math.max(t, n));
764
+ }
765
+ if (u == 0) {
766
+ if (t < a || t > s) return !1;
767
+ } else {
768
+ let e = (a - t) / u, n = (s - t) / u;
769
+ d = Math.max(d, Math.min(e, n)), f = Math.min(f, Math.max(e, n));
770
+ }
771
+ return d > f ? !1 : (c[0] = e + d * l, c[1] = t + d * u, c[2] = e + f * l, c[3] = t + f * u, !0);
772
+ }
773
+ //#endregion
727
774
  //#region ../core/src/rendering/immediate/marks/rule.js
728
- function Me(e) {
729
- return { minLength: B(e, e.properties.minLength) };
775
+ function Fe(e) {
776
+ return { minLength: V(e, e.properties.minLength) };
730
777
  }
731
- function Ne(e, t, n, r) {
778
+ function Ie(e, t, n, r) {
732
779
  let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
733
780
  if (a.length == 0) return 0;
734
- let c = P(i, s, "x", a[0]), l = P(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = {
781
+ let l = F(i, s, "x", a[0]), u = F(i, s, "y", a[0]), d = [0, 0], f = [0, 0], p = {
735
782
  datum: {},
736
783
  x1: 0,
737
784
  y1: 0,
738
785
  x2: 0,
739
786
  y2: 0,
740
787
  strokeWidth: 0
741
- }, p = 0;
788
+ }, m = c(e, "x"), h = c(e, "y"), g = [
789
+ 0,
790
+ 0,
791
+ 0,
792
+ 0
793
+ ], _ = 0;
742
794
  for (let e of a) {
743
- c(e, u), l(e, d);
744
- let [n, i] = u, [a, m] = d, h = i - n, _ = m - a, v = Math.hypot(h, _);
745
- if (v > 0 && v < t.minLength) {
746
- let e = (t.minLength - v) / 2, r = h / v, o = _ / v;
747
- n -= r * e, a -= o * e, i += r * e, m += o * e;
795
+ l(e, d), u(e, f);
796
+ let [n, a] = d, [c, v] = f, y = I(s.size, e), b = y + t.minLength + 1, S = Math.max(o.x2 - o.x1, b), C = Math.max(o.y2 - o.y1, b);
797
+ if (!Pe(n, c, a, v, m ? i.x : o.x1 - S, h ? i.y : o.y1 - C, m ? i.x2 : o.x2 + S, h ? i.y2 : o.y2 + C, g) || ([n, c, a, v] = g, n === a && c === v)) continue;
798
+ let w = a - n, T = v - c, E = Math.hypot(w, T);
799
+ if (E > 0 && E < t.minLength) {
800
+ let e = (t.minLength - E) / 2, r = w / E, i = T / E;
801
+ n -= r * e, c -= i * e, a += r * e, v += i * e;
748
802
  }
749
- let y = I(s.size, e);
750
- g(o, n, a, i, m, y / 2) && (p++, f.datum = e, f.x1 = n, f.y1 = a, f.x2 = i, f.y2 = m, f.strokeWidth = y, r(f));
803
+ x(o, n, c, a, v, y / 2) && (_++, p.datum = e, p.x1 = n, p.y1 = c, p.x2 = a, p.y2 = v, p.strokeWidth = y, r(p));
751
804
  }
752
- return p;
805
+ return _;
753
806
  }
754
807
  //#endregion
755
808
  //#region ../core/src/rendering/immediate/marks/text.js
756
- function Pe(e) {
809
+ function Le(e) {
757
810
  let t = e.properties;
758
811
  return {
759
- align: B(e, t.align),
760
- baseline: B(e, t.baseline),
761
- logoLetters: B(e, t.logoLetters),
762
- paddingX: B(e, t.paddingX),
763
- paddingY: B(e, t.paddingY),
764
- flushX: B(e, t.flushX),
765
- flushY: B(e, t.flushY),
766
- squeeze: B(e, t.squeeze),
767
- dx: B(e, t.dx),
768
- dy: B(e, t.dy)
812
+ align: V(e, t.align),
813
+ baseline: V(e, t.baseline),
814
+ logoLetters: V(e, t.logoLetters),
815
+ paddingX: V(e, t.paddingX),
816
+ paddingY: V(e, t.paddingY),
817
+ flushX: V(e, t.flushX),
818
+ flushY: V(e, t.flushY),
819
+ squeeze: V(e, t.squeeze),
820
+ dx: V(e, t.dx),
821
+ dy: V(e, t.dy)
769
822
  };
770
823
  }
771
- function Fe(n, r, a, o) {
772
- let { coords: s, data: c, visibleBounds: l, anchorCullBounds: u } = a, { align: d, baseline: f } = r, p = n.encoders;
773
- if (c.length == 0) return 0;
774
- let m = p.size.constant ? I(p.size, c[0]) : 0, g = p.angle.constant ? I(p.angle, c[0]) : 0, _ = P(s, p, "x", c[0]), v = P(s, p, "y", c[0]), y = n.encoding.text, b = "format" in y ? t(y.format) : (e) => e, x = [0, 0], S = [0, 0], C = {
824
+ function Re(n, r, a, o) {
825
+ let { coords: s, data: l, visibleBounds: u, anchorCullBounds: d } = a, { align: f, baseline: p } = r, m = n.encoders;
826
+ if (l.length == 0) return 0;
827
+ let h = m.size.constant ? I(m.size, l[0]) : 0, g = m.angle.constant ? I(m.angle, l[0]) : 0, _ = F(s, m, "x", l[0], c(n, "x")), v = F(s, m, "y", l[0], c(n, "y")), y = n.encoding.text, x = "format" in y ? i(y.format) : (e) => e, S = [0, 0], C = [0, 0], w = {
775
828
  width: 0,
776
829
  height: 0
777
- }, w = {
830
+ }, T = {
778
831
  x: 0,
779
832
  y: 0
780
- }, T = {
833
+ }, E = {
781
834
  position: 0,
782
835
  scale: 0
783
- }, E = {
836
+ }, D = {
784
837
  scaleX: 0,
785
838
  scaleY: 0,
786
839
  originX: 0,
787
840
  originY: 0
788
- }, D = Array(8).fill(0), O = {
841
+ }, O = Array(8).fill(0), k = {
789
842
  datum: {},
790
843
  text: "",
791
844
  x: 0,
@@ -799,50 +852,49 @@ function Fe(n, r, a, o) {
799
852
  scale: 1,
800
853
  logoTransform: void 0,
801
854
  multiCharacterLogo: !1,
802
- boundsQuad: D
803
- }, k = !!p.x2, A = !!p.y2, j = 0;
804
- for (let t of c) {
805
- let n = b(p.text(t)), c = i(n) ? n : n === null ? "" : "" + n;
806
- if (!c) continue;
807
- _(t, x), v(t, S);
808
- let [y, M] = x, [N, P] = S, F = p.size.constant ? m : I(p.size, t), L = p.angle.constant ? g : I(p.angle, t);
855
+ boundsQuad: O
856
+ }, A = !!m.x2, j = !!m.y2, M = A && c(n, "x"), N = j && c(n, "y"), P = 0;
857
+ for (let n of l) {
858
+ let i = x(m.text(n)), c = t(i) ? i : i === null ? "" : "" + i;
859
+ if (!c || (_(n, S), v(n, C), M && S[0] === S[1] || N && C[0] === C[1])) continue;
860
+ let [l, y] = S, [F, L] = C, R = m.size.constant ? h : I(m.size, n), z = m.angle.constant ? g : I(m.angle, n);
809
861
  if (r.logoLetters) {
810
- let e = F, n = F;
811
- if (k && (e = M - y, y = (y + M) / 2), A && (n = N - P, N = (N + P) / 2), Ie(D, y, N, Math.abs(e), Math.abs(n), "center", "middle", L, r.dx, r.dy), !e || !n || h(u, y, N) || !Le(l, D)) continue;
862
+ let e = R, t = R;
863
+ if (A && (e = y - l, l = (l + y) / 2), j && (t = F - L, F = (F + L) / 2), ze(O, l, F, Math.abs(e), Math.abs(t), "center", "middle", z, r.dx, r.dy), !e || !t || b(d, l, F) || !Be(u, O)) continue;
812
864
  let i = a.measureLogoInkBounds(c);
813
865
  if (!i) continue;
814
- j++, O.datum = t, O.text = c, O.x = y, O.y = N, O.size = 100, O.width = i.xMax - i.xMin, O.angle = L, O.fadeOpacity = 1, O.scale = 1, E.scaleX = e / O.width, E.scaleY = n / (i.yMax - i.yMin), E.originX = (i.xMin + i.xMax) / 2, E.originY = (i.yMin + i.yMax) / 2, O.logoTransform = E, O.multiCharacterLogo = c.length > 1, o(O);
866
+ P++, k.datum = n, k.text = c, k.x = l, k.y = F, k.size = 100, k.width = i.xMax - i.xMin, k.angle = z, k.fadeOpacity = 1, k.scale = 1, D.scaleX = e / k.width, D.scaleY = t / (i.yMax - i.yMin), D.originX = (i.xMin + i.xMax) / 2, D.originY = (i.yMin + i.yMax) / 2, k.logoTransform = D, k.multiCharacterLogo = c.length > 1, o(k);
815
867
  continue;
816
868
  }
817
- let R = a.fontMeasurement.measureWidth(c, F);
818
- Re(R, F, L, C), k || A ? Be(d, f, L, w) : (w.x = Ve[d], w.y = He[f]);
819
- let z = 1;
820
- if (k && (ze(Math.min(y, M), Math.max(y, M), C.width, r.paddingX, w.x, r.flushX, s.x, s.x2, T), y = T.position, z *= T.scale), A && (ze(Math.min(N, P), Math.max(N, P), C.height * z, r.paddingY, w.y, r.flushY, s.y, s.y2, T), N = T.position, z *= T.scale), h(u, y, N)) continue;
821
- let B = 1;
822
- if (z < 1) {
823
- if (!r.squeeze || z < 3 / F) continue;
824
- B = e(3 / F, 6 / F, z);
869
+ let B = a.fontMeasurement.measureWidth(c, R);
870
+ Ve(B, R, z, w), A || j ? Ue(f, p, z, T) : (T.x = We[f], T.y = Ge[p]);
871
+ let V = 1;
872
+ if (A && (He(Math.min(l, y), Math.max(l, y), w.width, r.paddingX, T.x, r.flushX, s.x, s.x2, E), l = E.position, V *= E.scale), j && (He(Math.min(F, L), Math.max(F, L), w.height * V, r.paddingY, T.y, r.flushY, s.y, s.y2, E), F = E.position, V *= E.scale), b(d, l, F)) continue;
873
+ let H = 1;
874
+ if (V < 1) {
875
+ if (!r.squeeze || V < 3 / R) continue;
876
+ H = e(3 / R, 6 / R, V);
825
877
  }
826
- let V = F * z, H = R * z;
827
- Ie(D, y, N, H, V, d, f, L, r.dx, r.dy), Le(l, D) && (j++, O.datum = t, O.text = c, O.x = y, O.y = N, O.size = F, O.width = H, O.angle = L, O.fadeOpacity = B, O.scale = z, O.logoTransform = void 0, O.multiCharacterLogo = !1, o(O));
878
+ let ee = R * V, U = B * V;
879
+ ze(O, l, F, U, ee, f, p, z, r.dx, r.dy), Be(u, O) && (P++, k.datum = n, k.text = c, k.x = l, k.y = F, k.size = R, k.width = U, k.angle = z, k.fadeOpacity = H, k.scale = V, k.logoTransform = void 0, k.multiCharacterLogo = !1, o(k));
828
880
  }
829
- return j;
881
+ return P;
830
882
  }
831
- function Ie(e, t, n, r, i, a, o, s, c, l) {
832
- let u = t + c - (Ve[a] + 1) / 2 * r, d = n + l - (He[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
883
+ function ze(e, t, n, r, i, a, o, s, c, l) {
884
+ let u = t + c - (We[a] + 1) / 2 * r, d = n + l - (Ge[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
833
885
  return $(e, 0, t, n, u, d, h, g), $(e, 2, t, n, f, d, h, g), $(e, 4, t, n, f, p, h, g), $(e, 6, t, n, u, p, h, g), e;
834
886
  }
835
- function Le(e, t) {
836
- return g(e, Math.min(t[0], t[2], t[4], t[6]), Math.min(t[1], t[3], t[5], t[7]), Math.max(t[0], t[2], t[4], t[6]), Math.max(t[1], t[3], t[5], t[7]), 1);
887
+ function Be(e, t) {
888
+ return x(e, Math.min(t[0], t[2], t[4], t[6]), Math.min(t[1], t[3], t[5], t[7]), Math.max(t[0], t[2], t[4], t[6]), Math.max(t[1], t[3], t[5], t[7]), 1);
837
889
  }
838
890
  function $(e, t, n, r, i, a, o, s) {
839
891
  e[t] = n + (i - n) * s - (a - r) * o, e[t + 1] = r + (i - n) * o + (a - r) * s;
840
892
  }
841
- function Re(e, t, n, r) {
893
+ function Ve(e, t, n, r) {
842
894
  let i = n * Math.PI / 180, a = Math.abs(Math.sin(i)), o = Math.abs(Math.cos(i));
843
895
  r.width = e * o + t * a, r.height = e * a + t * o;
844
896
  }
845
- function ze(e, t, n, r, i, a, o, s, c) {
897
+ function He(e, t, n, r, i, a, o, s, c) {
846
898
  let l = t - e, u = n + 2 * r;
847
899
  if (e > s || t < o) {
848
900
  c.position = 0, c.scale = 0;
@@ -867,21 +919,21 @@ function ze(e, t, n, r, i, a, o, s, c) {
867
919
  }
868
920
  c.position = f, c.scale = Math.max(0, Math.min(1, (l - r) / u));
869
921
  }
870
- function Be(e, t, n, r) {
871
- let i = Ve[e], a = -He[t], o = ((n + 45) % 360 + 360) % 360, s, c;
922
+ function Ue(e, t, n, r) {
923
+ let i = We[e], a = -Ge[t], o = ((n + 45) % 360 + 360) % 360, s, c;
872
924
  o < 90 ? (s = i, c = a) : o < 180 ? (s = a, c = -i) : o < 270 ? (s = -i, c = a) : (s = -a, c = i), r.x = s, r.y = -c;
873
925
  }
874
- var Ve = {
926
+ var We = {
875
927
  left: -1,
876
928
  center: 0,
877
929
  right: 1
878
- }, He = {
930
+ }, Ge = {
879
931
  top: -1,
880
932
  middle: 0,
881
933
  bottom: 1,
882
934
  alphabetic: 1,
883
935
  baseline: 1
884
- }, Ue = [
936
+ }, Ke = [
885
937
  "Lato",
886
938
  "Avenir Next",
887
939
  "Avenir",
@@ -892,7 +944,7 @@ var Ve = {
892
944
  "Helvetica",
893
945
  "Arial",
894
946
  "sans-serif"
895
- ], We = /* @__PURE__ */ new Set([
947
+ ], qe = /* @__PURE__ */ new Set([
896
948
  "serif",
897
949
  "sans-serif",
898
950
  "monospace",
@@ -906,7 +958,7 @@ var Ve = {
906
958
  "emoji",
907
959
  "math",
908
960
  "fangsong"
909
- ]), Ge = {
961
+ ]), Je = {
910
962
  thin: 100,
911
963
  light: 300,
912
964
  regular: 400,
@@ -915,24 +967,24 @@ var Ve = {
915
967
  bold: 700,
916
968
  black: 900
917
969
  };
918
- function Ke(e) {
970
+ function Ye(e) {
919
971
  let t = e ?? "Lato";
920
- return [t, ...Ue.filter((e) => e.toLowerCase() != t.toLowerCase())].map(Xe).join(", ");
972
+ return [t, ...Ke.filter((e) => e.toLowerCase() != t.toLowerCase())].map($e).join(", ");
921
973
  }
922
- function qe(e) {
974
+ function Xe(e) {
923
975
  if (typeof e == "number") return e;
924
- let t = Ge[e];
976
+ let t = Je[e];
925
977
  if (t === void 0) throw Error("Unknown font weight: " + e);
926
978
  return t;
927
979
  }
928
- function Je(e) {
980
+ function Ze(e) {
929
981
  return {
930
982
  style: e.fontStyle ?? "normal",
931
- weight: qe(e.fontWeight ?? "normal"),
932
- family: Ke(e.font)
983
+ weight: Xe(e.fontWeight ?? "normal"),
984
+ family: Ye(e.font)
933
985
  };
934
986
  }
935
- function Ye(e, t) {
987
+ function Qe(e, t) {
936
988
  switch (e) {
937
989
  case "top": return .79 * t;
938
990
  case "middle": return .35 * t;
@@ -942,13 +994,13 @@ function Ye(e, t) {
942
994
  default: throw Error(`Unknown text baseline: ${e}`);
943
995
  }
944
996
  }
945
- function Xe(e) {
997
+ function $e(e) {
946
998
  let t = e.toLowerCase();
947
- return We.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
999
+ return qe.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
948
1000
  }
949
1001
  //#endregion
950
1002
  //#region ../core/src/rendering/nativeTextMetrics.js
951
- var Ze = "Mg", Qe = 100, $e = class {
1003
+ var et = "Mg", tt = 100, nt = class {
952
1004
  #e;
953
1005
  #t;
954
1006
  #n = new r([], JSON.stringify);
@@ -958,10 +1010,10 @@ var Ze = "Mg", Qe = 100, $e = class {
958
1010
  this.#e = e, this.#t = t, e.fontKerning = "normal", e.direction = "ltr", e.textAlign = "left", e.textBaseline = "alphabetic";
959
1011
  }
960
1012
  requestFont(e) {
961
- let t = Je(e), n = this.#n.get(t);
1013
+ let t = Ze(e), n = this.#n.get(t);
962
1014
  if (!n) {
963
- n = new et((e, n) => this.#a(t, e, n)), this.#n.set(t, n);
964
- let e = this.#t?.load(rt(t, 16));
1015
+ n = new rt((e, n) => this.#a(t, e, n)), this.#n.set(t, n);
1016
+ let e = this.#t?.load(ot(t, 16));
965
1017
  e && this.#r.push(e.then(() => n.invalidateCache()));
966
1018
  }
967
1019
  return n;
@@ -970,10 +1022,10 @@ var Ze = "Mg", Qe = 100, $e = class {
970
1022
  await Promise.all(this.#r);
971
1023
  }
972
1024
  #a(e, t, n) {
973
- let r = rt(e, n);
1025
+ let r = ot(e, n);
974
1026
  return r != this.#i && (this.#e.font = r, this.#i = r), this.#e.measureText(t);
975
1027
  }
976
- }, et = class {
1028
+ }, rt = class {
977
1029
  #e;
978
1030
  #t = NaN;
979
1031
  #n = /* @__PURE__ */ new Float64Array(128);
@@ -995,7 +1047,7 @@ var Ze = "Mg", Qe = 100, $e = class {
995
1047
  }
996
1048
  getHeight(e) {
997
1049
  if (this.#a(e), Number.isNaN(this.#r)) {
998
- let t = this.#e(Ze, e);
1050
+ let t = this.#e(et, e);
999
1051
  this.#r = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
1000
1052
  }
1001
1053
  return this.#r;
@@ -1003,7 +1055,7 @@ var Ze = "Mg", Qe = 100, $e = class {
1003
1055
  measureInkBounds(e) {
1004
1056
  let t = e.length == 1 ? e.charCodeAt(0) : 128;
1005
1057
  if (t < 128 && this.#i[t] !== void 0) return this.#i[t];
1006
- let n = tt(this.#e(e, Qe));
1058
+ let n = it(this.#e(e, tt));
1007
1059
  return t < 128 && (this.#i[t] = n), n;
1008
1060
  }
1009
1061
  invalidateCache() {
@@ -1013,7 +1065,7 @@ var Ze = "Mg", Qe = 100, $e = class {
1013
1065
  e != this.#t && (this.#t = e, this.#n.fill(NaN), this.#r = NaN);
1014
1066
  }
1015
1067
  };
1016
- function tt(e) {
1068
+ function it(e) {
1017
1069
  let t = {
1018
1070
  xMin: -e.actualBoundingBoxLeft,
1019
1071
  xMax: e.actualBoundingBoxRight,
@@ -1022,10 +1074,10 @@ function tt(e) {
1022
1074
  };
1023
1075
  return t.xMax > t.xMin && t.yMax > t.yMin ? t : null;
1024
1076
  }
1025
- function nt(e, t) {
1077
+ function at(e, t) {
1026
1078
  let n = e.requestFont(t);
1027
- return n instanceof et ? (e) => n.measureInkBounds(e) : (e) => {
1028
- let t = n.measureWidth(e, Qe), r = n.getHeight(Qe);
1079
+ return n instanceof rt ? (e) => n.measureInkBounds(e) : (e) => {
1080
+ let t = n.measureWidth(e, tt), r = n.getHeight(tt);
1029
1081
  return t > 0 && r > 0 ? {
1030
1082
  xMin: 0,
1031
1083
  xMax: t,
@@ -1034,15 +1086,15 @@ function nt(e, t) {
1034
1086
  } : null;
1035
1087
  };
1036
1088
  }
1037
- function rt(e, t) {
1089
+ function ot(e, t) {
1038
1090
  return `${e.style} ${e.weight} ${t}px ${e.family}`;
1039
1091
  }
1040
- function it(e) {
1092
+ function st(e) {
1041
1093
  let t = e.createElement("canvas").getContext("2d");
1042
1094
  if (!t) throw Error("Canvas2D text measurement is unavailable.");
1043
- return new $e(t, e.fonts);
1095
+ return new nt(t, e.fonts);
1044
1096
  }
1045
- async function at(e, t) {
1097
+ async function ct(e, t) {
1046
1098
  t.visit((t) => {
1047
1099
  let n = t.mark;
1048
1100
  n?.getType() == "text" && e.requestFont(n.properties);
@@ -1050,7 +1102,7 @@ async function at(e, t) {
1050
1102
  }
1051
1103
  //#endregion
1052
1104
  //#region ../core/src/rendering/immediate/order.js
1053
- function ot(e, t, n, r, i) {
1105
+ function lt(e, t, n, r, i) {
1054
1106
  let a = [], o = [];
1055
1107
  for (let i = t; i < n; i++) {
1056
1108
  let t = e[i];
@@ -1059,4 +1111,4 @@ function ot(e, t, n, r, i) {
1059
1111
  return i.map((e) => e === "matching" ? a : o);
1060
1112
  }
1061
1113
  //#endregion
1062
- export { V as A, W as C, M as D, I as E, c as F, u as I, f as M, m as N, N as O, g as P, H as S, U as T, xe as _, Ke as a, de as b, Pe as c, Ne as d, De as f, we as g, Ce as h, nt as i, p as j, B as k, Fe as l, Te as m, it as n, Ye as o, Oe as p, at as r, qe as s, ot as t, Me as u, Se as v, ee as w, fe as x, pe as y };
1114
+ export { V as A, ee as C, I as D, W as E, x as F, f as I, m as L, v as M, _ as N, B as O, y as P, pe as S, U as T, Ee as _, Ye as a, me as b, Le as c, Ie as d, Pe as f, Te as g, De as h, at as i, H as j, F as k, Re as l, Ae as m, st as n, Qe as o, ke as p, ct as r, Xe as s, lt as t, Fe as u, Ce as v, ne as w, fe as x, we as y };