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