@pixerate/editor 0.164.0 → 0.165.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 (141) hide show
  1. package/dist/agent/index.cjs +54 -39
  2. package/dist/agent/index.js +24 -9
  3. package/dist/animation/index.cjs +6 -5
  4. package/dist/animation/index.js +5 -4
  5. package/dist/animation-editor/index.cjs +65 -64
  6. package/dist/animation-editor/index.js +8 -7
  7. package/dist/bridge/cli.cjs +3 -3
  8. package/dist/bridge/cli.js +2 -2
  9. package/dist/bridge/index.cjs +3 -3
  10. package/dist/bridge/index.js +2 -2
  11. package/dist/canvas/index.cjs +89 -87
  12. package/dist/canvas/index.js +11 -9
  13. package/dist/chart/controller.d.cts +31 -2
  14. package/dist/chart/controller.d.ts +31 -2
  15. package/dist/chart/index.cjs +504 -132
  16. package/dist/chart/index.d.cts +2 -0
  17. package/dist/chart/index.d.ts +2 -0
  18. package/dist/chart/index.js +386 -14
  19. package/dist/chart/layout-families.d.cts +7 -0
  20. package/dist/chart/layout-families.d.ts +7 -0
  21. package/dist/chart/links.d.cts +34 -0
  22. package/dist/chart/links.d.ts +34 -0
  23. package/dist/chart/mermaid.d.cts +9 -6
  24. package/dist/chart/mermaid.d.ts +9 -6
  25. package/dist/chart/schemas.d.cts +3 -0
  26. package/dist/chart/schemas.d.ts +3 -0
  27. package/dist/chart/spec.d.cts +3 -2
  28. package/dist/chart/spec.d.ts +3 -2
  29. package/dist/chart/style.d.cts +33 -0
  30. package/dist/chart/style.d.ts +33 -0
  31. package/dist/chart/types.d.cts +24 -2
  32. package/dist/chart/types.d.ts +24 -2
  33. package/dist/{chunk-TALQONZ5.js → chunk-2J5VLJHC.js} +3 -3
  34. package/dist/{chunk-3NEZJCBY.js → chunk-2ZRN43IN.js} +340 -201
  35. package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
  36. package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
  37. package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  38. package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
  39. package/dist/{chunk-YSAGBIRW.cjs → chunk-64VWWR5U.cjs} +16 -16
  40. package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
  41. package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
  42. package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
  43. package/dist/{chunk-POR54B55.js → chunk-CRFSQWKQ.js} +4 -1
  44. package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
  45. package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
  46. package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
  47. package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
  48. package/dist/{chunk-5FNGLV2D.js → chunk-FEU2XVQH.js} +15 -3
  49. package/dist/{chunk-SZA42R4N.js → chunk-FRBRLKNQ.js} +154 -16
  50. package/dist/chunk-HIDFL5LQ.js +484 -0
  51. package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
  52. package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
  53. package/dist/{chunk-GKNEJ6EN.cjs → chunk-IMRXC7OA.cjs} +241 -103
  54. package/dist/chunk-KGRZMHZB.js +204 -0
  55. package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
  56. package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
  57. package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
  58. package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
  59. package/dist/{chunk-D54JHQK2.cjs → chunk-MKXK6E4O.cjs} +51 -51
  60. package/dist/{chunk-DAPQGA55.js → chunk-N7NBGT2Y.js} +2 -2
  61. package/dist/chunk-O6OGNDND.js +164 -0
  62. package/dist/{chunk-22KLZZGH.cjs → chunk-ODFCS7HF.cjs} +8 -8
  63. package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
  64. package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
  65. package/dist/{chunk-YGG7WDWT.cjs → chunk-Q25WAFTD.cjs} +21 -18
  66. package/dist/{chunk-SBQVEBSU.cjs → chunk-QO2T6KA5.cjs} +165 -67
  67. package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
  68. package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
  69. package/dist/chunk-TFF2GTGN.cjs +153 -0
  70. package/dist/chunk-TTCJPX4U.cjs +204 -0
  71. package/dist/{chunk-NZD2MZJC.cjs → chunk-TVQW26AV.cjs} +35 -23
  72. package/dist/{chunk-R3P2M7HU.cjs → chunk-UVXTOZ2B.cjs} +346 -207
  73. package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
  74. package/dist/{chunk-Z4P2RBMJ.js → chunk-V5GSY3NC.js} +101 -3
  75. package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
  76. package/dist/chunk-VU6WQSMB.cjs +164 -0
  77. package/dist/{chunk-OXERWBKE.js → chunk-X5W645RI.js} +3 -3
  78. package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
  79. package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
  80. package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
  81. package/dist/chunk-YBAPT7NL.js +153 -0
  82. package/dist/chunk-Z2UQYMPS.cjs +484 -0
  83. package/dist/color/index.cjs +5 -3
  84. package/dist/color/index.js +12 -10
  85. package/dist/diagram/index.cjs +55 -243
  86. package/dist/diagram/index.js +12 -200
  87. package/dist/export/index.cjs +7 -6
  88. package/dist/export/index.js +6 -5
  89. package/dist/extensions/index.cjs +12 -9
  90. package/dist/extensions/index.js +11 -8
  91. package/dist/gradient/index.cjs +29 -27
  92. package/dist/gradient/index.js +6 -4
  93. package/dist/image-editor/index.cjs +644 -643
  94. package/dist/image-editor/index.js +7 -6
  95. package/dist/index.cjs +21 -18
  96. package/dist/index.js +14 -11
  97. package/dist/paint-editor/index.cjs +19 -18
  98. package/dist/paint-editor/index.js +7 -6
  99. package/dist/parameters/index.cjs +2 -2
  100. package/dist/parameters/index.js +1 -1
  101. package/dist/persistence/assetWrites.d.cts +22 -0
  102. package/dist/persistence/assetWrites.d.ts +22 -0
  103. package/dist/persistence/assets.d.cts +71 -0
  104. package/dist/persistence/assets.d.ts +71 -0
  105. package/dist/persistence/documentStore.d.cts +17 -1
  106. package/dist/persistence/documentStore.d.ts +17 -1
  107. package/dist/persistence/documentTools.d.cts +5 -1
  108. package/dist/persistence/documentTools.d.ts +5 -1
  109. package/dist/persistence/editorAutosave.d.cts +7 -0
  110. package/dist/persistence/editorAutosave.d.ts +7 -0
  111. package/dist/persistence/index.cjs +141 -21
  112. package/dist/persistence/index.js +130 -10
  113. package/dist/persistence/storage.d.cts +13 -1
  114. package/dist/persistence/storage.d.ts +13 -1
  115. package/dist/spreadsheet/index.cjs +3 -3
  116. package/dist/spreadsheet/index.js +2 -2
  117. package/dist/tokens/index.cjs +11 -3
  118. package/dist/tokens/index.d.cts +1 -0
  119. package/dist/tokens/index.d.ts +1 -0
  120. package/dist/tokens/index.js +10 -2
  121. package/dist/tokens/style.d.cts +36 -0
  122. package/dist/tokens/style.d.ts +36 -0
  123. package/dist/tools/index.cjs +15 -3
  124. package/dist/tools/index.d.cts +2 -0
  125. package/dist/tools/index.d.ts +2 -0
  126. package/dist/tools/index.js +14 -2
  127. package/dist/tools/style-tools.d.cts +19 -0
  128. package/dist/tools/style-tools.d.ts +19 -0
  129. package/dist/tools/style.d.cts +212 -0
  130. package/dist/tools/style.d.ts +212 -0
  131. package/dist/tools/view.d.cts +6 -0
  132. package/dist/tools/view.d.ts +6 -0
  133. package/dist/typography/index.cjs +8 -6
  134. package/dist/typography/index.js +5 -3
  135. package/dist/vector/index.cjs +953 -952
  136. package/dist/vector/index.js +7 -6
  137. package/dist/video-editor/index.cjs +8 -7
  138. package/dist/video-editor/index.js +6 -5
  139. package/package.json +1 -1
  140. package/dist/chunk-ERAGQL2N.cjs +0 -68
  141. package/dist/chunk-KMU6QJB7.js +0 -68
@@ -14,17 +14,17 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkNZD2MZJCcjs = require('../chunk-NZD2MZJC.cjs');
18
17
 
19
18
 
19
+ var _chunkTVQW26AVcjs = require('../chunk-TVQW26AV.cjs');
20
20
 
21
21
 
22
22
 
23
23
 
24
24
 
25
- var _chunkYGG7WDWTcjs = require('../chunk-YGG7WDWT.cjs');
26
25
 
27
26
 
27
+ var _chunkQ25WAFTDcjs = require('../chunk-Q25WAFTD.cjs');
28
28
 
29
29
 
30
30
 
@@ -44,9 +44,10 @@ var _chunkYGG7WDWTcjs = require('../chunk-YGG7WDWT.cjs');
44
44
 
45
45
 
46
46
 
47
- var _chunkGKNEJ6ENcjs = require('../chunk-GKNEJ6EN.cjs');
48
47
 
49
48
 
49
+ var _chunkIMRXC7OAcjs = require('../chunk-IMRXC7OA.cjs');
50
+ require('../chunk-TTCJPX4U.cjs');
50
51
 
51
52
 
52
53
 
@@ -84,9 +85,9 @@ var _chunkGKNEJ6ENcjs = require('../chunk-GKNEJ6EN.cjs');
84
85
 
85
86
 
86
87
 
87
- var _chunkSBQVEBSUcjs = require('../chunk-SBQVEBSU.cjs');
88
88
 
89
89
 
90
+ var _chunkQO2T6KA5cjs = require('../chunk-QO2T6KA5.cjs');
90
91
 
91
92
 
92
93
 
@@ -170,7 +171,18 @@ var _chunkSBQVEBSUcjs = require('../chunk-SBQVEBSU.cjs');
170
171
 
171
172
 
172
173
 
173
- var _chunkR3P2M7HUcjs = require('../chunk-R3P2M7HU.cjs');
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ var _chunkUVXTOZ2Bcjs = require('../chunk-UVXTOZ2B.cjs');
185
+ require('../chunk-VU6WQSMB.cjs');
174
186
  require('../chunk-55AKPTLM.cjs');
175
187
 
176
188
 
@@ -188,11 +200,12 @@ var _chunkSWTUM32Hcjs = require('../chunk-SWTUM32H.cjs');
188
200
  var _chunkALNIFK5Gcjs = require('../chunk-ALNIFK5G.cjs');
189
201
 
190
202
 
191
- var _chunkM4MIZPQIcjs = require('../chunk-M4MIZPQI.cjs');
203
+ var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
192
204
  require('../chunk-2BSBFBOA.cjs');
193
205
  require('../chunk-FJ2MSI43.cjs');
194
- require('../chunk-ES3UEVUT.cjs');
195
- require('../chunk-S6X2QRVU.cjs');
206
+ require('../chunk-EUIDTZNQ.cjs');
207
+ require('../chunk-TFF2GTGN.cjs');
208
+ require('../chunk-5UEFBM2M.cjs');
196
209
  require('../chunk-IPJ3TEYR.cjs');
197
210
 
198
211
  // src/chart/raster.ts
@@ -303,7 +316,7 @@ function chartFileName(spec, extension) {
303
316
  }
304
317
  async function downloadChartPng(spec, options = {}) {
305
318
  const { width = 800, height = 450, filename = chartFileName(spec, "png"), theme, ...raster } = options;
306
- const svg = _chunkGKNEJ6ENcjs.chartToSvg.call(void 0, spec, { width, height, theme });
319
+ const svg = _chunkIMRXC7OAcjs.chartToSvg.call(void 0, spec, { width, height, theme });
307
320
  const { url, width: w, height: h } = await svgToPngDataUrl(svg, { ...raster, width, height });
308
321
  const doc = _nullishCoalesce(raster.document, () => ( globalThis.document));
309
322
  const link = doc.createElement("a");
@@ -318,7 +331,7 @@ async function downloadChartPng(spec, options = {}) {
318
331
 
319
332
  // src/chart/recommend.ts
320
333
  var blank = (c) => c === null || c === void 0 || String(c).trim() === "";
321
- var isText = (c) => blank(c) || _chunkR3P2M7HUcjs.parseChartValue.call(void 0, c) === void 0;
334
+ var isText = (c) => blank(c) || _chunkUVXTOZ2Bcjs.parseChartValue.call(void 0, c) === void 0;
322
335
  function analyzeChartTable(rows) {
323
336
  const grid = rows.filter((r) => r.some((c) => !blank(c)));
324
337
  const height = grid.length;
@@ -336,7 +349,7 @@ function analyzeChartTable(rows) {
336
349
  let anyPositive = false;
337
350
  for (let r = headerRow ? 1 : 0; r < height; r++)
338
351
  for (let c = labelColumn ? 1 : 0; c < width; c++) {
339
- const v = _chunkR3P2M7HUcjs.parseChartValue.call(void 0, cell(r, c));
352
+ const v = _chunkUVXTOZ2Bcjs.parseChartValue.call(void 0, cell(r, c));
340
353
  if (typeof v !== "number") continue;
341
354
  anyNumber = true;
342
355
  if (v < 0) {
@@ -345,7 +358,7 @@ function analyzeChartTable(rows) {
345
358
  } else if (v > 0) anyPositive = true;
346
359
  }
347
360
  const labels = byRows ? _nullishCoalesce(_optionalChain([grid, 'access', _20 => _20[0], 'optionalAccess', _21 => _21.slice, 'call', _22 => _22(labelColumn ? 1 : 0)]), () => ( [])) : grid.slice(headerRow ? 1 : 0).map((r) => r[0]);
348
- const dates = (byRows ? headerRow : labelColumn) && labels.length > 1 && labels.filter((l) => !blank(l) && _chunkSBQVEBSUcjs.parseChartDate.call(void 0, String(l)) !== null).length >= labels.length * 0.8;
361
+ const dates = (byRows ? headerRow : labelColumn) && labels.length > 1 && labels.filter((l) => !blank(l) && _chunkQO2T6KA5cjs.parseChartDate.call(void 0, String(l)) !== null).length >= labels.length * 0.8;
349
362
  return {
350
363
  headerRow,
351
364
  labelColumn,
@@ -435,7 +448,7 @@ function chartFromTable(rows, options = {}) {
435
448
  if (xFromFirst) {
436
449
  table = table.map((r) => [r[1], ...r.slice(2)]);
437
450
  }
438
- const data = _chunkR3P2M7HUcjs.chartDataFromTable.call(void 0, table, { seriesIn: shape.byRows ? "rows" : "columns", header: true, xFromFirstColumn: xFromFirst });
451
+ const data = _chunkUVXTOZ2Bcjs.chartDataFromTable.call(void 0, table, { seriesIn: shape.byRows ? "rows" : "columns", header: true, xFromFirstColumn: xFromFirst });
439
452
  return { type, stacking, categories: data.categories, series: data.series, issues: data.issues, shape };
440
453
  }
441
454
 
@@ -471,10 +484,10 @@ function createChartCommands(controller, options = {}) {
471
484
  readOnly: true,
472
485
  keywords: ["chart", "data", "spec", "get", "summary"],
473
486
  description: "Returns the chart spec, its data as a table (series names in the header row) and a summary: per-series min / max / mean / trend, axes as drawn, layout warnings and a colour check.",
474
- params: object({ width: _chunkNZD2MZJCcjs.WIDTH, height: _chunkNZD2MZJCcjs.HEIGHT }),
487
+ params: object({ width: _chunkTVQW26AVcjs.WIDTH, height: _chunkTVQW26AVcjs.HEIGHT }),
475
488
  run: (_ctx, params = {}) => {
476
489
  const spec = controller.getSpec();
477
- return { spec: controller.toJSON(), table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, spec), summary: _chunkGKNEJ6ENcjs.summarizeChart.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _25 => _25.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _26 => _26.height]), () => ( 400)) }), issues: controller.getState().issues };
490
+ return { spec: controller.toJSON(), table: _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, spec), summary: _chunkIMRXC7OAcjs.summarizeChart.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _25 => _25.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _26 => _26.height]), () => ( 400)) }), issues: controller.getState().issues };
478
491
  }
479
492
  },
480
493
  {
@@ -483,7 +496,7 @@ function createChartCommands(controller, options = {}) {
483
496
  label: "Change Chart\u2026",
484
497
  keywords: ["chart", "title", "axis", "legend", "stack", "style", "format", "type"],
485
498
  description: 'Changes chart presentation as one undo step: type, titles, axes (xAxis = categories, yAxis = values, yAxis2 = secondary values; reverse, and scale "log" on value axes), legend, stacking, orientation, curve, points, data labels, palette, donut hole, bar spacing, histogram bins, waterfall total, or radar rings and grid shape, note, highlight, reference lines and bands, or colour by category (varyColors). Invalid values change nothing and return why.',
486
- params: object(_chunkNZD2MZJCcjs.CHART_UPDATE_PROPERTIES),
499
+ params: object(_chunkTVQW26AVcjs.CHART_UPDATE_PROPERTIES),
487
500
  run: (_ctx, params) => {
488
501
  check(controller.update(params));
489
502
  return { spec: controller.toJSON() };
@@ -497,11 +510,11 @@ function createChartCommands(controller, options = {}) {
497
510
  description: "Replaces the categories and series as one undo step. Each series has one value per category (padded with gaps).",
498
511
  params: object({
499
512
  categories: { type: "array", items: { type: "string" }, description: "Category labels in order." },
500
- series: { type: "array", description: "The new series.", items: object({ id: { type: "string", description: "Stable id (optional)." }, ..._chunkNZD2MZJCcjs.SERIES_PROPS }, ["name", "values"]) }
513
+ series: { type: "array", description: "The new series.", items: object({ id: { type: "string", description: "Stable id (optional)." }, ..._chunkTVQW26AVcjs.SERIES_PROPS }, ["name", "values"]) }
501
514
  }),
502
515
  run: (_ctx, params) => {
503
516
  check(controller.setData(params));
504
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()) };
517
+ return { table: _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, controller.getSpec()) };
505
518
  }
506
519
  },
507
520
  {
@@ -510,10 +523,10 @@ function createChartCommands(controller, options = {}) {
510
523
  label: "Set Chart Values\u2026",
511
524
  keywords: ["chart", "value", "cell", "edit"],
512
525
  description: "Sets individual values as one undo step. Series by id or name; category by index or label.",
513
- params: object({ cells: { type: "array", minItems: 1, description: "Values to set.", items: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, value: _chunkNZD2MZJCcjs.VALUE }, ["series", "category", "value"]) } }, ["cells"]),
526
+ params: object({ cells: { type: "array", minItems: 1, description: "Values to set.", items: object({ series: _chunkTVQW26AVcjs.SERIES_REF, category: _chunkTVQW26AVcjs.CATEGORY_REF, value: _chunkTVQW26AVcjs.VALUE }, ["series", "category", "value"]) } }, ["cells"]),
514
527
  run: (_ctx, params) => {
515
528
  check(controller.setValues(params.cells.map((c) => ({ seriesId: resolveSeries(c.series).id, index: resolveCategory(c.category), value: c.value }))));
516
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()) };
529
+ return { table: _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, controller.getSpec()) };
517
530
  }
