@genome-spy/app 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
  2. package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
  3. package/dist/{agentApi-8hMSlqAQ.js → agentApi-BclFF9zB.js} +7130 -7509
  4. package/dist/agentApi.es.js +4344 -4015
  5. package/dist/agentShared.es.js +431 -458
  6. package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
  7. package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
  8. package/dist/{canvas2d-Bd8H8MMo.js → canvas2d-8MSf70d4.js} +78 -86
  9. package/dist/{canvas2d-D6VYooRf.js → canvas2d-BwGNI_Rx.js} +83 -91
  10. package/dist/clipOptions-SrrxeAEU.js +4316 -0
  11. package/dist/clipOptions-clBEbkjv.js +4326 -0
  12. package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
  13. package/dist/color-uTRRsy8i.js +116 -0
  14. package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
  15. package/dist/{containerView-aEVmYmkA.js → containerView-BItRtKqu.js} +5 -1
  16. package/dist/{containerView-CRJSc4bM.js → containerView-CWa6ZIJW.js} +5 -1
  17. package/dist/{debug-CQ0agCrd.js → debug-23s-jja_.js} +3 -2
  18. package/dist/{debug-DkIMiGdW.js → debug-CWRxvAss.js} +2 -3
  19. package/dist/dialog.es.js +1 -1
  20. package/dist/dist-CmY6iewb.js +1501 -0
  21. package/dist/dist-D6xbz5Ks.js +1501 -0
  22. package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
  23. package/dist/esm-BUkWqSr2.js +299 -0
  24. package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
  25. package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
  26. package/dist/esm-C6erfjPM.js +252 -0
  27. package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
  28. package/dist/esm-CqY5ezGz.js +1249 -0
  29. package/dist/esm-DfMIJ_N2.js +1522 -0
  30. package/dist/esm-Dls41IbZ.js +787 -0
  31. package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
  32. package/dist/esm-aGLCvYRP.js +238 -0
  33. package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
  34. package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
  35. package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
  36. package/dist/flowNode-BSjy0Wz3.js +1306 -0
  37. package/dist/flowOutput-D5qpxWe0.js +183 -0
  38. package/dist/index.es.js +4756 -5528
  39. package/dist/index.js +707 -547
  40. package/dist/inflate-BdC5KvHn.js +886 -0
  41. package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
  42. package/dist/{markUtils-CvLDz744.js → markUtils-RaatLEa-.js} +9 -6
  43. package/dist/metadataUtils-DxEPe0vj.js +879 -0
  44. package/dist/{order-BVvkjDRT.js → order-BnKzKjt4.js} +383 -347
  45. package/dist/{order-DmMoZsi1.js → order-BpJnq_nV.js} +375 -339
  46. package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
  47. package/dist/{rasterExport-jeRVq6kY.js → rasterExport-B-WrX1pa.js} +5 -5
  48. package/dist/{rasterExport-DxvowWjH.js → rasterExport-C_vx4Jwd.js} +3 -3
  49. package/dist/{rasterization-DFj3Cvx4.js → rasterization-QktH8Sn2.js} +1 -1
  50. package/dist/{rectangle-Dl4Dy0hS.js → rectangle-BAdoDPXu.js} +34 -31
  51. package/dist/{renderCanvas2D-Bfm1NHFu.js → renderCanvas2D-CsRO78Pq.js} +88 -87
  52. package/dist/{renderCanvas2D-DVjhp834.js → renderCanvas2D-Y7pkRzbC.js} +93 -92
  53. package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
  54. package/dist/{indexer-DOYMJ-Md.js → scaleNull-CVzag4z8.js} +2 -12
  55. package/dist/{indexer-DDC0YRGn.js → scaleNull-Pbz7QGnl.js} +2 -12
  56. package/dist/{scalePosition-0aeqp_kz.js → scalePosition-CRXa0rCC.js} +1 -1
  57. package/dist/schema.json +3801 -816
  58. package/dist/{svg-Bm2zxBPu.js → svg-BBMtLgtM.js} +369 -285
  59. package/dist/{svg-CkfuhONt.js → svg-JjWL6U-T.js} +371 -287
  60. package/dist/{svgRasterizer-DoRQEqFA.js → svgRasterizer-6OcftuoI.js} +2 -2
  61. package/dist/{svgRasterizer-raDDhBF-.js → svgRasterizer-DkNRaCPs.js} +4 -4
  62. package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
  63. package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
  64. package/dist/url-DeOdSRrv.js +183 -0
  65. package/dist/{viewError-BkJeVYXA.js → viewError-B0TMfOpB.js} +1 -1
  66. package/dist/{viewError-IYqyluc7.js → viewError-D9aO90cI.js} +1 -1
  67. package/dist/{viewSelectors-7LyasQN-.js → viewSelectors-DkFvo33d.js} +832 -734
  68. package/dist/{viewSelectors-CbmkSQRT.js → viewSelectors-lM93fHAq.js} +900 -802
  69. package/dist/{viewUtils-DuddMNNw.js → viewUtils-0SJOewM6.js} +1861 -2459
  70. package/dist/webgl-CXIO3OQz.js +5782 -0
  71. package/dist/webgl-Pdvfhio5.js +5783 -0
  72. package/package.json +7 -5
  73. package/src/agentApi/index.d.ts +3 -2
  74. package/src/agentShared/index.d.ts +2 -0
  75. package/src/appTypes.d.ts +1 -6
  76. package/src/embedTypes.d.ts +36 -1
  77. package/src/index.d.ts +6 -0
  78. package/src/spec/sampleView.d.ts +68 -13
  79. package/src/state/paramProvenanceTypes.d.ts +25 -2
  80. package/src/state.d.ts +14 -52
  81. package/dist/clipOptions-DElJ8dTZ.js +0 -3097
  82. package/dist/clipOptions-D_wBNhzs.js +0 -3087
  83. package/dist/esm-Dndm-NaA.js +0 -1193
  84. package/dist/vega-scale-BoGHANI7.js +0 -2446
  85. package/dist/vega-scale-o9TRyzYH.js +0 -2443
  86. package/dist/webgl-CQfvgnxo.js +0 -5633
  87. package/dist/webgl-DVYkXtiZ.js +0 -5632
