@graphysdk/react-renderer 1.9.0-beta.1788895348418 → 1.9.0-beta.1789025801428

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,39 +1,39 @@
1
- import { Ct as _t, Ft as de, It as re, Lt as A, M as Dt, Mt as $t, Nt as xt, O as Ht, Pt as Mt, St as le, Tt as Pt, X as Lt, Y as Bt, _ as Kt, _t as ue, a as Ot, bt as me, ct as At, gt as K, i as jt, it as Ft, j as Ut, jt as Yt, k as Wt, lt as Vt, mt as Xt, n as Qt, pt as zt, r as Jt, rt as Zt, s as er, t as ge, tt as tr, vt as rr, wt as nr, xt as sr, yt as j } from "./history-chords-DhcO3NfJ.js";
2
- import { d as ir, t as he } from "./dev.utils-DT-z_GBs.js";
3
- import { COMPILER_STAGE_KEYS as F, Geom as pe, GraphCompilationSession as fe, areEditTargetsEqual as ve, buildDiagnostic as V, createAnchorResolver as ye, createCompiler as be, createGraphyBuilder as Se, createStyleResolver as Ee, findAnnotation as Ce, isCompilerCachingEnabled as Te, resolveDefinition as Ne, setCompilerCachingEnabled as Re, toPercent as P } from "@graphysdk/viz-engine";
4
- import { Component as qe, useCallback as f, useEffect as x, useId as Ge, useImperativeHandle as we, useMemo as $, useRef as X, useState as C, useSyncExternalStore as ke } from "react";
5
- import { Fragment as Ie, jsx as d, jsxs as v } from "react/jsx-runtime";
6
- import { useStore as Q } from "zustand";
1
+ import { Ct as Dt, Ft as le, It as ne, Lt as A, M as $t, Mt as xt, Nt as Ht, O as Mt, Pt as Lt, St as ue, Tt as Pt, X as Bt, Y as Kt, _ as Ot, _t as me, a as At, bt as he, ct as jt, gt as K, i as Ft, it as Ut, j as Yt, jt as Wt, k as Vt, lt as Xt, mt as Qt, n as zt, pt as Jt, r as Zt, rt as er, s as tr, t as ge, tt as rr, vt as nr, wt as sr, xt as or, yt as j } from "./history-chords-BtNvrHbM.js";
2
+ import { d as ar, t as pe } from "./dev.utils-DT-z_GBs.js";
3
+ import { COMPILER_STAGE_KEYS as F, Geom as fe, GraphCompilationSession as ve, areEditTargetsEqual as ye, buildDiagnostic as V, createAnchorResolver as be, createCompiler as Se, createGraphyBuilder as Ee, createStyleResolver as Ce, findAnnotation as Te, findLayerById as X, isCompilerCachingEnabled as Ne, resolveDefinition as Re, setCompilerCachingEnabled as qe, toPercent as L } from "@graphysdk/viz-engine";
4
+ import { Component as Ie, useCallback as f, useEffect as x, useId as ke, useImperativeHandle as Ge, useMemo as $, useRef as Q, useState as C, useSyncExternalStore as we } from "react";
5
+ import { Fragment as _e, jsx as d, jsxs as v } from "react/jsx-runtime";
6
+ import { useStore as z } from "zustand";
7
7
  import { createStore as U } from "zustand/vanilla";
8
- import _e from "clsx";
9
- import './index.css';var De = "_1a5iqpb0", $e = "_1a5iqpb1";
10
- var xe = "_1a5iqpb3", He = "_1a5iqpb4", Me = "_1a5iqpb5";
11
- var z = ({ errors: e }) => {
8
+ import De from "clsx";
9
+ import './index.css';var $e = "_1a5iqpb0", xe = "_1a5iqpb1";
10
+ var He = "_1a5iqpb3", Me = "_1a5iqpb4", Le = "_1a5iqpb5";
11
+ var J = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ v("div", {
14
14
  role: "alert",
15
- className: De,
15
+ className: $e,
16
16
  children: [
17
17
  /* @__PURE__ */ d("strong", {
18
- className: $e,
18
+ className: xe,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
- t && /* @__PURE__ */ d(J, { diagnostic: t }),
21
+ t && /* @__PURE__ */ d(Z, { diagnostic: t }),
22
22
  r.length > 0 && /* @__PURE__ */ d("ul", {
23
23
  className: "_1a5iqpb2",
24
- children: r.map((n, o) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(J, { diagnostic: n }) }, `${n.code}-${o}`))
24
+ children: r.map((n, o) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(Z, { diagnostic: n }) }, `${n.code}-${o}`))
25
25
  })
26
26
  ]
27
27
  });
