@pixerate/editor 0.236.0 → 0.238.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/index.cjs +40 -39
  3. package/dist/agent/index.js +9 -8
  4. package/dist/animation/index.cjs +7 -6
  5. package/dist/animation/index.js +6 -5
  6. package/dist/animation-editor/index.cjs +66 -65
  7. package/dist/animation-editor/index.js +9 -8
  8. package/dist/{brushstrokeRender-WDTKD54B.cjs → brushstrokeRender-MPOM7BFW.cjs} +7 -5
  9. package/dist/{brushstrokeRender-MAHOXL7K.js → brushstrokeRender-WB67GMUP.js} +4 -2
  10. package/dist/canvas/index.cjs +55 -54
  11. package/dist/canvas/index.js +10 -9
  12. package/dist/chart/index.cjs +159 -158
  13. package/dist/chart/index.js +9 -8
  14. package/dist/{chunk-L6Y7TSQ4.js → chunk-36ZTV7WO.js} +1 -1
  15. package/dist/{chunk-JVNGCS26.js → chunk-3E36VDMJ.js} +1 -1
  16. package/dist/{chunk-WRZ6C4TU.cjs → chunk-3R5P3DVY.cjs} +6 -6
  17. package/dist/{chunk-RUONPPMC.cjs → chunk-44BMJJVA.cjs} +8 -8
  18. package/dist/{chunk-YBAPT7NL.js → chunk-6ADHGQ73.js} +4 -2
  19. package/dist/chunk-7AHBW2CQ.cjs +200 -0
  20. package/dist/{chunk-EUIDTZNQ.cjs → chunk-7PT4RJL5.cjs} +113 -111
  21. package/dist/{chunk-CU6ANS5L.js → chunk-7YGBSFC6.js} +2 -2
  22. package/dist/{chunk-ATKKG76G.cjs → chunk-AD7GA3TL.cjs} +23 -23
  23. package/dist/{chunk-FSLKBQU7.js → chunk-AIS56JOO.js} +3 -3
  24. package/dist/{chunk-5VQXSS2S.cjs → chunk-BBUE3UJL.cjs} +86 -86
  25. package/dist/{chunk-7272D3K2.js → chunk-BP6KSGVD.js} +6 -4
  26. package/dist/{chunk-F6R67I3A.js → chunk-CXXXAZ7H.js} +1 -1
  27. package/dist/{chunk-5DQPDXOM.cjs → chunk-D2SGV525.cjs} +76 -76
  28. package/dist/chunk-F67XMVDI.js +200 -0
  29. package/dist/{chunk-PHYOZK3B.js → chunk-FQVVO5YA.js} +85 -8
  30. package/dist/{chunk-UXETV2NC.cjs → chunk-GA4EU4P3.cjs} +4 -4
  31. package/dist/{chunk-UFEDHACQ.js → chunk-GXAK6Q5J.js} +2 -2
  32. package/dist/{chunk-MHLU6GRJ.js → chunk-JEGJP4OW.js} +7 -196
  33. package/dist/{chunk-GOBOCZZI.js → chunk-LEQKZGQI.js} +1 -1
  34. package/dist/{chunk-M5GLQQWG.cjs → chunk-LJZRHVZV.cjs} +2 -2
  35. package/dist/{chunk-N76AMOKE.cjs → chunk-MOW3JMNG.cjs} +42 -42
  36. package/dist/{chunk-WKMUBATU.js → chunk-N4DFDI73.js} +1 -1
  37. package/dist/{chunk-GNZI3KYK.cjs → chunk-NKTNLJUJ.cjs} +49 -9
  38. package/dist/{chunk-TQOL6CF7.js → chunk-PJYG6FCF.js} +49 -9
  39. package/dist/{chunk-V3L7U63N.cjs → chunk-PP6BXVRL.cjs} +1 -1
  40. package/dist/{chunk-TFF2GTGN.cjs → chunk-PPFJHTW5.cjs} +24 -22
  41. package/dist/{chunk-6ZZKRH7R.js → chunk-QARCM66V.js} +3 -3
  42. package/dist/{chunk-5UEFBM2M.cjs → chunk-RD7RX52G.cjs} +18 -207
  43. package/dist/{chunk-CDP2AKMA.js → chunk-RV5DKZHU.js} +1 -1
  44. package/dist/{chunk-HUAISCUX.cjs → chunk-T7KQEMAE.cjs} +18 -18
  45. package/dist/{chunk-BQE3Y6ZO.cjs → chunk-THXFU3JB.cjs} +5 -5
  46. package/dist/{chunk-4ZC5QJE2.cjs → chunk-UTI5IITZ.cjs} +3 -3
  47. package/dist/{chunk-XSVUNSDJ.js → chunk-UUBO6RB5.js} +1 -1
  48. package/dist/{chunk-WPWHT4Z6.cjs → chunk-UZU6DIZA.cjs} +221 -144
  49. package/dist/{chunk-M2TPMYJE.js → chunk-V6DT2CDH.js} +1 -1
  50. package/dist/{chunk-WV5WTOC6.cjs → chunk-W7GRGGBH.cjs} +16 -16
  51. package/dist/{chunk-23E5GI2U.js → chunk-WGN7AUKB.js} +2 -2
  52. package/dist/{chunk-YMREOA67.js → chunk-XK4SST43.js} +2 -2
  53. package/dist/{chunk-SOSBOS5T.cjs → chunk-XWOLPNBW.cjs} +22 -22
  54. package/dist/{chunk-ILP77UD6.js → chunk-YGQVCQTG.js} +1 -1
  55. package/dist/{chunk-GXLZZVR5.cjs → chunk-ZXNO3ZOX.cjs} +37 -37
  56. package/dist/color/index.cjs +6 -4
  57. package/dist/color/index.js +9 -7
  58. package/dist/export/index.cjs +8 -7
  59. package/dist/export/index.js +7 -6
  60. package/dist/extensions/index.cjs +13 -10
  61. package/dist/extensions/index.js +12 -9
  62. package/dist/extensions/loading-node.d.cts +45 -1
  63. package/dist/extensions/loading-node.d.ts +45 -1
  64. package/dist/gradient/index.cjs +29 -28
  65. package/dist/gradient/index.js +4 -3
  66. package/dist/image-editor/index.cjs +778 -777
  67. package/dist/image-editor/index.js +9 -8
  68. package/dist/index.cjs +19 -16
  69. package/dist/index.js +13 -10
  70. package/dist/paint-editor/controller.d.cts +31 -1
  71. package/dist/paint-editor/controller.d.ts +31 -1
  72. package/dist/paint-editor/index.cjs +403 -195
  73. package/dist/paint-editor/index.js +231 -23
  74. package/dist/paint-editor/sticker-tools.d.cts +1 -1
  75. package/dist/paint-editor/sticker-tools.d.ts +1 -1
  76. package/dist/paint-editor/stickers.d.cts +10 -3
  77. package/dist/paint-editor/stickers.d.ts +10 -3
  78. package/dist/paint-editor/ui.d.cts +10 -3
  79. package/dist/paint-editor/ui.d.ts +10 -3
  80. package/dist/tokens/index.cjs +4 -3
  81. package/dist/tokens/index.js +3 -2
  82. package/dist/typography/index.cjs +8 -7
  83. package/dist/typography/index.js +3 -2
  84. package/dist/vector/index.cjs +967 -966
  85. package/dist/vector/index.js +9 -8
  86. package/dist/video-editor/index.cjs +7 -6
  87. package/dist/video-editor/index.js +6 -5
  88. package/package.json +1 -1
  89. package/skills/pixerate-color/SKILL.md +3 -0
  90. package/skills/pixerate-image-editor/SKILL.md +1 -0
  91. package/skills/pixerate-paint-editor/SKILL.md +6 -2
