@graphysdk/viz-engine 1.9.0-beta.1793621290212 → 1.9.0-beta.1793631379825

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
1
- import { $t as D, A as he, An as ys, Ar as Te, Br as vs, Bt as bs, C as Nt, Cr as Ss, Ct as Dt, Dr as nt, E as Ts, Fr as k, Ft as rt, Gn as En, Gt as Ge, Hn as As, Ht as xs, I as Vn, Ir as ws, It as Mn, Jn as Cs, Jt as me, Kn as Is, L as pe, Ln as Xe, Lr as Ye, Lt as Ln, Mt as _t, N as ge, Nr as h, Nt as Es, O as ht, On as Ot, Or as kn, Ot as Vs, P as Ms, Pr as Rn, Pt as X, Qn as Ls, Qt as Nn, Rn as ye, Rt as ks, St as Rs, T as Pt, Tn as Dn, Tr as st, Ut as Ns, Vt as Ds, Xn as M, Yn as ve, Yt as _s, Zn as E, Zr as Os, Zt as Ps, _r as _n, _t as $s, an as On, ar as Pn, cn as Fs, cr as $n, dn as te, dr as g, en as yt, er as Fn, fn as Bn, ft as Bs, g as Ie, gn as Un, gr as ae, hr as C, in as Ae, ir as Ee, j as Us, jr as _, k as Gs, kn as $t, kr as Ys, ln as js, m as Gn, mr as be, ni as Y, nn as vt, on as J, pn as Yn, pr as Ft, qn as zs, qt as bt, ri as O, rn as jn, rr as Ks, sn as qs, sr as fe, ti as zn, tn as Ws, un as Hs, ur as S, v as Bt, w as Xs, wn as Js, wr as Zs, x as Qs, xr as eo, yn as to, yr as no, yt as ro, z as St, zr as Ve, zt as Ut } from "./styles-BE6KKj04.js";
2
- import { clamp as Kn, isEqual as so, merge as je, pick as oo } from "lodash-es";
1
+ import { $n as vs, $t as bs, A as ye, An as En, Ar as Ss, Bn as Nt, Br as Ts, C as Dt, Cn as Vn, Dr as ae, Dt as As, E as xs, En as Mn, Er as C, Fn as ws, Fr as Cs, Gr as Ln, Gt as nt, Hr as D, Ht as _t, I as kn, In as Rn, Ir as rt, Jn as Xe, Jr as Ge, Jt as Is, Kr as k, Kt as Nn, L as pe, Mr as Es, Mt as Vs, N as he, Nt as Ot, O as ht, Or as Dn, P as Ms, Pr as Ls, Qt as ks, Rr as st, Rt as Rs, Sn as _n, Sr as g, St as Ns, T as Pt, Tr as ve, Ut as Ds, Vn as _s, Vr as Ae, Wr as h, Wt as X, Xr as Ie, Xt as Os, Yn as be, Yt as $t, Zr as Ps, Zt as $s, _n as Fs, an as Bs, ar as Us, bn as Gs, ci as Ys, cn as On, cr as E, dn as js, dr as Pn, fi as $n, fn as yt, g as Ee, gn as J, gr as Fn, hn as Bn, hr as Ve, in as fe, ir as zs, j as Ks, k as qs, kt as Ws, ln as _, lr as Hs, m as Un, mi as O, mn as de, mr as Xs, nr as Gn, or as Se, pi as Y, pn as Yn, qr as Js, qt as jn, rn as vt, rr as Zs, sn as Qs, sr as M, tn as Ye, un as bt, v as Ft, vn as eo, vr as ge, w as to, wr as Bt, x as no, xn as te, xr as S, yn as ro, yr as zn, z as St, zn as Ut, zr as Kn } from "./styles-Ca8aceS1.js";
2
+ import { clamp as qn, isEqual as so, merge as je, pick as oo } from "lodash-es";
3
3
  import { utcDay as ao, utcHour as io, utcMonday as co, utcMonth as lo, utcYear as uo } from "d3-time";
4
4
  import { differenceInDays as mo } from "date-fns/differenceInDays";
5
5
  import { regressionExp as po, regressionLinear as fo, regressionLoess as go, regressionLog as ho, regressionPoly as yo, regressionPow as vo, regressionQuad as bo } from "d3-regression";
6
- import { scaleBand as qn, scaleLinear as Je, scaleLog as So, scaleOrdinal as To, scaleSqrt as Ao, scaleUtc as xo } from "d3-scale";
6
+ import { scaleBand as Wn, scaleLinear as Je, scaleLog as So, scaleOrdinal as To, scaleSqrt as Ao, scaleUtc as xo } from "d3-scale";
7
7
  import { interpolateHcl as wo, interpolateHsl as Co, interpolateLab as Io, interpolateRgb as Eo, piecewise as Vo } from "d3-interpolate";