@@ -1,54 +1,272 @@
1
- import { Cn as e, G as t, K as n, S as r, Tn as i, Xt as a, bn as o, f as s, g as c, h as l, in as u, jn as d, l as f, mn as p, o as m, p as h, t as ee, ut as g, wn as te, y as _, yt as ne } from "./clipOptions-DElJ8dTZ.js";
2
- import { E as re, m as ie, y as v } from "./vega-scale-o9TRyzYH.js";
3
- import { a as y, n as ae, r as oe, t as b } from "./viewError-BkJeVYXA.js";
4
- import { t as se } from "./warning-CpIIpk8e.js";
5
- //#region ../../node_modules/flatqueue/index.js
6
- var x = class {
7
- constructor(e = Infinity, t = Float64Array, n = Uint32Array) {
8
- let r = e !== Infinity;
9
- this.ids = r ? new n(e) : [], this.values = r ? new t(e) : [], this.capacity = e, this.length = 0;
1
+ import { An as e, B as t, Ft as n, Hn as r, Ht as i, It as a, O as o, Pt as s, Rt as c, U as l, Un as u, Wn as d, Xn as f, Y as p, _t as m, dn as h, jt as g, l as ee, o as te, on as ne, ot as re, q as ie, t as ae, vt as oe, y as _, yn as se, zn as v, zt as ce } from "./clipOptions-SrrxeAEU.js";
2
+ import { a as y, n as le, r as ue, t as b } from "./viewError-B0TMfOpB.js";
3
+ import { c as de, o as fe, s as pe, t as me } from "./flowOutput-D5qpxWe0.js";
4
+ import { t as he } from "./warning-CpIIpk8e.js";
5
+ //#region ../core/src/view/layout/flexLayout.js
6
+ function ge(e, t, n = {}) {
7
+ let { sizes: r } = E(e, t, n.spacing || 0);
8
+ return _e(e, r, t, n);
9
+ }
10
+ function _e(e, t, n, { spacing: r, devicePixelRatio: i, offset: a, reverse: o } = {}) {
11
+ r ||= 0, a ||= 0;
12
+ let s = 0, c = 0;
13
+ for (let n = 0; n < e.length; n++) s += t[n], C(e[n]) || c++;
14
+ let l = s + Math.max(0, c - 1) * r, u = i === void 0 ? (e) => e : (e) => Math.round(e * i) / i, d = 0, f = [], p = (e) => {
15
+ let t = d;
16
+ if (!t) return;
17
+ let n = (e ? r : 0) * (o ? -1 : 1);
18
+ m -= n;
19
+ for (let e = 0; e < t; e++) f.push({
20
+ location: m + (e + 1) / (t + 1) * n,
21
+ size: 0
22
+ });
23
+ m += n, d = 0;
24
+ }, m = o ? Math.max(n, l) : 0 + a;
25
+ if (e.length == 1 && C(e[0])) return [{
26
+ location: m,
27
+ size: 0
28
+ }];
29
+ for (let n = 0; n < e.length; n++) {
30
+ let i = e[n];
31
+ if (C(i)) d++;
32
+ else {
33
+ p(f.length > 0);
34
+ let e = t[n];
35
+ o && (m -= e), f.push({
36
+ location: u(m),
37
+ size: u(e)
38
+ }), o ? m -= r : m += e + r;
39
+ }
10
40
  }
11
- clear() {
12
- this.length = 0;
13
- }
14
- push(e, t) {
15
- if (this.length === this.capacity) throw RangeError("Queue is at capacity.");
16
- let n = this.length++;
17
- for (; n > 0;) {
18
- let e = n - 1 >> 1, r = this.values[e];
19
- if (t >= r) break;
20
- this.ids[n] = this.ids[e], this.values[n] = r, n = e;
41
+ return m += o ? r : -r, p(!1), f;
42
+ }
43
+ function ve(e, { spacing: t } = { spacing: 0 }) {
44
+ let n = 0;
45
+ for (let r of e) n += k(r) + (C(r) ? 0 : t);
46
+ return Math.max(0, n - t);
47
+ }
48
+ function ye(e, t, { spacing: n = 0 } = {}) {
49
+ let r = [], i = [], a = 0, o = 0;
50
+ for (let [s, c] of e.entries()) {
51
+ let e = k(c), l = !C(c), u = o && l ? n : 0;
52
+ i.length && a + u + e > t && (r.push(i), i = [], a = 0, o = 0), i.push(s), a += (o && l ? n : 0) + e, o += +!!l;
53
+ }
54
+ return i.length && r.push(i), r;
55
+ }
56
+ function be(e) {
57
+ let t = 0, n = 0, r = 0, i, a = !0;
58
+ for (let o of e) {
59
+ t = Math.max(t, o.px ?? 0), n = Math.max(n, o.grow ?? 0), r = Math.max(r, k(o));
60
+ let e = A(o);
61
+ e === void 0 ? a = !1 : i = i === void 0 ? e : Math.max(i, e);
62
+ }
63
+ return N({
64
+ px: t,
65
+ grow: n,
66
+ minPx: r,
67
+ maxPx: a ? i : void 0
68
+ });
69
+ }
70
+ function xe(e, t = 0, n = 0) {
71
+ let r = Math.max(0, e.length - 1) * t, i = {
72
+ px: r,
73
+ grow: e.length ? 0 : n,
74
+ minPx: r,
75
+ maxPx: r
76
+ }, a = e.length > 0;
77
+ for (let t of e) {
78
+ i.px += w(t.px), i.grow += w(t.grow), i.minPx += k(t);
79
+ let e = A(t);
80
+ e === void 0 ? a = !1 : i.maxPx += e;
81
+ }
82
+ return a || delete i.maxPx, N(i);
83
+ }
84
+ var x = class e {
85
+ constructor(e, t) {
86
+ this.width = e, this.height = t;
87
+ }
88
+ addPadding(e) {
89
+ return this.#e(e.width, e.height);
90
+ }
91
+ subtractPadding(e) {
92
+ return this.#e(-e.width, -e.height);
93
+ }
94
+ #e(t, n) {
95
+ return new e(M(this.width, t), M(this.height, n));
96
+ }
97
+ isGrowing() {
98
+ return !!(this.width.grow || this.height.grow);
99
+ }
100
+ }, Se = Object.freeze({
101
+ px: 0,
102
+ grow: 0
103
+ }), S = new x(Se, Se);
104
+ function C(e) {
105
+ return !e.px && !e.grow && !e.minPx;
106
+ }
107
+ function Ce(e, t) {
108
+ return !e || !t ? !1 : e.px === t.px && e.grow === t.grow && e.minPx === t.minPx && e.maxPx === t.maxPx;
109
+ }
110
+ function w(e) {
111
+ return e || 0;
112
+ }
113
+ function T(e) {
114
+ return e && (r(e.px) || r(e.grow) || r(e.minPx) || r(e.maxPx));
115
+ }
116
+ function we(e) {
117
+ if (q(e)) throw Error("parseSizeDef does not accept step-based sizes.");
118
+ if (T(e)) return D(e), N(e);
119
+ if (r(e)) return {
120
+ px: e,
121
+ grow: 0
122
+ };
123
+ if (e === "container" || !e) return {
124
+ px: 0,
125
+ grow: 1
126
+ };
127
+ throw Error(`Invalid sizeDef: ${e}`);
128
+ }
129
+ function E(e, t, n = 0) {
130
+ let r = !1;
131
+ for (let t of e) D(t), r ||= j(t);
132
+ if (!r) return Te(e, t, n);
133
+ let i = Array(e.length).fill(0), a = [];
134
+ for (let t = 0; t < e.length; t++) C(e[t]) || a.push(t);
135
+ let o = Math.max(0, a.length - 1) * n, s = Math.max(0, t - o), c = /* @__PURE__ */ new Set();
136
+ for (let t of a) {
137
+ let n = e[t];
138
+ w(n.grow) || (i[t] = O(w(n.px), n), c.add(t));
139
+ }
140
+ let l = 0;
141
+ for (;;) {
142
+ let t = 0, n = 0, r = 0;
143
+ for (let o of a) c.has(o) ? r += i[o] : (t += w(e[o].px), n += w(e[o].grow));
144
+ if (!n) {
145
+ for (let t of a) c.has(t) || (i[t] = O(w(e[t].px), e[t]), c.add(t));
146
+ break;
21
147
  }
22
- this.ids[n] = e, this.values[n] = t;
23
- }
24
- pop() {
25
- if (this.length === 0) return;
26
- let e = this.ids, t = this.values, n = e[0], r = --this.length;
27
- if (r > 0) {
28
- let n = e[r], i = t[r], a = 0, o = r >> 1;
29
- for (; a < o;) {
30
- let n = (a << 1) + 1, o = n + 1, s = n + (+(o < r) & t[o] < t[n]);
31
- if (t[s] >= i) break;
32
- e[a] = e[s], t[a] = t[s], a = s;
33
- }
34
- e[a] = n, t[a] = i;
148
+ let o = Math.max(0, s - r - t);
149
+ l = o / n;
150
+ let u = 0, d = [], f = [];
151
+ for (let t of a) {
152
+ if (c.has(t)) continue;
153
+ let r = e[t], a = w(r.px) + w(r.grow) / n * o, s = O(a, r);
154
+ i[t] = s;
155
+ let l = s - a;
156
+ u += l, l > 0 ? d.push(t) : l < 0 && f.push(t);
35
157
  }
36
- return n;
158
+ if (!d.length && !f.length) break;
159
+ if (u > 0) for (let e of d) c.add(e);
160
+ else if (u < 0) for (let e of f) c.add(e);
161
+ else for (let e of a) c.add(e);
162
+ }
163
+ return {
164
+ sizes: i,
165
+ growth: l
166
+ };
167
+ }
168
+ function Te(e, t, n) {
169
+ let r = 0, i = 0;
170
+ for (let t of e) r += w(t.px) + (C(t) ? 0 : n), i += w(t.grow);
171
+ r -= n;
172
+ let a = Math.max(0, t - r), o = Array(e.length);
173
+ for (let t = 0; t < e.length; t++) {
174
+ let n = e[t];
175
+ o[t] = C(n) ? 0 : w(n.px) + (i ? w(n.grow) / i * a : 0);
176
+ }
177
+ return {
178
+ sizes: o,
179
+ growth: i ? a / i : 0
180
+ };
181
+ }
182
+ function D(e) {
183
+ if (e.minPx !== void 0 && e.maxPx !== void 0 && e.minPx > e.maxPx) throw Error("SizeDef minPx cannot be greater than maxPx.");
184
+ }
185
+ function O(e, t) {
186
+ return Math.min(Math.max(e, t.minPx ?? 0), t.maxPx ?? Infinity);
187
+ }
188
+ function k(e) {
189
+ return O(w(e.px), e);
190
+ }
191
+ function A(e) {
192
+ return e.maxPx ?? (w(e.grow) ? void 0 : k(e));
193
+ }
194
+ function j(e) {
195
+ return e.minPx !== void 0 || e.maxPx !== void 0;
196
+ }
197
+ function M(e, t) {
198
+ return N({
199
+ px: (e.px ?? 0) + t,
200
+ grow: e.grow,
201
+ minPx: e.minPx === void 0 ? void 0 : Math.max(0, e.minPx + t),
202
+ maxPx: e.maxPx === void 0 ? void 0 : Math.max(0, e.maxPx + t)
203
+ });
204
+ }
205
+ function N(e) {
206
+ let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i = j(e);
207
+ return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx > w(e.px) && (t.minPx = e.minPx), e.maxPx !== void 0 && (w(t.grow) || e.maxPx < w(e.px)) && (t.maxPx = e.maxPx), t;
208
+ }
209
+ //#endregion
210
+ //#region ../core/src/view/layout/padding.js
211
+ var P = class e {
212
+ constructor(e, t, n, r) {
213
+ this.top = e || 0, this.right = t || 0, this.bottom = n || 0, this.left = r || 0;
214
+ }
215
+ get width() {
216
+ return this.left + this.right;
217
+ }
218
+ get height() {
219
+ return this.top + this.bottom;
220
+ }
221
+ expand(t) {
222
+ return t <= 0 ? this : new e(this.top + t, this.right + t, this.bottom + t, this.left + t);
223
+ }
224
+ add(t) {
225
+ return new e(this.top + t.top, this.right + t.right, this.bottom + t.bottom, this.left + t.left);
226
+ }
227
+ subtract(t) {
228
+ return new e(this.top - t.top, this.right - t.right, this.bottom - t.bottom, this.left - t.left);
229
+ }
230
+ union(t) {
231
+ return new e(Math.max(this.top, t.top), Math.max(this.right, t.right), Math.max(this.bottom, t.bottom), Math.max(this.left, t.left));
232
+ }
233
+ getHorizontal() {
234
+ return new e(0, this.right, 0, this.left);
235
+ }
236
+ getVertical() {
237
+ return new e(this.top, 0, this.bottom, 0);
238
+ }
239
+ get horizontalTotal() {
240
+ return this.left + this.right;
241
+ }
242
+ get verticalTotal() {
243
+ return this.top + this.bottom;
244
+ }
245
+ static createFromConfig(e) {
246
+ return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) : F;
37
247
  }
38
- peek() {
39
- return this.length > 0 ? this.ids[0] : void 0;
248
+ static createFromRecord(t) {
249
+ return new e(t.top, t.right, t.bottom, t.left);
40
250
  }
41
- peekValue() {
42
- return this.length > 0 ? this.values[0] : void 0;
251
+ static zero() {
252
+ return F;
43
253
  }
44
- shrink() {
45
- Array.isArray(this.ids) && (this.ids.length = this.length), Array.isArray(this.values) && (this.values.length = this.length);
254
+ static createUniformPadding(t) {
255
+ return new e(t, t, t, t);
46
256
  }
47
- }, S = Symbol("runtimeNode"), ce = 1e6;
48
- function le(e) {
257
+ };
258
+ function Ee(e, t, n = P.zero()) {
259
+ return t ? new P(t.top === !1 ? n.top : e.top, t.right === !1 ? n.right : e.right, t.bottom === !1 ? n.bottom : e.bottom, t.left === !1 ? n.left : e.left) : e;
260
+ }
261
+ var F = P.createUniformPadding(0);
262
+ Object.freeze(F);
263
+ //#endregion
264
+ //#region ../core/src/paramRuntime/graphRuntime.js
265
+ var I = Symbol("runtimeNode"), L = 1e6;
266
+ function De(e) {
49
267
  return e ? (t, n) => e.addDisposer(t, n) : () => () => void 0;
50
268
  }
51
- function ue(e, t, n = !0) {
269
+ function R(e, t, n = !0) {
52
270
  let r = {
53
271
  id: e.id,
54
272
  name: e.name,
@@ -63,7 +281,7 @@ function ue(e, t, n = !0) {
63
281
  };
64
282
  }
65
283
  };
66
- return Object.defineProperty(r, S, {
284
+ return Object.defineProperty(r, I, {
67
285
  enumerable: !1,
68
286
  configurable: !1,
69
287
  writable: !1,
@@ -72,18 +290,25 @@ function ue(e, t, n = !0) {
72
290
  t(e);
73
291
  } }) : r;
74
292
  }
75
- function de(e) {
76
- let t = e[S];
293
+ function z(e) {
294
+ let t = e[I];
77
295
  if (!t) throw Error("ParamRef is not bound to this graph runtime. Expected runtime-created ref.");
78
296
  return t;
79
297
  }
80
- function fe(e) {
81
- return typeof e.rank == "number" ? e.rank : de(e).rank;
298
+ function Oe(e, t) {
299
+ let n = z(t), r = /* @__PURE__ */ new Set(), i = (e) => {
300
+ let t = z(e);
301
+ return t === n || !r.has(t) && (r.add(t), (t.dependencies ?? []).some(i));
302
+ };
303
+ return i(e);
304
+ }
305
+ function ke(e) {
306
+ return typeof e.rank == "number" ? e.rank : z(e).rank;
82
307
  }
83
- function pe(e) {
308
+ function Ae(e) {
84
309
  for (let t of e) t();
85
310
  }
86
- var me = class {
311
+ var je = class {
87
312
  #e = 1;
88
313
  #t = 1;
89
314
  #n = 0;
@@ -97,13 +322,13 @@ var me = class {
97
322
  #u = /* @__PURE__ */ new Map();
98
323
  #d = /* @__PURE__ */ new Set();
99
324
  #f = /* @__PURE__ */ new Set();
100
- #p = new x();
101
- #m = new x();
325
+ #p = new pe();
326
+ #m = new pe();
102
327
  #h = /* @__PURE__ */ new Set();
103
328
  #g;
104
329
  #_;
105
330
  constructor(e = {}) {
106
- this.#g = le(e.lifecycleRegistry), this.#_ = e.onError;
331
+ this.#g = De(e.lifecycleRegistry), this.#_ = e.onError;
107
332
  }
108
333
  createWritable(e, t, n, r, i = {}) {
109
334
  let a = "n" + this.#e++, o = i.notify ?? !0, s = {
@@ -125,7 +350,7 @@ var me = class {
125
350
  }, l = () => {
126
351
  s.disposed = !0, s.listeners.clear(), u();
127
352
  }, u = this.#g(e, l);
128
- return Object.assign(ue(s, c, o), { dispose: l });
353
+ return Object.assign(R(s, c, o), { dispose: l });
129
354
  }
130
355
  computed(e, t, n, r, i = {}) {
131
356
  return this.#v(e, t, n, r, i);
@@ -160,19 +385,13 @@ var me = class {
160
385
  })), l = c(), u = () => {
161
386
  s.disposed || (s.disposed = !0, d(), l.forEach((e) => e()), s.listeners.clear(), this.#d.delete(s));
162
387
  }, d = this.#g(e, u);
163
- return Object.assign(ue(s), {
388
+ return Object.assign(R(s), {
164
389
  dispose: u,
165
390
  rebind: (e, n) => {
166
391
  if (s.disposed) throw Error("Cannot rebind disposed operation: " + t);
167
- let r = /* @__PURE__ */ new Set(), i = (e) => {
168
- let n = e[S];
169
- if (n === s) throw Error("Reactive dependency cycle: " + t);
170
- if (!r.has(n)) {
171
- r.add(n);
172
- for (let e of n?.dependencies ?? []) i(e);
173
- }
174
- };
175
- e.forEach(i), l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#C(s), this.#p.clear();
392
+ let r = R(s);
393
+ if (e.some((e) => Oe(e, r))) throw Error("Reactive dependency cycle: " + t);
394
+ l.forEach((e) => e()), s.dependencies = e, s.fn = n, this.#n++, l = c(), this.#C(s), this.#p.clear();
176
395
  for (let e of this.#d) this.#p.push(e, this.#T(e.rank));
177
396
  this.#m.clear();
178
397
  for (let e of this.#f) this.#m.push(e, this.#T(e.rank));
@@ -266,7 +485,7 @@ var me = class {
266
485
  #y(e) {
267
486
  this.#s++;
268
487
  try {
269
- pe(e);
488
+ Ae(e);
270
489
  } catch (e) {
271
490
  throw this.#c = !1, !this.#o && this.#s === 1 && this.#b(e), e;
272
491
  } finally {
@@ -310,25 +529,17 @@ var me = class {
310
529
  }
311
530
  #S(e) {
312
531
  let t = -1, n = 0;
313
- return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, fe(t)), 0), t = this.#n), n);
532
+ return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, ke(t)), 0), t = this.#n), n);
314
533
  }
315
534
  #C(e) {
316
- if (this.#d.has(e)) {
317
- this.#E();
318
- return;
319
- }
320
- this.#d.add(e), this.#p.push(e, this.#T(e.rank)), this.#E();
535
+ this.#d.has(e) || (this.#d.add(e), this.#p.push(e, this.#T(e.rank))), this.#E();
321
536
  }
322
537
  #w(e) {
323
- if (this.#f.has(e)) {
324
- this.#E();
325
- return;
326
- }
327
- this.#f.add(e), this.#m.push(e, this.#T(e.rank)), this.#E();
538
+ this.#f.has(e) || (this.#f.add(e), this.#m.push(e, this.#T(e.rank))), this.#E();
328
539
  }
329
540
  #T(e) {
330
- let t = this.#t % ce;
331
- return this.#t += 1, e * ce + t;
541
+ let t = this.#t % L;
542
+ return this.#t += 1, e * L + t;
332
543
  }
333
544
  #E() {
334
545
  this.#r > 0 || this.#a || this.#o || (this.#a = !0, queueMicrotask(() => {
@@ -344,7 +555,7 @@ var me = class {
344
555
  this.#h.clear();
345
556
  }
346
557
  }
347
- }, he = class {
558
+ }, Me = class {
348
559
  #e = 1;
349
560
  #t = /* @__PURE__ */ new Map();
350
561
  createOwner(e, t) {
@@ -365,7 +576,7 @@ var me = class {
365
576
  t.clear(), this.#t.delete(e);
366
577
  }
367
578
  }
368
- }, ge = class {
579
+ }, Ne = class {
369
580
  #e = 1;
370
581
  #t = /* @__PURE__ */ new Map();
371
582
  createRootScope(e) {
@@ -397,7 +608,7 @@ var me = class {
397
608
  t.params.clear(), t.initializers.clear();
398
609
  }
399
610
  registerInitializer(e, t, n) {
400
- _(t);
611
+ i(t);
401
612
  let r = this.#t.get(e);
402
613
  if (!r) throw Error("Unknown scope: " + e);
403
614
  if (r.params.has(t) || r.initializers.has(t)) throw Error(`Parameter "${t}" already exists in scope ${e}`);
@@ -407,14 +618,14 @@ var me = class {
407
618
  });
408
619
  }
409
620
  register(e, t, n) {
410
- _(t);
621
+ i(t);
411
622
  let r = this.#t.get(e);
412
623
  if (!r) throw Error("Unknown scope: " + e);
413
624
  if (r.params.has(t) || r.initializers.get(t)?.initializing === !1) throw Error("Parameter \"" + t + "\" already exists in scope " + e);
414
625
  return r.params.set(t, n), n;
415
626
  }
416
627
  resolve(e, t) {
417
- _(t);
628
+ i(t);
418
629
  let n = e;
419
630
  for (; n;) {
420
631
  let e = this.#t.get(n);
@@ -438,19 +649,19 @@ var me = class {
438
649
  };
439
650
  //#endregion
440
651
  //#region ../core/src/paramRuntime/expressionCompiler.js
441
- function _e(e, t = {}, r = {}) {
442
- return n(e, t, r);
652
+ function Pe(e, t = {}, n = {}) {
653
+ return oe(e, t, n);
443
654
  }
444
655
  //#endregion
445
656
  //#region ../core/src/paramRuntime/expressionRef.js
446
- function C(e, t, n = {}) {
447
- let r = {}, i = _e(e, r, n), o = /* @__PURE__ */ new Map();
657
+ function Fe(e, t, n = {}) {
658
+ let r = {}, i = Pe(e, r, n), a = /* @__PURE__ */ new Map();
448
659
  try {
449
660
  for (let n of i.globals) {
450
- if (o.has(n)) continue;
661
+ if (a.has(n)) continue;
451
662
  let i = t(n);
452
663
  if (!i) throw Error("Unknown variable \"" + n + "\" in expression: " + e);
453
- o.set(n, i), Object.defineProperty(r, n, {
664
+ a.set(n, i), Object.defineProperty(r, n, {
454
665
  enumerable: !0,
455
666
  get() {
456
667
  return i.get();
@@ -458,44 +669,44 @@ function C(e, t, n = {}) {
458
669
  });
459
670
  }
460
671
  } catch (e) {
461
- throw a(e, n.specLocation);
672
+ throw g(e, n.specLocation);
462
673
  }
463
- let s = /* @__PURE__ */ new Set();
674
+ let o = /* @__PURE__ */ new Set();
464
675
  return i.subscribe = (e) => {
465
676
  let t = [];
466
- for (let n of o.values()) t.push(n.subscribe(e));
677
+ for (let n of a.values()) t.push(n.subscribe(e));
467
678
  for (let n of i.scaleDependencies ?? []) t.push(n.subscribe(e));
468
679
  let n = !0, r = () => {
469
- n && (n = !1, s.delete(r), t.forEach((e) => e()));
680
+ n && (n = !1, o.delete(r), t.forEach((e) => e()));
470
681
  };
471
- return s.add(r), r;
682
+ return o.add(r), r;
472
683
  }, i.invalidate = () => {
473
- for (let e of s) e();
474
- s.clear();
684
+ for (let e of o) e();
685
+ o.clear();
475
686
  }, i.createSnapshotEvaluator = () => {
476
687
  let e = {};
477
- for (let t of Object.keys(r)) o.has(t) || (e[t] = r[t]);
478
- for (let [t, n] of o) n.batchStable || Object.defineProperty(e, t, {
688
+ for (let t of Object.keys(r)) a.has(t) || (e[t] = r[t]);
689
+ for (let [t, n] of a) n.batchStable || Object.defineProperty(e, t, {
479
690
  enumerable: !0,
480
691
  get: () => n.get()
481
692
  });
482
693
  let t = Object.assign(i.createEvaluator(e), { refresh() {
483
- for (let [t, n] of o) n.batchStable && (e[t] = n.get());
694
+ for (let [t, n] of a) n.batchStable && (e[t] = n.get());
484
695
  } });
485
696
  return t.refresh(), t;
486
- }, i.identifier = () => i.code + "|" + Array.from(o.values()).map((e) => e.id).concat((i.scaleDependencies ?? []).map((e) => e.id)).join(","), i.dependencies = Array.from(o.values()).concat(i.scaleDependencies ?? []), {
697
+ }, i.identifier = () => i.code + "|" + Array.from(a.values()).map((e) => e.id).concat((i.scaleDependencies ?? []).map((e) => e.id)).join(","), i.dependencies = Array.from(a.values()).concat(i.scaleDependencies ?? []), {
487
698
  expression: i,
488
699
  dependencies: i.dependencies
489
700
  };
490
701
  }
491
702
  //#endregion
492
703
  //#region ../core/src/paramRuntime/paramRuntime.js
493
- var ve = class {
494
- #e = new he();
704
+ var Ie = class {
705
+ #e = new Me();
495
706
  #t;
496
- #n = new ge();
707
+ #n = new Ne();
497
708
  constructor(e = {}) {
498
- this.#t = new me({
709
+ this.#t = new je({
499
710
  lifecycleRegistry: this.#e,
500
711
  onError: e.onError
501
712
  });
@@ -524,11 +735,14 @@ var ve = class {
524
735
  return this.#n.register(e, t, a);
525
736
  }
526
737
  registerDerived(e, t, n, r) {
527
- let { expression: i, dependencies: a } = C(n, (t) => this.resolve(r?.expressionScope ?? e, t), r), o = this.#n.getOwnerId(e), s = this.#t.computed(o, t, a, () => i(null));
738
+ let { expression: i, dependencies: a } = Fe(n, (t) => this.resolve(r?.expressionScope ?? e, t), r), o = this.#n.getOwnerId(e), s = this.#t.computed(o, t, a, () => i(null));
528
739
  return this.#n.register(e, t, s);
529
740
  }
741
+ registerComputed(e, t, n, r) {
742
+ return this.#n.register(e, t, this.#t.computed(this.#n.getOwnerId(e), t, n, r));
743
+ }
530
744
  createExpression(e, t, n) {
531
- let { expression: r } = C(t, (t) => this.resolve(e, t), n);
745
+ let { expression: r } = Fe(t, (t) => this.resolve(e, t), n);
532
746
  return r;
533
747
  }
534
748
  resolve(e, t) {
@@ -561,28 +775,82 @@ var ve = class {
561
775
  whenPropagated(e) {
562
776
  return this.#t.whenPropagated(e);
563
777
  }
564
- }, ye = (e) => new Promise((t) => setTimeout(t, e));
565
- function be() {
778
+ }, Le = class {
779
+ #e;
780
+ #t;
781
+ #n;
782
+ #r;
783
+ #i = /* @__PURE__ */ new Set();
784
+ #a = !1;
785
+ #o;
786
+ #s;
787
+ constructor(e, t, n) {
788
+ this.#e = e, this.#t = t, this.#n = n, this.#o = e.signal("intervalCompletion", 0), this.#s = e.effect([e.getParamRef(t), this.#o], () => {
789
+ if (this.#a) {
790
+ this.#a = !1;
791
+ for (let n of Array.from(this.#i)) try {
792
+ n(e.getValue(t));
793
+ } catch (e) {
794
+ console.error(e);
795
+ }
796
+ }
797
+ });
798
+ }
799
+ beforeWrite(e, t) {
800
+ let n = this.#n;
801
+ if (n) {
802
+ if (e?.type !== "interval") throw Error(`Parameter "${this.#t}" requires an interval selection.`);
803
+ re(e.intervals, n);
804
+ }
805
+ this.#r && t !== this.#r.host && this.cancel(), this.#a = !this.#r && !fe(e, this.#e.getValue(this.#t));
806
+ }
807
+ begin(e, t) {
808
+ this.cancel(), this.#r = {
809
+ host: e,
810
+ cancel: t,
811
+ initial: structuredClone(this.#e.getValue(this.#t))
812
+ };
813
+ }
814
+ finish(e, t) {
815
+ if (this.#r?.host !== e) return;
816
+ let n = this.#r.initial;
817
+ this.#r = void 0, t && !fe(n, this.#e.getValue(this.#t)) && (this.#a = !0, this.#o.set(this.#o.get() + 1), this.#e.flushNow());
818
+ }
819
+ cancel() {
820
+ let e = this.#r;
821
+ this.#r = void 0, e?.cancel();
822
+ }
823
+ clear() {
824
+ this.cancel();
825
+ let e = this.#e.getValue(this.#t);
826
+ ie(e) && this.#e.setValue(this.#t, l(Object.keys(e.intervals)));
827
+ }
828
+ subscribeCommit(e) {
829
+ return this.#i.add(e), () => {
830
+ this.#i.delete(e);
831
+ };
832
+ }
833
+ dispose() {
834
+ this.cancel(), this.#s(), this.#i.clear();
835
+ }
836
+ }, Re = (e) => new Promise((t) => setTimeout(t, e));
837
+ function ze() {
566
838
  return { canceled: !1 };
567
839
  }
568
- function xe(e) {
840
+ function Be(e) {
569
841
  let t = e.requestAnimationFrame || window.requestAnimationFrame, n = e.signal, r = e.cancelToken, i = () => new Promise((i, a) => {
570
842
  if (r?.canceled) return i();
571
843
  if (n?.aborted) return a("aborted");
572
844
  let o = performance.now(), s = o + (e.duration || 1e3), c = typeof e.from == "number" ? e.from : 0, l = typeof e.to == "number" ? e.to : 1, u = e.easingFunction || ((e) => e), d = (e) => (e - o) / (s - o), f = (e) => e * (l - c) + c, p = (e) => Math.max(0, Math.min(1, e)), m = (o) => {
573
- if (r?.canceled) {
574
- i();
575
- return;
576
- }
577
- n?.aborted ? a("aborted") : (e.onUpdate(f(u(p(d(o))))), o < s ? t(m) : (e.onUpdate(f(u(1))), i()));
845
+ r?.canceled ? i() : n?.aborted ? a("aborted") : (e.onUpdate(f(u(p(d(o))))), o < s ? t(m) : (e.onUpdate(f(u(1))), i()));
578
846
  };
579
847
  t(m);
580
848
  });
581
- return e.delay ? r?.canceled ? Promise.resolve() : n?.aborted ? Promise.reject("aborted") : ye(e.delay).then(i) : i();
849
+ return e.delay ? r?.canceled ? Promise.resolve() : n?.aborted ? Promise.reject("aborted") : Re(e.delay).then(i) : i();
582
850
  }
583
851
  //#endregion
584
852
  //#region ../core/src/utils/animator.js
585
- var Se = class {
853
+ var Ve = class {
586
854
  constructor(e, t) {
587
855
  this._renderCallback = e, this._onError = t, this._renderRequested = !1, this._finalized = !1, this._warn = !1, this._animationFrameRequest = void 0, this.transitions = [], this.transitionsEnabled = !0;
588
856
  }
@@ -613,13 +881,13 @@ var Se = class {
613
881
  this._finalized = !0, this._renderRequested = !1, this.transitions = [], this._animationFrameRequest !== void 0 && (window.cancelAnimationFrame(this._animationFrameRequest), this._animationFrameRequest = void 0);
614
882
  }
615
883
  transition(e) {
616
- return xe({
884
+ return Be({
617
885
  requestAnimationFrame: (e) => this.requestTransition(e),
618
886
  ...e
619
887
  });
620
888
  }
621
889
  };
622
- function w(e, t, n, r, i) {
890
+ function He(e, t, n, r, i) {
623
891
  let a = 0, o = !0, s = !1, c = structuredClone(i), l = c;
624
892
  function u(e, t, n, r) {
625
893
  return t + (e - t) * 2 ** (-n / r);
@@ -638,7 +906,7 @@ function w(e, t, n, r, i) {
638
906
  s || (s = !0, e.requestTransition(d));
639
907
  }
640
908
  function p(n) {
641
- l = n, e.transitionsEnabled === !1 ? (c = l, o = !0, s = !1, e.cancelTransition(d), t(c)) : o && (o = !1, a = Ce(), d(a));
909
+ l = n, e.transitionsEnabled === !1 ? (c = l, o = !0, s = !1, e.cancelTransition(d), t(c)) : o && (o = !1, a = Ue(), d(a));
642
910
  }
643
911
  return p.stop = () => {
644
912
  o = !0, s = !1, e.cancelTransition(d);
@@ -646,168 +914,228 @@ function w(e, t, n, r, i) {
646
914
  l = e, c = e, p.stop(), t(c);
647
915
  }, p;
648
916
  }
649
- function Ce() {
917
+ function Ue() {
650
918
  let e = globalThis.document?.timeline?.currentTime;
651
919
  return typeof e == "number" ? e : performance.now();
652
920
  }
653
921
  //#endregion
654
922
  //#region ../core/src/paramRuntime/viewParamRuntime.js
655
- var T = class {
923
+ var B = class {
656
924
  #e;
657
925
  #t;
658
926
  #n = /* @__PURE__ */ new Map();
659
927
  #r = /* @__PURE__ */ new Map();
660
- #i = /* @__PURE__ */ new Map();
661
- #a = /* @__PURE__ */ new Set();
928
+ #i = !0;
929
+ #a = /* @__PURE__ */ new Map();
662
930
  #o = /* @__PURE__ */ new Map();
663
- #s;
664
- #c = /* @__PURE__ */ new Map();
931
+ #s = /* @__PURE__ */ new Map();
932
+ #c = /* @__PURE__ */ new Set();
665
933
  #l = /* @__PURE__ */ new Map();
666
934
  #u = /* @__PURE__ */ new Map();
667
935
  #d;
668
- #f;
669
- #p;
670
- #m;
936
+ #f = /* @__PURE__ */ new Map();
937
+ #p = /* @__PURE__ */ new Map();
938
+ #m = /* @__PURE__ */ new Map();
671
939
  #h;
672
- #g = !1;
940
+ #g;
941
+ #_;
942
+ #v;
943
+ #y;
944
+ #b = !1;
673
945
  constructor(e, t, n, r = {}) {
674
- this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#h = r.getSpecOrigin, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
675
- let i = this.#d();
676
- i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new ve({ onError: r.onError }), this.#t = this.#e.createScope());
946
+ this.#h = e ?? (() => void 0), this.#g = t ?? (() => void 0), this.#_ = n, this.#y = r.getSpecOrigin, this.#v = r.settleTemporalUpdatesImmediately ?? !1;
947
+ let i = this.#h();
948
+ i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new Ie({ onError: r.onError }), this.#t = this.#e.createScope());
677
949
  }
678
950
  setSelectionSource(e) {
679
- this.#s = e;
951
+ this.#d = e;
680
952
  }
681
953
  findSelectionCapability(e) {
682
- let t = this.findRuntimeForParam(e), n = t && t.#c.get(e);
954
+ let t = this.findRuntimeForParam(e), n = t && t.#f.get(e);
683
955
  if (!n?.size) return;
684
956
  let r = Array.from(n, (t) => ({
685
957
  type: t.kind,
686
958
  components: t.components.map((e) => ({
687
959
  component: e,
688
- type: t.source?.getScaleResolution(e)?.type
960
+ type: t.kind === "interval" ? t.source?.getScaleResolution(e)?.type : void 0
689
961
  })),
690
962
  location: t.source?.name ?? e
691
963
  })), i = r[0], a = JSON.stringify(i.components), o = r.find(({ components: e }) => JSON.stringify(e) !== a);
692
964
  if (o) throw Error(`Conflicting selection declarations for "${e}" in "${i.location}" and "${o.location}".`);
693
965
  return i;
694
966
  }
695
- #_(e) {
967
+ #x(e) {
696
968
  if (!("select" in e)) return;
697
- let t = r(e.select), n = t.type === "interval" ? "interval" : t.toggle ? "multi" : "single", i = t.type === "interval" ? Array.from(new Set(t.encodings)).sort() : [], a = e.push === "outer" ? this.findRuntimeForParam(e.name) : this, o = {
698
- kind: n,
969
+ let n = t(e.select), r = n.type === "interval" ? "interval" : n.encodings ? "categories" : n.toggle ? "multi" : "single", i = n.encodings ? Array.from(new Set(n.encodings)).sort() : [], a = e.push === "outer" ? this.findRuntimeForParam(e.name) : this, o = {
970
+ kind: r,
971
+ toggle: n.type === "point" ? !!n.toggle : void 0,
699
972
  components: i,
700
- source: this.#s
701
- }, s = a.#c.get(e.name) ?? /* @__PURE__ */ new Set(), c = s.values().next().value;
702
- if (c && (c.kind !== n || JSON.stringify(c.components) !== JSON.stringify(i))) throw Error(`Conflicting selection declarations for "${e.name}" in "${c.source?.name ?? e.name}" and "${this.#s?.name ?? e.name}".`);
703
- s.add(o), a.#c.set(e.name, s), this.#e.addScopeDisposer(this.#t, () => {
973
+ source: this.#d
974
+ }, s = a.#f.get(e.name) ?? /* @__PURE__ */ new Set(), c = s.values().next().value;
975
+ if (c && (c.kind !== r || c.toggle !== o.toggle || JSON.stringify(c.components) !== JSON.stringify(i))) throw Error(`Conflicting selection declarations for "${e.name}" in "${c.source?.name ?? e.name}" and "${this.#d?.name ?? e.name}".`);
976
+ s.add(o), a.#f.set(e.name, s), this.#e.addScopeDisposer(this.#t, () => {
704
977
  s.delete(o);
705
978
  });
706
979
  }
707
- #v(e) {
980
+ #S(e) {
708
981
  return {
709
- resolveScaleResolution: this.#f,
982
+ resolveScaleResolution: this.#g,
710
983
  specLocation: this.getSpecLocation(e, ["expr"])
711
984
  };
712
985
  }
986
+ registerOutput(e) {
987
+ return this.registerParam({ name: e }), this.#C(e);
988
+ }
989
+ #C(e) {
990
+ let t = this.#r.get(e);
991
+ if (t) return t;
992
+ if (!this.#i) throw Error("Cannot add a transform output to configured ancestor parameter \"" + e + "\". Create its owner and producer together.");
993
+ let n = this.#s.get(e);
994
+ if (!n || Object.keys(n).some((e) => e !== "name" && e !== "description") || this.#a.get(e)?.size) throw Error("Transform output target \"" + e + "\" must be a bare parameter with no other writers.");
995
+ let r = this.#o.get(e), i = new me(r);
996
+ return i.owner = this.#d, this.#n.delete(e), this.#r.set(e, i), this.#s.set(e, {
997
+ ...n,
998
+ persist: !1
999
+ }), r.set(Object.freeze([])), this.#e.flushNow(), i;
1000
+ }
1001
+ finalizeOutputDeclarations() {
1002
+ this.#i = !1;
1003
+ }
1004
+ getOutput(e) {
1005
+ let t = this.#r.get(e);
1006
+ if (!t) throw Error("Output parameter \"" + e + "\" is not declared.");
1007
+ return t;
1008
+ }
1009
+ resolveOutput(e) {
1010
+ if (typeof e == "string") return this.getOutput(e);
1011
+ if (e.push !== "outer") throw Error("Transform output pushing requires push: \"outer\".");
1012
+ let t = this.#h()?.findRuntimeForParam(e.name);
1013
+ if (!t) throw Error("Output parameter \"" + e.name + "\" not found in outer scope.");
1014
+ return t.#C(e.name);
1015
+ }
1016
+ get outputs() {
1017
+ return this.#r.values();
1018
+ }
1019
+ isWritable(e) {
1020
+ return this.#n.has(e);
1021
+ }
713
1022
  registerParam(e, t = {}) {
714
1023
  let n = e.name;
715
1024
  try {
716
- _(n);
1025
+ i(n);
717
1026
  } catch (t) {
718
- throw a(t, this.getSpecLocation(e, ["name"]));
1027
+ throw g(t, this.getSpecLocation(e, ["name"]));
719
1028
  }
720
- if (this.#i.has(n) || this.#a.has(n)) throw a(/* @__PURE__ */ Error("Parameter \"" + n + "\" already registered in this scope."), this.getSpecLocation(e, ["name"]));
721
- if (Te(e), t.defer) {
1029
+ if (this.#s.has(n) || this.#c.has(n)) throw g(/* @__PURE__ */ Error("Parameter \"" + n + "\" already registered in this scope."), this.getSpecLocation(e, ["name"]));
1030
+ if (Ge(e), t.defer) {
722
1031
  if (!("expr" in e)) throw Error("Only expression parameters can be deferred.");
723
1032
  return this.#e.registerInitializer(this.#t, n, () => {
724
- this.#y(e);
725
- }), this.#i.set(n, e), () => {
1033
+ this.#w(e);
1034
+ }), this.#s.set(n, e), () => {
726
1035
  throw Error("Cannot set derived parameter \"" + n + "\".");
727
1036
  };
728
1037
  }
729
- return this.#y(e);
1038
+ return this.#w(e);
730
1039
  }
731
1040
  registerLazyExpression(e, t, n) {
732
1041
  this.#e.registerInitializer(this.#t, e, () => {
733
1042
  n?.();
734
- let r = this.#e.registerDerived(this.#t, e, t, this.#v());
735
- this.#r.set(e, r);
736
- }), this.#a.add(e);
1043
+ let r = this.#e.registerDerived(this.#t, e, t, this.#S());
1044
+ this.#o.set(e, r);
1045
+ }), this.#c.add(e);
1046
+ }
1047
+ registerComputed(e, t, n) {
1048
+ this.#e.registerInitializer(this.#t, e, () => {
1049
+ this.#o.set(e, this.#e.registerComputed(this.#t, e, t(), n));
1050
+ }), this.#c.add(e);
737
1051
  }
738
1052
  registerScopedExpression(e, t, n) {
739
1053
  if (this.#e !== n.#e) throw Error("Scoped expressions must share a parameter runtime.");
740
- if (this.#i.has(e)) throw Error("Parameter \"" + e + "\" already registered in this scope.");
1054
+ if (this.#s.has(e)) throw Error("Parameter \"" + e + "\" already registered in this scope.");
741
1055
  this.#e.registerInitializer(this.#t, e, () => {
742
1056
  let r = this.#e.registerDerived(this.#t, e, t, {
743
1057
  expressionScope: n.#t,
744
- ...n.#v()
1058
+ ...n.#S()
745
1059
  });
746
- this.#r.set(e, r);
747
- }), this.#i.set(e, {
1060
+ this.#o.set(e, r);
1061
+ }), this.#s.set(e, {
748
1062
  name: e,
749
1063
  expr: t
750
1064
  });
751
1065
  }
752
- #y(e) {
753
- let t = e.name, n, r;
1066
+ #w(e) {
1067
+ let n = e.name, r, i;
754
1068
  if (e.push == "outer") {
755
- let i = this.findRuntimeForParam(t);
756
- if (!i) throw a(/* @__PURE__ */ Error(`Parameter "${t}" not found in outer scope!`), this.getSpecLocation(e, ["name"]));
757
- let o = i.paramConfigs.get(t);
758
- if (!o) throw Error(`Outer parameter "${t}" exists as a value but has no registered config.`);
759
- if ("expr" in o || "select" in o || "ruler" in o) throw Error(`The outer parameter "${t}" must not have expr, select, or ruler properties!`);
760
- n = (e) => {
761
- i.setValue(t, e);
762
- }, this.#n.set(t, n), "ruler" in e && (r = s(e, this), n(r));
763
- } else if ("value" in e) r = s(e, this), n = "transition" in e ? this.#x(t, r, e.transition) : this.#b(t, r);
764
- else if (h(e)) {
765
- if ("transition" in e) this.#S(t, e, e.transition);
766
- else if ("debounce" in e) this.#C(t, e, e.debounce);
1069
+ let t = this.findRuntimeForParam(n);
1070
+ if (!t) throw g(/* @__PURE__ */ Error(`Parameter "${n}" not found in outer scope!`), this.getSpecLocation(e, ["name"]));
1071
+ let a = t.paramConfigs.get(n);
1072
+ if (!a) throw Error(`Outer parameter "${n}" exists as a value but has no registered config.`);
1073
+ if ("expr" in a || "select" in a && !("select" in e) || "ruler" in a || !t.isWritable(n)) throw Error(`The outer parameter "${n}" must not have expr, select, or ruler properties!`);
1074
+ r = (e, r = {}) => {
1075
+ t.setValue(n, e, r);
1076
+ }, this.#n.set(n, r);
1077
+ let o = t.#a.get(n) ?? /* @__PURE__ */ new Set();
1078
+ o.add(this), t.#a.set(n, o), this.#e.addScopeDisposer(this.#t, () => {
1079
+ o.delete(this);
1080
+ }), "ruler" in e && (i = s(e, this), r(i));
1081
+ } else if ("value" in e) i = s(e, this), r = "transition" in e ? this.#T(n, i, e.transition) : this.allocateSetter(n, i);
1082
+ else if (a(e)) {
1083
+ if ("transition" in e) this.#E(n, e, e.transition);
1084
+ else if ("debounce" in e) this.#D(n, e, e.debounce);
767
1085
  else {
768
- let n = this.#e.registerDerived(this.#t, t, e.expr, this.#v(e));
769
- this.#r.set(t, n);
1086
+ let t = this.#e.registerDerived(this.#t, n, e.expr, this.#S(e));
1087
+ this.#o.set(n, t);
770
1088
  }
771
- n = () => {
772
- throw Error("Cannot set derived parameter \"" + t + "\".");
1089
+ r = () => {
1090
+ throw Error("Cannot set derived parameter \"" + n + "\".");
773
1091
  };
774
- } else r = s(e, this), n = this.#b(t, r);
1092
+ } else i = s(e, this), r = this.allocateSetter(n, i);
775
1093
  if ("select" in e) {
776
- if (r ??= s(e, this), !this.#n.has(t)) {
777
- let e = this.#e.registerSelection(this.#t, t, r);
778
- this.#r.set(t, e), this.#n.set(t, (t) => {
779
- e.set(t), this.#e.flushNow();
780
- }), n = this.#n.get(t);
1094
+ if (e.push === "outer") {
1095
+ let e = this.findValue(n);
1096
+ e && [
1097
+ "single",
1098
+ "multi",
1099
+ "categories",
1100
+ "interval"
1101
+ ].includes(e.type) && (i = e);
1102
+ }
1103
+ if (i ??= s(e, this), !this.#n.has(n)) {
1104
+ let e = this.#e.registerSelection(this.#t, n, i);
1105
+ this.#o.set(n, e), this.#n.set(n, (t, r) => {
1106
+ this.#u.get(n)?.beforeWrite(t, r?.intervalGesture), e.set(t), this.#e.flushNow();
1107
+ }), r = this.#n.get(n);
781
1108
  }
782
- n(r);
1109
+ r(i);
783
1110
  }
784
- return this.#i.set(t, e), this.#_(e), n;
1111
+ return this.#s.set(n, e), this.#x(e), "select" in e && t(e.select).type === "interval" && this.getIntervalSelectionState(n).beforeWrite(this.findValue(n)), r;
785
1112
  }
786
1113
  allocateSetter(e, t, n = !1) {
787
- if (_(e), this.#n.has(e)) throw Error("Setter already allocated for parameter: " + e);
1114
+ if (i(e), this.#n.has(e)) throw Error("Setter already allocated for parameter: " + e);
788
1115
  let r = this.#e.registerBase(this.#t, e, t, { notify: !n });
789
- this.#r.set(e, r);
790
- let i = (e) => {
791
- r.set(e), this.#e.flushNow();
1116
+ this.#o.set(e, r);
1117
+ let a = (t, n = {}) => {
1118
+ if (this.#r.has(e)) throw Error("Cannot set output parameter \"" + e + "\".");
1119
+ this.#u.get(e)?.beforeWrite(t, n?.intervalGesture), r.set(t), this.#e.flushNow();
792
1120
  };
793
- return this.#n.set(e, i), i;
1121
+ return this.#n.set(e, a), a;
794
1122
  }
795
1123
  setValue(e, t, n) {
796
- _(e);
1124
+ i(e);
797
1125
  let r = this.#n.get(e);
798
1126
  if (!r) throw Error("Writable parameter not found in this scope: " + e);
799
1127
  r(t, n);
800
1128
  }
801
1129
  getValue(e) {
802
- return !this.#r.has(e) && this.hasLocalParam(e) && this.#e.resolve(this.#t, e), this.#r.get(e)?.get();
1130
+ return !this.#o.has(e) && this.hasLocalParam(e) && this.#e.resolve(this.#t, e), this.#o.get(e)?.get();
803
1131
  }
804
1132
  getParamRef(e) {
805
- _(e);
1133
+ i(e);
806
1134
  let t = this.findRuntimeForParam(e);
807
- if (t) return t.#r.has(e) || t.#e.resolve(t.#t, e), t.#r.get(e);
1135
+ if (t) return t.#o.has(e) || t.#e.resolve(t.#t, e), t.#o.get(e);
808
1136
  }
809
1137
  getTargetValue(e) {
810
- return _(e), this.#l.get(e)?.target ?? this.#u.get(e)?.target ?? this.getValue(e);
1138
+ return i(e), this.#p.get(e)?.target ?? this.#m.get(e)?.target ?? this.getValue(e);
811
1139
  }
812
1140
  subscribe(e, t) {
813
1141
  let n = this.getParamRef(e);
@@ -821,38 +1149,53 @@ var T = class {
821
1149
  return this.findRuntimeForParam(e)?.getTargetValue(e);
822
1150
  }
823
1151
  get paramConfigs() {
824
- return this.#i;
1152
+ return this.#s;
825
1153
  }
826
1154
  hasLocalParam(e) {
827
- _(e);
828
- let t = this.#i.get(e);
829
- return this.#r.has(e) || this.#a.has(e) || t !== void 0 && "expr" in t;
1155
+ i(e);
1156
+ let t = this.#s.get(e);
1157
+ return this.#o.has(e) || this.#c.has(e) || t !== void 0 && "expr" in t;
830
1158
  }
831
1159
  isPendingParam(e) {
832
1160
  let t = this.findRuntimeForParam(e);
833
- return t !== void 0 && !t.#r.has(e);
1161
+ return t !== void 0 && !t.#o.has(e);
834
1162
  }
835
1163
  hasConfiguredParamInScopeChain(e) {
836
- return _(e), this.#i.has(e) ? !0 : this.#d()?.hasConfiguredParamInScopeChain(e) ?? !1;
1164
+ return i(e), this.#s.has(e) ? !0 : this.#h()?.hasConfiguredParamInScopeChain(e) ?? !1;
837
1165
  }
838
1166
  findRuntimeForParam(e) {
839
- return this.hasLocalParam(e) ? this : this.#d()?.findRuntimeForParam(e);
1167
+ return this.hasLocalParam(e) ? this : this.#h()?.findRuntimeForParam(e);
840
1168
  }
841
1169
  findConfiguredParam(e) {
842
- let t = this.#i.get(e);
1170
+ let t = this.#s.get(e);
843
1171
  return t ? {
844
1172
  runtime: this,
845
1173
  config: t
846
- } : this.#d()?.findConfiguredParam(e);
1174
+ } : this.#h()?.findConfiguredParam(e);
1175
+ }
1176
+ getIntervalSelectionState(e) {
1177
+ let t = this.findRuntimeForParam(e), n = t.#u.get(e);
1178
+ if (!n) {
1179
+ let r = t.#f.get(e)?.values().next().value;
1180
+ n = new Le(t, e, r?.components.find(p)), t.#u.set(e, n);
1181
+ }
1182
+ return n;
1183
+ }
1184
+ getComplexIntervals(e, t) {
1185
+ let n = this.findRuntimeForParam(e).#f.get(e)?.values().next().value?.source;
1186
+ return Object.fromEntries(Object.entries(t).map(([e, t]) => {
1187
+ let r = n?.getScaleResolution(e);
1188
+ return [e, t ? t.map((e) => r ? r.toComplex(e) : e) : null];
1189
+ }));
847
1190
  }
848
1191
  registerSelectionController(e, t) {
849
- let n = this.#o.get(e);
850
- return n || (n = /* @__PURE__ */ new Set(), this.#o.set(e, n)), n.add(t), () => {
851
- n.delete(t), n.size === 0 && this.#o.delete(e);
1192
+ let n = this.#l.get(e);
1193
+ return n || (n = /* @__PURE__ */ new Set(), this.#l.set(e, n)), n.add(t), () => {
1194
+ n.delete(t), n.size === 0 && this.#l.delete(e);
852
1195
  };
853
1196
  }
854
1197
  getSelectionController(e) {
855
- let t = this.#o.get(e);
1198
+ let t = this.#l.get(e);
856
1199
  if (t) {
857
1200
  if (t.size > 1) throw Error(`Selection "${e}" has ambiguous interaction ownership.`);
858
1201
  return t.values().next().value;
@@ -860,29 +1203,29 @@ var T = class {
860
1203
  }
861
1204
  getDebugState() {
862
1205
  let e = [];
863
- for (let [t, n] of this.#r) {
864
- let r = this.#i.get(t);
1206
+ for (let [t, n] of this.#o) {
1207
+ let r = this.#s.get(t);
865
1208
  e.push({
866
1209
  name: t,
867
- kind: we(r),
1210
+ kind: We(r),
868
1211
  value: n.get(),
869
1212
  writable: this.#n.has(t),
870
1213
  configured: !!r,
871
1214
  config: r ? structuredClone(r) : void 0,
872
- target: this.#l.get(t)?.target ?? this.#u.get(t)?.target
1215
+ target: this.#p.get(t)?.target ?? this.#m.get(t)?.target
873
1216
  });
874
1217
  }
875
1218
  return {
876
1219
  scopeId: this.#t,
877
- disposed: this.#g,
1220
+ disposed: this.#b,
878
1221
  params: e
879
1222
  };
880
1223
  }
881
1224
  getSpecLocation(e, t) {
882
- return f(e, this.#h, t);
1225
+ return ee(e, this.#y, t);
883
1226
  }
884
1227
  createExpression(e) {
885
- return this.#e.createExpression(this.#t, typeof e == "string" ? e : e.expr, this.#v(typeof e == "string" ? void 0 : e));
1228
+ return this.#e.createExpression(this.#t, typeof e == "string" ? e : e.expr, this.#S(typeof e == "string" ? void 0 : e));
886
1229
  }
887
1230
  watchExpression(e, t, n = {}) {
888
1231
  let r = this.createExpression(e), i = r.subscribe(t);
@@ -909,59 +1252,51 @@ var T = class {
909
1252
  cancelUpdate(e) {
910
1253
  this.#e.cancelUpdate(e);
911
1254
  }
912
- #b(e, t) {
913
- let n = this.#e.registerBase(this.#t, e, t);
914
- this.#r.set(e, n);
915
- let r = (e) => {
916
- n.set(e), this.#e.flushNow();
917
- };
918
- return this.#n.set(e, r), r;
919
- }
920
- #x(e, t, n) {
921
- let r = this.#w(e, t, n), i = (t, n) => {
922
- this.#T(e, r, t, n);
1255
+ #T(e, t, n) {
1256
+ let r = this.#O(e, t, n), i = (t, n) => {
1257
+ this.#k(e, r, t, n);
923
1258
  };
924
1259
  return this.#n.set(e, i), i;
925
1260
  }
926
- #S(e, t, n) {
927
- let r = this.createExpression(t), i = this.#w(e, r(null), n), a = r.subscribe(() => {
928
- this.#T(e, i, r(null), { animate: !this.#m });
1261
+ #E(e, t, n) {
1262
+ let r = this.createExpression(t), i = this.#O(e, r(null), n), a = r.subscribe(() => {
1263
+ this.#k(e, i, r(null), { animate: !this.#v });
929
1264
  });
930
1265
  this.#e.addScopeDisposer(this.#t, a);
931
1266
  }
932
- #C(e, t, n) {
1267
+ #D(e, t, n) {
933
1268
  let r = this.createExpression(t), i = r(null), a = this.#e.registerBase(this.#t, e, i);
934
- this.#r.set(e, a);
1269
+ this.#o.set(e, a);
935
1270
  let o = {
936
1271
  target: i,
937
1272
  timeout: void 0
938
1273
  }, s = () => {
939
1274
  o.timeout = void 0, a.set(o.target), this.#e.flushNow();
940
1275
  }, c = r.subscribe(() => {
941
- o.target = r(null), clearTimeout(o.timeout), o.timeout = void 0, o.target !== a.get() && (this.#m ? s() : o.timeout = setTimeout(s, n));
1276
+ o.target = r(null), clearTimeout(o.timeout), o.timeout = void 0, o.target !== a.get() && (this.#v ? s() : o.timeout = setTimeout(s, n));
942
1277
  });
943
- this.#u.set(e, o), this.#e.addScopeDisposer(this.#t, () => {
944
- clearTimeout(o.timeout), c(), this.#u.delete(e);
1278
+ this.#m.set(e, o), this.#e.addScopeDisposer(this.#t, () => {
1279
+ clearTimeout(o.timeout), c(), this.#m.delete(e);
945
1280
  });
946
1281
  }
947
- #w(e, t, n) {
948
- let r = E(e, t), i = this.#e.registerBase(this.#t, e, r);
949
- this.#r.set(e, i);
950
- let a = this.#p;
1282
+ #O(e, t, n) {
1283
+ let r = Ke(e, t), i = this.#e.registerBase(this.#t, e, r);
1284
+ this.#o.set(e, i);
1285
+ let a = this.#_;
951
1286
  if (!a) throw Error(`The parameter "${e}" uses transition but no animator is available.`);
952
- let o = w(a, ({ value: e }) => {
1287
+ let o = He(a, ({ value: e }) => {
953
1288
  i.set(e), this.#e.flushNow();
954
1289
  }, n.halfLife ?? 80, n.epsilon ?? .01, { value: i.get() }), s = {
955
1290
  target: i.get(),
956
1291
  smoother: o,
957
1292
  dispose: () => {
958
- o.stop(), this.#l.delete(e);
1293
+ o.stop(), this.#p.delete(e);
959
1294
  }
960
1295
  };
961
- return this.#l.set(e, s), this.#e.addScopeDisposer(this.#t, s.dispose), s;
1296
+ return this.#p.set(e, s), this.#e.addScopeDisposer(this.#t, s.dispose), s;
962
1297
  }
963
- #T(e, t, n, r = {}) {
964
- let i = E(e, n);
1298
+ #k(e, t, n, r = {}) {
1299
+ let i = Ke(e, n);
965
1300
  t.target = i, r.animate === !1 ? t.smoother.snap({ value: i }) : t.smoother({ value: i });
966
1301
  }
967
1302
  evaluateAndGet(e) {
@@ -977,20 +1312,24 @@ var T = class {
977
1312
  return this.#e.whenPropagated(e);
978
1313
  }
979
1314
  finalizeInitialization() {
980
- this.#m = !1;
1315
+ this.#v = !1;
981
1316
  }
982
1317
  dispose() {
983
- this.#g || (this.#g = !0, this.#e.disposeScope(this.#t), this.#n.clear(), this.#r.clear(), this.#i.clear(), this.#a.clear(), this.#o.clear(), this.#l.clear(), this.#u.clear());
1318
+ if (!this.#b) {
1319
+ this.#b = !0;
1320
+ for (let e of this.#u.values()) e.dispose();
1321
+ this.#u.clear(), this.#e.disposeScope(this.#t), this.#n.clear(), this.#o.clear(), this.#r.clear(), this.#a.clear(), this.#s.clear(), this.#c.clear(), this.#l.clear(), this.#p.clear(), this.#m.clear();
1322
+ }
984
1323
  }
985
- hasPointSelections({ inherited: e = !1 } = {}) {
986
- for (let t = this; t; t = e ? t.#d() : void 0) for (let n of t.#i.values()) if (l(n) && (n.select === "point" || typeof n.select == "object" && n.select.type === "point") && (!e || this.findConfiguredParam(n.name).config === n)) return !0;
1324
+ hasPointSelections({ inherited: e = !1, recordsOnly: t = !1, inputOnly: r = !1 } = {}) {
1325
+ for (let i = this; i; i = e ? i.#h() : void 0) for (let a of i.#s.values()) if (c(a) && (!r || n(a)) && (a.select === "point" || typeof a.select == "object" && a.select.type === "point") && (!t || typeof a.select == "string" || !("encodings" in a.select && a.select.encodings)) && (!e || this.findConfiguredParam(a.name).config === a)) return !0;
987
1326
  return !1;
988
1327
  }
989
1328
  };
990
- function we(e) {
1329
+ function We(e) {
991
1330
  return e ? e.push === "outer" ? "push" : "select" in e ? "selection" : "ruler" in e ? "ruler" : "expr" in e ? "derived" : "base" : "auto";
992
1331
  }
993
- function Te(e) {
1332
+ function Ge(e) {
994
1333
  let t = e.name;
995
1334
  if ("value" in e && "expr" in e) throw Error(`The parameter "${t}" must not have both value and expr properties!`);
996
1335
  if ("expr" in e && "bind" in e) throw Error(`The parameter "${t}" must not have both expr and bind properties!`);
@@ -1008,306 +1347,16 @@ function Te(e) {
1008
1347
  if (n.halfLife != null && (!Number.isFinite(n.halfLife) || n.halfLife <= 0)) throw Error(`The transition halfLife for parameter "${t}" must be a positive finite number.`);
1009
1348
  if (n.epsilon != null && (!Number.isFinite(n.epsilon) || n.epsilon < 0)) throw Error(`The transition epsilon for parameter "${t}" must be a non-negative finite number.`);
1010
1349
  }
1011
- function E(e, t) {
1350
+ function Ke(e, t) {
1012
1351
  if (typeof t != "number" || !Number.isFinite(t)) throw Error(`Transitioned parameter "${e}" must have a finite numeric value.`);
1013
1352
  return t;
1014
1353
  }
1015
1354
  //#endregion
1016
- //#region ../core/src/view/layout/flexLayout.js
1017
- function Ee(e, t, n = {}) {
1018
- let { sizes: r } = Ie(e, t, n.spacing || 0);
1019
- return De(e, r, t, n);
1020
- }
1021
- function De(e, t, n, { spacing: r, devicePixelRatio: i, offset: a, reverse: o } = {}) {
1022
- r ||= 0, a ||= 0;
1023
- let s = 0, c = 0;
1024
- for (let n = 0; n < e.length; n++) s += t[n], k(e[n]) || c++;
1025
- let l = s + Math.max(0, c - 1) * r, u = i === void 0 ? (e) => e : (e) => Math.round(e * i) / i, d = 0, f = [], p = (e) => {
1026
- let t = d;
1027
- if (!t) return;
1028
- let n = (e ? r : 0) * (o ? -1 : 1);
1029
- m -= n;
1030
- for (let e = 0; e < t; e++) f.push({
1031
- location: m + (e + 1) / (t + 1) * n,
1032
- size: 0
1033
- });
1034
- m += n, d = 0;
1035
- }, m = o ? Math.max(n, l) : 0 + a;
1036
- if (e.length == 1 && k(e[0])) return [{
1037
- location: m,
1038
- size: 0
1039
- }];
1040
- for (let n = 0; n < e.length; n++) {
1041
- let i = e[n];
1042
- if (k(i)) d++;
1043
- else {
1044
- p(f.length > 0);
1045
- let e = t[n];
1046
- o && (m -= e), f.push({
1047
- location: u(m),
1048
- size: u(e)
1049
- }), o ? m -= r : m += e + r;
1050
- }
1051
- }
1052
- return m += o ? r : -r, p(!1), f;
1053
- }
1054
- function Oe(e, { spacing: t } = { spacing: 0 }) {
1055
- let n = 0;
1056
- for (let r of e) n += N(r) + (k(r) ? 0 : t);
1057
- return Math.max(0, n - t);
1058
- }
1059
- function ke(e, t, { spacing: n = 0 } = {}) {
1060
- let r = [], i = [], a = 0, o = 0;
1061
- for (let [s, c] of e.entries()) {
1062
- let e = N(c), l = !k(c), u = o && l ? n : 0;
1063
- i.length && a + u + e > t && (r.push(i), i = [], a = 0, o = 0), i.push(s), a += (o && l ? n : 0) + e, o += +!!l;
1064
- }
1065
- return i.length && r.push(i), r;
1066
- }
1067
- function Ae(e) {
1068
- let t = 0, n = 0, r = 0, i, a = !0;
1069
- for (let o of e) {
1070
- t = Math.max(t, o.px ?? 0), n = Math.max(n, o.grow ?? 0), r = Math.max(r, N(o));
1071
- let e = P(o);
1072
- e === void 0 ? a = !1 : i = i === void 0 ? e : Math.max(i, e);
1073
- }
1074
- return L({
1075
- px: t,
1076
- grow: n,
1077
- minPx: r,
1078
- maxPx: a ? i : void 0
1079
- });
1080
- }
1081
- function je(e, t = 0, n = 0) {
1082
- let r = Math.max(0, e.length - 1) * t, i = {
1083
- px: r,
1084
- grow: e.length ? 0 : n,
1085
- minPx: r,
1086
- maxPx: r
1087
- }, a = e.length > 0;
1088
- for (let t of e) {
1089
- i.px += A(t.px), i.grow += A(t.grow), i.minPx += N(t);
1090
- let e = P(t);
1091
- e === void 0 ? a = !1 : i.maxPx += e;
1092
- }
1093
- return a || delete i.maxPx, L(i);
1094
- }
1095
- var D = class e {
1096
- constructor(e, t) {
1097
- this.width = e, this.height = t;
1098
- }
1099
- addPadding(e) {
1100
- return this.#e(e.width, e.height);
1101
- }
1102
- subtractPadding(e) {
1103
- return this.#e(-e.width, -e.height);
1104
- }
1105
- #e(t, n) {
1106
- return new e(I(this.width, t), I(this.height, n));
1107
- }
1108
- isGrowing() {
1109
- return !!(this.width.grow || this.height.grow);
1110
- }
1111
- }, Me = Object.freeze({
1112
- px: 0,
1113
- grow: 0
1114
- }), O = new D(Me, Me);
1115
- function k(e) {
1116
- return !e.px && !e.grow && !e.minPx;
1117
- }
1118
- function Ne(e, t) {
1119
- return !e || !t ? !1 : e.px === t.px && e.grow === t.grow && e.minPx === t.minPx && e.maxPx === t.maxPx;
1120
- }
1121
- function A(e) {
1122
- return e || 0;
1123
- }
1124
- function Pe(t) {
1125
- return t && (e(t.px) || e(t.grow) || e(t.minPx) || e(t.maxPx));
1126
- }
1127
- function Fe(t) {
1128
- if (q(t)) throw Error("parseSizeDef does not accept step-based sizes.");
1129
- if (Pe(t)) return j(t), L(t);
1130
- if (e(t)) return {
1131
- px: t,
1132
- grow: 0
1133
- };
1134
- if (t === "container" || !t) return {
1135
- px: 0,
1136
- grow: 1
1137
- };
1138
- throw Error(`Invalid sizeDef: ${t}`);
1139
- }
1140
- function Ie(e, t, n = 0) {
1141
- let r = !1;
1142
- for (let t of e) j(t), r ||= F(t);
1143
- if (!r) return Le(e, t, n);
1144
- let i = Array(e.length).fill(0), a = [];
1145
- for (let t = 0; t < e.length; t++) k(e[t]) || a.push(t);
1146
- let o = Math.max(0, a.length - 1) * n, s = Math.max(0, t - o), c = /* @__PURE__ */ new Set();
1147
- for (let t of a) {
1148
- let n = e[t];
1149
- A(n.grow) || (i[t] = M(A(n.px), n), c.add(t));
1150
- }
1151
- let l = 0;
1152
- for (;;) {
1153
- let t = 0, n = 0, r = 0;
1154
- for (let o of a) c.has(o) ? r += i[o] : (t += A(e[o].px), n += A(e[o].grow));
1155
- if (!n) {
1156
- for (let t of a) c.has(t) || (i[t] = M(A(e[t].px), e[t]), c.add(t));
1157
- break;
1158
- }
1159
- let o = Math.max(0, s - r - t);
1160
- l = o / n;
1161
- let u = 0, d = [], f = [];
1162
- for (let t of a) {
1163
- if (c.has(t)) continue;
1164
- let r = e[t], a = A(r.px) + A(r.grow) / n * o, s = M(a, r);
1165
- i[t] = s;
1166
- let l = s - a;
1167
- u += l, l > 0 ? d.push(t) : l < 0 && f.push(t);
1168
- }
1169
- if (!d.length && !f.length) break;
1170
- if (u > 0) for (let e of d) c.add(e);
1171
- else if (u < 0) for (let e of f) c.add(e);
1172
- else for (let e of a) c.add(e);
1173
- }
1174
- return {
1175
- sizes: i,
1176
- growth: l
1177
- };
1178
- }
1179
- function Le(e, t, n) {
1180
- let r = 0, i = 0;
1181
- for (let t of e) r += A(t.px) + (k(t) ? 0 : n), i += A(t.grow);
1182
- r -= n;
1183
- let a = Math.max(0, t - r), o = Array(e.length);
1184
- for (let t = 0; t < e.length; t++) {
1185
- let n = e[t];
1186
- o[t] = k(n) ? 0 : A(n.px) + (i ? A(n.grow) / i * a : 0);
1187
- }
1188
- return {
1189
- sizes: o,
1190
- growth: i ? a / i : 0
1191
- };
1192
- }
1193
- function j(e) {
1194
- if (e.minPx !== void 0 && e.maxPx !== void 0 && e.minPx > e.maxPx) throw Error("SizeDef minPx cannot be greater than maxPx.");
1195
- }
1196
- function M(e, t) {
1197
- return Math.min(Math.max(e, t.minPx ?? 0), t.maxPx ?? Infinity);
1198
- }
1199
- function N(e) {
1200
- return M(A(e.px), e);
1201
- }
1202
- function P(e) {
1203
- return e.maxPx ?? (A(e.grow) ? void 0 : N(e));
1204
- }
1205
- function F(e) {
1206
- return e.minPx !== void 0 || e.maxPx !== void 0;
1207
- }
1208
- function I(e, t) {
1209
- return L({
1210
- px: (e.px ?? 0) + t,
1211
- grow: e.grow,
1212
- minPx: e.minPx === void 0 ? void 0 : Math.max(0, e.minPx + t),
1213
- maxPx: e.maxPx === void 0 ? void 0 : Math.max(0, e.maxPx + t)
1214
- });
1215
- }
1216
- function L(e) {
1217
- let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i = F(e);
1218
- return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx > A(e.px) && (t.minPx = e.minPx), e.maxPx !== void 0 && (A(t.grow) || e.maxPx < A(e.px)) && (t.maxPx = e.maxPx), t;
1219
- }
1220
- //#endregion
1221
- //#region ../core/src/view/layout/padding.js
1222
- var R = class e {
1223
- constructor(e, t, n, r) {
1224
- this.top = e || 0, this.right = t || 0, this.bottom = n || 0, this.left = r || 0;
1225
- }
1226
- get width() {
1227
- return this.left + this.right;
1228
- }
1229
- get height() {
1230
- return this.top + this.bottom;
1231
- }
1232
- expand(t) {
1233
- return t <= 0 ? this : new e(this.top + t, this.right + t, this.bottom + t, this.left + t);
1234
- }
1235
- add(t) {
1236
- return new e(this.top + t.top, this.right + t.right, this.bottom + t.bottom, this.left + t.left);
1237
- }
1238
- subtract(t) {
1239
- return new e(this.top - t.top, this.right - t.right, this.bottom - t.bottom, this.left - t.left);
1240
- }
1241
- union(t) {
1242
- return new e(Math.max(this.top, t.top), Math.max(this.right, t.right), Math.max(this.bottom, t.bottom), Math.max(this.left, t.left));
1243
- }
1244
- getHorizontal() {
1245
- return new e(0, this.right, 0, this.left);
1246
- }
1247
- getVertical() {
1248
- return new e(this.top, 0, this.bottom, 0);
1249
- }
1250
- get horizontalTotal() {
1251
- return this.left + this.right;
1252
- }
1253
- get verticalTotal() {
1254
- return this.top + this.bottom;
1255
- }
1256
- static createFromConfig(e) {
1257
- return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) : z;
1258
- }
1259
- static createFromRecord(t) {
1260
- return new e(t.top, t.right, t.bottom, t.left);
1261
- }
1262
- static zero() {
1263
- return z;
1264
- }
1265
- static createUniformPadding(t) {
1266
- return new e(t, t, t, t);
1267
- }
1268
- };
1269
- function Re(e, t, n = R.zero()) {
1270
- return t ? new R(t.top === !1 ? n.top : e.top, t.right === !1 ? n.right : e.right, t.bottom === !1 ? n.bottom : e.bottom, t.left === !1 ? n.left : e.left) : e;
1271
- }
1272
- var z = R.createUniformPadding(0);
1273
- Object.freeze(z);
1274
- //#endregion
1275
- //#region ../core/src/utils/url.js
1276
- var ze = /^([A-Za-z]+:)?\/\//;
1277
- function B(e, t) {
1278
- if (t && ze.test(t)) return t;
1279
- let n = typeof e == "function" ? e() : e;
1280
- if (!n) return t;
1281
- if (!t) return n;
1282
- if (/[#?]/.test(n)) throw Error(`Cannot append to a url with query or hash. Append: ${t}, base: ${n}`);
1283
- return Ve(n) + t;
1284
- }
1285
- function Be(e, t, n = He()) {
1286
- let r = typeof e == "function" ? e() : e;
1287
- if (!t) return r;
1288
- try {
1289
- if (r) {
1290
- let e = n ? new URL(r, n).href : new URL(r).href;
1291
- return new URL(t, e).href;
1292
- }
1293
- if (n) return new URL(t, n).href;
1294
- } catch {}
1295
- return B(r, t);
1296
- }
1297
- function Ve(e) {
1298
- let t = e.replace(/[^/]*$/, "");
1299
- return t === "" ? void 0 : t.endsWith("://") ? e + "/" : t;
1300
- }
1301
- function He() {
1302
- if (typeof document < "u" && document.baseURI) return document.baseURI;
1303
- if (typeof window < "u" && window.location?.href) return window.location.href;
1304
- }
1305
- //#endregion
1306
1355
  //#region ../core/src/utils/addBaseUrl.js
1307
- function Ue(e, t) {
1356
+ function qe(e, t) {
1308
1357
  return !t || /^(data:|([A-Za-z]+:)?\/\/)/.test(e) || e.startsWith("/") ? e : (t.endsWith("/") || (t += "/"), t + e);
1309
1358
  }
1310
- function We(e) {
1359
+ function Je(e) {
1311
1360
  if (!e) return e;
1312
1361
  if (/[?#]/.test(e)) throw Error(`Invalid base URL: ${e} - cannot contain query or hash.`);
1313
1362
  return e.endsWith("/") ? e : e + "/";
@@ -1315,42 +1364,42 @@ function We(e) {
1315
1364
  //#endregion
1316
1365
  //#region ../core/src/config/mergeConfig.js
1317
1366
  function V(e) {
1318
- return te(e) && !Array.isArray(e) && !("expr" in e && typeof e.expr == "string");
1367
+ return u(e) && !Array.isArray(e) && !("expr" in e && typeof e.expr == "string");
1319
1368
  }
1320
- function Ge(e) {
1369
+ function Ye(e) {
1321
1370
  let t = {};
1322
1371
  for (let [n, r] of Object.entries(e)) t[n] = H(r);
1323
1372
  return t;
1324
1373
  }
1325
1374
  function H(e) {
1326
- return Array.isArray(e) ? e.map(H) : V(e) ? Ge(e) : e;
1375
+ return Array.isArray(e) ? e.map(H) : V(e) ? Ye(e) : e;
1327
1376
  }
1328
- function Ke(e, t) {
1377
+ function Xe(e, t) {
1329
1378
  for (let [n, r] of Object.entries(t)) {
1330
1379
  if (r === void 0) continue;
1331
1380
  let t = e[n];
1332
- V(r) && V(t) ? Ke(t, r) : e[n] = H(r);
1381
+ V(r) && V(t) ? Xe(t, r) : e[n] = H(r);
1333
1382
  }
1334
1383
  return e;
1335
1384
  }
1336
- function qe(e) {
1385
+ function Ze(e) {
1337
1386
  let t = {};
1338
- for (let n of e) n && Ke(t, n);
1387
+ for (let n of e) n && Xe(t, n);
1339
1388
  return t;
1340
1389
  }
1341
1390
  //#endregion
1342
1391
  //#region ../core/src/view/viewChrome.js
1343
1392
  var U = /* @__PURE__ */ new WeakMap();
1344
- function Je(e, t) {
1393
+ function Qe(e, t) {
1345
1394
  U.set(e, t);
1346
1395
  }
1347
- function Ye(e) {
1396
+ function $e(e) {
1348
1397
  return U.get(e);
1349
1398
  }
1350
- function Xe(e) {
1399
+ function et(e) {
1351
1400
  return U.has(e);
1352
1401
  }
1353
- function Ze(e) {
1402
+ function tt(e) {
1354
1403
  let t = e;
1355
1404
  for (; t;) {
1356
1405
  let n = U.get(t);
@@ -1361,16 +1410,34 @@ function Ze(e) {
1361
1410
  }
1362
1411
  //#endregion
1363
1412
  //#region ../core/src/view/postScaleParams.js
1364
- var Qe = /* @__PURE__ */ new WeakMap();
1365
- function $e(e, t) {
1366
- Qe.set(e, t);
1413
+ var nt = /* @__PURE__ */ new WeakMap();
1414
+ function rt(e, t) {
1415
+ nt.set(e, t);
1367
1416
  }
1368
- function et(e) {
1369
- return Qe.get(e);
1417
+ function it(e) {
1418
+ return nt.get(e);
1419
+ }
1420
+ //#endregion
1421
+ //#region ../core/src/view/transformOutputDeclarations.js
1422
+ function* at(e) {
1423
+ for (let t of e) t.type === "values" ? yield {
1424
+ transform: t,
1425
+ property: "param",
1426
+ param: t.param
1427
+ } : t.type === "dendrogram" && t.domainParam !== void 0 ? yield {
1428
+ transform: t,
1429
+ property: "domainParam",
1430
+ param: t.domainParam
1431
+ } : t.type === "branch" && (yield* at(t.transform));
1432
+ }
1433
+ function ot(e) {
1434
+ e.visit((e) => {
1435
+ e.paramRuntime.finalizeOutputDeclarations();
1436
+ });
1370
1437
  }
1371
1438
  //#endregion
1372
1439
  //#region ../core/src/data/namedDataScope.js
1373
- var tt = class {
1440
+ var st = class {
1374
1441
  name;
1375
1442
  owner;
1376
1443
  getDefaultData;
@@ -1408,13 +1475,13 @@ var tt = class {
1408
1475
  dispose() {
1409
1476
  this.#e = void 0, this.#t = !1, this.#n++, this.#r = !0;
1410
1477
  }
1411
- }, nt = class {
1478
+ }, ct = class {
1412
1479
  view;
1413
1480
  #e = /* @__PURE__ */ new Map();
1414
1481
  #t = /* @__PURE__ */ new Map();
1415
1482
  constructor(e) {
1416
1483
  this.view = e;
1417
- for (let [t, n] of Object.entries(e.spec.datasets ?? {})) this.#e.set(t, new tt(t, e, () => n));
1484
+ for (let [t, n] of Object.entries(e.spec.datasets ?? {})) this.#e.set(t, new st(t, e, () => n));
1418
1485
  }
1419
1486
  getLocalBinding(e) {
1420
1487
  return this.#e.get(e);
@@ -1428,7 +1495,7 @@ var tt = class {
1428
1495
  let n = this.view.dataParent?.namedDataScope;
1429
1496
  if (n) return n.resolve(e);
1430
1497
  let r = this.#t.get(e);
1431
- return r || (r = new tt(e, void 0, () => this.view.context.getNamedDataFromProvider(e)), this.#t.set(e, r)), r;
1498
+ return r || (r = new st(e, void 0, () => this.view.context.getNamedDataFromProvider(e)), this.#t.set(e, r)), r;
1432
1499
  }
1433
1500
  dispose() {
1434
1501
  for (let e of this.#e.values()) e.dispose();
@@ -1436,9 +1503,10 @@ var tt = class {
1436
1503
  for (let e of this.#t.values()) e.dispose();
1437
1504
  this.#t.clear();
1438
1505
  }
1439
- }, W = "VISIT_SKIP", G = "VISIT_STOP", K = (e) => e, rt = class {
1506
+ }, W = "VISIT_SKIP", G = "VISIT_STOP", K = (e) => e, lt = class {
1440
1507
  spec;
1441
1508
  namedDataScope;
1509
+ flowOutputs = /* @__PURE__ */ new Set();
1442
1510
  #e;
1443
1511
  #t;
1444
1512
  #n = {};
@@ -1455,40 +1523,48 @@ var tt = class {
1455
1523
  #f = [];
1456
1524
  #p = "none";
1457
1525
  #m = /* @__PURE__ */ new Map();
1458
- facetCoords = new p([], JSON.stringify);
1526
+ facetCoords = new e([], JSON.stringify);
1459
1527
  layoutCoords;
1460
- constructor(e, n, r, i, a, o = {}) {
1528
+ constructor(e, t, n, r, i, a = {}) {
1461
1529
  if (!e) throw Error("View spec must be defined!");
1462
- if (this.context = n, this.layoutParent = r, this.dataParent = i, o.chrome && Je(this, "excludeSubtree"), this.#t = a, this.spec = e, this.namedDataScope = new nt(this), i && e.theme !== void 0) throw Error("\"theme\" is only supported at the root specification. Use \"config\" and \"style\" for subtree customization.");
1463
- let s = i ? i.getConfigScopes() : [n.getBaseConfig()], c = e.config;
1464
- this.#e = [...s, c].filter((e) => !!e), this.resolutions = {
1530
+ if (this.context = t, this.layoutParent = n, this.dataParent = r, a.chrome && Qe(this, "excludeSubtree"), this.#t = i, this.spec = e, this.namedDataScope = new ct(this), r && e.theme !== void 0) throw Error("\"theme\" is only supported at the root specification. Use \"config\" and \"style\" for subtree customization.");
1531
+ let o = r ? r.getConfigScopes() : [t.getBaseConfig()], s = e.config;
1532
+ this.#e = [...o, s].filter((e) => !!e), this.resolutions = {
1465
1533
  scale: {},
1466
1534
  axis: {},
1467
1535
  legend: {}
1468
- }, oe(this), this.options = {
1536
+ }, ue(this), this.options = {
1469
1537
  inheritEncoding: !1,
1470
1538
  layoutSizeParams: "own",
1471
- ...o
1539
+ ...a
1472
1540
  }, this.flowHandle = void 0, this.needsAxes = {
1473
1541
  x: !1,
1474
1542
  y: !1
1475
- }, this.paramRuntime = new T(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), n.animator, {
1543
+ }, this.paramRuntime = new B(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, {
1476
1544
  settleTemporalUpdatesImmediately: !0,
1477
- onError: n.reportError,
1478
- getSpecOrigin: n.getSpecOrigin
1479
- }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => se("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1480
- let l = [...e.params ?? [], ...et(e) ?? []];
1481
- for (let e of l) {
1545
+ onError: t.reportError,
1546
+ getSpecOrigin: t.getSpecOrigin
1547
+ }), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => he("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
1548
+ for (let { transform: t, property: n, param: r } of at(e.transform ?? [])) try {
1549
+ typeof r == "string" && this.paramRuntime.registerOutput(r);
1550
+ let e = this.paramRuntime.resolveOutput(r);
1551
+ if (e.producerView) throw Error("Duplicate transform output producer.");
1552
+ e.producerView = this, this.flowOutputs.add(e);
1553
+ } catch (e) {
1554
+ throw g(e, this.paramRuntime.getSpecLocation(t, [n]));
1555
+ }
1556
+ let c = [...e.params ?? [], ...it(e) ?? []];
1557
+ this.options.layoutSizeParams !== "inherit" && (c.some((e) => e.name === "width") || (this.#a = this.#h("width")), c.some((e) => e.name === "height") || (this.#o = this.#h("height")));
1558
+ for (let e of c) {
1482
1559
  if ("expr" in e) {
1483
- let { usesScaleHelper: n, globals: r } = t(e.expr, this.paramRuntime.getSpecLocation(e, ["expr"])), i = r.some((e) => this.paramRuntime.isPendingParam(e));
1484
- if (n || i) {
1560
+ let { usesScaleHelper: t, globals: n } = m(e.expr, this.paramRuntime.getSpecLocation(e, ["expr"])), r = n.some((e) => this.paramRuntime.isPendingParam(e));
1561
+ if (t || r) {
1485
1562
  this.paramRuntime.registerParam(e, { defer: !0 }), this.#d.push(e.name);
1486
1563
  continue;
1487
1564
  }
1488
1565
  }
1489
1566
  this.paramRuntime.registerParam(e);
1490
1567
  }
1491
- this.options.layoutSizeParams !== "inherit" && (this.#a = this.#h("width"), this.#o = this.#h("height"));
1492
1568
  }
1493
1569
  #h(e) {
1494
1570
  if (!(this.paramRuntime.hasLocalParam(e) || this.options.layoutSizeParams != "force" && this.paramRuntime.hasConfiguredParamInScopeChain(e))) return this.paramRuntime.allocateSetter(e, 0);
@@ -1506,18 +1582,18 @@ var tt = class {
1506
1582
  return this.#t;
1507
1583
  }
1508
1584
  getConfig() {
1509
- return qe(this.#e);
1585
+ return Ze(this.#e);
1510
1586
  }
1511
1587
  getCursorSpec() {
1512
1588
  return this.spec.cursor;
1513
1589
  }
1514
1590
  getCursor() {
1515
1591
  let e = this.getCursorSpec();
1516
- return h(e) ? this.paramRuntime.evaluateAndGet(e) : e;
1592
+ return a(e) ? this.paramRuntime.evaluateAndGet(e) : e;
1517
1593
  }
1518
1594
  watchCursor(e, t) {
1519
1595
  let n = this.getCursorSpec();
1520
- h(n) && this.paramRuntime.watchExpression(n, e, {
1596
+ a(n) && this.paramRuntime.watchExpression(n, e, {
1521
1597
  scopeOwned: !1,
1522
1598
  registerDisposer: t
1523
1599
  });
@@ -1529,13 +1605,13 @@ var tt = class {
1529
1605
  return this.facetCoords.values().next().value;
1530
1606
  }
1531
1607
  getPadding() {
1532
- return this._cache("size/padding", () => R.createFromConfig(this.spec.padding));
1608
+ return this._cache("size/padding", () => P.createFromConfig(this.spec.padding));
1533
1609
  }
1534
1610
  getOverhang() {
1535
- return R.zero();
1611
+ return P.zero();
1536
1612
  }
1537
1613
  getStructuralOverhang() {
1538
- return R.zero();
1614
+ return P.zero();
1539
1615
  }
1540
1616
  getStructuralSizeDefs(e) {
1541
1617
  let t = this.getStructuralOverhang();
@@ -1566,13 +1642,22 @@ var tt = class {
1566
1642
  return this.spec.viewportWidth != null || this.spec.viewportHeight != null;
1567
1643
  }
1568
1644
  getSize() {
1569
- return this._cache("size/size", () => this.isConfiguredVisible() ? new D(this.#g("width"), this.#g("height")) : O);
1645
+ return this._cache("size/size", () => this.isConfiguredVisible() ? new x(this.#g("width"), this.#g("height")) : S);
1570
1646
  }
1571
1647
  getViewportSize() {
1572
1648
  if (!this.isScrollable()) return this.getSize();
1573
- if (!this.isConfiguredVisible()) return O;
1649
+ if (!this.isConfiguredVisible()) return S;
1574
1650
  let e = this.getSize();
1575
- return new D(this.#g("viewportWidth") ?? e.width, this.#g("viewportHeight") ?? e.height);
1651
+ return new x(this.#g("viewportWidth") ?? e.width, this.#g("viewportHeight") ?? e.height);
1652
+ }
1653
+ getViewportAnchor(e) {
1654
+ let t = this.spec[e];
1655
+ if (!t || typeof t != "object" || !("anchor" in t)) return "start";
1656
+ if (e !== "viewportWidth" && e !== "viewportHeight") throw new b("Anchors are supported only on viewport sizes.", this);
1657
+ if (!T(t) && !a(t)) throw new b("An anchored viewport must define a size.", this);
1658
+ let n = t.anchor === void 0 ? "start" : t.anchor;
1659
+ if (n !== "start" && n !== "end") throw new b("Viewport anchor must be \"start\" or \"end\".", this);
1660
+ return n;
1576
1661
  }
1577
1662
  #g(e) {
1578
1663
  let { value: t, implicit: n } = this.#_(e), r = this.resolveSizeValue(e, t), i = q(r), a = e == "viewportWidth" || e == "viewportHeight";
@@ -1580,22 +1665,17 @@ var tt = class {
1580
1665
  if (a) throw new b(`Cannot use step-based size with "${e}"!`, this);
1581
1666
  let t = this.#x(e, r), i = this.getScaleResolution(e == "width" ? "x" : "y")?.getScale();
1582
1667
  if (i) {
1583
- let n;
1584
- if (v(i.type)) n = i.domain().length;
1585
- else if (["locus", "index"].includes(i.type)) {
1586
- let e = i.domain();
1587
- n = u(e) - e[0];
1588
- } else throw new b(`Cannot use step-based size with "${i.type}" scale!`, this);
1589
- let a = i;
1590
- n = ie(n, a.paddingInner(), a.paddingOuter());
1591
- let o = e == "width" ? "xOffset" : "yOffset", s = this.getScaleResolution(o)?.getScale(), c = r.for ?? (s && v(s.type) ? "offset" : "position"), l = t;
1592
- if (c == "offset") {
1593
- if (!s || !v(s.type)) throw new b(`Cannot use ${e}.step.for = "offset" without a discrete ${o} scale!`, this);
1594
- let t = s, n = ie(s.domain().length, t.paddingInner(), t.paddingOuter());
1595
- l *= n / (1 - a.paddingInner());
1668
+ if (!("sizeForStep" in i)) throw new b(`Cannot use step-based size with "${i.type}" scale!`, this);
1669
+ let n = e == "width" ? "xOffset" : "yOffset", a = this.getScaleResolution(n)?.getScale(), o = r.for ?? (a && h(a.type) ? "offset" : "position"), s = t;
1670
+ if (o == "offset") {
1671
+ let t = i.paddingInner?.() ?? 1;
1672
+ if (t === 1) throw new b("Offset-step sizing requires a primary scale with nonzero bandwidth.", this);
1673
+ if (!a || !h(a.type)) throw new b(`Cannot use ${e}.step.for = "offset" without a discrete ${n} scale!`, this);
1674
+ let r = a, o = ne(a.domain().length, a.type === "point" ? 1 : r.paddingInner(), r.paddingOuter());
1675
+ s *= o / (1 - t);
1596
1676
  }
1597
1677
  return {
1598
- px: n * l,
1678
+ px: i.sizeForStep(s),
1599
1679
  grow: 0
1600
1680
  };
1601
1681
  }
@@ -1605,7 +1685,7 @@ var tt = class {
1605
1685
  };
1606
1686
  throw new b(`Cannot use step-based size with "${e}"!`, this);
1607
1687
  }
1608
- return (r && Fe(r)) ?? (a ? void 0 : {
1688
+ return (r && we(r)) ?? (a ? void 0 : {
1609
1689
  px: 0,
1610
1690
  grow: 1
1611
1691
  });
@@ -1621,20 +1701,23 @@ var tt = class {
1621
1701
  };
1622
1702
  }
1623
1703
  #v(e) {
1624
- if (Ze(this)) return;
1704
+ if (tt(this)) return;
1625
1705
  let t = this.getConfig().view;
1626
1706
  if (!t) return;
1627
1707
  let n = e == "width" ? "x" : "y", r = this.getScaleResolution(n)?.getResolvedScaleType();
1628
- return r && !v(r) ? e == "width" ? t.continuousWidth : t.continuousHeight : (e == "width" ? t.discreteWidth : t.discreteHeight) ?? (t.step === void 0 ? void 0 : { step: t.step });
1708
+ return r && !h(r) ? e == "width" ? t.continuousWidth : t.continuousHeight : (e == "width" ? t.discreteWidth : t.discreteHeight) ?? (t.step === void 0 ? void 0 : { step: t.step });
1629
1709
  }
1630
1710
  resolveSizeValue(e, t) {
1631
- if (!h(t)) return t;
1711
+ if (this.getViewportAnchor(e), !a(t)) return t;
1632
1712
  let n = this.#C(e)();
1633
- if (ct(n) || n === "container") return n;
1713
+ if (mt(n) || n === "container") return n;
1634
1714
  throw new b(`"${e}" ExprRef must resolve to a finite number or "container"!`, this);
1635
1715
  }
1636
1716
  registerSizeInvalidation() {
1637
- this.#y("width", "x"), this.#y("height", "y"), this.#b("width"), this.#b("height"), this.#b("viewportWidth"), this.#b("viewportHeight");
1717
+ this.#b("width"), this.#b("height"), this.#b("viewportWidth"), this.#b("viewportHeight");
1718
+ }
1719
+ isStepSized(e) {
1720
+ return q(this.#_(e).value);
1638
1721
  }
1639
1722
  #y(e, t) {
1640
1723
  let { value: n, implicit: r } = this.#_(e);
@@ -1648,20 +1731,20 @@ var tt = class {
1648
1731
  let t = this.getSize()[e];
1649
1732
  this.invalidateSizeCache();
1650
1733
  let n = this.getSize()[e];
1651
- Ne(t, n) || this.context.requestLayoutReflow();
1734
+ Ce(t, n) || this.context.requestLayoutReflow();
1652
1735
  };
1653
- if (i.addEventListener("domain", a), this.registerDisposer(() => i.removeEventListener("domain", a)), n.for != "position") {
1736
+ if (this.registerDisposer(i.observeMapping(a)), n.for != "position") {
1654
1737
  let t = e == "width" ? "xOffset" : "yOffset", n = this.getScaleResolution(t);
1655
- n && v(n.getResolvedScaleType()) && (n.addEventListener("domain", a), this.registerDisposer(() => n.removeEventListener("domain", a)));
1738
+ n && h(n.getResolvedScaleType()) && this.registerDisposer(n.observeMapping(a));
1656
1739
  }
1657
1740
  }
1658
1741
  #b(e) {
1659
1742
  let { value: t } = this.#_(e);
1660
- h(t) ? this.#S(e, t) : q(t) && h(t.step) && this.#S(e + ".step", t.step);
1743
+ a(t) ? this.#S(e, t) : q(t) && a(t.step) && this.#S(e + ".step", t.step);
1661
1744
  }
1662
1745
  #x(e, t) {
1663
- let n = h(t.step) ? this.#C(e + ".step")() : t.step;
1664
- if (ct(n)) return n;
1746
+ let n = a(t.step) ? this.#C(e + ".step")() : t.step;
1747
+ if (mt(n)) return n;
1665
1748
  throw new b(`"${e}.step" ExprRef must resolve to a finite number!`, this);
1666
1749
  }
1667
1750
  #S(e, t) {
@@ -1771,23 +1854,33 @@ var tt = class {
1771
1854
  for (let e of this.#f) e();
1772
1855
  this.#f.length = 0;
1773
1856
  let e = this.flowHandle;
1774
- e?.collector && (this.context.dataFlow.pruneCollectorBranch(e.collector), this.context.dataFlow.removeCollector(e.collector)), e?.dataSource && e.dataSource.view === this && !e.dataSource.shareKey && this.context.dataFlow.removeDataSource(e.dataSource), this.paramRuntime.dispose(), this.namedDataScope.dispose(), this.flowHandle = void 0, this.context.dataFlow.loadingStatusRegistry.delete(this);
1857
+ for (let t of e?.terminals ?? []) t.children.length === 0 && this.context.dataFlow.pruneBranch(t);
1858
+ e?.collector && (this.context.dataFlow.pruneBranch(e.collector), this.context.dataFlow.removeCollector(e.collector)), e?.dataSource && e.dataSource.view === this && !e.dataSource.shareKey && this.context.dataFlow.removeDataSource(e.dataSource), this.paramRuntime.dispose(), this.namedDataScope.dispose();
1859
+ for (let e of this.flowOutputs) e.producerView = void 0;
1860
+ this.flowOutputs.clear(), this.flowHandle = void 0, this.context.dataFlow.loadingStatusRegistry.delete(this);
1775
1861
  }
1776
1862
  registerDisposer(e) {
1777
1863
  this.#f.push(e);
1778
1864
  }
1779
- disposeSubtree() {
1780
- let e = (e) => {
1865
+ assertCanDisposeSubtree() {
1866
+ let e = new Set(this.getDescendants());
1867
+ for (let t of e) for (let n of t.flowOutputs) if (n.owner && !e.has(n.owner)) throw Error("Cannot remove a shared output producer while its owner survives.");
1868
+ }
1869
+ disposeSubtree({ checkDependencies: e = !0 } = {}) {
1870
+ e && this.assertCanDisposeSubtree();
1871
+ let t = (e) => {
1781
1872
  for (let t of Object.values(e.resolutions.scale)) t.dispose();
1782
1873
  };
1783
- e.postOrder = (e) => {
1874
+ t.postOrder = (e) => {
1784
1875
  e.dispose();
1785
- }, this.visit(e);
1876
+ }, this.visit(t);
1786
1877
  }
1787
1878
  configurePostScaleParams() {
1879
+ if (this.#u) return;
1880
+ this.#u = !0, this.#y("width", "x"), this.#y("height", "y");
1788
1881
  let e = this.#d;
1789
- if (e.length && !this.#u) {
1790
- this.#u = !0, this.#l = !1;
1882
+ if (e.length) {
1883
+ this.#l = !1;
1791
1884
  for (let t of e) this.paramRuntime.getValue(t);
1792
1885
  this.registerDisposer(this._addBroadcastHandler("subtreeDataReady", () => {
1793
1886
  this.#l = !0, this.#T();
@@ -1795,7 +1888,7 @@ var tt = class {
1795
1888
  }
1796
1889
  }
1797
1890
  configureViewOpacity() {
1798
- (!this.opacityFunction || this.opacityFunction === K) && (this.opacityFunction = at(this));
1891
+ (!this.opacityFunction || this.opacityFunction === K) && (this.opacityFunction = dt(this));
1799
1892
  }
1800
1893
  finalizeParamRuntimeInitialization() {
1801
1894
  this.#l === void 0 ? this.paramRuntime.finalizeInitialization() : this.#T();
@@ -1809,8 +1902,8 @@ var tt = class {
1809
1902
  arrange(e, t, n = {}) {
1810
1903
  if (this.layoutParent || this.visit((e) => {
1811
1904
  e.layoutCoords = void 0;
1812
- }), this.layoutCoords = t, n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId, ee(t, m(n))), this.#a || this.#o) {
1813
- let e = this.getOverhang(), n = this.layoutParent ? R.zero() : this.getPadding();
1905
+ }), this.layoutCoords = t, n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId, ae(t, te(n))), this.#a || this.#o) {
1906
+ let e = this.getOverhang(), n = this.layoutParent ? P.zero() : this.getPadding();
1814
1907
  this.#a?.(t.width - e.width - n.width), this.#o?.(t.height - e.height - n.height);
1815
1908
  }
1816
1909
  this.#c = !0, this.#T();
@@ -1831,7 +1924,7 @@ var tt = class {
1831
1924
  }
1832
1925
  getFacetFields(e) {
1833
1926
  let t = this.getEncoding().sample;
1834
- return ne(t) ? [t.field] : this.options.inheritEncoding ? this.layoutParent?.getFacetFields(this) : [];
1927
+ return o(t) ? [t.field] : this.options.inheritEncoding ? this.layoutParent?.getFacetFields(this) : [];
1835
1928
  }
1836
1929
  usesSampleFacetRendering() {
1837
1930
  return this.layoutParent?.usesSampleFacetRendering() ?? !1;
@@ -1849,17 +1942,17 @@ var tt = class {
1849
1942
  return this.#E(e, "axis");
1850
1943
  }
1851
1944
  #E(e, t) {
1852
- let n = g(e);
1945
+ let n = _(e);
1853
1946
  for (let e of this.getDataAncestors()) {
1854
1947
  let r = e.resolutions[t][n];
1855
1948
  if (r || e.isResolutionBoundary(n)) return r;
1856
1949
  }
1857
1950
  }
1858
1951
  isResolutionBoundary(e) {
1859
- return this.options.resolutionBoundaryChannels?.some((t) => t === g(e)) ?? !1;
1952
+ return this.options.resolutionBoundaryChannels?.some((t) => t === _(e)) ?? !1;
1860
1953
  }
1861
1954
  getLegendResolution(e) {
1862
- let t = g(e);
1955
+ let t = _(e);
1863
1956
  return this.getDataAncestors().map((e) => e.resolutions.legend[t]).find((e) => e);
1864
1957
  }
1865
1958
  getConfiguredResolution(e, t) {
@@ -1872,17 +1965,17 @@ var tt = class {
1872
1965
  return "independent";
1873
1966
  }
1874
1967
  getBaseUrl() {
1875
- return B(() => this.dataParent?.getBaseUrl(), We(this.spec.baseUrl));
1968
+ return de(() => this.dataParent?.getBaseUrl(), Je(this.spec.baseUrl));
1876
1969
  }
1877
1970
  isPickingSupported() {
1878
1971
  return !0;
1879
1972
  }
1880
1973
  getTitleText() {
1881
1974
  let e = this.spec.title;
1882
- if (e) return i(e) ? e : h(e.text) ? this.paramRuntime.evaluateAndGet(e.text) : e.text;
1975
+ if (e) return d(e) ? e : a(e.text) ? this.paramRuntime.evaluateAndGet(e.text) : e.text;
1883
1976
  }
1884
1977
  _cache(e, t) {
1885
- return ae(this, e, t);
1978
+ return le(this, e, t);
1886
1979
  }
1887
1980
  _invalidateCacheByPrefix(e, t = "self") {
1888
1981
  switch (t) {
@@ -1900,16 +1993,16 @@ var tt = class {
1900
1993
  }
1901
1994
  propagateInteraction(e) {}
1902
1995
  };
1903
- function it(e) {
1996
+ function ut(e) {
1904
1997
  return "unitsPerPixel" in e;
1905
1998
  }
1906
- function at(t) {
1907
- let n = "opacity" in t.spec ? t.spec.opacity : void 0;
1908
- if (n !== void 0) {
1909
- if (e(n)) return (e) => e * n;
1910
- if (it(n)) {
1911
- let e = (e) => {
1912
- let n = t.getScaleResolution(e), r = n?.getScale();
1999
+ function dt(e) {
2000
+ let t = "opacity" in e.spec ? e.spec.opacity : void 0;
2001
+ if (t !== void 0) {
2002
+ if (r(t)) return (e) => e * t;
2003
+ if (ut(t)) {
2004
+ let n = (t) => {
2005
+ let n = e.getScaleResolution(t), r = n?.getScale();
1913
2006
  if ([
1914
2007
  "linear",
1915
2008
  "index",
@@ -1918,46 +2011,46 @@ function at(t) {
1918
2011
  scale: r,
1919
2012
  scaleResolution: n
1920
2013
  };
1921
- }, r = st(n.values, "opacity.values", t);
1922
- if (!o(n.unitsPerPixel)) throw new b("\"opacity.unitsPerPixel\" must be an array.", t);
1923
- let i = () => 1, a = [], s = () => {
1924
- let e = ot(st(a.map((e) => e()), "opacity.unitsPerPixel", t), r, t), n = re().domain(e.unitsPerPixel).range(e.values).clamp(!0);
2014
+ }, r = pt(t.values, "opacity.values", e);
2015
+ if (!v(t.unitsPerPixel)) throw new b("\"opacity.unitsPerPixel\" must be an array.", e);
2016
+ let i = () => 1, o = [], s = () => {
2017
+ let t = ft(pt(o.map((e) => e()), "opacity.unitsPerPixel", e), r, e), n = se().domain(t.unitsPerPixel).range(t.values).clamp(!0);
1925
2018
  i = (e) => n(e);
1926
2019
  };
1927
- a = n.unitsPerPixel.map((e) => {
1928
- if (h(e)) {
1929
- let n = t.paramRuntime.watchExpression(e, () => {
1930
- s(), t.context.animator.requestRender();
2020
+ o = t.unitsPerPixel.map((t) => {
2021
+ if (a(t)) {
2022
+ let n = e.paramRuntime.watchExpression(t, () => {
2023
+ s(), e.context.animator.requestRender();
1931
2024
  });
1932
2025
  return () => n(null);
1933
2026
  }
1934
- return () => e;
2027
+ return () => t;
1935
2028
  }), s();
1936
2029
  let c = (e) => {
1937
2030
  let t = e.scaleResolution.getAxisLength() || 1e3;
1938
- return d(e.scale.domain()) / t;
2031
+ return f(e.scale.domain()) / t;
1939
2032
  }, l;
1940
- if (n.channel === "auto") {
1941
- let n = e("x"), r = e("y");
1942
- if (n && r) l = () => (c(n) + c(r)) / 2;
1943
- else if (n) l = () => c(n);
2033
+ if (t.channel === "auto") {
2034
+ let t = n("x"), r = n("y");
2035
+ if (t && r) l = () => (c(t) + c(r)) / 2;
2036
+ else if (t) l = () => c(t);
1944
2037
  else if (r) l = () => c(r);
1945
- else throw new b("Cannot find a resolved quantitative x or y scale for dynamic opacity!", t);
2038
+ else throw new b("Cannot find a resolved quantitative x or y scale for dynamic opacity!", e);
1946
2039
  } else {
1947
- let r = n.channel ? e(n.channel) : e("x") ?? e("y");
1948
- if (!r) throw new b("Cannot find a resolved quantitative scale for dynamic opacity!", t);
2040
+ let r = t.channel ? n(t.channel) : n("x") ?? n("y");
2041
+ if (!r) throw new b("Cannot find a resolved quantitative scale for dynamic opacity!", e);
1949
2042
  l = () => c(r);
1950
2043
  }
1951
2044
  return (e) => i(l()) * e;
1952
2045
  }
1953
- if (h(n)) {
1954
- let e = t.paramRuntime.watchExpression(n, () => t.context.animator.requestRender());
1955
- return (t) => e(null) * t;
2046
+ if (a(t)) {
2047
+ let n = e.paramRuntime.watchExpression(t, () => e.context.animator.requestRender());
2048
+ return (e) => n(null) * e;
1956
2049
  }
1957
2050
  }
1958
2051
  return K;
1959
2052
  }
1960
- function ot(e, t, n) {
2053
+ function ft(e, t, n) {
1961
2054
  if (!e.length) throw new b("\"opacity.unitsPerPixel\" must contain at least one stop.", n);
1962
2055
  if (e.length !== t.length) throw new b("\"opacity.unitsPerPixel\" and \"opacity.values\" must have the same length.", n);
1963
2056
  e.forEach((e, t) => {
@@ -1975,42 +2068,42 @@ function ot(e, t, n) {
1975
2068
  values: a
1976
2069
  };
1977
2070
  }
1978
- function st(t, n, r) {
1979
- if (!o(t)) throw new b("\"" + n + "\" must evaluate to an array.", r);
1980
- return t.map((t, i) => {
1981
- if (!e(t) || !Number.isFinite(t)) throw new b("Invalid " + n + " value at index " + i + ". Expected a finite number.", r);
1982
- return t;
2071
+ function pt(e, t, n) {
2072
+ if (!v(e)) throw new b("\"" + t + "\" must evaluate to an array.", n);
2073
+ return e.map((e, i) => {
2074
+ if (!r(e) || !Number.isFinite(e)) throw new b("Invalid " + t + " value at index " + i + ". Expected a finite number.", n);
2075
+ return e;
1983
2076
  });
1984
2077
  }
1985
2078
  var q = (e) => !!e && typeof e == "object" && "step" in e;
1986
- function ct(e) {
2079
+ function mt(e) {
1987
2080
  return typeof e == "number" && Number.isFinite(e);
1988
2081
  }
1989
2082
  var J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
1990
- function lt(e, t) {
1991
- X(e, t, "Import");
2083
+ function ht(e, t) {
2084
+ _t(e, t, "Import");
1992
2085
  }
1993
- function ut(e, t) {
1994
- X(e, t, "View");
2086
+ function gt(e, t) {
2087
+ _t(e, t, "View");
1995
2088
  }
1996
- function X(e, t, n) {
2089
+ function _t(e, t, n) {
1997
2090
  if (t !== null && typeof t != "string") throw Error(n + " scope name must be a string or null.");
1998
2091
  J.set(e, { name: t });
1999
2092
  }
2000
- function dt(e) {
2093
+ function vt(e) {
2001
2094
  return J.get(e);
2002
2095
  }
2003
- function ft(e, t = {}) {
2096
+ function yt(e, t = {}) {
2004
2097
  let n = t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude";
2005
2098
  Y.set(e, n);
2006
2099
  }
2007
- function pt(e, t = {}) {
2008
- Je(e, t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude");
2100
+ function bt(e, t = {}) {
2101
+ Qe(e, t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude");
2009
2102
  }
2010
- function mt(e) {
2011
- return e.getLayoutAncestors().some(Xe);
2103
+ function xt(e) {
2104
+ return e.getLayoutAncestors().some(et);
2012
2105
  }
2013
- function Z(e) {
2106
+ function X(e) {
2014
2107
  let t = e.getDataAncestors(), n = [];
2015
2108
  for (let e = t.length - 1; e >= 0; --e) {
2016
2109
  let r = J.get(t[e]);
@@ -2018,112 +2111,117 @@ function Z(e) {
2018
2111
  }
2019
2112
  return n;
2020
2113
  }
2021
- function ht(e) {
2114
+ function St(e) {
2022
2115
  let t = e.explicitName;
2023
2116
  if (!t) throw Error("Cannot build a selector for a view without a name.");
2024
2117
  return {
2025
- scope: Z(e),
2118
+ scope: X(e),
2026
2119
  view: t
2027
2120
  };
2028
2121
  }
2029
- function gt(e, t) {
2122
+ function Ct(e, t) {
2030
2123
  if (!t) throw Error("Cannot build a selector for a parameter without a name.");
2031
2124
  return {
2032
- scope: Z(e),
2125
+ scope: X(e),
2033
2126
  param: t
2034
2127
  };
2035
2128
  }
2036
- function _t(e) {
2037
- return Tt(e), "p:" + JSON.stringify({
2129
+ function wt(e) {
2130
+ return Mt(e), "p:" + JSON.stringify({
2038
2131
  scope: e.scope,
2039
2132
  param: e.param
2040
2133
  });
2041
2134
  }
2042
- function vt(e, t) {
2135
+ function Tt(e, t) {
2043
2136
  e.visit((e) => {
2044
- let n = Ye(e);
2137
+ let n = $e(e);
2045
2138
  if (n === "excludeSubtree") return W;
2046
2139
  if (n !== "exclude") return t(e);
2047
2140
  });
2048
2141
  }
2049
- function yt(e, t) {
2142
+ function Et(e, t) {
2050
2143
  e.visit((e) => {
2051
2144
  let n = Y.get(e);
2052
2145
  if (n === "excludeSubtree") return W;
2053
2146
  if (n !== "exclude") return t(e);
2054
2147
  });
2055
2148
  }
2056
- function bt(e, t) {
2057
- if (Et(t), !Pt(e, t.scope)) return;
2149
+ function Dt(e, t) {
2150
+ if (Nt(t), !Vt(e, t.scope)) return;
2058
2151
  let n = [];
2059
- if ($(e, t.scope, (e) => {
2152
+ if (Q(e, t.scope, (e) => {
2060
2153
  e.explicitName === t.view && n.push(e);
2061
2154
  }, { includeNamedImportRoots: !0 }), n.length === 1) return n[0];
2062
2155
  if (n.length !== 0) throw Error("View selector is ambiguous for view \"" + t.view + "\" in scope " + JSON.stringify(t.scope));
2063
2156
  }
2064
- function xt(e, t) {
2065
- if (Tt(t), !Pt(e, t.scope)) return;
2157
+ function Ot(e, t) {
2158
+ if (Mt(t), !Vt(e, t.scope)) return;
2066
2159
  let n = [];
2067
- if ($(e, t.scope, (e) => {
2068
- for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param && Q(i) && n.push({
2160
+ if (Q(e, t.scope, (e) => {
2161
+ for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param && Z(i, e) && n.push({
2069
2162
  view: e,
2070
2163
  param: i
2071
2164
  });
2072
2165
  }), n.length === 1) return n[0];
2073
2166
  if (n.length !== 0) throw Error("Param selector is ambiguous for param \"" + t.param + "\" in scope " + JSON.stringify(t.scope));
2074
2167
  }
2075
- function St(e, t) {
2168
+ function kt(e, t) {
2076
2169
  e.visit((e) => {
2077
2170
  let n = Y.get(e);
2078
2171
  if (n === "excludeSubtree") return W;
2079
- if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs) Q(r) && t({
2172
+ if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs) Z(r, e) && t({
2080
2173
  view: e,
2081
2174
  param: r,
2082
- selector: gt(e, n)
2175
+ selector: Ct(e, n)
2083
2176
  });
2084
2177
  });
2085
2178
  }
2086
- function Ct(e) {
2179
+ function At(e) {
2087
2180
  let t = [];
2088
- return St(e, (e) => t.push(e)), t;
2181
+ return kt(e, (e) => t.push(e)), t;
2089
2182
  }
2090
- function wt(e) {
2183
+ function jt(e) {
2091
2184
  let t = [];
2092
- for (let n of Dt(e)) {
2093
- let r = Ot(n);
2094
- At(e, r, t), jt(e, r, t);
2185
+ for (let n of Pt(e)) {
2186
+ let r = Ft(n);
2187
+ Lt(e, r, t), Rt(e, r, t);
2095
2188
  }
2096
2189
  return t;
2097
2190
  }
2098
- function Tt(e) {
2191
+ function Mt(e) {
2099
2192
  if (!e || !Array.isArray(e.scope)) throw Error("Param selector scope must be an array.");
2100
2193
  if (typeof e.param != "string" || !e.param.length) throw Error("Param selector param must be a non-empty string.");
2101
2194
  }
2102
- function Et(e) {
2195
+ function Nt(e) {
2103
2196
  if (!e || !Array.isArray(e.scope)) throw Error("View selector scope must be an array.");
2104
2197
  if (typeof e.view != "string" || !e.view.length) throw Error("View selector view must be a non-empty string.");
2105
2198
  }
2106
- function Q(e) {
2107
- return e.persist === !1 ? !1 : l(e) ? !0 : c(e) ? !!e.bind : !1;
2199
+ function Z(e, t) {
2200
+ if (e.persist === !1) return !1;
2201
+ if (e.push === "outer") {
2202
+ let n = t.paramRuntime.findRuntimeForParam(e.name);
2203
+ if (c(n.paramConfigs.get(e.name))) return !1;
2204
+ }
2205
+ return c(e) ? !0 : ce(e) ? !!e.bind : !1;
2108
2206
  }
2109
- function Dt(e) {
2207
+ function Pt(e) {
2110
2208
  let t = /* @__PURE__ */ new Set([e]);
2111
2209
  return e.visit((e) => {
2112
2210
  let n = J.get(e);
2113
2211
  n && typeof n.name == "string" && t.add(e);
2114
2212
  }), Array.from(t);
2115
2213
  }
2116
- function Ot(e) {
2117
- return Z(e);
2214
+ function Ft(e) {
2215
+ return X(e);
2118
2216
  }
2119
- function kt(e) {
2217
+ function It(e) {
2120
2218
  return e.length ? "import scope [" + e.join(" / ") + "]" : "import scope (root)";
2121
2219
  }
2122
- function At(e, t, n) {
2220
+ function Lt(e, t, n) {
2123
2221
  let r = /* @__PURE__ */ new Map();
2124
- $(e, t, (e) => {
2222
+ Q(e, t, (e) => {
2125
2223
  for (let [t, n] of e.paramRuntime.paramConfigs) {
2126
- if (!Q(n)) continue;
2224
+ if (!Z(n, e)) continue;
2127
2225
  let i = r.get(t);
2128
2226
  i ? i.push(e) : r.set(t, [e]);
2129
2227
  }
@@ -2132,15 +2230,15 @@ function At(e, t, n) {
2132
2230
  if (i.length <= 1) continue;
2133
2231
  let r = i.map((e) => e.getPathString()).join(", ");
2134
2232
  n.push({
2135
- message: "Bookmarkable parameter \"" + e + "\" is not unique within " + kt(t) + ". Found in: " + r + ".",
2233
+ message: "Bookmarkable parameter \"" + e + "\" is not unique within " + It(t) + ". Found in: " + r + ".",
2136
2234
  scope: t
2137
2235
  });
2138
2236
  }
2139
2237
  }
2140
- function jt(e, t, n) {
2141
- let r = Mt(e, t);
2238
+ function Rt(e, t, n) {
2239
+ let r = zt(e, t);
2142
2240
  if (!r.length) return;
2143
- let i = r.filter((e) => Nt(e));
2241
+ let i = r.filter((e) => Bt(e));
2144
2242
  if (i.length <= 1) return;
2145
2243
  let a = /* @__PURE__ */ new Map();
2146
2244
  for (let e of i) {
@@ -2148,36 +2246,36 @@ function jt(e, t, n) {
2148
2246
  typeof n == "string" && n.length && a.set(n, (a.get(n) ?? 0) + 1);
2149
2247
  }
2150
2248
  for (let [e, r] of a) r > 1 && n.push({
2151
- message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " + kt(t) + ".",
2249
+ message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " + It(t) + ".",
2152
2250
  scope: t
2153
2251
  });
2154
2252
  }
2155
- function Mt(e, t) {
2253
+ function zt(e, t) {
2156
2254
  let n = [];
2157
- return $(e, t, (e) => {
2158
- if (Z(e).length !== t.length + 1) return;
2255
+ return Q(e, t, (e) => {
2256
+ if (X(e).length !== t.length + 1) return;
2159
2257
  let r = J.get(e);
2160
2258
  r && typeof r.name == "string" && n.push(e);
2161
2259
  }, { includeNamedImportRoots: !0 }), n;
2162
2260
  }
2163
- function Nt(e) {
2261
+ function Bt(e) {
2164
2262
  let t = !1;
2165
2263
  return e.visit((e) => {
2166
2264
  let n = Y.get(e);
2167
2265
  if (n === "excludeSubtree") return W;
2168
2266
  if (n !== "exclude") {
2169
- for (let n of e.paramRuntime.paramConfigs.values()) if (Q(n)) return t = !0, G;
2267
+ for (let n of e.paramRuntime.paramConfigs.values()) if (Z(n, e)) return t = !0, G;
2170
2268
  }
2171
2269
  }), t;
2172
2270
  }
2173
- function Pt(e, t) {
2271
+ function Vt(e, t) {
2174
2272
  let n = e, r = [];
2175
2273
  for (let i of t) {
2176
2274
  if (typeof i != "string" || !i.length) throw Error("Scope names must be non-empty strings.");
2177
2275
  let t, a = !1;
2178
- if ($(e, r, (e) => {
2276
+ if (Q(e, r, (e) => {
2179
2277
  let n = J.get(e);
2180
- if (n && n.name === i && Z(e).length === r.length + 1) {
2278
+ if (n && n.name === i && X(e).length === r.length + 1) {
2181
2279
  if (t) return a = !0, G;
2182
2280
  t = e;
2183
2281
  }
@@ -2187,25 +2285,25 @@ function Pt(e, t) {
2187
2285
  }
2188
2286
  return n;
2189
2287
  }
2190
- function $(e, t, n, r = {}) {
2288
+ function Q(e, t, n, r = {}) {
2191
2289
  let i = r.includeNamedImportRoots ?? !1;
2192
2290
  e.visit((e) => {
2193
2291
  let r = J.get(e), a = Y.get(e);
2194
2292
  if (a === "excludeSubtree") return W;
2195
- if (a !== "exclude" && Ft(e, t, r, i)) return n(e);
2293
+ if (a !== "exclude" && Ht(e, t, r, i)) return n(e);
2196
2294
  });
2197
2295
  }
2198
- function Ft(e, t, n, r) {
2199
- let i = Z(e);
2200
- return It(i, t) ? !0 : !r || !n || typeof n.name != "string" || i.length !== t.length + 1 ? !1 : Lt(t, i);
2296
+ function Ht(e, t, n, r) {
2297
+ let i = X(e);
2298
+ return Ut(i, t) ? !0 : !r || !n || typeof n.name != "string" || i.length !== t.length + 1 ? !1 : $(t, i);
2201
2299
  }
2202
- function It(e, t) {
2203
- return e.length === t.length && Lt(e, t);
2300
+ function Ut(e, t) {
2301
+ return e.length === t.length && $(e, t);
2204
2302
  }
2205
- function Lt(e, t) {
2303
+ function $(e, t) {
2206
2304
  if (e.length > t.length) return !1;
2207
2305
  for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
2208
2306
  return !0;
2209
2307
  }
2210
2308
  //#endregion
2211
- export { D as A, De as B, qe as C, Be as D, Ve as E, Oe as F, Se as G, je as H, P as I, xe as J, w as K, N as L, I as M, M as N, R as O, Ae as P, Ee as R, Ze as S, B as T, ke as U, Ie as V, T as W, x as Y, W as _, ht as a, $e as b, pt as c, ut as d, xt as f, vt as g, yt as h, Z as i, O as j, Re as k, ft as l, wt as m, dt as n, mt as o, bt as p, be as q, gt as r, _t as s, Ct as t, lt as u, G as v, Ue as w, Xe as x, rt as y, Fe as z };
2309
+ export { P as A, ge as B, Ze as C, He as D, Ve as E, O as F, ye as G, _e as H, be as I, ve as L, x as M, S as N, ze as O, M as P, A as R, tt as S, B as T, E as U, we as V, xe as W, G as _, xt as a, rt as b, yt as c, Ot as d, Dt as f, W as g, Tt as h, St as i, Ee as j, Oe as k, ht as l, Et as m, vt as n, wt as o, jt as p, X as r, bt as s, At as t, gt as u, lt as v, qe as w, et as x, ot as y, k as z };