@@ -14,7 +14,7 @@ var _chunkTTCJPX4Ucjs = require('./chunk-TTCJPX4U.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkN76AMOKEcjs = require('./chunk-N76AMOKE.cjs');
17
+ var _chunkMOW3JMNGcjs = require('./chunk-MOW3JMNG.cjs');
18
18
 
19
19
 
20
20
 
@@ -47,7 +47,7 @@ var _chunkN76AMOKEcjs = require('./chunk-N76AMOKE.cjs');
47
47
 
48
48
 
49
49
 
50
- var _chunkWRZ6C4TUcjs = require('./chunk-WRZ6C4TU.cjs');
50
+ var _chunk3R5P3DVYcjs = require('./chunk-3R5P3DVY.cjs');
51
51
 
52
52
 
53
53
 
@@ -86,7 +86,7 @@ var csvField = (text) => /[",\n]|^\s|\s$/.test(text) ? `"${text.replace(/"/g, '"
86
86
  var treemapName = (name) => !name.includes('"') ? `"${name}"` : !name.includes("'") ? `'${name}'` : `"${name.replace(/"/g, "'")}"`;
87
87
  var yamlText = (text) => /^[\w][\w .,!?()/&+-]*$/.test(text) && !/:\s/.test(text) ? text : JSON.stringify(text);
88
88
  function chartMermaidFamily(spec) {
89
- const family = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, spec);
89
+ const family = _chunk3R5P3DVYcjs.chartFamily.call(void 0, spec);
90
90
  if (family === "sankey" && _optionalChain([spec, 'access', _2 => _2.links, 'optionalAccess', _3 => _3.length])) return "sankey";
91
91
  if (family === "treemap" || family === "sunburst") return "treemap";
92
92
  if (family === "pie" || family === "funnel" || family === "parliament") return "pie";
@@ -139,7 +139,7 @@ function chartToMermaid(spec, options = {}) {
139
139
  lines.push("treemap-beta");
140
140
  if (spec.title) lines.push(`title ${spec.title}`);
141
141
  const first = _nullishCoalesce(visible[0], () => ( spec.series[0]));
142
- const tree = spec.tree.length ? spec.tree : _chunkWRZ6C4TUcjs.chartTreeFromSeries.call(void 0, spec.categories, _nullishCoalesce(_optionalChain([first, 'optionalAccess', _4 => _4.values]), () => ( [])));
142
+ const tree = spec.tree.length ? spec.tree : _chunk3R5P3DVYcjs.chartTreeFromSeries.call(void 0, spec.categories, _nullishCoalesce(_optionalChain([first, 'optionalAccess', _4 => _4.values]), () => ( [])));
143
143
  const write = (nodes, depth) => {
144
144
  for (const n of nodes) {
145
145
  const pad = ind.repeat(depth);
@@ -274,8 +274,8 @@ function chartFromMermaid(text, options = {}) {
274
274
  let title = _nullishCoalesce(frontTitle, () => ( ""));
275
275
  const categories = [];
276
276
  const series = [];
277
- const xAxis = _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, false);
278
- const yAxis = _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, true);
277
+ const xAxis = _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, false);
278
+ const yAxis = _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, true);
279
279
  const radarAxes = [];
280
280
  const pieSlices = [];
281
281
  let legendShow = true;
@@ -437,7 +437,7 @@ function chartFromMermaid(text, options = {}) {
437
437
  input.series = metaSeries.map((extra, i) => ({ ..._nullishCoalesce(base[i], () => ( {})), ..._nullishCoalesce(extra, () => ( {})) }));
438
438
  }
439
439
  }
440
- const { spec, issues: specIssues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
440
+ const { spec, issues: specIssues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
441
441
  if (!family && !partial && !issues.length) issues.push({ path: "header", message: "The text is empty: expected a chart header (xychart-beta, pie, radar-beta, sankey-beta or treemap-beta)." });
442
442
  return { spec, issues: [...issues, ...specIssues], family, hasMeta: !!meta };
443
443
  }
@@ -467,7 +467,7 @@ function readWholeMermaid(family, all, headerLine, partial, title, issues) {
467
467
  const tree = items.map(toNode);
468
468
  const leaf = (n) => !n.children;
469
469
  const flatOrOneLevel = tree.every(leaf) || tree.every((n) => _optionalChain([n, 'access', _18 => _18.children, 'optionalAccess', _19 => _19.every, 'call', _20 => _20(leaf)]));
470
- return { type: flatOrOneLevel ? "treemap" : "sunburst", title: name, tree, categories: tree.map((n) => n.name), series: [{ id: "series-1", name: "Values", values: tree.map(_chunkWRZ6C4TUcjs.chartTreeTotal) }] };
470
+ return { type: flatOrOneLevel ? "treemap" : "sunburst", title: name, tree, categories: tree.map((n) => n.name), series: [{ id: "series-1", name: "Values", values: tree.map(_chunk3R5P3DVYcjs.chartTreeTotal) }] };
471
471
  }
472
472
  function findMermaidCharts(text) {
473
473
  const lines = text.replace(/^/, "").split(/\r?\n/);
@@ -512,11 +512,11 @@ function findMermaidCharts(text) {
512
512
  }
513
513
 
514
514
  // src/chart/summary.ts
515
- function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunkN76AMOKEcjs.layoutChart.call(void 0, spec, { ...size, selection: null })) {
515
+ function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunkMOW3JMNGcjs.layoutChart.call(void 0, spec, { ...size, selection: null })) {
516
516
  const visible = spec.series.filter((s) => !s.hidden);
517
- const series = visible.map((s) => _chunkN76AMOKEcjs.summarizeChartSeries.call(void 0, s, spec.categories));
518
- const colors = _chunkWRZ6C4TUcjs.chartSpecColorsByCategory.call(void 0, spec) ? spec.categories.map((_, i) => _optionalChain([visible, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.pointColors, 'optionalAccess', _26 => _26[i]]) || _chunkWRZ6C4TUcjs.chartSliceColor.call(void 0, spec, i)) : visible.map((s) => _chunkWRZ6C4TUcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s)));
519
- const check = _chunkWRZ6C4TUcjs.checkChartColors.call(void 0, colors, { surface: scene.theme.surface.startsWith("var(") ? "#ffffff" : scene.theme.surface });
517
+ const series = visible.map((s) => _chunkMOW3JMNGcjs.summarizeChartSeries.call(void 0, s, spec.categories));
518
+ const colors = _chunk3R5P3DVYcjs.chartSpecColorsByCategory.call(void 0, spec) ? spec.categories.map((_, i) => _optionalChain([visible, 'access', _24 => _24[0], 'optionalAccess', _25 => _25.pointColors, 'optionalAccess', _26 => _26[i]]) || _chunk3R5P3DVYcjs.chartSliceColor.call(void 0, spec, i)) : visible.map((s) => _chunk3R5P3DVYcjs.chartSeriesColor.call(void 0, spec, spec.series.indexOf(s)));
519
+ const check = _chunk3R5P3DVYcjs.checkChartColors.call(void 0, colors, { surface: scene.theme.surface.startsWith("var(") ? "#ffffff" : scene.theme.surface });
520
520
  const axis = (s, a) => s ? { min: s.domain[0], max: s.domain[1], ticks: [...s.ticks], ...s.logBase ? { logBase: s.logBase } : {}, ...a.reverse ? { reversed: true } : {} } : void 0;
521
521
  return {
522
522
  type: spec.type,
@@ -531,12 +531,12 @@ function summarizeChart(spec, size = { width: 640, height: 400 }, scene = _chunk
531
531
  description: describeChart(spec, series)
532
532
  };
533
533
  }
534
- function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) => _chunkN76AMOKEcjs.summarizeChartSeries.call(void 0, s, spec.categories))) {
535
- const kind = _chunkWRZ6C4TUcjs.CHART_TYPE_LABELS[spec.type].toLowerCase();
534
+ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((s) => _chunkMOW3JMNGcjs.summarizeChartSeries.call(void 0, s, spec.categories))) {
535
+ const kind = _chunk3R5P3DVYcjs.CHART_TYPE_LABELS[spec.type].toLowerCase();
536
536
  const parts = [];
537
- const family = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, spec);
537
+ const family = _chunk3R5P3DVYcjs.chartFamily.call(void 0, spec);
538
538
  const format = spec.yAxis.format;