8
8
  var U = (e, t) => {
9
- const n = fe(t);
9
+ const n = ge(t);
10
10
  if (n !== void 0) return () => n;
11
11
  const r = S(t);
12
12
  return g(r) ? (s) => {
13
13
  const o = s[r];
14
- return o === void 0 ? null : Wn(o, e.getType(r));
14
+ return o === void 0 ? null : Hn(o, e.getType(r));
15
15
  } : () => null;
16
16
  }, Mo = (e, t) => {
17
- const n = fe(t);
17
+ const n = ge(t);
18
18
  if (n !== void 0) return () => n;
19
19
  const r = S(t);
20
20
  if (!g(r) || !e.hasVariable(r)) return () => null;
21
21
  const s = e.getValues(r), o = e.getType(r);
22
22
  return (a) => {
23
23
  const i = s[a];
24
- return i === void 0 ? null : Wn(i, o);
24
+ return i === void 0 ? null : Hn(i, o);
25
25
  };
26
- }, gm = (e, t) => U(e, t.x), hm = (e, t) => U(e, t.y), ym = (e, t) => U(e, t.label), vm = (e, t) => U(e, t.color), bm = (e, t) => U(e, t.size), Sm = (e, t) => U(e, t.alpha), Tm = (e, t) => U(e, t.group), Am = (e, t) => U(e, t.strokeWidth), Wn = (e, t) => {
26
+ }, hm = (e, t) => U(e, t.x), ym = (e, t) => U(e, t.y), vm = (e, t) => U(e, t.label), bm = (e, t) => U(e, t.color), Sm = (e, t) => U(e, t.size), Tm = (e, t) => U(e, t.alpha), Am = (e, t) => U(e, t.group), xm = (e, t) => U(e, t.strokeWidth), Hn = (e, t) => {
27
27
  switch (t) {
28
28
  case "numeric":
29
29
  return Y(e) ? e : null;
30
30
  case "categorical":
31
- return zn(e) ? e : null;
31
+ return $n(e) ? e : null;
32
32
  case "temporal":
33
33
  return O(e) ? e : null;
34
34
  default:
@@ -36,9 +36,9 @@ var U = (e, t) => {
36
36
  }
37
37
  }, Gt = { variable: h.yRaw };
38
38
  function Tt(e, t) {
39
- return Ee(e) ? Gt : t.y ?? Gt;
39
+ return Ve(e) ? Gt : t.y ?? Gt;
40
40
  }
41
- function Hn(e) {
41
+ function Xn(e) {
42
42
  return U(e.data, Tt(e.position, e.mapping));
43
43
  }
44
44
  function Lo(e) {
@@ -46,18 +46,18 @@ function Lo(e) {
46
46
  }
47
47
  var ze = (e) => {
48
48
  const t = S(e.mapping.x);
49
- return t !== null && t !== Te.x ? t : Qn(e) ?? _.group;
50
- }, Xn = (e) => ko(e) ? S(e.mapping.y) : null, Jn = (e) => Xn(e) === null ? null : Hn(e), Zn = (e) => e.spatialKind !== "cells" && ze(e) !== Qn(e), Qn = (e) => typeof e.identityKey == "object" ? e.identityKey.variable : null, ko = (e) => e.spatialKind === "points" || e.spatialKind === "cells", Ro = (e, t) => e.yScaleType === t.yScaleType && ot(e.valueFormat) === ot(t.valueFormat), Yt = (e) => `${e.yScaleType} y axis, ${ot(e.valueFormat)}`, ot = (e) => e.type === "currency" ? `${e.type}:${e.iso}` : e.type, No = (e, t) => {
51
- const n = ve(e.data.getValueFormat(ze(e))), r = Xn(e);
49
+ return t !== null && t !== Ae.x ? t : er(e) ?? D.group;
50
+ }, Jn = (e) => ko(e) ? S(e.mapping.y) : null, Zn = (e) => Jn(e) === null ? null : Xn(e), Qn = (e) => e.spatialKind !== "cells" && ze(e) !== er(e), er = (e) => typeof e.identityKey == "object" ? e.identityKey.variable : null, ko = (e) => e.spatialKind === "points" || e.spatialKind === "cells", Ro = (e, t) => e.yScaleType === t.yScaleType && ot(e.valueFormat) === ot(t.valueFormat), Yt = (e) => `${e.yScaleType} y axis, ${ot(e.valueFormat)}`, ot = (e) => e.type === "currency" ? `${e.type}:${e.iso}` : e.type, No = (e, t) => {
51
+ const n = Se(e.data.getValueFormat(ze(e))), r = Jn(e);
52
52
  return (s) => ({
53
53
  ...s,
54
- anchorValue: ye(s.anchorValue, n, t),
55
- ...s.groupValue !== void 0 && { groupValue: ye(s.groupValue, ve(e.data.getValueFormat(_.group)), t) },
56
- ...s.crossValue !== void 0 && r !== null && { crossValue: ye(s.crossValue, ve(e.data.getValueFormat(r)), t) }
54
+ anchorValue: be(s.anchorValue, n, t),
55
+ ...s.groupValue !== void 0 && { groupValue: be(s.groupValue, Se(e.data.getValueFormat(D.group)), t) },
56
+ ...s.crossValue !== void 0 && r !== null && { crossValue: be(s.crossValue, Se(e.data.getValueFormat(r)), t) }
57
57
  });
58
58
  };
59
59
  function Do(e) {
60
- return e instanceof Ls ? {
60
+ return e instanceof Hs ? {
61
61
  severity: "error",
62
62
  kind: e.kind,
63
63
  code: e.code,
@@ -71,8 +71,8 @@ function Do(e) {
71
71
  message: e instanceof Error ? e.message : String(e)
72
72
  };
73
73
  }
74
- function xm(e, t) {
75
- return tr(e, t);
74
+ function wm(e, t) {
75
+ return nr(e, t);
76
76
  }
77
77
  function ke(e, t) {
78
78
  for (const n of Object.keys(t)) {
@@ -84,12 +84,12 @@ function ke(e, t) {
84
84
  }
85
85
  return e;
86
86
  }
87
- function wm(e, t, n) {
87
+ function Cm(e, t, n) {
88
88
  if (e[t] === n) return e;
89
89
  const r = [...e];
90
90
  return r[t] = n, r;
91
91
  }
92
- function er(e, t) {
92
+ function tr(e, t) {
93
93
  let n = null;
94
94
  for (const [r, s] of e.entries()) {
95
95
  const o = t(s, r);
@@ -101,13 +101,13 @@ function er(e, t) {
101
101
  }
102
102
  return n ?? e;
103
103
  }
104
- function tr(e, t) {
104
+ function nr(e, t) {
105
105
  let n = !1;
106
106
  const r = { ...e };
107
107
  for (const [s, o] of Object.entries(t)) {
108
108
  const a = e[s];
109
- if (Ft(o) && Ft(a)) {
110
- const i = tr(a, o);
109
+ if (Bt(o) && Bt(a)) {
110
+ const i = nr(a, o);
111
111
  i !== a && (r[s] = i, n = !0);
112
112
  } else o !== void 0 && o !== a && (r[s] = o, n = !0);
113
113
  }
@@ -125,7 +125,7 @@ function At(e) {
125
125
  result: () => e
126
126
  };
127
127
  }
128
- var Cm = (e, t) => at(e) === at(t), at = (e) => JSON.stringify(xt(e)), xt = (e) => {
128
+ var Im = (e, t) => at(e) === at(t), at = (e) => JSON.stringify(xt(e)), xt = (e) => {
129
129
  const t = e;
130
130
  return typeof t != "object" || t === null ? ["invalid", String(t)] : "and" in e ? ["and", ...jt(e.and)] : "or" in e ? ["or", ...jt(e.or)] : "not" in e ? ["not", xt(e.not)] : [e.variable, ..._o(e)];
131
131
  }, _o = (e) => {
@@ -139,17 +139,17 @@ var Cm = (e, t) => at(e) === at(t), at = (e) => JSON.stringify(xt(e)), xt = (e)
139
139
  const t = Object.entries(e).sort(([n], [r]) => n.localeCompare(r));
140
140
  return ["invalid", JSON.stringify(t)];
141
141
  }, jt = (e) => Array.isArray(e) ? e.map(xt) : ["invalid", JSON.stringify(e)], zt = (e) => Array.isArray(e) ? e.map(ae) : ["invalid", JSON.stringify(e)], Kt = (e) => e.coords.coordType === "polar" ? "polar" : "cartesian", Oo = (e, t, n) => {
142
- const r = nr(e, t, n);
142
+ const r = rr(e, t, n);
143
143
  return r === -1 ? void 0 : e[r];
144
- }, nr = (e, t, n) => {
144
+ }, rr = (e, t, n) => {
145
145
  const r = wt(t, n);
146
146
  for (let s = e.length - 1; s >= 0; s -= 1) {
147
147
  const o = e[s];
148
148
  if (o !== void 0 && r(o)) return s;
149
149
  }
150
150
  return -1;
151
- }, Im = (e, t, n) => {
152
- const r = nr(e, t, n);
151
+ }, Em = (e, t, n) => {
152
+ const r = rr(e, t, n);
153
153
  return e.filter((s, o) => o !== r);
154
154
  }, Po = (e, t, n) => {
155
155
  const r = wt(t, n);
@@ -160,7 +160,7 @@ var Cm = (e, t) => at(e) === at(t), at = (e) => JSON.stringify(xt(e)), xt = (e)
160
160
  for (const [a, i] of Object.entries(o.declarations)) i !== void 0 && (s[a] = i);
161
161
  }
162
162
  return s;
163
- }, Em = (e, t, n) => Po(e, t, n), Vm = (e, t) => ce(e) === ce(t), wt = (e, t) => {
163
+ }, Vm = (e, t, n) => Po(e, t, n), Mm = (e, t) => ce(e) === ce(t), wt = (e, t) => {
164
164
  const n = ce(e), r = qt(e) !== void 0;
165
165
  return (s) => {
166
166
  const o = qt(s);
@@ -179,24 +179,24 @@ var Cm = (e, t) => at(e) === at(t), at = (e) => JSON.stringify(xt(e)), xt = (e)
179
179
  e.when?.state ?? null,
180
180
  n
181
181
  ]);
182
- }, Mm = (e, t) => [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((n) => $o(e[n], t[n])), Lm = (e, t) => ({ select: {
182
+ }, Lm = (e, t) => [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((n) => $o(e[n], t[n])), km = (e, t) => ({ select: {
183
183
  target: "geom",
184
184
  kind: e,
185
185
  layer: t
186
- } }), rr = (e) => e.select.target === "geom", km = (e, t, n) => {
186
+ } }), sr = (e) => e.select.target === "geom", Rm = (e, t, n) => {
187
187
  const r = /* @__PURE__ */ new Map();
188
188
  for (const s of e)
189
- !rr(s) || s.when?.where === void 0 || wt({
189
+ !sr(s) || s.when?.where === void 0 || wt({
190
190
  ...t,
191
191
  when: s.when
192
192
  }, n)(s) && r.set(ce(s), s);
193
193
  return [...r.values()];
194
- }, Rm = (e, t, n) => {
194
+ }, Nm = (e, t, n) => {
195
195
  const r = Oo(e, t, n);
196
- if (!(r === void 0 || !rr(r)))
196
+ if (!(r === void 0 || !sr(r)))
197
197
  return r.declarations;
198
- }, qt = (e) => e.select.coord, $o = (e, t) => e === t ? !0 : Ot(e) ? Ot(t) && e.light === t.light && e.dark === t.dark : $t(e) ? $t(t) && e.token === t.token : !1, Fo = (e, t) => {
199
- if (!Is(e)) return e;
198
+ }, qt = (e) => e.select.coord, $o = (e, t) => e === t ? !0 : Ut(e) ? Ut(t) && e.light === t.light && e.dark === t.dark : Nt(e) ? Nt(t) && e.token === t.token : !1, Fo = (e, t) => {
199
+ if (!Zs(e)) return e;
200
200
  const n = t[e.byVariable];
201
201
  return n === void 0 ? e.fallback : e.cases[C(n)] ?? e.fallback;
202
202
  }, Bo = (e) => e.type === "polar" ? "disk" : "panel", Uo = (e, t) => {
@@ -213,7 +213,7 @@ var Cm = (e, t) => at(e) === at(t), at = (e) => JSON.stringify(xt(e)), xt = (e)
213
213
  width: n,
214
214
  height: n
215
215
  };
216
- }, Nm = (e, t) => {
216
+ }, Dm = (e, t) => {
217
217
  if (e.space !== "disk") return {
218
218
  x: e.x,
219
219
  y: e.y
@@ -234,7 +234,7 @@ function Go(e, t) {
234
234
  function Yo(e, t) {
235
235
  return e === "x" ? t.y : t.x;
236
236
  }
237
- function Dm(e, t) {
237
+ function _m(e, t) {
238
238
  return {
239
239
  main: Go(e, t),
240
240
  cross: Yo(e, t)
@@ -252,11 +252,11 @@ function Wt(e, t) {
252
252
  function Ct(e) {
253
253
  return e.type === "cartesian" ? e.mainAxis : "x";
254
254
  }
255
- function _m(e) {
255
+ function Om(e) {
256
256
  return e.type === "cartesian";
257
257
  }
258
- var Ke = (e) => e[_.group], jo = (e) => {
259
- const t = ze(e), n = Jn(e), r = Zn(e) && t !== _.group;
258
+ var Ke = (e) => e[D.group], jo = (e) => {
259
+ const t = ze(e), n = Zn(e), r = Qn(e) && t !== D.group;
260
260
  return (s) => {
261
261
  const o = s[t] ?? null;
262
262
  if (o === null) return null;
@@ -271,7 +271,7 @@ var Ke = (e) => e[_.group], jo = (e) => {
271
271
  };
272
272
  };
273
273
  }, De = 1e-9;
274
- function sr(e) {
274
+ function or(e) {
275
275
  return e ? {
276
276
  start: h.yMin,
277
277
  end: h.yMax
@@ -280,7 +280,7 @@ function sr(e) {
280
280
  end: h.xMax
281
281
  };
282
282
  }
283
- function or(e, t) {
283
+ function ar(e, t) {
284
284
  const n = /* @__PURE__ */ new Map();
285
285
  for (const s of e.flatMap((o) => Wo(o, t))) {
286
286
  const o = C([s.value]), a = n.get(o);
@@ -290,7 +290,7 @@ function or(e, t) {
290
290
  return r.some(Ko) ? null : r.flatMap((s) => qo(s) ?? []);
291
291
  }
292
292
  function zo(e, t, n) {
293
- const r = or(e, t), s = C([n]), o = r?.find((a) => C([a.value]) === s);
293
+ const r = ar(e, t), s = C([n]), o = r?.find((a) => C([a.value]) === s);
294
294
  return o === void 0 ? null : (o.start + o.end) / 2;
295
295
  }
296
296
  function Ko(e) {
@@ -312,7 +312,7 @@ function qo(e) {
312
312
  return n;
313
313
  }
314
314
  function Wo(e, t) {
315
- const n = S(e.mapping.x), { data: r } = e, { start: s, end: o } = sr(t);
315
+ const n = S(e.mapping.x), { data: r } = e, { start: s, end: o } = or(t);
316
316
  if (!g(n) || !r.hasVariable(s) || !r.hasVariable(o)) return [];
317
317
  const a = r.getValues(n), i = r.getValues(s, { type: "numeric" }), c = r.getValues(o, { type: "numeric" });
318
318
  return a.flatMap((l, u) => {
@@ -325,32 +325,32 @@ function Wo(e, t) {
325
325
  });
326
326
  }
327
327
  var Ho = { type: "decimal" };
328
- function ar(e) {
328
+ function ir(e) {
329
329
  return e.length > 0 && e.every((t) => t.data.size() === 0);
330
330
  }
331
- function ir(e, t) {
331
+ function cr(e, t) {
332
332
  return t !== null && e.data.hasVariable(t) ? e.data.getValueFormat(t) : Ho;
333
333
  }
334
- function Om(e) {
335
- return ir(e, S(e.mapping.y));
334
+ function Pm(e) {
335
+ return cr(e, S(e.mapping.y));
336
336
  }
337
337
  function Xo(e, t) {
338
338
  const n = Ht(t);
339
339
  return [...Ht(e)].filter((r) => n.has(r));
340
340
  }
341
341
  function Ht(e) {
342
- const t = new Set(me(e.data, e.mapping));
342
+ const t = new Set(fe(e.data, e.mapping));
343
343
  for (const n of Object.values(e.mapping)) {
344
344
  const r = S(n);
345
345
  r === null || !e.data.hasVariable(r) || e.data.getType(r) === "categorical" && t.add(r);
346
346
  }
347
347
  return t;
348
348
  }
349
- function cr({ geom: e, position: t, mapping: n, purpose: r }) {
349
+ function lr({ geom: e, position: t, mapping: n, purpose: r }) {
350
350
  return e.resolveValueSource?.(n, r) ?? Tt(t, n);
351
351
  }
352
352
  function Jo(e, t) {
353
- const n = cr({
353
+ const n = lr({
354
354
  geom: t,
355
355
  position: e.position,
356
356
  mapping: e.mapping,
@@ -358,14 +358,14 @@ function Jo(e, t) {
358
358
  }), r = S(n), s = r === h.yRaw ? S(e.mapping.y) : r;
359
359
  return {
360
360
  read: U(e.data, n),
361
- valueFormat: ir(e, s)
361
+ valueFormat: cr(e, s)
362
362
  };
363
363
  }
364
364
  var Zo = (e) => {
365
- const t = ze(e), n = Jn(e), r = Zn(e);
366
- return (s, o) => !be(s[t] ?? null, o.anchorValue) || !(n === null || o.crossValue === void 0 || be(n(s), o.crossValue)) ? !1 : !r || o.groupValue === void 0 ? !0 : be(Ke(s), o.groupValue);
365
+ const t = ze(e), n = Zn(e), r = Qn(e);
366
+ return (s, o) => !ve(s[t] ?? null, o.anchorValue) || !(n === null || o.crossValue === void 0 || ve(n(s), o.crossValue)) ? !1 : !r || o.groupValue === void 0 ? !0 : ve(Ke(s), o.groupValue);
367
367
  }, Qo = (e) => {
368
- const t = S(e.mapping.y), n = Hn(e);
368
+ const t = S(e.mapping.y), n = Xn(e);
369
369
  return (r, s) => t !== null && s === t ? n(r) : r[s] ?? null;
370
370
  }, ea = (e) => (t) => {
371
371
  if (t === S(e.mapping.y)) return Lo(e);
@@ -399,13 +399,13 @@ function It(e, t) {
399
399
  createValueReader: (r) => (s) => n(s, r)
400
400
  };
401
401
  }
402
- function Pm(e, t) {
402
+ function $m(e, t) {
403
403
  return {
404
404
  ...Et(e.data, t),
405
405
  createValueReader: ea(e)
406
406
  };
407
407
  }
408
- function $m(e, t) {
408
+ function Fm(e, t) {
409
409
  return {
410
410
  ...Et(e, t),
411
411
  createValueReader: (n) => {
@@ -467,10 +467,10 @@ function ra(e, t, n) {
467
467
  }
468
468
  function sa(e, t) {
469
469
  if (!t.hasVariable(e.variable)) return G;
470
- const n = t.createValueReader(e.variable), r = ve(t.getValueFormat(e.variable)), s = (o) => ye(o, r, t.parsingLocale);
470
+ const n = t.createValueReader(e.variable), r = Se(t.getValueFormat(e.variable)), s = (o) => be(o, r, t.parsingLocale);
471
471
  if ("eq" in e) {
472
472
  const o = s(e.eq);
473
- return (a) => be(n(a), o);
473
+ return (a) => ve(n(a), o);
474
474
  }
475
475
  if ("oneOf" in e) {
476
476
  const o = e.oneOf.map(s);
@@ -484,7 +484,7 @@ function sa(e, t) {
484
484
  }
485
485
  return (a) => {
486
486
  const i = n(a);
487
- for (const c of o) if (be(i, c)) return !0;
487
+ for (const c of o) if (ve(i, c)) return !0;
488
488
  return !1;
489
489
  };
490
490
  }
@@ -532,9 +532,9 @@ function se(e, t) {
532
532
  return Y(e) && Y(t) ? e < t ? "less" : e > t ? "greater" : "equal" : "incomparable";
533
533
  }
534
534
  var aa = (e, t) => {
535
- const n = ur(e, t.predicate);
535
+ const n = dr(e, t.predicate);
536
536
  if (n === null) return null;
537
- const { box: r, observations: s } = n, o = lr(t.padding) === null ? la(r, t.padding) : r;
537
+ const { box: r, observations: s } = n, o = ur(t.padding) === null ? la(r, t.padding) : r;
538
538
  return {
539
539
  x: o.xMin,
540
540
  y: o.yMin,
@@ -548,11 +548,11 @@ var aa = (e, t) => {
548
548
  }
549
549
  };
550
550
  }, ia = (e, t) => {
551
- const n = ur(e, t.predicate);
551
+ const n = dr(e, t.predicate);
552
552
  if (n === null) return null;
553
553
  const { box: r, observations: s } = n;
554
554
  return {
555
- ..._n(r, t.align),
555
+ ...Dn(r, t.align),
556
556
  space: r.space,
557
557
  defer: {
558
558
  type: "observationBox",
@@ -560,11 +560,11 @@ var aa = (e, t) => {
560
560
  align: t.align
561
561
  }
562
562
  };
563
- }, lr = (e) => e === void 0 || typeof e == "number" || e.unit !== "px" ? null : {
563
+ }, ur = (e) => e === void 0 || typeof e == "number" || e.unit !== "px" ? null : {
564
564
  type: "pxOffset",
565
565
  x: e.x ?? 0,
566
566
  y: e.y ?? 0
567
- }, ur = ({ warnings: e, layers: t, coordSystem: n, selectionBoxCache: r, parsingLocale: s }, o) => {
567
+ }, dr = ({ warnings: e, layers: t, coordSystem: n, selectionBoxCache: r, parsingLocale: s }, o) => {
568
568
  if (r.has(o)) return r.get(o) ?? null;
569
569
  let a = null;
570
570
  const i = [];
@@ -583,7 +583,7 @@ var aa = (e, t) => {
583
583
  let f = -1;
584
584
  for (const y of d.data) {
585
585
  if (f += 1, !p(y)) continue;
586
- const b = no(y, n);
586
+ const b = Ss(y, n);
587
587
  b !== null && (a = a === null ? b : ca(a, b), i.push({
588
588
  layerId: d.id,
589
589
  observationIndex: f
@@ -624,7 +624,7 @@ var aa = (e, t) => {
624
624
  offset: t.offset
625
625
  }
626
626
  } : fa(r, t.offset, e.coordSystem);
627
- }, dr = (e, t) => t.anchorType === "selection" ? aa(e, t) : t.anchorType === "annotation" ? {
627
+ }, mr = (e, t) => t.anchorType === "selection" ? aa(e, t) : t.anchorType === "annotation" ? {
628
628
  x: 0,
629
629
  y: 0,
630
630
  width: 0,
@@ -639,7 +639,7 @@ var aa = (e, t) => {
639
639
  y: 1 - t.y - t.height,
640
640
  width: t.width,
641
641
  height: t.height
642
- }, mr = (e, t, n) => $e(e, t, n)?.point ?? null, $e = ({ container: e, layers: t, coordSystem: n, parsingLocale: r }, s, o) => {
642
+ }, pr = (e, t, n) => $e(e, t, n)?.point ?? null, $e = ({ container: e, layers: t, coordSystem: n, parsingLocale: r }, s, o) => {
643
643
  for (const a of t) {
644
644
  const i = e.geomRegistry.get(a.geom), { resolveAnchorPosition: c } = i;
645
645
  if (c === void 0 || s.layerId !== void 0 && a.id !== s.layerId || s.layerId === void 0 && !a.interactive) continue;
@@ -682,7 +682,7 @@ var aa = (e, t) => {
682
682
  const c = Jt(t.x, "x", n, o), l = Jt(t.y, "y", n, o);
683
683
  if (c === null || l === null) return null;
684
684
  const u = ma(e, a, c), d = i.map(l);
685
- if (!Hs(u, d)) return null;
685
+ if (!Gs(u, d)) return null;
686
686
  const m = Xt(u, a, ga(e)), p = Xt(d, i), f = Wt(r.mainAxis, {
687
687
  main: m.min,
688
688
  cross: p.min
@@ -690,7 +690,7 @@ var aa = (e, t) => {
690
690
  main: m.max,
691
691
  cross: p.max
692
692
  });
693
- return _n({
693
+ return Dn({
694
694
  xMin: f.x,
695
695
  xMax: y.x,
696
696
  yMin: f.y,
@@ -751,7 +751,7 @@ var aa = (e, t) => {
751
751
  }
752
752
  }, fa = (e, t, n) => {
753
753
  if (t === void 0 || n.type === "polar") return e;
754
- const r = lr(t);
754
+ const r = ur(t);
755
755
  return r !== null ? {
756
756
  ...e,
757
757
  defer: r
@@ -787,8 +787,8 @@ var aa = (e, t) => {
787
787
  }), Jt = (e, t, n, r) => {
788
788
  for (const s of n) {
789
789
  const o = S(s.mapping[t]);
790
- if (!(o === null || o === Te.x))
791
- return ye(e, ve(s.data.getValueFormat(o)), r);
790
+ if (!(o === null || o === Ae.x))
791
+ return be(e, Se(s.data.getValueFormat(o)), r);
792
792
  }
793
793
  return e;
794
794
  }, ya = class extends te {
@@ -885,7 +885,7 @@ var aa = (e, t) => {
885
885
  }, Ta = (e, t) => {
886
886
  const n = [];
887
887
  for (const r of t) {
888
- const s = dr(e, r.region);
888
+ const s = mr(e, r.region);
889
889
  if (s === null) {
890
890
  B(e.warnings, "shape", r.id, "has a region anchor that resolves to nothing");
891
891
  continue;
@@ -901,7 +901,7 @@ var aa = (e, t) => {
901
901
  }, Aa = (e, t) => {
902
902
  const n = [];
903
903
  for (const r of t) {
904
- const s = dr(e, r.region);
904
+ const s = mr(e, r.region);
905
905
  if (s === null) {
906
906
  B(e.warnings, "image", r.id, "has a region anchor that resolves to nothing");
907
907
  continue;
@@ -920,7 +920,7 @@ var aa = (e, t) => {
920
920
  for (const r of t) {
921
921
  const s = Pe(e, r.start, "pin"), o = Pe(e, r.end, "pin");
922
922
  if (s === null || o === null) {
923
- B(e.warnings, "arrow", r.id, `has ${pr(s, o)} resolving to nothing`);
923
+ B(e.warnings, "arrow", r.id, `has ${fr(s, o)} resolving to nothing`);
924
924
  continue;
925
925
  }
926
926
  n.push({
@@ -967,7 +967,7 @@ var aa = (e, t) => {
967
967
  }, Ia = (e, t) => {
968
968
  const n = [];
969
969
  for (const r of t) {
970
- const s = mr(e, r.at, "pin");
970
+ const s = pr(e, r.at, "pin");
971
971
  if (s === null) {
972
972
  B(e.warnings, "pinnedNumber", r.id, "matches no observation");
973
973
  continue;
@@ -981,7 +981,7 @@ var aa = (e, t) => {
981
981
  }, Ea = (e, t) => {
982
982
  const n = [];
983
983
  for (const r of t) {
984
- const s = mr(e, r.at, "pin");
984
+ const s = pr(e, r.at, "pin");
985
985
  if (s === null) {
986
986
  B(e.warnings, "comment", r.id, "matches no observation");
987
987
  continue;
@@ -1002,7 +1002,7 @@ var aa = (e, t) => {
1002
1002
  for (const r of t) {
1003
1003
  const s = $e(e, r.start, "value"), o = $e(e, r.end, "value");
1004
1004
  if (s === null || o === null) {
1005
- B(e.warnings, "differenceArrow", r.id, `has ${pr(s, o)} matching no observation`);
1005
+ B(e.warnings, "differenceArrow", r.id, `has ${fr(s, o)} matching no observation`);
1006
1006
  continue;
1007
1007
  }
1008
1008
  if (s.layerId === o.layerId && s.point.observationIndex === o.point.observationIndex) {
@@ -1018,7 +1018,7 @@ var aa = (e, t) => {
1018
1018
  });
1019
1019
  }
1020
1020
  return n;
1021
- }, pr = (e, t) => e === null && t === null ? "start and end anchors" : e === null ? "a start anchor" : "an end anchor", Ma = (e, t, n, r) => {
1021
+ }, fr = (e, t) => e === null && t === null ? "start and end anchors" : e === null ? "a start anchor" : "an end anchor", Ma = (e, t, n, r) => {
1022
1022
  Ro(n, r) || e.warnings.push({
1023
1023
  code: "INCOMPARABLE_ARROW_ENDPOINTS",
1024
1024
  message: `Difference arrow "${t.id}" measures between endpoints on different bases, so its label reports a quantity that does not exist.`,
@@ -1030,19 +1030,19 @@ var aa = (e, t) => {
1030
1030
  suggestion: "Point both ends at observations sharing one y scale and one unit, or label the arrow as a proportion."
1031
1031
  });
1032
1032
  };
1033
- function Fm(e, t = "kind") {
1033
+ function Bm(e, t = "kind") {
1034
1034
  const n = /* @__PURE__ */ new Map();
1035
1035
  n.set(t, []);
1036
1036
  for (const s of e) for (const o of s.observations) for (const a of Object.keys(o)) n.has(a) || n.set(a, []);
1037
1037
  for (const s of e) for (const o of s.observations) for (const [a, i] of n) i.push(a === t ? s.kind : o[a] ?? null);
1038
1038
  const r = {};
1039
1039
  for (const [s, o] of n) r[s] = {
1040
- type: fr(o),
1040
+ type: gr(o),
1041
1041
  values: o
1042
1042
  };
1043
- return new bt(r);
1043
+ return new vt(r);
1044
1044
  }
1045
- function fr(e) {
1045
+ function gr(e) {
1046
1046
  const t = Array.isArray(e) ? e : [e];
1047
1047
  for (const n of t)
1048
1048
  if (n !== null)
@@ -1055,16 +1055,16 @@ var La = class extends te {
1055
1055
  }
1056
1056
  run(e) {
1057
1057
  let t = e.data, n = e.mapping;
1058
- n.x === "" && (t = t.addConstantVariable(Te.x, "categorical", ""), n = {
1058
+ n.x === "" && (t = t.addConstantVariable(Ae.x, "categorical", ""), n = {
1059
1059
  ...n,
1060
- x: Te.x
1060
+ x: Ae.x
1061
1061
  });
1062
1062
  for (const r of Object.keys(n)) {
1063
- if (vt(r)) continue;
1064
- const s = fe(n[r]);
1063
+ if (yt(r)) continue;
1064
+ const s = ge(n[r]);
1065
1065
  if (s === void 0) continue;
1066
- const o = Ve(`const_${r}`);
1067
- t = t.addConstantVariable(o, fr(s), s), n = {
1066
+ const o = Ie(`const_${r}`);
1067
+ t = t.addConstantVariable(o, gr(s), s), n = {
1068
1068
  ...n,
1069
1069
  [r]: o
1070
1070
  };
@@ -1076,10 +1076,10 @@ var La = class extends te {
1076
1076
  }
1077
1077
  }, ne = class {
1078
1078
  constructor() {
1079
- this.perLayerMemo = Bn(), this.listMemo = Yn();
1079
+ this.perLayerMemo = _n(), this.listMemo = Vn();
1080
1080
  }
1081
1081
  get stats() {
1082
- return Un(this.perLayerMemo.stats, this.listMemo.stats);
1082
+ return Mn(this.perLayerMemo.stats, this.listMemo.stats);
1083
1083
  }
1084
1084
  compile(e) {
1085
1085
  const t = this.dependencies(e), n = e.layers.map((r) => this.perLayerMemo(r, t, () => this.compileLayer(r, e)));
@@ -1190,7 +1190,7 @@ var La = class extends te {
1190
1190
  [h.xMin, h.yMin],
1191
1191
  [h.xMax, h.yMax],
1192
1192
  [h.xBand, h.yBand]
1193
- ], Zt = Ve("flipSwap"), Pa = (e, t) => $a(t) ? e.map((n) => n.scaledAesthetic !== "x" || n.scaleType !== "continuous" && n.scaleType !== "datetime" && n.scaleType !== "discrete" ? n : {
1193
+ ], Zt = Ie("flipSwap"), Pa = (e, t) => $a(t) ? e.map((n) => n.scaledAesthetic !== "x" || n.scaleType !== "continuous" && n.scaleType !== "datetime" && n.scaleType !== "discrete" ? n : {
1194
1194
  ...n,
1195
1195
  reverse: !n.reverse
1196
1196
  }) : e, $a = (e) => {
@@ -1220,7 +1220,7 @@ function Ba(e) {
1220
1220
  }
1221
1221
  return n;
1222
1222
  }
1223
- var gr = (e, t) => Ba(t.domain !== null && t.domain.length > 0 ? t.domain : e), hr = (e, t) => e.scaledAesthetic === "x" && t.some((n) => S(n.mapping.x) === Te.x) && t.every((n) => $n(n.mapping) === "") ? {
1223
+ var hr = (e, t) => Ba(t.domain !== null && t.domain.length > 0 ? t.domain : e), yr = (e, t) => e.scaledAesthetic === "x" && t.some((n) => S(n.mapping.x) === Ae.x) && t.every((n) => zn(n.mapping) === "") ? {
1224
1224
  ...e,
1225
1225
  domain: null
1226
1226
  } : e, Ua = (e) => {
@@ -1282,9 +1282,9 @@ var gr = (e, t) => Ba(t.domain !== null && t.domain.length > 0 ? t.domain : e),
1282
1282
  [h.xMin, h.yMin],
1283
1283
  [h.xMax, h.yMax],
1284
1284
  [h.xBand, h.yBand]
1285
- ], Qt = Ve("polarSwap");
1285
+ ], Qt = Ie("polarSwap");
1286
1286
  function za(e, t) {
1287
- return (n) => Os(n, e, t);
1287
+ return (n) => Ys(n, e, t);
1288
1288
  }
1289
1289
  function Ka(e, t, n) {
1290
1290
  return e.theta !== "x" ? t : t.map((r) => {
@@ -1319,7 +1319,7 @@ function Ha(e, t, n) {
1319
1319
  if (!(o === null || !s.data.hasVariable(o)))
1320
1320
  for (const a of s.data.getValues(o)) r.push(a);
1321
1321
  }
1322
- return gr(r, hr(e, n)).length;
1322
+ return hr(r, yr(e, n)).length;
1323
1323
  }
1324
1324
  function Xa(e, t, n) {
1325
1325
  if (e.theta === "x") return "x";
@@ -1353,7 +1353,7 @@ function Qa(e) {
1353
1353
  data: t
1354
1354
  };
1355
1355
  }
1356
- var ei = class extends Ge {
1356
+ var ei = class extends Ye {
1357
1357
  constructor() {
1358
1358
  super("coord"), this.register("cartesian", new Da()), this.register("flip", new _a()), this.register("polar", new Ya());
1359
1359
  }
@@ -1368,16 +1368,16 @@ var ei = class extends Ge {
1368
1368
  };
1369
1369
  return {
1370
1370
  ...r,
1371
- data: js(r.data, n.positionRoles, s)
1371
+ data: ro(r.data, n.positionRoles, s)
1372
1372
  };
1373
1373
  }
1374
1374
  }, ni = class {
1375
1375
  compute({ data: e, mapping: t }) {
1376
- const n = me(e, t);
1377
- if (n.length === 0) return { data: e.addConstantVariable(_.group, "categorical", null) };
1376
+ const n = fe(e, t);
1377
+ if (n.length === 0) return { data: e.addConstantVariable(D.group, "categorical", null) };
1378
1378
  const r = e.size(), s = n.map((a) => e.getValues(a)), o = new Array(r);
1379
1379
  for (let a = 0; a < r; a++) o[a] = C(s.map((i) => i[a]));
1380
- return { data: e.addVariable(_.group, "categorical", o) };
1380
+ return { data: e.addVariable(D.group, "categorical", o) };
1381
1381
  }
1382
1382
  }, ri = (e) => {
1383
1383
  if (e === void 0) return {};
@@ -1389,12 +1389,12 @@ var ei = class extends Ge {
1389
1389
  return r === null ? {} : (e?.columns ?? []).some((s) => s.key === r) ? {} : n;
1390
1390
  };
1391
1391
  function ee(e, t) {
1392
- const n = D(t);
1392
+ const n = _(t);
1393
1393
  let r = null;
1394
- for (const s of vr(t, e)) {
1394
+ for (const s of br(t, e)) {
1395
1395
  const o = S(s.mapping[n]);
1396
1396
  if (g(o)) {
1397
- if (Ye(o)) {
1397
+ if (Ge(o)) {
1398
1398
  r ??= o;
1399
1399
  continue;
1400
1400
  }
@@ -1403,7 +1403,7 @@ function ee(e, t) {
1403
1403
  }
1404
1404
  return r;
1405
1405
  }
1406
- var yr = (e, t) => e === null ? null : t[e] ?? e, oi = (e, t) => e === null ? null : t[String(e)] ?? null, j = ({ layers: e, scaleType: t, variableName: n }) => {
1406
+ var vr = (e, t) => e === null ? null : t[e] ?? e, oi = (e, t) => e === null ? null : t[String(e)] ?? null, j = ({ layers: e, scaleType: t, variableName: n }) => {
1407
1407
  if (n === null) return Qe(t);
1408
1408
  for (const r of e) {
1409
1409
  if (!r.data.hasVariable(n)) continue;
@@ -1411,8 +1411,8 @@ var yr = (e, t) => e === null ? null : t[e] ?? e, oi = (e, t) => e === null ? nu
1411
1411
  return ii(o, t) ? o : Qe(t);
1412
1412
  }
1413
1413
  return Qe(t);
1414
- }, ai = (e, t) => t !== "y" && t !== "ySecondary" ? !1 : vr(t, e).some((n) => n.position === "fill");
1415
- function vr(e, t) {
1414
+ }, ai = (e, t) => t !== "y" && t !== "ySecondary" ? !1 : br(t, e).some((n) => n.position === "fill");
1415
+ function br(e, t) {
1416
1416
  return e === "ySecondary" ? t.filter((n) => n.yScaleType === "secondary") : e === "y" ? t.filter((n) => n.yScaleType === "primary") : t;
1417
1417
  }
1418
1418
  var Qe = (e) => {
@@ -1430,7 +1430,7 @@ var Qe = (e) => {
1430
1430
  case "continuous":
1431
1431
  return zs(e);
1432
1432
  case "datetime":
1433
- return Cs(e);
1433
+ return Us(e);
1434
1434
  case "discrete":
1435
1435
  case "identity":
1436
1436
  return !0;
@@ -1539,7 +1539,7 @@ var Qe = (e) => {
1539
1539
  return s / (365 * t) > oe;
1540
1540
  }
1541
1541
  }, di = (e, t) => {
1542
- const n = !En(t);
1542
+ const n = !Gn(t);
1543
1543
  switch (e.unit) {
1544
1544
  case "year":
1545
1545
  return n ? { type: "year" } : { type: "month" };
@@ -1592,7 +1592,7 @@ var Qe = (e) => {
1592
1592
  default:
1593
1593
  return null;
1594
1594
  }
1595
- }, br = {
1595
+ }, Sr = {
1596
1596
  left: "right",
1597
1597
  right: "left",
1598
1598
  top: "bottom",
@@ -1604,10 +1604,10 @@ var Qe = (e) => {
1604
1604
  }, _e = 20, tn = /* @__PURE__ */ new Set(["top", "bottom"]), hi = { type: "percentage" };
1605
1605
  function yi(e, t) {
1606
1606
  const { scales: n, config: r, layers: s, coordSystem: o, variableLabels: a, geomRegistry: i } = e;
1607
- if (ar(s)) return [];
1607
+ if (ir(s)) return [];
1608
1608
  if (o.type === "polar" && o.bandAxis === null) return [];
1609
- const c = Si(i, s, o.type, r), l = new Set(t.map((m) => m.position)), u = Ai(Sr(r.axes.y.position, o.axisMapping.y.position), l), d = [];
1610
- for (const m of Ps) {
1609
+ const c = Si(i, s, o.type, r), l = new Set(t.map((m) => m.position)), u = Ai(Tr(r.axes.y.position, o.axisMapping.y.position), l), d = [];
1610
+ for (const m of Qs) {
1611
1611
  const p = n[m];
1612
1612
  if (!g(p) || p.kind !== "position") continue;
1613
1613
  const f = vi({
@@ -1683,7 +1683,7 @@ function Ti(e, t, n, r) {
1683
1683
  case "x":
1684
1684
  return {
1685
1685
  axisConfig: t.axes[e],
1686
- position: Sr(t.axes[e].position, n[e].position),
1686
+ position: Tr(t.axes[e].position, n[e].position),
1687
1687
  geometry: n.x.geometry
1688
1688
  };
1689
1689
  case "y":
@@ -1693,7 +1693,7 @@ function Ti(e, t, n, r) {
1693
1693
  geometry: n.y.geometry
1694
1694
  };
1695
1695
  case "ySecondary": {
1696
- const s = br[r], o = je({}, {
1696
+ const s = Sr[r], o = je({}, {
1697
1697
  visible: t.axes.y.visible,
1698
1698
  label: null,
1699
1699
  position: s,
@@ -1708,11 +1708,11 @@ function Ti(e, t, n, r) {
1708
1708
  }
1709
1709
  }
1710
1710
  }
1711
- function Sr(e, t) {
1711
+ function Tr(e, t) {
1712
1712
  return tn.has(e) === tn.has(t) ? e : t;
1713
1713
  }
1714
1714
  function Ai(e, t) {
1715
- return t.has(e) ? br[e] : e;
1715
+ return t.has(e) ? Sr[e] : e;
1716
1716
  }
1717
1717
  function xi(e, t, n) {
1718
1718
  const { showGrid: r } = n === "x" ? t.x : t.y;
@@ -1730,7 +1730,7 @@ var wi = (e, t, n) => e !== "x" ? [] : t.filter((r) => J(n.get(r.geom))), Ci = (
1730
1730
  return s.length > 0 ? j({
1731
1731
  layers: s,
1732
1732
  scaleType: i,
1733
- variableName: sr(o).start
1733
+ variableName: or(o).start
1734
1734
  }) : ai(r, n) ? hi : j({
1735
1735
  layers: r,
1736
1736
  scaleType: i,
@@ -1747,7 +1747,7 @@ var wi = (e, t, n) => e !== "x" ? [] : t.filter((r) => J(n.get(r.geom))), Ci = (
1747
1747
  }
1748
1748
  return Ni(t, s, a);
1749
1749
  }, Vi = (e, t) => {
1750
- const n = or(e, t)?.filter(ki);
1750
+ const n = ar(e, t)?.filter(ki);
1751
1751
  if (n === void 0) return [];
1752
1752
  const r = new Map([...n].sort((s, o) => o.end - o.start - (s.end - s.start)).map((s, o) => [s, o]));
1753
1753
  return Ri(n.length).map((s) => ({
@@ -1779,27 +1779,27 @@ var wi = (e, t, n) => e !== "x" ? [] : t.filter((r) => J(n.get(r.geom))), Ci = (
1779
1779
  for (let a = 1; a <= _e; a++) {
1780
1780
  const i = e.generateTicks({ count: a }), c = C(i);
1781
1781
  s.has(c) || (s.add(c), o.push({
1782
- ticks: i.map((l) => de(e, l)),
1782
+ ticks: i.map((l) => me(e, l)),
1783
1783
  source: "generated"
1784
1784
  }));
1785
1785
  }
1786
1786
  return o;
1787
1787
  }
1788
1788
  return e.spec.scaleType === "datetime" ? Di(e, t) : [{
1789
- ticks: e.generateTicks().map((s) => de(e, s)),
1789
+ ticks: e.generateTicks().map((s) => me(e, s)),
1790
1790
  source: "generated"
1791
1791
  }];
1792
1792
  }, Di = (e, t) => {
1793
1793
  const [n, r] = e.domain;
1794
1794
  if (!O(n) || !O(r)) return [{
1795
- ticks: e.generateTicks().map((i) => de(e, i)),
1795
+ ticks: e.generateTicks().map((i) => me(e, i)),
1796
1796
  source: "generated"
1797
1797
  }];
1798
1798
  const s = /* @__PURE__ */ new Set(), o = [], a = (i, c) => {
1799
1799
  if (i.length === 0) return;
1800
1800
  const l = C(i);
1801
1801
  s.has(l) || (s.add(l), o.push({
1802
- ticks: i.map((u) => de(e, u)),
1802
+ ticks: i.map((u) => me(e, u)),
1803
1803
  valueFormat: c,
1804
1804
  source: "generated"
1805
1805
  }));
@@ -1814,18 +1814,18 @@ var wi = (e, t, n) => e !== "x" ? [] : t.filter((r) => J(n.get(r.geom))), Ci = (
1814
1814
  }, _i = (e) => {
1815
1815
  const { domain: t } = e, n = t[0], r = t.at(-1);
1816
1816
  return !g(n) || !g(r) || C([n]) === C([r]) ? null : {
1817
- ticks: [de(e, n), de(e, r)],
1817
+ ticks: [me(e, n), me(e, r)],
1818
1818
  source: "generated"
1819
1819
  };
1820
- }, de = (e, t) => ({
1820
+ }, me = (e, t) => ({
1821
1821
  value: t,
1822
1822
  position: e.map(t)
1823
1823
  });
1824
- function Tr({ scale: e, aesthetics: t, layers: n }) {
1824
+ function Ar({ scale: e, aesthetics: t, layers: n }) {
1825
1825
  const r = Oi({
1826
1826
  layers: n,
1827
1827
  aesthetics: t
1828
- }), s = Ar({
1828
+ }), s = xr({
1829
1829
  layers: n,
1830
1830
  aesthetics: t
1831
1831
  });
@@ -1836,7 +1836,7 @@ function Tr({ scale: e, aesthetics: t, layers: n }) {
1836
1836
  }));
1837
1837
  }
1838
1838
  function Oi({ layers: e, aesthetics: t }) {
1839
- const n = Ar({
1839
+ const n = xr({
1840
1840
  layers: e,
1841
1841
  aesthetics: t
1842
1842
  }), r = e.find((o) => t.some((a) => g(o.mapping[a]))), s = r ? r.geom : "bar";
@@ -1845,7 +1845,7 @@ function Oi({ layers: e, aesthetics: t }) {
1845
1845
  return a ? a.layer.geom : s;
1846
1846
  };
1847
1847
  }
1848
- function Ar({ layers: e, aesthetics: t, layerFilter: n }) {
1848
+ function xr({ layers: e, aesthetics: t, layerFilter: n }) {
1849
1849
  const r = /* @__PURE__ */ new Map();
1850
1850
  for (const [s, o] of e.entries()) {
1851
1851
  if (n && !n(o)) continue;
@@ -1873,14 +1873,14 @@ function Pi({ scales: e, layers: t, valueLabels: n }) {
1873
1873
  if (r === void 0 || !Vt(r)) return [];
1874
1874
  if (!t.some((i) => g(i.mapping.color))) return [];
1875
1875
  const s = ee(t, "color");
1876
- if (xr({
1876
+ if (wr({
1877
1877
  colorVariableName: s,
1878
1878
  xVariableName: ee(t, "x"),
1879
1879
  mapsColorAcrossMultipleLayers: Fi(t) > 1,
1880
1880
  sharesColorVariable: $i(e, t, s)
1881
1881
  })) return [];
1882
1882
  const o = r.spec.scaleType, a = t.findIndex((i) => g(i.mapping.color));
1883
- return Tr({
1883
+ return Ar({
1884
1884
  scale: r,
1885
1885
  aesthetics: ["color"],
1886
1886
  layers: t
@@ -1900,10 +1900,10 @@ function Pi({ scales: e, layers: t, valueLabels: n }) {
1900
1900
  };
1901
1901
  });
1902
1902
  }
1903
- var xr = ({ colorVariableName: e, xVariableName: t, mapsColorAcrossMultipleLayers: n, sharesColorVariable: r }) => r ? !1 : e === null || Ye(e) ? !n : t !== null && e === t;
1903
+ var wr = ({ colorVariableName: e, xVariableName: t, mapsColorAcrossMultipleLayers: n, sharesColorVariable: r }) => r ? !1 : e === null || Ge(e) ? !n : t !== null && e === t;
1904
1904
  function $i(e, t, n) {
1905
1905
  if (n === null) return !1;
1906
- for (const r of Nn) {
1906
+ for (const r of On) {
1907
1907
  if (r === "color") continue;
1908
1908
  const s = e[r];
1909
1909
  if (!(s === void 0 || !Vt(s)) && ee(t, r) === n)
@@ -1912,17 +1912,17 @@ function $i(e, t, n) {
1912
1912
  return !1;
1913
1913
  }
1914
1914
  var Fi = (e) => e.filter((t) => g(t.mapping.color)).length;
1915
- function wr(e, t) {
1915
+ function Cr(e, t) {
1916
1916
  return e.get(t.geom).summaries.supportsPerGroupHeadline === !0;
1917
1917
  }
1918
1918
  function Bi(e, t, n, r) {
1919
- const s = n.findIndex((o) => wr(e, o));
1919
+ const s = n.findIndex((o) => Cr(e, o));
1920
1920
  return s === -1 ? [] : t.length < 2 ? [{
1921
1921
  value: null,
1922
1922
  swatch: null,
1923
1923
  layerIndex: s,
1924
1924
  groupLabelFormat: { type: "text" },
1925
- label: yr(S(n[s]?.mapping.y), r)
1925
+ label: vr(S(n[s]?.mapping.y), r)
1926
1926
  }] : t.map((o) => ({
1927
1927
  value: o.value,
1928
1928
  swatch: {
@@ -1991,7 +1991,7 @@ function zi(e, t) {
1991
1991
  }
1992
1992
  function Ki(e, t) {
1993
1993
  const { config: n, scales: r, layers: s, variableLabels: o, colorGroups: a, geomRegistry: i } = e;
1994
- if (!s.some((u) => wr(i, u))) return null;
1994
+ if (!s.some((u) => Cr(i, u))) return null;
1995
1995
  const c = Bi(i, a, s, o);
1996
1996
  if (c.length === 0) return null;
1997
1997
  const l = c.map((u) => qi({
@@ -2061,42 +2061,42 @@ function Ji(e, t) {
2061
2061
  return t === null || !["numeric", "temporal"].includes(e.getType(t)) ? e : e.orderBy(t);
2062
2062
  }
2063
2063
  var Zi = /* @__PURE__ */ new Set(["line", "area"]);
2064
- function Bm(e, ...t) {
2064
+ function Um(e, ...t) {
2065
2065
  return e ? t.includes(e.geom) : !1;
2066
2066
  }
2067
- function Um(e, t) {
2067
+ function Gm(e, t) {
2068
2068
  return e.find((n) => n.id === t);
2069
2069
  }
2070
- function Gm(e, ...t) {
2070
+ function Ym(e, ...t) {
2071
2071
  return e.find((n) => t.includes(n.geom));
2072
2072
  }
2073
- function Ym(e, ...t) {
2073
+ function jm(e, ...t) {
2074
2074
  return e.filter((n) => t.includes(n.geom));
2075
2075
  }
2076
2076
  function Fe(e, t) {
2077
- return e.interactive ? !1 : t.some((n) => n !== e && Pn(n.mapping, e.mapping));
2078
- }
2079
- function jm(e, t) {
2080
- return t.filter((n) => n !== e && !n.interactive && Pn(e.mapping, n.mapping));
2077
+ return e.interactive ? !1 : t.some((n) => n !== e && Fn(n.mapping, e.mapping));
2081
2078
  }
2082
2079
  function zm(e, t) {
2080
+ return t.filter((n) => n !== e && !n.interactive && Fn(e.mapping, n.mapping));
2081
+ }
2082
+ function Km(e, t) {
2083
2083
  return t.find((n) => n.interactive && Fe(e, [n])) ?? e;
2084
2084
  }
2085
- function Km(e) {
2085
+ function qm(e) {
2086
2086
  return Zi.has(e);
2087
2087
  }
2088
- function Cr(e) {
2088
+ function Ir(e) {
2089
2089
  const t = e.filter((n) => !Fe(n, e));
2090
2090
  return t.length > 0 ? t : [...e];
2091
2091
  }
2092
2092
  function Qi({ legendPosition: e, coordSystem: t, layers: n }) {
2093
2093
  if (e !== "right" || t.type !== "cartesian" || t.mainAxis !== "x") return !1;
2094
- const r = Cr(n);
2094
+ const r = Ir(n);
2095
2095
  return r.length === 1 && r[0]?.supportsDirectLabels === !0;
2096
2096
  }
2097
2097
  var ec = 3;
2098
2098
  function tc({ scales: e, config: t, layers: n, coordSystem: r, variableLabels: s, colorGroups: o, geomRegistry: a }) {
2099
- const i = Cr(n), c = yc(a, t.legend.position, i);
2099
+ const i = Ir(n), c = yc(a, t.legend.position, i);
2100
2100
  if (c === "none") return {
2101
2101
  drawn: [],
2102
2102
  position: "none"
@@ -2165,7 +2165,7 @@ function sc(e, t) {
2165
2165
  }
2166
2166
  function oc(e) {
2167
2167
  const { scales: t, layers: n } = e, r = [];
2168
- for (const s of Nn) {
2168
+ for (const s of On) {
2169
2169
  const o = t[s];
2170
2170
  if (o === void 0 || o.kind === "identity" || !ac(s, n)) continue;
2171
2171
  const a = ee(n, s), i = Ac(s, o);
@@ -2179,12 +2179,12 @@ function oc(e) {
2179
2179
  return r;
2180
2180
  }
2181
2181
  function ac(e, t) {
2182
- const n = D(e);
2182
+ const n = _(e);
2183
2183
  return t.some((r) => g(r.mapping[n]));
2184
2184
  }
2185
2185
  function ic(e, t, n) {
2186
2186
  const [r] = e;
2187
- return r.scaledAesthetic !== "color" ? !1 : xr({
2187
+ return r.scaledAesthetic !== "color" ? !1 : wr({
2188
2188
  colorVariableName: r.variableName,
2189
2189
  xVariableName: t,
2190
2190
  mapsColorAcrossMultipleLayers: cc(r.scaledAesthetic, n),
@@ -2192,7 +2192,7 @@ function ic(e, t, n) {
2192
2192
  });
2193
2193
  }
2194
2194
  function cc(e, t) {
2195
- const n = D(e);
2195
+ const n = _(e);
2196
2196
  return t.filter((r) => g(r.mapping[n])).length > 1;
2197
2197
  }
2198
2198
  function lc(e) {
@@ -2215,7 +2215,7 @@ function uc(e, t, n) {
2215
2215
  e[t] = n;
2216
2216
  }
2217
2217
  function dc({ group: e, variableLabels: t, layers: n, colorGroupsByValue: r }) {
2218
- const s = e[0], o = e.map((l) => D(l.scaledAesthetic)), a = Tr({
2218
+ const s = e[0], o = e.map((l) => _(l.scaledAesthetic)), a = Ar({
2219
2219
  scale: s.scale,
2220
2220
  aesthetics: o,
2221
2221
  layers: n
@@ -2226,7 +2226,7 @@ function dc({ group: e, variableLabels: t, layers: n, colorGroupsByValue: r }) {
2226
2226
  }), c = n.find((l) => o.some((u) => g(l.mapping[u])))?.id;
2227
2227
  return {
2228
2228
  aesthetics: e.map((l) => l.scaledAesthetic),
2229
- title: yr(s.variableName, t),
2229
+ title: vr(s.variableName, t),
2230
2230
  items: a.map((l) => mc(l, e, o, i, r, c))
2231
2231
  };
2232
2232
  }
@@ -2234,8 +2234,8 @@ function mc(e, t, n, r, s, o) {
2234
2234
  const a = {};
2235
2235
  for (const c of t) uc(a, c.scaledAesthetic, c.scale.map(e.value));
2236
2236
  if (a.lineType === void 0) {
2237
- const c = fe(e.owner?.layer.mapping.lineType);
2238
- Ks(c) && (a.lineType = c);
2237
+ const c = ge(e.owner?.layer.mapping.lineType);
2238
+ Xs(c) && (a.lineType = c);
2239
2239
  }
2240
2240
  const i = fc(e, t, n, r, s);
2241
2241
  return {
@@ -2286,7 +2286,7 @@ function vc(e, t, n, r, s) {
2286
2286
  let o = !1, a = !1, i = !1;
2287
2287
  for (const l of r) {
2288
2288
  const { sidePlacement: u } = e.get(l.geom).legend;
2289
- u === "whenCrowded" && (o = !0), u === "whenStackedVertical" && (a = !0, Ee(l.position) && (i = !0));
2289
+ u === "whenCrowded" && (o = !0), u === "whenStackedVertical" && (a = !0, Ve(l.position) && (i = !0));
2290
2290
  }
2291
2291
  const c = n >= ec;
2292
2292
  return o && a ? "top" : o ? c ? "right" : "top" : i ? Sc(s) ? "top" : c ? "right" : "top" : "top";
@@ -2311,12 +2311,12 @@ function Ac(e, t) {
2311
2311
  function xc(e) {
2312
2312
  if (!e) return /* @__PURE__ */ new Map();
2313
2313
  const t = /* @__PURE__ */ new Map();
2314
- return e.data.groupBy(_.group).forEach((n) => {
2315
- const r = n.findLast((c) => g(nt(c)) || g(st(c)));
2314
+ return e.data.groupBy(D.group).forEach((n) => {
2315
+ const r = n.findLast((c) => g(st(c)) || g(rt(c)));
2316
2316
  if (!r) return;
2317
2317
  const s = Ke(r);
2318
2318
  if (!g(s)) return;
2319
- const o = kn(r), a = nt(r) ?? st(r);
2319
+ const o = Kn(r), a = st(r) ?? rt(r);
2320
2320
  if (!g(a)) return;
2321
2321
  const i = g(o) ? (o + a) / 2 : a;
2322
2322
  t.set(String(s), i);
@@ -2367,19 +2367,19 @@ var wc = class extends te {
2367
2367
  case "group":
2368
2368
  return Ec(t);
2369
2369
  case "xValue":
2370
- return Ir(t, n);
2370
+ return Er(t, n);
2371
2371
  }
2372
2372
  }, Ic = (e) => {
2373
- const t = $n(e);
2373
+ const t = zn(e);
2374
2374
  return t === "" ? null : t;
2375
- }, Ec = (e) => C([Ke(e)]), Ir = (e, t) => C([t !== null ? e[t] ?? null : null]);
2375
+ }, Ec = (e) => C([Ke(e)]), Er = (e, t) => C([t !== null ? e[t] ?? null : null]);
2376
2376
  function Vc(e) {
2377
2377
  return e === null ? null : {
2378
2378
  strategy: e,
2379
- composition: Er()
2379
+ composition: Vr()
2380
2380
  };
2381
2381
  }
2382
- function Er() {
2382
+ function Vr() {
2383
2383
  return {
2384
2384
  dimmed: !1,
2385
2385
  matchedLayer: null,
@@ -2468,7 +2468,7 @@ function Lc({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings:
2468
2468
  }
2469
2469
  x++;
2470
2470
  }
2471
- if (v.size === 0 && T.size === 0 && !A) return Er();
2471
+ if (v.size === 0 && T.size === 0 && !A) return Vr();
2472
2472
  const I = new Uint8Array(m), R = [];
2473
2473
  let $ = 0;
2474
2474
  for (let w = 0; w < m; w++) {
@@ -2495,18 +2495,18 @@ function Lc({ layer: e, highlights: t, parsingLocale: n, strategy: r, warnings:
2495
2495
  overlayCandidates: R
2496
2496
  };
2497
2497
  }
2498
- var kc = Ve("__ungrouped__");
2498
+ var kc = Ie("__ungrouped__");
2499
2499
  function Rc(e) {
2500
- const t = e.getVariableNames().filter((s) => e.getType(s) === "temporal" && En(e.getValueFormat(s)));
2500
+ const t = e.getVariableNames().filter((s) => e.getType(s) === "temporal" && Gn(e.getValueFormat(s)));
2501
2501
  if (t.length === 0) return e;
2502
- const n = e.getValues(_.group, { type: "categorical" });
2502
+ const n = e.getValues(D.group, { type: "categorical" });
2503
2503
  let r = e;
2504
2504
  for (const s of t) {
2505
2505
  const o = r.getValues(s, { type: "temporal" }), a = /* @__PURE__ */ new Map(), i = o.map((c, l) => {
2506
2506
  if (c === null) return null;
2507
2507
  const u = n[l] ?? kc;
2508
2508
  let d = a.get(u);
2509
- return d || (d = new As(), a.set(u, d)), d.incrementYearIfNeeded(c);
2509
+ return d || (d = new vs(), a.set(u, d)), d.incrementYearIfNeeded(c);
2510
2510
  });
2511
2511
  r = r.addVariable(s, "temporal", i);
2512
2512
  }
@@ -2533,16 +2533,16 @@ var Dc = () => ({
2533
2533
  vocabulary: X.geom.vocabulary,
2534
2534
  aesthetics: X.geom.aesthetics
2535
2535
  },
2536
- dashPresets: Fn.line,
2536
+ dashPresets: Pn.line,
2537
2537
  parts: {}
2538
- }), Vr = "y", Mr = {
2538
+ }), Mr = "y", Lr = {
2539
2539
  kind: "group",
2540
- name: Vr
2540
+ name: Mr
2541
2541
  };
2542
2542
  function _c({ contract: e, entries: t, mapping: n, derivedVariables: r }) {
2543
- const s = e.map(kr), o = s.some((l) => !Be(l)), a = o ? s : [...s, Mr], i = [];
2543
+ const s = e.map(Rr), o = s.some((l) => !Be(l)), a = o ? s : [...s, Lr], i = [];
2544
2544
  for (const [l, u] of Object.entries(t)) {
2545
- const d = a.findIndex((p) => Lr(p, l)), m = d === -1 ? Pc(l, n, r) : a.splice(d, 1)[0];
2545
+ const d = a.findIndex((p) => kr(p, l)), m = d === -1 ? Pc(l, n, r) : a.splice(d, 1)[0];
2546
2546
  m === void 0 || u === !1 || i.push(u === !0 ? m : $c(m, u));
2547
2547
  }
2548
2548
  const c = [...i, ...a];
@@ -2552,7 +2552,7 @@ function _c({ contract: e, entries: t, mapping: n, derivedVariables: r }) {
2552
2552
  };
2553
2553
  }
2554
2554
  function Oc({ layerId: e, contract: t, entries: n, mapping: r, derivedVariables: s }) {
2555
- const o = t.map(kr), a = o.some((c) => !Be(c)) ? o : [...o, Mr], i = (c) => a.some((l) => Lr(l, c)) || r[c] !== void 0 || s.includes(c);
2555
+ const o = t.map(Rr), a = o.some((c) => !Be(c)) ? o : [...o, Lr], i = (c) => a.some((l) => kr(l, c)) || r[c] !== void 0 || s.includes(c);
2556
2556
  return Object.keys(n).filter((c) => !i(c)).map((c) => ({
2557
2557
  code: "UNKNOWN_TOOLTIP_FIELD",
2558
2558
  message: `Layer '${e}' has no tooltip field '${c}'; its tooltip entry is ignored.`,
@@ -2567,10 +2567,10 @@ function Oc({ layerId: e, contract: t, entries: n, mapping: r, derivedVariables:
2567
2567
  function Be(e) {
2568
2568
  return e.kind !== "group" && e.heading;
2569
2569
  }
2570
- function Lr(e, t) {
2570
+ function kr(e, t) {
2571
2571
  return e.name === t || e.kind === "aesthetic" && e.aesthetic === t;
2572
2572
  }
2573
- function kr(e) {
2573
+ function Rr(e) {
2574
2574
  return "range" in e ? {
2575
2575
  kind: "range",
2576
2576
  name: ct(e),
@@ -2607,7 +2607,7 @@ function $c(e, { title: t, format: n, heading: r }) {
2607
2607
  return e.kind === "group" ? r === !0 ? {
2608
2608
  kind: "aesthetic",
2609
2609
  name: e.name,
2610
- aesthetic: Vr,
2610
+ aesthetic: Mr,
2611
2611
  heading: !0,
2612
2612
  ...s
2613
2613
  } : {
@@ -2669,7 +2669,7 @@ var Uc = class extends ne {
2669
2669
  mapping: c,
2670
2670
  hasDiscreteXScale: r,
2671
2671
  params: { ...e.params },
2672
- requiredAesthetics: On(this.container.geomRegistry.get(e.geom))
2672
+ requiredAesthetics: Bn(this.container.geomRegistry.get(e.geom))
2673
2673
  });
2674
2674
  return {
2675
2675
  data: l.data,
@@ -2718,6 +2718,7 @@ var Uc = class extends ne {
2718
2718
  geom: e.geom,
2719
2719
  position: e.position,
2720
2720
  yScaleType: e.yScaleType,
2721
+ yZero: null,
2721
2722
  params: e.params,
2722
2723
  interactive: e.interactive,
2723
2724
  attachment: null,
@@ -2741,14 +2742,14 @@ var Uc = class extends ne {
2741
2742
  function an(e) {
2742
2743
  return e.scales.some((t) => t.scaledAesthetic === "x" && t.scaleType === "discrete");
2743
2744
  }
2744
- function Rr(e, t) {
2745
+ function Nr(e, t) {
2745
2746
  const [n] = t;
2746
2747
  if (n) {
2747
2748
  for (const r of t) e.addError(r);
2748
2749
  throw new E(n);
2749
2750
  }
2750
2751
  }
2751
- function Nr(e, t) {
2752
+ function Dr(e, t) {
2752
2753
  return t.map((n) => {
2753
2754
  const r = e.has(n.geom) ? e.get(n.geom) : void 0;
2754
2755
  return {
@@ -2759,10 +2760,10 @@ function Nr(e, t) {
2759
2760
  });
2760
2761
  }
2761
2762
  function Gc(e) {
2762
- return e.some((t) => Ee(t.position) || t.scaleConstraints?.bandPadding === 0);
2763
+ return e.some((t) => Ve(t.position) || t.scaleConstraints?.bandPadding === 0);
2763
2764
  }
2764
- function Dr(e) {
2765
- const t = _r(e), n = {};
2765
+ function _r(e) {
2766
+ const t = Or(e), n = {};
2766
2767
  for (const { layer: s, scaleConstraints: o, crossAxis: a } of t)
2767
2768
  o.includeZero === !0 && (n[a] = { nice: (n[a]?.nice ?? !0) && s.position !== "fill" });
2768
2769
  const r = t.find(({ scaleConstraints: s }) => s.requireCrossAxisBands === !0);
@@ -2777,7 +2778,7 @@ function Dr(e) {
2777
2778
  };
2778
2779
  }
2779
2780
  function Yc(e) {
2780
- const t = _r(e);
2781
+ const t = Or(e);
2781
2782
  return jc(t) ?? zc(e, t);
2782
2783
  }
2783
2784
  function jc(e) {
@@ -2812,7 +2813,7 @@ var ie = (e, t, n) => ({
2812
2813
  geom: e.geom,
2813
2814
  shape: n
2814
2815
  });
2815
- function _r(e) {
2816
+ function Or(e) {
2816
2817
  const t = [];
2817
2818
  return e.forEach((n, r) => {
2818
2819
  const { scaleConstraints: s, yScaleType: o } = n;
@@ -2820,7 +2821,7 @@ function _r(e) {
2820
2821
  layer: n,
2821
2822
  index: r,
2822
2823
  scaleConstraints: s,
2823
- crossAxis: Ae(o)
2824
+ crossAxis: de(o)
2824
2825
  });
2825
2826
  }), t;
2826
2827
  }
@@ -2846,7 +2847,7 @@ function Wc({ scaleConstraints: e, crossAxis: t }) {
2846
2847
  return e.requireCrossAxisBands !== !0 ? ["x"] : e.requireMainAxisBands === !0 ? ["x", t] : [t];
2847
2848
  }
2848
2849
  function Hc(e, t, n) {
2849
- const r = Or(e, t);
2850
+ const r = Pr(e, t);
2850
2851
  return t.map((s, o) => {
2851
2852
  const a = r[o], i = a === void 0 ? void 0 : t[a];
2852
2853
  if (i === void 0) return s;
@@ -2861,7 +2862,7 @@ function Hc(e, t, n) {
2861
2862
  });
2862
2863
  }
2863
2864
  function Xc(e, t) {
2864
- const n = Or(e, t);
2865
+ const n = Pr(e, t);
2865
2866
  return t.flatMap((r, s) => {
2866
2867
  const o = e[s]?.attachTo ?? "none";
2867
2868
  return o === "none" || o === "previous" ? [] : n[s] !== void 0 ? [] : [{
@@ -2875,7 +2876,7 @@ function Xc(e, t) {
2875
2876
  }];
2876
2877
  });
2877
2878
  }
2878
- function Or(e, t) {
2879
+ function Pr(e, t) {
2879
2880
  const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), s = (i) => t[i]?.interactive === !0 && !r.has(i) && a(i) === void 0, o = (i) => {
2880
2881
  const c = e[i]?.attachTo ?? "none";
2881
2882
  if (c === "none") return;
@@ -2901,13 +2902,13 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
2901
2902
  }, Zc = (e, t, n) => {
2902
2903
  if (n.some((s) => s.axis === "x" && s.role === "scalar" && s.aesthetic === "x")) return !1;
2903
2904
  const r = S(e.x);
2904
- return !g(r) || Ye(r) || !t.hasVariable(r) || t.size() === 0 ? !1 : t.getType(r) !== "numeric";
2905
+ return !g(r) || Ge(r) || !t.hasVariable(r) || t.size() === 0 ? !1 : t.getType(r) !== "numeric";
2905
2906
  }, Qc = ({ aesthetic: e, layers: t }) => e !== "x" ? "Drop one of the layers, or move one onto the secondary y axis with 'yScaleType'." : t.some((n) => n.shape === "discrete") ? "Drop one of the layers, or map the other layer's x to a numeric column." : "Drop one of the layers.", el = class {
2906
2907
  constructor(e, t, n, r) {
2907
- this.container = e, this.transformCompiler = t, this.statRegistry = n, this.layerCompiler = r, this.attachedLayerMemo = Bn(), this.resolvedLayersMemo = Yn();
2908
+ this.container = e, this.transformCompiler = t, this.statRegistry = n, this.layerCompiler = r, this.attachedLayerMemo = _n(), this.resolvedLayersMemo = Vn();
2908
2909
  }
2909
2910
  get stats() {
2910
- return Un(this.layerCompiler.stats, this.attachedLayerMemo.stats, this.resolvedLayersMemo.stats);
2911
+ return Mn(this.layerCompiler.stats, this.attachedLayerMemo.stats, this.resolvedLayersMemo.stats);
2911
2912
  }
2912
2913
  compile(e) {
2913
2914
  this.checkPreCompile(e);
@@ -2946,7 +2947,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
2946
2947
  ...this.collectDuplicateTooltipHeadings(i)
2947
2948
  ];
2948
2949
  for (const l of c) this.container.diagnostics.addWarning(l);
2949
- }), t.push(...this.validateSharedScaleDemands(e.layers, n)), Rr(this.container.diagnostics, t);
2950
+ }), t.push(...this.validateSharedScaleDemands(e.layers, n)), Nr(this.container.diagnostics, t);
2950
2951
  }
2951
2952
  checkPostCompile(e, t) {
2952
2953
  const n = [
@@ -2970,7 +2971,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
2970
2971
  const { justify: a, showDataLabels: i } = o;
2971
2972
  if (!i || a !== "panelStart" && a !== "panelEnd") return [];
2972
2973
  if (s === "polar" || !this.container.geomRegistry.get(e).composite) return [];
2973
- if (!_s(n, t)) return [];
2974
+ if (!Bs(n, t)) return [];
2974
2975
  const c = a === "panelEnd" ? "end" : "start";
2975
2976
  return [{
2976
2977
  code: "DATA_LABEL_PLACEMENT_COERCED",
@@ -2997,7 +2998,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
2997
2998
  }));
2998
2999
  }
2999
3000
  validateRequiredAesthetics({ layerId: e, layerIndex: t, geom: n, stat: r, params: s, effectiveMapping: o }) {
3000
- const a = [], i = On(this.container.geomRegistry.get(n)), c = this.resolveComputedAesthetics(r, s);
3001
+ const a = [], i = Bn(this.container.geomRegistry.get(n)), c = this.resolveComputedAesthetics(r, s);
3001
3002
  for (const l of i)
3002
3003
  c.has(l) || g(o[l]) || a.push({
3003
3004
  code: "MISSING_AESTHETIC",
@@ -3029,7 +3030,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3029
3030
  validatePositionalAestheticTypes({ layerId: e, layerIndex: t, geom: n, stat: r, params: s, effectiveMapping: o, data: a }) {
3030
3031
  const { positionRoles: i } = this.container.geomRegistry.get(n), c = this.resolveComputedAesthetics(r, s), l = [];
3031
3032
  for (const u of i) {
3032
- if (!qs.has(u.role) || !g(u.aesthetic) || c.has(u.aesthetic) || u.role === "scalar" && u.aesthetic === u.axis) continue;
3033
+ if (!Fs.has(u.role) || !g(u.aesthetic) || c.has(u.aesthetic) || u.role === "scalar" && u.aesthetic === u.axis) continue;
3033
3034
  const d = S(o[u.aesthetic]);
3034
3035
  if (d === null || !a.hasVariable(d) || a.size() === 0) continue;
3035
3036
  const m = a.getType(d);
@@ -3074,7 +3075,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3074
3075
  return this.statRegistry.get(e.type).resolveComputedAesthetics(e, t);
3075
3076
  }
3076
3077
  validateSharedScaleDemands(e, t) {
3077
- const n = Yc(Nr(this.container.geomRegistry, e).map((o, a) => ({
3078
+ const n = Yc(Dr(this.container.geomRegistry, e).map((o, a) => ({
3078
3079
  ...o,
3079
3080
  hasNonNumericX: !!t[a]
3080
3081
  })));
@@ -3110,7 +3111,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3110
3111
  }
3111
3112
  collectUndeclaredAesthetics({ layerId: e, layerIndex: t, geom: n, stat: r, params: s, effectiveMapping: o }) {
3112
3113
  const { positionRoles: a, categorySpanAxes: i, aesthetics: c } = this.container.geomRegistry.get(n), l = this.resolveComputedAesthetics(r, s), u = /* @__PURE__ */ new Set([
3113
- ...Fs(a),
3114
+ ...eo(a),
3114
3115
  ...i,
3115
3116
  ...c.map((p) => p.name)
3116
3117
  ]), d = Jc, m = [];
@@ -3126,7 +3127,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3126
3127
  return m;
3127
3128
  }
3128
3129
  collectEmptyDataset(e) {
3129
- return ar(e) ? [{
3130
+ return ir(e) ? [{
3130
3131
  code: "EMPTY_DATASET",
3131
3132
  message: "No data to plot — every layer resolved to zero observations.",
3132
3133
  suggestion: "Check the dataset has rows and that transforms (filters, joins) are not removing them all."
@@ -3164,7 +3165,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3164
3165
  context: { aesthetic: "y" },
3165
3166
  suggestion: "Remove the 'y' mapping; the 'count' stat computes it."
3166
3167
  });
3167
- const r = [.../* @__PURE__ */ new Set([n, ...me(e, t)])];
3168
+ const r = [.../* @__PURE__ */ new Set([n, ...fe(e, t)])];
3168
3169
  return {
3169
3170
  data: e.groupBy(...r).rollup({ [k.count]: {
3170
3171
  variableName: n,
@@ -3209,7 +3210,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3209
3210
  });
3210
3211
  }
3211
3212
  return {
3212
- data: e.size() === 0 ? new bt({ [k.mean]: {
3213
+ data: e.size() === 0 ? new vt({ [k.mean]: {
3213
3214
  type: "numeric",
3214
3215
  values: []
3215
3216
  } }) : e.rollup({ [k.mean]: {
@@ -3219,7 +3220,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3219
3220
  mapping: { y: k.mean }
3220
3221
  };
3221
3222
  }
3222
- }, sl = 2, Pr = 1440 * 60 * 1e3, ol = class extends pe {
3223
+ }, sl = 2, $r = 1440 * 60 * 1e3, ol = class extends pe {
3223
3224
  constructor(...e) {
3224
3225
  super(...e), this.type = "smooth", this.computedAesthetics = /* @__PURE__ */ new Set();
3225
3226
  }
@@ -3248,7 +3249,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3248
3249
  variableType: i
3249
3250
  }
3250
3251
  });
3251
- const c = me(e, t), l = ml(s, a, o, c, e);
3252
+ const c = fe(e, t), l = ml(s, a, o, c, e);
3252
3253
  return c.length === 0 ? ln({
3253
3254
  data: e,
3254
3255
  xVariable: s,
@@ -3331,10 +3332,10 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3331
3332
  case "temporal": {
3332
3333
  if (!O(e)) return null;
3333
3334
  const s = e.getTime();
3334
- return r === null ? s : (s - r) / Pr + 1;
3335
+ return r === null ? s : (s - r) / $r + 1;
3335
3336
  }
3336
3337
  case "categorical": {
3337
- if (!zn(e)) return null;
3338
+ if (!$n(e)) return null;
3338
3339
  const s = n.get(e);
3339
3340
  if (s !== void 0) return s;
3340
3341
  const o = n.size + 1;
@@ -3344,7 +3345,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3344
3345
  throw new M({ message: `Unexpected xType: ${t}` });
3345
3346
  }
3346
3347
  }, ll = ({ observations: e, xType: t, temporalOrigin: n, spec: r, output: s, groupObservation: o }) => {
3347
- const a = $r(r, e);
3348
+ const a = Fr(r, e);
3348
3349
  for (const [i, c] of a) {
3349
3350
  if (!Number.isFinite(i) || !Number.isFinite(c)) continue;
3350
3351
  const l = t === "temporal" ? ul(i, n) : i;
@@ -3354,12 +3355,12 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3354
3355
  groupObservation: o
3355
3356
  });
3356
3357
  }
3357
- }, ul = (e, t) => t === null ? new Date(e) : new Date((e - 1) * Pr + t), dl = ({ observations: e, spec: t, output: n, groupObservation: r }) => {
3358
+ }, ul = (e, t) => t === null ? new Date(e) : new Date((e - 1) * $r + t), dl = ({ observations: e, spec: t, output: n, groupObservation: r }) => {
3358
3359
  const s = /* @__PURE__ */ new Map();
3359
3360
  for (const i of e) s.has(i.x) || s.set(i.x, i.originalX);
3360
3361
  const o = [...s.keys()].sort((i, c) => i - c);
3361
3362
  if (t.method === "loess") {
3362
- const i = $r(t, e), c = /* @__PURE__ */ new Map();
3363
+ const i = Fr(t, e), c = /* @__PURE__ */ new Map();
3363
3364
  for (const [l, u] of i)
3364
3365
  Number.isFinite(u) && (c.has(l) || c.set(l, u));
3365
3366
  for (const l of o) {
@@ -3372,7 +3373,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3372
3373
  }
3373
3374
  return;
3374
3375
  }
3375
- const a = Fr(t, e);
3376
+ const a = Br(t, e);
3376
3377
  for (const i of o) {
3377
3378
  const c = s.get(i), l = a.predict(i);
3378
3379
  c === void 0 || !Number.isFinite(l) || n.push({
@@ -3381,7 +3382,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3381
3382
  groupObservation: r
3382
3383
  });
3383
3384
  }
3384
- }, $r = (e, t) => e.method === "loess" ? go().x((n) => n.x).y((n) => n.y).bandwidth(e.bandwidth)(t) : Fr(e, t), Fr = (e, t) => {
3385
+ }, Fr = (e, t) => e.method === "loess" ? go().x((n) => n.x).y((n) => n.y).bandwidth(e.bandwidth)(t) : Br(e, t), Br = (e, t) => {
3385
3386
  const n = (s) => s.x, r = (s) => s.y;
3386
3387
  switch (e.method) {
3387
3388
  case "linear":
@@ -3424,7 +3425,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3424
3425
  values: i[l] ?? [],
3425
3426
  valueFormat: s.getValueFormat(l)
3426
3427
  };
3427
- return new bt(c);
3428
+ return new vt(c);
3428
3429
  }
3429
3430
  };
3430
3431
  }, pl = (e, t) => {
@@ -3456,7 +3457,7 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3456
3457
  suggestion: "Map a numeric variable to 'y' when using the 'sum' stat."
3457
3458
  });
3458
3459
  }
3459
- const r = S(t.x), s = [.../* @__PURE__ */ new Set([...r === null ? [] : [r], ...me(e, t)])];
3460
+ const r = S(t.x), s = [.../* @__PURE__ */ new Set([...r === null ? [] : [r], ...fe(e, t)])];
3460
3461
  return {
3461
3462
  data: e.groupBy(...s).rollup({ [k.sum]: {
3462
3463
  variableName: n,
@@ -3476,9 +3477,9 @@ var Jc = /* @__PURE__ */ new Set(["label", "group"]), cn = {
3476
3477
  9984369578019572e-21,
3477
3478
  15056327351493116e-23
3478
3479
  ], hl = 300, yl = 1e-14, F = 1e-300, vl = 200;
3479
- function Br(e, t) {
3480
+ function Ur(e, t) {
3480
3481
  if (e === 0.5) return 0;
3481
- if (e < 0.5) return -Br(1 - e, t);
3482
+ if (e < 0.5) return -Ur(1 - e, t);
3482
3483
  let n = 0, r = 1;
3483
3484
  for (; dn(r, t) < e; )
3484
3485
  n = r, r *= 2;
@@ -3535,7 +3536,7 @@ var Sl = /* @__PURE__ */ new Set(["mean", "median"]), Tl = /* @__PURE__ */ new S
3535
3536
  "y",
3536
3537
  "lower",
3537
3538
  "upper"
3538
- ]), Ur = {
3539
+ ]), Gr = {
3539
3540
  lower: null,
3540
3541
  upper: null
3541
3542
  }, Cl = class extends pe {
@@ -3568,10 +3569,10 @@ var Sl = /* @__PURE__ */ new Set(["mean", "median"]), Tl = /* @__PURE__ */ new S
3568
3569
  suggestion: "Map a numeric variable to 'y' when using the 'summary' stat."
3569
3570
  });
3570
3571
  }
3571
- const s = S(t.x), o = [.../* @__PURE__ */ new Set([...s === null ? [] : [s], ...me(e, t)])], a = e.groupBy(...o), i = kl(n.level), c = [], l = [];
3572
+ const s = S(t.x), o = [.../* @__PURE__ */ new Set([...s === null ? [] : [s], ...fe(e, t)])], a = e.groupBy(...o), i = kl(n.level), c = [], l = [];
3572
3573
  a.forEach((p) => {
3573
3574
  const f = El(p, r);
3574
- c.push(Vl(f, n.estimate)), l.push(n.interval === void 0 ? Ur : Ml(f, n, n.interval, i));
3575
+ c.push(Vl(f, n.estimate)), l.push(n.interval === void 0 ? Gr : Ml(f, n, n.interval, i));
3575
3576
  });
3576
3577
  const u = e.getValueFormat(r), d = a.rollup({}).addVariable(k.summaryEstimate, "numeric", c, u);
3577
3578
  if (n.interval === void 0) return {
@@ -3633,16 +3634,16 @@ function El(e, t) {
3633
3634
  return e.getValues(t).filter((n) => Y(n) && Number.isFinite(n));
3634
3635
  }
3635
3636
  function Vl(e, t) {
3636
- return e.length === 0 ? null : t === "mean" ? Gr(e) : lt([...e].sort((n, r) => n - r), 0.5);
3637
+ return e.length === 0 ? null : t === "mean" ? Yr(e) : lt([...e].sort((n, r) => n - r), 0.5);
3637
3638
  }
3638
3639
  function Ml(e, t, n, r) {
3639
3640
  const s = e.length, o = Nl(e);
3640
- if (s < 2 || o.lower === o.upper) return Ur;
3641
+ if (s < 2 || o.lower === o.upper) return Gr;
3641
3642
  switch (n) {
3642
3643
  case "stderr":
3643
3644
  case "stdev":
3644
3645
  case "ci": {
3645
- const a = Gr(e), i = Ll(n, Rl(e, a), s, t.mult, r);
3646
+ const a = Yr(e), i = Ll(n, Rl(e, a), s, t.mult, r);
3646
3647
  return {
3647
3648
  lower: a - i,
3648
3649
  upper: a + i
@@ -3670,11 +3671,11 @@ function kl(e) {
3670
3671
  return (n) => {
3671
3672
  const r = t.get(n);
3672
3673
  if (r !== void 0) return r;
3673
- const s = Br(1 - (1 - e) / 2, n);
3674
+ const s = Ur(1 - (1 - e) / 2, n);
3674
3675
  return t.set(n, s), s;
3675
3676
  };
3676
3677
  }
3677
- function Gr(e) {
3678
+ function Yr(e) {
3678
3679
  let t = 0;
3679
3680
  for (const n of e) t += n;
3680
3681
  return t / e.length;
@@ -3704,14 +3705,14 @@ var Dl = [
3704
3705
  new rl(),
3705
3706
  new fl(),
3706
3707
  new Cl()
3707
- ], Yr = class extends Ge {
3708
+ ], jr = class extends Ye {
3708
3709
  constructor() {
3709
3710
  super("stat");
3710
3711
  for (const e of Dl) this.register(e.type, e);
3711
3712
  }
3712
3713
  };
3713
3714
  function _l({ geoms: e, stats: t, transforms: n }) {
3714
- const r = new St(), s = new Yr(), o = new Vn();
3715
+ const r = new St(), s = new jr(), o = new kn();
3715
3716
  for (const a of e) r.register(a.type, a);
3716
3717
  for (const a of t) s.register(a.type, a);
3717
3718
  for (const a of n) o.register(a.transformType, a);
@@ -3738,7 +3739,7 @@ var Ol = class {
3738
3739
  data: e,
3739
3740
  mapping: {}
3740
3741
  };
3741
- const n = e.getValues(_.group, {
3742
+ const n = e.getValues(D.group, {
3742
3743
  type: "categorical",
3743
3744
  distinct: !0,
3744
3745
  skipNulls: !0
@@ -3747,7 +3748,7 @@ var Ol = class {
3747
3748
  data: e,
3748
3749
  mapping: {}
3749
3750
  };
3750
- const r = e.size(), s = e.getValues(_.group, { type: "categorical" }), o = $l(e) ?? [-0.7 / 2, 0.7 / 2], a = n.length > 1 ? Bs : 0, i = qn().domain(n.map(String)).range(o).paddingInner(a).paddingOuter(0), c = i.bandwidth(), l = new Array(r).fill(null), u = new Array(r).fill(null);
3751
+ const r = e.size(), s = e.getValues(D.group, { type: "categorical" }), o = $l(e) ?? [-0.7 / 2, 0.7 / 2], a = n.length > 1 ? Ns : 0, i = Wn().domain(n.map(String)).range(o).paddingInner(a).paddingOuter(0), c = i.bandwidth(), l = new Array(r).fill(null), u = new Array(r).fill(null);
3751
3752
  for (let d = 0; d < r; d++) {
3752
3753
  const m = s[d];
3753
3754
  if (!g(m)) continue;
@@ -3762,14 +3763,14 @@ var Ol = class {
3762
3763
  }, $l = (e) => {
3763
3764
  const t = e.getConstant(h.xMin)?.value, n = e.getConstant(h.xMax)?.value;
3764
3765
  return typeof t != "number" || typeof n != "number" ? null : [t, n];
3765
- }, pn = Ve("__ungrouped__"), jr = (e, t) => {
3766
+ }, pn = Ie("__ungrouped__"), zr = (e, t) => {
3766
3767
  const n = S(t.x), r = S(t.y);
3767
3768
  if (!n || !r) return null;
3768
- const s = e.getValues(_.group, {
3769
+ const s = e.getValues(D.group, {
3769
3770
  type: "categorical",
3770
3771
  distinct: !0,
3771
3772
  skipNulls: !0
3772
- }), o = s.length === 0, a = o ? [pn] : s, i = e.getValues(n), c = e.getValues(r, { type: "numeric" }), l = e.getValues(_.group, { type: "categorical" }), u = e.size(), d = /* @__PURE__ */ new Map();
3773
+ }), o = s.length === 0, a = o ? [pn] : s, i = e.getValues(n), c = e.getValues(r, { type: "numeric" }), l = e.getValues(D.group, { type: "categorical" }), u = e.size(), d = /* @__PURE__ */ new Map();
3773
3774
  for (let m = 0; m < u; m++) {
3774
3775
  const p = C(i[m] ?? null), f = l[m], y = o ? pn : f;
3775
3776
  if (!g(y)) continue;
@@ -3784,7 +3785,7 @@ var Ol = class {
3784
3785
  uniqueGroupKeys: a,
3785
3786
  observationCount: u
3786
3787
  };
3787
- }, zr = (e, t, n, r) => {
3788
+ }, Kr = (e, t, n, r) => {
3788
3789
  const s = new Array(r).fill(null);
3789
3790
  for (const [, o] of n) {
3790
3791
  const a = [];
@@ -3801,7 +3802,7 @@ var Ol = class {
3801
3802
  super(...e), this.type = "fill";
3802
3803
  }
3803
3804
  adjust({ data: e, mapping: t, stackMissingAsZero: n = !1 }) {
3804
- const r = jr(e, t);
3805
+ const r = zr(e, t);
3805
3806
  if (r === null) return {
3806
3807
  data: e,
3807
3808
  mapping: {}
@@ -3839,9 +3840,9 @@ var Ol = class {
3839
3840
  }
3840
3841
  }
3841
3842
  }
3842
- const u = zr(l, c, o, i);
3843
+ const u = Kr(l, c, o, i);
3843
3844
  return {
3844
- data: e.addVariable(h.yMin, "numeric", l).addVariable(h.yMax, "numeric", c).addVariable(h.yRaw, "numeric", s).addVariable(Rn.role, "categorical", u),
3845
+ data: e.addVariable(h.yMin, "numeric", l).addVariable(h.yMax, "numeric", c).addVariable(h.yRaw, "numeric", s).addVariable(Ln.role, "categorical", u),
3845
3846
  mapping: {}
3846
3847
  };
3847
3848
  }
@@ -3860,7 +3861,7 @@ var Ol = class {
3860
3861
  super(...e), this.type = "stack";
3861
3862
  }
3862
3863
  adjust({ data: e, mapping: t, stackMissingAsZero: n = !1 }) {
3863
- const r = jr(e, t);
3864
+ const r = zr(e, t);
3864
3865
  if (r === null) return {
3865
3866
  data: e,
3866
3867
  mapping: {}
@@ -3884,8 +3885,8 @@ var Ol = class {
3884
3885
  }
3885
3886
  }
3886
3887
  }
3887
- const u = zr(l, c, o, i);
3888
- let d = e.addVariable(h.yMin, "numeric", l).addVariable(h.yMax, "numeric", c).addVariable(h.yRaw, "numeric", s).addVariable(Rn.role, "categorical", u);
3888
+ const u = Kr(l, c, o, i);
3889
+ let d = e.addVariable(h.yMin, "numeric", l).addVariable(h.yMax, "numeric", c).addVariable(h.yRaw, "numeric", s).addVariable(Ln.role, "categorical", u);
3889
3890
  const m = S(t.y);
3890
3891
  if (m !== null) {
3891
3892
  const p = c.map((f, y) => s[y] === null ? null : f);
@@ -3896,7 +3897,7 @@ var Ol = class {
3896
3897
  mapping: {}
3897
3898
  };
3898
3899
  }
3899
- }, Yl = class extends Ge {
3900
+ }, Yl = class extends Ye {
3900
3901
  constructor() {
3901
3902
  super("position"), this.register("identity", new Ul()), this.register("stack", new Gl()), this.register("fill", new Bl()), this.register("dodge", new Pl());
3902
3903
  }
@@ -3914,13 +3915,13 @@ var Ol = class {
3914
3915
  let s = e;
3915
3916
  const o = r.get(t.geom);
3916
3917
  for (const a of o.positionRoles) {
3917
- if (a.role !== "scalar" || !g(a.aesthetic) || vt(a.aesthetic)) continue;
3918
+ if (a.role !== "scalar" || !g(a.aesthetic) || yt(a.aesthetic)) continue;
3918
3919
  const i = S(t.mapping[a.aesthetic]);
3919
3920
  if (!g(i) || !s.hasVariable(i)) continue;
3920
- const c = n(jn(a.axis, t.yScaleType));
3921
+ const c = n(Yn(a.axis, t.yScaleType));
3921
3922
  if (!c) continue;
3922
3923
  const l = s.getValues(i, { type: "numeric" }).map((u) => g(u) ? c.map(u) : null);
3923
- s = s.addVariable(vs(a.aesthetic), "numeric", l);
3924
+ s = s.addVariable(Ps(a.aesthetic), "numeric", l);
3924
3925
  }
3925
3926
  return s;
3926
3927
  }
@@ -3950,7 +3951,7 @@ var Wl = class {
3950
3951
  }
3951
3952
  };
3952
3953
  function Hl(e, t, n) {
3953
- const r = e.getValues(h.x, { type: "numeric" }), s = e.getValues(h.xMin, { type: "numeric" }), o = e.getValues(h.xMax, { type: "numeric" }), a = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = Kr(i);
3954
+ const r = e.getValues(h.x, { type: "numeric" }), s = e.getValues(h.xMin, { type: "numeric" }), o = e.getValues(h.xMax, { type: "numeric" }), a = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = qr(i);
3954
3955
  for (let l = 0; l < i; l++) {
3955
3956
  const u = r[l], d = s[l], m = o[l];
3956
3957
  !g(u) || !g(d) || !g(m) || (c.min[l] = u + (a ? -m : d) * n, c.max[l] = u + (a ? -d : m) * n);
@@ -3958,14 +3959,14 @@ function Hl(e, t, n) {
3958
3959
  return c;
3959
3960
  }
3960
3961
  function Xl(e, t) {
3961
- const n = e.getValues(h.xMin, { type: "numeric" }), r = e.getValues(h.xMax, { type: "numeric" }), s = e.size(), o = Kr(s);
3962
+ const n = e.getValues(h.xMin, { type: "numeric" }), r = e.getValues(h.xMax, { type: "numeric" }), s = e.size(), o = qr(s);
3962
3963
  for (let a = 0; a < s; a++) {
3963
3964
  const i = n[a], c = r[a];
3964
3965
  !g(i) || !g(c) || (o.min[a] = t.map(i), o.max[a] = t.map(c));
3965
3966
  }
3966
3967
  return o;
3967
3968
  }
3968
- function Kr(e) {
3969
+ function qr(e) {
3969
3970
  return {
3970
3971
  min: new Array(e).fill(null),
3971
3972
  max: new Array(e).fill(null)
@@ -3973,21 +3974,21 @@ function Kr(e) {
3973
3974
  }
3974
3975
  var Jl = class {
3975
3976
  map({ data: e, layer: t, getPositionScale: n }) {
3976
- const r = S(t.mapping.y), s = n(Ae(t.yScaleType));
3977
+ const r = S(t.mapping.y), s = n(de(t.yScaleType));
3977
3978
  if (!r || !s) return e;
3978
3979
  const o = e.getValues(r).map((a) => g(a) ? s.map(a) : null);
3979
3980
  return e.addVariable(h.y, "numeric", o);
3980
3981
  }
3981
3982
  }, Zl = class {
3982
3983
  map({ data: e, layer: t, getPositionScale: n }) {
3983
- const r = n(Ae(t.yScaleType));
3984
+ const r = n(de(t.yScaleType));
3984
3985
  if (!r || !e.hasVariable(h.yMin) || !e.hasVariable(h.yMax)) return e;
3985
3986
  const s = r.bandwidth, o = g(s) && e.hasVariable(h.y) ? Ql(e, r, s) : eu(e, r);
3986
3987
  return e.addVariable(h.yMin, "numeric", o.min).addVariable(h.yMax, "numeric", o.max);
3987
3988
  }
3988
3989
  };
3989
3990
  function Ql(e, t, n) {
3990
- const r = e.getValues(h.y, { type: "numeric" }), s = e.getValues(h.yMin, { type: "numeric" }), o = e.getValues(h.yMax, { type: "numeric" }), a = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = qr(i);
3991
+ const r = e.getValues(h.y, { type: "numeric" }), s = e.getValues(h.yMin, { type: "numeric" }), o = e.getValues(h.yMax, { type: "numeric" }), a = "reverse" in t.spec && t.spec.reverse === !0, i = e.size(), c = Wr(i);
3991
3992
  for (let l = 0; l < i; l++) {
3992
3993
  const u = r[l], d = s[l], m = o[l];
3993
3994
  !g(u) || !g(d) || !g(m) || (c.min[l] = u + (a ? -m : d) * n, c.max[l] = u + (a ? -d : m) * n);
@@ -3995,14 +3996,14 @@ function Ql(e, t, n) {
3995
3996
  return c;
3996
3997
  }
3997
3998
  function eu(e, t) {
3998
- const n = e.getValues(h.yMin, { type: "numeric" }), r = e.getValues(h.yMax, { type: "numeric" }), s = e.size(), o = qr(s);
3999
+ const n = e.getValues(h.yMin, { type: "numeric" }), r = e.getValues(h.yMax, { type: "numeric" }), s = e.size(), o = Wr(s);
3999
4000
  for (let a = 0; a < s; a++) {
4000
4001
  const i = n[a], c = r[a];
4001
4002
  !g(i) || !g(c) || (o.min[a] = t.map(i), o.max[a] = t.map(c));
4002
4003
  }
4003
4004
  return o;
4004
4005
  }
4005
- function qr(e) {
4006
+ function Wr(e) {
4006
4007
  return {
4007
4008
  min: new Array(e).fill(null),
4008
4009
  max: new Array(e).fill(null)
@@ -4042,15 +4043,22 @@ var ru = class extends ne {
4042
4043
  });
4043
4044
  return {
4044
4045
  ...e,
4045
- data: r
4046
+ data: r,
4047
+ yZero: su(n(de(e.yScaleType)))
4046
4048
  };
4047
4049
  }
4048
- }, fn = (e) => {
4050
+ };
4051
+ function su(e) {
4052
+ if (e === null || g(e.bandwidth)) return null;
4053
+ const t = e.map(0);
4054
+ return Number.isFinite(t) ? t : null;
4055
+ }
4056
+ var fn = (e) => {
4049
4057
  const t = e.find((r) => r.scaledAesthetic === "color"), n = t?.scaleType === "discrete" ? t.range?.[0] : void 0;
4050
4058
  return typeof n == "string" ? n : void 0;
4051
- }, su = (e, t) => (Ut[e][t] ?? Ut[e].default).map((n) => ks[n]), ou = (e, t) => {
4059
+ }, ou = (e, t) => ($t[e][t] ?? $t[e].default).map((n) => Is[n]), au = (e, t) => {
4052
4060
  const n = e.palettes?.categorical;
4053
- return n !== void 0 && n.length > 0 ? n : e.hasTouchingGeoms ? su(e.colorScheme, t) : bs;
4061
+ return n !== void 0 && n.length > 0 ? n : e.hasTouchingGeoms ? ou(e.colorScheme, t) : Os;
4054
4062
  }, W = {
4055
4063
  transform: "linear",
4056
4064
  reverse: !1,
@@ -4070,29 +4078,29 @@ var ru = class extends ne {
4070
4078
  domainMax: null,
4071
4079
  nice: !1,
4072
4080
  reverse: !1
4073
- }, Se = {
4081
+ }, Te = {
4074
4082
  range: null,
4075
4083
  domain: null,
4076
4084
  padding: 0.1,
4077
4085
  reverse: !1
4078
- }, au = {
4086
+ }, iu = {
4079
4087
  rgb: Eo,
4080
4088
  lab: Io,
4081
4089
  hcl: wo,
4082
4090
  hsl: Co
4083
4091
  };
4084
4092
  function ut(e) {
4085
- const t = iu(e);
4093
+ const t = cu(e);
4086
4094
  return e.reverse ? (n) => t(1 - n) : t;
4087
4095
  }
4088
- function qm(e = {}, t = 2) {
4096
+ function Wm(e = {}, t = 2) {
4089
4097
  const n = ut(e);
4090
4098
  return Array.from({ length: t }, (r, s) => n(t === 1 ? 0 : s / (t - 1)));
4091
4099
  }
4092
- var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.diverging : t?.sequential) ?? (e ? Ds : xs), iu = (e) => {
4093
- const t = Wr(e), n = au[e.interpolate ?? W.interpolate];
4100
+ var Hr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.diverging : t?.sequential) ?? (e ? $s : ks), cu = (e) => {
4101
+ const t = Hr(e), n = iu[e.interpolate ?? W.interpolate];
4094
4102
  return Vo(n, t.map(String));
4095
- }, hn = (e) => e != null && e.length >= 2 ? e : void 0, cu = class extends te {
4103
+ }, hn = (e) => e != null && e.length >= 2 ? e : void 0, lu = class extends te {
4096
4104
  constructor(e, t) {
4097
4105
  super(), this.container = e, this.registry = t;
4098
4106
  }
@@ -4114,11 +4122,11 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4114
4122
  const n = this.collectValues(e.layers, t), r = {
4115
4123
  colorScheme: e.colorScheme,
4116
4124
  hasTouchingGeoms: Gc(e.layers),
4117
- zeroAxes: Dr(e.layers).zeroAxes,
4125
+ zeroAxes: _r(e.layers).zeroAxes,
4118
4126
  palettes: this.container.theme?.palettes
4119
4127
  }, s = {};
4120
4128
  for (const [o, a] of t) {
4121
- const i = n.get(o) ?? [], c = a.scaleType === "discrete" ? hr(a, e.layers) : a;
4129
+ const i = n.get(o) ?? [], c = a.scaleType === "discrete" ? yr(a, e.layers) : a;
4122
4130
  s[o] = this.registry.get(c.scaleType).compile(c, i, r);
4123
4131
  }
4124
4132
  return s;
@@ -4126,7 +4134,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4126
4134
  warnEvenDivergingRamp(e) {
4127
4135
  const t = e.color;
4128
4136
  if (t?.spec.scaleType !== "continuous" || t.domain.length !== 3) return;
4129
- const n = Wr({
4137
+ const n = Hr({
4130
4138
  ...t.spec,
4131
4139
  diverging: !0,
4132
4140
  palettes: this.container.theme?.palettes
@@ -4145,11 +4153,11 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4145
4153
  validateScaleTypeCompatibility(e) {
4146
4154
  const t = [];
4147
4155
  for (const n of e.scales) {
4148
- const { compatibleDataTypes: r } = this.registry.get(n.scaleType), s = D(n.scaledAesthetic);
4156
+ const { compatibleDataTypes: r } = this.registry.get(n.scaleType), s = _(n.scaledAesthetic);
4149
4157
  for (const o of e.layers) {
4150
- if ((n.scaledAesthetic === "y" || n.scaledAesthetic === "ySecondary") && Ae(o.yScaleType) !== n.scaledAesthetic || !g(o.mapping[s]) || n.scaleType === "continuous" && this.spansCategoriesOf(o, s)) continue;
4158
+ if ((n.scaledAesthetic === "y" || n.scaledAesthetic === "ySecondary") && de(o.yScaleType) !== n.scaledAesthetic || !g(o.mapping[s]) || n.scaleType === "continuous" && this.spansCategoriesOf(o, s)) continue;
4151
4159
  const a = S(o.mapping[s]);
4152
- if (!g(a) || Ye(a) || !o.data.hasVariable(a) || o.data.size() === 0) continue;
4160
+ if (!g(a) || Ge(a) || !o.data.hasVariable(a) || o.data.size() === 0) continue;
4153
4161
  const i = o.data.getType(a);
4154
4162
  if (!r.includes(i)) {
4155
4163
  const c = n.scaleType === "continuous" && i === "temporal" ? `Use scale.${n.scaledAesthetic}.datetime() for a time axis or declare the column's valueFormat in data.columns to read it as a number.` : void 0;
@@ -4181,7 +4189,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4181
4189
  }
4182
4190
  }
4183
4191
  }
4184
- Rr(this.container.diagnostics, t);
4192
+ Nr(this.container.diagnostics, t);
4185
4193
  }
4186
4194
  collectValues(e, t) {
4187
4195
  const n = /* @__PURE__ */ new Map();
@@ -4189,7 +4197,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4189
4197
  const s = this.resolveCustomPositionalAxes(r);
4190
4198
  for (const [o, a] of Object.entries(r.mapping)) {
4191
4199
  if (!g(a)) continue;
4192
- const i = o === "y" ? Ae(r.yScaleType) : o, c = s.get(o) ?? (Ws(i) ? i : void 0);
4200
+ const i = o === "y" ? de(r.yScaleType) : o, c = s.get(o) ?? (js(i) ? i : void 0);
4193
4201
  if (!g(c) || !t.has(c)) continue;
4194
4202
  const l = t.get(c)?.scaleType, u = this.spansCategoriesOf(r, o) ? [h.xMin, h.xMax].filter((d) => r.data.hasVariable(d)) : this.resolveVariables(o, a, r.data, l);
4195
4203
  this.collectFromVariables(r.data, u, c, n);
@@ -4203,7 +4211,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4203
4211
  resolveCustomPositionalAxes(e) {
4204
4212
  const t = /* @__PURE__ */ new Map(), n = this.container.geomRegistry.get(e.geom);
4205
4213
  for (const r of n.positionRoles)
4206
- r.role !== "scalar" || !g(r.aesthetic) || vt(r.aesthetic) || t.set(r.aesthetic, jn(r.axis, e.yScaleType));
4214
+ r.role !== "scalar" || !g(r.aesthetic) || yt(r.aesthetic) || t.set(r.aesthetic, Yn(r.axis, e.yScaleType));
4207
4215
  return t;
4208
4216
  }
4209
4217
  resolveVariables(e, t, n, r) {
@@ -4225,7 +4233,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4225
4233
  createPositionScale(e, t) {
4226
4234
  return {
4227
4235
  kind: "position",
4228
- aesthetic: D(e.scaledAesthetic),
4236
+ aesthetic: _(e.scaledAesthetic),
4229
4237
  spec: e,
4230
4238
  ...t
4231
4239
  };
@@ -4233,7 +4241,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4233
4241
  createVisualScale(e, t) {
4234
4242
  return {
4235
4243
  kind: "visual",
4236
- aesthetic: D(e.scaledAesthetic),
4244
+ aesthetic: _(e.scaledAesthetic),
4237
4245
  spec: e,
4238
4246
  ...t
4239
4247
  };
@@ -4254,7 +4262,7 @@ var Wr = ({ diverging: e = !1, palettes: t, range: n }) => hn(n) ?? hn(e ? t?.di
4254
4262
  pinnedHigh: n !== null
4255
4263
  };
4256
4264
  };
4257
- function lu(e) {
4265
+ function uu(e) {
4258
4266
  const [t, n] = e.domain;
4259
4267
  return t > 0 ? {
4260
4268
  ...e,
@@ -4269,13 +4277,13 @@ function lu(e) {
4269
4277
  function mt(e, t) {
4270
4278
  return [t.pinnedLow ? t.domain[0] : e[0], t.pinnedHigh ? t.domain[1] : e[1]];
4271
4279
  }
4272
- var uu = class extends We {
4280
+ var du = class extends We {
4273
4281
  constructor(e) {
4274
4282
  super(), this.container = e, this.compatibleDataTypes = ["numeric"];
4275
4283
  }
4276
4284
  compile(e, t, n) {
4277
4285
  if (e.scaleType !== "continuous") throw new M({ message: "ContinuousScale.compile received non-continuous spec" });
4278
- const r = yt(e.scaledAesthetic), s = e.scaledAesthetic === "color", o = this.computeDataDomain(t);
4286
+ const r = bt(e.scaledAesthetic), s = e.scaledAesthetic === "color", o = this.computeDataDomain(t);
4279
4287
  return s ? this.buildColorScale(o, e, n.palettes) : r ? this.buildPositionScale(o, e, n.zeroAxes[e.scaledAesthetic] !== void 0) : this.buildVisualScale(o, e);
4280
4288
  }
4281
4289
  computeDataDomain(e) {
@@ -4285,10 +4293,10 @@ var uu = class extends We {
4285
4293
  return t === 1 / 0 ? [0, 0] : [t, n];
4286
4294
  }
4287
4295
  createD3Scale(e, t, n, r = !1) {
4288
- const s = dt(e, n.domainMin, n.domainMax), o = r ? lu(s) : s;
4296
+ const s = dt(e, n.domainMin, n.domainMax), o = r ? uu(s) : s;
4289
4297
  let a = o.domain;
4290
- r && du(s, o) && this.warnIncompatibleDomain(n, s.domain, `'${n.scaledAesthetic}' holds zero for the geom drawn on it, so the pin at [${s.domain[0]}, ${s.domain[1]}] gives way to [${a[0]}, ${a[1]}].`, `Pin '${n.scaledAesthetic}' at or past zero, or drop the pin.`);
4291
- const i = n.transform === "log" && mu(a);
4298
+ r && mu(s, o) && this.warnIncompatibleDomain(n, s.domain, `'${n.scaledAesthetic}' holds zero for the geom drawn on it, so the pin at [${s.domain[0]}, ${s.domain[1]}] gives way to [${a[0]}, ${a[1]}].`, `Pin '${n.scaledAesthetic}' at or past zero, or drop the pin.`);
4299
+ const i = n.transform === "log" && pu(a);
4292
4300
  n.transform === "log" && !i && this.warnIncompatibleDomain(n, a, `Log scale on '${n.scaledAesthetic}' needs a strictly positive or negative domain, but the domain is [${a[0]}, ${a[1]}] — rendering a linear scale instead.`, r ? `'${n.scaledAesthetic}' holds zero for the geom drawn on it; use a linear or sqrt transform.` : "Filter out non-positive values or set a positive domainMin so the log scale can apply.");
4293
4301
  const c = i ? So() : n.transform === "sqrt" ? Ao() : Je();
4294
4302
  return n.nice && !i && (a = mt(c.copy().domain(a).nice().domain(), o)), c.domain(a).range(t).clamp(n.clamp);
@@ -4298,7 +4306,7 @@ var uu = class extends We {
4298
4306
  code: "INCOMPATIBLE_SCALE_DOMAIN",
4299
4307
  message: n,
4300
4308
  context: {
4301
- aesthetic: D(e.scaledAesthetic),
4309
+ aesthetic: _(e.scaledAesthetic),
4302
4310
  scaleType: e.scaleType,
4303
4311
  actual: t
4304
4312
  },
@@ -4315,7 +4323,7 @@ var uu = class extends We {
4315
4323
  });
4316
4324
  }
4317
4325
  buildVisualScale(e, t) {
4318
- const n = pu(t.range) ?? [0, 1], r = t.reverse ? [n[1], n[0]] : n, s = this.createD3Scale(e, r, t);
4326
+ const n = fu(t.range) ?? [0, 1], r = t.reverse ? [n[1], n[0]] : n, s = this.createD3Scale(e, r, t);
4319
4327
  return this.createVisualScale(t, {
4320
4328
  map: s,
4321
4329
  domain: s.domain(),
@@ -4379,22 +4387,22 @@ var uu = class extends We {
4379
4387
  const a = Math.max(Math.abs(r[0] - n), Math.abs(r[1] - n));
4380
4388
  return [s ? r[0] : n - a, o ? r[1] : n + a];
4381
4389
  }
4382
- }, du = (e, t) => e.pinnedLow && e.domain[0] !== t.domain[0] || e.pinnedHigh && e.domain[1] !== t.domain[1], mu = (e) => {
4390
+ }, mu = (e, t) => e.pinnedLow && e.domain[0] !== t.domain[0] || e.pinnedHigh && e.domain[1] !== t.domain[1], pu = (e) => {
4383
4391
  const [t, n] = e;
4384
4392
  return t > 0 && n > 0 || t < 0 && n < 0;
4385
4393
  };
4386
- function pu(e) {
4394
+ function fu(e) {
4387
4395
  if (!e) return null;
4388
4396
  const [t, n] = e;
4389
4397
  return typeof t == "number" && typeof n == "number" ? [t, n] : null;
4390
4398
  }
4391
- var fu = class extends We {
4399
+ var gu = class extends We {
4392
4400
  constructor(...e) {
4393
4401
  super(...e), this.compatibleDataTypes = ["temporal"];
4394
4402
  }
4395
4403
  compile(e, t) {
4396
4404
  if (e.scaleType !== "datetime") throw new M({ message: "DatetimeScale.compile received non-datetime spec" });
4397
- const n = yt(e.scaledAesthetic), r = this.computeDataDomain(t);
4405
+ const n = bt(e.scaledAesthetic), r = this.computeDataDomain(t);
4398
4406
  if (!n) throw new E({
4399
4407
  code: "INCOMPATIBLE_TYPE",
4400
4408
  message: "Datetime scale is not supported for non-position aesthetics",
@@ -4423,7 +4431,7 @@ var fu = class extends We {
4423
4431
  }
4424
4432
  createD3Scale(e, t, n) {
4425
4433
  const r = xo().range(t).clamp(n.clamp);
4426
- if (!gu(e)) return r.domain([]);
4434
+ if (!hu(e)) return r.domain([]);
4427
4435
  const s = dt([e[0].getTime(), e[1].getTime()], n.domainMin, n.domainMax);
4428
4436
  if (r.domain(s.domain), n.nice) {
4429
4437
  const [o, a] = r.nice().domain();
@@ -4440,7 +4448,7 @@ var fu = class extends We {
4440
4448
  generateTicks: (c) => c && "atInputs" in c ? i : c && "interval" in c ? o && a ? li(o, a, c.interval) : [] : s.ticks(c?.count)
4441
4449
  });
4442
4450
  }
4443
- }, gu = (e) => e.length === 2 && O(e[0]) && O(e[1]), hu = class extends We {
4451
+ }, hu = (e) => e.length === 2 && O(e[0]) && O(e[1]), yu = class extends We {
4444
4452
  constructor(...e) {
4445
4453
  super(...e), this.compatibleDataTypes = [
4446
4454
  "categorical",
@@ -4450,13 +4458,13 @@ var fu = class extends We {
4450
4458
  }
4451
4459
  compile(e, t, n) {
4452
4460
  if (e.scaleType !== "discrete") throw new M({ message: "DiscreteScale.compile received non-discrete spec" });
4453
- const r = yt(e.scaledAesthetic), s = gr(t, e);
4461
+ const r = bt(e.scaledAesthetic), s = hr(t, e);
4454
4462
  if (r) return this.buildPositionScale(s, e);
4455
- const o = e.scaledAesthetic === "color" ? ou(n, s.length) : void 0;
4463
+ const o = e.scaledAesthetic === "color" ? au(n, s.length) : void 0;
4456
4464
  return this.buildVisualScale(s, e, o);
4457
4465
  }
4458
4466
  buildPositionScale(e, t) {
4459
- const n = e.map(String), r = t.padding ?? Se.padding, s = t.reverse ? [1, 0] : [0, 1], o = qn().domain(n).range(s).paddingInner(r).paddingOuter(r / 2), a = o.bandwidth() / 2;
4467
+ const n = e.map(String), r = t.padding ?? Te.padding, s = t.reverse ? [1, 0] : [0, 1], o = Wn().domain(n).range(s).paddingInner(r).paddingOuter(r / 2), a = o.bandwidth() / 2;
4460
4468
  return this.createPositionScale(t, {
4461
4469
  map: (i) => (o(String(i)) ?? NaN) + a,
4462
4470
  domain: e,
@@ -4465,7 +4473,7 @@ var fu = class extends We {
4465
4473
  });
4466
4474
  }
4467
4475
  buildVisualScale(e, t, n) {
4468
- const r = e.map(String), s = t.range && t.range.length > 0 ? t.range : n, o = s && s.length > 0 ? To().domain(r).range(s).unknown(s[0]) : null, a = yu(t.scaledAesthetic, s);
4476
+ const r = e.map(String), s = t.range && t.range.length > 0 ? t.range : n, o = s && s.length > 0 ? To().domain(r).range(s).unknown(s[0]) : null, a = vu(t.scaledAesthetic, s);
4469
4477
  return this.createVisualScale(t, {
4470
4478
  map: (i) => {
4471
4479
  const c = String(i);
@@ -4477,7 +4485,7 @@ var fu = class extends We {
4477
4485
  ...n === void 0 ? {} : { defaultPalette: n }
4478
4486
  });
4479
4487
  }
4480
- }, yu = (e, t) => {
4488
+ }, vu = (e, t) => {
4481
4489
  if (e !== "color" || t === void 0 || t.length === 0) return;
4482
4490
  const n = [];
4483
4491
  for (const r of t) {
@@ -4485,7 +4493,7 @@ var fu = class extends We {
4485
4493
  n.push(r);
4486
4494
  }
4487
4495
  return n;
4488
- }, vu = class extends We {
4496
+ }, bu = class extends We {
4489
4497
  constructor(...e) {
4490
4498
  super(...e), this.compatibleDataTypes = [
4491
4499
  "numeric",
@@ -4497,18 +4505,18 @@ var fu = class extends We {
4497
4505
  if (e.scaleType !== "identity") throw new M({ message: "IdentityScale.compile received non-identity spec" });
4498
4506
  return {
4499
4507
  kind: "identity",
4500
- aesthetic: D(e.scaledAesthetic),
4508
+ aesthetic: _(e.scaledAesthetic),
4501
4509
  spec: e,
4502
4510
  map: (t) => t,
4503
4511
  domain: [],
4504
4512
  generateTicks: () => []
4505
4513
  };
4506
4514
  }
4507
- }, bu = class extends Ge {
4515
+ }, Su = class extends Ye {
4508
4516
  constructor(e) {
4509
- super("scale"), this.register("continuous", new uu(e)), this.register("discrete", new hu()), this.register("datetime", new fu()), this.register("identity", new vu());
4517
+ super("scale"), this.register("continuous", new du(e)), this.register("discrete", new yu()), this.register("datetime", new gu()), this.register("identity", new bu());
4510
4518
  }
4511
- }, Hr = {
4519
+ }, Xr = {
4512
4520
  x: "position",
4513
4521
  y: "position",
4514
4522
  ySecondary: "position",
@@ -4517,7 +4525,7 @@ var fu = class extends We {
4517
4525
  alpha: "continuous-range",
4518
4526
  strokeWidth: "continuous-range",
4519
4527
  lineType: "discrete-only"
4520
- }, Su = {
4528
+ }, Tu = {
4521
4529
  numeric: {
4522
4530
  position: "continuous",
4523
4531
  "color-range": "continuous",
@@ -4537,25 +4545,25 @@ var fu = class extends We {
4537
4545
  "discrete-only": "discrete"
4538
4546
  }
4539
4547
  };
4540
- function Xr(e, t) {
4548
+ function Jr(e, t) {
4541
4549
  const { data: n, layers: r, mapping: s } = t;
4542
4550
  return {
4543
4551
  container: e,
4544
4552
  data: n,
4545
4553
  layers: r,
4546
4554
  mapping: s,
4547
- demands: Dr(Nr(e.geomRegistry, r))
4555
+ demands: _r(Dr(e.geomRegistry, r))
4548
4556
  };
4549
4557
  }
4550
4558
  function Mt(e, t) {
4551
4559
  switch (t.scaleType) {
4552
4560
  case "inferred":
4553
4561
  return {
4554
- ...Mt(e, Iu(e, t)),
4562
+ ...Mt(e, Eu(e, t)),
4555
4563
  inferredFrom: t
4556
4564
  };
4557
4565
  case "continuous": {
4558
- const n = Hr[t.scaledAesthetic], r = n === "continuous-range" && t.scaledAesthetic in gn ? gn[t.scaledAesthetic] : null, s = t.scaledAesthetic === "size" && n === "continuous-range" ? "sqrt" : W.transform;
4566
+ const n = Xr[t.scaledAesthetic], r = n === "continuous-range" && t.scaledAesthetic in gn ? gn[t.scaledAesthetic] : null, s = t.scaledAesthetic === "size" && n === "continuous-range" ? "sqrt" : W.transform;
4559
4567
  return {
4560
4568
  type: t.type,
4561
4569
  scaledAesthetic: t.scaledAesthetic,
@@ -4584,7 +4592,7 @@ function Mt(e, t) {
4584
4592
  clamp: t.clamp ?? !1
4585
4593
  };
4586
4594
  case "discrete":
4587
- return Au(t, e.demands);
4595
+ return xu(t, e.demands);
4588
4596
  case "identity":
4589
4597
  return {
4590
4598
  type: t.type,
@@ -4595,43 +4603,43 @@ function Mt(e, t) {
4595
4603
  throw new M({ message: `Unknown scale type: ${t.scaleType}` });
4596
4604
  }
4597
4605
  }
4598
- function Tu(e, t) {
4599
- const { scales: n, layers: r, mapping: s, coords: o } = t, a = Xr(e, t), i = ku(Lu(Vu(e, n, r, s), r), a.demands), c = /* @__PURE__ */ new Map();
4606
+ function Au(e, t) {
4607
+ const { scales: n, layers: r, mapping: s, coords: o } = t, a = Jr(e, t), i = Ru(ku(Mu(e, n, r, s), r), a.demands), c = /* @__PURE__ */ new Map();
4600
4608
  for (const u of i) c.set(u.scaledAesthetic, u);
4601
4609
  const l = [...c.values()].map((u) => {
4602
- const d = wu(a, xu(a, u));
4610
+ const d = Cu(a, wu(a, u));
4603
4611
  return Mt(a, d);
4604
4612
  });
4605
- return o.coordType === "polar" ? l.map(Jr) : l;
4613
+ return o.coordType === "polar" ? l.map(Zr) : l;
4606
4614
  }
4607
- function Au(e, t) {
4615
+ function xu(e, t) {
4608
4616
  const n = t?.bandPadding[e.scaledAesthetic];
4609
4617
  return {
4610
4618
  type: e.type,
4611
4619
  scaledAesthetic: e.scaledAesthetic,
4612
4620
  scaleType: e.scaleType,
4613
- range: e.range ?? Se.range,
4614
- domain: e.domain ?? Se.domain,
4615
- padding: e.padding ?? n ?? Se.padding,
4616
- reverse: e.reverse ?? Cu(e.scaledAesthetic, t)
4621
+ range: e.range ?? Te.range,
4622
+ domain: e.domain ?? Te.domain,
4623
+ padding: e.padding ?? n ?? Te.padding,
4624
+ reverse: e.reverse ?? Iu(e.scaledAesthetic, t)
4617
4625
  };
4618
4626
  }
4619
- var Jr = (e) => e.scaleType === "discrete" ? {
4627
+ var Zr = (e) => e.scaleType === "discrete" ? {
4620
4628
  ...e,
4621
4629
  padding: 0
4622
4630
  } : e;
4623
- function xu(e, t) {
4631
+ function wu(e, t) {
4624
4632
  return t.scaleType === "inferred" || t.scaleType === "discrete" || !e.demands.bandedAxes.includes(t.scaledAesthetic) ? t : (e.container.diagnostics.addWarning({
4625
4633
  code: "UNSUPPORTED_SCALE_TYPE",
4626
4634
  message: `A geom drawn on '${t.scaledAesthetic}' needs it to be a band scale, but the spec declares a '${t.scaleType}' one; the band wins.`,
4627
4635
  context: {
4628
- aesthetic: D(t.scaledAesthetic),
4636
+ aesthetic: _(t.scaledAesthetic),
4629
4637
  scaleType: t.scaleType
4630
4638
  },
4631
4639
  suggestion: `Declare '${t.scaledAesthetic}' as a discrete scale, or omit it and let the geom's band be inferred.`
4632
- }), he(t.scaledAesthetic, { ..."reverse" in t && t.reverse !== void 0 && { reverse: t.reverse } }));
4640
+ }), ye(t.scaledAesthetic, { ..."reverse" in t && t.reverse !== void 0 && { reverse: t.reverse } }));
4633
4641
  }
4634
- function wu(e, t) {
4642
+ function Cu(e, t) {
4635
4643
  return t.scaleType === "inferred" || t.scaledAesthetic !== e.demands.categorySpanAxis ? t : t.scaleType === "continuous" ? {
4636
4644
  ...t,
4637
4645
  nice: t.nice ?? !1
@@ -4639,76 +4647,76 @@ function wu(e, t) {
4639
4647
  code: "UNSUPPORTED_SCALE_TYPE",
4640
4648
  message: `A geom spanning categories on '${t.scaledAesthetic}' needs it to be a continuous scale, but the spec declares a '${t.scaleType}' one; continuous wins.`,
4641
4649
  context: {
4642
- aesthetic: D(t.scaledAesthetic),
4650
+ aesthetic: _(t.scaledAesthetic),
4643
4651
  scaleType: t.scaleType
4644
4652
  },
4645
4653
  suggestion: `Declare '${t.scaledAesthetic}' as a continuous scale, or omit it and let it be inferred.`
4646
- }), ge(t.scaledAesthetic, {
4654
+ }), he(t.scaledAesthetic, {
4647
4655
  nice: !1,
4648
4656
  ..."reverse" in t && t.reverse !== void 0 && { reverse: t.reverse }
4649
4657
  }));
4650
4658
  }
4651
- function Cu(e, t) {
4652
- return e === t?.discreteCrossAxis ? !0 : Se.reverse;
4659
+ function Iu(e, t) {
4660
+ return e === t?.discreteCrossAxis ? !0 : Te.reverse;
4653
4661
  }
4654
- function Iu({ data: e, layers: t, mapping: n, demands: r }, s) {
4655
- const o = Eu(t, n, s.scaledAesthetic);
4662
+ function Eu({ data: e, layers: t, mapping: n, demands: r }, s) {
4663
+ const o = Vu(t, n, s.scaledAesthetic);
4656
4664
  if (s.scaledAesthetic === r.categorySpanAxis) {
4657
4665
  const u = s.options;
4658
- return ge(s.scaledAesthetic, {
4666
+ return he(s.scaledAesthetic, {
4659
4667
  ...u,
4660
4668
  nice: u?.nice ?? !1
4661
4669
  });
4662
4670
  }
4663
- if (s.scaledAesthetic === r.discreteAxis) return he(s.scaledAesthetic, s.options);
4664
- if (s.scaledAesthetic === r.discreteCrossAxis) return he(s.scaledAesthetic, s.options);
4671
+ if (s.scaledAesthetic === r.discreteAxis) return ye(s.scaledAesthetic, s.options);
4672
+ if (s.scaledAesthetic === r.discreteCrossAxis) return ye(s.scaledAesthetic, s.options);
4665
4673
  const a = r.zeroAxes[s.scaledAesthetic];
4666
4674
  if (a !== void 0) {
4667
4675
  const u = s.options;
4668
- return ge(s.scaledAesthetic, {
4676
+ return he(s.scaledAesthetic, {
4669
4677
  ...u,
4670
4678
  ...!a.nice && { nice: !1 }
4671
4679
  });
4672
4680
  }
4673
4681
  const i = S(o);
4674
- if (!g(i) || !e.hasVariable(i) || e.size() === 0) return ge(s.scaledAesthetic, s.options);
4675
- const c = e.getType(i), l = Hr[s.scaledAesthetic];
4676
- switch (Su[c][l]) {
4682
+ if (!g(i) || !e.hasVariable(i) || e.size() === 0) return he(s.scaledAesthetic, s.options);
4683
+ const c = e.getType(i), l = Xr[s.scaledAesthetic];
4684
+ switch (Tu[c][l]) {
4677
4685
  case "discrete":
4678
- return he(s.scaledAesthetic, s.options);
4686
+ return ye(s.scaledAesthetic, s.options);
4679
4687
  case "datetime":
4680
- return Us(s.scaledAesthetic, s.options);
4688
+ return Ks(s.scaledAesthetic, s.options);
4681
4689
  case "continuous":
4682
- return ge(s.scaledAesthetic, s.options);
4690
+ return he(s.scaledAesthetic, s.options);
4683
4691
  default:
4684
- return Gs(s.scaledAesthetic);
4692
+ return qs(s.scaledAesthetic);
4685
4693
  }
4686
4694
  }
4687
- function Eu(e, t, n) {
4688
- const r = D(n);
4689
- for (const s of Zr(n, e)) {
4695
+ function Vu(e, t, n) {
4696
+ const r = _(n);
4697
+ for (const s of Qr(n, e)) {
4690
4698
  const o = s.mapping[r] ?? t[r];
4691
4699
  if (g(S(o))) return o;
4692
4700
  }
4693
4701
  return t[r];
4694
4702
  }
4695
- function Zr(e, t) {
4703
+ function Qr(e, t) {
4696
4704
  return e === "ySecondary" ? t.filter((n) => n.yScaleType === "secondary") : e === "y" ? t.filter((n) => n.yScaleType === "primary") : t;
4697
4705
  }
4698
- function Vu(e, t, n, r) {
4699
- const s = ["x", "y"].filter((o) => !t.some((a) => a.scaledAesthetic === o) && Zr(o, n).some((a) => Mu(e, a, o, r)));
4706
+ function Mu(e, t, n, r) {
4707
+ const s = ["x", "y"].filter((o) => !t.some((a) => a.scaledAesthetic === o) && Qr(o, n).some((a) => Lu(e, a, o, r)));
4700
4708
  return [...t, ...s.map((o) => ht(o))];
4701
4709
  }
4702
- function Mu(e, t, n, r) {
4710
+ function Lu(e, t, n, r) {
4703
4711
  return e.statRegistry.get(t.stat.type).resolveComputedAesthetics(t.stat, { ...t.params }).has(n) ? !0 : [n, ...e.geomRegistry.get(t.geom).positionRoles.filter((s) => s.axis === n).map((s) => s.aesthetic ?? n)].some((s) => !!S(t.mapping[s] ?? r[s]));
4704
4712
  }
4705
- function Lu(e, t) {
4713
+ function ku(e, t) {
4706
4714
  return !t.some((n) => n.yScaleType === "secondary") || e.some((n) => n.scaledAesthetic === "ySecondary") ? e : [...e, ht("ySecondary")];
4707
4715
  }
4708
- function ku(e, t) {
4709
- return e.some((n) => n.scaledAesthetic === "color") ? e : [...e, t.inferColorScale ? ht("color") : he("color")];
4716
+ function Ru(e, t) {
4717
+ return e.some((n) => n.scaledAesthetic === "color") ? e : [...e, t.inferColorScale ? ht("color") : ye("color")];
4710
4718
  }
4711
- var Qr = class extends te {
4719
+ var es = class extends te {
4712
4720
  constructor(e) {
4713
4721
  super(), this.registry = e;
4714
4722
  }
@@ -4721,9 +4729,9 @@ var Qr = class extends te {
4721
4729
  run(e) {
4722
4730
  return e.transforms.reduce((t, n) => this.registry.get(n.transformType).apply(t, n), e.data);
4723
4731
  }
4724
- }, es = new Vn(), Ru = new Qr(es), Nu = (e, t) => {
4725
- const n = t.every((r) => es.has(r.transformType));
4726
- return t.length === 0 || !n ? e : Ru.compile({
4732
+ }, ts = new kn(), Nu = new es(ts), Du = (e, t) => {
4733
+ const n = t.every((r) => ts.has(r.transformType));
4734
+ return t.length === 0 || !n ? e : Nu.compile({
4727
4735
  data: e,
4728
4736
  transforms: t
4729
4737
  });
@@ -4731,7 +4739,7 @@ var Qr = class extends te {
4731
4739
  function P() {
4732
4740
  return yn += 1, `${Math.random().toString(36).slice(2, 6)}${yn.toString(36)}`;
4733
4741
  }
4734
- var Du = {
4742
+ var _u = {
4735
4743
  top: {
4736
4744
  x: 0,
4737
4745
  y: -1
@@ -4764,21 +4772,21 @@ var Du = {
4764
4772
  x: 1,
4765
4773
  y: 1
4766
4774
  }
4767
- }, _u = (e, t, n) => {
4768
- const r = Ou(e, t), s = Fu(r);
4775
+ }, Ou = (e, t, n) => {
4776
+ const r = Pu(e, t), s = Bu(r);
4769
4777
  return {
4770
- differenceArrows: (r.differenceArrows ?? []).map((o) => Uu(e, o, n)).filter(g),
4771
- shapes: (r.shapes ?? []).map((o) => zu(e, o, s)).filter(g),
4772
- arrows: (r.arrows ?? []).map((o) => Wu(e, o, n, s)).filter(g),
4773
- textAnnotations: (r.textAnnotations ?? []).map((o) => Bu(e, o, n, s)).filter(g),
4774
- stickers: (r.stickers ?? []).map((o) => Gu(e, o, n, s)).filter(g),
4775
- images: (r.images ?? []).map((o) => Ku(e, o, s)).filter(g),
4776
- pinnedNumbers: (r.pinnedNumbers ?? []).map((o) => Yu(e, o, n)).filter(g),
4777
- comments: (r.comments ?? []).map((o) => ju(e, o, n)).filter(g)
4778
+ differenceArrows: (r.differenceArrows ?? []).map((o) => Gu(e, o, n)).filter(g),
4779
+ shapes: (r.shapes ?? []).map((o) => Ku(e, o, s)).filter(g),
4780
+ arrows: (r.arrows ?? []).map((o) => Hu(e, o, n, s)).filter(g),
4781
+ textAnnotations: (r.textAnnotations ?? []).map((o) => Uu(e, o, n, s)).filter(g),
4782
+ stickers: (r.stickers ?? []).map((o) => Yu(e, o, n, s)).filter(g),
4783
+ images: (r.images ?? []).map((o) => qu(e, o, s)).filter(g),
4784
+ pinnedNumbers: (r.pinnedNumbers ?? []).map((o) => ju(e, o, n)).filter(g),
4785
+ comments: (r.comments ?? []).map((o) => zu(e, o, n)).filter(g)
4778
4786
  };
4779
- }, Ou = (e, t) => {
4787
+ }, Pu = (e, t) => {
4780
4788
  if (t === void 0) return {};
4781
- if (!Pu(t)) return t;
4789
+ if (!$u(t)) return t;
4782
4790
  const n = /* @__PURE__ */ new Set(), r = (s) => s.id === void 0 ? s : n.has(s.id) ? (e.diagnostics.addWarning({
4783
4791
  code: "ANNOTATION_DUPLICATE_ID",
4784
4792
  message: `More than one annotation declares id "${s.id}" — giving this one a generated id, so references to "${s.id}" point at the first.`,
@@ -4798,15 +4806,15 @@ var Du = {
4798
4806
  pinnedNumbers: t.pinnedNumbers?.map((s) => r(s)),
4799
4807
  comments: t.comments?.map((s) => r(s))
4800
4808
  };
4801
- }, Pu = (e) => {
4809
+ }, $u = (e) => {
4802
4810
  const t = /* @__PURE__ */ new Set();
4803
- for (const n of $u(e))
4811
+ for (const n of Fu(e))
4804
4812
  if (n.id !== void 0) {
4805
4813
  if (t.has(n.id)) return !0;
4806
4814
  t.add(n.id);
4807
4815
  }
4808
4816
  return !1;
4809
- }, $u = (e) => [
4817
+ }, Fu = (e) => [
4810
4818
  ...e.differenceArrows ?? [],
4811
4819
  ...e.shapes ?? [],
4812
4820
  ...e.arrows ?? [],
@@ -4815,7 +4823,7 @@ var Du = {
4815
4823
  ...e.stickers ?? [],
4816
4824
  ...e.pinnedNumbers ?? [],
4817
4825
  ...e.comments ?? []
4818
- ], Fu = (e) => {
4826
+ ], Bu = (e) => {
4819
4827
  const t = /* @__PURE__ */ new Set(), n = [
4820
4828
  e.differenceArrows,
4821
4829
  e.shapes,
@@ -4840,23 +4848,23 @@ var Du = {
4840
4848
  },
4841
4849
  suggestion: "Reference the explicit id of another annotation in the same spec, or set an id on the target."
4842
4850
  }), !1;
4843
- }, Bu = (e, t, n, r) => {
4851
+ }, Uu = (e, t, n, r) => {
4844
4852
  const s = Ue(e, t.at, n, r, t.id);
4845
4853
  return s === null ? null : {
4846
4854
  id: t.id ?? P(),
4847
4855
  content: t.content,
4848
4856
  at: s,
4849
4857
  width: t.width,
4850
- align: t.align ?? Ts.align
4858
+ align: t.align ?? xs.align
4851
4859
  };
4852
- }, Uu = (e, t, n) => {
4860
+ }, Gu = (e, t, n) => {
4853
4861
  const r = xe(e, t.start, n), s = xe(e, t.end, n);
4854
4862
  return r === null || s === null ? null : {
4855
4863
  id: t.id ?? P(),
4856
4864
  start: r,
4857
4865
  end: s,
4858
4866
  label: t.label,
4859
- labelCrossPosition: t.labelCrossPosition ?? Qs.labelCrossPosition
4867
+ labelCrossPosition: t.labelCrossPosition ?? no.labelCrossPosition
4860
4868
  };
4861
4869
  }, xe = (e, t, n) => {
4862
4870
  const r = t.align !== void 0 ? { align: t.align } : {};
@@ -4889,43 +4897,43 @@ var Du = {
4889
4897
  ...o,
4890
4898
  ...t.offset !== void 0 ? { offset: t.offset } : {}
4891
4899
  };
4892
- }, Gu = (e, t, n, r) => {
4900
+ }, Yu = (e, t, n, r) => {
4893
4901
  const s = Ue(e, t.at, n, r, t.id);
4894
4902
  return s === null ? null : {
4895
4903
  id: t.id ?? P(),
4896
4904
  at: s,
4897
4905
  sticker: t.sticker
4898
4906
  };
4899
- }, Yu = (e, t, n) => {
4907
+ }, ju = (e, t, n) => {
4900
4908
  const r = xe(e, t.at, n);
4901
4909
  return r === null ? null : {
4902
4910
  id: t.id ?? P(),
4903
4911
  at: r
4904
4912
  };
4905
- }, ju = (e, t, n) => {
4913
+ }, zu = (e, t, n) => {
4906
4914
  const r = xe(e, t.at, n);
4907
4915
  return r === null ? null : {
4908
4916
  id: t.id ?? P(),
4909
4917
  at: r,
4910
4918
  content: t.content
4911
4919
  };
4912
- }, zu = (e, t, n) => t.region.anchorType === "annotation" && !Lt(e, t.region.ref, n, t.id) ? null : {
4920
+ }, Ku = (e, t, n) => t.region.anchorType === "annotation" && !Lt(e, t.region.ref, n, t.id) ? null : {
4913
4921
  id: t.id ?? P(),
4914
4922
  kind: t.kind ?? Pt.kind,
4915
4923
  zOrder: t.zOrder ?? Pt.zOrder,
4916
- region: qu(t.region)
4917
- }, Ku = (e, t, n) => t.region.anchorType === "annotation" && !Lt(e, t.region.ref, n, t.id) ? null : {
4924
+ region: Wu(t.region)
4925
+ }, qu = (e, t, n) => t.region.anchorType === "annotation" && !Lt(e, t.region.ref, n, t.id) ? null : {
4918
4926
  id: t.id ?? P(),
4919
4927
  src: t.src,
4920
- zOrder: t.zOrder ?? Nt.zOrder,
4928
+ zOrder: t.zOrder ?? Dt.zOrder,
4921
4929
  region: t.region,
4922
- fit: t.fit ?? Nt.fit
4923
- }, qu = (e) => e.anchorType !== "selection" || e.padding !== void 0 ? e : {
4930
+ fit: t.fit ?? Dt.fit
4931
+ }, Wu = (e) => e.anchorType !== "selection" || e.padding !== void 0 ? e : {
4924
4932
  ...e,
4925
- padding: Xs
4933
+ padding: to
4926
4934
  }, vn = (e) => {
4927
4935
  if (e.anchorType === "panel" || e.anchorType === "axis" || e.offset !== void 0 || e.align === void 0) return e;
4928
- const t = Du[e.align];
4936
+ const t = _u[e.align];
4929
4937
  return t === void 0 ? e : {
4930
4938
  ...e,
4931
4939
  offset: {
@@ -4934,16 +4942,16 @@ var Du = {
4934
4942
  unit: "px"
4935
4943
  }
4936
4944
  };
4937
- }, Wu = (e, t, n, r) => {
4945
+ }, Hu = (e, t, n, r) => {
4938
4946
  const s = Ue(e, t.start, n, r, t.id), o = Ue(e, t.end, n, r, t.id);
4939
4947
  return s === null || o === null ? null : {
4940
4948
  id: t.id ?? P(),
4941
4949
  start: vn(s),
4942
4950
  end: vn(o),
4943
- startArrowheadStyle: t.startArrowheadStyle ?? Bt.startArrowheadStyle,
4944
- endArrowheadStyle: t.endArrowheadStyle ?? Bt.endArrowheadStyle
4951
+ startArrowheadStyle: t.startArrowheadStyle ?? Ft.startArrowheadStyle,
4952
+ endArrowheadStyle: t.endArrowheadStyle ?? Ft.endArrowheadStyle
4945
4953
  };
4946
- }, Hu = {
4954
+ }, Xu = {
4947
4955
  parsingLocale: "en-US",
4948
4956
  legend: {
4949
4957
  position: "auto",
@@ -5009,10 +5017,10 @@ var Du = {
5009
5017
  }
5010
5018
  }
5011
5019
  };
5012
- function Xu(e, t) {
5013
- return je({}, Hu, t, e);
5020
+ function Ju(e, t) {
5021
+ return je({}, Xu, t, e);
5014
5022
  }
5015
- var Ju = {
5023
+ var Zu = {
5016
5024
  xLimits: null,
5017
5025
  yLimits: null
5018
5026
  }, tt = {
@@ -5020,11 +5028,11 @@ var Ju = {
5020
5028
  startAngle: 0,
5021
5029
  innerRadius: 0
5022
5030
  };
5023
- function Zu(e) {
5031
+ function Qu(e) {
5024
5032
  const t = e ?? {
5025
5033
  type: "coord",
5026
5034
  coordType: "cartesian"
5027
- }, n = je({}, Ju, t.params ?? {});
5035
+ }, n = je({}, Zu, t.params ?? {});
5028
5036
  switch (t.coordType) {
5029
5037
  case "cartesian":
5030
5038
  case "flip":
@@ -5039,12 +5047,12 @@ function Zu(e) {
5039
5047
  ...n,
5040
5048
  theta: t.params?.theta ?? tt.theta,
5041
5049
  startAngle: t.params?.startAngle ?? tt.startAngle,
5042
- innerRadius: Kn(t.params?.innerRadius ?? tt.innerRadius, 0, 1)
5050
+ innerRadius: qn(t.params?.innerRadius ?? tt.innerRadius, 0, 1)
5043
5051
  }
5044
5052
  };
5045
5053
  }
5046
5054
  }
5047
- function Qu(e, t, n) {
5055
+ function ed(e, t, n) {
5048
5056
  const r = [];
5049
5057
  for (const s of t) {
5050
5058
  if (s.layerId !== void 0 && !n.some((o) => o.id === s.layerId)) {
@@ -5069,7 +5077,7 @@ function Qu(e, t, n) {
5069
5077
  }
5070
5078
  return r;
5071
5079
  }
5072
- var ed = class {
5080
+ var td = class {
5073
5081
  constructor() {
5074
5082
  this.diagnostics = [], this.persistent = [];
5075
5083
  }
@@ -5103,7 +5111,7 @@ var ed = class {
5103
5111
  warnings: n
5104
5112
  };
5105
5113
  }
5106
- }, td = class {
5114
+ }, nd = class {
5107
5115
  constructor(e, t) {
5108
5116
  this.sink = e, this.baseContext = t;
5109
5117
  }
@@ -5131,7 +5139,7 @@ function bn(e) {
5131
5139
  return t.has(r) ? !1 : (t.add(r), !0);
5132
5140
  });
5133
5141
  }
5134
- var nd = {
5142
+ var rd = {
5135
5143
  showDataLabels: !1,
5136
5144
  format: "absolute",
5137
5145
  showStackTotals: !1,
@@ -5145,39 +5153,39 @@ var nd = {
5145
5153
  categoryJustify: "start",
5146
5154
  categoryAlign: "center",
5147
5155
  categoryOffset: 4
5148
- }, Wm = {
5156
+ }, Hm = {
5149
5157
  stat: { type: "identity" },
5150
5158
  position: "identity",
5151
5159
  params: {}
5152
- }, Hm = {
5160
+ }, Xm = {
5153
5161
  stat: { type: "identity" },
5154
5162
  position: "identity",
5155
5163
  params: {
5156
5164
  curve: "linear",
5157
5165
  missingValues: "gap"
5158
5166
  }
5159
- }, Xm = {
5167
+ }, Jm = {
5160
5168
  stat: { type: "identity" },
5161
5169
  position: "stack",
5162
5170
  params: {
5163
5171
  curve: "linear",
5164
5172
  missingValues: "zero"
5165
5173
  }
5166
- }, Jm = {
5174
+ }, Zm = {
5167
5175
  stat: { type: "identity" },
5168
5176
  position: "dodge",
5169
5177
  params: {}
5170
- }, Zm = {
5178
+ }, Qm = {
5171
5179
  stat: { type: "identity" },
5172
5180
  position: "identity",
5173
5181
  interactive: !1,
5174
5182
  params: { labelPosition: "start" }
5175
- }, Qm = {
5183
+ }, ep = {
5176
5184
  stat: { type: "identity" },
5177
5185
  position: "identity",
5178
5186
  params: {}
5179
5187
  };
5180
- function rd(e, t) {
5188
+ function sd(e, t) {
5181
5189
  const n = e ?? (typeof t == "string" ? t : t.type), r = typeof n == "string" ? n : n.type;
5182
5190
  if (r === "smooth") {
5183
5191
  const s = typeof n == "string" ? void 0 : n;
@@ -5200,15 +5208,15 @@ function rd(e, t) {
5200
5208
  }
5201
5209
  return { type: r };
5202
5210
  }
5203
- function sd(e, t, n, r, s, o) {
5204
- const a = s !== void 0 && o !== void 0 ? new td(s, { layerIndex: o }) : s, i = e.get(r.geom), c = r.position ?? i.defaultPosition, l = ld({
5205
- dataLabels: dd(e, t, r, c, n),
5211
+ function od(e, t, n, r, s, o) {
5212
+ const a = s !== void 0 && o !== void 0 ? new nd(s, { layerIndex: o }) : s, i = e.get(r.geom), c = r.position ?? i.defaultPosition, l = ud({
5213
+ dataLabels: md(e, t, r, c, n),
5206
5214
  geom: i,
5207
5215
  position: c,
5208
5216
  coordType: n,
5209
5217
  diagnostics: a
5210
5218
  });
5211
- return cd({
5219
+ return ld({
5212
5220
  diagnostics: a,
5213
5221
  coordType: n,
5214
5222
  geom: i,
@@ -5219,7 +5227,7 @@ function sd(e, t, n, r, s, o) {
5219
5227
  type: r.type,
5220
5228
  geom: r.geom,
5221
5229
  mapping: r.mapping ?? {},
5222
- stat: rd(r.stat, i.defaultStat ?? "identity"),
5230
+ stat: sd(r.stat, i.defaultStat ?? "identity"),
5223
5231
  position: c,
5224
5232
  yScaleType: r.yScaleType ?? "primary",
5225
5233
  params: i.resolveParams({
@@ -5233,23 +5241,23 @@ function sd(e, t, n, r, s, o) {
5233
5241
  dataLabels: l
5234
5242
  };
5235
5243
  }
5236
- function od(e, t, n, r, s) {
5237
- const o = r.map((a, i) => sd(e, t, n, a, s, i));
5238
- return id(e, o);
5244
+ function ad(e, t, n, r, s) {
5245
+ const o = r.map((a, i) => od(e, t, n, a, s, i));
5246
+ return cd(e, o);
5239
5247
  }
5240
- var ad = (e, t, n, r) => r.label !== void 0 ? r.label : cr({
5248
+ var id = (e, t, n, r) => r.label !== void 0 ? r.label : lr({
5241
5249
  geom: e.get(t),
5242
5250
  position: n,
5243
5251
  mapping: r,
5244
5252
  purpose: "label"
5245
- }), id = (e, t) => {
5253
+ }), cd = (e, t) => {
5246
5254
  const n = /* @__PURE__ */ new Set();
5247
5255
  for (const r of t) r.position === "fill" && n.add(r.yScaleType);
5248
- return n.size === 0 ? t : er(t, (r) => {
5256
+ return n.size === 0 ? t : tr(t, (r) => {
5249
5257
  if (!n.has(r.yScaleType) || !e.has(r.geom) || !e.get(r.geom).positionRoles.some((a) => a.axis === "y" && a.role === "scalar")) return r;
5250
- const s = fe(r.mapping.y);
5258
+ const s = ge(r.mapping.y);
5251
5259
  if (!Y(s)) return r;
5252
- const o = Kn(s, 0, 1);
5260
+ const o = qn(s, 0, 1);
5253
5261
  return o === s ? r : {
5254
5262
  ...r,
5255
5263
  mapping: {
@@ -5258,7 +5266,7 @@ var ad = (e, t, n, r) => r.label !== void 0 ? r.label : cr({
5258
5266
  }
5259
5267
  };
5260
5268
  });
5261
- }, cd = ({ diagnostics: e, coordType: t, geom: n, position: r, dataLabels: s }) => {
5269
+ }, ld = ({ diagnostics: e, coordType: t, geom: n, position: r, dataLabels: s }) => {
5262
5270
  if (e === void 0) return;
5263
5271
  const o = n.type === "bar" && t !== "polar";
5264
5272
  if (s.showDataLabels && !n.dataLabelCoordTypes.includes(t)) {
@@ -5269,7 +5277,7 @@ var ad = (e, t, n, r) => r.label !== void 0 ? r.label : cr({
5269
5277
  });
5270
5278
  return;
5271
5279
  }
5272
- s.showDataLabels && s.position === "outside" && o && Ee(r) && e.addWarning({
5280
+ s.showDataLabels && s.position === "outside" && o && Ve(r) && e.addWarning({
5273
5281
  code: "DATA_LABEL_PLACEMENT_COERCED",
5274
5282
  message: "Stacked bar segments only place data labels inside; position 'outside' will render as 'inside'.",
5275
5283
  context: {
@@ -5282,10 +5290,10 @@ var ad = (e, t, n, r) => r.label !== void 0 ? r.label : cr({
5282
5290
  message: "showStackTotals only applies to stacked cartesian bars; it will be ignored.",
5283
5291
  suggestion: "Turn off showStackTotals, or use a bar geom with position 'stack'."
5284
5292
  });
5285
- }, ld = ({ dataLabels: e, geom: t, position: n, coordType: r, diagnostics: s }) => {
5293
+ }, ud = ({ dataLabels: e, geom: t, position: n, coordType: r, diagnostics: s }) => {
5286
5294
  const { justify: o, showDataLabels: a } = e;
5287
5295
  if (o !== "panelStart" && o !== "panelEnd") return e;
5288
- const i = ud(t, n, r);
5296
+ const i = dd(t, n, r);
5289
5297
  if (i === null) return e;
5290
5298
  const c = o === "panelEnd" ? "end" : "start";
5291
5299
  return a && s?.addWarning({
@@ -5300,25 +5308,25 @@ var ad = (e, t, n, r) => r.label !== void 0 ? r.label : cr({
5300
5308
  ...e,
5301
5309
  justify: c
5302
5310
  };
5303
- }, ud = (e, t, n) => n === "polar" ? "Panel-edge anchors do not apply under polar coords" : e.type === "bar" && Ee(t) ? "Stacked bar segments would all pin their labels to the same panel edge" : null, dd = (e, t, n, r, s) => {
5311
+ }, dd = (e, t, n) => n === "polar" ? "Panel-edge anchors do not apply under polar coords" : e.type === "bar" && Ve(t) ? "Stacked bar segments would all pin their labels to the same panel edge" : null, md = (e, t, n, r, s) => {
5304
5312
  const o = {
5305
5313
  ...t,
5306
5314
  ...n.mapping
5307
- }, a = ad(e, n.geom, r, o), i = e.get(n.geom);
5315
+ }, a = id(e, n.geom, r, o), i = e.get(n.geom);
5308
5316
  return {
5309
- ...je({}, nd, i.resolveDataLabelDefaults?.(r) ?? {}, i.dataLabels?.[s] ?? {}, n.dataLabels ?? {}),
5317
+ ...je({}, rd, i.resolveDataLabelDefaults?.(r) ?? {}, i.dataLabels?.[s] ?? {}, n.dataLabels ?? {}),
5310
5318
  labelSource: a
5311
5319
  };
5312
- }, ts = (e) => {
5320
+ }, ns = (e) => {
5313
5321
  const t = {
5314
5322
  tokens: {},
5315
5323
  defaults: [],
5316
5324
  overrides: []
5317
5325
  };
5318
- for (const n of md(e))
5326
+ for (const n of pd(e))
5319
5327
  Object.assign(t.tokens, n.tokens), t.defaults.push(...n.defaults ?? []), t.overrides.push(...n.overrides ?? []);
5320
5328
  return t;
5321
- }, md = (e) => {
5329
+ }, pd = (e) => {
5322
5330
  const t = [], n = /* @__PURE__ */ new Set(), r = e === void 0 ? [] : [e];
5323
5331
  for (; r.length > 0; ) {
5324
5332
  const s = r.pop();
@@ -5329,14 +5337,14 @@ var ad = (e, t, n, r) => r.label !== void 0 ? r.label : cr({
5329
5337
  }
5330
5338
  return t.reverse();
5331
5339
  };
5332
- function pd(e, t) {
5333
- const n = Zu(t.coords), r = od(e.geomRegistry, t.mapping, n.coordType, t.layers, e.diagnostics), s = Tu(e, {
5334
- data: Nu(t.data, t.transforms),
5340
+ function fd(e, t) {
5341
+ const n = Qu(t.coords), r = ad(e.geomRegistry, t.mapping, n.coordType, t.layers, e.diagnostics), s = Au(e, {
5342
+ data: Du(t.data, t.transforms),
5335
5343
  scales: t.scales,
5336
5344
  layers: r,
5337
5345
  mapping: t.mapping,
5338
5346
  coords: n
5339
- }), o = Xu(t.config, e.theme?.config), a = Qu(e, t.highlights, r), i = _u(e, t.annotations, r), c = ts(t.styles);
5347
+ }), o = Ju(t.config, e.theme?.config), a = ed(e, t.highlights, r), i = Ou(e, t.annotations, r), c = ns(t.styles);
5340
5348
  return {
5341
5349
  data: t.data,
5342
5350
  mapping: t.mapping,
@@ -5350,17 +5358,17 @@ function pd(e, t) {
5350
5358
  config: o
5351
5359
  };
5352
5360
  }
5353
- var fd = class {
5361
+ var gd = class {
5354
5362
  constructor(e) {
5355
5363
  this.container = e;
5356
5364
  }
5357
5365
  compile({ spec: e, dataset: t }) {
5358
- return pd(this.container, {
5366
+ return fd(this.container, {
5359
5367
  ...e,
5360
5368
  data: t
5361
5369
  });
5362
5370
  }
5363
- }, gd = () => {
5371
+ }, hd = () => {
5364
5372
  let e = {}, t = null;
5365
5373
  return {
5366
5374
  reset: () => {
@@ -5379,7 +5387,7 @@ var fd = class {
5379
5387
  }
5380
5388
  }
5381
5389
  };
5382
- }, hd = class {
5390
+ }, yd = class {
5383
5391
  constructor(e) {
5384
5392
  this.registry = e;
5385
5393
  }
@@ -5391,16 +5399,16 @@ var fd = class {
5391
5399
  hasDiscreteXScale: t.hasDiscreteXScale,
5392
5400
  params: t.params
5393
5401
  });
5394
- return vd(n, n.resolveComputedAesthetics(e, t.params), r, t.requiredAesthetics), {
5402
+ return bd(n, n.resolveComputedAesthetics(e, t.params), r, t.requiredAesthetics), {
5395
5403
  data: r.data,
5396
5404
  mapping: {
5397
- ...yd(t, r.data),
5405
+ ...vd(t, r.data),
5398
5406
  ...r.mapping
5399
5407
  }
5400
5408
  };
5401
5409
  }
5402
5410
  };
5403
- function yd({ data: e, mapping: t }, n) {
5411
+ function vd({ data: e, mapping: t }, n) {
5404
5412
  const r = {};
5405
5413
  for (const [s, o] of Object.entries(t)) {
5406
5414
  const a = S(o);
@@ -5408,7 +5416,7 @@ function yd({ data: e, mapping: t }, n) {
5408
5416
  }
5409
5417
  return r;
5410
5418
  }
5411
- function vd(e, t, { data: n, mapping: r }, s) {
5419
+ function bd(e, t, { data: n, mapping: r }, s) {
5412
5420
  for (const o of s) {
5413
5421
  if (!t.has(o)) continue;
5414
5422
  const a = r[o], i = S(a);
@@ -5424,20 +5432,20 @@ function vd(e, t, { data: n, mapping: r }, s) {
5424
5432
  });
5425
5433
  }
5426
5434
  }
5427
- var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5428
- for (const n of ns) {
5429
- const r = Sd(e, n, t);
5435
+ var rs = Object.keys(Ee), tp = (e) => Object.hasOwn(Ee, e), np = (e, t) => {
5436
+ for (const n of rs) {
5437
+ const r = Td(e, n, t);
5430
5438
  if (r) return r;
5431
5439
  }
5432
5440
  return null;
5433
- }, rs = (e, t) => e[Ie[t]], bd = (e, t, n) => ({
5441
+ }, ss = (e, t) => e[Ee[t]], Sd = (e, t, n) => ({
5434
5442
  ...e,
5435
- [Ie[t]]: n
5436
- }), np = (e, t) => {
5437
- const n = rs(e, t.kind);
5438
- return bd(e, t.kind, [...n.slice(0, t.index), ...n.slice(t.index + 1)]);
5439
- }, Sd = (e, t, n) => {
5440
- const r = rs(e, t), s = r.findIndex((a) => a.id === n), o = r[s];
5443
+ [Ee[t]]: n
5444
+ }), rp = (e, t) => {
5445
+ const n = ss(e, t.kind);
5446
+ return Sd(e, t.kind, [...n.slice(0, t.index), ...n.slice(t.index + 1)]);
5447
+ }, Td = (e, t, n) => {
5448
+ const r = ss(e, t), s = r.findIndex((a) => a.id === n), o = r[s];
5441
5449
  return o === void 0 ? null : {
5442
5450
  kind: t,
5443
5451
  index: s,
@@ -5446,13 +5454,13 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5446
5454
  }, Sn = Object.freeze({
5447
5455
  light: "#898373",
5448
5456
  dark: "#9F9886"
5449
- }), Td = {
5450
- graphBackground: Dt,
5457
+ }), Ad = {
5458
+ graphBackground: Ot,
5451
5459
  graphBorder: Object.freeze({
5452
5460
  light: "rgba(58, 56, 51, 0.15)",
5453
5461
  dark: "rgba(237, 231, 218, 0.15)"
5454
5462
  }),
5455
- geom: Rs,
5463
+ geom: Vs,
5456
5464
  geomBorder: Object.freeze({
5457
5465
  light: "rgba(58, 56, 51, 0.55)",
5458
5466
  dark: "rgba(237, 231, 218, 0.55)"
@@ -5470,7 +5478,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5470
5478
  light: "#E1DAC9",
5471
5479
  dark: "#373531"
5472
5480
  }),
5473
- hoverStroke: Vs,
5481
+ hoverStroke: Rs,
5474
5482
  hoverGuideFill: Object.freeze({
5475
5483
  light: "#E7E1D2",
5476
5484
  dark: "#2B2A27"
@@ -5503,7 +5511,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5503
5511
  light: "#3A3833",
5504
5512
  dark: "#EDE7DA"
5505
5513
  }),
5506
- differenceLabelBackground: Dt,
5514
+ differenceLabelBackground: Ot,
5507
5515
  trendPositive: {
5508
5516
  light: "#06B299",
5509
5517
  dark: "#0AC600"
@@ -5513,23 +5521,23 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5513
5521
  dark: "#CB3333"
5514
5522
  },
5515
5523
  trendNeutral: Sn
5516
- }, Ad = Mn(Ln()), kt = Object.freeze({
5517
- tokens: Object.freeze(Td),
5518
- defaults: Object.freeze(Ad),
5524
+ }, xd = Nn(jn()), kt = Object.freeze({
5525
+ tokens: Object.freeze(Ad),
5526
+ defaults: Object.freeze(xd),
5519
5527
  overrides: Object.freeze([])
5520
- }), xd = class extends ne {
5528
+ }), wd = class extends ne {
5521
5529
  constructor(e) {
5522
5530
  super(), this.container = e;
5523
5531
  }
5524
5532
  compile(e) {
5525
- const t = super.compile(e), n = Wd(this.container.geomRegistry);
5533
+ const t = super.compile(e), n = Hd(this.container.geomRegistry);
5526
5534
  for (const [r, s] of this.readStylesheets(e.styles)) {
5527
5535
  const o = [
5528
- ...Yd(r, t, s),
5529
- ...jd(r, s),
5536
+ ...jd(r, t, s),
5530
5537
  ...zd(r, s),
5538
+ ...Kd(r, s),
5531
5539
  ...n(r, s),
5532
- ...Hd(r, s)
5540
+ ...Xd(r, s)
5533
5541
  ];
5534
5542
  for (const a of o) this.container.diagnostics.addWarning(a);
5535
5543
  }
@@ -5545,12 +5553,12 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5545
5553
  ];
5546
5554
  }
5547
5555
  compileLayer(e, t) {
5548
- const n = Ld({
5556
+ const n = kd({
5549
5557
  layer: e,
5550
5558
  layerIndex: t.layers.indexOf(e),
5551
5559
  styles: t.styles,
5552
5560
  parsingLocale: t.config.parsingLocale,
5553
- styleTarget: os(this.container.geomRegistry, e.geom),
5561
+ styleTarget: as(this.container.geomRegistry, e.geom),
5554
5562
  coord: t.coord,
5555
5563
  theme: this.container.theme?.styles,
5556
5564
  geomColor: t.geomColor
@@ -5564,7 +5572,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5564
5572
  const t = this.container.theme?.styles;
5565
5573
  return t === void 0 ? [[e, "spec"]] : [[t, "theme"], [e, "spec"]];
5566
5574
  }
5567
- }, wd = class extends te {
5575
+ }, Cd = class extends te {
5568
5576
  constructor(e) {
5569
5577
  super(), this.container = e;
5570
5578
  }
@@ -5582,32 +5590,32 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5582
5590
  ];
5583
5591
  }
5584
5592
  run(e) {
5585
- return Md(e.styles, {
5593
+ return Ld(e.styles, {
5586
5594
  coord: e.coord,
5587
5595
  theme: this.container.theme?.styles,
5588
5596
  geomColor: e.geomColor
5589
5597
  });
5590
5598
  }
5591
- }, pt = new St(), Cd = new Set(Js), Id = /* @__PURE__ */ new WeakMap(), Ed = /* @__PURE__ */ new WeakMap(), Tn = {
5599
+ }, pt = new St(), Id = new Set(ws), Ed = /* @__PURE__ */ new WeakMap(), Vd = /* @__PURE__ */ new WeakMap(), Tn = {
5592
5600
  stateless: 0,
5593
5601
  dimmed: 1,
5594
5602
  hovered: 2
5595
- }, ss = {
5603
+ }, os = {
5596
5604
  overpaint: {
5597
5605
  conditions: ["where"],
5598
5606
  reason: "an overpaint covers the layer's shapes as one"
5599
5607
  },
5600
5608
  maxWidth: {
5601
5609
  conditions: ["where", "state"],
5602
- reason: "a layer's bars share one cap"
5610
+ reason: "a layer's bars share one cap, which the browser fits to every column as the chart resizes"
5603
5611
  }
5604
- }, Vd = Object.keys(ss), Md = (e, { coord: t = "cartesian", theme: n, geomColor: r } = {}) => {
5605
- const s = [], o = fs(e, n, r), a = {
5606
- ...Rd(),
5612
+ }, Md = Object.keys(os), Ld = (e, { coord: t = "cartesian", theme: n, geomColor: r } = {}) => {
5613
+ const s = [], o = gs(e, n, r), a = {
5614
+ ...Nd(),
5607
5615
  warnings: s
5608
5616
  }, i = (c, l, u, d) => {
5609
- if (Me(c) || !ds(c.select, t)) return;
5610
- const m = c.id === void 0 ? {} : { styleEntryId: c.id }, p = c.select.target, f = Nd(c.select);
5617
+ if (Me(c) || !ms(c.select, t)) return;
5618
+ const m = c.id === void 0 ? {} : { styleEntryId: c.id }, p = c.select.target, f = Dd(c.select);
5611
5619
  if (f.status === "unknown-target") {
5612
5620
  s.push({
5613
5621
  code: "INVALID_STYLE_RULE",
@@ -5704,7 +5712,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5704
5712
  return;
5705
5713
  }
5706
5714
  }
5707
- const T = ps({
5715
+ const T = fs({
5708
5716
  declarations: c.declarations,
5709
5717
  vocabulary: y.vocabulary,
5710
5718
  tokens: o,
@@ -5715,7 +5723,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5715
5723
  });
5716
5724
  if (Object.keys(T).length === 0) return;
5717
5725
  const A = y.select.target;
5718
- Gn(A) && a[A][l].push({
5726
+ Un(A) && a[A][l].push({
5719
5727
  select: c.select,
5720
5728
  declarations: T,
5721
5729
  origin: d
@@ -5740,17 +5748,17 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5740
5748
  ...c.id === void 0 ? {} : { id: c.id }
5741
5749
  });
5742
5750
  }), a;
5743
- }, rp = (e) => pt.has(e) ? pt.get(e).styleTarget : void 0, Ld = (e) => {
5744
- const { layer: t, layerIndex: n, styles: r, parsingLocale: s, styleTarget: o, coord: a = "cartesian", theme: i, geomColor: c } = e, l = It(t, s), u = [], d = fs(r, i, c), m = (f) => f === t.geom ? o : void 0, p = (f, y, b = "spec") => {
5751
+ }, sp = (e) => pt.has(e) ? pt.get(e).styleTarget : void 0, kd = (e) => {
5752
+ const { layer: t, layerIndex: n, styles: r, parsingLocale: s, styleTarget: o, coord: a = "cartesian", theme: i, geomColor: c } = e, l = It(t, s), u = [], d = gs(r, i, c), m = (f) => f === t.geom ? o : void 0, p = (f, y, b = "spec") => {
5745
5753
  const v = [];
5746
5754
  return f.forEach((T, A) => {
5747
- if (!Me(T) || !ds(T.select, a)) return;
5755
+ if (!Me(T) || !ms(T.select, a)) return;
5748
5756
  const x = T.select.kind;
5749
5757
  if (x !== void 0 && x !== t.geom || T.select.layer !== void 0 && T.select.layer !== t.id) return;
5750
5758
  const I = Ce(b, y, A);
5751
- if (ms(T, I, m) !== void 0) return;
5759
+ if (ps(T, I, m) !== void 0) return;
5752
5760
  const R = T.when?.state;
5753
- if (R !== void 0 && !us(R)) return;
5761
+ if (R !== void 0 && !ds(R)) return;
5754
5762
  const $ = T.id === void 0 ? {} : { styleEntryId: T.id }, z = b === "theme" ? gt(T, A) : {
5755
5763
  list: y,
5756
5764
  index: A,
@@ -5772,7 +5780,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5772
5780
  return;
5773
5781
  }
5774
5782
  }
5775
- const V = ls({
5783
+ const V = us({
5776
5784
  select: T.select,
5777
5785
  declarations: T.declarations,
5778
5786
  layerGeom: t.geom,
@@ -5793,9 +5801,9 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5793
5801
  suggestion: "Declare 'overpaint' without a state or in the 'hovered' state."
5794
5802
  }), delete V.overpaint);
5795
5803
  const L = [];
5796
- for (const N of Vd) {
5804
+ for (const N of Md) {
5797
5805
  if (V[N] === void 0) continue;
5798
- const { conditions: K, reason: gs } = ss[N], He = K.find((hs) => T.when?.[hs] !== void 0);
5806
+ const { conditions: K, reason: hs } = os[N], He = K.find((ys) => T.when?.[ys] !== void 0);
5799
5807
  He !== void 0 && (L.push(N), u.push({
5800
5808
  code: "INVALID_STYLE_RULE",
5801
5809
  message: `Style ${I}: '${N}' does not take '${He}'; the declaration is ignored.`,
@@ -5804,7 +5812,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5804
5812
  layerIndex: n,
5805
5813
  ...$
5806
5814
  },
5807
- suggestion: `Remove '${He}': ${gs}.`
5815
+ suggestion: `Remove '${He}': ${hs}.`
5808
5816
  }));
5809
5817
  }
5810
5818
  const Z = L.length === 0 ? V : Object.fromEntries(Object.entries(V).filter(([N]) => !L.includes(N)));
@@ -5824,19 +5832,19 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5824
5832
  };
5825
5833
  return {
5826
5834
  defaults: [
5827
- ...Gd(t.geom, o, d, u),
5835
+ ...Yd(t.geom, o, d, u),
5828
5836
  ...p(i?.defaults ?? [], "defaults", "theme"),
5829
5837
  ...p(r.defaults, "defaults")
5830
5838
  ],
5831
5839
  overrides: [...p(i?.overrides ?? [], "overrides", "theme"), ...p(r.overrides, "overrides")],
5832
5840
  warnings: u,
5833
- ...Pd(t.geom, o),
5834
- dashPresets: o?.observation?.dashPresets ?? Fn.line
5841
+ ...$d(t.geom, o),
5842
+ dashPresets: o?.observation?.dashPresets ?? Pn.line
5835
5843
  };
5836
- }, os = (e, t) => e.has(t) ? e.get(t).styleTarget : void 0, kd = (e) => (t) => os(e, t), Rd = () => {
5844
+ }, as = (e, t) => e.has(t) ? e.get(t).styleTarget : void 0, Rd = (e) => (t) => as(e, t), Nd = () => {
5837
5845
  const e = {};
5838
5846
  for (const t of Object.keys(X))
5839
- Gn(t) && (e[t] = {
5847
+ Un(t) && (e[t] = {
5840
5848
  defaults: [],
5841
5849
  overrides: []
5842
5850
  });
@@ -5849,8 +5857,8 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5849
5857
  s !== void 0 && n.push(s);
5850
5858
  }
5851
5859
  return n;
5852
- }, An = (e) => Object.keys(e.vocabulary).length === 0 && e.children !== void 0, Nd = (e) => {
5853
- const t = rt(e);
5860
+ }, An = (e) => Object.keys(e.vocabulary).length === 0 && e.children !== void 0, Dd = (e) => {
5861
+ const t = nt(e);
5854
5862
  if (t !== void 0) return An(t) ? {
5855
5863
  status: "namespace",
5856
5864
  node: t
@@ -5858,10 +5866,10 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5858
5866
  status: "found",
5859
5867
  node: t
5860
5868
  };
5861
- const n = rt({ target: e.target });
5869
+ const n = nt({ target: e.target });
5862
5870
  if (n === void 0) return { status: "unknown-target" };
5863
5871
  let r = n;
5864
- for (const s of Es) {
5872
+ for (const s of Ds) {
5865
5873
  const o = e[s];
5866
5874
  if (o === void 0) continue;
5867
5875
  const a = r.children === void 0 ? void 0 : Object.values(r.children).find((i) => i.select[s] === o);
@@ -5883,30 +5891,30 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5883
5891
  }, Rt = (e) => {
5884
5892
  const t = e.options ?? [];
5885
5893
  return t.includes("where") || t.includes("state");
5886
- }, Dd = (e, t) => {
5887
- const n = e === "geom" ? pt.getAll().find((r) => r.styleTarget !== void 0 && ro(r.styleTarget)[t] !== void 0)?.type : e === "annotation" ? Object.entries(X.annotation.children).find(([, r]) => r.vocabulary[t] !== void 0)?.[0] : void 0;
5894
+ }, _d = (e, t) => {
5895
+ const n = e === "geom" ? pt.getAll().find((r) => r.styleTarget !== void 0 && Ws(r.styleTarget)[t] !== void 0)?.type : e === "annotation" ? Object.entries(X.annotation.children).find(([, r]) => r.vocabulary[t] !== void 0)?.[0] : void 0;
5888
5896
  return n === void 0 ? void 0 : `style.${e}.${n}`;
5889
- }, Me = (e) => e.select.target === "geom", _d = (e, t) => e !== void 0 && Object.hasOwn(e, t) ? e[t] : void 0, as = (e, t, n, r) => {
5897
+ }, Me = (e) => e.select.target === "geom", Od = (e, t) => e !== void 0 && Object.hasOwn(e, t) ? e[t] : void 0, is = (e, t, n, r) => {
5890
5898
  const s = e.get(n) ?? /* @__PURE__ */ new Map();
5891
5899
  e.set(n, s);
5892
5900
  const o = s.get(t);
5893
5901
  if (o !== void 0) return o;
5894
5902
  const a = r();
5895
5903
  return s.set(t, a), a;
5896
- }, is = (e, t) => as(Id, e, t, () => $s(e, t)), we = (e, t) => {
5904
+ }, cs = (e, t) => is(Ed, e, t, () => As(e, t)), we = (e, t) => {
5897
5905
  const { kind: n, part: r } = e;
5898
- if (n === void 0) return rt({
5906
+ if (n === void 0) return nt({
5899
5907
  target: "geom",
5900
5908
  part: r
5901
5909
  });
5902
5910
  const s = t(n);
5903
5911
  if (s === void 0) return;
5904
- const o = is(n, s);
5905
- return r === void 0 ? o : _d(o.children, r);
5906
- }, Od = (e, t) => {
5912
+ const o = cs(n, s);
5913
+ return r === void 0 ? o : Od(o.children, r);
5914
+ }, Pd = (e, t) => {
5907
5915
  const n = we(e, () => t);
5908
5916
  return n === void 0 || Rt(n);
5909
- }, cs = (e, t) => [e, t].filter((n) => n !== void 0).join(" "), Pd = (e, t) => {
5917
+ }, ls = (e, t) => [e, t].filter((n) => n !== void 0).join(" "), $d = (e, t) => {
5910
5918
  const n = we({ kind: e }, () => t), r = {};
5911
5919
  for (const s of Object.values(n?.children ?? {})) s.select.part !== void 0 && (r[s.select.part] = {
5912
5920
  vocabulary: s.vocabulary,
@@ -5919,29 +5927,38 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5919
5927
  },
5920
5928
  parts: r
5921
5929
  };
5922
- }, xn = (e, t) => we(e, () => t)?.vocabulary ?? X.geom.vocabulary, $d = (e, t) => {
5923
- const n = {};
5924
- for (const r of Object.keys(e)) {
5925
- const s = e[r];
5926
- s === void 0 || t[r] === void 0 || (n[r] = s);
5930
+ }, xn = (e, t) => we(e, () => t)?.vocabulary ?? X.geom.vocabulary, Fd = (e, { entry: t, kind: n }, r) => {
5931
+ const s = {};
5932
+ for (const o of Object.keys(e)) {
5933
+ const a = e[o], i = n[o];
5934
+ if (a === void 0 || i === void 0) continue;
5935
+ if (i === t[o]) {
5936
+ s[o] = a;
5937
+ continue;
5938
+ }
5939
+ const c = En[i](a, r);
5940
+ c.status === "accepted" && (s[o] = c.value);
5927
5941
  }
5928
- return n;
5929
- }, ls = (e) => {
5930
- const t = ps({
5942
+ return s;
5943
+ }, us = (e) => {
5944
+ const t = xn(e.select, e.styleTarget), n = fs({
5931
5945
  declarations: e.declarations,
5932
- vocabulary: xn(e.select, e.styleTarget),
5946
+ vocabulary: t,
5933
5947
  tokens: e.tokens,
5934
5948
  location: e.location,
5935
5949
  origin: e.origin,
5936
5950
  warnings: e.warnings,
5937
5951
  entryTarget: "geom"
5938
5952
  });
5939
- return e.select.part !== void 0 ? t : $d(t, xn({ kind: e.layerGeom }, e.styleTarget));
5940
- }, Fd = (e, t) => as(Ed, e, t, () => Mn(Ln([is(e, t)]))), Bd = (e, t) => Tn[e.state ?? "stateless"] - Tn[t.state ?? "stateless"], Ud = (e, t) => t === void 0 ? `builtin ${e}` : `builtin ${e}.${t}`, Gd = (e, t, n, r) => {
5953
+ return e.select.part !== void 0 ? n : Fd(n, {
5954
+ entry: t,
5955
+ kind: xn({ kind: e.layerGeom }, e.styleTarget)
5956
+ }, e.tokens);
5957
+ }, Bd = (e, t) => is(Vd, e, t, () => Nn(jn([cs(e, t)]))), Ud = (e, t) => Tn[e.state ?? "stateless"] - Tn[t.state ?? "stateless"], Gd = (e, t) => t === void 0 ? `builtin ${e}` : `builtin ${e}.${t}`, Yd = (e, t, n, r) => {
5941
5958
  const s = [], o = { list: "builtin" }, a = (i, c, l, u) => {
5942
5959
  if (i.kind !== void 0 && i.kind !== e) return;
5943
- if (l !== void 0 && !Od(i, t)) {
5944
- const p = cs(e, i.part);
5960
+ if (l !== void 0 && !Pd(i, t)) {
5961
+ const p = ls(e, i.part);
5945
5962
  r.push({
5946
5963
  code: "INVALID_STYLE_RULE",
5947
5964
  message: `Style ${u} ignored: a ${p} entry takes no conditions.`,
@@ -5953,7 +5970,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5953
5970
  });
5954
5971
  return;
5955
5972
  }
5956
- const d = ls({
5973
+ const d = us({
5957
5974
  select: i,
5958
5975
  declarations: c,
5959
5976
  layerGeom: e,
@@ -5975,11 +5992,11 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5975
5992
  if (kt.defaults.forEach((i, c) => {
5976
5993
  Me(i) && a(i.select, i.declarations, i.when?.state, `builtin[${c}]`);
5977
5994
  }), t === void 0) return s;
5978
- for (const i of Fd(e, t)) a(i.select, i.declarations, i.when?.state, Ud(e, i.select.part));
5979
- return s.sort(Bd);
5995
+ for (const i of Bd(e, t)) a(i.select, i.declarations, i.when?.state, Gd(e, i.select.part));
5996
+ return s.sort(Ud);
5980
5997
  }, Ce = (e, t, n) => `${e === "theme" ? "theme " : ""}${t}[${n}]`, Le = (e, t, n) => {
5981
5998
  e.defaults.forEach((r, s) => n(r, Ce(t, "defaults", s))), e.overrides.forEach((r, s) => n(r, Ce(t, "overrides", s)));
5982
- }, Yd = (e, t, n = "spec") => {
5999
+ }, jd = (e, t, n = "spec") => {
5983
6000
  const r = new Set(t.map((o) => o.id)), s = [];
5984
6001
  return Le(e, n, (o, a) => {
5985
6002
  const i = o.select;
@@ -5997,7 +6014,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
5997
6014
  });
5998
6015
  }), s;
5999
6016
  }, wn = (e, t, n = "spec") => {
6000
- const r = new Map(ns.flatMap((o) => t[Ie[o]].map((a) => [a.id, o]))), s = [];
6017
+ const r = new Map(rs.flatMap((o) => t[Ee[o]].map((a) => [a.id, o]))), s = [];
6001
6018
  return Le(e, n, (o, a) => {
6002
6019
  const i = o.select;
6003
6020
  if (i.target !== "annotation") return;
@@ -6034,12 +6051,12 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6034
6051
  suggestion: `Set 'kind' to '${u}', or omit it to address the annotation with the shared vocabulary.`
6035
6052
  });
6036
6053
  }), s;
6037
- }, jd = (e, t = "spec") => {
6054
+ }, zd = (e, t = "spec") => {
6038
6055
  const n = [];
6039
6056
  return Le(e, t, (r, s) => {
6040
6057
  if (!Me(r)) return;
6041
6058
  const o = r.when?.state;
6042
- o === void 0 || us(o) || n.push({
6059
+ o === void 0 || ds(o) || n.push({
6043
6060
  code: "INVALID_STYLE_RULE",
6044
6061
  message: `Style ${s} scopes to unknown state '${o}'.`,
6045
6062
  context: {
@@ -6047,14 +6064,14 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6047
6064
  actual: String(o),
6048
6065
  ...r.id === void 0 ? {} : { styleEntryId: r.id }
6049
6066
  },
6050
- suggestion: `Set 'state' to one of ${Dn.map((a) => `'${a}'`).join(", ")}.`
6067
+ suggestion: `Set 'state' to one of ${Rn.map((a) => `'${a}'`).join(", ")}.`
6051
6068
  });
6052
6069
  }), n;
6053
- }, us = (e) => Dn.includes(e), ds = (e, t) => e.coord === void 0 || e.coord === t, gt = (e, t) => ({
6070
+ }, ds = (e) => Rn.includes(e), ms = (e, t) => e.coord === void 0 || e.coord === t, gt = (e, t) => ({
6054
6071
  list: "theme",
6055
6072
  index: t,
6056
6073
  ...e.id === void 0 ? {} : { id: e.id }
6057
- }), zd = (e, t = "spec") => {
6074
+ }), Kd = (e, t = "spec") => {
6058
6075
  const n = [];
6059
6076
  return Le(e, t, (r, s) => {
6060
6077
  const o = r.select.coord;
@@ -6069,7 +6086,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6069
6086
  suggestion: `Set 'coord' to one of ${_t.map((a) => `'${a}'`).join(", ")}, or omit it.`
6070
6087
  });
6071
6088
  }), n;
6072
- }, Kd = (e, t, n) => e === void 0 ? `Set 'kind' to the geom declaring '${t}' — a part is addressed on the kind that has it.` : n.length === 0 ? `Remove 'part' — ${e} has none.` : `Set 'part' to one of ${n.map((r) => `'${r}'`).join(", ")}, or omit it.`, ms = (e, t, n) => {
6089
+ }, qd = (e, t, n) => e === void 0 ? `Set 'kind' to the geom declaring '${t}' — a part is addressed on the kind that has it.` : n.length === 0 ? `Remove 'part' — ${e} has none.` : `Set 'part' to one of ${n.map((r) => `'${r}'`).join(", ")}, or omit it.`, ps = (e, t, n) => {
6073
6090
  const { kind: r, part: s } = e.select;
6074
6091
  if (s === void 0) return;
6075
6092
  const o = e.id === void 0 ? {} : { styleEntryId: e.id }, a = we({
@@ -6086,11 +6103,11 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6086
6103
  actual: s,
6087
6104
  ...o
6088
6105
  },
6089
- suggestion: Kd(r, s, c)
6106
+ suggestion: qd(r, s, c)
6090
6107
  };
6091
6108
  }
6092
6109
  if (e.when !== void 0 && !Rt(a)) {
6093
- const i = cs(r, s);
6110
+ const i = ls(r, s);
6094
6111
  return {
6095
6112
  code: "INVALID_STYLE_RULE",
6096
6113
  message: `Style ${t} ignored: a ${i} entry takes no conditions.`,
@@ -6101,7 +6118,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6101
6118
  suggestion: `Remove the 'when' clause — the ${i} is styled as a whole.`
6102
6119
  };
6103
6120
  }
6104
- }, qd = (e, t, n) => {
6121
+ }, Wd = (e, t, n) => {
6105
6122
  const { kind: r } = e.select;
6106
6123
  if (r === void 0 || n.has(r)) return;
6107
6124
  const s = n.getAll().map((o) => `'${o.type}'`);
@@ -6115,20 +6132,20 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6115
6132
  },
6116
6133
  suggestion: `Set 'kind' to one of ${s.join(", ")}, or omit it to reach every geom.`
6117
6134
  };
6118
- }, Wd = (e) => {
6119
- const t = kd(e);
6135
+ }, Hd = (e) => {
6136
+ const t = Rd(e);
6120
6137
  return (n, r = "spec") => {
6121
6138
  const s = [];
6122
6139
  return Le(n, r, (o, a) => {
6123
6140
  if (!Me(o)) return;
6124
- const i = qd(o, a, e) ?? ms(o, a, t);
6141
+ const i = Wd(o, a, e) ?? ps(o, a, t);
6125
6142
  i !== void 0 && s.push(i);
6126
6143
  }), s;
6127
6144
  };
6128
- }, Hd = (e, t = "spec") => {
6145
+ }, Xd = (e, t = "spec") => {
6129
6146
  const n = [];
6130
6147
  for (const [r, s] of Object.entries(e.tokens))
6131
- ys(s) || n.push({
6148
+ _s(s) || n.push({
6132
6149
  code: "INVALID_STYLE_RULE",
6133
6150
  message: `${t === "theme" ? "Theme style" : "Style"} token '${r}' has an invalid value: ${H(s)}.`,
6134
6151
  context: {
@@ -6138,7 +6155,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6138
6155
  suggestion: `Set '${r}' to a non-empty color string or a { light, dark } pair of colors.`
6139
6156
  });
6140
6157
  return n;
6141
- }, H = (e) => typeof e == "object" && e !== null ? JSON.stringify(e) : String(e), ps = (e) => {
6158
+ }, H = (e) => typeof e == "object" && e !== null ? JSON.stringify(e) : String(e), fs = (e) => {
6142
6159
  const { declarations: t, vocabulary: n, tokens: r, location: s, origin: o, warnings: a, entryTarget: i } = e, c = {}, l = o.list === "builtin" || o.id === void 0 ? {} : { styleEntryId: o.id }, u = (f, y) => {
6143
6160
  c[f] = y;
6144
6161
  }, d = (f, y, b) => {
@@ -6165,7 +6182,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6165
6182
  suggestion: `Declare '${y}' in the stylesheet's tokens.`
6166
6183
  });
6167
6184
  }, p = (f) => {
6168
- const y = Cd.has(f), b = Dd(i, f), v = b === void 0 ? `Declare '${f}' on a target whose vocabulary carries it.` : `Declare '${f}' on an entry whose kind supports it (e.g. ${b}).`;
6185
+ const y = Id.has(f), b = _d(i, f), v = b === void 0 ? `Declare '${f}' on a target whose vocabulary carries it.` : `Declare '${f}' on an entry whose kind supports it (e.g. ${b}).`;
6169
6186
  a.push({
6170
6187
  code: "INVALID_STYLE_RULE",
6171
6188
  message: `Style ${s} declaration '${f}' ignored: ${y ? "not in this entry's vocabulary" : "not a style property"}.`,
@@ -6184,7 +6201,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6184
6201
  p(f);
6185
6202
  continue;
6186
6203
  }
6187
- const v = to[b](y, r);
6204
+ const v = En[b](y, r);
6188
6205
  switch (v.status) {
6189
6206
  case "accepted":
6190
6207
  u(f, v.value);
@@ -6202,12 +6219,12 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6202
6219
  }
6203
6220
  }
6204
6221
  return c;
6205
- }, fs = (e, t, n) => ({
6222
+ }, gs = (e, t, n) => ({
6206
6223
  ...kt.tokens,
6207
6224
  ...t?.tokens,
6208
6225
  ...n === void 0 ? {} : { geom: n },
6209
6226
  ...e.tokens
6210
- }), Xd = ({ layer: e }) => {
6227
+ }), Jd = ({ layer: e }) => {
6211
6228
  if (e.position === "stack") return;
6212
6229
  const t = S(e.mapping.y);
6213
6230
  if (t === null) return;
@@ -6220,7 +6237,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6220
6237
  grandTotal: n,
6221
6238
  absoluteGrandTotal: r
6222
6239
  };
6223
- }, Jd = ({ layer: e, mainAxis: t }) => {
6240
+ }, Zd = ({ layer: e, mainAxis: t }) => {
6224
6241
  if (e.position !== "stack") return;
6225
6242
  const n = S(e.mapping.x);
6226
6243
  if (n === null) return;
@@ -6228,11 +6245,11 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6228
6245
  if (!e.data.hasVariable(r) || !e.data.hasVariable(s)) return;
6229
6246
  const o = (l) => t === "y" ? l.xMax : l.yMax, a = (l) => t === "y" ? l.xMin : l.yMin, i = /* @__PURE__ */ new Map();
6230
6247
  for (const l of e.data) {
6231
- const u = l[n], d = t === "y" ? st(l) : eo(l), m = kn(l) ?? (t === "y" ? d : null), p = nt(l) ?? (t === "y" ? d : null), f = Zs(l) ?? (t === "x" ? d : null), y = Ss(l) ?? (t === "x" ? d : null), b = Ys(l);
6248
+ const u = l[n], d = t === "y" ? rt(l) : Es(l), m = Kn(l) ?? (t === "y" ? d : null), p = st(l) ?? (t === "y" ? d : null), f = Cs(l) ?? (t === "x" ? d : null), y = Ls(l) ?? (t === "x" ? d : null), b = Ts(l);
6232
6249
  if (!g(u) || !g(m) || !g(p) || !g(f) || !g(y) || !g(b)) continue;
6233
6250
  const v = b >= 0;
6234
6251
  if (Math.abs(b) === 0) continue;
6235
- const T = Ir(l, n), A = {
6252
+ const T = Er(l, n), A = {
6236
6253
  xMin: f,
6237
6254
  xMax: y,
6238
6255
  yMin: m,
@@ -6264,7 +6281,7 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6264
6281
  });
6265
6282
  }
6266
6283
  return c;
6267
- }, Zd = class extends ne {
6284
+ }, Qd = class extends ne {
6268
6285
  constructor(e) {
6269
6286
  super(), this.container = e;
6270
6287
  }
@@ -6274,14 +6291,14 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6274
6291
  compileLayer(e, t) {
6275
6292
  const n = this.container.geomRegistry.get(e.geom), r = {}, s = Ct(t.coordSystem);
6276
6293
  if (n.summaries.includeStackTotals) {
6277
- const o = Jd({
6294
+ const o = Zd({
6278
6295
  layer: e,
6279
6296
  mainAxis: s
6280
6297
  });
6281
6298
  o !== void 0 && (r.stackTotals = o);
6282
6299
  }
6283
6300
  if (n.summaries.includeGrandTotal) {
6284
- const o = Xd({ layer: e });
6301
+ const o = Jd({ layer: e });
6285
6302
  o !== void 0 && (r.grandTotal = o.grandTotal, r.absoluteGrandTotal = o.absoluteGrandTotal);
6286
6303
  }
6287
6304
  return {
@@ -6295,50 +6312,50 @@ var ns = Object.keys(Ie), ep = (e) => Object.hasOwn(Ie, e), tp = (e, t) => {
6295
6312
  alpha: "numeric",
6296
6313
  strokeWidth: "numeric",
6297
6314
  lineType: "categorical"
6298
- }, Qd = [
6315
+ }, em = [
6299
6316
  "color",
6300
6317
  "size",
6301
6318
  "alpha",
6302
6319
  "strokeWidth",
6303
6320
  "lineType"
6304
- ], em = class extends ne {
6321
+ ], tm = class extends ne {
6305
6322
  dependencies(e) {
6306
- return Qd.map((t) => e.scales[t]);
6323
+ return em.map((t) => e.scales[t]);
6307
6324
  }
6308
6325
  compileLayer(e, t) {
6309
6326
  let n = e.data;
6310
- const r = Object.entries(ws);
6327
+ const r = Object.entries(Js);
6311
6328
  for (const [s, o] of r) {
6312
- const a = fe(e.mapping[s]);
6329
+ const a = ge(e.mapping[s]);
6313
6330
  if (a !== void 0) {
6314
6331
  n = n.addConstantVariable(o, Cn[s], a);
6315
6332
  continue;
6316
6333
  }
6317
6334
  const i = S(e.mapping[s]), c = t.scales[s];
6318
- !i || !c || c.kind !== "visual" || (n = n.deriveVariableFrom(i, o, Cn[s], tm(c)));
6335
+ !i || !c || c.kind !== "visual" || (n = n.deriveVariableFrom(i, o, Cn[s], nm(c)));
6319
6336
  }
6320
6337
  return {
6321
6338
  ...e,
6322
6339
  data: n
6323
6340
  };
6324
6341
  }
6325
- }, tm = (e) => (t) => g(t) ? e.map(t) : null;
6326
- function nm(e = new St(), t, n = new Yr()) {
6342
+ }, nm = (e) => (t) => g(t) ? e.map(t) : null;
6343
+ function rm(e = new St(), t, n = new jr()) {
6327
6344
  return {
6328
- diagnostics: new ed(),
6345
+ diagnostics: new td(),
6329
6346
  geomRegistry: e,
6330
6347
  statRegistry: n,
6331
6348
  theme: t
6332
6349
  };
6333
6350
  }
6334
- var rm = (e) => ({
6335
- styles: sm(ts({
6351
+ var sm = (e) => ({
6352
+ styles: om(ns({
6336
6353
  type: "styles",
6337
6354
  ...e.styles
6338
6355
  }), e.palettes?.categorical),
6339
6356
  palettes: e.palettes,
6340
- config: e.config === void 0 ? void 0 : om(e.config)
6341
- }), sm = (e, t) => {
6357
+ config: e.config === void 0 ? void 0 : am(e.config)
6358
+ }), om = (e, t) => {
6342
6359
  const n = t?.[0];
6343
6360
  return e.tokens.geom !== void 0 || n === void 0 ? e : {
6344
6361
  ...e,
@@ -6347,12 +6364,12 @@ var rm = (e) => ({
6347
6364
  geom: n
6348
6365
  }
6349
6366
  };
6350
- }, om = (e) => {
6367
+ }, am = (e) => {
6351
6368
  const { content: t, ...n } = e;
6352
6369
  return n;
6353
- }, am = class {
6370
+ }, im = class {
6354
6371
  constructor(e, t, n, r, s, o, a, i, c, l, u, d, m, p, f, y) {
6355
- this.container = e, this.dataCompiler = t, this.specCompiler = n, this.transformCompiler = r, this.constantMappingCompiler = s, this.layerPhasedCompiler = o, this.scaleCompiler = a, this.coordCompiler = i, this.positionMapperCompiler = c, this.visualMapperCompiler = l, this.guideCompiler = u, this.summarizeCompiler = d, this.layerStylesCompiler = m, this.sceneStylesCompiler = p, this.highlightsCompiler = f, this.annotationsCompiler = y, this.stageTimer = Xe ? gd() : null, this.lastCompile = null, this.lastDiagnostics = null, this.lastData = void 0, this.stages = [
6372
+ this.container = e, this.dataCompiler = t, this.specCompiler = n, this.transformCompiler = r, this.constantMappingCompiler = s, this.layerPhasedCompiler = o, this.scaleCompiler = a, this.coordCompiler = i, this.positionMapperCompiler = c, this.visualMapperCompiler = l, this.guideCompiler = u, this.summarizeCompiler = d, this.layerStylesCompiler = m, this.sceneStylesCompiler = p, this.highlightsCompiler = f, this.annotationsCompiler = y, this.stageTimer = Xe ? hd() : null, this.lastCompile = null, this.lastDiagnostics = null, this.lastData = void 0, this.stages = [
6356
6373
  {
6357
6374
  name: "data",
6358
6375
  getStats: () => this.dataCompiler.stats
@@ -6469,16 +6486,16 @@ var rm = (e) => ({
6469
6486
  }
6470
6487
  reResolveInferredScalesIfNeeded(e, t) {
6471
6488
  if (e.size() !== 0 || t.data.size() === 0 || t.scales.filter((r) => r.inferredFrom !== void 0).length === 0) return t;
6472
- const n = Xr(this.container, {
6489
+ const n = Jr(this.container, {
6473
6490
  data: t.data,
6474
6491
  layers: t.layers,
6475
6492
  mapping: t.mapping
6476
6493
  });
6477
- return ke(t, { scales: er(t.scales, (r) => {
6494
+ return ke(t, { scales: tr(t.scales, (r) => {
6478
6495
  const s = r.inferredFrom;
6479
6496
  if (s === void 0) return r;
6480
6497
  const o = Mt(n, s);
6481
- return t.coords.coordType === "polar" ? Jr(o) : o;
6498
+ return t.coords.coordType === "polar" ? Zr(o) : o;
6482
6499
  }) });
6483
6500
  }
6484
6501
  runCompile(e) {
@@ -6599,7 +6616,7 @@ var rm = (e) => ({
6599
6616
  spec: e
6600
6617
  };
6601
6618
  }
6602
- }, sp = [
6619
+ }, op = [
6603
6620
  "data",
6604
6621
  "transform",
6605
6622
  "constantMapping",
@@ -6615,136 +6632,136 @@ var rm = (e) => ({
6615
6632
  "sceneStyles",
6616
6633
  "highlights",
6617
6634
  "annotations"
6618
- ], In = "light", op = ({ plugins: e = [], theme: t } = {}) => {
6619
- const n = Ms(e), { geomRegistry: r, statRegistry: s, transformRegistry: o } = _l(n), a = nm(r, t === void 0 ? void 0 : rm(t), s), i = new bu(a), c = new Qr(o);
6635
+ ], In = "light", ap = ({ plugins: e = [], theme: t } = {}) => {
6636
+ const n = Ms(e), { geomRegistry: r, statRegistry: s, transformRegistry: o } = _l(n), a = rm(r, t === void 0 ? void 0 : sm(t), s), i = new Su(a), c = new es(o);
6620
6637
  for (const l of n.warnings) a.diagnostics.addWarning(l, { persistent: !0 });
6621
- return new am(a, new Ns(), new fd(a), c, new La(), new el(a, c, s, new Uc(a, c, new hd(s), new ni(), new ti(a), new Ol(new Yl()))), new cu(a, i), new Na(new ei()), new ru(a), new em(), new wc(a), new Zd(a), new xd(a), new wd(a), new Mc(a), new ya(a));
6638
+ return new im(a, new bs(), new gd(a), c, new La(), new el(a, c, s, new Uc(a, c, new yd(s), new ni(), new ti(a), new Ol(new Yl()))), new lu(a, i), new Na(new ei()), new ru(a), new tm(), new wc(a), new Qd(a), new wd(a), new Cd(a), new Mc(a), new ya(a));
6622
6639
  };
6623
6640
  export {
6624
- Cr as $,
6625
- wm as $t,
6626
- Nu as A,
6641
+ Ir as $,
6642
+ Cm as $t,
6643
+ Du as A,
6627
6644
  Ct as At,
6628
- Nr as B,
6629
- km as Bt,
6630
- Wm as C,
6645
+ Dr as B,
6646
+ Rm as Bt,
6647
+ Hm as C,
6631
6648
  jo as Ct,
6632
6649
  tt as D,
6633
6650
  Yo as Dt,
6634
- Zu as E,
6635
- Dm as Et,
6651
+ Qu as E,
6652
+ _m as Et,
6636
6653
  Mt as F,
6637
- Vm as Ft,
6654
+ Mm as Ft,
6638
6655
  Dc as G,
6639
6656
  Kt as Gt,
6640
- Mr as H,
6657
+ Lr as H,
6641
6658
  Oo as Ht,
6642
6659
  ut as I,
6643
- Lm as It,
6660
+ km as It,
6644
6661
  on as J,
6645
- Cm as Jt,
6662
+ Im as Jt,
6646
6663
  Vc as K,
6647
6664
  ce as Kt,
6648
- qm as L,
6649
- Em as Lt,
6650
- Xr as M,
6665
+ Wm as L,
6666
+ Vm as Lt,
6667
+ Jr as M,
6651
6668
  Bo as Mt,
6652
- Jr as N,
6653
- Nm as Nt,
6654
- Xu as O,
6669
+ Zr as N,
6670
+ Dm as Nt,
6671
+ Ju as O,
6655
6672
  Go as Ot,
6656
- Au as P,
6657
- Mm as Pt,
6658
- jm as Q,
6673
+ xu as P,
6674
+ Lm as Pt,
6675
+ zm as Q,
6659
6676
  ke as Qt,
6660
6677
  W as R,
6661
6678
  Po as Rt,
6662
- Hm as S,
6663
- Om as St,
6664
- Qm as T,
6679
+ Xm as S,
6680
+ Pm as St,
6681
+ ep as T,
6665
6682
  Wt as Tt,
6666
6683
  Be as U,
6667
- nr as Ut,
6668
- Dr as V,
6669
- Rm as Vt,
6684
+ rr as Ut,
6685
+ _r as V,
6686
+ Nm as Vt,
6670
6687
  _c as W,
6671
- rr as Wt,
6688
+ sr as Wt,
6672
6689
  Qi as X,
6673
6690
  At as Xt,
6674
6691
  Ic as Y,
6675
6692
  at as Yt,
6676
- Ym as Z,
6677
- er as Zt,
6678
- sd as _,
6679
- gm as _n,
6693
+ jm as Z,
6694
+ tr as Zt,
6695
+ od as _,
6696
+ hm as _n,
6680
6697
  Qo as _t,
6681
- Ld as a,
6698
+ kd as a,
6682
6699
  ze as an,
6683
- Km as at,
6684
- Jm as b,
6700
+ qm as at,
6701
+ Zm as b,
6685
6702
  Xo as bt,
6686
6703
  kt as c,
6687
- Hn as cn,
6688
- Fm as ct,
6689
- rs as d,
6690
- vm as dn,
6691
- $m as dt,
6692
- xm as en,
6693
- zm as et,
6694
- np as f,
6695
- Tm as fn,
6704
+ Xn as cn,
6705
+ Bm as ct,
6706
+ ss as d,
6707
+ bm as dn,
6708
+ Fm as dt,
6709
+ wm as en,
6710
+ Km as et,
6711
+ rp as f,
6712
+ Am as fn,
6696
6713
  It as ft,
6697
- ad as g,
6698
- Am as gn,
6714
+ id as g,
6715
+ xm as gn,
6699
6716
  ea as gt,
6700
- id as h,
6701
- bm as hn,
6717
+ cd as h,
6718
+ Sm as hn,
6702
6719
  Ze as ht,
6703
- nm as i,
6720
+ rm as i,
6704
6721
  Yt as in,
6705
- Bm as it,
6706
- Qr as j,
6722
+ Um as it,
6723
+ es as j,
6707
6724
  Uo as jt,
6708
6725
  P as k,
6709
- _m as kt,
6710
- tp as l,
6726
+ Om as kt,
6727
+ np as l,
6711
6728
  Tt as ln,
6712
6729
  da as lt,
6713
- fd as m,
6730
+ gd as m,
6714
6731
  U as mn,
6715
6732
  ue as mt,
6716
- am as n,
6733
+ im as n,
6717
6734
  No as nn,
6718
- Um as nt,
6719
- Md as o,
6720
- Xn as on,
6735
+ Gm as nt,
6736
+ Ld as o,
6737
+ Jn as on,
6721
6738
  Ui as ot,
6722
- bd as p,
6723
- ym as pn,
6724
- Pm as pt,
6725
- Ir as q,
6726
- Im as qt,
6727
- op as r,
6739
+ Sd as p,
6740
+ vm as pn,
6741
+ $m as pt,
6742
+ Er as q,
6743
+ Em as qt,
6744
+ ap as r,
6728
6745
  Ro as rn,
6729
6746
  Fe as rt,
6730
- rp as s,
6731
- Zn as sn,
6732
- yr as st,
6733
- sp as t,
6747
+ sp as s,
6748
+ Qn as sn,
6749
+ vr as st,
6750
+ op as t,
6734
6751
  Do as tn,
6735
- Gm as tt,
6736
- ep as u,
6737
- Sm as un,
6752
+ Ym as tt,
6753
+ tp as u,
6754
+ Tm as un,
6738
6755
  le as ut,
6739
- rd as v,
6740
- hm as vn,
6756
+ sd as v,
6757
+ ym as vn,
6741
6758
  Zo as vt,
6742
- Zm as w,
6759
+ Qm as w,
6743
6760
  Ke as wt,
6744
- nd as x,
6745
- ir as xt,
6746
- Xm as y,
6761
+ rd as x,
6762
+ cr as xt,
6763
+ Jm as y,
6747
6764
  Jo as yt,
6748
- Se as z,
6765
+ Te as z,
6749
6766
  wt as zt
6750
6767
  };