518
531
  },
519
532
  {
@@ -522,7 +535,7 @@ function createChartCommands(controller, options = {}) {
522
535
  label: "Add Series",
523
536
  keywords: ["chart", "series", "new"],
524
537
  description: "Adds a series (default: an empty one at the end). Returns its id.",
525
- params: object({ ..._chunkNZD2MZJCcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } }),
538
+ params: object({ ..._chunkTVQW26AVcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } }),
526
539
  run: (_ctx, params = {}) => {
527
540
  const { at, ...input } = _nullishCoalesce(params, () => ( {}));
528
541
  const clean = Object.fromEntries(Object.entries(input).filter(([, v]) => v !== null));
@@ -537,7 +550,7 @@ function createChartCommands(controller, options = {}) {
537
550
  label: "Change Series\u2026",
538
551
  keywords: ["chart", "series", "rename", "colour", "color", "hide", "axis", "marker"],
539
552
  description: "Renames, recolours, hides, moves to the secondary axis or changes how a series is drawn, including error bars (null resets a field).",
540
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkNZD2MZJCcjs.SERIES_PROPS).filter(([k]) => k !== "values")) }, ["series"]),
553
+ params: object({ series: _chunkTVQW26AVcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkTVQW26AVcjs.SERIES_PROPS).filter(([k]) => k !== "values")) }, ["series"]),
541
554
  run: (_ctx, params) => {
542
555
  const { series, ...patch } = params;
543
556
  const id = resolveSeries(series).id;
@@ -551,7 +564,7 @@ function createChartCommands(controller, options = {}) {
551
564
  label: "Delete Series",
552
565
  keywords: ["chart", "series", "remove"],
553
566
  description: "Deletes a series by id or name.",
554
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF }, ["series"]),
567
+ params: object({ series: _chunkTVQW26AVcjs.SERIES_REF }, ["series"]),
555
568
  run: (_ctx, params) => {
556
569
  check(controller.removeSeries(resolveSeries(params.series).id));
557
570
  return { series: seriesIds() };
@@ -576,7 +589,7 @@ function createChartCommands(controller, options = {}) {
576
589
  label: "Delete Category",
577
590
  keywords: ["chart", "category", "row", "remove"],
578
591
  description: "Deletes a category (and its values) by index or label.",
579
- params: object({ category: _chunkNZD2MZJCcjs.CATEGORY_REF }, ["category"]),
592
+ params: object({ category: _chunkTVQW26AVcjs.CATEGORY_REF }, ["category"]),
580
593
  run: (_ctx, params) => {
581
594
  check(controller.removeCategory(resolveCategory(params.category)));
582
595
  return { categories: controller.getSpec().categories };
@@ -588,7 +601,7 @@ function createChartCommands(controller, options = {}) {
588
601
  label: "Add Trendline\u2026",
589
602
  keywords: ["chart", "trend", "regression", "fit", "forecast", "moving average"],
590
603
  description: "Fits a trendline to a series (linear, exponential, logarithmic, power, polynomial or moving average). Returns its index and the fit.",
591
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, ..._chunkNZD2MZJCcjs.TRENDLINE_PROPS }, ["series", "type"]),
604
+ params: object({ series: _chunkTVQW26AVcjs.SERIES_REF, ..._chunkTVQW26AVcjs.TRENDLINE_PROPS }, ["series", "type"]),
592
605
  run: (_ctx, params) => {
593
606
  const { series, ...line } = params;
594
607
  const result = controller.addTrendline(resolveSeries(series).id, line);
@@ -603,7 +616,7 @@ function createChartCommands(controller, options = {}) {
603
616
  label: "Delete Trendline",
604
617
  keywords: ["chart", "trend", "remove"],
605
618
  description: "Deletes a trendline from a series.",
606
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index (0 = first)." } }, ["series", "index"]),
619
+ params: object({ series: _chunkTVQW26AVcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index (0 = first)." } }, ["series", "index"]),
607
620
  run: (_ctx, params) => {
608
621
  check(controller.removeTrendline(resolveSeries(params.series).id, params.index));
609
622
  return { trendlines: _nullishCoalesce(_optionalChain([controller, 'access', _29 => _29.getSeries, 'call', _30 => _30(resolveSeries(params.series).id), 'optionalAccess', _31 => _31.trendlines]), () => ( [])) };
@@ -615,7 +628,7 @@ function createChartCommands(controller, options = {}) {
615
628
  label: "Add Reference Line\u2026",
616
629
  keywords: ["chart", "target", "goal", "threshold", "average", "reference", "line", "annotation"],
617
630
  description: "Draws a dashed line across the plot at one value (a target, floor or average). Returns its index.",
618
- params: object(_chunkNZD2MZJCcjs.REFERENCE_LINE_PROPS, ["value"]),
631
+ params: object(_chunkTVQW26AVcjs.REFERENCE_LINE_PROPS, ["value"]),
619
632
  run: (_ctx, params) => {
620
633
  const result = controller.addReferenceLine(params);
621
634
  check(result);
@@ -628,7 +641,7 @@ function createChartCommands(controller, options = {}) {
628
641
  label: "Change Reference Line\u2026",
629
642
  keywords: ["chart", "target", "reference", "line", "annotation"],
630
643
  description: "Changes a reference line by index; label, axis and color take null to remove them.",
631
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference line"), ..._chunkNZD2MZJCcjs.REFERENCE_LINE_PATCH }, ["index"]),
644
+ params: object({ index: _chunkTVQW26AVcjs.REFERENCE_INDEX.call(void 0, "Reference line"), ..._chunkTVQW26AVcjs.REFERENCE_LINE_PATCH }, ["index"]),
632
645
  run: (_ctx, params) => {
633
646
  const { index, ...patch } = params;
634
647
  check(controller.updateReferenceLine(index, patch));
@@ -641,7 +654,7 @@ function createChartCommands(controller, options = {}) {
641
654
  label: "Delete Reference Line",
642
655
  keywords: ["chart", "target", "reference", "line", "remove"],
643
656
  description: "Deletes a reference line by index.",
644
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference line") }, ["index"]),
657
+ params: object({ index: _chunkTVQW26AVcjs.REFERENCE_INDEX.call(void 0, "Reference line") }, ["index"]),
645
658
  run: (_ctx, params) => {
646
659
  check(controller.removeReferenceLine(params.index));
647
660
  return { referenceLines: controller.getSpec().referenceLines };
@@ -653,7 +666,7 @@ function createChartCommands(controller, options = {}) {
653
666
  label: "Add Reference Band\u2026",
654
667
  keywords: ["chart", "target", "range", "band", "reference", "shade", "annotation"],
655
668
  description: "Shades a band across the plot between two values (a target or normal range). Returns its index.",
656
- params: object(_chunkNZD2MZJCcjs.REFERENCE_BAND_PROPS, ["from", "to"]),
669
+ params: object(_chunkTVQW26AVcjs.REFERENCE_BAND_PROPS, ["from", "to"]),
657
670
  run: (_ctx, params) => {
658
671
  const result = controller.addReferenceBand(params);
659
672
  check(result);
@@ -666,7 +679,7 @@ function createChartCommands(controller, options = {}) {
666
679
  label: "Change Reference Band\u2026",
667
680
  keywords: ["chart", "range", "band", "reference", "annotation"],
668
681
  description: "Changes a reference band by index; label, axis and color take null to remove them.",
669
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference band"), ..._chunkNZD2MZJCcjs.REFERENCE_BAND_PATCH }, ["index"]),
682
+ params: object({ index: _chunkTVQW26AVcjs.REFERENCE_INDEX.call(void 0, "Reference band"), ..._chunkTVQW26AVcjs.REFERENCE_BAND_PATCH }, ["index"]),
670
683
  run: (_ctx, params) => {
671
684
  const { index, ...patch } = params;
672
685
  check(controller.updateReferenceBand(index, patch));
@@ -679,7 +692,7 @@ function createChartCommands(controller, options = {}) {
679
692
  label: "Delete Reference Band",
680
693
  keywords: ["chart", "range", "band", "reference", "remove"],
681
694
  description: "Deletes a reference band by index.",
682
- params: object({ index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, "Reference band") }, ["index"]),
695
+ params: object({ index: _chunkTVQW26AVcjs.REFERENCE_INDEX.call(void 0, "Reference band") }, ["index"]),
683
696
  run: (_ctx, params) => {
684
697
  check(controller.removeReferenceBand(params.index));
685
698
  return { referenceBands: controller.getSpec().referenceBands };
@@ -691,7 +704,7 @@ function createChartCommands(controller, options = {}) {
691
704
  label: "Pin Label to Point\u2026",
692
705
  keywords: ["chart", "callout", "annotation", "label", "note", "point"],
693
706
  description: 'Pins a short label to one bar or point (label null or "" removes it).',
694
- params: object({ series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (a few words), or null to remove it." } }, ["series", "category", "label"]),
707
+ params: object({ series: _chunkTVQW26AVcjs.SERIES_REF, category: _chunkTVQW26AVcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (a few words), or null to remove it." } }, ["series", "category", "label"]),
695
708
  run: (_ctx, params) => {
696
709
  const series = resolveSeries(params.series);
697
710
  const index = resolveCategory(params.category);
@@ -719,10 +732,10 @@ function createChartCommands(controller, options = {}) {
719
732
  label: "Replace Grouped Data\u2026",
720
733
  keywords: ["chart", "tree", "hierarchy", "groups", "treemap", "sunburst", "nested"],
721
734
  description: "Replaces the data with groups of items (a tree) for treemaps and sunbursts; [] goes back to plain data.",
722
- params: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkNZD2MZJCcjs.TREE_DEFS },
735
+ params: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkTVQW26AVcjs.TREE_DEFS },
723
736
  run: (_ctx, params) => {
724
737
  check(controller.setTree(params.tree));
725
- return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n) })) };
738
+ return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkUVXTOZ2Bcjs.chartTreeTotal.call(void 0, n) })) };
726
739
  }
727
740
  },
728
741
  {
@@ -758,7 +771,7 @@ function createChartCommands(controller, options = {}) {
758
771
  },
759
772
  required: ["node"],
760
773
  additionalProperties: false,
761
- $defs: _chunkNZD2MZJCcjs.TREE_DEFS
774
+ $defs: _chunkTVQW26AVcjs.TREE_DEFS
762
775
  },
763
776
  run: (_ctx, params) => {
764
777
  const result = controller.addTreeNode(_nullishCoalesce(params.parent, () => ( [])), params.node, { at: params.at });
@@ -774,7 +787,7 @@ function createChartCommands(controller, options = {}) {
774
787
  description: "Renames a node, sets an item's value or sets a node's colour (null for the palette).",
775
788
  params: object(
776
789
  {
777
- path: _chunkNZD2MZJCcjs.TREE_PATH,
790
+ path: _chunkTVQW26AVcjs.TREE_PATH,
778
791
  name: { type: "string", description: "New name." },
779
792
  value: { type: "number", minimum: 0, description: "Items only: the new amount." },
780
793
  color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." }
@@ -794,10 +807,84 @@ function createChartCommands(controller, options = {}) {
794
807
  label: "Delete Item or Group",
795
808
  keywords: ["chart", "tree", "group", "item", "remove", "delete"],
796
809
  description: "Deletes a node of the grouped data with everything under it.",
797
- params: object({ path: _chunkNZD2MZJCcjs.TREE_PATH }, ["path"]),
810
+ params: object({ path: _chunkTVQW26AVcjs.TREE_PATH }, ["path"]),
798
811
  run: (_ctx, params) => {
799
812
  check(controller.removeTreeNode(params.path));
800
- return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n) })) };
813
+ return { groups: controller.getSpec().tree.map((n) => ({ name: n.name, total: _chunkUVXTOZ2Bcjs.chartTreeTotal.call(void 0, n) })) };
814
+ }
815
+ },
816
+ {
817
+ ...base,
818
+ id: `${prefix}setLinks`,
819
+ label: "Replace Flows\u2026",
820
+ keywords: ["chart", "sankey", "flow", "links", "funnel", "budget"],
821
+ description: "Replaces the data with flows between named nodes for a Sankey diagram; [] goes back to plain data.",
822
+ params: object(
823
+ {
824
+ links: { type: "array", items: { type: "object", properties: _chunkTVQW26AVcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false }, description: "All the flows; [] removes them." },
825
+ nodes: { type: "array", items: { type: "string" }, description: "Node names in stacking order." }
826
+ },
827
+ ["links"]
828
+ ),
829
+ run: (_ctx, params) => {
830
+ check(controller.setLinks(params.links, { nodes: params.nodes }));
831
+ return { links: controller.getSpec().links, nodes: controller.getSpec().sankeyNodes };
832
+ }
833
+ },
834
+ {
835
+ ...base,
836
+ id: `${prefix}importLinksCsv`,
837
+ label: "Import Flows from CSV\u2026",
838
+ keywords: ["chart", "sankey", "flow", "csv", "import"],
839
+ description: "Replaces the data with flows from CSV / TSV rows of source, target and value.",
840
+ params: object(
841
+ {
842
+ csv: { type: "string", description: "CSV or TSV text." },
843
+ header: { type: ["boolean", "string"], enum: [true, false, "auto"], description: "The first row holds column names (default auto)." }
844
+ },
845
+ ["csv"]
846
+ ),
847
+ run: (_ctx, params) => {
848
+ check(controller.importLinksTable(_chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv, { delimiter: params.csv.includes(" ") ? " " : "," }), { header: params.header }));
849
+ return { links: controller.getSpec().links };
850
+ }
851
+ },
852
+ {
853
+ ...base,
854
+ id: `${prefix}addLink`,
855
+ label: "Add Flow\u2026",
856
+ keywords: ["chart", "sankey", "flow", "link", "add"],
857
+ description: "Adds a flow between two nodes. Returns its index.",
858
+ params: object(_chunkTVQW26AVcjs.LINK_PROPS, ["source", "target", "value"]),
859
+ run: (_ctx, params) => {
860
+ const result = controller.addLink(params);
861
+ check(result);
862
+ return { index: result.index };
863
+ }
864
+ },
865
+ {
866
+ ...base,
867
+ id: `${prefix}updateLink`,
868
+ label: "Change Flow\u2026",
869
+ keywords: ["chart", "sankey", "flow", "link", "value"],
870
+ description: "Changes a flow by index (color null for the default).",
871
+ params: object({ index: _chunkTVQW26AVcjs.LINK_INDEX, ..._chunkTVQW26AVcjs.LINK_PROPS, color: { type: ["string", "null"], description: "CSS colour, or null for the default." } }, ["index"]),
872
+ run: (_ctx, params) => {
873
+ const { index, ...patch } = params;
874
+ check(controller.updateLink(index, patch));
875
+ return { link: controller.getSpec().links[index] };
876
+ }
877
+ },
878
+ {
879
+ ...base,
880
+ id: `${prefix}removeLink`,
881
+ label: "Delete Flow",
882
+ keywords: ["chart", "sankey", "flow", "link", "remove"],
883
+ description: "Deletes a flow by index.",
884
+ params: object({ index: _chunkTVQW26AVcjs.LINK_INDEX }, ["index"]),
885
+ run: (_ctx, params) => {
886
+ check(controller.removeLink(params.index));
887
+ return { links: controller.getSpec().links };
801
888
  }
802
889
  },
803
890
  {
@@ -807,8 +894,8 @@ function createChartCommands(controller, options = {}) {
807
894
  keywords: ["chart", "quick layout", "style", "colours", "colors", "monochrome", "theme"],
808
895
  description: "Applies a quick layout and / or colour scheme as one undo step.",
809
896
  params: object({
810
- layout: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
811
- colors: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
897
+ layout: { type: "string", enum: _chunkIMRXC7OAcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
898
+ colors: { type: "string", enum: _chunkIMRXC7OAcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
812
899
  }),
813
900
  run: (_ctx, params = {}) => {
814
901
  check(controller.applyPreset(_nullishCoalesce(params, () => ( {}))));
@@ -823,7 +910,7 @@ function createChartCommands(controller, options = {}) {
823
910
  description: "Swaps series and categories as one undo step.",
824
911
  run: () => {
825
912
  check(controller.transpose());
826
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()) };
913
+ return { table: _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, controller.getSpec()) };
827
914
  }
828
915
  },
829
916
  {
@@ -843,7 +930,7 @@ function createChartCommands(controller, options = {}) {
843
930
  run: (_ctx, params) => {
844
931
  const result = controller.importCsv(params.csv, { seriesIn: params.seriesIn, header: params.header });
845
932
  check(result);
846
- return { table: _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()), issues: _nullishCoalesce(result.issues, () => ( [])) };
933
+ return { table: _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, controller.getSpec()), issues: _nullishCoalesce(result.issues, () => ( [])) };
847
934
  }
848
935
  },
849
936
  {
@@ -851,11 +938,11 @@ function createChartCommands(controller, options = {}) {
851
938
  id: `${prefix}importMermaid`,
852
939
  label: "Import Mermaid Chart\u2026",
853
940
  keywords: ["chart", "mermaid", "markdown", "xychart", "pie", "radar", "import"],
854
- description: "Replaces the chart with Mermaid xychart-beta, pie or radar-beta text (one undo step). Unreadable lines are listed with line numbers.",
941
+ description: "Replaces the chart with Mermaid xychart-beta, pie, radar-beta, sankey-beta or treemap-beta text (one undo step). Unreadable lines are listed with line numbers.",
855
942
  params: object({ mermaid: { type: "string", description: "Mermaid text." } }, ["mermaid"]),
856
943
  run: (_ctx, params) => {
857
- const read = _chunkGKNEJ6ENcjs.chartFromMermaid.call(void 0, params.mermaid);
858
- if (!read.family) fail(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie or radar-beta.");
944
+ const read = _chunkIMRXC7OAcjs.chartFromMermaid.call(void 0, params.mermaid);
945
+ if (!read.family) fail(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie, radar-beta, sankey-beta or treemap-beta.");
859
946
  check(controller.update({ ...read.spec }, { label: "Import Mermaid chart" }));
860
947
  return { spec: controller.toJSON(), issues: read.issues };
861
948
  }
@@ -868,7 +955,7 @@ function createChartCommands(controller, options = {}) {
868
955
  keywords: ["chart", "mermaid", "markdown", "export"],
869
956
  description: "Returns the chart as Mermaid text (with a round-trip comment unless meta is false).",
870
957
  params: object({ meta: { type: "boolean", description: "Include the %% @pixerate round-trip comment (default true)." } }),
871
- run: (_ctx, params = {}) => ({ mermaid: _chunkGKNEJ6ENcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta: _optionalChain([params, 'optionalAccess', _36 => _36.meta]) }) })
958
+ run: (_ctx, params = {}) => ({ mermaid: _chunkIMRXC7OAcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta: _optionalChain([params, 'optionalAccess', _36 => _36.meta]) }) })
872
959
  },
873
960
  {
874
961
  ...base,
@@ -877,7 +964,7 @@ function createChartCommands(controller, options = {}) {
877
964
  readOnly: true,
878
965
  keywords: ["chart", "office", "word", "powerpoint", "docx", "pptx", "xml", "export"],
879
966
  description: "Returns the chart as a DrawingML chart part (c:chartSpace) and what could not be written.",
880
- run: () => _chunkYGG7WDWTcjs.chartToOoxml.call(void 0, controller.toJSON())
967
+ run: () => _chunkQ25WAFTDcjs.chartToOoxml.call(void 0, controller.toJSON())
881
968
  },
882
969
  {
883
970
  ...base,
@@ -886,9 +973,9 @@ function createChartCommands(controller, options = {}) {
886
973
  readOnly: true,
887
974
  keywords: ["chart", "svg", "export", "image"],
888
975
  description: "Returns the chart drawn as a standalone, accessible SVG string (with <title> and <desc>).",
889
- params: object({ width: _chunkNZD2MZJCcjs.WIDTH, height: _chunkNZD2MZJCcjs.HEIGHT }),
976
+ params: object({ width: _chunkTVQW26AVcjs.WIDTH, height: _chunkTVQW26AVcjs.HEIGHT }),
890
977
  run: (_ctx, params = {}) => ({
891
- svg: _chunkGKNEJ6ENcjs.chartToSvg.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _37 => _37.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _38 => _38.height]), () => ( 400)) })
978
+ svg: _chunkIMRXC7OAcjs.chartToSvg.call(void 0, controller.toJSON(), { width: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _37 => _37.width]), () => ( 640)), height: _nullishCoalesce(_optionalChain([params, 'optionalAccess', _38 => _38.height]), () => ( 400)) })
892
979
  })
893
980
  },
894
981
  {
@@ -900,7 +987,7 @@ function createChartCommands(controller, options = {}) {
900
987
  description: "Suggests chart types for the current data (or CSV), best first, each with a reason.",
901
988
  params: object({ csv: { type: "string", description: "CSV text to analyse instead of the current data." } }),
902
989
  run: (_ctx, params = {}) => ({
903
- recommendations: recommendChartTypes(_optionalChain([params, 'optionalAccess', _39 => _39.csv]) !== void 0 ? _chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv) : _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, controller.getSpec()))
990
+ recommendations: recommendChartTypes(_optionalChain([params, 'optionalAccess', _39 => _39.csv]) !== void 0 ? _chunkN3KJFGXTcjs.parseCsv.call(void 0, params.csv) : _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, controller.getSpec()))
904
991
  })
905
992
  },
906
993
  {
@@ -913,8 +1000,8 @@ function createChartCommands(controller, options = {}) {
913
1000
  run: () => {
914
1001
  const s = controller.getSpec();
915
1002
  const visible = s.series.filter((x) => !x.hidden);
916
- const colors = _chunkR3P2M7HUcjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _40 => _40[0], 'optionalAccess', _41 => _41.pointColors, 'optionalAccess', _42 => _42[i]]) || _chunkR3P2M7HUcjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkR3P2M7HUcjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
917
- return { colors, ..._chunkR3P2M7HUcjs.checkChartColors.call(void 0, colors) };
1003
+ const colors = _chunkUVXTOZ2Bcjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _40 => _40[0], 'optionalAccess', _41 => _41.pointColors, 'optionalAccess', _42 => _42[i]]) || _chunkUVXTOZ2Bcjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkUVXTOZ2Bcjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
1004
+ return { colors, ..._chunkUVXTOZ2Bcjs.checkChartColors.call(void 0, colors) };
918
1005
  }
919
1006
  },
920
1007
  {
@@ -945,7 +1032,7 @@ function chartClientToScene(scene, box, clientX, clientY) {
945
1032
  function canDragChartPoint(controller, scene, target) {
946
1033
  if (_optionalChain([target, 'optionalAccess', _43 => _43.kind]) !== "point" || !scene.valueScale || scene.percent) return false;
947
1034
  const spec = controller.getSpec();
948
- const family = _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec);
1035
+ const family = _chunkUVXTOZ2Bcjs.chartFamily.call(void 0, spec);
949
1036
  if (family !== "cartesian" && family !== "xy" && family !== "waterfall") return false;
950
1037
  const series = controller.getSeries(target.seriesId);
951
1038
  return !!series && !series.hidden && series.values[target.index] !== null;
@@ -954,7 +1041,7 @@ function snapChartDragValue(scene, value, options = {}) {
954
1041
  const scale = _nullishCoalesce(options.scale, () => ( scene.valueScale));
955
1042
  const tolerance = _nullishCoalesce(options.tolerancePx, () => ( 6));
956
1043
  if (scale) {
957
- const px = (v) => _chunkSBQVEBSUcjs.chartScaleToPixel.call(void 0, v, scale);
1044
+ const px = (v) => _chunkQO2T6KA5cjs.chartScaleToPixel.call(void 0, v, scale);
958
1045
  const at = px(value);
959
1046
  let best = null;
960
1047
  let bestDist = tolerance;
@@ -969,7 +1056,7 @@ function snapChartDragValue(scene, value, options = {}) {
969
1056
  }
970
1057
  if (best !== null) return best;
971
1058
  }
972
- return _chunkSBQVEBSUcjs.snapChartValue.call(void 0, scene, value, options.step, _optionalChain([scale, 'optionalAccess', _44 => _44.ticks]), _optionalChain([scale, 'optionalAccess', _45 => _45.logBase]));
1059
+ return _chunkQO2T6KA5cjs.snapChartValue.call(void 0, scene, value, options.step, _optionalChain([scale, 'optionalAccess', _44 => _44.ticks]), _optionalChain([scale, 'optionalAccess', _45 => _45.logBase]));
973
1060
  }
974
1061
  function startChartPointDrag(controller, scene, target, start, options = {}) {
975
1062
  if (!canDragChartPoint(controller, scene, target)) return null;
@@ -978,11 +1065,11 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
978
1065
  const series = controller.getSeries(seriesId);
979
1066
  const secondary = series.axis === "secondary" && !!scene.valueScale2;
980
1067
  const scale = secondary ? scene.valueScale2 : scene.valueScale;
981
- const xy = _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec) === "xy" && !!scene.xScale;
1068
+ const xy = _chunkUVXTOZ2Bcjs.chartFamily.call(void 0, spec) === "xy" && !!scene.xScale;
982
1069
  const startValue = _nullishCoalesce(series.values[index], () => ( 0));
983
1070
  const startX = _nullishCoalesce(_optionalChain([series, 'access', _46 => _46.x, 'optionalAccess', _47 => _47[index]]), () => ( null));
984
- const startAt = _chunkSBQVEBSUcjs.chartValueAtPoint.call(void 0, scene, start, secondary);
985
- const startAtX = xy ? _chunkSBQVEBSUcjs.chartXAtPoint.call(void 0, scene, start) : void 0;
1071
+ const startAt = _chunkQO2T6KA5cjs.chartValueAtPoint.call(void 0, scene, start, secondary);
1072
+ const startAtX = xy ? _chunkQO2T6KA5cjs.chartXAtPoint.call(void 0, scene, start) : void 0;
986
1073
  if (startAt === void 0) return null;
987
1074
  const candidates = [0, startValue];
988
1075
  if (!xy) {
@@ -1000,7 +1087,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1000
1087
  target: { seriesId, index },
1001
1088
  move(point, moveOptions = {}) {
1002
1089
  if (ended) return;
1003
- const at = _chunkSBQVEBSUcjs.chartValueAtPoint.call(void 0, scene, point, secondary);
1090
+ const at = _chunkQO2T6KA5cjs.chartValueAtPoint.call(void 0, scene, point, secondary);
1004
1091
  if (at === void 0) return;
1005
1092
  const factor = moveOptions.fine ? 0.1 : 1;
1006
1093
  const moved = (from, to, s, value) => s.logBase && value > 0 && from > 0 && to > 0 ? value * Math.pow(to / from, factor) : value + (to - from) * factor;
@@ -1008,7 +1095,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1008
1095
  let moveX = false;
1009
1096
  let atX;
1010
1097
  if (xy && startX !== null && startAtX !== void 0) {
1011
- atX = _chunkSBQVEBSUcjs.chartXAtPoint.call(void 0, scene, point);
1098
+ atX = _chunkQO2T6KA5cjs.chartXAtPoint.call(void 0, scene, point);
1012
1099
  moveX = atX !== void 0;
1013
1100
  if (moveOptions.lockAxis) {
1014
1101
  if (Math.abs(point.x - start.x) >= Math.abs(point.y - start.y)) moveY = false;
@@ -1020,7 +1107,7 @@ function startChartPointDrag(controller, scene, target, start, options = {}) {
1020
1107
  if (moveOptions.fine) {
1021
1108
  if (s.logBase && !options.step) return v > 0 ? Number(v.toPrecision(3)) : v;
1022
1109
  const unit = options.step ? options.step / 10 : s.ticks.length > 1 ? (s.ticks[1] - s.ticks[0]) / 100 : void 0;
1023
- return _chunkSBQVEBSUcjs.snapChartValue.call(void 0, scene, v, unit, s.ticks);
1110
+ return _chunkQO2T6KA5cjs.snapChartValue.call(void 0, scene, v, unit, s.ticks);
1024
1111
  }
1025
1112
  return snapChartDragValue(scene, v, { candidates: c, tolerancePx: options.tolerancePx, step: options.step, scale: s });
1026
1113
  };
@@ -1108,7 +1195,7 @@ function describeChartSelection(controller, selection = controller.getState().se
1108
1195
  case "legend":
1109
1196
  return "Legend";
1110
1197
  case "axis":
1111
- return selection.axis === "x" ? _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec) === "xy" ? "X axis" : "Category axis" : selection.axis === "y" ? "Value axis" : "Secondary value axis";
1198
+ return selection.axis === "x" ? _chunkUVXTOZ2Bcjs.chartFamily.call(void 0, spec) === "xy" ? "X axis" : "Category axis" : selection.axis === "y" ? "Value axis" : "Secondary value axis";
1112
1199
  case "series":
1113
1200
  return `Series "${_nullishCoalesce(_optionalChain([controller, 'access', _63 => _63.getSeries, 'call', _64 => _64(selection.seriesId), 'optionalAccess', _65 => _65.name]), () => ( selection.seriesId))}"`;
1114
1201
  case "category":
@@ -1122,7 +1209,7 @@ function describeChartSelection(controller, selection = controller.getState().se
1122
1209
  const series = controller.getSeries(selection.seriesId);
1123
1210
  const value = _optionalChain([series, 'optionalAccess', _69 => _69.values, 'access', _70 => _70[selection.index]]);
1124
1211
  const x = _optionalChain([series, 'optionalAccess', _71 => _71.x, 'optionalAccess', _72 => _72[selection.index]]);
1125
- if (x !== void 0 && x !== null && _chunkR3P2M7HUcjs.chartFamily.call(void 0, spec) === "xy") return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _73 => _73.name]), () => ( selection.seriesId))}: (${x}, ${_nullishCoalesce(value, () => ( "blank"))})`;
1212
+ if (x !== void 0 && x !== null && _chunkUVXTOZ2Bcjs.chartFamily.call(void 0, spec) === "xy") return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _73 => _73.name]), () => ( selection.seriesId))}: (${x}, ${_nullishCoalesce(value, () => ( "blank"))})`;
1126
1213
  return `${_nullishCoalesce(_optionalChain([series, 'optionalAccess', _74 => _74.name]), () => ( selection.seriesId))} \xB7 ${_nullishCoalesce(spec.categories[selection.index], () => ( selection.index))}: ${_nullishCoalesce(value, () => ( "blank"))}`;
1127
1214
  }
1128
1215
  }
@@ -1199,7 +1286,7 @@ function planChartCommand(spec, scene, command, speed = 1) {
1199
1286
  const from = _nullishCoalesce(_optionalChain([series, 'optionalAccess', _77 => _77.values, 'access', _78 => _78[command.index]]), () => ( 0));
1200
1287
  const scale = _optionalChain([series, 'optionalAccess', _79 => _79.axis]) === "secondary" ? _nullishCoalesce(scene.valueScale2, () => ( scene.valueScale)) : scene.valueScale;
1201
1288
  if (at && scale) {
1202
- const px = _chunkSBQVEBSUcjs.linearMap.call(void 0, command.value, scale.domain, scale.range);
1289
+ const px = _chunkQO2T6KA5cjs.linearMap.call(void 0, command.value, scale.domain, scale.range);
1203
1290
  const to = scale.axis === "y" ? { x: at.x, y: px } : { x: px, y: at.y };
1204
1291
  steps.push({ type: "move", to: at, ms: ms(380) }, { type: "press" }, { type: "drag", to, ms: ms(520), from, value: command.value }, { type: "release" });
1205
1292
  } else steps.push({ type: "drag", to: { x: scene.plot.x + scene.plot.width / 2, y: scene.plot.y + scene.plot.height / 2 }, ms: ms(200), from, value: command.value });
@@ -1366,6 +1453,11 @@ function planChartToolPlayback(tool, args) {
1366
1453
  case "add_chart_tree_node":
1367
1454
  case "update_chart_tree_node":
1368
1455
  case "remove_chart_tree_node":
1456
+ case "set_chart_links":
1457
+ case "import_chart_links_csv":
1458
+ case "add_chart_link":
1459
+ case "update_chart_link":
1460
+ case "remove_chart_link":
1369
1461
  case "import_chart_csv":
1370
1462
  case "import_chart_mermaid":
1371
1463
  case "import_chart_ooxml":
@@ -1450,19 +1542,20 @@ function createChartToolProvider(controller, options = {}) {
1450
1542
  fail2(`There is no category ${JSON.stringify(ref)}; expected an index from 0 to ${categories.length - 1} or one of ${categories.slice(0, 20).map((c) => JSON.stringify(c)).join(", ")}.`);
1451
1543
  return index;
1452
1544
  };
1453
- const table = () => _chunkR3P2M7HUcjs.chartDataToTable.call(void 0, spec());
1545
+ const table = () => _chunkUVXTOZ2Bcjs.chartDataToTable.call(void 0, spec());
1454
1546
  const treeTable = () => {
1455
- const rows = _chunkR3P2M7HUcjs.chartTreeToRows.call(void 0, spec().tree);
1456
- const depth = _chunkR3P2M7HUcjs.chartTreeDepth.call(void 0, spec().tree);
1547
+ const rows = _chunkUVXTOZ2Bcjs.chartTreeToRows.call(void 0, spec().tree);
1548
+ const depth = _chunkUVXTOZ2Bcjs.chartTreeDepth.call(void 0, spec().tree);
1457
1549
  return [[...Array.from({ length: depth }, (_, k) => k === 0 ? "Group" : k === depth - 1 ? "Item" : `Level ${k + 1}`), "Value"], ...rows.map((r) => [...r.path, ...Array(depth - r.path.length).fill(""), r.value])];
1458
1550
  };
1459
- const treeSummary = () => ({ tree: spec().tree, groups: spec().tree.map((n) => ({ name: n.name, total: _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n) })), depth: _chunkR3P2M7HUcjs.chartTreeDepth.call(void 0, spec().tree) });
1551
+ const linksSummary = () => ({ links: spec().links, nodes: spec().sankeyNodes.map((name, i) => ({ name, value: _chunkUVXTOZ2Bcjs.chartSankeyNodeValues.call(void 0, spec().links, spec().sankeyNodes)[i] })) });
1552
+ const treeSummary = () => ({ tree: spec().tree, groups: spec().tree.map((n) => ({ name: n.name, total: _chunkUVXTOZ2Bcjs.chartTreeTotal.call(void 0, n) })), depth: _chunkUVXTOZ2Bcjs.chartTreeDepth.call(void 0, spec().tree) });
1460
1553
  const Parser = () => _nullishCoalesce(options.DOMParser, () => ( globalThis.DOMParser));
1461
1554
  const getChart = {
1462
1555
  name: "get_chart",
1463
1556
  title: "Read the chart",
1464
1557
  description: "Returns the chart spec (type, titles, axes, legend, series with ids and settings), its data as a table (header row of series names, then one row per category), grouped data as treeTable (path of names to each item, then its value) when the chart has a tree, the current selection, and a summary at the given size: per-series min / max / mean / trend, the axes as drawn, layout warnings (hidden labels, thinned lines), a colour check and a plain-language description. Use the series ids and category indexes it returns with the write tools.",
1465
- inputSchema: { type: "object", properties: { width: _chunkNZD2MZJCcjs.WIDTH, height: _chunkNZD2MZJCcjs.HEIGHT }, additionalProperties: false },
1558
+ inputSchema: { type: "object", properties: { width: _chunkTVQW26AVcjs.WIDTH, height: _chunkTVQW26AVcjs.HEIGHT }, additionalProperties: false },
1466
1559
  annotations: { title: "Read the chart", ...READ },
1467
1560
  handler: ({ width = size.width, height = size.height }) => {
1468
1561
  const reason = readOnlyReason();
@@ -1470,7 +1563,7 @@ function createChartToolProvider(controller, options = {}) {
1470
1563
  spec: controller.toJSON(),
1471
1564
  table: table(),
1472
1565
  selection: controller.getState().selection,
1473
- summary: _chunkGKNEJ6ENcjs.summarizeChart.call(void 0, controller.toJSON(), { width, height }),
1566
+ summary: _chunkIMRXC7OAcjs.summarizeChart.call(void 0, controller.toJSON(), { width, height }),
1474
1567
  ...spec().tree.length ? { treeTable: treeTable() } : {},
1475
1568
  issues: controller.getState().issues,
1476
1569
  ...reason ? { readOnly: reason } : {}
@@ -1484,8 +1577,8 @@ function createChartToolProvider(controller, options = {}) {
1484
1577
  inputSchema: {
1485
1578
  type: "object",
1486
1579
  properties: {
1487
- width: _chunkNZD2MZJCcjs.WIDTH,
1488
- height: _chunkNZD2MZJCcjs.HEIGHT,
1580
+ width: _chunkTVQW26AVcjs.WIDTH,
1581
+ height: _chunkTVQW26AVcjs.HEIGHT,
1489
1582
  format: { type: "string", enum: ["svg", "png"], description: "svg (default): the SVG document as text. png: an image to look at (only when the host can rasterize; costs image tokens)." }
1490
1583
  },
1491
1584
  additionalProperties: false
@@ -1493,8 +1586,8 @@ function createChartToolProvider(controller, options = {}) {
1493
1586
  annotations: { title: "Render the chart", ...READ },
1494
1587
  handler: async ({ width = size.width, height = size.height, format = "svg" }) => {
1495
1588
  const json = controller.toJSON();
1496
- const scene = _chunkSBQVEBSUcjs.layoutChart.call(void 0, json, { width, height, selection: null });
1497
- const svg = _chunkGKNEJ6ENcjs.chartSceneToSvg.call(void 0, scene, { ariaLabel: json.title || void 0, description: _chunkGKNEJ6ENcjs.describeChart.call(void 0, json) });
1589
+ const scene = _chunkQO2T6KA5cjs.layoutChart.call(void 0, json, { width, height, selection: null });
1590
+ const svg = _chunkIMRXC7OAcjs.chartSceneToSvg.call(void 0, scene, { ariaLabel: json.title || void 0, description: _chunkIMRXC7OAcjs.describeChart.call(void 0, json) });
1498
1591
  const warnings = scene.warnings;
1499
1592
  if (format === "png") {
1500
1593
  if (!options.rasterize) fail2('This host cannot rasterize charts; call render_chart with format "svg", or get_chart for the layout warnings.');
@@ -1528,8 +1621,8 @@ function createChartToolProvider(controller, options = {}) {
1528
1621
  handler: ({ colors, surface }) => {
1529
1622
  const s = spec();
1530
1623
  const visible = s.series.filter((x) => !x.hidden);
1531
- const own = _chunkR3P2M7HUcjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _91 => _91[0], 'optionalAccess', _92 => _92.pointColors, 'optionalAccess', _93 => _93[i]]) || _chunkR3P2M7HUcjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkR3P2M7HUcjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
1532
- return { colors: _nullishCoalesce(colors, () => ( own)), ..._chunkR3P2M7HUcjs.checkChartColors.call(void 0, _nullishCoalesce(colors, () => ( own)), { surface }) };
1624
+ const own = _chunkUVXTOZ2Bcjs.chartSpecColorsByCategory.call(void 0, s) ? s.categories.map((_, i) => _optionalChain([visible, 'access', _91 => _91[0], 'optionalAccess', _92 => _92.pointColors, 'optionalAccess', _93 => _93[i]]) || _chunkUVXTOZ2Bcjs.chartSliceColor.call(void 0, s, i)) : visible.map((x) => _chunkUVXTOZ2Bcjs.chartSeriesColor.call(void 0, s, s.series.indexOf(x)));
1625
+ return { colors: _nullishCoalesce(colors, () => ( own)), ..._chunkUVXTOZ2Bcjs.checkChartColors.call(void 0, _nullishCoalesce(colors, () => ( own)), { surface }) };
1533
1626
  }
1534
1627
  };
1535
1628
  const recommend = {
@@ -1551,7 +1644,7 @@ function createChartToolProvider(controller, options = {}) {
1551
1644
  description: "Returns a trendline's fitted coefficients (in x for category charts, x = 1, 2, 3, \u2026), R\xB2, equation and the number of points, or the moving-average points.",
1552
1645
  inputSchema: {
1553
1646
  type: "object",
1554
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1647
+ properties: { series: _chunkTVQW26AVcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1555
1648
  required: ["series", "index"],
1556
1649
  additionalProperties: false
1557
1650
  },
@@ -1573,17 +1666,17 @@ function createChartToolProvider(controller, options = {}) {
1573
1666
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
1574
1667
  annotations: { title: "List chart presets", ...READ },
1575
1668
  handler: () => ({
1576
- layouts: _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS.map(({ id, label, description }) => ({ id, label, description })),
1577
- colorSchemes: _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES.map(({ id, label, description, palette }) => ({ id, label, description, palette }))
1669
+ layouts: _chunkIMRXC7OAcjs.CHART_LAYOUT_PRESETS.map(({ id, label, description }) => ({ id, label, description })),
1670
+ colorSchemes: _chunkIMRXC7OAcjs.CHART_COLOR_SCHEMES.map(({ id, label, description, palette }) => ({ id, label, description, palette }))
1578
1671
  })
1579
1672
  };
1580
1673
  const exportMermaid = {
1581
1674
  name: "export_chart_mermaid",
1582
1675
  title: "Export chart as Mermaid",
1583
- description: 'Returns the chart as Mermaid text (xychart-beta, pie or radar-beta) for Markdown or chat. With meta (default true) one "%% @pixerate {\u2026}" comment keeps what Mermaid cannot express, so import_chart_mermaid gets the chart back exactly.',
1676
+ description: 'Returns the chart as Mermaid text for Markdown or chat: xychart-beta, pie or radar-beta, sankey-beta for Sankey diagrams with flows, treemap-beta for treemaps and sunbursts (with their levels). With meta (default true) one "%% @pixerate {\u2026}" comment keeps what Mermaid cannot express, so import_chart_mermaid gets the chart back exactly.',
1584
1677
  inputSchema: { type: "object", properties: { meta: { type: "boolean", description: "Include the round-trip comment (default true)." } }, additionalProperties: false },
1585
1678
  annotations: { title: "Export chart as Mermaid", ...READ },
1586
- handler: ({ meta = true }) => ({ mermaid: _chunkGKNEJ6ENcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta }) })
1679
+ handler: ({ meta = true }) => ({ mermaid: _chunkIMRXC7OAcjs.chartToMermaid.call(void 0, controller.toJSON(), { meta }) })
1587
1680
  };
1588
1681
  const exportOoxml = {
1589
1682
  name: "export_chart_ooxml",
@@ -1591,7 +1684,7 @@ function createChartToolProvider(controller, options = {}) {
1591
1684
  description: "Returns the chart as a DrawingML chart part (c:chartSpace) for Word or PowerPoint files, with what could not be written as sentences.",
1592
1685
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
1593
1686
  annotations: { title: "Export chart as Office XML", ...READ },
1594
- handler: () => _chunkYGG7WDWTcjs.chartToOoxml.call(void 0, controller.toJSON())
1687
+ handler: () => _chunkQ25WAFTDcjs.chartToOoxml.call(void 0, controller.toJSON())
1595
1688
  };
1596
1689
  const updateChart = {
1597
1690
  name: "update_chart",
@@ -1599,7 +1692,7 @@ function createChartToolProvider(controller, options = {}) {
1599
1692
  description: 'Changes how the chart looks, as one undo step: type, titles, axes (xAxis = categories or numeric x, yAxis = values, yAxis2 = secondary values; each can be reversed, and value axes can be logarithmic with scale "log"), legend, stacking, orientation, curve, points, data labels and their position, palette, donut hole, bar spacing, histogram bins, waterfall total, radar rings (radarTicks) and grid shape (radarGraticule), note, highlight, reference lines and bands (whole lists), and varyColors. All-or-nothing: invalid values change nothing and come back as sentences. Returns the new spec.',
1600
1693
  inputSchema: {
1601
1694
  type: "object",
1602
- properties: _chunkNZD2MZJCcjs.CHART_UPDATE_PROPERTIES,
1695
+ properties: _chunkTVQW26AVcjs.CHART_UPDATE_PROPERTIES,
1603
1696
  additionalProperties: false
1604
1697
  },
1605
1698
  annotations: { title: "Change chart presentation", ...WRITE_IDEMPOTENT },
@@ -1620,7 +1713,7 @@ function createChartToolProvider(controller, options = {}) {
1620
1713
  series: {
1621
1714
  type: "array",
1622
1715
  description: "The new series (replaces all).",
1623
- items: { type: "object", properties: { id: { type: "string", description: "Stable id (optional)." }, ..._chunkNZD2MZJCcjs.SERIES_PROPS }, required: ["name", "values"], additionalProperties: false }
1716
+ items: { type: "object", properties: { id: { type: "string", description: "Stable id (optional)." }, ..._chunkTVQW26AVcjs.SERIES_PROPS }, required: ["name", "values"], additionalProperties: false }
1624
1717
  }
1625
1718
  },
1626
1719
  additionalProperties: false
@@ -1643,7 +1736,7 @@ function createChartToolProvider(controller, options = {}) {
1643
1736
  type: "array",
1644
1737
  minItems: 1,
1645
1738
  description: "Values to set.",
1646
- items: { type: "object", properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, value: _chunkNZD2MZJCcjs.VALUE }, required: ["series", "category", "value"], additionalProperties: false }
1739
+ items: { type: "object", properties: { series: _chunkTVQW26AVcjs.SERIES_REF, category: _chunkTVQW26AVcjs.CATEGORY_REF, value: _chunkTVQW26AVcjs.VALUE }, required: ["series", "category", "value"], additionalProperties: false }
1647
1740
  }
1648
1741
  },
1649
1742
  required: ["cells"],
@@ -1652,7 +1745,7 @@ function createChartToolProvider(controller, options = {}) {
1652
1745
  annotations: { title: "Set chart values", ...WRITE_IDEMPOTENT },
1653
1746
  handler: async ({ cells }) => {
1654
1747
  const resolved = cells.map((c) => ({ seriesId: seriesById(c.series).id, index: categoryIndex(c.category), value: c.value }));
1655
- const parsed = resolved.map((c) => _chunkR3P2M7HUcjs.parseChartValue.call(void 0, c.value));
1748
+ const parsed = resolved.map((c) => _chunkUVXTOZ2Bcjs.parseChartValue.call(void 0, c.value));
1656
1749
  const bad = resolved.find((_, i) => parsed[i] === void 0);
1657
1750
  if (bad) fail2(`"${String(bad.value)}" is not a number; pass a number, numeric text or null for a gap. Nothing was changed.`);
1658
1751
  if (options.director && parsed.every((v) => typeof v === "number")) {
@@ -1669,7 +1762,7 @@ function createChartToolProvider(controller, options = {}) {
1669
1762
  description: "Adds a series (values padded to the categories) and selects it. Returns its id and stored values.",
1670
1763
  inputSchema: {
1671
1764
  type: "object",
1672
- properties: { ..._chunkNZD2MZJCcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default: series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } },
1765
+ properties: { ..._chunkTVQW26AVcjs.SERIES_PROPS, id: { type: "string", description: "Id to use (default: series-N)." }, at: { type: "integer", minimum: 0, description: "Position (default: last)." } },
1673
1766
  required: ["name"],
1674
1767
  additionalProperties: false
1675
1768
  },
@@ -1687,7 +1780,7 @@ function createChartToolProvider(controller, options = {}) {
1687
1780
  description: "Renames, recolours, hides, moves to the secondary axis or changes how a series is drawn (marker, curve, labels, format, x values, bubble sizes, point colours, error bars). null resets a field. Values change with set_chart_values. Returns the series.",
1688
1781
  inputSchema: {
1689
1782
  type: "object",
1690
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkNZD2MZJCcjs.SERIES_PROPS).filter(([k]) => k !== "values")) },
1783
+ properties: { series: _chunkTVQW26AVcjs.SERIES_REF, ...Object.fromEntries(Object.entries(_chunkTVQW26AVcjs.SERIES_PROPS).filter(([k]) => k !== "values")) },
1691
1784
  required: ["series"],
1692
1785
  additionalProperties: false
1693
1786
  },
@@ -1703,7 +1796,7 @@ function createChartToolProvider(controller, options = {}) {
1703
1796
  name: "remove_chart_series",
1704
1797
  title: "Delete a series",
1705
1798
  description: "Deletes a series and its values. Returns the remaining series ids.",
1706
- inputSchema: { type: "object", properties: { series: _chunkNZD2MZJCcjs.SERIES_REF }, required: ["series"], additionalProperties: false },
1799
+ inputSchema: { type: "object", properties: { series: _chunkTVQW26AVcjs.SERIES_REF }, required: ["series"], additionalProperties: false },
1707
1800
  annotations: { title: "Delete a series", ...DESTRUCTIVE },
1708
1801
  handler: ({ series }) => {
1709
1802
  resolve(controller.removeSeries(seriesById(series).id));
@@ -1729,7 +1822,7 @@ function createChartToolProvider(controller, options = {}) {
1729
1822
  name: "remove_chart_category",
1730
1823
  title: "Delete a category",
1731
1824
  description: "Deletes a category and its value in every series. Returns the remaining categories.",
1732
- inputSchema: { type: "object", properties: { category: _chunkNZD2MZJCcjs.CATEGORY_REF }, required: ["category"], additionalProperties: false },
1825
+ inputSchema: { type: "object", properties: { category: _chunkTVQW26AVcjs.CATEGORY_REF }, required: ["category"], additionalProperties: false },
1733
1826
  annotations: { title: "Delete a category", ...DESTRUCTIVE },
1734
1827
  handler: ({ category }) => {
1735
1828
  resolve(controller.removeCategory(categoryIndex(category)));
@@ -1767,13 +1860,13 @@ function createChartToolProvider(controller, options = {}) {
1767
1860
  const importMermaid = {
1768
1861
  name: "import_chart_mermaid",
1769
1862
  title: "Import a Mermaid chart",
1770
- description: 'Replaces the chart with Mermaid xychart-beta, pie or radar-beta text as one undo step (a "%% @pixerate" comment from export_chart_mermaid restores everything else). Lines that cannot be read are skipped and listed with their line numbers. Returns the spec.',
1863
+ description: 'Replaces the chart with Mermaid xychart-beta, pie, radar-beta, sankey-beta or treemap-beta text as one undo step (a "%% @pixerate" comment from export_chart_mermaid restores everything else). Lines that cannot be read are skipped and listed with their line numbers. Returns the spec.',
1771
1864
  inputSchema: { type: "object", properties: { mermaid: { type: "string", description: "Mermaid text, optionally inside a ```mermaid fence." } }, required: ["mermaid"], additionalProperties: false },
1772
1865
  annotations: { title: "Import a Mermaid chart", ...DESTRUCTIVE },
1773
1866
  handler: ({ mermaid }) => {
1774
1867
  const fenced = /```(?:mermaid)?\s*\n([\s\S]*?)```/.exec(mermaid);
1775
- const read = _chunkGKNEJ6ENcjs.chartFromMermaid.call(void 0, fenced ? fenced[1] : mermaid);
1776
- if (!read.family) fail2(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie or radar-beta.");
1868
+ const read = _chunkIMRXC7OAcjs.chartFromMermaid.call(void 0, fenced ? fenced[1] : mermaid);
1869
+ if (!read.family) fail2(read.issues.map((i) => i.message).join(" ") || "Expected Mermaid starting with xychart-beta, pie, radar-beta, sankey-beta or treemap-beta.");
1777
1870
  resolve(controller.update({ ...read.spec }, { label: "Import Mermaid chart" }));
1778
1871
  return { spec: controller.toJSON(), issues: read.issues };
1779
1872
  }
@@ -1785,7 +1878,7 @@ function createChartToolProvider(controller, options = {}) {
1785
1878
  inputSchema: { type: "object", properties: { xml: { type: "string", description: "The chart part XML, e.g. word/charts/chart1.xml." } }, required: ["xml"], additionalProperties: false },
1786
1879
  annotations: { title: "Import an Office chart", ...DESTRUCTIVE },
1787
1880
  handler: ({ xml }) => {
1788
- const read = _chunkYGG7WDWTcjs.chartFromOoxml.call(void 0, xml, { DOMParser: Parser() });
1881
+ const read = _chunkQ25WAFTDcjs.chartFromOoxml.call(void 0, xml, { DOMParser: Parser() });
1789
1882
  if (read.issues.some((i) => i.path === "" || i.path === "plotArea")) fail2(read.issues.map((i) => i.message).join(" "));
1790
1883
  resolve(controller.update({ ...read.spec }, { label: "Import Office chart" }));
1791
1884
  return { spec: controller.toJSON(), issues: read.issues.map((i) => i.message), unsupported: read.unsupported, lossless: read.lossless };
@@ -1795,7 +1888,7 @@ function createChartToolProvider(controller, options = {}) {
1795
1888
  name: "add_chart_trendline",
1796
1889
  title: "Add a trendline",
1797
1890
  description: "Fits a trendline to a series and draws it (unstacked bar, line, area, scatter and bubble charts). Returns its index and the fit: coefficients, R\xB2 and equation.",
1798
- inputSchema: { type: "object", properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, ..._chunkNZD2MZJCcjs.TRENDLINE_PROPS }, required: ["series", "type"], additionalProperties: false },
1891
+ inputSchema: { type: "object", properties: { series: _chunkTVQW26AVcjs.SERIES_REF, ..._chunkTVQW26AVcjs.TRENDLINE_PROPS }, required: ["series", "type"], additionalProperties: false },
1799
1892
  annotations: { title: "Add a trendline", ...WRITE },
1800
1893
  handler: ({ series, ...line }) => {
1801
1894
  const s = seriesById(series);
@@ -1809,7 +1902,7 @@ function createChartToolProvider(controller, options = {}) {
1809
1902
  description: "Deletes a trendline from a series. Returns the series' remaining trendlines.",
1810
1903
  inputSchema: {
1811
1904
  type: "object",
1812
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1905
+ properties: { series: _chunkTVQW26AVcjs.SERIES_REF, index: { type: "integer", minimum: 0, description: "Trendline index on the series (0 = first)." } },
1813
1906
  required: ["series", "index"],
1814
1907
  additionalProperties: false
1815
1908
  },
@@ -1828,7 +1921,7 @@ function createChartToolProvider(controller, options = {}) {
1828
1921
  name: `add_chart_reference_${what}`,
1829
1922
  title: `Add a reference ${what}`,
1830
1923
  description: what === "line" ? "Draws a dashed line across the plot at one value: a target, a floor, an average (bar, line, area, scatter and bubble charts). The axis grows to keep it in view. Returns its index and the reference lines." : "Shades a band across the plot between two values: a target or normal range (bar, line, area, scatter and bubble charts), drawn under the data. The axis grows to keep it in view. Returns its index and the reference bands.",
1831
- inputSchema: { type: "object", properties: what === "line" ? _chunkNZD2MZJCcjs.REFERENCE_LINE_PROPS : _chunkNZD2MZJCcjs.REFERENCE_BAND_PROPS, required: what === "line" ? ["value"] : ["from", "to"], additionalProperties: false },
1924
+ inputSchema: { type: "object", properties: what === "line" ? _chunkTVQW26AVcjs.REFERENCE_LINE_PROPS : _chunkTVQW26AVcjs.REFERENCE_BAND_PROPS, required: what === "line" ? ["value"] : ["from", "to"], additionalProperties: false },
1832
1925
  annotations: { title: `Add a reference ${what}`, ...WRITE },
1833
1926
  handler: (args) => {
1834
1927
  const result = resolve(what === "line" ? controller.addReferenceLine(args) : controller.addReferenceBand(args));
@@ -1839,7 +1932,7 @@ function createChartToolProvider(controller, options = {}) {
1839
1932
  name: `update_chart_reference_${what}`,
1840
1933
  title: `Change a reference ${what}`,
1841
1934
  description: `Changes a reference ${what} by index (all-or-nothing); label, axis and color take null to remove them. Returns the ${what} as stored.`,
1842
- inputSchema: { type: "object", properties: { index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, Kind), ...what === "line" ? _chunkNZD2MZJCcjs.REFERENCE_LINE_PATCH : _chunkNZD2MZJCcjs.REFERENCE_BAND_PATCH }, required: ["index"], additionalProperties: false },
1935
+ inputSchema: { type: "object", properties: { index: _chunkTVQW26AVcjs.REFERENCE_INDEX.call(void 0, Kind), ...what === "line" ? _chunkTVQW26AVcjs.REFERENCE_LINE_PATCH : _chunkTVQW26AVcjs.REFERENCE_BAND_PATCH }, required: ["index"], additionalProperties: false },
1843
1936
  annotations: { title: `Change a reference ${what}`, ...WRITE_IDEMPOTENT },
1844
1937
  handler: ({ index, ...patch }) => {
1845
1938
  if (!Object.keys(patch).length) fail2(`Nothing to change: pass at least one field besides index, e.g. {"index": ${index}, "label": "Target"}.`);
@@ -1851,7 +1944,7 @@ function createChartToolProvider(controller, options = {}) {
1851
1944
  name: `remove_chart_reference_${what}`,
1852
1945
  title: `Delete a reference ${what}`,
1853
1946
  description: `Deletes a reference ${what} by index; the ones after it move up one. Returns the reference ${what}s left.`,
1854
- inputSchema: { type: "object", properties: { index: _chunkNZD2MZJCcjs.REFERENCE_INDEX.call(void 0, Kind) }, required: ["index"], additionalProperties: false },
1947
+ inputSchema: { type: "object", properties: { index: _chunkTVQW26AVcjs.REFERENCE_INDEX.call(void 0, Kind) }, required: ["index"], additionalProperties: false },
1855
1948
  annotations: { title: `Delete a reference ${what}`, ...DESTRUCTIVE },
1856
1949
  handler: ({ index }) => {
1857
1950
  resolve(what === "line" ? controller.removeReferenceLine(index) : controller.removeReferenceBand(index));
@@ -1868,7 +1961,7 @@ function createChartToolProvider(controller, options = {}) {
1868
1961
  description: 'Pins a short label to one bar or point, with a leader line, to say why it matters ("Record quarter", "Launch"); label null or "" removes it. Bar, line, area, scatter and bubble charts; the point must have a value. Selects the point and returns the series id, category index and label.',
1869
1962
  inputSchema: {
1870
1963
  type: "object",
1871
- properties: { series: _chunkNZD2MZJCcjs.SERIES_REF, category: _chunkNZD2MZJCcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (keep it to a few words), or null to remove it." } },
1964
+ properties: { series: _chunkTVQW26AVcjs.SERIES_REF, category: _chunkTVQW26AVcjs.CATEGORY_REF, label: { type: ["string", "null"], description: "The label (keep it to a few words), or null to remove it." } },
1872
1965
  required: ["series", "category", "label"],
1873
1966
  additionalProperties: false
1874
1967
  },
@@ -1901,7 +1994,7 @@ function createChartToolProvider(controller, options = {}) {
1901
1994
  name: "set_chart_tree",
1902
1995
  title: "Replace grouped data",
1903
1996
  description: `Replaces the chart's data with groups of items (a tree) for treemaps and sunbursts, as one undo step: items {"name", "value"} and groups {"name", "children"}, up to 6 levels, names unique among siblings. The top-level groups become the categories and their totals the first series, so other chart types draw the totals. [] goes back to plain data (the totals stay as values). Returns the tree, each group's total and the depth.`,
1904
- inputSchema: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkNZD2MZJCcjs.TREE_DEFS },
1997
+ inputSchema: { type: "object", properties: { tree: { type: "array", items: { $ref: "#/$defs/chartTreeNode" }, description: "The top-level nodes; [] removes the grouping." } }, required: ["tree"], additionalProperties: false, $defs: _chunkTVQW26AVcjs.TREE_DEFS },
1905
1998
  annotations: { title: "Replace grouped data", ...WRITE_IDEMPOTENT },
1906
1999
  handler: ({ tree }) => {
1907
2000
  resolve(controller.setTree(tree));
@@ -1940,13 +2033,13 @@ function createChartToolProvider(controller, options = {}) {
1940
2033
  },
1941
2034
  required: ["node"],
1942
2035
  additionalProperties: false,
1943
- $defs: _chunkNZD2MZJCcjs.TREE_DEFS
2036
+ $defs: _chunkTVQW26AVcjs.TREE_DEFS
1944
2037
  },
1945
2038
  annotations: { title: "Add an item or group", ...WRITE },
1946
2039
  handler: ({ parent = [], node, at }) => {
1947
2040
  const result = resolve(controller.addTreeNode(parent, node, { at }));
1948
- const group = parent.length ? _chunkR3P2M7HUcjs.findChartTreeNode.call(void 0, spec().tree, parent) : null;
1949
- return { path: result.path, parentTotal: group ? _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, group) : spec().tree.reduce((t, n) => t + _chunkR3P2M7HUcjs.chartTreeTotal.call(void 0, n), 0) };
2041
+ const group = parent.length ? _chunkUVXTOZ2Bcjs.findChartTreeNode.call(void 0, spec().tree, parent) : null;
2042
+ return { path: result.path, parentTotal: group ? _chunkUVXTOZ2Bcjs.chartTreeTotal.call(void 0, group) : spec().tree.reduce((t, n) => t + _chunkUVXTOZ2Bcjs.chartTreeTotal.call(void 0, n), 0) };
1950
2043
  }
1951
2044
  };
1952
2045
  const updateTreeNode = {
@@ -1956,7 +2049,7 @@ function createChartToolProvider(controller, options = {}) {
1956
2049
  inputSchema: {
1957
2050
  type: "object",
1958
2051
  properties: {
1959
- path: _chunkNZD2MZJCcjs.TREE_PATH,
2052
+ path: _chunkTVQW26AVcjs.TREE_PATH,
1960
2053
  name: { type: "string", description: "New name (unique among its siblings)." },
1961
2054
  value: { type: "number", minimum: 0, description: "Items only: the new amount." },
1962
2055
  color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." }
@@ -1968,20 +2061,95 @@ function createChartToolProvider(controller, options = {}) {
1968
2061
  handler: ({ path, ...patch }) => {
1969
2062
  if (!Object.keys(patch).length) fail2("Nothing to change: pass name, value or color with the path.");
1970
2063
  const result = resolve(controller.updateTreeNode(path, patch));
1971
- return { path: result.path, node: _chunkR3P2M7HUcjs.findChartTreeNode.call(void 0, spec().tree, result.path) };
2064
+ return { path: result.path, node: _chunkUVXTOZ2Bcjs.findChartTreeNode.call(void 0, spec().tree, result.path) };
1972
2065
  }
1973
2066
  };
1974
2067
  const removeTreeNode = {
1975
2068
  name: "remove_chart_tree_node",
1976
2069
  title: "Delete an item or group",
1977
2070
  description: "Deletes a node of the grouped data with everything under it (a group left empty becomes an item with value 0). Returns the group totals left.",
1978
- inputSchema: { type: "object", properties: { path: _chunkNZD2MZJCcjs.TREE_PATH }, required: ["path"], additionalProperties: false },
2071
+ inputSchema: { type: "object", properties: { path: _chunkTVQW26AVcjs.TREE_PATH }, required: ["path"], additionalProperties: false },
1979
2072
  annotations: { title: "Delete an item or group", ...DESTRUCTIVE },
1980
2073
  handler: ({ path }) => {
1981
2074
  resolve(controller.removeTreeNode(path));
1982
2075
  return { groups: treeSummary().groups };
1983
2076
  }
1984
2077
  };
2078
+ const setLinks = {
2079
+ name: "set_chart_links",
2080
+ title: "Replace the flows",
2081
+ description: `Replaces the chart's data with flows between named nodes for a Sankey diagram, as one undo step: each {"source", "target", "value"} with a value above 0. Flows only go forwards (no loops) and a source-target pair appears once. The nodes become the categories and how much passes through each the first series. nodes (optional) sets the stacking order. [] goes back to plain data. Returns the flows and each node's throughput.`,
2082
+ inputSchema: {
2083
+ type: "object",
2084
+ properties: {
2085
+ links: { type: "array", items: { type: "object", properties: _chunkTVQW26AVcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false }, description: "All the flows; [] removes them." },
2086
+ nodes: { type: "array", items: { type: "string" }, description: "Node names in stacking order (default: as the flows first name them)." }
2087
+ },
2088
+ required: ["links"],
2089
+ additionalProperties: false
2090
+ },
2091
+ annotations: { title: "Replace the flows", ...WRITE_IDEMPOTENT },
2092
+ handler: ({ links, nodes }) => {
2093
+ resolve(controller.setLinks(links, { nodes }));
2094
+ return linksSummary();
2095
+ }
2096
+ };
2097
+ const importLinksCsv = {
2098
+ name: "import_chart_links_csv",
2099
+ title: "Import flows from CSV",
2100
+ description: "Replaces the data with flows from CSV or TSV rows of source, target and value (as Mermaid sankey-beta and spreadsheets write them). One undo step. Returns the flows and each node's throughput.",
2101
+ inputSchema: {
2102
+ type: "object",
2103
+ properties: {
2104
+ csv: { type: "string", description: 'CSV or TSV text, e.g. "Website,Signup,120\\nSignup,Paid,30".' },
2105
+ header: { type: ["boolean", "string"], enum: [true, false, "auto"], description: "The first row holds column names (default auto: when its third cell is not a number)." }
2106
+ },
2107
+ required: ["csv"],
2108
+ additionalProperties: false
2109
+ },
2110
+ annotations: { title: "Import flows from CSV", ...WRITE },
2111
+ handler: ({ csv, header }) => {
2112
+ resolve(controller.importLinksTable(_chunkN3KJFGXTcjs.parseCsv.call(void 0, csv, { delimiter: csv.includes(" ") ? " " : "," }), { header }));
2113
+ return linksSummary();
2114
+ }
2115
+ };
2116
+ const addLink = {
2117
+ name: "add_chart_link",
2118
+ title: "Add a flow",
2119
+ description: "Adds a flow from one node to another (new names add nodes). Refused when the pair exists already or it would close a loop. Returns its index and the throughput of its two nodes.",
2120
+ inputSchema: { type: "object", properties: _chunkTVQW26AVcjs.LINK_PROPS, required: ["source", "target", "value"], additionalProperties: false },
2121
+ annotations: { title: "Add a flow", ...WRITE },
2122
+ handler: (args) => {
2123
+ const result = resolve(controller.addLink(args));
2124
+ const s = spec();
2125
+ const through = (n) => _nullishCoalesce(_optionalChain([s, 'access', _105 => _105.series, 'access', _106 => _106[0], 'optionalAccess', _107 => _107.values, 'access', _108 => _108[s.sankeyNodes.indexOf(n)]]), () => ( 0));
2126
+ const link = s.links[result.index];
2127
+ return { index: result.index, link, nodes: [link.source, link.target].map((name) => ({ name, value: through(name) })) };
2128
+ }
2129
+ };
2130
+ const updateLink = {
2131
+ name: "update_chart_link",
2132
+ title: "Change a flow",
2133
+ description: "Changes a flow by index: its source, target, value or colour (null goes back to the default). Checked like a new flow. Returns the flow as stored.",
2134
+ inputSchema: { type: "object", properties: { index: _chunkTVQW26AVcjs.LINK_INDEX, ..._chunkTVQW26AVcjs.LINK_PROPS, color: { type: ["string", "null"], description: "CSS colour, or null for the default." } }, required: ["index"], additionalProperties: false },
2135
+ annotations: { title: "Change a flow", ...WRITE_IDEMPOTENT },
2136
+ handler: ({ index, ...patch }) => {
2137
+ if (!Object.keys(patch).length) fail2(`Nothing to change: pass source, target, value or color with the index, e.g. {"index": ${index}, "value": 40}.`);
2138
+ resolve(controller.updateLink(index, patch));
2139
+ return { index, link: spec().links[index] };
2140
+ }
2141
+ };
2142
+ const removeLink = {
2143
+ name: "remove_chart_link",
2144
+ title: "Delete a flow",
2145
+ description: "Deletes a flow by index; the ones after it move up one, and nodes no flow uses any more go. Returns the flows left.",
2146
+ inputSchema: { type: "object", properties: { index: _chunkTVQW26AVcjs.LINK_INDEX }, required: ["index"], additionalProperties: false },
2147
+ annotations: { title: "Delete a flow", ...DESTRUCTIVE },
2148
+ handler: ({ index }) => {
2149
+ resolve(controller.removeLink(index));
2150
+ return { links: spec().links };
2151
+ }
2152
+ };
1985
2153
  const applyPreset = {
1986
2154
  name: "apply_chart_preset",
1987
2155
  title: "Apply a chart style",
@@ -1989,8 +2157,8 @@ function createChartToolProvider(controller, options = {}) {
1989
2157
  inputSchema: {
1990
2158
  type: "object",
1991
2159
  properties: {
1992
- layout: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
1993
- colors: { type: "string", enum: _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
2160
+ layout: { type: "string", enum: _chunkIMRXC7OAcjs.CHART_LAYOUT_PRESETS.map((p) => p.id), description: "Quick layout id." },
2161
+ colors: { type: "string", enum: _chunkIMRXC7OAcjs.CHART_COLOR_SCHEMES.map((p) => p.id), description: "Colour scheme id." }
1994
2162
  },
1995
2163
  additionalProperties: false
1996
2164
  },
@@ -2019,8 +2187,8 @@ function createChartToolProvider(controller, options = {}) {
2019
2187
  type: "object",
2020
2188
  properties: {
2021
2189
  kind: { type: "string", enum: ["none", "chart", "title", "subtitle", "legend", "axis", "series", "point", "category", "trendline"], description: "What to select." },
2022
- series: { ..._chunkNZD2MZJCcjs.SERIES_REF, description: "Series id or name (series, point, trendline)." },
2023
- category: { ..._chunkNZD2MZJCcjs.CATEGORY_REF, description: "Category index or label (point, category)." },
2190
+ series: { ..._chunkTVQW26AVcjs.SERIES_REF, description: "Series id or name (series, point, trendline)." },
2191
+ category: { ..._chunkTVQW26AVcjs.CATEGORY_REF, description: "Category index or label (point, category)." },
2024
2192
  axis: { type: "string", enum: ["x", "y", "y2"], description: "Axis (axis)." },
2025
2193
  index: { type: "integer", minimum: 0, description: "Trendline index (trendline)." }
2026
2194
  },
@@ -2078,20 +2246,20 @@ function createChartToolProvider(controller, options = {}) {
2078
2246
  to: { type: "object", description: "End, as fractions of the chart.", properties: { x: { type: "number", minimum: 0, maximum: 1, description: "Fraction of the width." }, y: { type: "number", minimum: 0, maximum: 1, description: "Fraction of the height." } }, required: ["x", "y"], additionalProperties: false },
2079
2247
  fine: { type: "boolean", description: "Move a tenth as far (Alt)." },
2080
2248
  lockAxis: { type: "boolean", description: "Scatter charts: change only the axis moved along most (Shift)." },
2081
- width: _chunkNZD2MZJCcjs.WIDTH,
2082
- height: _chunkNZD2MZJCcjs.HEIGHT
2249
+ width: _chunkTVQW26AVcjs.WIDTH,
2250
+ height: _chunkTVQW26AVcjs.HEIGHT
2083
2251
  },
2084
2252
  required: ["from", "to"],
2085
2253
  additionalProperties: false
2086
2254
  },
2087
2255
  annotations: { title: "Drag a chart point", ...WRITE },
2088
2256
  handler: ({ from, to, fine, lockAxis, width = size.width, height = size.height }) => {
2089
- const scene = _chunkSBQVEBSUcjs.layoutChart.call(void 0, controller.toJSON(), { width, height });
2257
+ const scene = _chunkQO2T6KA5cjs.layoutChart.call(void 0, controller.toJSON(), { width, height });
2090
2258
  const start = { x: from.x * width, y: from.y * height };
2091
2259
  const target = chartHitTest(scene, start);
2092
- if (_optionalChain([target, 'optionalAccess', _105 => _105.kind]) !== "point") fail2(`There is no bar or point at (${from.x}, ${from.y}); ${target ? `that is the ${target.kind}` : "that is outside the chart"}. Use render_chart to find marks.`);
2260
+ if (_optionalChain([target, 'optionalAccess', _109 => _109.kind]) !== "point") fail2(`There is no bar or point at (${from.x}, ${from.y}); ${target ? `that is the ${target.kind}` : "that is outside the chart"}. Use render_chart to find marks.`);
2093
2261
  const t = target;
2094
- const before = _nullishCoalesce(_optionalChain([controller, 'access', _106 => _106.getSeries, 'call', _107 => _107(t.seriesId), 'optionalAccess', _108 => _108.values, 'access', _109 => _109[t.index]]), () => ( null));
2262
+ const before = _nullishCoalesce(_optionalChain([controller, 'access', _110 => _110.getSeries, 'call', _111 => _111(t.seriesId), 'optionalAccess', _112 => _112.values, 'access', _113 => _113[t.index]]), () => ( null));
2095
2263
  const session = startChartPointDrag(controller, scene, t, start);
2096
2264
  if (!session) fail2("That point cannot be dragged here (percent-stacked charts, pies and gaps cannot be dragged).");
2097
2265
  session.move({ x: to.x * width, y: to.y * height }, { fine, lockAxis });
@@ -2116,10 +2284,10 @@ function createChartToolProvider(controller, options = {}) {
2116
2284
  },
2117
2285
  annotations: { title: "Press a key on the chart", ...DESTRUCTIVE },
2118
2286
  handler: ({ key: k, shift, alt }) => {
2119
- const scene = _chunkSBQVEBSUcjs.layoutChart.call(void 0, controller.toJSON(), size);
2287
+ const scene = _chunkQO2T6KA5cjs.layoutChart.call(void 0, controller.toJSON(), size);
2120
2288
  const used = handleChartKey(controller, scene, { key: k, shiftKey: shift, altKey: alt });
2121
2289
  const sel = controller.getState().selection;
2122
- const value = _optionalChain([sel, 'optionalAccess', _110 => _110.kind]) === "point" ? _nullishCoalesce(_optionalChain([controller, 'access', _111 => _111.getSeries, 'call', _112 => _112(sel.seriesId), 'optionalAccess', _113 => _113.values, 'access', _114 => _114[sel.index]]), () => ( null)) : void 0;
2290
+ const value = _optionalChain([sel, 'optionalAccess', _114 => _114.kind]) === "point" ? _nullishCoalesce(_optionalChain([controller, 'access', _115 => _115.getSeries, 'call', _116 => _116(sel.seriesId), 'optionalAccess', _117 => _117.values, 'access', _118 => _118[sel.index]]), () => ( null)) : void 0;
2123
2291
  return { used, selection: sel, ...value !== void 0 ? { value } : {} };
2124
2292
  }
2125
2293
  };
@@ -2174,6 +2342,11 @@ function createChartToolProvider(controller, options = {}) {
2174
2342
  addTreeNode,
2175
2343
  updateTreeNode,
2176
2344
  removeTreeNode,
2345
+ setLinks,
2346
+ importLinksCsv,
2347
+ addLink,
2348
+ updateLink,
2349
+ removeLink,
2177
2350
  applyPreset,
2178
2351
  transpose,
2179
2352
  select,
@@ -2186,7 +2359,7 @@ function createChartToolProvider(controller, options = {}) {
2186
2359
  id: _nullishCoalesce(options.id, () => ( "chart")),
2187
2360
  namespace: options.namespace,
2188
2361
  title: "Chart editor",
2189
- description: "One chart: its spec, data and values, series and categories, trendlines, reference lines and bands, callouts, highlight, grouped data and presets, CSV, Mermaid and OOXML import, rendering and colour checks.",
2362
+ description: "One chart: its spec, data and values, series and categories, trendlines, reference lines and bands, callouts, highlight, grouped data, flows and presets, CSV, Mermaid and OOXML import, rendering and colour checks.",
2190
2363
  skill: "pixerate-chart",
2191
2364
  tools: () => {
2192
2365
  if (readOnlyReason()) return reads;
@@ -2260,12 +2433,12 @@ var ChartStream = (_class = class {
2260
2433
  if (format === "json") {
2261
2434
  const value = complete ? safeParse(text) : parsePartialChartJson(text);
2262
2435
  if (value !== void 0) {
2263
- const read = _chunkR3P2M7HUcjs.normalizeChartSpec.call(void 0, value);
2436
+ const read = _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, value);
2264
2437
  spec = read.spec;
2265
2438
  issues = complete ? read.issues : [];
2266
2439
  }
2267
2440
  } else {
2268
- const read = _chunkGKNEJ6ENcjs.chartFromMermaid.call(void 0, text, { partial: !complete });
2441
+ const read = _chunkIMRXC7OAcjs.chartFromMermaid.call(void 0, text, { partial: !complete });
2269
2442
  if (read.family) {
2270
2443
  spec = read.spec;
2271
2444
  issues = complete ? read.issues : [];
@@ -2362,7 +2535,7 @@ function elements(root, localName) {
2362
2535
  }
2363
2536
  function relId(el, localName = "id") {
2364
2537
  for (const a of Array.from(el.attributes)) {
2365
- if (a.localName === localName && (_optionalChain([a, 'access', _115 => _115.namespaceURI, 'optionalAccess', _116 => _116.includes, 'call', _117 => _117("relationships")]) || a.prefix === "r")) return a.value;
2538
+ if (a.localName === localName && (_optionalChain([a, 'access', _119 => _119.namespaceURI, 'optionalAccess', _120 => _120.includes, 'call', _121 => _121("relationships")]) || a.prefix === "r")) return a.value;
2366
2539
  }
2367
2540
  return void 0;
2368
2541
  }
@@ -2381,17 +2554,17 @@ async function readRels(r, partPath) {
2381
2554
  const id = rel.getAttribute("Id");
2382
2555
  if (!id) continue;
2383
2556
  const target = _nullishCoalesce(rel.getAttribute("Target"), () => ( ""));
2384
- const external = _optionalChain([rel, 'access', _118 => _118.getAttribute, 'call', _119 => _119("TargetMode"), 'optionalAccess', _120 => _120.toLowerCase, 'call', _121 => _121()]) === "external";
2557
+ const external = _optionalChain([rel, 'access', _122 => _122.getAttribute, 'call', _123 => _123("TargetMode"), 'optionalAccess', _124 => _124.toLowerCase, 'call', _125 => _125()]) === "external";
2385
2558
  rels.set(id, { type: _nullishCoalesce(rel.getAttribute("Type"), () => ( "")), target: external ? target : resolvePartPath(dirname(partPath), target), external });
2386
2559
  }
2387
2560
  return rels;
2388
2561
  }
2389
- var isChartRef = (el) => el.localName === "chart" && (el.namespaceURI === _chunkYGG7WDWTcjs.CHART_OOXML_NS || el.namespaceURI === STRICT_CHART_NS || el.namespaceURI === CHARTEX_NS);
2562
+ var isChartRef = (el) => el.localName === "chart" && (el.namespaceURI === _chunkQ25WAFTDcjs.CHART_OOXML_NS || el.namespaceURI === STRICT_CHART_NS || el.namespaceURI === CHARTEX_NS);
2390
2563
  function frameName(ref) {
2391
2564
  for (let el = ref.parentElement; el; el = el.parentElement) {
2392
2565
  if (el.localName === "graphicFrame") {
2393
2566
  const nv = elements(el, "cNvPr")[0];
2394
- return _optionalChain([nv, 'optionalAccess', _122 => _122.getAttribute, 'call', _123 => _123("name")]) || void 0;
2567
+ return _optionalChain([nv, 'optionalAccess', _126 => _126.getAttribute, 'call', _127 => _127("name")]) || void 0;
2395
2568
  }
2396
2569
  }
2397
2570
  return void 0;
@@ -2405,7 +2578,7 @@ async function chartsInPart(r, root, rels, place) {
2405
2578
  const entry = r.zip.get(rel.target);
2406
2579
  if (!entry) continue;
2407
2580
  r.seen.add(rel.target);
2408
- const read = _chunkYGG7WDWTcjs.chartFromOoxml.call(void 0, await r.zip.readText(entry), { DOMParser: r.Parser });
2581
+ const read = _chunkQ25WAFTDcjs.chartFromOoxml.call(void 0, await r.zip.readText(entry), { DOMParser: r.Parser });
2409
2582
  const name = frameName(ref);
2410
2583
  r.charts.push({
2411
2584
  id: `chart-${r.charts.length + 1}`,
@@ -2427,8 +2600,8 @@ function columnName(index) {
2427
2600
  return name;
2428
2601
  }
2429
2602
  function anchorCell(marker) {
2430
- const col = Number(_optionalChain([firstChild, 'call', _124 => _124(marker, "col"), 'optionalAccess', _125 => _125.textContent]));
2431
- const row = Number(_optionalChain([firstChild, 'call', _126 => _126(marker, "row"), 'optionalAccess', _127 => _127.textContent]));
2603
+ const col = Number(_optionalChain([firstChild, 'call', _128 => _128(marker, "col"), 'optionalAccess', _129 => _129.textContent]));
2604
+ const row = Number(_optionalChain([firstChild, 'call', _130 => _130(marker, "row"), 'optionalAccess', _131 => _131.textContent]));
2432
2605
  return Number.isInteger(col) && Number.isInteger(row) && col >= 0 && row >= 0 ? `${columnName(col)}${row + 1}` : void 0;
2433
2606
  }
2434
2607
  function drawingPlace(ref) {
@@ -2591,7 +2764,7 @@ function createOfficeChartToolProvider(options = {}) {
2591
2764
  description: "Lists the Office files the user opened that charts can be read from. Returns their names and sizes in bytes.",
2592
2765
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
2593
2766
  annotations: { title: "List open files", ...READ2 },
2594
- handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _128 => _128.files, 'optionalCall', _129 => _129()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
2767
+ handler: () => ({ files: (_nullishCoalesce(_optionalChain([options, 'access', _132 => _132.files, 'optionalCall', _133 => _133()]), () => ( []))).map((f) => ({ name: f.name, bytes: f.data.byteLength })) })
2595
2768
  };
2596
2769
  const listCharts = {
2597
2770
  name: "list_file_charts",
@@ -2642,7 +2815,7 @@ function createOfficeChartToolProvider(options = {}) {
2642
2815
 
2643
2816
  // src/chart/editorDocument.ts
2644
2817
  function createChartEditorDocument(controller) {
2645
- return _chunkM4MIZPQIcjs.defineEditorDocument.call(void 0, {
2818
+ return _chunkSJ2CPTQCcjs.defineEditorDocument.call(void 0, {
2646
2819
  kind: "chart",
2647
2820
  get: () => controller.toJSON(),
2648
2821
  load: (document, { history }) => {
@@ -2670,6 +2843,205 @@ function createChartEditorDocument(controller) {
2670
2843
  });
2671
2844
  }
2672
2845
 
2846
+ // src/chart/style.ts
2847
+ var CHART_TYPES3 = ["bar", "line", "area", "scatter", "bubble", "pie", "donut", "radar", "waterfall", "histogram", "box", "funnel", "treemap"];
2848
+ var COLOR = { type: "string", minLength: 1, description: 'A CSS colour (hex or rgb()), or a { "$token": ... } reference.' };
2849
+ function chartColors(spec) {
2850
+ const out = [];
2851
+ const visible = spec.series.map((s, i) => ({ s, i })).filter(({ s }) => !s.hidden);
2852
+ if (_chunkUVXTOZ2Bcjs.chartColorsByCategory.call(void 0, spec.type)) {
2853
+ const first = visible[0];
2854
+ spec.categories.forEach((name, index) => {
2855
+ const color = _optionalChain([first, 'optionalAccess', _134 => _134.s, 'access', _135 => _135.pointColors, 'optionalAccess', _136 => _136[index]]) || _chunkUVXTOZ2Bcjs.chartSliceColor.call(void 0, spec, index);
2856
+ out.push({ color, label: `Slice "${name}"`, target: first ? { kind: "point", seriesId: first.s.id, index } : { kind: "category", index } });
2857
+ });
2858
+ return out;
2859
+ }
2860
+ for (const { s, i } of visible) {
2861
+ out.push({ color: _chunkUVXTOZ2Bcjs.chartSeriesColor.call(void 0, spec, i), label: `Series "${s.name}"`, target: { kind: "series", seriesId: s.id } });
2862
+ _optionalChain([s, 'access', _137 => _137.pointColors, 'optionalAccess', _138 => _138.forEach, 'call', _139 => _139((c, index) => {
2863
+ if (c) out.push({ color: c, label: `Point ${index + 1} of "${s.name}"`, target: { kind: "point", seriesId: s.id, index } });
2864
+ })]);
2865
+ }
2866
+ return out;
2867
+ }
2868
+ var paletteOf = (profile) => {
2869
+ const palette = profile.palette;
2870
+ if (!_optionalChain([palette, 'optionalAccess', _140 => _140.length])) throw new Error("the profile has no palette.");
2871
+ return palette;
2872
+ };
2873
+ var paletteOnly = {
2874
+ id: "palette-only",
2875
+ description: "Every series, slice and point colour comes from the house palette (or a lighter or darker shade the chart cycles to once the palette runs out).",
2876
+ optionsSchema: {
2877
+ type: "object",
2878
+ properties: { tolerance: { type: "number", minimum: 0, maximum: 1, description: "Largest OKLab distance still counted as the same colour (default 0.02)." } },
2879
+ additionalProperties: false
2880
+ },
2881
+ run(spec, profile, { tolerance = 0.02 }) {
2882
+ const palette = paletteOf(profile);
2883
+ const allowed = palette.flatMap((c) => _chunkUVXTOZ2Bcjs.CHART_PALETTE_SHADES.map((t) => _chunkUVXTOZ2Bcjs.shadeChartColor.call(void 0, c, t))).map((c) => ({ c, rgb: _chunkUVXTOZ2Bcjs.parseChartColor.call(void 0, c) }));
2884
+ return chartColors(spec).flatMap(({ color, label, target }) => {
2885
+ const rgb = _chunkUVXTOZ2Bcjs.parseChartColor.call(void 0, color);
2886
+ if (!rgb) return [];
2887
+ let best = { c: palette[0], d: Infinity };
2888
+ for (const a of allowed) {
2889
+ if (!a.rgb) continue;
2890
+ const d = _chunkUVXTOZ2Bcjs.chartColorDistance.call(void 0, rgb, a.rgb);
2891
+ if (d < best.d) best = { c: a.c, d };
2892
+ }
2893
+ if (best.d <= tolerance) return [];
2894
+ const nearest = palette.map((c) => ({ c, d: _chunkUVXTOZ2Bcjs.parseChartColor.call(void 0, c) ? _chunkUVXTOZ2Bcjs.chartColorDistance.call(void 0, rgb, _chunkUVXTOZ2Bcjs.parseChartColor.call(void 0, c)) : Infinity })).sort((a, b) => a.d - b.d)[0].c;
2895
+ return [{ severity: "error", message: `${label} uses ${color}, which is not in the house palette; use ${nearest} or another palette colour (${palette.join(", ")}).`, target }];
2896
+ });
2897
+ }
2898
+ };
2899
+ var distinguishable = {
2900
+ id: "distinguishable",
2901
+ description: "Series (or slice) colours can be told apart with normal vision and with protanopia, deuteranopia and tritanopia.",
2902
+ optionsSchema: {
2903
+ type: "object",
2904
+ properties: { minDistance: { type: "number", minimum: 0, maximum: 1, description: "Smallest OKLab distance between two colours after simulation (default 0.08)." } },
2905
+ additionalProperties: false
2906
+ },
2907
+ run(spec, _profile, { minDistance = 0.08 }) {
2908
+ const colors = chartColors(spec).filter((c) => c.target.kind !== "point" || _chunkUVXTOZ2Bcjs.chartColorsByCategory.call(void 0, spec.type));
2909
+ const result = _chunkUVXTOZ2Bcjs.checkChartColors.call(void 0, colors.map((c) => c.color), { minDistance, minContrast: 0 });
2910
+ const findings = [];
2911
+ for (const [vision, pair] of Object.entries(result.closest)) {
2912
+ if (!pair || pair.distance >= minDistance) continue;
2913
+ const who = vision === "normal" ? "" : ` with ${vision}`;
2914
+ findings.push({
2915
+ severity: "warning",
2916
+ message: `${colors[pair.a].label} (${pair.colors[0]}) and ${colors[pair.b].label} (${pair.colors[1]}) are hard to tell apart${who} (distance ${pair.distance}, want ${minDistance}); give the second another palette colour.`,
2917
+ target: colors[pair.b].target
2918
+ });
2919
+ }
2920
+ return findings;
2921
+ }
2922
+ };
2923
+ var minContrast = {
2924
+ id: "min-contrast",
2925
+ description: "Marks stand out from the background: each series or slice colour against the profile theme's background (or surface, default white).",
2926
+ optionsSchema: {
2927
+ type: "object",
2928
+ properties: { ratio: { type: "number", minimum: 1, maximum: 21, description: "Smallest contrast ratio (default 3, the WCAG ratio for graphics)." } },
2929
+ additionalProperties: false
2930
+ },
2931
+ run(spec, profile, { ratio = 3 }) {
2932
+ const theme = _nullishCoalesce(profile.theme, () => ( {}));
2933
+ const background = theme.background && theme.background !== "transparent" ? theme.background : _nullishCoalesce(theme.surface, () => ( "#ffffff"));
2934
+ return chartColors(spec).flatMap(({ color, label, target }) => {
2935
+ const r = _chunkUVXTOZ2Bcjs.chartContrastRatio.call(void 0, color, background);
2936
+ if (r === null || r >= ratio) return [];
2937
+ return [{ severity: "warning", message: `${label} (${color}) has contrast ${Math.round(r * 100) / 100}:1 against the background ${background}; want at least ${ratio}:1, so use a darker or lighter palette colour.`, target }];
2938
+ });
2939
+ }
2940
+ };
2941
+ var allowedType = {
2942
+ id: "allowed-type",
2943
+ description: "The chart is one of the chart types the house style allows.",
2944
+ optionsSchema: {
2945
+ type: "object",
2946
+ properties: { types: { type: "array", items: { type: "string", enum: [...CHART_TYPES3] }, minItems: 1, description: "Allowed chart types." } },
2947
+ required: ["types"],
2948
+ additionalProperties: false
2949
+ },
2950
+ run(spec, _profile, { types }) {
2951
+ const allowed = types;
2952
+ if (allowed.includes(spec.type)) return [];
2953
+ return [{ severity: "error", message: `This is a ${spec.type} chart; the house style allows ${allowed.join(", ")}. Change the type with update_chart.`, target: { kind: "chart" } }];
2954
+ }
2955
+ };
2956
+ var chartStyleDomain = {
2957
+ id: "chart",
2958
+ title: "Charts",
2959
+ description: "The house palette and theme for charts, which colour schemes and layouts are allowed, defaults for new charts, and the checks to run.",
2960
+ profileSchema: {
2961
+ type: "object",
2962
+ properties: {
2963
+ palette: { type: "array", items: COLOR, minItems: 1, description: "Series colours in order." },
2964
+ colorSchemes: { type: "array", items: { type: "string", enum: _chunkIMRXC7OAcjs.CHART_COLOR_SCHEMES.map((s) => s.id) }, description: "Colour scheme ids allowed besides the palette (empty: none)." },
2965
+ layouts: { type: "array", items: { type: "string", enum: _chunkIMRXC7OAcjs.CHART_LAYOUT_PRESETS.map((p) => p.id) }, description: "Layout preset ids allowed." },
2966
+ theme: {
2967
+ type: "object",
2968
+ properties: {
2969
+ background: COLOR,
2970
+ surface: COLOR,
2971
+ text: COLOR,
2972
+ mutedText: COLOR,
2973
+ grid: COLOR,
2974
+ axis: COLOR,
2975
+ positive: COLOR,
2976
+ negative: COLOR,
2977
+ fontFamily: { type: "string", minLength: 1, description: "CSS font family." },
2978
+ fontSize: { type: "number", minimum: 6, maximum: 48, description: "Body text size in px." },
2979
+ titleSize: { type: "number", minimum: 6, maximum: 72, description: "Title size in px." }
2980
+ },
2981
+ additionalProperties: false,
2982
+ description: "Colours and type to draw charts with."
2983
+ },
2984
+ defaults: {
2985
+ type: "object",
2986
+ properties: {
2987
+ dataLabels: { type: "boolean", description: "Value labels on." },
2988
+ points: { type: "boolean", description: "Dots on lines." },
2989
+ curve: { type: "string", enum: ["linear", "smooth", "step"], description: "Line interpolation." },
2990
+ stacking: { type: "string", enum: ["none", "stacked", "percent"], description: "Stacking." },
2991
+ orientation: { type: "string", enum: ["vertical", "horizontal"], description: "Bar direction." },
2992
+ labelPosition: { type: "string", enum: ["auto", "inside", "outside", "center"], description: "Bar label position." }
2993
+ },
2994
+ additionalProperties: false,
2995
+ description: "Spec values new charts start from."
2996
+ }
2997
+ },
2998
+ additionalProperties: false
2999
+ },
3000
+ checks: [paletteOnly, distinguishable, minContrast, allowedType]
3001
+ };
3002
+ function chartStylePatch(profile) {
3003
+ const p = profile;
3004
+ return { ..._nullishCoalesce(p.defaults, () => ( {})), ..._optionalChain([p, 'access', _141 => _141.palette, 'optionalAccess', _142 => _142.length]) ? { palette: [...p.palette] } : {} };
3005
+ }
3006
+ function createChartStyleToolProvider(controller, styles, options = {}) {
3007
+ if (!styles.domains.some((d) => d.id === "chart")) throw new Error('The style resolver has no "chart" domain; add chartStyleDomain to its domains.');
3008
+ const check2 = {
3009
+ name: "check_chart_style",
3010
+ title: "Check chart house style",
3011
+ description: 'Checks the chart against the house style (see get_style with domain "chart"): runs the checks its profile turns on (palette-only, distinguishable, min-contrast, allowed-type). Returns findings with a severity, a sentence saying how to fix it, a target selection (series id or point) for update_chart_series or update_chart, and the layer that asked for it; plus the checks that ran and the ones skipped with the reason. Check after a batch of edits and again after fixing.',
3012
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
3013
+ annotations: { title: "Check chart house style", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
3014
+ handler: async () => {
3015
+ const { style, ...report } = await styles.check("chart", controller.getSpec());
3016
+ return {
3017
+ ...report,
3018
+ ok: report.findings.length === 0,
3019
+ ...style.skills.length ? {} : { note: "No house style applies to charts." },
3020
+ ...style.issues.length ? { issues: style.issues } : {}
3021
+ };
3022
+ }
3023
+ };
3024
+ return {
3025
+ id: _nullishCoalesce(options.id, () => ( "chart-style")),
3026
+ namespace: _nullishCoalesce(options.namespace, () => ( "chart")),
3027
+ title: "Chart house style",
3028
+ description: "Check a chart against the house style.",
3029
+ skill: "pixerate-chart",
3030
+ tools: [check2]
3031
+ };
3032
+ }
3033
+
3034
+
3035
+
3036
+
3037
+
3038
+
3039
+
3040
+
3041
+
3042
+
3043
+
3044
+
2673
3045
 
2674
3046
 
2675
3047
 
@@ -2862,4 +3234,4 @@ function createChartEditorDocument(controller) {
2862
3234
 
2863
3235
 
2864
3236
 
2865
- exports.CHART_AXIS_KINDS = _chunkR3P2M7HUcjs.CHART_AXIS_KINDS; exports.CHART_AXIS_SCALES = _chunkR3P2M7HUcjs.CHART_AXIS_SCALES; exports.CHART_COLOR_SCHEMES = _chunkGKNEJ6ENcjs.CHART_COLOR_SCHEMES; exports.CHART_CURVES = _chunkR3P2M7HUcjs.CHART_CURVES; exports.CHART_DATE_STEPS = _chunkSBQVEBSUcjs.CHART_DATE_STEPS; exports.CHART_ERROR_BAR_DIRECTIONS = _chunkR3P2M7HUcjs.CHART_ERROR_BAR_DIRECTIONS; exports.CHART_ERROR_BAR_LABELS = _chunkR3P2M7HUcjs.CHART_ERROR_BAR_LABELS; exports.CHART_ERROR_BAR_TYPES = _chunkR3P2M7HUcjs.CHART_ERROR_BAR_TYPES; exports.CHART_LABEL_POSITIONS = _chunkR3P2M7HUcjs.CHART_LABEL_POSITIONS; exports.CHART_LAYOUT_PRESETS = _chunkGKNEJ6ENcjs.CHART_LAYOUT_PRESETS; exports.CHART_LEGEND_POSITIONS = _chunkR3P2M7HUcjs.CHART_LEGEND_POSITIONS; exports.CHART_LIKERT_NEUTRALS = _chunkR3P2M7HUcjs.CHART_LIKERT_NEUTRALS; exports.CHART_LIKERT_SORTS = _chunkR3P2M7HUcjs.CHART_LIKERT_SORTS; exports.CHART_MARKERS = _chunkR3P2M7HUcjs.CHART_MARKERS; exports.CHART_MERMAID_META_PREFIX = _chunkGKNEJ6ENcjs.CHART_MERMAID_META_PREFIX; exports.CHART_NUMBER_STYLES = _chunkR3P2M7HUcjs.CHART_NUMBER_STYLES; exports.CHART_OOXML_CONTENT_TYPE = _chunkYGG7WDWTcjs.CHART_OOXML_CONTENT_TYPE; exports.CHART_OOXML_NS = _chunkYGG7WDWTcjs.CHART_OOXML_NS; exports.CHART_OOXML_RELATIONSHIP = _chunkYGG7WDWTcjs.CHART_OOXML_RELATIONSHIP; exports.CHART_ORIENTATIONS = _chunkR3P2M7HUcjs.CHART_ORIENTATIONS; exports.CHART_PALETTE_SHADES = _chunkR3P2M7HUcjs.CHART_PALETTE_SHADES; exports.CHART_PRESENCE_COLORS = CHART_PRESENCE_COLORS; exports.CHART_RADAR_GRATICULES = _chunkR3P2M7HUcjs.CHART_RADAR_GRATICULES; exports.CHART_RASTER_MAX_SIZE = CHART_RASTER_MAX_SIZE; exports.CHART_REFERENCE_AXES = _chunkR3P2M7HUcjs.CHART_REFERENCE_AXES; exports.CHART_SERIES_TYPES = _chunkR3P2M7HUcjs.CHART_SERIES_TYPES; exports.CHART_STACKINGS = _chunkR3P2M7HUcjs.CHART_STACKINGS; exports.CHART_TRENDLINE_TYPES = _chunkR3P2M7HUcjs.CHART_TRENDLINE_TYPES; exports.CHART_TYPES = _chunkR3P2M7HUcjs.CHART_TYPES; exports.CHART_TYPE_LABELS = _chunkR3P2M7HUcjs.CHART_TYPE_LABELS; exports.CSS_VARIABLE_CHART_THEME = _chunkR3P2M7HUcjs.CSS_VARIABLE_CHART_THEME; exports.ChartController = _chunkGKNEJ6ENcjs.ChartController; exports.ChartDirector = ChartDirector; exports.ChartPresence = ChartPresence; exports.ChartStream = ChartStream; exports.DEFAULT_CHART_PALETTE = _chunkR3P2M7HUcjs.DEFAULT_CHART_PALETTE; exports.DEFAULT_CHART_THEME = _chunkR3P2M7HUcjs.DEFAULT_CHART_THEME; exports.MAX_CHART_DATA_LABELS = _chunkSBQVEBSUcjs.MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = _chunkSBQVEBSUcjs.MAX_CHART_LINE_POINTS; exports.MAX_CHART_MARKERS = _chunkSBQVEBSUcjs.MAX_CHART_MARKERS; exports.MAX_CHART_TREE_DEPTH = _chunkR3P2M7HUcjs.MAX_CHART_TREE_DEPTH; exports.MAX_CHART_TREE_NODES = _chunkR3P2M7HUcjs.MAX_CHART_TREE_NODES; exports.OfficeChartsError = OfficeChartsError; exports.RENDER_CHART_INSTRUCTIONS = RENDER_CHART_INSTRUCTIONS; exports.addChartTreeRow = _chunkR3P2M7HUcjs.addChartTreeRow; exports.analyzeChartTable = analyzeChartTable; exports.blendChartScenes = blendChartScenes; exports.canDragChartPoint = canDragChartPoint; exports.chartBoxStats = _chunkSBQVEBSUcjs.chartBoxStats; exports.chartClientToScene = chartClientToScene; exports.chartColorDistance = _chunkR3P2M7HUcjs.chartColorDistance; exports.chartColorInputValue = _chunkR3P2M7HUcjs.chartColorInputValue; exports.chartColorsByCategory = _chunkR3P2M7HUcjs.chartColorsByCategory; exports.chartContrastRatio = _chunkR3P2M7HUcjs.chartContrastRatio; exports.chartDataFromTable = _chunkR3P2M7HUcjs.chartDataFromTable; exports.chartDataToTable = _chunkR3P2M7HUcjs.chartDataToTable; exports.chartDateLabels = _chunkSBQVEBSUcjs.chartDateLabels; exports.chartDateToSerial = _chunkSBQVEBSUcjs.chartDateToSerial; exports.chartErrorAmounts = _chunkR3P2M7HUcjs.chartErrorAmounts; exports.chartErrorBarsOfType = _chunkR3P2M7HUcjs.chartErrorBarsOfType; exports.chartFamily = _chunkR3P2M7HUcjs.chartFamily; exports.chartFileName = chartFileName; exports.chartFormatToCode = _chunkYGG7WDWTcjs.chartFormatToCode; exports.chartFromMermaid = _chunkGKNEJ6ENcjs.chartFromMermaid; exports.chartFromOoxml = _chunkYGG7WDWTcjs.chartFromOoxml; exports.chartFromTable = chartFromTable; exports.chartHistogram = _chunkSBQVEBSUcjs.chartHistogram; exports.chartHitTest = chartHitTest; exports.chartLikertColor = _chunkR3P2M7HUcjs.chartLikertColor; exports.chartLuminance = _chunkR3P2M7HUcjs.chartLuminance; exports.chartMermaidFamily = _chunkGKNEJ6ENcjs.chartMermaidFamily; exports.chartMovingAverage = _chunkSBQVEBSUcjs.chartMovingAverage; exports.chartPointAnchor = chartPointAnchor; exports.chartPointColor = _chunkR3P2M7HUcjs.chartPointColor; exports.chartPointRef = chartPointRef; exports.chartPresetPatch = _chunkGKNEJ6ENcjs.chartPresetPatch; exports.chartQuantile = _chunkSBQVEBSUcjs.chartQuantile; exports.chartRasterSize = chartRasterSize; exports.chartRgbToHex = _chunkR3P2M7HUcjs.chartRgbToHex; exports.chartRgbToOklab = _chunkR3P2M7HUcjs.chartRgbToOklab; exports.chartScaleFromPixel = _chunkSBQVEBSUcjs.chartScaleFromPixel; exports.chartScaleToPixel = _chunkSBQVEBSUcjs.chartScaleToPixel; exports.chartSceneToDomSpec = _chunkGKNEJ6ENcjs.chartSceneToDomSpec; exports.chartSceneToSvg = _chunkGKNEJ6ENcjs.chartSceneToSvg; exports.chartSerialToDate = _chunkSBQVEBSUcjs.chartSerialToDate; exports.chartSeriesColor = _chunkR3P2M7HUcjs.chartSeriesColor; exports.chartSeriesType = _chunkR3P2M7HUcjs.chartSeriesType; exports.chartSliceColor = _chunkR3P2M7HUcjs.chartSliceColor; exports.chartSpecColorsByCategory = _chunkR3P2M7HUcjs.chartSpecColorsByCategory; exports.chartSquarify = _chunkSBQVEBSUcjs.chartSquarify; exports.chartSupportsTrendlines = _chunkSBQVEBSUcjs.chartSupportsTrendlines; exports.chartTextBaseline = _chunkGKNEJ6ENcjs.chartTextBaseline; exports.chartTextOn = _chunkR3P2M7HUcjs.chartTextOn; exports.chartTextTransform = _chunkGKNEJ6ENcjs.chartTextTransform; exports.chartToMermaid = _chunkGKNEJ6ENcjs.chartToMermaid; exports.chartToOoxml = _chunkYGG7WDWTcjs.chartToOoxml; exports.chartToSvg = _chunkGKNEJ6ENcjs.chartToSvg; exports.chartTreeColumnLabels = _chunkR3P2M7HUcjs.chartTreeColumnLabels; exports.chartTreeDepth = _chunkR3P2M7HUcjs.chartTreeDepth; exports.chartTreeFromRows = _chunkR3P2M7HUcjs.chartTreeFromRows; exports.chartTreeFromSeries = _chunkR3P2M7HUcjs.chartTreeFromSeries; exports.chartTreeFromTable = _chunkR3P2M7HUcjs.chartTreeFromTable; exports.chartTreeToRows = _chunkR3P2M7HUcjs.chartTreeToRows; exports.chartTreeTotal = _chunkR3P2M7HUcjs.chartTreeTotal; exports.chartTrendlineName = _chunkSBQVEBSUcjs.chartTrendlineName; exports.chartValueAtPoint = _chunkSBQVEBSUcjs.chartValueAtPoint; exports.chartVariesColors = _chunkR3P2M7HUcjs.chartVariesColors; exports.chartXAtPoint = _chunkSBQVEBSUcjs.chartXAtPoint; exports.checkChartColors = _chunkR3P2M7HUcjs.checkChartColors; exports.cloneChartSeries = _chunkR3P2M7HUcjs.cloneChartSeries; exports.cloneChartSpec = _chunkR3P2M7HUcjs.cloneChartSpec; exports.cloneChartTree = _chunkR3P2M7HUcjs.cloneChartTree; exports.compileChartFormatCode = _chunkSBQVEBSUcjs.compileChartFormatCode; exports.contrastingTextColor = _chunkSBQVEBSUcjs.contrastingTextColor; exports.createChartCommands = createChartCommands; exports.createChartController = _chunkGKNEJ6ENcjs.createChartController; exports.createChartEditorDocument = createChartEditorDocument; exports.createChartRasterizer = createChartRasterizer; exports.createChartSpec = _chunkR3P2M7HUcjs.createChartSpec; exports.createChartToolProvider = createChartToolProvider; exports.createInstantChartClock = createInstantChartClock; exports.createOfficeChartToolProvider = createOfficeChartToolProvider; exports.cyclePaletteColor = _chunkR3P2M7HUcjs.cyclePaletteColor; exports.decimateChartPoints = _chunkSBQVEBSUcjs.decimateChartPoints; exports.defaultChartAxis = _chunkR3P2M7HUcjs.defaultChartAxis; exports.defaultChartErrorBarValue = _chunkR3P2M7HUcjs.defaultChartErrorBarValue; exports.describeChart = _chunkGKNEJ6ENcjs.describeChart; exports.describeChartErrorBars = _chunkR3P2M7HUcjs.describeChartErrorBars; exports.describeChartSelection = describeChartSelection; exports.describeOfficeChartPlace = describeOfficeChartPlace; exports.downloadChartPng = downloadChartPng; exports.easeChartTween = easeChartTween; exports.estimateChartTextWidth = _chunkSBQVEBSUcjs.estimateChartTextWidth; exports.extractDocxCharts = extractDocxCharts; exports.extractOfficeCharts = extractOfficeCharts; exports.extractPptxCharts = extractPptxCharts; exports.extractXlsxCharts = extractXlsxCharts; exports.findChartTreeNode = _chunkR3P2M7HUcjs.findChartTreeNode; exports.findMermaidCharts = _chunkGKNEJ6ENcjs.findMermaidCharts; exports.fitChartTrendline = _chunkSBQVEBSUcjs.fitChartTrendline; exports.formatChartAmountList = _chunkR3P2M7HUcjs.formatChartAmountList; exports.formatChartDate = _chunkSBQVEBSUcjs.formatChartDate; exports.formatChartNumber = _chunkSBQVEBSUcjs.formatChartNumber; exports.formatChartValueWithCode = _chunkSBQVEBSUcjs.formatChartValueWithCode; exports.handleChartKey = handleChartKey; exports.isCartesianChart = _chunkR3P2M7HUcjs.isCartesianChart; exports.isXyChart = _chunkR3P2M7HUcjs.isXyChart; exports.layoutChart = _chunkSBQVEBSUcjs.layoutChart; exports.layoutSparkline = _chunkGKNEJ6ENcjs.layoutSparkline; exports.linearMap = _chunkSBQVEBSUcjs.linearMap; exports.locateChartPoint = locateChartPoint; exports.monochromeChartPalette = _chunkGKNEJ6ENcjs.monochromeChartPalette; exports.niceLogScale = _chunkSBQVEBSUcjs.niceLogScale; exports.niceScale = _chunkSBQVEBSUcjs.niceScale; exports.niceStep = _chunkSBQVEBSUcjs.niceStep; exports.normalizeChartAxis = _chunkR3P2M7HUcjs.normalizeChartAxis; exports.normalizeChartErrorBars = _chunkR3P2M7HUcjs.normalizeChartErrorBars; exports.normalizeChartReferenceBand = _chunkR3P2M7HUcjs.normalizeChartReferenceBand; exports.normalizeChartReferenceLine = _chunkR3P2M7HUcjs.normalizeChartReferenceLine; exports.normalizeChartSpec = _chunkR3P2M7HUcjs.normalizeChartSpec; exports.normalizeChartTree = _chunkR3P2M7HUcjs.normalizeChartTree; exports.normalizeChartTrendline = _chunkR3P2M7HUcjs.normalizeChartTrendline; exports.normalizeChartValues = _chunkR3P2M7HUcjs.normalizeChartValues; exports.parseChartAmountList = _chunkR3P2M7HUcjs.parseChartAmountList; exports.parseChartColor = _chunkR3P2M7HUcjs.parseChartColor; exports.parseChartDate = _chunkSBQVEBSUcjs.parseChartDate; exports.parseChartValue = _chunkR3P2M7HUcjs.parseChartValue; exports.parsePartialChartJson = parsePartialChartJson; exports.planChartCommand = planChartCommand; exports.planChartToolPlayback = planChartToolPlayback; exports.rasterizeChartSvg = rasterizeChartSvg; exports.realChartClock = realChartClock; exports.recommendChartTypes = recommendChartTypes; exports.recommendForShape = recommendForShape; exports.removeChartTreeRow = _chunkR3P2M7HUcjs.removeChartTreeRow; exports.resolveChartSvgPaints = resolveChartSvgPaints; exports.sameChartSelection = _chunkSBQVEBSUcjs.sameChartSelection; exports.setChartTreeRowName = _chunkR3P2M7HUcjs.setChartTreeRowName; exports.setChartTreeRowValue = _chunkR3P2M7HUcjs.setChartTreeRowValue; exports.shadeChartColor = _chunkR3P2M7HUcjs.shadeChartColor; exports.simulateChartVision = _chunkR3P2M7HUcjs.simulateChartVision; exports.snapChartDragValue = snapChartDragValue; exports.snapChartValue = _chunkSBQVEBSUcjs.snapChartValue; exports.sparklineToSvg = _chunkGKNEJ6ENcjs.sparklineToSvg; exports.startChartPointDrag = startChartPointDrag; exports.stepDecimals = _chunkSBQVEBSUcjs.stepDecimals; exports.suggestChartReferences = _chunkSBQVEBSUcjs.suggestChartReferences; exports.summarizeChart = _chunkGKNEJ6ENcjs.summarizeChart; exports.summarizeChartSeries = _chunkSBQVEBSUcjs.summarizeChartSeries; exports.trendNumberText = _chunkSBQVEBSUcjs.trendNumberText; exports.uniqueChartSeriesId = _chunkR3P2M7HUcjs.uniqueChartSeriesId; exports.withChartPlayback = withChartPlayback;
3237
+ exports.CHART_AXIS_KINDS = _chunkUVXTOZ2Bcjs.CHART_AXIS_KINDS; exports.CHART_AXIS_SCALES = _chunkUVXTOZ2Bcjs.CHART_AXIS_SCALES; exports.CHART_COLOR_SCHEMES = _chunkIMRXC7OAcjs.CHART_COLOR_SCHEMES; exports.CHART_CURVES = _chunkUVXTOZ2Bcjs.CHART_CURVES; exports.CHART_DATE_STEPS = _chunkQO2T6KA5cjs.CHART_DATE_STEPS; exports.CHART_ERROR_BAR_DIRECTIONS = _chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_DIRECTIONS; exports.CHART_ERROR_BAR_LABELS = _chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_LABELS; exports.CHART_ERROR_BAR_TYPES = _chunkUVXTOZ2Bcjs.CHART_ERROR_BAR_TYPES; exports.CHART_LABEL_POSITIONS = _chunkUVXTOZ2Bcjs.CHART_LABEL_POSITIONS; exports.CHART_LAYOUT_PRESETS = _chunkIMRXC7OAcjs.CHART_LAYOUT_PRESETS; exports.CHART_LEGEND_POSITIONS = _chunkUVXTOZ2Bcjs.CHART_LEGEND_POSITIONS; exports.CHART_LIKERT_NEUTRALS = _chunkUVXTOZ2Bcjs.CHART_LIKERT_NEUTRALS; exports.CHART_LIKERT_SORTS = _chunkUVXTOZ2Bcjs.CHART_LIKERT_SORTS; exports.CHART_MARKERS = _chunkUVXTOZ2Bcjs.CHART_MARKERS; exports.CHART_MERMAID_META_PREFIX = _chunkIMRXC7OAcjs.CHART_MERMAID_META_PREFIX; exports.CHART_NUMBER_STYLES = _chunkUVXTOZ2Bcjs.CHART_NUMBER_STYLES; exports.CHART_OOXML_CONTENT_TYPE = _chunkQ25WAFTDcjs.CHART_OOXML_CONTENT_TYPE; exports.CHART_OOXML_NS = _chunkQ25WAFTDcjs.CHART_OOXML_NS; exports.CHART_OOXML_RELATIONSHIP = _chunkQ25WAFTDcjs.CHART_OOXML_RELATIONSHIP; exports.CHART_ORIENTATIONS = _chunkUVXTOZ2Bcjs.CHART_ORIENTATIONS; exports.CHART_PALETTE_SHADES = _chunkUVXTOZ2Bcjs.CHART_PALETTE_SHADES; exports.CHART_PRESENCE_COLORS = CHART_PRESENCE_COLORS; exports.CHART_RADAR_GRATICULES = _chunkUVXTOZ2Bcjs.CHART_RADAR_GRATICULES; exports.CHART_RASTER_MAX_SIZE = CHART_RASTER_MAX_SIZE; exports.CHART_REFERENCE_AXES = _chunkUVXTOZ2Bcjs.CHART_REFERENCE_AXES; exports.CHART_SANKEY_LINK_COLORS = _chunkUVXTOZ2Bcjs.CHART_SANKEY_LINK_COLORS; exports.CHART_SERIES_TYPES = _chunkUVXTOZ2Bcjs.CHART_SERIES_TYPES; exports.CHART_STACKINGS = _chunkUVXTOZ2Bcjs.CHART_STACKINGS; exports.CHART_TRENDLINE_TYPES = _chunkUVXTOZ2Bcjs.CHART_TRENDLINE_TYPES; exports.CHART_TYPES = _chunkUVXTOZ2Bcjs.CHART_TYPES; exports.CHART_TYPE_LABELS = _chunkUVXTOZ2Bcjs.CHART_TYPE_LABELS; exports.CSS_VARIABLE_CHART_THEME = _chunkUVXTOZ2Bcjs.CSS_VARIABLE_CHART_THEME; exports.ChartController = _chunkIMRXC7OAcjs.ChartController; exports.ChartDirector = ChartDirector; exports.ChartPresence = ChartPresence; exports.ChartStream = ChartStream; exports.DEFAULT_CHART_PALETTE = _chunkUVXTOZ2Bcjs.DEFAULT_CHART_PALETTE; exports.DEFAULT_CHART_THEME = _chunkUVXTOZ2Bcjs.DEFAULT_CHART_THEME; exports.MAX_CHART_DATA_LABELS = _chunkQO2T6KA5cjs.MAX_CHART_DATA_LABELS; exports.MAX_CHART_LINE_POINTS = _chunkQO2T6KA5cjs.MAX_CHART_LINE_POINTS; exports.MAX_CHART_LINKS = _chunkUVXTOZ2Bcjs.MAX_CHART_LINKS; exports.MAX_CHART_MARKERS = _chunkQO2T6KA5cjs.MAX_CHART_MARKERS; exports.MAX_CHART_TREE_DEPTH = _chunkUVXTOZ2Bcjs.MAX_CHART_TREE_DEPTH; exports.MAX_CHART_TREE_NODES = _chunkUVXTOZ2Bcjs.MAX_CHART_TREE_NODES; exports.OfficeChartsError = OfficeChartsError; exports.RENDER_CHART_INSTRUCTIONS = RENDER_CHART_INSTRUCTIONS; exports.addChartLink = _chunkUVXTOZ2Bcjs.addChartLink; exports.addChartTreeRow = _chunkUVXTOZ2Bcjs.addChartTreeRow; exports.analyzeChartTable = analyzeChartTable; exports.blendChartScenes = blendChartScenes; exports.canDragChartPoint = canDragChartPoint; exports.chartBoxStats = _chunkQO2T6KA5cjs.chartBoxStats; exports.chartClientToScene = chartClientToScene; exports.chartColorDistance = _chunkUVXTOZ2Bcjs.chartColorDistance; exports.chartColorInputValue = _chunkUVXTOZ2Bcjs.chartColorInputValue; exports.chartColorsByCategory = _chunkUVXTOZ2Bcjs.chartColorsByCategory; exports.chartContrastRatio = _chunkUVXTOZ2Bcjs.chartContrastRatio; exports.chartDataFromTable = _chunkUVXTOZ2Bcjs.chartDataFromTable; exports.chartDataToTable = _chunkUVXTOZ2Bcjs.chartDataToTable; exports.chartDateLabels = _chunkQO2T6KA5cjs.chartDateLabels; exports.chartDateToSerial = _chunkQO2T6KA5cjs.chartDateToSerial; exports.chartErrorAmounts = _chunkUVXTOZ2Bcjs.chartErrorAmounts; exports.chartErrorBarsOfType = _chunkUVXTOZ2Bcjs.chartErrorBarsOfType; exports.chartFamily = _chunkUVXTOZ2Bcjs.chartFamily; exports.chartFileName = chartFileName; exports.chartFormatToCode = _chunkQ25WAFTDcjs.chartFormatToCode; exports.chartFromMermaid = _chunkIMRXC7OAcjs.chartFromMermaid; exports.chartFromOoxml = _chunkQ25WAFTDcjs.chartFromOoxml; exports.chartFromTable = chartFromTable; exports.chartHistogram = _chunkQO2T6KA5cjs.chartHistogram; exports.chartHitTest = chartHitTest; exports.chartLikertColor = _chunkUVXTOZ2Bcjs.chartLikertColor; exports.chartLinksFromTable = _chunkUVXTOZ2Bcjs.chartLinksFromTable; exports.chartLuminance = _chunkUVXTOZ2Bcjs.chartLuminance; exports.chartMermaidFamily = _chunkIMRXC7OAcjs.chartMermaidFamily; exports.chartMovingAverage = _chunkQO2T6KA5cjs.chartMovingAverage; exports.chartPointAnchor = chartPointAnchor; exports.chartPointColor = _chunkUVXTOZ2Bcjs.chartPointColor; exports.chartPointRef = chartPointRef; exports.chartPresetPatch = _chunkIMRXC7OAcjs.chartPresetPatch; exports.chartQuantile = _chunkQO2T6KA5cjs.chartQuantile; exports.chartRasterSize = chartRasterSize; exports.chartRgbToHex = _chunkUVXTOZ2Bcjs.chartRgbToHex; exports.chartRgbToOklab = _chunkUVXTOZ2Bcjs.chartRgbToOklab; exports.chartSankeyNodeValues = _chunkUVXTOZ2Bcjs.chartSankeyNodeValues; exports.chartSankeyNodes = _chunkUVXTOZ2Bcjs.chartSankeyNodes; exports.chartScaleFromPixel = _chunkQO2T6KA5cjs.chartScaleFromPixel; exports.chartScaleToPixel = _chunkQO2T6KA5cjs.chartScaleToPixel; exports.chartSceneToDomSpec = _chunkIMRXC7OAcjs.chartSceneToDomSpec; exports.chartSceneToSvg = _chunkIMRXC7OAcjs.chartSceneToSvg; exports.chartSerialToDate = _chunkQO2T6KA5cjs.chartSerialToDate; exports.chartSeriesColor = _chunkUVXTOZ2Bcjs.chartSeriesColor; exports.chartSeriesType = _chunkUVXTOZ2Bcjs.chartSeriesType; exports.chartSliceColor = _chunkUVXTOZ2Bcjs.chartSliceColor; exports.chartSpecColorsByCategory = _chunkUVXTOZ2Bcjs.chartSpecColorsByCategory; exports.chartSquarify = _chunkQO2T6KA5cjs.chartSquarify; exports.chartStyleDomain = chartStyleDomain; exports.chartStylePatch = chartStylePatch; exports.chartSupportsTrendlines = _chunkQO2T6KA5cjs.chartSupportsTrendlines; exports.chartTextBaseline = _chunkIMRXC7OAcjs.chartTextBaseline; exports.chartTextOn = _chunkUVXTOZ2Bcjs.chartTextOn; exports.chartTextTransform = _chunkIMRXC7OAcjs.chartTextTransform; exports.chartToMermaid = _chunkIMRXC7OAcjs.chartToMermaid; exports.chartToOoxml = _chunkQ25WAFTDcjs.chartToOoxml; exports.chartToSvg = _chunkIMRXC7OAcjs.chartToSvg; exports.chartTreeColumnLabels = _chunkUVXTOZ2Bcjs.chartTreeColumnLabels; exports.chartTreeDepth = _chunkUVXTOZ2Bcjs.chartTreeDepth; exports.chartTreeFromRows = _chunkUVXTOZ2Bcjs.chartTreeFromRows; exports.chartTreeFromSeries = _chunkUVXTOZ2Bcjs.chartTreeFromSeries; exports.chartTreeFromTable = _chunkUVXTOZ2Bcjs.chartTreeFromTable; exports.chartTreeToRows = _chunkUVXTOZ2Bcjs.chartTreeToRows; exports.chartTreeTotal = _chunkUVXTOZ2Bcjs.chartTreeTotal; exports.chartTrendlineName = _chunkQO2T6KA5cjs.chartTrendlineName; exports.chartValueAtPoint = _chunkQO2T6KA5cjs.chartValueAtPoint; exports.chartVariesColors = _chunkUVXTOZ2Bcjs.chartVariesColors; exports.chartXAtPoint = _chunkQO2T6KA5cjs.chartXAtPoint; exports.checkChartColors = _chunkUVXTOZ2Bcjs.checkChartColors; exports.cloneChartSeries = _chunkUVXTOZ2Bcjs.cloneChartSeries; exports.cloneChartSpec = _chunkUVXTOZ2Bcjs.cloneChartSpec; exports.cloneChartTree = _chunkUVXTOZ2Bcjs.cloneChartTree; exports.compileChartFormatCode = _chunkQO2T6KA5cjs.compileChartFormatCode; exports.contrastingTextColor = _chunkQO2T6KA5cjs.contrastingTextColor; exports.createChartCommands = createChartCommands; exports.createChartController = _chunkIMRXC7OAcjs.createChartController; exports.createChartEditorDocument = createChartEditorDocument; exports.createChartRasterizer = createChartRasterizer; exports.createChartSpec = _chunkUVXTOZ2Bcjs.createChartSpec; exports.createChartStyleToolProvider = createChartStyleToolProvider; exports.createChartToolProvider = createChartToolProvider; exports.createInstantChartClock = createInstantChartClock; exports.createOfficeChartToolProvider = createOfficeChartToolProvider; exports.cyclePaletteColor = _chunkUVXTOZ2Bcjs.cyclePaletteColor; exports.decimateChartPoints = _chunkQO2T6KA5cjs.decimateChartPoints; exports.defaultChartAxis = _chunkUVXTOZ2Bcjs.defaultChartAxis; exports.defaultChartErrorBarValue = _chunkUVXTOZ2Bcjs.defaultChartErrorBarValue; exports.describeChart = _chunkIMRXC7OAcjs.describeChart; exports.describeChartErrorBars = _chunkUVXTOZ2Bcjs.describeChartErrorBars; exports.describeChartSelection = describeChartSelection; exports.describeOfficeChartPlace = describeOfficeChartPlace; exports.downloadChartPng = downloadChartPng; exports.easeChartTween = easeChartTween; exports.estimateChartTextWidth = _chunkQO2T6KA5cjs.estimateChartTextWidth; exports.extractDocxCharts = extractDocxCharts; exports.extractOfficeCharts = extractOfficeCharts; exports.extractPptxCharts = extractPptxCharts; exports.extractXlsxCharts = extractXlsxCharts; exports.findChartTreeNode = _chunkUVXTOZ2Bcjs.findChartTreeNode; exports.findMermaidCharts = _chunkIMRXC7OAcjs.findMermaidCharts; exports.fitChartTrendline = _chunkQO2T6KA5cjs.fitChartTrendline; exports.formatChartAmountList = _chunkUVXTOZ2Bcjs.formatChartAmountList; exports.formatChartDate = _chunkQO2T6KA5cjs.formatChartDate; exports.formatChartNumber = _chunkQO2T6KA5cjs.formatChartNumber; exports.formatChartValueWithCode = _chunkQO2T6KA5cjs.formatChartValueWithCode; exports.handleChartKey = handleChartKey; exports.isCartesianChart = _chunkUVXTOZ2Bcjs.isCartesianChart; exports.isXyChart = _chunkUVXTOZ2Bcjs.isXyChart; exports.layoutChart = _chunkQO2T6KA5cjs.layoutChart; exports.layoutSparkline = _chunkIMRXC7OAcjs.layoutSparkline; exports.linearMap = _chunkQO2T6KA5cjs.linearMap; exports.locateChartPoint = locateChartPoint; exports.monochromeChartPalette = _chunkIMRXC7OAcjs.monochromeChartPalette; exports.niceLogScale = _chunkQO2T6KA5cjs.niceLogScale; exports.niceScale = _chunkQO2T6KA5cjs.niceScale; exports.niceStep = _chunkQO2T6KA5cjs.niceStep; exports.normalizeChartAxis = _chunkUVXTOZ2Bcjs.normalizeChartAxis; exports.normalizeChartErrorBars = _chunkUVXTOZ2Bcjs.normalizeChartErrorBars; exports.normalizeChartLinks = _chunkUVXTOZ2Bcjs.normalizeChartLinks; exports.normalizeChartReferenceBand = _chunkUVXTOZ2Bcjs.normalizeChartReferenceBand; exports.normalizeChartReferenceLine = _chunkUVXTOZ2Bcjs.normalizeChartReferenceLine; exports.normalizeChartSpec = _chunkUVXTOZ2Bcjs.normalizeChartSpec; exports.normalizeChartTree = _chunkUVXTOZ2Bcjs.normalizeChartTree; exports.normalizeChartTrendline = _chunkUVXTOZ2Bcjs.normalizeChartTrendline; exports.normalizeChartValues = _chunkUVXTOZ2Bcjs.normalizeChartValues; exports.parseChartAmountList = _chunkUVXTOZ2Bcjs.parseChartAmountList; exports.parseChartColor = _chunkUVXTOZ2Bcjs.parseChartColor; exports.parseChartDate = _chunkQO2T6KA5cjs.parseChartDate; exports.parseChartValue = _chunkUVXTOZ2Bcjs.parseChartValue; exports.parsePartialChartJson = parsePartialChartJson; exports.planChartCommand = planChartCommand; exports.planChartToolPlayback = planChartToolPlayback; exports.rasterizeChartSvg = rasterizeChartSvg; exports.realChartClock = realChartClock; exports.recommendChartTypes = recommendChartTypes; exports.recommendForShape = recommendForShape; exports.removeChartTreeRow = _chunkUVXTOZ2Bcjs.removeChartTreeRow; exports.resolveChartSvgPaints = resolveChartSvgPaints; exports.sameChartSelection = _chunkQO2T6KA5cjs.sameChartSelection; exports.setChartLinkField = _chunkUVXTOZ2Bcjs.setChartLinkField; exports.setChartTreeRowName = _chunkUVXTOZ2Bcjs.setChartTreeRowName; exports.setChartTreeRowValue = _chunkUVXTOZ2Bcjs.setChartTreeRowValue; exports.shadeChartColor = _chunkUVXTOZ2Bcjs.shadeChartColor; exports.simulateChartVision = _chunkUVXTOZ2Bcjs.simulateChartVision; exports.snapChartDragValue = snapChartDragValue; exports.snapChartValue = _chunkQO2T6KA5cjs.snapChartValue; exports.sparklineToSvg = _chunkIMRXC7OAcjs.sparklineToSvg; exports.startChartPointDrag = startChartPointDrag; exports.stepDecimals = _chunkQO2T6KA5cjs.stepDecimals; exports.suggestChartReferences = _chunkQO2T6KA5cjs.suggestChartReferences; exports.summarizeChart = _chunkIMRXC7OAcjs.summarizeChart; exports.summarizeChartSeries = _chunkQO2T6KA5cjs.summarizeChartSeries; exports.trendNumberText = _chunkQO2T6KA5cjs.trendNumberText; exports.uniqueChartSeriesId = _chunkUVXTOZ2Bcjs.uniqueChartSeriesId; exports.withChartPlayback = withChartPlayback;