539
- const fmt = (v) => v === null ? "blank" : _chunkN76AMOKEcjs.formatChartNumber.call(void 0, v, format);
539
+ const fmt = (v) => v === null ? "blank" : _chunkMOW3JMNGcjs.formatChartNumber.call(void 0, v, format);
540
540
  const head = spec.title ? `${spec.title}: a ${kind} chart` : `A ${kind} chart`;
541
541
  if (!series.length || series.every((s) => s.count === 0)) return `${head} with no data.`;
542
542
  if (family === "pie" || family === "funnel" || family === "treemap" || family === "sunburst") {
@@ -546,16 +546,16 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
546
546
  parts.push(`${head} of ${s.name} across ${spec.categories.length} categories, totalling ${fmt(s.sum)}.`);
547
547
  parts.push(`The largest is ${s.maxAt} at ${fmt(s.max)}${share(s.max)}; the smallest is ${s.minAt} at ${fmt(s.min)}${share(s.min)}.`);
548
548
  if (spec.tree.length) {
549
- const depth = _chunkWRZ6C4TUcjs.chartTreeDepth.call(void 0, spec.tree);
550
- const items = _chunkWRZ6C4TUcjs.chartTreeToRows.call(void 0, spec.tree).length;
549
+ const depth = _chunk3R5P3DVYcjs.chartTreeDepth.call(void 0, spec.tree);
550
+ const items = _chunk3R5P3DVYcjs.chartTreeToRows.call(void 0, spec.tree).length;
551
551
  parts.push(`The data is grouped ${depth} level${depth === 1 ? "" : "s"} deep with ${items} item${items === 1 ? "" : "s"}.`);
552
552
  }
553
553
  return parts.join(" ");
554
554
  }
555
555
  if (family === "choropleth") {
556
556
  const s = spec.series.find((x) => !x.hidden);
557
- const map = _chunkN76AMOKEcjs.getChartMap.call(void 0, spec.map);
558
- const matches = map ? _chunkN76AMOKEcjs.matchChartMapRegions.call(void 0, map, spec.categories) : spec.categories.map(() => null);
557
+ const map = _chunkMOW3JMNGcjs.getChartMap.call(void 0, spec.map);
558
+ const matches = map ? _chunkMOW3JMNGcjs.matchChartMapRegions.call(void 0, map, spec.categories) : spec.categories.map(() => null);
559
559
  const rows = spec.categories.flatMap((c, i) => matches[i] && s.values[i] !== null ? [{ name: matches[i].name, v: s.values[i] }] : []).sort((a, b) => b.v - a.v);
560
560
  const missing = spec.categories.filter((_, i) => !matches[i]).length;
561
561
  if (!rows.length) return `${head} of ${_nullishCoalesce(_optionalChain([map, 'optionalAccess', _27 => _27.name]), () => ( spec.map))} with no regions matched.`;
@@ -563,8 +563,8 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
563
563
  }
564
564
  if (family === "barrace") {
565
565
  const n = spec.categories.length;
566
- const first = _chunkN76AMOKEcjs.chartRaceRanking.call(void 0, spec, 0)[0];
567
- const last = _chunkN76AMOKEcjs.chartRaceRanking.call(void 0, spec, n - 1)[0];
566
+ const first = _chunkMOW3JMNGcjs.chartRaceRanking.call(void 0, spec, 0)[0];
567
+ const last = _chunkMOW3JMNGcjs.chartRaceRanking.call(void 0, spec, n - 1)[0];
568
568
  const lead = (e, at) => e ? `${e.name} leads at ${at} with ${fmt(e.value)}` : "";
569
569
  return `${head} of ${series.length} names over ${n} time points (${spec.categories[0]} to ${spec.categories[n - 1]}), showing the top ${Math.min(spec.raceTopN, series.length)}. ${lead(first, spec.categories[0])}; ${lead(last, spec.categories[n - 1])}.`;
570
570
  }
