@graphysdk/react-renderer 1.9.0-beta.1792400629887 → 1.9.0-beta.1792407460425

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,91 +1,88 @@
1
- import { $t as Zt, A as er, At as tr, B as rr, Bt as nr, Cn as J, Ct as sr, Ft as Se, It as be, Jt as or, Kt as ar, L as ir, Lt as cr, M as lr, Mt as z, R as dr, Rt as Y, Ut as ur, V as mr, Wt as Ee, Yt as hr, _n as gr, a as pr, an as fr, at as vr, bn as Z, cn as j, dn as yr, fn as Sr, ft as br, gn as Er, h as Tr, hn as Rr, ht as Nr, i as Cr, it as Gr, j as Dr, kt as qr, ln as Ir, mn as wr, mt as Pr, n as _r, nn as kr, on as Lr, pn as $r, qt as Mr, r as xr, s as Hr, sn as Te, st as Ar, t as Re, vn as Br, w as Or, wt as Kr, xn as Ne, xt as Fr, yn as Ce, zt as Ge } from "./history-chords-D7hQLh47.js";
2
- import { COMPILER_STAGE_KEYS as ee, Geom as De, GraphCompilationSession as qe, areEditTargetsEqual as Ie, buildDiagnostic as ne, createAnchorResolver as we, createCompiler as Pe, createDataLabelPlacementResolver as _e, createSpecBuilder as ke, createStyleResolver as me, findAnnotation as Le, findLayerById as se, isCompilerCachingEnabled as $e, resolveDefinition as Me, setCompilerCachingEnabled as xe, toPercent as F } from "@graphysdk/viz-engine";
3
- import { Component as He, createContext as Ae, useCallback as f, useContext as Be, useEffect as x, useId as Oe, useImperativeHandle as Ke, useMemo as M, useRef as oe, useState as b, useSyncExternalStore as Fe } from "react";
4
- import { Fragment as Ue, jsx as a, jsxs as v } from "react/jsx-runtime";
5
- import { useStore as Q } from "zustand";
6
- import { motion as V } from "motion/react";
7
- import { createStore as te } from "zustand/vanilla";
8
- import Ye from "clsx";
9
- import './index.css';var je = "_1a5iqpb0", Ve = "_1a5iqpb1";
10
- var We = "_1a5iqpb3", Xe = "_1a5iqpb4", ze = "_1a5iqpb5";
11
- var ae = ({ errors: e }) => {
1
+ import { $t as or, At as ar, Bt as Re, Cn as ir, Ct as cr, Dn as Ne, En as lr, Gt as W, H as dr, Ht as z, It as Ge, Kt as Ce, Lt as ve, M as ur, N as hr, Nt as Z, On as te, Ot as mr, R as gr, Rt as H, Sn as pr, Tn as vr, Tt as fr, Ut as we, V as yr, Vt as De, Wt as Sr, Xt as br, Zt as Pe, _n as Er, _t as Tr, a as Rr, at as Nr, bn as Gr, ct as Cr, en as wr, fn as Dr, gn as Y, gt as Pr, h as qr, hn as V, i as Ir, j as _r, jn as J, jt as kr, kn as qe, kt as Lr, ln as $r, mn as Ie, mt as Mr, n as xr, nn as Hr, on as Ar, ot as Br, pn as Or, qt as Kr, r as Fr, s as Ur, t as _e, tn as jr, w as Wr, wn as zr, xn as Yr, yn as Vr, z as Xr, zt as fe } from "./history-chords-BcKFOh7E.js";
2
+ import { COMPILER_STAGE_KEYS as re, Geom as ke, GraphCompilationSession as Le, areEditTargetsEqual as $e, buildDiagnostic as oe, createAnchorResolver as Me, createCompiler as xe, createDataLabelPlacementResolver as He, createSpecBuilder as Ae, createStyleResolver as ye, findAnnotation as Be, findLayerById as ae, isCompilerCachingEnabled as Oe, resolveDefinition as Ke, resolveGeomCornerRadiusPx as ie, setCompilerCachingEnabled as Fe, toPercent as F } from "@graphysdk/viz-engine";
3
+ import { Component as Ue, useCallback as v, useEffect as x, useId as je, useImperativeHandle as We, useMemo as _, useRef as ce, useState as b, useSyncExternalStore as ze } from "react";
4
+ import { Fragment as Ye, jsx as c, jsxs as f } from "react/jsx-runtime";
5
+ import { useStore as ee } from "zustand";
6
+ import { motion as X } from "motion/react";
7
+ import { createStore as ne } from "zustand/vanilla";
8
+ import Ve from "clsx";
9
+ import './index.css';var Xe = "_1a5iqpb0", Qe = "_1a5iqpb1";
10
+ var Ze = "_1a5iqpb3", Je = "_1a5iqpb4", et = "_1a5iqpb5";
11
+ var le = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
- return /* @__PURE__ */ v("div", {
13
+ return /* @__PURE__ */ f("div", {
14
14
  role: "alert",
15
- className: je,
15
+ className: Xe,
16
16
  children: [
17
- /* @__PURE__ */ a("strong", {
18
- className: Ve,
17
+ /* @__PURE__ */ c("strong", {
18
+ className: Qe,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
- t && /* @__PURE__ */ a(ie, { diagnostic: t }),
22
- r.length > 0 && /* @__PURE__ */ a("ul", {
21
+ t && /* @__PURE__ */ c(de, { diagnostic: t }),
22
+ r.length > 0 && /* @__PURE__ */ c("ul", {
23
23
  className: "_1a5iqpb2",
24
- children: r.map((n, s) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(ie, { diagnostic: n }) }, `${n.code}-${s}`))
24
+ children: r.map((n, s) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(de, { diagnostic: n }) }, `${n.code}-${s}`))
25
25
  })
26
26
  ]
27
27
  });
28
- }, ie = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
29
- className: We,
28
+ }, de = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
29
+ className: Ze,
30
30
  children: [
31
- /* @__PURE__ */ a("span", {
32
- className: Xe,
31
+ /* @__PURE__ */ c("span", {
32
+ className: Je,
33
33
  children: e.code
34
34
  }),
35
- /* @__PURE__ */ a("p", {
36
- className: ze,
35
+ /* @__PURE__ */ c("p", {
36
+ className: et,
37
37
  children: e.message
38
38
  }),
39
- e.suggestion && /* @__PURE__ */ a("p", {
39
+ e.suggestion && /* @__PURE__ */ c("p", {
40
40
  className: "_1a5iqpb6",
41
41
  children: e.suggestion
42
42
  })
43
43
  ]
44
44
  });
45
- function Je(e = [], t = []) {
45
+ function tt(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var Qe = class extends He {
48
+ var rt = class extends Ue {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
52
52
  static getDerivedStateFromError(e) {
53
- return { caughtDiagnostic: ne(e) };
53
+ return { caughtDiagnostic: oe(e) };
54
54
  }
55
55
  componentDidCatch(e, t) {
56
- const r = ne(e);
56
+ const r = oe(e);
57
57
  J([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
- this.state.caughtDiagnostic && !Je(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
60
+ this.state.caughtDiagnostic && !tt(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
64
- if (e) return /* @__PURE__ */ a(ae, { errors: [e] });
64
+ if (e) return /* @__PURE__ */ c(le, { errors: [e] });
65
65
  const { forcedErrors: t, children: r } = this.props;
66
- return t && t.length > 0 ? /* @__PURE__ */ a(ae, { errors: t }) : r;
66
+ return t && t.length > 0 ? /* @__PURE__ */ c(le, { errors: t }) : r;
67
67
  }
68
- }, he = {}, ge = Ae(he), H = ({ shapes: e = he, children: t }) => /* @__PURE__ */ a(ge.Provider, {
69
- value: e,
70
- children: t
71
- }), W = () => Be(ge), pe = (e) => typeof e == "object" && "geom" in e && "render" in e, fe = (e) => {
72
- const t = Me(e);
73
- return t instanceof De ? t : null;
74
- }, Ze = (e, t) => {
75
- const r = e.filter((n) => et(n, t));
68
+ }, Se = (e) => typeof e == "object" && "geom" in e && "render" in e, be = (e) => {
69
+ const t = Ke(e);
70
+ return t instanceof ke ? t : null;
71
+ }, nt = (e, t) => {
72
+ const r = e.filter((n) => st(n, t));
76
73
  return r.length === e.length ? e : r;
77
- }, et = (e, t) => e.kind === "annotation" ? Le(t.annotations, e.id) !== null : e.kind === "observations" ? se(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? se(t.layers, e.layerId) !== void 0 : !0, ce = [], tt = () => te((e) => ({
78
- selection: ce,
79
- setSelection: (t) => e((r) => rt(r.selection, t) ? r : { selection: t }),
80
- clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ce })
81
- })), rt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
74
+ }, st = (e, t) => e.kind === "annotation" ? Be(t.annotations, e.id) !== null : e.kind === "observations" ? ae(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ae(t.layers, e.layerId) !== void 0 : !0, ue = [], ot = () => ne((e) => ({
75
+ selection: ue,
76
+ setSelection: (t) => e((r) => at(r.selection, t) ? r : { selection: t }),
77
+ clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ue })
78
+ })), at = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
82
79
  const s = t[n];
83
- return s !== void 0 && Ie(r, s);
84
- }), nt = process.env.NODE_ENV !== "production", st = 5, ot = (e) => {
85
- if (!nt) return {
80
+ return s !== void 0 && $e(r, s);
81
+ }), it = process.env.NODE_ENV !== "production", ct = 5, lt = (e) => {
82
+ if (!it) return {
86
83
  emit: () => {
87
84
  },
88
- subscribe: () => it,
85
+ subscribe: () => ut,
89
86
  getLastTrigger: () => null,
90
87
  getLastCompile: () => null,
91
88
  getCacheStats: () => e.getCacheStats()
@@ -97,7 +94,7 @@ var Qe = class extends He {
97
94
  const s = e.getLastCompile();
98
95
  if (s) {
99
96
  r = n;
100
- for (const c of t) c(n, s);
97
+ for (const i of t) i(n, s);
101
98
  }
102
99
  },
103
100
  subscribe: (n) => (t.add(n), () => {
@@ -107,7 +104,7 @@ var Qe = class extends He {
107
104
  getLastCompile: () => e.getLastCompile(),
108
105
  getCacheStats: () => e.getCacheStats()
109
106
  };
110
- }, at = () => te((e) => ({
107
+ }, dt = () => ne((e) => ({
111
108
  lastCompile: null,
112
109
  history: [],
113
110
  nextId: 1,
@@ -116,20 +113,20 @@ var Qe = class extends He {
116
113
  if (n.lastSnapshot === r) return n;
117
114
  const s = {
118
115
  id: n.nextId,
119
- label: ct(t),
116
+ label: ht(t),
120
117
  stages: r.stages,
121
118
  stageDurationsMs: r.stageDurationsMs,
122
119
  durationMs: r.durationMs
123
120
  };
124
121
  return {
125
122
  lastCompile: s,
126
- history: lt(n.history, s, st),
123
+ history: mt(n.history, s, ct),
127
124
  nextId: n.nextId + 1,
128
125
  lastSnapshot: r
129
126
  };
130
127
  })
131
- })), it = () => {
132
- }, ct = (e) => {
128
+ })), ut = () => {
129
+ }, ht = (e) => {
133
130
  switch (e.kind) {
134
131
  case "init":
135
132
  return "init";
@@ -140,29 +137,14 @@ var Qe = class extends He {
140
137
  case "command":
141
138
  return e.command.metadata.description;
142
139
  }
143
- }, lt = (e, t, r) => {
140
+ }, mt = (e, t, r) => {
144
141
  const n = e.length >= r ? e.length - (r - 1) : 0;
145
142
  return [...e.slice(n), t];
146
143
  };
147
- function dt(e, t) {
148
- let r;
149
- return e.layers.flatMap((n, s) => Y(t(n.geom, e.coordSystem.type)) ? vt(n) ? (r ??= me().readers(e), yt(n, r.geom(n)) ? [{
150
- kind: "user-input",
151
- severity: "warning",
152
- code: "INVALID_STYLE_RULE",
153
- message: `Style 'overlay' is not supported on portal-rendered geom '${n.geom}' (layer '${n.id}'); it is ignored.`,
154
- context: {
155
- param: "overlay",
156
- layerIndex: s,
157
- requested: n.geom
158
- },
159
- suggestion: "Remove the geom overlay or use a renderer that paints inside the panel SVG."
160
- }] : []) : [] : []);
161
- }
162
- function le(e) {
163
- const t = e.filter(pe), r = /* @__PURE__ */ new Set([...Object.keys(Ge), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
144
+ function he(e) {
145
+ const t = e.filter(Se), r = /* @__PURE__ */ new Set([...Object.keys(Ce), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
164
146
  for (const l of e) {
165
- const d = fe(l);
147
+ const d = be(l);
166
148
  d === null || r.has(d.type) || s.has(d.type) || (s.add(d.type), n.push({
167
149
  kind: "user-input",
168
150
  severity: "error",
@@ -175,70 +157,70 @@ function le(e) {
175
157
  suggestion: `Add a render half for it: \`defineGeomRenderer(${d.type}Geom, { coord, render })\`, then include it in \`plugins\`.`
176
158
  }));
177
159
  }
178
- const c = /* @__PURE__ */ new Map();
160
+ const i = /* @__PURE__ */ new Map();
179
161
  for (const l of t) {
180
162
  if ("definition" in l) continue;
181
- const d = `${l.geom}|${l.coord}`, g = c.get(d);
182
- g ? g.count += 1 : c.set(d, {
163
+ const d = `${l.geom}|${l.coord}`, h = i.get(d);
164
+ h ? h.count += 1 : i.set(d, {
183
165
  geom: l.geom,
184
166
  coord: l.coord,
185
167
  count: 1
186
168
  });
187
169
  }
188
- const i = [];
189
- for (const { geom: l, coord: d, count: g } of c.values())
190
- g < 2 || i.push({
170
+ const a = [];
171
+ for (const { geom: l, coord: d, count: h } of i.values())
172
+ h < 2 || a.push({
191
173
  kind: "user-input",
192
174
  severity: "warning",
193
175
  code: "DUPLICATE_REGISTERED_TYPE",
194
- message: `Multiple render-only overrides register ('${l}', '${d}') (${g} entries); the last in the array wins.`,
176
+ message: `Multiple render-only overrides register ('${l}', '${d}') (${h} entries); the last in the array wins.`,
195
177
  context: {
196
178
  requested: `${l}@${d}`,
197
179
  kind: "geom-renderer"
198
180
  },
199
181
  suggestion: `Keep a single render-only override for ('${l}', '${d}').`
200
182
  });
201
- return i.push(...St(e)), {
183
+ return a.push(...Tt(e)), {
202
184
  errors: n,
203
- warnings: i
185
+ warnings: a
204
186
  };
205
187
  }
206
- function ut(e, t) {
207
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
208
- for (const i of n)
209
- t(i.geom, r.type) !== null || s.has(i.geom) || (s.add(i.geom), c.push({
188
+ function gt(e, t) {
189
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
190
+ for (const a of n)
191
+ t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), i.push({
210
192
  kind: "user-input",
211
193
  severity: "warning",
212
194
  code: "MISSING_GEOM_RENDERER",
213
- message: `No renderer for geom '${i.geom}' under ${r.type} coords; the layer is not painted.`,
195
+ message: `No renderer for geom '${a.geom}' under ${r.type} coords; the layer is not painted.`,
214
196
  context: {
215
- requested: i.geom,
197
+ requested: a.geom,
216
198
  kind: "geom-renderer"
217
199
  },
218
- suggestion: `Register a renderer for ('${i.geom}', '${r.type}') via \`defineGeomRenderer\`.`
200
+ suggestion: `Register a renderer for ('${a.geom}', '${r.type}') via \`defineGeomRenderer\`.`
219
201
  }));
220
- return c;
202
+ return i;
221
203
  }
222
- function mt(e, t) {
223
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
224
- for (const i of n) {
225
- if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || s.has(i.geom)) continue;
226
- const l = t(i.geom, r.type);
227
- l === null || l.hitTest || Y(l) || (s.add(i.geom), c.push({
204
+ function pt(e, t) {
205
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
206
+ for (const a of n) {
207
+ if (a.interactive === !1 || a.spatialKind !== "render-hit-test" || s.has(a.geom)) continue;
208
+ const l = t(a.geom, r.type);
209
+ l === null || l.hitTest || W(l) || (s.add(a.geom), i.push({
228
210
  kind: "user-input",
229
211
  severity: "warning",
230
212
  code: "MISSING_RENDER_HIT_TEST",
231
- message: `Geom '${i.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,
213
+ message: `Geom '${a.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,
232
214
  context: {
233
- requested: i.geom,
215
+ requested: a.geom,
234
216
  kind: "geom-renderer"
235
217
  },
236
- suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${i.geom}', '${r.type}').`
218
+ suggestion: `Add a \`hitTest\` factory (precomputed geometry) or a live render (\`{ fn, options: { live: true } }\`, live simulation) to the renderer for ('${a.geom}', '${r.type}').`
237
219
  }));
238
220
  }
239
- return c;
221
+ return i;
240
222
  }
241
- function ht(e) {
223
+ function vt(e) {
242
224
  const t = /* @__PURE__ */ new Set(), r = [];
243
225
  for (const n of e.layers) {
244
226
  const s = n.identityKey;
@@ -256,26 +238,26 @@ function ht(e) {
256
238
  }
257
239
  return r;
258
240
  }
259
- function gt(e, t) {
260
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
261
- for (const i of n) {
262
- if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || s.has(i.geom)) continue;
263
- const l = t(i.geom, r.type);
264
- l === null || !l.hitTest || !Y(l) || (s.add(i.geom), c.push({
241
+ function ft(e, t) {
242
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
243
+ for (const a of n) {
244
+ if (a.interactive === !1 || a.spatialKind !== "render-hit-test" || s.has(a.geom)) continue;
245
+ const l = t(a.geom, r.type);
246
+ l === null || !l.hitTest || !W(l) || (s.add(a.geom), i.push({
265
247
  kind: "user-input",
266
248
  severity: "warning",
267
249
  code: "CONFLICTING_RENDER_HIT_TEST",
268
- message: `Geom '${i.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,
250
+ message: `Geom '${a.geom}' declares both a \`hitTest\` factory and a live render; these are alternatives, so only the live render is used.`,
269
251
  context: {
270
- requested: i.geom,
252
+ requested: a.geom,
271
253
  kind: "geom-renderer"
272
254
  },
273
- suggestion: "Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."
255
+ suggestion: "Keep one: a `hitTest` factory for precomputed geometry, OR a live render (`{ fn, options: { live: true } }`) for a live simulation."
274
256
  }));
275
257
  }
276
- return c;
258
+ return i;
277
259
  }
278
- function pt(e, t) {
260
+ function yt(e, t) {
279
261
  const r = /* @__PURE__ */ new Set(), n = [];
280
262
  for (const s of e.layers)
281
263
  s.interactive !== !1 && (s.spatialKind !== "render-hit-test" || r.has(s.geom) || t.hasCapability(s.geom) || (r.add(s.geom), n.push({
@@ -291,36 +273,45 @@ function pt(e, t) {
291
273
  })));
292
274
  return n;
293
275
  }
294
- function ft(e, t) {
295
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
296
- for (const i of n) {
297
- if (i.interactive === !1 || i.spatialKind === "render-hit-test" || s.has(i.geom)) continue;
298
- const l = t(i.geom, r.type);
299
- l === null || !Y(l) || (s.add(i.geom), c.push({
276
+ function St(e, t) {
277
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
278
+ for (const a of n) {
279
+ if (a.interactive === !1 || a.spatialKind === "render-hit-test" || s.has(a.geom)) continue;
280
+ const l = t(a.geom, r.type);
281
+ l === null || !W(l) || (s.add(a.geom), i.push({
300
282
  kind: "user-input",
301
283
  severity: "warning",
302
- code: "OVERLAY_REQUIRES_RENDER_HIT_TEST",
303
- message: `Geom '${i.geom}' declares an overlay render but its layer's spatialKind is '${i.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,
284
+ code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
285
+ message: `Geom '${a.geom}' declares a live render but its layer's spatialKind is '${a.spatialKind}', not 'render-hit-test'; its push-path hover resolves to nothing.`,
304
286
  context: {
305
- requested: i.geom,
287
+ requested: a.geom,
306
288
  kind: "geom-renderer"
307
289
  },
308
- suggestion: "Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."
290
+ suggestion: "Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the live render's `pushHover` resolves against."
309
291
  }));
310
292
  }
311
- return c;
293
+ return i;
312
294
  }
313
- var vt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => (r.declarations.overlay?.length ?? 0) > 0)), yt = (e, t) => {
314
- const [r] = e.data;
315
- if (r === void 0) return !1;
316
- if ((t.get("overlay", r)?.length ?? 0) > 0) return !0;
317
- for (const n of e.data) if ((t.get("overlay", n, "hovered")?.length ?? 0) > 0) return !0;
318
- return !1;
319
- };
320
- function St(e) {
295
+ function bt(e, t) {
296
+ let r;
297
+ return e.layers.flatMap((n, s) => W(t(n.geom, e.coordSystem.type)) ? Et(n) ? (r ??= ye().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
298
+ kind: "user-input",
299
+ severity: "warning",
300
+ code: "INVALID_STYLE_RULE",
301
+ message: `Style 'overpaint' in state 'hovered' is not supported on live geom '${n.geom}' (layer '${n.id}'); it is ignored.`,
302
+ context: {
303
+ param: "overpaint",
304
+ layerIndex: s,
305
+ requested: n.geom
306
+ },
307
+ suggestion: "Remove the hovered overpaint, or paint the hover treatment in the geom's live render."
308
+ }]) : [] : []);
309
+ }
310
+ var Et = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
+ function Tt(e) {
321
312
  const t = /* @__PURE__ */ new Set(), r = [];
322
313
  for (const n of e) {
323
- const s = fe(n);
314
+ const s = be(n);
324
315
  s === null || t.has(s.type) || s.dataLabelCoordTypes.length === 0 || s.getDataLabelPlacements !== void 0 || (t.add(s.type), r.push({
325
316
  kind: "user-input",
326
317
  severity: "warning",
@@ -335,129 +326,129 @@ function St(e) {
335
326
  }
336
327
  return r;
337
328
  }
338
- var bt = (e) => te((t) => ({
329
+ var Rt = (e) => ne((t) => ({
339
330
  scene: e,
340
331
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
341
- })), Et = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: c, anchorResolver: i, onSpecChange: l, onError: d, onWarnings: g }) => {
342
- const C = z(l), G = z(d), T = z(g), [{ session: h, compileBus: u }] = b(() => {
343
- const o = Pe({
332
+ })), Nt = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: h }) => {
333
+ const G = Z(l), C = Z(d), T = Z(h), [{ session: g, compileBus: u }] = b(() => {
334
+ const o = xe({
344
335
  plugins: n,
345
336
  theme: s
346
337
  });
347
338
  return {
348
- session: new qe(o),
349
- compileBus: ot(o)
339
+ session: new Le(o),
340
+ compileBus: lt(o)
350
341
  };
351
342
  }), [p] = b(() => {
352
- const o = le(n ?? []), m = le(s?.plugins ?? []);
343
+ const o = he(n ?? []), m = he(s?.plugins ?? []);
353
344
  return {
354
345
  errors: [...m.errors, ...o.errors],
355
346
  warnings: [...m.warnings, ...o.warnings]
356
347
  };
357
- }), R = oe(null), [y] = b(Tt), D = oe(null), w = f((o) => p.errors.length === 0 ? o : [...p.errors, ...o ?? []], [p]), N = f((o) => {
348
+ }), R = ce(null), [y] = b(Gt), w = ce(null), q = v((o) => p.errors.length === 0 ? o : [...p.errors, ...o ?? []], [p]), N = v((o) => {
358
349
  if (!o.ok) return o.errors;
359
- if (D.current) D.current.getState().setScene(o.scene);
350
+ if (w.current) w.current.getState().setScene(o.scene);
360
351
  else {
361
- const m = bt(o.scene);
362
- m.subscribe(y.notify), D.current = m, y.notify();
352
+ const m = Rt(o.scene);
353
+ m.subscribe(y.notify), w.current = m, y.notify();
363
354
  }
364
355
  return null;
365
- }, [y]), [A, _] = b(() => {
366
- const o = h.compile({
356
+ }, [y]), [A, k] = b(() => {
357
+ const o = g.compile({
367
358
  spec: e,
368
359
  data: t,
369
360
  colorScheme: r
370
361
  });
371
- return R.current = o, w(N(o));
372
- }), E = f((o) => o.ok ? [
362
+ return R.current = o, q(N(o));
363
+ }), E = v((o) => o.ok ? [
373
364
  ...o.warnings,
374
- ...ut(o.scene, c),
375
- ...mt(o.scene, c),
376
- ...ht(o.scene),
377
- ...gt(o.scene, c),
378
- ...ft(o.scene, c),
379
- ...dt(o.scene, c),
380
- ...pt(o.scene, i)
381
- ] : o.warnings, [c, i]), q = f((o) => {
382
- o.length !== 0 && (J(o), G.current?.(o));
383
- }, [G]), I = f((o) => {
365
+ ...gt(o.scene, i),
366
+ ...pt(o.scene, i),
367
+ ...vt(o.scene),
368
+ ...ft(o.scene, i),
369
+ ...St(o.scene, i),
370
+ ...bt(o.scene, i),
371
+ ...yt(o.scene, a)
372
+ ] : o.warnings, [i, a]), D = v((o) => {
373
+ o.length !== 0 && (J(o), C.current?.(o));
374
+ }, [C]), P = v((o) => {
384
375
  o.length !== 0 && (J(o), T.current?.(o));
385
376
  }, [T]);
386
377
  x(() => {
387
378
  const o = R.current;
388
- o && (q([...p.errors, ...o.ok ? [] : o.errors]), I([...p.warnings, ...E(o)]), o.ok && u.emit({ kind: "init" }));
379
+ o && (D([...p.errors, ...o.ok ? [] : o.errors]), P([...p.warnings, ...E(o)]), o.ok && u.emit({ kind: "init" }));
389
380
  }, [
390
381
  u,
391
- q,
392
- I,
382
+ D,
383
+ P,
393
384
  p,
394
385
  E
395
386
  ]), x(() => {
396
- const o = h.update({
387
+ const o = g.update({
397
388
  spec: e,
398
389
  data: t,
399
390
  colorScheme: r
400
391
  });
401
392
  if (!o) return;
402
- o.committedSpec && C.current?.(o.committedSpec);
393
+ o.committedSpec && G.current?.(o.committedSpec);
403
394
  const m = N(o.result);
404
- _(w(m)), m && q(m), I(E(o.result)), m || u.emit({ kind: o.specChanged ? "spec" : "data" });
395
+ k(q(m)), m && D(m), P(E(o.result)), m || u.emit({ kind: o.specChanged ? "spec" : "data" });
405
396
  }, [
406
397
  e,
407
398
  t,
408
399
  r,
409
- h,
400
+ g,
410
401
  u,
411
402
  N,
403
+ D,
404
+ P,
412
405
  q,
413
- I,
414
- w,
415
406
  E,
416
- C
407
+ G
417
408
  ]);
418
- const k = f((o) => {
419
- _((m) => m === null ? m : w(null)), I(E(o));
409
+ const L = v((o) => {
410
+ k((m) => m === null ? m : q(null)), P(E(o));
420
411
  }, [
421
- w,
422
- I,
412
+ q,
413
+ P,
423
414
  E
424
- ]), B = f((o) => {
425
- o.scene && D.current?.getState().setScene(o.scene), o.result && k(o.result), o.command && u.emit({
415
+ ]), B = v((o) => {
416
+ o.scene && w.current?.getState().setScene(o.scene), o.result && L(o.result), o.command && u.emit({
426
417
  kind: "command",
427
418
  command: o.command
428
- }), o.spec && C.current?.(o.spec), o.errors && q([...o.errors]);
419
+ }), o.spec && G.current?.(o.spec), o.errors && D([...o.errors]);
429
420
  }, [
430
- k,
421
+ L,
431
422
  u,
432
- C,
433
- q
434
- ]), S = f((o) => {
423
+ G,
424
+ D
425
+ ]), S = v((o) => {
435
426
  for (const m of o) B(m);
436
427
  return o.some((m) => !!m.scene);
437
- }, [B]), O = f((o, m) => {
438
- S(h.applyCommand(o, m));
439
- }, [h, S]), P = f(() => {
440
- S(h.commit());
441
- }, [h, S]), K = f(() => S(h.undo()), [h, S]), L = f(() => S(h.redo()), [h, S]), X = M(() => ({
442
- stack: h.history,
428
+ }, [B]), O = v((o, m) => {
429
+ S(g.applyCommand(o, m));
430
+ }, [g, S]), I = v(() => {
431
+ S(g.commit());
432
+ }, [g, S]), K = v(() => S(g.undo()), [g, S]), $ = v(() => S(g.redo()), [g, S]), Q = _(() => ({
433
+ stack: g.history,
443
434
  undo: K,
444
- redo: L
435
+ redo: $
445
436
  }), [
446
- h,
437
+ g,
447
438
  K,
448
- L
449
- ]), ye = f(() => D.current?.getState().scene ?? null, []);
439
+ $
440
+ ]), Te = v(() => w.current?.getState().scene ?? null, []);
450
441
  return {
451
- store: D.current,
442
+ store: w.current,
452
443
  dispatch: O,
453
- commit: P,
454
- history: X,
444
+ commit: I,
445
+ history: Q,
455
446
  subscribe: y.subscribe,
456
- getScene: ye,
447
+ getScene: Te,
457
448
  compileBus: u,
458
449
  compileErrors: A
459
450
  };
460
- }, Tt = () => {
451
+ }, Gt = () => {
461
452
  const e = /* @__PURE__ */ new Set();
462
453
  return {
463
454
  subscribe: (t) => (e.add(t), () => {
@@ -465,375 +456,448 @@ var bt = (e) => te((t) => ({
465
456
  }),
466
457
  notify: () => e.forEach((t) => t())
467
458
  };
468
- }, Rt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: c, onSpecChange: i, onError: l, onWarnings: d, colorScheme: g = "light", children: C }) => {
469
- const [G] = b(() => n), T = G?.colorScheme ?? g, [h] = b(() => be([...G?.plugins ?? [], ...r].filter(pe))), u = Oe(), [p] = b(() => we(r)), [R] = b(() => _e(r)), [y] = b(() => tt()), [D] = b(() => Se()), w = M(() => me({ colorScheme: T }), [T]), { store: N, dispatch: A, commit: _, history: E, subscribe: q, getScene: I, compileBus: k, compileErrors: B } = Et({
459
+ }, Ct = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: i, onSpecChange: a, onError: l, onWarnings: d, colorScheme: h = "light", children: G }) => {
460
+ const [C] = b(() => n), T = C?.colorScheme ?? h, [g] = b(() => we([...C?.plugins ?? [], ...r].filter(Se))), u = je(), [p] = b(() => Me(r)), [R] = b(() => He(r)), [y] = b(() => ot()), [w] = b(() => Ge()), q = _(() => ye({ colorScheme: T }), [T]), { store: N, dispatch: A, commit: k, history: E, subscribe: D, getScene: P, compileBus: L, compileErrors: B } = Nt({
470
461
  spec: t,
471
462
  data: e,
472
463
  colorScheme: T,
473
464
  plugins: r,
474
- theme: G,
475
- resolveRenderer: h,
465
+ theme: C,
466
+ resolveRenderer: g,
476
467
  anchorResolver: p,
477
- onSpecChange: i,
468
+ onSpecChange: a,
478
469
  onError: l,
479
470
  onWarnings: d
480
471
  });
481
472
  x(() => {
482
473
  if (N)
483
- return N.subscribe((P, K) => {
484
- if (P.scene.spec === K.scene.spec) return;
485
- const { selection: L, setSelection: X } = y.getState();
486
- L.length !== 0 && X(Ze(L, P.scene.spec));
474
+ return N.subscribe((I, K) => {
475
+ if (I.scene.spec === K.scene.spec) return;
476
+ const { selection: $, setSelection: Q } = y.getState();
477
+ $.length !== 0 && Q(nt($, I.scene.spec));
487
478
  });
488
479
  }, [N, y]);
489
- const S = M(() => ({
480
+ const S = _(() => ({
490
481
  dispatch: A,
491
- commit: _
492
- }), [A, _]);
493
- Ke(c, () => ({
482
+ commit: k
483
+ }), [A, k]);
484
+ We(i, () => ({
494
485
  commands: S,
495
486
  undo: E.undo,
496
487
  redo: E.redo,
497
- subscribe: q,
498
- getScene: I,
488
+ subscribe: D,
489
+ getScene: P,
499
490
  getSelection: () => y.getState().selection,
500
- setSelection: (P) => y.getState().setSelection(P),
491
+ setSelection: (I) => y.getState().setSelection(I),
501
492
  subscribeSelection: y.subscribe,
502
493
  canPlaceDataLabels: R.hasCapability,
503
494
  canFormatDataLabelsAsPercentages: R.hasPercentageFormat
504
495
  }), [
505
496
  S,
506
497
  E,
507
- q,
508
- I,
498
+ D,
499
+ P,
509
500
  y,
510
501
  R
511
502
  ]);
512
- const O = M(() => N ? {
503
+ const O = _(() => N ? {
513
504
  chartId: u,
514
505
  store: N,
515
506
  selectionStore: y,
516
- targetBoundaryStore: D,
507
+ targetBoundaryStore: w,
517
508
  commands: S,
518
509
  history: E,
519
510
  formattingLocale: s,
520
- compileBus: k,
511
+ compileBus: L,
521
512
  colorScheme: T,
522
- styleResolver: w,
513
+ styleResolver: q,
523
514
  anchorResolver: p
524
515
  } : null, [
525
516
  u,
526
517
  N,
527
518
  y,
528
- D,
519
+ w,
529
520
  S,
530
521
  E,
531
522
  s,
532
- k,
523
+ L,
533
524
  T,
534
- w,
525
+ q,
535
526
  p
536
527
  ]);
537
- return /* @__PURE__ */ a(Qe, {
528
+ return /* @__PURE__ */ c(rt, {
538
529
  forcedErrors: B,
539
530
  onError: l,
540
531
  resetKeys: [t, e],
541
- children: O ? /* @__PURE__ */ a(Ce.Provider, {
532
+ children: O ? /* @__PURE__ */ c(Ne.Provider, {
542
533
  value: O,
543
- children: /* @__PURE__ */ a(Ee, {
544
- value: h,
545
- children: /* @__PURE__ */ a(Ne, {
534
+ children: /* @__PURE__ */ c(Pe, {
535
+ value: g,
536
+ children: /* @__PURE__ */ c(qe, {
546
537
  value: R,
547
- children: /* @__PURE__ */ a(H, {
548
- shapes: G?.shapes,
549
- children: C
538
+ children: /* @__PURE__ */ c(H, {
539
+ shapes: C?.shapes,
540
+ children: G
550
541
  })
551
542
  })
552
543
  })
553
544
  }) : null
554
545
  });
555
546
  };
556
- function Jr({ theme: e, ...t } = {}) {
557
- const r = ke(t);
547
+ function sn({ theme: e, ...t } = {}) {
548
+ const r = Ae(t);
558
549
  return {
559
550
  ...r,
560
- GraphProvider: (s) => /* @__PURE__ */ a(Rt, {
551
+ GraphProvider: (s) => /* @__PURE__ */ c(Ct, {
561
552
  ...s,
562
553
  plugins: r.plugins,
563
554
  theme: e
564
555
  })
565
556
  };
566
557
  }
567
- var Nt = ({ shouldAnimateTransitions: e, cx: t, cy: r, r: n, ...s }) => e ? /* @__PURE__ */ a(V.circle, {
568
- initial: !1,
569
- animate: {
558
+ var U = (e, t) => {
559
+ if (typeof e != "string" || !e.endsWith("%")) return null;
560
+ const r = Number.parseFloat(e);
561
+ return Number.isFinite(r) ? r / 100 * t : null;
562
+ }, wt = ({ x: e, y: t, width: r, height: n }, s) => {
563
+ const i = U(e, s.width), a = U(t, s.height), l = U(r, s.width), d = U(n, s.height);
564
+ return i === null || a === null || l === null || d === null ? null : {
565
+ x: i,
566
+ y: a,
567
+ width: l,
568
+ height: d
569
+ };
570
+ }, Dt = ({ shouldAnimateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
571
+ const a = Y(s);
572
+ return e ? /* @__PURE__ */ c(X.circle, {
573
+ initial: !1,
574
+ animate: {
575
+ cx: t,
576
+ cy: r,
577
+ r: n
578
+ },
579
+ transition: V,
580
+ style: a,
581
+ ...i
582
+ }) : /* @__PURE__ */ c("circle", {
570
583
  cx: t,
571
584
  cy: r,
572
- r: n
573
- },
574
- transition: j,
575
- ...s
576
- }) : /* @__PURE__ */ a("circle", {
577
- cx: t,
578
- cy: r,
579
- r: n,
580
- ...s
581
- }), Ct = ({ shouldAnimateTransitions: e, x1: t, y1: r, x2: n, y2: s, ...c }) => e ? /* @__PURE__ */ a(V.line, {
582
- initial: !1,
583
- animate: {
585
+ r: n,
586
+ style: a,
587
+ ...i
588
+ });
589
+ }, Pt = ({ shouldAnimateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
590
+ const l = Y(i);
591
+ return e ? /* @__PURE__ */ c(X.line, {
592
+ initial: !1,
593
+ animate: {
594
+ x1: t,
595
+ y1: r,
596
+ x2: n,
597
+ y2: s
598
+ },
599
+ transition: V,
600
+ style: l,
601
+ ...a
602
+ }) : /* @__PURE__ */ c("line", {
584
603
  x1: t,
585
604
  y1: r,
586
605
  x2: n,
587
- y2: s
588
- },
589
- transition: j,
590
- ...c
591
- }) : /* @__PURE__ */ a("line", {
592
- x1: t,
593
- y1: r,
594
- x2: n,
595
- y2: s,
596
- ...c
597
- }), Gt = ({ shouldAnimateTransitions: e, x: t, y: r, width: n, height: s, ...c }) => e ? /* @__PURE__ */ a(V.rect, {
598
- initial: !1,
599
- animate: {
600
- attrX: t,
601
- attrY: r,
606
+ y2: s,
607
+ style: l,
608
+ ...a
609
+ });
610
+ }, qt = ({ shouldAnimateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
611
+ const h = Y(l);
612
+ return e ? /* @__PURE__ */ c(X.rect, {
613
+ initial: !1,
614
+ animate: {
615
+ attrX: t,
616
+ attrY: r,
617
+ width: n,
618
+ height: s,
619
+ ...i !== void 0 && a !== void 0 ? {
620
+ rx: i,
621
+ ry: a
622
+ } : {}
623
+ },
624
+ transition: V,
625
+ style: h,
626
+ ...d
627
+ }) : /* @__PURE__ */ c("rect", {
628
+ x: t,
629
+ y: r,
602
630
  width: n,
603
- height: s
604
- },
605
- transition: j,
606
- ...c
607
- }) : /* @__PURE__ */ a("rect", {
608
- x: t,
609
- y: r,
610
- width: n,
611
- height: s,
612
- ...c
613
- }), Dt = ({ shouldAnimateTransitions: e, d: t, source: r, ...n }) => e ? /* @__PURE__ */ a(qt, {
614
- d: t,
615
- source: r,
616
- ...n
617
- }) : /* @__PURE__ */ a("path", {
618
- d: t,
619
- ...n
620
- }), Qr = (e) => {
621
- const { Circle: t } = W();
622
- return t === void 0 ? Nt(e) : /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(t, { ...e }) });
623
- }, Zr = (e) => {
624
- const { Line: t } = W();
625
- return t === void 0 ? Ct(e) : /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(t, { ...e }) });
626
- }, en = (e) => {
627
- const { Rect: t } = W();
628
- return t === void 0 ? Gt(e) : /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(t, { ...e }) });
629
- }, tn = (e) => {
630
- const { Path: t } = W();
631
- return t === void 0 ? Dt(e) : /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(t, { ...e }) });
632
- }, qt = ({ d: e, source: t, ...r }) => {
633
- const n = Te(e, j, t);
634
- return /* @__PURE__ */ a(V.path, {
631
+ height: s,
632
+ rx: i,
633
+ ry: a,
634
+ style: h,
635
+ ...d
636
+ });
637
+ }, It = ({ shouldAnimateTransitions: e, d: t, source: r, effects: n, ...s }) => {
638
+ const i = Y(n);
639
+ return e ? /* @__PURE__ */ c(_t, {
640
+ d: t,
641
+ source: r,
642
+ style: i,
643
+ ...s
644
+ }) : /* @__PURE__ */ c("path", {
645
+ d: t,
646
+ style: i,
647
+ ...s
648
+ });
649
+ }, on = (e) => {
650
+ const { Circle: t } = z();
651
+ return t === void 0 ? Dt(e) : /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(t, { ...e }) });
652
+ }, an = (e) => {
653
+ const { Line: t } = z();
654
+ return t === void 0 ? Pt(e) : /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(t, { ...e }) });
655
+ }, cn = ({ cornerRadius: e, ...t }) => {
656
+ const { Rect: r } = z(), n = fe(), s = De(), i = {
657
+ ...t,
658
+ ...kt(e, t, n, s)
659
+ };
660
+ return r === void 0 ? qt(i) : /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(r, { ...i }) });
661
+ }, ln = (e) => {
662
+ const { Path: t } = z();
663
+ return t === void 0 ? It(e) : /* @__PURE__ */ c(H, { children: /* @__PURE__ */ c(t, { ...e }) });
664
+ }, _t = ({ d: e, source: t, ...r }) => {
665
+ const n = Ie(e, V, t);
666
+ return /* @__PURE__ */ c(X.path, {
635
667
  d: n,
636
668
  ...r
637
669
  });
638
- }, rn = ({ children: e, ...t }) => /* @__PURE__ */ a("svg", {
639
- viewBox: "0 0 1 1",
640
- preserveAspectRatio: "none",
641
- width: "100%",
642
- height: "100%",
643
- pointerEvents: "none",
644
- ...t,
645
- children: e
646
- }), nn = ({ box: e, children: t }) => /* @__PURE__ */ a("svg", {
647
- x: F(e.x0),
648
- y: F(e.y0),
649
- width: F(e.x1 - e.x0),
650
- height: F(e.y1 - e.y0),
651
- overflow: "hidden",
652
- pointerEvents: "none",
653
- children: t
654
- }), It = "drqe3u0", wt = "drqe3u1", Pt = "drqe3u2", _t = "drqe3u3", $ = "drqe3u4", kt = "drqe3u5", Lt = "drqe3u6", $t = "drqe3u7", U = "drqe3u8", Mt = "drqe3u9", xt = "drqe3ua";
655
- var Ht = "drqe3uc", At = "drqe3ud", Bt = "drqe3ue", Ot = "drqe3uf";
656
- var Kt = "drqe3uh", Ft = "drqe3ui", de = {
670
+ }, kt = (e, t, r, n) => {
671
+ if (e === void 0) return {};
672
+ const s = Lt(t, r, n);
673
+ if (s === null)
674
+ return e === "full" ? {} : me(ie({ cornerRadius: e }), n);
675
+ const i = Math.min(ie({
676
+ cornerRadius: e,
677
+ box: s
678
+ }), Math.min(s.width, s.height) / 2);
679
+ return me(i, n);
680
+ }, Lt = (e, t, r) => typeof e.width == "number" && typeof e.height == "number" ? {
681
+ width: Math.abs(e.width) * r.x,
682
+ height: Math.abs(e.height) * r.y
683
+ } : t === null ? null : wt(e, t), me = (e, t) => ({
684
+ rx: e / t.x,
685
+ ry: e / t.y
686
+ }), dn = ({ children: e, ...t }) => {
687
+ const r = fe();
688
+ return /* @__PURE__ */ c("svg", {
689
+ viewBox: "0 0 1 1",
690
+ preserveAspectRatio: "none",
691
+ width: "100%",
692
+ height: "100%",
693
+ pointerEvents: "none",
694
+ ...t,
695
+ children: /* @__PURE__ */ c(ve, {
696
+ size: r,
697
+ space: "unit",
698
+ children: e
699
+ })
700
+ });
701
+ }, un = ({ box: e, children: t }) => {
702
+ const r = Re(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = _(() => n === null || s === null ? null : {
703
+ width: n,
704
+ height: s
705
+ }, [n, s]);
706
+ return /* @__PURE__ */ c("svg", {
707
+ x: F(e.x0),
708
+ y: F(e.y0),
709
+ width: F(e.x1 - e.x0),
710
+ height: F(e.y1 - e.y0),
711
+ overflow: "hidden",
712
+ pointerEvents: "none",
713
+ children: /* @__PURE__ */ c(ve, {
714
+ size: i,
715
+ children: t
716
+ })
717
+ });
718
+ }, $t = "drqe3u0", Mt = "drqe3u1", xt = "drqe3u2", Ht = "drqe3u3", M = "drqe3u4", At = "drqe3u5", Bt = "drqe3u6", Ot = "drqe3u7", j = "drqe3u8", Kt = "drqe3u9", Ft = "drqe3ua";
719
+ var Ut = "drqe3uc", jt = "drqe3ud", Wt = "drqe3ue", zt = "drqe3uf";
720
+ var Yt = "drqe3uh", Vt = "drqe3ui", ge = {
657
721
  enabled: "drqe3uk drqe3uj",
658
722
  disabled: "drqe3ul drqe3uj"
659
- }, ue = {
723
+ }, pe = {
660
724
  ran: "drqe3un drqe3um",
661
725
  dim: "drqe3uo drqe3um"
662
- }, ve = {
726
+ }, Ee = {
663
727
  ran: "drqe3uq drqe3up",
664
728
  cached: "drqe3ur drqe3up",
665
729
  untouched: "drqe3us drqe3up"
666
- }, sn = ({ width: e = 440, style: t, className: r } = {}) => {
667
- const { compileBus: n } = Z(), [s] = b(() => at()), [c, i] = b(!1), [l, d] = b($e);
730
+ }, hn = ({ width: e = 440, style: t, className: r } = {}) => {
731
+ const { compileBus: n } = te(), [s] = b(() => dt()), [i, a] = b(!1), [l, d] = b(Oe);
668
732
  x(() => {
669
733
  const { recordCompile: u } = s.getState(), p = n.getLastTrigger(), R = n.getLastCompile();
670
734
  return p && R && u(p, R), n.subscribe(u);
671
735
  }, [s, n]);
672
- const g = Q(s, (u) => u.lastCompile), C = Q(s, (u) => u.history), G = n.getCacheStats(), T = g === null && C.length === 0, h = () => {
736
+ const h = ee(s, (u) => u.lastCompile), G = ee(s, (u) => u.history), C = n.getCacheStats(), T = h === null && G.length === 0, g = () => {
673
737
  d((u) => {
674
738
  const p = !u;
675
- return xe(p), p;
739
+ return Fe(p), p;
676
740
  });
677
741
  };
678
- return /* @__PURE__ */ v("div", {
679
- className: Ye(xt, r),
742
+ return /* @__PURE__ */ f("div", {
743
+ className: Ve(Ft, r),
680
744
  style: {
681
745
  width: e,
682
746
  ...t
683
747
  },
684
748
  children: [
685
- /* @__PURE__ */ v("div", {
686
- className: It,
687
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ a("div", {
688
- className: wt,
749
+ /* @__PURE__ */ f("div", {
750
+ className: $t,
751
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ c("div", {
752
+ className: Mt,
689
753
  children: "compile cache"
690
- }), /* @__PURE__ */ a("div", {
691
- className: Bt,
692
- children: T ? "production: stats disabled" : g ? `last: ${g.label} · ${re(g.durationMs)}` : "awaiting first compile…"
693
- })] }), /* @__PURE__ */ a("button", {
754
+ }), /* @__PURE__ */ c("div", {
755
+ className: Wt,
756
+ children: T ? "production: stats disabled" : h ? `last: ${h.label} · ${se(h.durationMs)}` : "awaiting first compile…"
757
+ })] }), /* @__PURE__ */ c("button", {
694
758
  type: "button",
695
- onClick: () => i((u) => !u),
696
- className: Ot,
697
- children: c ? "▾" : "▴"
759
+ onClick: () => a((u) => !u),
760
+ className: zt,
761
+ children: i ? "▾" : "▴"
698
762
  })]
699
763
  }),
700
- !c && /* @__PURE__ */ v("div", {
764
+ !i && /* @__PURE__ */ f("div", {
701
765
  className: "drqe3ub",
702
- children: [/* @__PURE__ */ v("button", {
766
+ children: [/* @__PURE__ */ f("button", {
703
767
  type: "button",
704
- onClick: h,
705
- className: l ? de.enabled : de.disabled,
768
+ onClick: g,
769
+ className: l ? ge.enabled : ge.disabled,
706
770
  "aria-pressed": l,
707
771
  children: ["cache ", l ? "enabled" : "disabled"]
708
- }), /* @__PURE__ */ a("span", {
772
+ }), /* @__PURE__ */ c("span", {
709
773
  className: "drqe3ug",
710
774
  children: "next compile reflects this toggle"
711
775
  })]
712
776
  }),
713
- !c && !T && /* @__PURE__ */ v(Ue, { children: [/* @__PURE__ */ a(Ut, {
714
- delta: g?.stages,
715
- durations: g?.stageDurationsMs,
716
- cumulative: G
717
- }), /* @__PURE__ */ a(Yt, { entries: C })] })
777
+ !i && !T && /* @__PURE__ */ f(Ye, { children: [/* @__PURE__ */ c(Xt, {
778
+ delta: h?.stages,
779
+ durations: h?.stageDurationsMs,
780
+ cumulative: C
781
+ }), /* @__PURE__ */ c(Qt, { entries: G })] })
718
782
  ]
719
783
  });
720
- }, Ut = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ v("table", {
721
- className: Pt,
722
- children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ v("tr", {
723
- className: Kt,
784
+ }, Xt = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
785
+ className: xt,
786
+ children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ f("tr", {
787
+ className: Yt,
724
788
  children: [
725
- /* @__PURE__ */ a("th", {
726
- className: _t,
789
+ /* @__PURE__ */ c("th", {
790
+ className: Ht,
727
791
  children: "stage"
728
792
  }),
729
- /* @__PURE__ */ a("th", {
730
- className: $,
793
+ /* @__PURE__ */ c("th", {
794
+ className: M,
731
795
  children: "time"
732
796
  }),
733
- /* @__PURE__ */ a("th", {
734
- className: $,
797
+ /* @__PURE__ */ c("th", {
798
+ className: M,
735
799
  children: "Δ miss"
736
800
  }),
737
- /* @__PURE__ */ a("th", {
738
- className: $,
801
+ /* @__PURE__ */ c("th", {
802
+ className: M,
739
803
  children: "Δ hit"
740
804
  }),
741
- /* @__PURE__ */ a("th", {
742
- className: $,
805
+ /* @__PURE__ */ c("th", {
806
+ className: M,
743
807
  children: "total miss"
744
808
  }),
745
- /* @__PURE__ */ a("th", {
746
- className: $,
809
+ /* @__PURE__ */ c("th", {
810
+ className: M,
747
811
  children: "total hit"
748
812
  })
749
813
  ]
750
- }) }), /* @__PURE__ */ a("tbody", { children: ee.map((n) => {
751
- const s = e?.[n], c = jt(s);
752
- return /* @__PURE__ */ v("tr", {
753
- className: Ht,
814
+ }) }), /* @__PURE__ */ c("tbody", { children: re.map((n) => {
815
+ const s = e?.[n], i = Zt(s);
816
+ return /* @__PURE__ */ f("tr", {
817
+ className: Ut,
754
818
  children: [
755
- /* @__PURE__ */ v("td", {
756
- className: kt,
819
+ /* @__PURE__ */ f("td", {
820
+ className: At,
757
821
  children: [
758
- /* @__PURE__ */ a("span", {
759
- className: ve[c],
822
+ /* @__PURE__ */ c("span", {
823
+ className: Ee[i],
760
824
  "aria-hidden": !0
761
825
  }),
762
826
  " ",
763
827
  n
764
828
  ]
765
829
  }),
766
- /* @__PURE__ */ a("td", {
767
- className: U,
768
- children: t === void 0 || c === "untouched" ? "—" : re(t[n])
830
+ /* @__PURE__ */ c("td", {
831
+ className: j,
832
+ children: t === void 0 || i === "untouched" ? "—" : se(t[n])
769
833
  }),
770
- /* @__PURE__ */ a("td", {
771
- className: c === "ran" ? ue.ran : ue.dim,
834
+ /* @__PURE__ */ c("td", {
835
+ className: i === "ran" ? pe.ran : pe.dim,
772
836
  children: s?.misses ?? 0
773
837
  }),
774
- /* @__PURE__ */ a("td", {
775
- className: U,
838
+ /* @__PURE__ */ c("td", {
839
+ className: j,
776
840
  children: s?.hits ?? 0
777
841
  }),
778
- /* @__PURE__ */ a("td", {
779
- className: U,
842
+ /* @__PURE__ */ c("td", {
843
+ className: j,
780
844
  children: r[n].misses
781
845
  }),
782
- /* @__PURE__ */ a("td", {
783
- className: U,
846
+ /* @__PURE__ */ c("td", {
847
+ className: j,
784
848
  children: r[n].hits
785
849
  })
786
850
  ]
787
851
  }, n);
788
852
  }) })]
789
- }), Yt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
790
- className: At,
791
- children: [/* @__PURE__ */ a("div", {
792
- className: Ft,
853
+ }), Qt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
854
+ className: jt,
855
+ children: [/* @__PURE__ */ c("div", {
856
+ className: Vt,
793
857
  children: "recent compiles"
794
858
  }), e.map((t) => {
795
- const r = Vt(t.stages, (c) => c.misses > 0), n = ee.length;
796
- return /* @__PURE__ */ v("div", {
797
- className: Lt,
859
+ const r = Jt(t.stages, (i) => i.misses > 0), n = re.length;
860
+ return /* @__PURE__ */ f("div", {
861
+ className: Bt,
798
862
  children: [
799
- /* @__PURE__ */ a("span", {
800
- className: ve[r === 0 ? "cached" : "ran"],
863
+ /* @__PURE__ */ c("span", {
864
+ className: Ee[r === 0 ? "cached" : "ran"],
801
865
  "aria-hidden": !0
802
866
  }),
803
- /* @__PURE__ */ a("span", {
804
- className: $t,
867
+ /* @__PURE__ */ c("span", {
868
+ className: Ot,
805
869
  title: t.label,
806
870
  children: t.label
807
871
  }),
808
- /* @__PURE__ */ v("span", {
809
- className: Mt,
872
+ /* @__PURE__ */ f("span", {
873
+ className: Kt,
810
874
  children: [
811
875
  r,
812
876
  "/",
813
877
  n,
814
878
  " ran · ",
815
- re(t.durationMs)
879
+ se(t.durationMs)
816
880
  ]
817
881
  })
818
882
  ]
819
883
  }, t.id);
820
884
  })]
821
- }), jt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Vt = (e, t) => {
885
+ }), Zt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Jt = (e, t) => {
822
886
  let r = 0;
823
- for (const n of ee) t(e[n]) && (r += 1);
887
+ for (const n of re) t(e[n]) && (r += 1);
824
888
  return r;
825
- }, re = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, on = () => {
826
- const { history: e } = Z(), { stack: t, undo: r, redo: n } = e, s = f((l) => t.subscribe(l), [t]), c = f(() => t.getSnapshot(), [t]), i = Fe(s, c, c);
827
- return M(() => ({
828
- ...i,
889
+ }, se = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, mn = () => {
890
+ const { history: e } = te(), { stack: t, undo: r, redo: n } = e, s = v((l) => t.subscribe(l), [t]), i = v(() => t.getSnapshot(), [t]), a = ze(s, i, i);
891
+ return _(() => ({
892
+ ...a,
829
893
  undo: r,
830
894
  redo: n
831
895
  }), [
832
- i,
896
+ a,
833
897
  r,
834
898
  n
835
899
  ]);
836
- }, Wt = /* @__PURE__ */ new Set([
900
+ }, er = /* @__PURE__ */ new Set([
837
901
  "button",
838
902
  "checkbox",
839
903
  "color",
@@ -844,91 +908,95 @@ var Kt = "drqe3uh", Ft = "drqe3ui", de = {
844
908
  "range",
845
909
  "reset",
846
910
  "submit"
847
- ]), an = (e, t = {}) => {
911
+ ]), gn = (e, t = {}) => {
848
912
  const { target: r, enabled: n = !0 } = t;
849
913
  x(() => {
850
- const s = Xt(r);
914
+ const s = tr(r);
851
915
  if (!n || !s) return;
852
- const c = (i) => {
853
- if (!zt(i) || i.defaultPrevented || Jt(i.target)) return;
854
- const l = Re(i);
916
+ const i = (a) => {
917
+ if (!rr(a) || a.defaultPrevented || nr(a.target)) return;
918
+ const l = _e(a);
855
919
  if (!l) return;
856
920
  const d = e.current;
857
- d && (l === "undo" ? d.undo() : d.redo()) && i.preventDefault();
921
+ d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
858
922
  };
859
- return s.addEventListener("keydown", c), () => s.removeEventListener("keydown", c);
923
+ return s.addEventListener("keydown", i), () => s.removeEventListener("keydown", i);
860
924
  }, [
861
925
  e,
862
926
  r,
863
927
  n
864
928
  ]);
865
- }, Xt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, zt = (e) => "key" in e, Jt = (e) => e instanceof HTMLInputElement ? !Wt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, cn = () => {
866
- const { targetBoundaryStore: e } = Z();
867
- return Q(e, (t) => t.boundary);
929
+ }, tr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, rr = (e) => "key" in e, nr = (e) => e instanceof HTMLInputElement ? !er.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, pn = () => {
930
+ const { targetBoundaryStore: e } = te();
931
+ return ee(e, (t) => t.boundary);
868
932
  };
869
933
  export {
870
- rr as BrandMark,
871
- or as CanvasTextMeasurer,
872
- dr as DefaultFooter,
873
- Nt as DefaultGeomCircle,
874
- Ct as DefaultGeomLine,
875
- Dt as DefaultGeomPath,
876
- Gt as DefaultGeomRect,
877
- Hr as DefaultGrid,
878
- ir as DefaultHeader,
879
- ur as DefaultSwatch,
880
- vr as DefaultTooltip,
881
- sn as DevToolsPanel,
882
- Fr as GRAPH_MODES,
883
- Qr as GeomCircle,
884
- Zr as GeomLine,
885
- tn as GeomPath,
886
- en as GeomRect,
887
- Qe as GraphErrorBoundary,
888
- ae as GraphErrorPanel,
889
- Rt as GraphProvider,
890
- pr as GraphRenderer,
891
- tr as HoverProvider,
892
- nr as IntroFade,
893
- Lr as IntroWipeClip,
894
- ar as TextMeasurerProvider,
895
- br as ThemeProvider,
896
- nn as UnitBoxSvg,
897
- rn as UnitSpaceSvg,
898
- yr as buildDotsEditOutlineShapes,
899
- Jr as createGraphyKit,
934
+ yr as BrandMark,
935
+ jr as CanvasTextMeasurer,
936
+ Xr as DefaultFooter,
937
+ Dt as DefaultGeomCircle,
938
+ Pt as DefaultGeomLine,
939
+ It as DefaultGeomPath,
940
+ qt as DefaultGeomRect,
941
+ Ur as DefaultGrid,
942
+ gr as DefaultHeader,
943
+ br as DefaultSwatch,
944
+ Br as DefaultTooltip,
945
+ hn as DevToolsPanel,
946
+ cr as GRAPH_MODES,
947
+ on as GeomCircle,
948
+ an as GeomLine,
949
+ Lr as GeomOverpaint,
950
+ ln as GeomPath,
951
+ cn as GeomRect,
952
+ rt as GraphErrorBoundary,
953
+ le as GraphErrorPanel,
954
+ Ct as GraphProvider,
955
+ Rr as GraphRenderer,
956
+ kr as HoverProvider,
957
+ Kr as IntroFade,
958
+ Or as IntroWipeClip,
959
+ or as TextMeasurerProvider,
960
+ Mr as ThemeProvider,
961
+ un as UnitBoxSvg,
962
+ dn as UnitSpaceSvg,
963
+ Vr as buildDotsEditOutlineShapes,
964
+ sn as createGraphyKit,
900
965
  Pr as darkTheme,
901
- cr as defineGeomRenderer,
902
- Nr as lightTheme,
903
- Zt as lightenCss,
904
- $r as projectPointCartesian,
905
- Ze as pruneSelection,
906
- mr as resolveBrandMarkVisual,
907
- Ir as resolvePathStroke,
908
- Sr as scalePointToPanel,
909
- er as stampAxisEditTarget,
910
- Dr as stampGridEditTarget,
911
- lr as stampLegendEditTarget,
912
- Kr as useElementScreenRect,
913
- qr as useGeomHitTest,
914
- sr as useGeomHover,
915
- wr as useGeomReaderTree,
916
- Rr as useGeomStyleReader,
917
- _r as useGraphCommands,
918
- Cr as useGraphHandle,
919
- on as useGraphHistory,
920
- an as useGraphHistoryShortcuts,
921
- Gr as useGraphLocale,
922
- Tr as useGraphSelection,
923
- Or as useGuidesTakePress,
924
- xr as useHandleScene,
925
- Ar as useHoverState,
926
- fr as usePaintDefs,
927
- hr as useResolvedStyle,
928
- Br as useSceneSelector,
929
- Er as useStyleReaderTree,
930
- gr as useStyleResolver,
931
- cn as useTargetBoundary,
932
- Mr as useTextMeasurer,
933
- kr as vars
966
+ Sr as defineGeomRenderer,
967
+ Tr as lightTheme,
968
+ Ar as lightenCss,
969
+ Yr as projectPointCartesian,
970
+ nt as pruneSelection,
971
+ wt as readShapePixelRect,
972
+ U as readShapePixels,
973
+ dr as resolveBrandMarkVisual,
974
+ Er as resolvePathStroke,
975
+ Gr as scalePointToPanel,
976
+ _r as stampAxisEditTarget,
977
+ ur as stampGridEditTarget,
978
+ hr as stampLegendEditTarget,
979
+ fr as useElementScreenRect,
980
+ ar as useGeomHitTest,
981
+ mr as useGeomHover,
982
+ Re as useGeomPanelSize,
983
+ pr as useGeomReaderTree,
984
+ ir as useGeomStyleReader,
985
+ xr as useGraphCommands,
986
+ Ir as useGraphHandle,
987
+ mn as useGraphHistory,
988
+ gn as useGraphHistoryShortcuts,
989
+ Nr as useGraphLocale,
990
+ qr as useGraphSelection,
991
+ Wr as useGuidesTakePress,
992
+ Fr as useHandleScene,
993
+ Cr as useHoverState,
994
+ Dr as usePaintDefs,
995
+ Hr as useResolvedStyle,
996
+ lr as useSceneSelector,
997
+ zr as useStyleReaderTree,
998
+ vr as useStyleResolver,
999
+ pn as useTargetBoundary,
1000
+ wr as useTextMeasurer,
1001
+ $r as vars
934
1002
  };