28
- }, J = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
29
- className: xe,
28
+ }, Z = ({ diagnostic: e }) => /* @__PURE__ */ v("div", {
29
+ className: He,
30
30
  children: [
31
31
  /* @__PURE__ */ d("span", {
32
- className: He,
32
+ className: Me,
33
33
  children: e.code
34
34
  }),
35
35
  /* @__PURE__ */ d("p", {
36
- className: Me,
36
+ className: Le,
37
37
  children: e.message
38
38
  }),
39
39
  e.suggestion && /* @__PURE__ */ d("p", {
@@ -45,7 +45,7 @@ var z = ({ errors: e }) => {
45
45
  function Pe(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var Le = class extends qe {
48
+ var Be = class extends Ie {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
@@ -61,28 +61,28 @@ var Le = class extends qe {
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
64
- if (e) return /* @__PURE__ */ d(z, { errors: [e] });
64
+ if (e) return /* @__PURE__ */ d(J, { errors: [e] });
65
65
  const { forcedErrors: t, children: r } = this.props;
66
- return t && t.length > 0 ? /* @__PURE__ */ d(z, { errors: t }) : r;
66
+ return t && t.length > 0 ? /* @__PURE__ */ d(J, { errors: t }) : r;
67
67
  }
68
- }, ne = (e) => typeof e == "object" && "geom" in e && "render" in e, Be = (e) => {
69
- const t = Ne(e);
70
- return t instanceof pe ? t : null;
71
- }, Ke = (e, t) => {
72
- const r = e.filter((n) => Oe(n, t));
68
+ }, se = (e) => typeof e == "object" && "geom" in e && "render" in e, Ke = (e) => {
69
+ const t = Re(e);
70
+ return t instanceof fe ? t : null;
71
+ }, Oe = (e, t) => {
72
+ const r = e.filter((n) => Ae(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, Oe = (e, t) => e.kind !== "annotation" ? !0 : Ce(t.annotations, e.id) !== null, Z = [], Ae = () => U((e) => ({
75
- selection: Z,
76
- setSelection: (t) => e((r) => je(r.selection, t) ? r : { selection: t }),
77
- clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: Z })
78
- })), je = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
74
+ }, Ae = (e, t) => e.kind === "annotation" ? Te(t.annotations, e.id) !== null : e.kind === "observations" ? X(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? X(t.layers, e.layerId) !== void 0 : !0, ee = [], je = () => U((e) => ({
75
+ selection: ee,
76
+ setSelection: (t) => e((r) => Fe(r.selection, t) ? r : { selection: t }),
77
+ clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: ee })
78
+ })), Fe = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const o = t[n];
80
- return o !== void 0 && ve(r, o);
81
- }), Fe = 5, Ue = (e) => {
82
- if (!he) return {
80
+ return o !== void 0 && ye(r, o);
81
+ }), Ue = 5, Ye = (e) => {
82
+ if (!pe) return {
83
83
  emit: () => {
84
84
  },
85
- subscribe: () => We,
85
+ subscribe: () => Ve,
86
86
  getLastTrigger: () => null,
87
87
  getLastCompile: () => null,
88
88
  getCacheStats: () => e.getCacheStats()
@@ -104,7 +104,7 @@ var Le = class extends qe {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, Ye = () => U((e) => ({
107
+ }, We = () => U((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -113,19 +113,19 @@ var Le = class extends qe {
113
113
  if (n.lastSnapshot === r) return n;
114
114
  const o = {
115
115
  id: n.nextId,
116
- label: Ve(t),
116
+ label: Xe(t),
117
117
  stages: r.stages,
118
118
  durationMs: r.durationMs
119
119
  };
120
120
  return {
121
121
  lastCompile: o,
122
- history: Xe(n.history, o, Fe),
122
+ history: Qe(n.history, o, Ue),
123
123
  nextId: n.nextId + 1,
124
124
  lastSnapshot: r
125
125
  };
126
126
  })
127
- })), We = () => {
128
- }, Ve = (e) => {
127
+ })), Ve = () => {
128
+ }, Xe = (e) => {
129
129
  switch (e.kind) {
130
130
  case "init":
131
131
  return "init";
@@ -136,14 +136,14 @@ var Le = class extends qe {
136
136
  case "command":
137
137
  return e.command.metadata.description;
138
138
  }
139
- }, Xe = (e, t, r) => {
139
+ }, Qe = (e, t, r) => {
140
140
  const n = e.length >= r ? e.length - (r - 1) : 0;
141
141
  return [...e.slice(n), t];
142
142
  };
143
- function Qe(e) {
144
- const t = e.filter(ne), r = /* @__PURE__ */ new Set([...Object.keys(me), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
143
+ function ze(e) {
144
+ const t = e.filter(se), r = /* @__PURE__ */ new Set([...Object.keys(he), ...t.map((c) => c.geom)]), n = [], o = /* @__PURE__ */ new Set();
145
145
  for (const c of e) {
146
- const u = Be(c);
146
+ const u = Ke(c);
147
147
  u === null || r.has(u.type) || o.has(u.type) || (o.add(u.type), n.push({
148
148
  kind: "user-input",
149
149
  severity: "error",
@@ -184,7 +184,7 @@ function Qe(e) {
184
184
  warnings: i
185
185
  };
186
186
  }
187
- function ze(e, t) {
187
+ function Je(e, t) {
188
188
  const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
189
189
  for (const i of n)
190
190
  t(i.geom, r.type) !== null || o.has(i.geom) || (o.add(i.geom), a.push({
@@ -200,7 +200,7 @@ function ze(e, t) {
200
200
  }));
201
201
  return a;
202
202
  }
203
- function Je(e, t) {
203
+ function Ze(e, t) {
204
204
  const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
205
205
  for (const i of n) {
206
206
  if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
@@ -219,7 +219,7 @@ function Je(e, t) {
219
219
  }
220
220
  return a;
221
221
  }
222
- function Ze(e) {
222
+ function et(e) {
223
223
  const t = /* @__PURE__ */ new Set(), r = [];
224
224
  for (const n of e.layers) {
225
225
  const o = n.identityKey;
@@ -237,7 +237,7 @@ function Ze(e) {
237
237
  }
238
238
  return r;
239
239
  }
240
- function et(e, t) {
240
+ function tt(e, t) {
241
241
  const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
242
242
  for (const i of n) {
243
243
  if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || o.has(i.geom)) continue;
@@ -256,7 +256,7 @@ function et(e, t) {
256
256
  }
257
257
  return a;
258
258
  }
259
- function tt(e, t) {
259
+ function rt(e, t) {
260
260
  const r = /* @__PURE__ */ new Set(), n = [];
261
261
  for (const o of e.layers)
262
262
  o.interactive !== !1 && (o.spatialKind !== "render-hit-test" || r.has(o.geom) || t.hasCapability(o.geom) || (r.add(o.geom), n.push({
@@ -272,7 +272,7 @@ function tt(e, t) {
272
272
  })));
273
273
  return n;
274
274
  }
275
- function rt(e, t) {
275
+ function nt(e, t) {
276
276
  const { coordSystem: r, layers: n } = e, o = /* @__PURE__ */ new Set(), a = [];
277
277
  for (const i of n) {
278
278
  if (i.interactive === !1 || i.spatialKind === "render-hit-test" || o.has(i.geom)) continue;
@@ -291,56 +291,56 @@ function rt(e, t) {
291
291
  }
292
292
  return a;
293
293
  }
294
- var nt = (e) => U((t) => ({
294
+ var st = (e) => U((t) => ({
295
295
  compiled: e,
296
296
  setCompiled: (r) => t((n) => n.compiled === r ? n : { compiled: r })
297
- })), st = ({ input: e, data: t, customPalettes: r, colorScheme: n, plugins: o, resolveRenderer: a, anchorResolver: i, onChange: c, onError: u, onWarnings: m }) => {
298
- const T = K(c), w = K(u), q = K(m), [{ session: g, compileBus: l }] = C(() => {
299
- const s = be({ plugins: o });
297
+ })), ot = ({ input: e, data: t, customPalettes: r, colorScheme: n, plugins: o, resolveRenderer: a, anchorResolver: i, onChange: c, onError: u, onWarnings: m }) => {
298
+ const T = K(c), k = K(u), q = K(m), [{ session: h, compileBus: l }] = C(() => {
299
+ const s = Se({ plugins: o });
300
300
  return {
301
- session: new fe(s),
302
- compileBus: Ue(s)
301
+ session: new ve(s),
302
+ compileBus: Ye(s)
303
303
  };
304
- }), [p] = C(() => Qe(o ?? [])), y = X(null), [k] = C(ot), N = X(null), b = f((s) => p.errors.length === 0 ? s : [...p.errors, ...s ?? []], [p]), _ = f((s) => {
304
+ }), [p] = C(() => ze(o ?? [])), y = Q(null), [G] = C(it), N = Q(null), b = f((s) => p.errors.length === 0 ? s : [...p.errors, ...s ?? []], [p]), _ = f((s) => {
305
305
  if (!s.ok) return s.errors;
306
306
  if (N.current) N.current.getState().setCompiled(s.compiled);
307
307
  else {
308
- const h = nt(s.compiled);
309
- h.subscribe(k.notify), N.current = h, k.notify();
308
+ const g = st(s.compiled);
309
+ g.subscribe(G.notify), N.current = g, G.notify();
310
310
  }
311
311
  return null;
312
- }, [k]), [H, D] = C(() => {
313
- const s = g.compile({
312
+ }, [G]), [H, D] = C(() => {
313
+ const s = h.compile({
314
314
  input: e,
315
315
  data: t,
316
316
  customPalettes: r,
317
317
  colorScheme: n
318
318
  });
319
319
  return y.current = s, b(_(s));
320
- }), G = f((s) => s.ok ? [
320
+ }), I = f((s) => s.ok ? [
321
321
  ...s.warnings,
322
- ...ze(s.compiled, a),
323
322
  ...Je(s.compiled, a),
324
- ...Ze(s.compiled),
325
- ...et(s.compiled, a),
326
- ...rt(s.compiled, a),
327
- ...tt(s.compiled, i)
323
+ ...Ze(s.compiled, a),
324
+ ...et(s.compiled),
325
+ ...tt(s.compiled, a),
326
+ ...nt(s.compiled, a),
327
+ ...rt(s.compiled, i)
328
328
  ] : s.warnings, [a, i]), S = f((s) => {
329
- s.length !== 0 && (A(s), w.current?.(s));
330
- }, [w]), R = f((s) => {
329
+ s.length !== 0 && (A(s), k.current?.(s));
330
+ }, [k]), R = f((s) => {
331
331
  s.length !== 0 && (A(s), q.current?.(s));
332
332
  }, [q]);
333
333
  x(() => {
334
334
  const s = y.current;
335
- s && (S([...p.errors, ...s.ok ? [] : s.errors]), R([...p.warnings, ...G(s)]), s.ok && l.emit({ kind: "init" }));
335
+ s && (S([...p.errors, ...s.ok ? [] : s.errors]), R([...p.warnings, ...I(s)]), s.ok && l.emit({ kind: "init" }));
336
336
  }, [
337
337
  l,
338
338
  S,
339
339
  R,
340
340
  p,
341
- G
341
+ I
342
342
  ]), x(() => {
343
- const s = g.update({
343
+ const s = h.update({
344
344
  input: e,
345
345
  data: t,
346
346
  customPalettes: r,
@@ -348,65 +348,65 @@ var nt = (e) => U((t) => ({
348
348
  });
349
349
  if (!s) return;
350
350
  s.sealedInput && T.current?.(s.sealedInput);
351
- const h = _(s.result);
352
- D(b(h)), h && S(h), R(G(s.result)), h || l.emit({ kind: s.inputChanged ? "input" : "data" });
351
+ const g = _(s.result);
352
+ D(b(g)), g && S(g), R(I(s.result)), g || l.emit({ kind: s.inputChanged ? "input" : "data" });
353
353
  }, [
354
354
  e,
355
355
  t,
356
356
  r,
357
357
  n,
358
- g,
358
+ h,
359
359
  l,
360
360
  _,
361
361
  S,
362
362
  R,
363
363
  b,
364
- G,
364
+ I,
365
365
  T
366
366
  ]);
367
- const I = f((s) => {
368
- D((h) => h === null ? h : b(null)), R(G(s));
367
+ const w = f((s) => {
368
+ D((g) => g === null ? g : b(null)), R(I(s));
369
369
  }, [
370
370
  b,
371
371
  R,
372
- G
372
+ I
373
373
  ]), M = f((s) => {
374
- s.compiled && N.current?.getState().setCompiled(s.compiled), s.result && I(s.result), s.command && l.emit({
374
+ s.compiled && N.current?.getState().setCompiled(s.compiled), s.result && w(s.result), s.command && l.emit({
375
375
  kind: "command",
376
376
  command: s.command
377
377
  }), s.input && T.current?.(s.input), s.errors && S([...s.errors]);
378
378
  }, [
379
- I,
379
+ w,
380
380
  l,
381
381
  T,
382
382
  S
383
383
  ]), E = f((s) => {
384
- for (const h of s) M(h);
385
- return s.some((h) => !!h.compiled);
386
- }, [M]), B = f((s, h) => {
387
- E(g.applyCommand(s, h));
388
- }, [g, E]), ie = f(() => {
389
- E(g.seal());
390
- }, [g, E]), Y = f(() => E(g.undo()), [g, E]), W = f(() => E(g.redo()), [g, E]), ae = $(() => ({
391
- stack: g.history,
384
+ for (const g of s) M(g);
385
+ return s.some((g) => !!g.compiled);
386
+ }, [M]), B = f((s, g) => {
387
+ E(h.applyCommand(s, g));
388
+ }, [h, E]), ae = f(() => {
389
+ E(h.seal());
390
+ }, [h, E]), Y = f(() => E(h.undo()), [h, E]), W = f(() => E(h.redo()), [h, E]), ce = $(() => ({
391
+ stack: h.history,
392
392
  undo: Y,
393
393
  redo: W
394
394
  }), [
395
- g,
395
+ h,
396
396
  Y,
397
397
  W
398
- ]), ce = f(() => N.current?.getState().compiled ?? null, []);
398
+ ]), de = f(() => N.current?.getState().compiled ?? null, []);
399
399
  return {
400
400
  store: N.current,
401
401
  dispatch: B,
402
- seal: ie,
403
- history: ae,
404
- subscribe: k.subscribe,
405
- getCompiled: ce,
402
+ seal: ae,
403
+ history: ce,
404
+ subscribe: G.subscribe,
405
+ getCompiled: de,
406
406
  compileBus: l,
407
407
  compileErrors: H
408
408
  };
409
- }, ot = () => {
409
+ }, it = () => {
410
410
  const e = /* @__PURE__ */ new Set();
411
411
  return {
412
412
  subscribe: (t) => (e.add(t), () => {
@@ -414,39 +414,39 @@ var nt = (e) => U((t) => ({
414
414
  }),
415
415
  notify: () => e.forEach((t) => t())
416
416
  };
417
- }, it = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: a, onError: i, onWarnings: c, customPalettes: u, colorScheme: m = "light", children: T }) => {
418
- const [w] = C(() => ue(r.filter(ne))), q = Ge(), [g] = C(() => ye(r)), [l] = C(() => Ae()), p = $(() => Ee({ colorScheme: m }), [m]), { store: y, dispatch: k, seal: N, history: b, subscribe: _, getCompiled: H, compileBus: D, compileErrors: G } = st({
417
+ }, at = ({ data: e, input: t, plugins: r = [], formattingLocale: n, handleRef: o, onChange: a, onError: i, onWarnings: c, customPalettes: u, colorScheme: m = "light", children: T }) => {
418
+ const [k] = C(() => me(r.filter(se))), q = ke(), [h] = C(() => be(r)), [l] = C(() => je()), p = $(() => Ce({ colorScheme: m }), [m]), { store: y, dispatch: G, seal: N, history: b, subscribe: _, getCompiled: H, compileBus: D, compileErrors: I } = ot({
419
419
  input: t,
420
420
  data: e,
421
421
  customPalettes: u,
422
422
  colorScheme: m,
423
423
  plugins: r,
424
- resolveRenderer: w,
425
- anchorResolver: g,
424
+ resolveRenderer: k,
425
+ anchorResolver: h,
426
426
  onChange: a,
427
427
  onError: i,
428
428
  onWarnings: c
429
429
  });
430
430
  x(() => {
431
431
  if (y)
432
- return y.subscribe((I, M) => {
433
- if (I.compiled.spec === M.compiled.spec) return;
432
+ return y.subscribe((w, M) => {
433
+ if (w.compiled.spec === M.compiled.spec) return;
434
434
  const { selection: E, setSelection: B } = l.getState();
435
- E.length !== 0 && B(Ke(E, I.compiled.spec));
435
+ E.length !== 0 && B(Oe(E, w.compiled.spec));
436
436
  });
437
437
  }, [y, l]);
438
438
  const S = $(() => ({
439
- dispatch: k,
439
+ dispatch: G,
440
440
  seal: N
441
- }), [k, N]);
442
- we(o, () => ({
441
+ }), [G, N]);
442
+ Ge(o, () => ({
443
443
  commands: S,
444
444
  undo: b.undo,
445
445
  redo: b.redo,
446
446
  subscribe: _,
447
447
  getCompiled: H,
448
448
  getSelection: () => l.getState().selection,
449
- setSelection: (I) => l.getState().setSelection(I),
449
+ setSelection: (w) => l.getState().setSelection(w),
450
450
  subscribeSelection: l.subscribe
451
451
  }), [
452
452
  S,
@@ -465,7 +465,7 @@ var nt = (e) => U((t) => ({
465
465
  compileBus: D,
466
466
  colorScheme: m,
467
467
  styleResolver: p,
468
- anchorResolver: g
468
+ anchorResolver: h
469
469
  } : null, [
470
470
  q,
471
471
  y,
@@ -476,32 +476,32 @@ var nt = (e) => U((t) => ({
476
476
  D,
477
477
  m,
478
478
  p,
479
- g
479
+ h
480
480
  ]);
481
- return /* @__PURE__ */ d(Le, {
482
- forcedErrors: G,
481
+ return /* @__PURE__ */ d(Be, {
482
+ forcedErrors: I,
483
483
  onError: i,
484
484
  resetKeys: [t, e],
485
- children: R ? /* @__PURE__ */ d(de.Provider, {
485
+ children: R ? /* @__PURE__ */ d(le.Provider, {
486
486
  value: R,
487
- children: /* @__PURE__ */ d(le, {
488
- value: w,
487
+ children: /* @__PURE__ */ d(ue, {
488
+ value: k,
489
489
  children: T
490
490
  })
491
491
  }) : null
492
492
  });
493
493
  };
494
494
  function gr(e) {
495
- const t = Se(e);
495
+ const t = Ee(e);
496
496
  return {
497
497
  ...t,
498
- GraphProvider: (n) => /* @__PURE__ */ d(it, {
498
+ GraphProvider: (n) => /* @__PURE__ */ d(at, {
499
499
  ...n,
500
500
  plugins: t.plugins
501
501
  })
502
502
  };
503
503
  }
504
- var hr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
504
+ var pr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
505
505
  viewBox: "0 0 1 1",
506
506
  preserveAspectRatio: "none",
507
507
  width: "100%",
@@ -509,57 +509,57 @@ var hr = ({ children: e, ...t }) => /* @__PURE__ */ d("svg", {
509
509
  pointerEvents: "none",
510
510
  ...t,
511
511
  children: e
512
- }), pr = ({ box: e, children: t }) => /* @__PURE__ */ d("svg", {
513
- x: P(e.x0),
514
- y: P(e.y0),
515
- width: P(e.x1 - e.x0),
516
- height: P(e.y1 - e.y0),
512
+ }), fr = ({ box: e, children: t }) => /* @__PURE__ */ d("svg", {
513
+ x: L(e.x0),
514
+ y: L(e.y0),
515
+ width: L(e.x1 - e.x0),
516
+ height: L(e.y1 - e.y0),
517
517
  overflow: "hidden",
518
518
  pointerEvents: "none",
519
519
  children: t
520
- }), at = "drqe3u0", ct = "drqe3u1", dt = "drqe3u2", lt = "drqe3u3", L = "drqe3u4", ut = "drqe3u5", mt = "drqe3u6", gt = "drqe3u7", O = "drqe3u8", ht = "drqe3u9", pt = "drqe3ua";
521
- var ft = "drqe3uc", vt = "drqe3ud", yt = "drqe3ue", bt = "drqe3uf";
522
- var St = "drqe3uh", Et = "drqe3ui", ee = {
520
+ }), ct = "drqe3u0", dt = "drqe3u1", lt = "drqe3u2", ut = "drqe3u3", P = "drqe3u4", mt = "drqe3u5", ht = "drqe3u6", gt = "drqe3u7", O = "drqe3u8", pt = "drqe3u9", ft = "drqe3ua";
521
+ var vt = "drqe3uc", yt = "drqe3ud", bt = "drqe3ue", St = "drqe3uf";
522
+ var Et = "drqe3uh", Ct = "drqe3ui", te = {
523
523
  enabled: "drqe3uk drqe3uj",
524
524
  disabled: "drqe3ul drqe3uj"
525
- }, te = {
525
+ }, re = {
526
526
  ran: "drqe3un drqe3um",
527
527
  dim: "drqe3uo drqe3um"
528
- }, se = {
528
+ }, oe = {
529
529
  ran: "drqe3uq drqe3up",
530
530
  cached: "drqe3ur drqe3up",
531
531
  untouched: "drqe3us drqe3up"
532
- }, fr = ({ width: e = 380, style: t, className: r } = {}) => {
533
- const { compileBus: n } = re(), [o] = C(() => Ye()), [a, i] = C(!1), [c, u] = C(Te);
532
+ }, vr = ({ width: e = 380, style: t, className: r } = {}) => {
533
+ const { compileBus: n } = ne(), [o] = C(() => We()), [a, i] = C(!1), [c, u] = C(Ne);
534
534
  x(() => {
535
535
  const { recordCompile: l } = o.getState(), p = n.getLastTrigger(), y = n.getLastCompile();
536
536
  return p && y && l(p, y), n.subscribe(l);
537
537
  }, [o, n]);
538
- const m = Q(o, (l) => l.lastCompile), T = Q(o, (l) => l.history), w = n.getCacheStats(), q = m === null && T.length === 0, g = () => {
538
+ const m = z(o, (l) => l.lastCompile), T = z(o, (l) => l.history), k = n.getCacheStats(), q = m === null && T.length === 0, h = () => {
539
539
  u((l) => {
540
540
  const p = !l;
541
- return Re(p), p;
541
+ return qe(p), p;
542
542
  });
543
543
  };
544
544
  return /* @__PURE__ */ v("div", {
545
- className: _e(pt, r),
545
+ className: De(ft, r),
546
546
  style: {
547
547
  width: e,
548
548
  ...t
549
549
  },
550
550
  children: [
551
551
  /* @__PURE__ */ v("div", {
552
- className: at,
552
+ className: ct,
553
553
  children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ d("div", {
554
- className: ct,
554
+ className: dt,
555
555
  children: "compile cache"
556
556
  }), /* @__PURE__ */ d("div", {
557
- className: yt,
558
- children: q ? "production: stats disabled" : m ? `last: ${m.label} · ${oe(m.durationMs)}` : "awaiting first compile…"
557
+ className: bt,
558
+ children: q ? "production: stats disabled" : m ? `last: ${m.label} · ${ie(m.durationMs)}` : "awaiting first compile…"
559
559
  })] }), /* @__PURE__ */ d("button", {
560
560
  type: "button",
561
561
  onClick: () => i((l) => !l),
562
- className: bt,
562
+ className: St,
563
563
  children: a ? "▾" : "▴"
564
564
  })]
565
565
  }),
@@ -567,8 +567,8 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
567
567
  className: "drqe3ub",
568
568
  children: [/* @__PURE__ */ v("button", {
569
569
  type: "button",
570
- onClick: g,
571
- className: c ? ee.enabled : ee.disabled,
570
+ onClick: h,
571
+ className: c ? te.enabled : te.disabled,
572
572
  "aria-pressed": c,
573
573
  children: ["cache ", c ? "enabled" : "disabled"]
574
574
  }), /* @__PURE__ */ d("span", {
@@ -576,48 +576,48 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
576
576
  children: "next compile reflects this toggle"
577
577
  })]
578
578
  }),
579
- !a && !q && /* @__PURE__ */ v(Ie, { children: [/* @__PURE__ */ d(Ct, {
579
+ !a && !q && /* @__PURE__ */ v(_e, { children: [/* @__PURE__ */ d(Tt, {
580
580
  delta: m?.stages,
581
- cumulative: w
582
- }), /* @__PURE__ */ d(Tt, { entries: T })] })
581
+ cumulative: k
582
+ }), /* @__PURE__ */ d(Nt, { entries: T })] })
583
583
  ]
584
584
  });
585
- }, Ct = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
586
- className: dt,
585
+ }, Tt = ({ delta: e, cumulative: t }) => /* @__PURE__ */ v("table", {
586
+ className: lt,
587
587
  children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ v("tr", {
588
- className: St,
588
+ className: Et,
589
589
  children: [
590
590
  /* @__PURE__ */ d("th", {
591
- className: lt,
591
+ className: ut,
592
592
  children: "stage"
593
593
  }),
594
594
  /* @__PURE__ */ d("th", {
595
- className: L,
595
+ className: P,
596
596
  children: "Δ miss"
597
597
  }),
598
598
  /* @__PURE__ */ d("th", {
599
- className: L,
599
+ className: P,
600
600
  children: "Δ hit"
601
601
  }),
602
602
  /* @__PURE__ */ d("th", {
603
- className: L,
603
+ className: P,
604
604
  children: "total miss"
605
605
  }),
606
606
  /* @__PURE__ */ d("th", {
607
- className: L,
607
+ className: P,
608
608
  children: "total hit"
609
609
  })
610
610
  ]
611
611
  }) }), /* @__PURE__ */ d("tbody", { children: F.map((r) => {
612
- const n = e?.[r], o = Nt(n);
612
+ const n = e?.[r], o = Rt(n);
613
613
  return /* @__PURE__ */ v("tr", {
614
- className: ft,
614
+ className: vt,
615
615
  children: [
616
616
  /* @__PURE__ */ v("td", {
617
- className: ut,
617
+ className: mt,
618
618
  children: [
619
619
  /* @__PURE__ */ d("span", {
620
- className: se[o],
620
+ className: oe[o],
621
621
  "aria-hidden": !0
622
622
  }),
623
623
  " ",
@@ -625,7 +625,7 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
625
625
  ]
626
626
  }),
627
627
  /* @__PURE__ */ d("td", {
628
- className: o === "ran" ? te.ran : te.dim,
628
+ className: o === "ran" ? re.ran : re.dim,
629
629
  children: n?.misses ?? 0
630
630
  }),
631
631
  /* @__PURE__ */ d("td", {
@@ -643,18 +643,18 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
643
643
  ]
644
644
  }, r);
645
645
  }) })]
646
- }), Tt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
647
- className: vt,
646
+ }), Nt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ v("div", {
647
+ className: yt,
648
648
  children: [/* @__PURE__ */ d("div", {
649
- className: Et,
649
+ className: Ct,
650
650
  children: "recent compiles"
651
651
  }), e.map((t) => {
652
- const r = Rt(t.stages, (a) => a.misses > 0), n = F.length;
652
+ const r = qt(t.stages, (a) => a.misses > 0), n = F.length;
653
653
  return /* @__PURE__ */ v("div", {
654
- className: mt,
654
+ className: ht,
655
655
  children: [
656
656
  /* @__PURE__ */ d("span", {
657
- className: se[r === 0 ? "cached" : "ran"],
657
+ className: oe[r === 0 ? "cached" : "ran"],
658
658
  "aria-hidden": !0
659
659
  }),
660
660
  /* @__PURE__ */ d("span", {
@@ -663,24 +663,24 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
663
663
  children: t.label
664
664
  }),
665
665
  /* @__PURE__ */ v("span", {
666
- className: ht,
666
+ className: pt,
667
667
  children: [
668
668
  r,
669
669
  "/",
670
670
  n,
671
671
  " ran · ",
672
- oe(t.durationMs)
672
+ ie(t.durationMs)
673
673
  ]
674
674
  })
675
675
  ]
676
676
  }, t.id);
677
677
  })]
678
- }), Nt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Rt = (e, t) => {
678
+ }), Rt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", qt = (e, t) => {
679
679
  let r = 0;
680
680
  for (const n of F) t(e[n]) && (r += 1);
681
681
  return r;
682
- }, oe = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, vr = () => {
683
- const { history: e } = re(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = ke(o, a, a);
682
+ }, ie = (e) => e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, yr = () => {
683
+ const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, o = f((c) => t.subscribe(c), [t]), a = f(() => t.getSnapshot(), [t]), i = we(o, a, a);
684
684
  return $(() => ({
685
685
  ...i,
686
686
  undo: r,
@@ -690,7 +690,7 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
690
690
  r,
691
691
  n
692
692
  ]);
693
- }, qt = /* @__PURE__ */ new Set([
693
+ }, It = /* @__PURE__ */ new Set([
694
694
  "button",
695
695
  "checkbox",
696
696
  "color",
@@ -701,13 +701,13 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
701
701
  "range",
702
702
  "reset",
703
703
  "submit"
704
- ]), yr = (e, t = {}) => {
704
+ ]), br = (e, t = {}) => {
705
705
  const { target: r, enabled: n = !0 } = t;
706
706
  x(() => {
707
- const o = Gt(r);
707
+ const o = kt(r);
708
708
  if (!n || !o) return;
709
709
  const a = (i) => {
710
- if (!wt(i) || i.defaultPrevented || kt(i.target)) return;
710
+ if (!Gt(i) || i.defaultPrevented || wt(i.target)) return;
711
711
  const c = ge(i);
712
712
  if (!c) return;
713
713
  const u = e.current;
@@ -719,45 +719,45 @@ var St = "drqe3uh", Et = "drqe3ui", ee = {
719
719
  r,
720
720
  n
721
721
  ]);
722
- }, Gt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, wt = (e) => "key" in e, kt = (e) => e instanceof HTMLInputElement ? !qt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
722
+ }, kt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Gt = (e) => "key" in e, wt = (e) => e instanceof HTMLInputElement ? !It.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1;
723
723
  export {
724
- Ut as BrandMark,
724
+ Yt as BrandMark,
725
725
  Pt as CanvasTextMeasurer,
726
- Wt as DefaultFooter,
727
- er as DefaultGrid,
728
- Ht as DefaultHeader,
729
- sr as DefaultSwatch,
730
- Bt as DefaultTooltip,
731
- fr as DevToolsPanel,
732
- Le as GraphErrorBoundary,
733
- z as GraphErrorPanel,
734
- it as GraphProvider,
735
- Ot as GraphRenderer,
736
- Xt as HoverProvider,
737
- _t as TextMeasurerProvider,
738
- tr as ThemeProvider,
739
- pr as UnitBoxSvg,
740
- hr as UnitSpaceSvg,
726
+ Vt as DefaultFooter,
727
+ tr as DefaultGrid,
728
+ Mt as DefaultHeader,
729
+ or as DefaultSwatch,
730
+ Kt as DefaultTooltip,
731
+ vr as DevToolsPanel,
732
+ Be as GraphErrorBoundary,
733
+ J as GraphErrorPanel,
734
+ at as GraphProvider,
735
+ At as GraphRenderer,
736
+ Qt as HoverProvider,
737
+ Dt as TextMeasurerProvider,
738
+ rr as ThemeProvider,
739
+ fr as UnitBoxSvg,
740
+ pr as UnitSpaceSvg,
741
741
  gr as createGraphyKit,
742
- Zt as darkTheme,
743
- rr as defineGeomRenderer,
744
- Ft as lightTheme,
745
- Yt as lightenCss,
746
- Ke as pruneSelection,
747
- Dt as resolveBrandMarkVisual,
748
- Mt as useCompiledSelector,
749
- Vt as useElementScreenRect,
750
- zt as useGeomHitTest,
751
- At as useGeomHover,
752
- Qt as useGraphCommands,
753
- jt as useGraphHandle,
754
- vr as useGraphHistory,
755
- yr as useGraphHistoryShortcuts,
756
- Kt as useGraphSelection,
757
- Jt as useHandleCompiled,
758
- Lt as useHoverState,
759
- $t as useStyleReaders,
760
- xt as useStyleResolver,
761
- nr as useTextMeasurer,
762
- ir as vars
742
+ er as darkTheme,
743
+ nr as defineGeomRenderer,
744
+ Ut as lightTheme,
745
+ Wt as lightenCss,
746
+ Oe as pruneSelection,
747
+ $t as resolveBrandMarkVisual,
748
+ Lt as useCompiledSelector,
749
+ Xt as useElementScreenRect,
750
+ Jt as useGeomHitTest,
751
+ jt as useGeomHover,
752
+ zt as useGraphCommands,
753
+ Ft as useGraphHandle,
754
+ yr as useGraphHistory,
755
+ br as useGraphHistoryShortcuts,
756
+ Ot as useGraphSelection,
757
+ Zt as useHandleCompiled,
758
+ Bt as useHoverState,
759
+ xt as useStyleReaders,
760
+ Ht as useStyleResolver,
761
+ sr as useTextMeasurer,
762
+ ar as vars
763
763
  };