@@ -650,7 +650,7 @@ function describeChart(spec, series = spec.series.filter((s) => !s.hidden).map((
650
650
  }
651
651
  parts.push(...axes);
652
652
  for (const s of spec.series.filter((x) => !x.hidden && (x.errorBars || x.xErrorBars)).slice(0, 8)) {
653
- const bars = [s.errorBars ? _chunkWRZ6C4TUcjs.describeChartErrorBars.call(void 0, s.errorBars) : "", s.xErrorBars ? `x ${_chunkWRZ6C4TUcjs.describeChartErrorBars.call(void 0, s.xErrorBars)}` : ""].filter(Boolean).join(" and ");
653
+ const bars = [s.errorBars ? _chunk3R5P3DVYcjs.describeChartErrorBars.call(void 0, s.errorBars) : "", s.xErrorBars ? `x ${_chunk3R5P3DVYcjs.describeChartErrorBars.call(void 0, s.xErrorBars)}` : ""].filter(Boolean).join(" and ");
654
654
  parts.push(`${s.name} has ${bars}.`);
655
655
  }
656
656
  return parts.join(" ");
@@ -715,7 +715,7 @@ function chartSceneToSvg(scene, options = {}) {
715
715
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${scene.width}" height="${scene.height}" viewBox="0 0 ${scene.width} ${scene.height}" role="img"${label ? ` aria-label="${escape(label)}"` : ""}${labelled ? ` aria-labelledby="${labelled}"` : ""}>${head}${body}</svg>`;
716
716
  }
717
717
  function chartToSvg(spec, options) {
718
- const scene = _chunkN76AMOKEcjs.layoutChart.call(void 0, spec, { ...options, selection: null });
718
+ const scene = _chunkMOW3JMNGcjs.layoutChart.call(void 0, spec, { ...options, selection: null });
719
719
  return chartSceneToSvg(scene, { ...options, ariaLabel: _nullishCoalesce(options.ariaLabel, () => ( (spec.title || void 0))), description: _nullishCoalesce(options.description, () => ( describeChart(spec))) });
720
720
  }
721
721
  var SVG_NS = "http://www.w3.org/2000/svg";
@@ -753,10 +753,10 @@ var CHART_LAYOUT_PRESETS = [
753
753
  ];
754
754
  function monochromeChartPalette(base, count = 6) {
755
755
  const steps = count <= 1 ? [0] : Array.from({ length: count }, (_, i) => -0.45 + 1.05 * i / (count - 1));
756
- return steps.map((t) => _chunkWRZ6C4TUcjs.shadeChartColor.call(void 0, base, t));
756
+ return steps.map((t) => _chunk3R5P3DVYcjs.shadeChartColor.call(void 0, base, t));
757
757
  }
758
758
  var CHART_COLOR_SCHEMES = [
759
- { id: "default", label: "Default", description: "Ten distinct colours, readable on light and dark backgrounds.", palette: _chunkWRZ6C4TUcjs.DEFAULT_CHART_PALETTE },
759
+ { id: "default", label: "Default", description: "Ten distinct colours, readable on light and dark backgrounds.", palette: _chunk3R5P3DVYcjs.DEFAULT_CHART_PALETTE },
760
760
  { id: "okabe-ito", label: "Okabe\u2013Ito", description: "Eight colours chosen to stay distinct with colour-blindness.", palette: ["#e69f00", "#56b4e9", "#009e73", "#f0e442", "#0072b2", "#d55e00", "#cc79a7", "#000000"] },
761
761
  { id: "office", label: "Office", description: "The six accent colours of the default Office theme.", palette: ["#4472c4", "#ed7d31", "#a5a5a5", "#ffc000", "#5b9bd5", "#70ad47"] },
762
762
  { id: "warm", label: "Warm", description: "Reds, oranges and yellows.", palette: ["#b2182b", "#d6604d", "#f4a582", "#e08214", "#fdb863", "#8c510a"] },
@@ -834,7 +834,7 @@ var ChartController = (_class = class {
834
834
  this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkFJ2MSI43cjs.HistoryManager)()));
835
835
  this.onChange = options.onChange;
836
836
  this.raceTicker = _nullishCoalesce(options.raceTicker, () => ( defaultRaceTicker));
837
- const { spec, issues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {})));
837
+ const { spec, issues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {})));
838
838
  this.spec = spec;
839
839
  this.issues = issues;
840
840
  this.state = this.computeState();
@@ -939,7 +939,7 @@ var ChartController = (_class = class {
939
939
  const hadIssues = this.issues.length > 0;
940
940
  this.issues = [];
941
941
  if (sameChartJson(before, next)) {
942
- const reselect = select !== void 0 && !_chunkN76AMOKEcjs.sameChartSelection.call(void 0, this.selection, select) && !(select === null && this.selection === null);
942
+ const reselect = select !== void 0 && !_chunkMOW3JMNGcjs.sameChartSelection.call(void 0, this.selection, select) && !(select === null && this.selection === null);
943
943
  if (reselect) this.selection = select;
944
944
  if (reselect || hadIssues) this.notify(false);
945
945
  return;
@@ -962,7 +962,7 @@ var ChartController = (_class = class {
962
962
  }
963
963
  /** A copy of the spec with `edit` applied (series and categories copied as needed). */
964
964
  edited(edit) {
965
- const draft = _chunkWRZ6C4TUcjs.cloneChartSpec.call(void 0, this.spec);
965
+ const draft = _chunk3R5P3DVYcjs.cloneChartSpec.call(void 0, this.spec);
966
966
  edit(draft);
967
967
  return draft;
968
968
  }
@@ -992,7 +992,7 @@ var ChartController = (_class = class {
992
992
  legend: patch.legend ? { ...s.legend, ...patch.legend } : s.legend,
993
993
  version: 1
994
994
  };
995
- const { spec, issues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, merged);
995
+ const { spec, issues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, merged);
996
996
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
997
997
  if (JSON.stringify(spec) === JSON.stringify(s)) return { ok: true };
998
998
  this.commit(_nullishCoalesce(options.label, () => ( updateLabel(patch))), spec);
@@ -1046,7 +1046,7 @@ var ChartController = (_class = class {
1046
1046
  const series = this.getSeries(seriesId);
1047
1047
  if (!series) return this.unknownSeries(seriesId);
1048
1048
  if (!Number.isInteger(index) || index < 0 || index >= this.spec.categories.length) return this.badIndex(index);
1049
- const parsed = _chunkWRZ6C4TUcjs.parseChartValue.call(void 0, value);
1049
+ const parsed = _chunk3R5P3DVYcjs.parseChartValue.call(void 0, value);
1050
1050
  if (parsed === void 0) return this.reject(`"${String(value)}" is not a number; enter a number or leave the cell blank.`, [{ path: `${seriesId}[${index}]`, message: `"${String(value)}" is not a number.` }]);
1051
1051
  if (series.values[index] === parsed) {
1052
1052
  if (this.issues.length) {
@@ -1071,7 +1071,7 @@ var ChartController = (_class = class {
1071
1071
  if (!this.getSeries(cell.seriesId)) issues.push({ path: cell.seriesId, message: this.unknownSeries(cell.seriesId).message });
1072
1072
  else if (!Number.isInteger(cell.index) || cell.index < 0 || cell.index >= this.spec.categories.length) issues.push({ path: `${cell.seriesId}[${cell.index}]`, message: this.badIndex(cell.index).message });
1073
1073
  else {
1074
- const value = _chunkWRZ6C4TUcjs.parseChartValue.call(void 0, cell.value);
1074
+ const value = _chunk3R5P3DVYcjs.parseChartValue.call(void 0, cell.value);
1075
1075
  if (value === void 0) issues.push({ path: `${cell.seriesId}[${cell.index}]`, message: `"${String(cell.value)}" is not a number.` });
1076
1076
  else parsed.push({ seriesId: cell.seriesId, index: cell.index, value });
1077
1077
  }
@@ -1085,12 +1085,12 @@ var ChartController = (_class = class {
1085
1085
  }
1086
1086
  /** Adds a series (values padded to the categories) and selects it. Returns its id. */
1087
1087
  addSeries(input = {}, options = {}) {
1088
- const id = input.id && !this.getSeries(input.id) ? input.id : _chunkWRZ6C4TUcjs.uniqueChartSeriesId.call(void 0, this.spec.series);
1088
+ const id = input.id && !this.getSeries(input.id) ? input.id : _chunk3R5P3DVYcjs.uniqueChartSeriesId.call(void 0, this.spec.series);
1089
1089
  const name = _nullishCoalesce(input.name, () => ( `Series ${this.spec.series.length + 1}`));
1090
1090
  const at = Math.max(0, Math.min(this.spec.series.length, _nullishCoalesce(options.at, () => ( this.spec.series.length))));
1091
1091
  const series = [...this.spec.series];
1092
1092
  series.splice(at, 0, { ...input, id, name, values: _nullishCoalesce(input.values, () => ( [])) });
1093
- const { spec, issues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, { ...this.spec, series });
1093
+ const { spec, issues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, { ...this.spec, series });
1094
1094
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1095
1095
  this.commit(`Add series "${name}"`, spec, { kind: "series", seriesId: id });
1096
1096
  return { ok: true, id };
@@ -1110,7 +1110,7 @@ var ChartController = (_class = class {
1110
1110
  updateSeries(id, patch) {
1111
1111
  const series = this.getSeries(id);
1112
1112
  if (!series) return this.unknownSeries(id);
1113
- const next = _chunkWRZ6C4TUcjs.cloneChartSeries.call(void 0, series);
1113
+ const next = _chunk3R5P3DVYcjs.cloneChartSeries.call(void 0, series);
1114
1114
  if (patch.name !== void 0) next.name = String(patch.name);
1115
1115
  if (patch.color === null || patch.color === "") delete next.color;
1116
1116
  else if (patch.color !== void 0) next.color = patch.color;
@@ -1130,7 +1130,7 @@ var ChartController = (_class = class {
1130
1130
  const series2 = this.spec.series.map((s) => s.id === id ? next : s);
1131
1131
  const renamed = next.name !== series.name && this.spec.highlight.includes(series.name) && !this.spec.categories.includes(series.name);
1132
1132
  const highlight = renamed ? this.spec.highlight.map((h) => h === series.name ? next.name : h) : this.spec.highlight;
1133
- const { spec, issues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, { ...this.spec, series: series2, highlight });
1133
+ const { spec, issues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, { ...this.spec, series: series2, highlight });
1134
1134
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1135
1135
  if (JSON.stringify(spec.series) === JSON.stringify(this.spec.series)) return { ok: true };
1136
1136
  const label = patch.hidden !== void 0 && Object.keys(patch).length === 1 ? `${patch.hidden ? "Hide" : "Show"} "${series.name}"` : patch.name !== void 0 && Object.keys(patch).length === 1 ? "Rename series" : `Change series "${series.name}"`;
@@ -1236,7 +1236,7 @@ var ChartController = (_class = class {
1236
1236
  const width = Math.max(...rows.map((r) => r.length));
1237
1237
  const lastSeries = column + width - 1;
1238
1238
  while (d.series.length <= lastSeries) {
1239
- const id = _chunkWRZ6C4TUcjs.uniqueChartSeriesId.call(void 0, d.series);
1239
+ const id = _chunk3R5P3DVYcjs.uniqueChartSeriesId.call(void 0, d.series);
1240
1240
  d.series.push({ id, name: `Series ${d.series.length + 1}`, values: d.categories.map(() => null) });
1241
1241
  }
1242
1242
  const lastRow = row + rows.length - 1;
@@ -1250,7 +1250,7 @@ var ChartController = (_class = class {
1250
1250
  const index = row + r;
1251
1251
  if (col < 0) d.categories[index] = cell === null || cell === void 0 ? "" : String(cell).trim();
1252
1252
  else {
1253
- const parsed = _chunkWRZ6C4TUcjs.parseChartValue.call(void 0, cell);
1253
+ const parsed = _chunk3R5P3DVYcjs.parseChartValue.call(void 0, cell);
1254
1254
  if (parsed === void 0) issues.push({ path: `${d.series[col].id}[${index}]`, message: `"${String(cell)}" is not a number; it was left blank.` });
1255
1255
  d.series[col].values[index] = _nullishCoalesce(parsed, () => ( null));
1256
1256
  }
@@ -1269,14 +1269,14 @@ var ChartController = (_class = class {
1269
1269
  * colours and types are kept by name.
1270
1270
  */
1271
1271
  importTable(rows, options = {}) {
1272
- const data = _chunkWRZ6C4TUcjs.chartDataFromTable.call(void 0, rows, options);
1272
+ const data = _chunk3R5P3DVYcjs.chartDataFromTable.call(void 0, rows, options);
1273
1273
  if (!data.categories.length || !data.series.length) return this.reject("There is no data to import: expected a header row and at least one row of values.");
1274
1274
  const byName = new Map(this.spec.series.map((s) => [s.name, s]));
1275
1275
  const series = data.series.map((s) => {
1276
1276
  const old = byName.get(s.name);
1277
1277
  return { ...s, ..._optionalChain([old, 'optionalAccess', _65 => _65.color]) ? { color: old.color } : {}, ..._optionalChain([old, 'optionalAccess', _66 => _66.type]) ? { type: old.type } : {}, ...old ? { id: old.id } : {} };
1278
1278
  });
1279
- const { spec } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, { ...this.spec, categories: data.categories, series, tree: [], links: [] });
1279
+ const { spec } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, { ...this.spec, categories: data.categories, series, tree: [], links: [] });
1280
1280
  this.commit("Import data", spec);
1281
1281
  if (data.issues.length) {
1282
1282
  this.issues = data.issues;
@@ -1307,7 +1307,7 @@ var ChartController = (_class = class {
1307
1307
  /** Replaces the grouped data (an empty list goes back to the table, keeping the totals as values). One undo step. */
1308
1308
  setTree(tree, options = {}) {
1309
1309
  const issues = [];
1310
- const next = _chunkWRZ6C4TUcjs.normalizeChartTree.call(void 0, tree, issues);
1310
+ const next = _chunk3R5P3DVYcjs.normalizeChartTree.call(void 0, tree, issues);
1311
1311
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1312
1312
  return this.update({ tree: next, links: [] }, { label: _nullishCoalesce(options.label, () => ( (next.length ? "Replace grouped data" : "Ungroup data"))) });
1313
1313
  }
@@ -1317,11 +1317,11 @@ var ChartController = (_class = class {
1317
1317
  */
1318
1318
  setTreeRows(rows, options = {}) {
1319
1319
  const issues = [];
1320
- const next = _chunkWRZ6C4TUcjs.chartTreeFromRows.call(void 0, rows, issues);
1320
+ const next = _chunk3R5P3DVYcjs.chartTreeFromRows.call(void 0, rows, issues);
1321
1321
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1322
1322
  const keepColors = (list, prefix) => {
1323
1323
  for (const n of list) {
1324
- const old = _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, this.spec.tree, [...prefix, n.name]);
1324
+ const old = _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, this.spec.tree, [...prefix, n.name]);
1325
1325
  if (_optionalChain([old, 'optionalAccess', _67 => _67.color])) n.color = old.color;
1326
1326
  if (n.children) keepColors(n.children, [...prefix, n.name]);
1327
1327
  }
@@ -1332,15 +1332,15 @@ var ChartController = (_class = class {
1332
1332
  /** Replaces the data with a table of names and values (group, …, item, value); see `chartTreeFromTable`. */
1333
1333
  importTreeTable(rows, options = {}) {
1334
1334
  const issues = [];
1335
- const next = _chunkWRZ6C4TUcjs.chartTreeFromTable.call(void 0, rows, options, issues);
1335
+ const next = _chunk3R5P3DVYcjs.chartTreeFromTable.call(void 0, rows, options, issues);
1336
1336
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1337
1337
  if (!next.length) return this.reject('There is no grouped data to import: expected rows of names followed by a value, e.g. "Europe,France,40".');
1338
1338
  return this.update({ tree: next, links: [] }, { label: "Import grouped data" });
1339
1339
  }
1340
1340
  nodeAt(path) {
1341
- const node = _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, this.spec.tree, path);
1341
+ const node = _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, this.spec.tree, path);
1342
1342
  if (node) return node;
1343
- const known = path.length > 1 ? _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, this.spec.tree, path.slice(0, -1)) : null;
1343
+ const known = path.length > 1 ? _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, this.spec.tree, path.slice(0, -1)) : null;
1344
1344
  const siblings = _nullishCoalesce((path.length > 1 ? _optionalChain([known, 'optionalAccess', _68 => _68.children]) : this.spec.tree), () => ( []));
1345
1345
  return fail(
1346
1346
  `There is no node ${JSON.stringify(path)}. ${siblings.length ? `${path.length > 1 && known ? `"${known.name}" contains` : "The top level has"} ${siblings.map((n) => `"${n.name}"`).slice(0, 20).join(", ")}.` : "The chart has no grouped data yet; add nodes with add_chart_tree_node or set_chart_tree."}`
@@ -1356,12 +1356,12 @@ var ChartController = (_class = class {
1356
1356
  siblings = group.children;
1357
1357
  }
1358
1358
  const issues = [];
1359
- const [node] = _chunkWRZ6C4TUcjs.normalizeChartTree.call(void 0, [input], issues, "node");
1359
+ const [node] = _chunk3R5P3DVYcjs.normalizeChartTree.call(void 0, [input], issues, "node");
1360
1360
  if (!node || issues.length) return this.reject(issues.map((i) => i.message).join(" ") || "The node is not valid.", issues);
1361
1361
  if (siblings.some((n) => n.name === node.name)) return this.reject(`"${node.name}" is already there; names under one group must be unique.`);
1362
1362
  const at = Math.max(0, Math.min(siblings.length, _nullishCoalesce(options.at, () => ( siblings.length))));
1363
- const tree = _chunkWRZ6C4TUcjs.cloneChartTree.call(void 0, this.spec.tree);
1364
- const list = parent.length ? _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, tree, parent).children : tree;
1363
+ const tree = _chunk3R5P3DVYcjs.cloneChartTree.call(void 0, this.spec.tree);
1364
+ const list = parent.length ? _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, tree, parent).children : tree;
1365
1365
  list.splice(at, 0, node);
1366
1366
  const result = this.update({ tree }, { label: `Add "${node.name}"` });
1367
1367
  if (!result.ok) return result;
@@ -1373,16 +1373,16 @@ var ChartController = (_class = class {
1373
1373
  if ("ok" in node) return node;
1374
1374
  if (patch.value !== void 0 && node.children) return this.reject(`"${node.name}" is a group: its value is the sum of its items. Change the items instead.`);
1375
1375
  const name = patch.name !== void 0 ? String(patch.name).trim() : node.name;
1376
- const siblings = (path.length > 1 ? _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, this.spec.tree, path.slice(0, -1)).children : this.spec.tree).filter((n) => n !== node);
1376
+ const siblings = (path.length > 1 ? _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, this.spec.tree, path.slice(0, -1)).children : this.spec.tree).filter((n) => n !== node);
1377
1377
  if (siblings.some((n) => n.name === name)) return this.reject(`There is already a "${name}" next to "${node.name}"; names under one group must be unique.`);
1378
- const tree = _chunkWRZ6C4TUcjs.cloneChartTree.call(void 0, this.spec.tree);
1379
- const target = _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, tree, path);
1378
+ const tree = _chunk3R5P3DVYcjs.cloneChartTree.call(void 0, this.spec.tree);
1379
+ const target = _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, tree, path);
1380
1380
  const merged = { ...target, name };
1381
1381
  if (patch.value !== void 0) merged.value = patch.value;
1382
1382
  if (patch.color === null) delete merged.color;
1383
1383
  else if (patch.color !== void 0) merged.color = patch.color;
1384
1384
  const issues = [];
1385
- const [checked] = _chunkWRZ6C4TUcjs.normalizeChartTree.call(void 0, [merged], issues, "node");
1385
+ const [checked] = _chunk3R5P3DVYcjs.normalizeChartTree.call(void 0, [merged], issues, "node");
1386
1386
  if (!checked || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1387
1387
  Object.assign(target, checked);
1388
1388
  if (patch.color === null) delete target.color;
@@ -1394,8 +1394,8 @@ var ChartController = (_class = class {
1394
1394
  removeTreeNode(path) {
1395
1395
  const node = this.nodeAt(path);
1396
1396
  if ("ok" in node) return node;
1397
- const tree = _chunkWRZ6C4TUcjs.cloneChartTree.call(void 0, this.spec.tree);
1398
- const parent = path.length > 1 ? _chunkWRZ6C4TUcjs.findChartTreeNode.call(void 0, tree, path.slice(0, -1)) : null;
1397
+ const tree = _chunk3R5P3DVYcjs.cloneChartTree.call(void 0, this.spec.tree);
1398
+ const parent = path.length > 1 ? _chunk3R5P3DVYcjs.findChartTreeNode.call(void 0, tree, path.slice(0, -1)) : null;
1399
1399
  const list = parent ? parent.children : tree;
1400
1400
  list.splice(
1401
1401
  list.findIndex((n) => n.name === node.name),
@@ -1416,7 +1416,7 @@ var ChartController = (_class = class {
1416
1416
  */
1417
1417
  setLinks(links, options = {}) {
1418
1418
  const issues = [];
1419
- const next = _chunkWRZ6C4TUcjs.normalizeChartLinks.call(void 0, links, issues);
1419
+ const next = _chunk3R5P3DVYcjs.normalizeChartLinks.call(void 0, links, issues);
1420
1420
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1421
1421
  const used = new Set(next.flatMap((l) => [l.source, l.target]));
1422
1422
  const sankeyNodes = options.nodes ? [...options.nodes] : this.spec.sankeyNodes.filter((n) => used.has(n));
@@ -1424,7 +1424,7 @@ var ChartController = (_class = class {
1424
1424
  }
1425
1425
  /** Replaces the data with flows from a table of source, target and value columns. */
1426
1426
  importLinksTable(rows, options = {}) {
1427
- const raw = _chunkWRZ6C4TUcjs.chartLinksFromTable.call(void 0, rows, options);
1427
+ const raw = _chunk3R5P3DVYcjs.chartLinksFromTable.call(void 0, rows, options);
1428
1428
  if (!raw.length) return this.reject('There are no flows to import: expected rows of source, target and value, e.g. "Website,Signup,120".');
1429
1429
  return this.setLinks(raw, { label: "Import flows" });
1430
1430
  }
@@ -1488,7 +1488,7 @@ var ChartController = (_class = class {
1488
1488
  /** Why a reference on `axis` at `values` cannot be drawn on this chart, or null. */
1489
1489
  referenceProblem(axis, values) {
1490
1490
  const s = this.spec;
1491
- const family = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, s);
1491
+ const family = _chunk3R5P3DVYcjs.chartFamily.call(void 0, s);
1492
1492
  if (family !== "cartesian" && family !== "xy") return `Reference lines and bands are drawn on bar, line, area, scatter and bubble charts; this is a ${s.type} chart.`;
1493
1493
  if (axis === "x" && family !== "xy") return 'axis "x" needs a scatter or bubble chart with numeric x values; use "y" for the value axis.';
1494
1494
  if (axis === "y2" && (family !== "cartesian" || !s.series.some((x) => !x.hidden && x.axis === "secondary")))
@@ -1507,7 +1507,7 @@ var ChartController = (_class = class {
1507
1507
  /** Adds a reference line (a target, floor or average). Returns its index. */
1508
1508
  addReferenceLine(input) {
1509
1509
  const issues = [];
1510
- const line = _chunkWRZ6C4TUcjs.normalizeChartReferenceLine.call(void 0, input, "referenceLine", issues);
1510
+ const line = _chunk3R5P3DVYcjs.normalizeChartReferenceLine.call(void 0, input, "referenceLine", issues);
1511
1511
  if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1512
1512
  const problem = this.referenceProblem(line.axis, [line.value]);
1513
1513
  if (problem) return this.reject(problem);
@@ -1522,7 +1522,7 @@ var ChartController = (_class = class {
1522
1522
  const merged = { ...current, ...patch };
1523
1523
  for (const [k, v] of Object.entries(patch)) if (v === null) delete merged[k];
1524
1524
  const issues = [];
1525
- const line = _chunkWRZ6C4TUcjs.normalizeChartReferenceLine.call(void 0, merged, "referenceLine", issues);
1525
+ const line = _chunk3R5P3DVYcjs.normalizeChartReferenceLine.call(void 0, merged, "referenceLine", issues);
1526
1526
  if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1527
1527
  const problem = this.referenceProblem(line.axis, [line.value]);
1528
1528
  if (problem) return this.reject(problem);
@@ -1537,7 +1537,7 @@ var ChartController = (_class = class {
1537
1537
  /** Adds a reference band (a target range). Returns its index. */
1538
1538
  addReferenceBand(input) {
1539
1539
  const issues = [];
1540
- const band = _chunkWRZ6C4TUcjs.normalizeChartReferenceBand.call(void 0, input, "referenceBand", issues);
1540
+ const band = _chunk3R5P3DVYcjs.normalizeChartReferenceBand.call(void 0, input, "referenceBand", issues);
1541
1541
  if (!band || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1542
1542
  const problem = this.referenceProblem(band.axis, [band.from, band.to]);
1543
1543
  if (problem) return this.reject(problem);
@@ -1552,7 +1552,7 @@ var ChartController = (_class = class {
1552
1552
  const merged = { ...current, ...patch };
1553
1553
  for (const [k, v] of Object.entries(patch)) if (v === null) delete merged[k];
1554
1554
  const issues = [];
1555
- const band = _chunkWRZ6C4TUcjs.normalizeChartReferenceBand.call(void 0, merged, "referenceBand", issues);
1555
+ const band = _chunk3R5P3DVYcjs.normalizeChartReferenceBand.call(void 0, merged, "referenceBand", issues);
1556
1556
  if (!band || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1557
1557
  const problem = this.referenceProblem(band.axis, [band.from, band.to]);
1558
1558
  if (problem) return this.reject(problem);
@@ -1575,7 +1575,7 @@ var ChartController = (_class = class {
1575
1575
  const series = this.getSeries(seriesId);
1576
1576
  if (!series) return this.unknownSeries(seriesId);
1577
1577
  if (!Number.isInteger(index) || index < 0 || index >= this.spec.categories.length) return this.badIndex(index);
1578
- const family = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, this.spec);
1578
+ const family = _chunk3R5P3DVYcjs.chartFamily.call(void 0, this.spec);
1579
1579
  const text = label === null ? "" : String(label).trim();
1580
1580
  if (text && family !== "cartesian" && family !== "xy") return this.reject(`Callouts are drawn on bar, line, area, scatter and bubble charts; this is a ${this.spec.type} chart.`);
1581
1581
  if (text && (series.values[index] === null || series.values[index] === void 0))
@@ -1597,10 +1597,10 @@ var ChartController = (_class = class {
1597
1597
  addTrendline(seriesId, input) {
1598
1598
  const series = this.getSeries(seriesId);
1599
1599
  if (!series) return this.unknownSeries(seriesId);
1600
- if (!_chunkN76AMOKEcjs.chartSupportsTrendlines.call(void 0, this.spec.type, this.spec.stacking))
1600
+ if (!_chunkMOW3JMNGcjs.chartSupportsTrendlines.call(void 0, this.spec.type, this.spec.stacking))
1601
1601
  return this.reject(`Trendlines need an unstacked bar, line, area, scatter or bubble chart; this is a ${this.spec.stacking !== "none" ? `${this.spec.stacking} ` : ""}${this.spec.type} chart.`);
1602
1602
  const issues = [];
1603
- const line = _chunkWRZ6C4TUcjs.normalizeChartTrendline.call(void 0, input, "trendline", issues);
1603
+ const line = _chunk3R5P3DVYcjs.normalizeChartTrendline.call(void 0, input, "trendline", issues);
1604
1604
  if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" ") || "The trendline is not valid.", issues);
1605
1605
  const index = _nullishCoalesce(_optionalChain([series, 'access', _71 => _71.trendlines, 'optionalAccess', _72 => _72.length]), () => ( 0));
1606
1606
  const next = this.edited((d) => {
@@ -1619,7 +1619,7 @@ var ChartController = (_class = class {
1619
1619
  const issues = [];
1620
1620
  const merged = { ...current, ...patch };
1621
1621
  for (const [k, v] of Object.entries(patch)) if (v === null) delete merged[k];
1622
- const line = _chunkWRZ6C4TUcjs.normalizeChartTrendline.call(void 0, merged, "trendline", issues);
1622
+ const line = _chunk3R5P3DVYcjs.normalizeChartTrendline.call(void 0, merged, "trendline", issues);
1623
1623
  if (!line || issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1624
1624
  this.commit(
1625
1625
  "Change trendline",
@@ -1647,7 +1647,7 @@ var ChartController = (_class = class {
1647
1647
  trendlinePoints(seriesId) {
1648
1648
  const series = this.getSeries(seriesId);
1649
1649
  if (!series) return [];
1650
- const xy = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, this.spec) === "xy";
1650
+ const xy = _chunk3R5P3DVYcjs.chartFamily.call(void 0, this.spec) === "xy";
1651
1651
  const out = [];
1652
1652
  series.values.forEach((v, i) => {
1653
1653
  const x = xy ? _nullishCoalesce(_optionalChain([series, 'access', _79 => _79.x, 'optionalAccess', _80 => _80[i]]), () => ( (this.spec.type === "bubble" ? i + 1 : null))) : i + 1;
@@ -1659,13 +1659,13 @@ var ChartController = (_class = class {
1659
1659
  trendlineFit(seriesId, index) {
1660
1660
  const line = _optionalChain([this, 'access', _81 => _81.getSeries, 'call', _82 => _82(seriesId), 'optionalAccess', _83 => _83.trendlines, 'optionalAccess', _84 => _84[index]]);
1661
1661
  if (!line) return null;
1662
- return _chunkN76AMOKEcjs.fitChartTrendline.call(void 0, line, this.trendlinePoints(seriesId));
1662
+ return _chunkMOW3JMNGcjs.fitChartTrendline.call(void 0, line, this.trendlinePoints(seriesId));
1663
1663
  }
1664
1664
  /** The moving-average points of a trendline (empty for other kinds). */
1665
1665
  trendlineMovingAverage(seriesId, index) {
1666
1666
  const line = _optionalChain([this, 'access', _85 => _85.getSeries, 'call', _86 => _86(seriesId), 'optionalAccess', _87 => _87.trendlines, 'optionalAccess', _88 => _88[index]]);
1667
1667
  if (!line || line.type !== "moving-average") return [];
1668
- return _chunkN76AMOKEcjs.chartMovingAverage.call(void 0, this.trendlinePoints(seriesId), _nullishCoalesce(line.period, () => ( 2)));
1668
+ return _chunkMOW3JMNGcjs.chartMovingAverage.call(void 0, this.trendlinePoints(seriesId), _nullishCoalesce(line.period, () => ( 2)));
1669
1669
  }
1670
1670
  // -------------------------------------------------------------------------
1671
1671
  // Reshaping
@@ -1686,7 +1686,7 @@ var ChartController = (_class = class {
1686
1686
  used.add(id);
1687
1687
  return { id, name, values: s.series.map((x) => _nullishCoalesce(x.values[i], () => ( null))) };
1688
1688
  });
1689
- const { spec } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, { ...s, categories: s.series.map((x) => x.name), series });
1689
+ const { spec } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, { ...s, categories: s.series.map((x) => x.name), series });
1690
1690
  this.commit("Switch rows and columns", spec, null);
1691
1691
  return { ok: true };
1692
1692
  }
@@ -1745,7 +1745,7 @@ var ChartController = (_class = class {
1745
1745
  /** Selects a chart element (view state; not an undo step). */
1746
1746
  select(selection) {
1747
1747
  const next = this.validSelection(selection, this.spec);
1748
- if (_chunkN76AMOKEcjs.sameChartSelection.call(void 0, next, this.selection) || next === null && this.selection === null) return;
1748
+ if (_chunkMOW3JMNGcjs.sameChartSelection.call(void 0, next, this.selection) || next === null && this.selection === null) return;
1749
1749
  this.selection = next;
1750
1750
  this.notify(false);
1751
1751
  }
@@ -1822,14 +1822,14 @@ var ChartController = (_class = class {
1822
1822
  // -------------------------------------------------------------------------
1823
1823
  /** The spec, for saving (a copy). */
1824
1824
  toJSON() {
1825
- return _chunkWRZ6C4TUcjs.cloneChartSpec.call(void 0, this.spec);
1825
+ return _chunk3R5P3DVYcjs.cloneChartSpec.call(void 0, this.spec);
1826
1826
  }
1827
1827
  /**
1828
1828
  * Replaces the chart without an undo step (e.g. when opening a document). Problems are
1829
1829
  * fixed with defaults and reported in `state.issues` (and returned).
1830
1830
  */
1831
1831
  load(input, options = {}) {
1832
- const { spec, issues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
1832
+ const { spec, issues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
1833
1833
  this.spec = spec;
1834
1834
  this.issues = issues;
1835
1835
  this.selection = this.validSelection(this.selection, spec);
@@ -1849,7 +1849,7 @@ var ChartController = (_class = class {
1849
1849
  * nothing changes and every problem is returned (and shown in `state.issues`).
1850
1850
  */
1851
1851
  replace(input, options = {}) {
1852
- const { spec, issues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
1852
+ const { spec, issues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
1853
1853
  if (issues.length) return this.reject(issues.map((i) => i.message).join(" "), issues);
1854
1854
  this.commit(_nullishCoalesce(options.label, () => ( "Replace chart")), spec, this.validSelection(this.selection, spec));
1855
1855
  return { ok: true };
@@ -1931,7 +1931,7 @@ function layoutSparkline(values, options) {
1931
1931
  const h = Number.isFinite(options.height) ? Math.max(1, options.height) : 1;
1932
1932
  const color = _nullishCoalesce(options.color, () => ( "#4269d0"));
1933
1933
  const negative = _nullishCoalesce(options.negativeColor, () => ( "#e5484d"));
1934
- const theme = { ..._chunkWRZ6C4TUcjs.DEFAULT_CHART_THEME, background: "transparent" };
1934
+ const theme = { ..._chunk3R5P3DVYcjs.DEFAULT_CHART_THEME, background: "transparent" };
1935
1935
  const marks = [];
1936
1936
  const scene = { width: w, height: h, plot: { x: 0, y: 0, width: w, height: h }, marks, percent: false, theme, warnings: [] };
1937
1937
  const vals = values.slice(0, MAX_POINTS).map((v) => v !== null && Number.isFinite(v) ? Math.max(-1e300, Math.min(1e300, v)) : null);
@@ -1964,7 +1964,7 @@ function layoutSparkline(values, options) {
1964
1964
  const flush = () => {
1965
1965
  if (run.length >= 2) {
1966
1966
  const pts = run.length > 4e3 ? run.filter((_, i) => i % (Math.floor(run.length / 2e3) + 1) === 0) : run;
1967
- d += pts.map(([x, y], i) => `${i ? "L" : "M"}${_chunkN76AMOKEcjs.r2.call(void 0, x)},${_chunkN76AMOKEcjs.r2.call(void 0, y)}`).join("");
1967
+ d += pts.map(([x, y], i) => `${i ? "L" : "M"}${_chunkMOW3JMNGcjs.r2.call(void 0, x)},${_chunkMOW3JMNGcjs.r2.call(void 0, y)}`).join("");
1968
1968
  }
1969
1969
  run = [];
1970
1970
  };