pptx-react-viewer 4.9.0 → 4.10.1

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 (93) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/{AiChatPanel-YRWC7C3B.mjs → AiChatPanel-AR2K2XN2.mjs} +3 -3
  3. package/dist/AiChatPanel-AR2K2XN2.mjs.br +0 -0
  4. package/dist/AiChatPanel-AR2K2XN2.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-WJ64Q6KO.js → AiChatPanel-X6E22UAR.js} +27 -27
  6. package/dist/AiChatPanel-X6E22UAR.js.br +0 -0
  7. package/dist/AiChatPanel-X6E22UAR.js.gz +0 -0
  8. package/dist/{Model3DScene-DS6AQWFV.mjs → Model3DScene-FF4RCG4O.mjs} +1 -1
  9. package/dist/Model3DScene-FF4RCG4O.mjs.br +0 -0
  10. package/dist/Model3DScene-FF4RCG4O.mjs.gz +0 -0
  11. package/dist/{Model3DScene-VHDYCHO5.js → Model3DScene-ZSCVKXZE.js} +2 -2
  12. package/dist/Model3DScene-ZSCVKXZE.js.br +0 -0
  13. package/dist/Model3DScene-ZSCVKXZE.js.gz +0 -0
  14. package/dist/{chunk-M6KW27TZ.mjs → chunk-22ODJ4CT.mjs} +17 -13
  15. package/dist/chunk-22ODJ4CT.mjs.br +0 -0
  16. package/dist/chunk-22ODJ4CT.mjs.gz +0 -0
  17. package/dist/{chunk-7NTNFOPT.js → chunk-7EP22XCS.js} +187 -187
  18. package/dist/chunk-7EP22XCS.js.br +0 -0
  19. package/dist/chunk-7EP22XCS.js.gz +0 -0
  20. package/dist/{chunk-NMXIX7E4.js → chunk-ICOJBMRC.js} +1179 -1179
  21. package/dist/chunk-ICOJBMRC.js.br +0 -0
  22. package/dist/chunk-ICOJBMRC.js.gz +0 -0
  23. package/dist/{chunk-YWAFJZ23.js → chunk-JJE4AACM.js} +861 -346
  24. package/dist/chunk-JJE4AACM.js.br +0 -0
  25. package/dist/chunk-JJE4AACM.js.gz +0 -0
  26. package/dist/{chunk-PJT2DTOS.mjs → chunk-LDRA5LJT.mjs} +861 -346
  27. package/dist/chunk-LDRA5LJT.mjs.br +0 -0
  28. package/dist/chunk-LDRA5LJT.mjs.gz +0 -0
  29. package/dist/{chunk-Y7RTQOD6.mjs → chunk-NE4USMMB.mjs} +1 -1
  30. package/dist/chunk-NE4USMMB.mjs.br +0 -0
  31. package/dist/chunk-NE4USMMB.mjs.gz +0 -0
  32. package/dist/{chunk-K5HZD63F.mjs → chunk-QPWNFTU5.mjs} +6 -6
  33. package/dist/chunk-QPWNFTU5.mjs.br +0 -0
  34. package/dist/chunk-QPWNFTU5.mjs.gz +0 -0
  35. package/dist/{chunk-ZZY24BB7.mjs → chunk-VOD4C7OS.mjs} +1 -1
  36. package/dist/chunk-VOD4C7OS.mjs.br +0 -0
  37. package/dist/chunk-VOD4C7OS.mjs.gz +0 -0
  38. package/dist/{chunk-ZZ6IPWOP.js → chunk-VYJFYRT4.js} +820 -816
  39. package/dist/chunk-VYJFYRT4.js.br +0 -0
  40. package/dist/chunk-VYJFYRT4.js.gz +0 -0
  41. package/dist/{chunk-PSJTZIIK.js → chunk-WLEFW2F4.js} +5 -5
  42. package/dist/chunk-WLEFW2F4.js.br +0 -0
  43. package/dist/chunk-WLEFW2F4.js.gz +0 -0
  44. package/dist/index.d.ts +20 -4
  45. package/dist/index.js +61 -61
  46. package/dist/index.js.br +0 -0
  47. package/dist/index.js.gz +0 -0
  48. package/dist/index.mjs +5 -5
  49. package/dist/index.mjs.br +0 -0
  50. package/dist/index.mjs.gz +0 -0
  51. package/dist/internals.d.ts +22 -6
  52. package/dist/internals.js +104 -104
  53. package/dist/internals.js.br +0 -0
  54. package/dist/internals.js.gz +0 -0
  55. package/dist/internals.mjs +3 -3
  56. package/dist/internals.mjs.br +0 -0
  57. package/dist/internals.mjs.gz +0 -0
  58. package/dist/viewer/index.d.ts +20 -4
  59. package/dist/viewer/index.js +26 -26
  60. package/dist/viewer/index.js.br +0 -0
  61. package/dist/viewer/index.js.gz +0 -0
  62. package/dist/viewer/index.mjs +5 -5
  63. package/dist/viewer/index.mjs.br +0 -0
  64. package/dist/viewer/index.mjs.gz +0 -0
  65. package/package.json +2 -2
  66. package/dist/AiChatPanel-WJ64Q6KO.js.br +0 -0
  67. package/dist/AiChatPanel-WJ64Q6KO.js.gz +0 -0
  68. package/dist/AiChatPanel-YRWC7C3B.mjs.br +0 -0
  69. package/dist/AiChatPanel-YRWC7C3B.mjs.gz +0 -0
  70. package/dist/Model3DScene-DS6AQWFV.mjs.br +0 -0
  71. package/dist/Model3DScene-DS6AQWFV.mjs.gz +0 -0
  72. package/dist/Model3DScene-VHDYCHO5.js.br +0 -0
  73. package/dist/Model3DScene-VHDYCHO5.js.gz +0 -0
  74. package/dist/chunk-7NTNFOPT.js.br +0 -0
  75. package/dist/chunk-7NTNFOPT.js.gz +0 -0
  76. package/dist/chunk-K5HZD63F.mjs.br +0 -0
  77. package/dist/chunk-K5HZD63F.mjs.gz +0 -0
  78. package/dist/chunk-M6KW27TZ.mjs.br +0 -0
  79. package/dist/chunk-M6KW27TZ.mjs.gz +0 -0
  80. package/dist/chunk-NMXIX7E4.js.br +0 -0
  81. package/dist/chunk-NMXIX7E4.js.gz +0 -0
  82. package/dist/chunk-PJT2DTOS.mjs.br +0 -0
  83. package/dist/chunk-PJT2DTOS.mjs.gz +0 -0
  84. package/dist/chunk-PSJTZIIK.js.br +0 -0
  85. package/dist/chunk-PSJTZIIK.js.gz +0 -0
  86. package/dist/chunk-Y7RTQOD6.mjs.br +0 -0
  87. package/dist/chunk-Y7RTQOD6.mjs.gz +0 -0
  88. package/dist/chunk-YWAFJZ23.js.br +0 -0
  89. package/dist/chunk-YWAFJZ23.js.gz +0 -0
  90. package/dist/chunk-ZZ6IPWOP.js.br +0 -0
  91. package/dist/chunk-ZZ6IPWOP.js.gz +0 -0
  92. package/dist/chunk-ZZY24BB7.mjs.br +0 -0
  93. package/dist/chunk-ZZY24BB7.mjs.gz +0 -0
@@ -11100,7 +11100,7 @@ function createChartElement(chartType, input, options) {
11100
11100
  const chartData = {
11101
11101
  chartType,
11102
11102
  categories: input.categories,
11103
- categoryLevels: input.categoryLevels?.map((level) => [...level]),
11103
+ categoryLevels: input.categoryLevels?.map((level2) => [...level2]),
11104
11104
  series,
11105
11105
  title: input.title,
11106
11106
  grouping: input.grouping,
@@ -35944,9 +35944,9 @@ function paragraphsAt(text22, sizePt) {
35944
35944
  const afterParent = (text22.spaceAfterParent ?? DEFAULT_SPACE_AFTER_PARENT) / 100;
35945
35945
  const afterChild = (text22.spaceAfterChild ?? DEFAULT_SPACE_AFTER_CHILD) / 100;
35946
35946
  const { secondary } = paragraphSizesPt(text22, sizePt);
35947
- const paragraph = (value, level) => {
35948
- const bullet = bulletLevel > 0 && level >= bulletLevel;
35949
- const size = bullet || level >= 2 ? secondary : sizePt;
35947
+ const paragraph = (value, level2) => {
35948
+ const bullet = bulletLevel > 0 && level2 >= bulletLevel;
35949
+ const size = bullet || level2 >= 2 ? secondary : sizePt;
35950
35950
  return {
35951
35951
  text: value,
35952
35952
  size,
@@ -36819,6 +36819,136 @@ var init_alg_hier = __esm({
36819
36819
  HIER_ALGS = /* @__PURE__ */ new Set(["hierRoot", "hierChild"]);
36820
36820
  }
36821
36821
  });
36822
+ function shapeTransform(node) {
36823
+ const box = node.box;
36824
+ if (!box) {
36825
+ return void 0;
36826
+ }
36827
+ const rotation = (((node.shape?.rot ?? 0) + node.rotation) % 360 + 360) % 360;
36828
+ const quarter = Math.round((node.shape?.rot ?? 0) / 90);
36829
+ if (Math.abs(quarter) % 2 === 1 && Math.abs((node.shape?.rot ?? 0) - quarter * 90) < 1e-6) {
36830
+ const cx = box.x + box.w / 2;
36831
+ const cy = box.y + box.h / 2;
36832
+ return { x: cx - box.h / 2, y: cy - box.w / 2, w: box.h, h: box.w, rotation };
36833
+ }
36834
+ return { ...box, rotation };
36835
+ }
36836
+ var init_shape_transform = __esm({
36837
+ "src/core/utils/smartart-engine/shape-transform.ts"() {
36838
+ }
36839
+ });
36840
+ function depthOf(point) {
36841
+ let depth = 0;
36842
+ for (let current = point.parent; current; current = current.parent) {
36843
+ depth++;
36844
+ }
36845
+ return depth;
36846
+ }
36847
+ function level(depth) {
36848
+ return Math.max(0, Math.min(MAX_LEVEL, depth));
36849
+ }
36850
+ function connectorDim(node) {
36851
+ return node.alg.type === "conn" && node.alg.params.dim === "1D" ? "1D" : "2D";
36852
+ }
36853
+ function derivedStyleLabel(node) {
36854
+ if (!node.hasPresOf) {
36855
+ return void 0;
36856
+ }
36857
+ const point = node.presOf[0] ?? node.point;
36858
+ switch (point.type) {
36859
+ case "node":
36860
+ case "asst":
36861
+ return `node${level(depthOf(point))}`;
36862
+ case "sibTrans":
36863
+ return `sibTrans${connectorDim(node)}1`;
36864
+ case "parTrans":
36865
+ return `parChTrans${connectorDim(node)}${level(depthOf(point))}`;
36866
+ default:
36867
+ return void 0;
36868
+ }
36869
+ }
36870
+ function engineStyleLabel(node) {
36871
+ for (let current = node; current; current = current.parent) {
36872
+ if (current.styleLbl) {
36873
+ return current.styleLbl;
36874
+ }
36875
+ }
36876
+ return derivedStyleLabel(node);
36877
+ }
36878
+ var MAX_LEVEL;
36879
+ var init_style_label = __esm({
36880
+ "src/core/utils/smartart-engine/style-label.ts"() {
36881
+ MAX_LEVEL = 4;
36882
+ }
36883
+ });
36884
+ function connectorPreset(node) {
36885
+ const type = node.shape?.type;
36886
+ if (!type || type === "none" || node.shape?.hideGeom || !node.values.has("connDist")) {
36887
+ return void 0;
36888
+ }
36889
+ if (type !== "conn") {
36890
+ return type;
36891
+ }
36892
+ const params = node.alg.params;
36893
+ if ((params.dim ?? "2D") !== "2D" || (params.connRout ?? "stra") !== "stra") {
36894
+ return void 0;
36895
+ }
36896
+ const begin = (params.begSty ?? "noArr") === "arr";
36897
+ const end = (params.endSty ?? "arr") === "arr";
36898
+ if (begin && end) {
36899
+ return "leftRightArrow";
36900
+ }
36901
+ if (begin) {
36902
+ return "leftArrow";
36903
+ }
36904
+ return end ? "rightArrow" : "rect";
36905
+ }
36906
+ function buildConnectorNode(node, index, connectorIndex, palette, roleColors) {
36907
+ const preset22 = connectorPreset(node);
36908
+ const transform6 = preset22 ? shapeTransform(node) : void 0;
36909
+ if (!preset22 || !transform6 || !(transform6.w > 0) || !(transform6.h > 0)) {
36910
+ return void 0;
36911
+ }
36912
+ const styleLabel = engineStyleLabel(node);
36913
+ const fills = styleLabel ? roleColors?.[styleLabel]?.fill : void 0;
36914
+ const fill = fills && fills.length > 0 ? fills[connectorIndex % fills.length] : colour(index, palette);
36915
+ const x = transform6.x * PX_PER_PT3;
36916
+ const y = transform6.y * PX_PER_PT3;
36917
+ const width = transform6.w * PX_PER_PT3;
36918
+ const height = transform6.h * PX_PER_PT3;
36919
+ return {
36920
+ kind: "rect",
36921
+ key: `${node.name || "engine-conn"}-${index}`,
36922
+ x,
36923
+ y,
36924
+ width,
36925
+ height,
36926
+ rx: 0,
36927
+ fill,
36928
+ stroke: "none",
36929
+ strokeWidth: 0,
36930
+ opacity: 1,
36931
+ text: "",
36932
+ fontSize: 0,
36933
+ textX: x + width / 2,
36934
+ textY: y + height / 2,
36935
+ rotation: transform6.rotation === 0 ? void 0 : transform6.rotation,
36936
+ presetOverride: preset22,
36937
+ ...preset22 === "rect" ? {} : { shapeAdjustments: { ...ARROW_ADJUSTMENTS } },
36938
+ ...styleLabel ? { styleLabel } : {}
36939
+ };
36940
+ }
36941
+ var ARROW_ADJUSTMENTS;
36942
+ var PX_PER_PT3;
36943
+ var init_connector_shape = __esm({
36944
+ "src/core/utils/smartart-engine/connector-shape.ts"() {
36945
+ init_smartart_layout_style_helpers();
36946
+ init_shape_transform();
36947
+ init_style_label();
36948
+ ARROW_ADJUSTMENTS = { adj1: 6e4, adj2: 5e4 };
36949
+ PX_PER_PT3 = 96 / 72;
36950
+ }
36951
+ });
36822
36952
  function collectNodes(nodes, parentId, out) {
36823
36953
  for (const node of nodes) {
36824
36954
  out.push({ node, parentId: node.parentId ?? parentId });
@@ -37514,6 +37644,68 @@ var init_pres_tree = __esm({
37514
37644
  MAX_DEPTH = 96;
37515
37645
  }
37516
37646
  });
37647
+ function connectorThickness(node, fallback) {
37648
+ const parent = node.parent;
37649
+ let resized = false;
37650
+ for (const constraint of parent?.constraints ?? []) {
37651
+ if (!parent || !SIZE_TYPES2.has(constraint.type) || !SIZE_TYPES2.has(constraint.refType)) {
37652
+ continue;
37653
+ }
37654
+ if (constraint.refFor === "self" && !constraint.refForName) {
37655
+ continue;
37656
+ }
37657
+ const targets = relatedNodes(parent, constraint.for, constraint.forName, constraint.ptType);
37658
+ if (!targets.includes(node)) {
37659
+ continue;
37660
+ }
37661
+ const ref = relatedNodes(
37662
+ parent,
37663
+ constraint.refFor,
37664
+ constraint.refForName,
37665
+ constraint.refPtType
37666
+ )[0];
37667
+ const box = ref?.box;
37668
+ if (!box || ref.alg.type === "conn") {
37669
+ continue;
37670
+ }
37671
+ const base = constraint.refType === "w" ? box.w : box.h;
37672
+ if (base > 0) {
37673
+ node.values.set(constraint.type, base * constraint.fact);
37674
+ resized = true;
37675
+ }
37676
+ }
37677
+ if (resized) {
37678
+ for (let i2 = 0; i2 < node.constraints.length; i2++) {
37679
+ if (isSelfSizeConstraint(node, i2)) {
37680
+ applyConstraint(node, node.constraints[i2]);
37681
+ }
37682
+ }
37683
+ }
37684
+ const h2 = node.values.get("h");
37685
+ return resized && h2 !== void 0 && h2 > 0 ? h2 : fallback;
37686
+ }
37687
+ function edgeDistance(shape, box, dx, dy) {
37688
+ const halfW = box.w / 2;
37689
+ const halfH = box.h / 2;
37690
+ if (shape.shape?.type === "ellipse" && halfW > 0 && halfH > 0) {
37691
+ return halfW * halfH / Math.hypot(halfH * dx, halfW * dy);
37692
+ }
37693
+ const tx = dx === 0 ? Infinity : halfW / Math.abs(dx);
37694
+ const ty = dy === 0 ? Infinity : halfH / Math.abs(dy);
37695
+ return Math.min(tx, ty);
37696
+ }
37697
+ var SIZE_TYPES2;
37698
+ var DEFAULT_BEGIN_PAD;
37699
+ var DEFAULT_END_PAD;
37700
+ var init_connector_size = __esm({
37701
+ "src/core/utils/smartart-engine/connector-size.ts"() {
37702
+ init_constraint_eval();
37703
+ init_preferred_size();
37704
+ SIZE_TYPES2 = /* @__PURE__ */ new Set(["w", "h"]);
37705
+ DEFAULT_BEGIN_PAD = 0.22;
37706
+ DEFAULT_END_PAD = 0.25;
37707
+ }
37708
+ });
37517
37709
  function rootOf2(node) {
37518
37710
  let current = node;
37519
37711
  while (current.parent) {
@@ -37560,13 +37752,6 @@ function findShape(scope, point, name, skip) {
37560
37752
  visit(scope);
37561
37753
  return named ?? fallback;
37562
37754
  }
37563
- function edgeDistance(box, dx, dy) {
37564
- const halfW = box.w / 2;
37565
- const halfH = box.h / 2;
37566
- const tx = dx === 0 ? Infinity : halfW / Math.abs(dx);
37567
- const ty = dy === 0 ? Infinity : halfH / Math.abs(dy);
37568
- return Math.min(tx, ty);
37569
- }
37570
37755
  function arrangeConnector(node) {
37571
37756
  const box = node.box;
37572
37757
  if (!box) {
@@ -37585,8 +37770,8 @@ function arrangeConnector(node) {
37585
37770
  if (length > 0) {
37586
37771
  const dx = (ex - sx) / length;
37587
37772
  const dy = (ey - sy) / length;
37588
- const startGap = edgeDistance(src.box, dx, dy);
37589
- const endGap = edgeDistance(dst.box, dx, dy);
37773
+ const startGap = edgeDistance(src, src.box, dx, dy);
37774
+ const endGap = edgeDistance(dst, dst.box, dx, dy);
37590
37775
  const connDist = Math.max(0, length - startGap - endGap);
37591
37776
  node.values.set("connDist", connDist);
37592
37777
  for (const constraint of node.constraints) {
@@ -37594,13 +37779,13 @@ function arrangeConnector(node) {
37594
37779
  node.values.set(constraint.type, connDist * constraint.fact);
37595
37780
  }
37596
37781
  }
37597
- const begPad = node.values.get("begPad") ?? 0;
37598
- const endPad = node.values.get("endPad") ?? 0;
37782
+ const begPad = node.values.get("begPad") ?? connDist * DEFAULT_BEGIN_PAD;
37783
+ const endPad = node.values.get("endPad") ?? connDist * DEFAULT_END_PAD;
37599
37784
  const arrowLength = Math.max(0, connDist - begPad - endPad);
37600
37785
  const mid = startGap + begPad + arrowLength / 2;
37601
37786
  const cx = sx + dx * mid;
37602
37787
  const cy = sy + dy * mid;
37603
- const thickness = box.h;
37788
+ const thickness = connectorThickness(node, box.h);
37604
37789
  node.box = { x: cx - arrowLength / 2, y: cy - thickness / 2, w: arrowLength, h: thickness };
37605
37790
  node.rotation = normaliseAngle2(Math.atan2(dy, dx) * 180 / Math.PI);
37606
37791
  }
@@ -37616,6 +37801,7 @@ function normaliseAngle2(degrees) {
37616
37801
  }
37617
37802
  var init_alg_connector = __esm({
37618
37803
  "src/core/utils/smartart-engine/alg-connector.ts"() {
37804
+ init_connector_size();
37619
37805
  }
37620
37806
  });
37621
37807
  function groupContentChildren(node) {
@@ -38655,11 +38841,11 @@ function applyEngineFonts(collected, nodeById, fontName) {
38655
38841
  const pt2 = sizes.get(node) ?? 18;
38656
38842
  const text22 = texts.get(node);
38657
38843
  const { first, secondary } = text22 ? paragraphSizesPt(text22, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
38658
- rendered.fontSize = first * PX_PER_PT3;
38659
- rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT3 : void 0;
38844
+ rendered.fontSize = first * PX_PER_PT4;
38845
+ rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT4 : void 0;
38660
38846
  }
38661
38847
  }
38662
- var PX_PER_PT3;
38848
+ var PX_PER_PT4;
38663
38849
  var init_engine_fonts = __esm({
38664
38850
  "src/core/utils/smartart-engine/engine-fonts.ts"() {
38665
38851
  init_smartart_layout_item_font_size();
@@ -38667,7 +38853,7 @@ var init_engine_fonts = __esm({
38667
38853
  init_move_with_merge();
38668
38854
  init_node_text();
38669
38855
  init_text_measure();
38670
- PX_PER_PT3 = 96 / 72;
38856
+ PX_PER_PT4 = 96 / 72;
38671
38857
  }
38672
38858
  });
38673
38859
  function transitionLabelOf(node) {
@@ -38697,24 +38883,6 @@ var init_render_filter = __esm({
38697
38883
  "src/core/utils/smartart-engine/render-filter.ts"() {
38698
38884
  }
38699
38885
  });
38700
- function shapeTransform(node) {
38701
- const box = node.box;
38702
- if (!box) {
38703
- return void 0;
38704
- }
38705
- const rotation = (((node.shape?.rot ?? 0) + node.rotation) % 360 + 360) % 360;
38706
- const quarter = Math.round((node.shape?.rot ?? 0) / 90);
38707
- if (Math.abs(quarter) % 2 === 1 && Math.abs((node.shape?.rot ?? 0) - quarter * 90) < 1e-6) {
38708
- const cx = box.x + box.w / 2;
38709
- const cy = box.y + box.h / 2;
38710
- return { x: cx - box.h / 2, y: cy - box.w / 2, w: box.h, h: box.w, rotation };
38711
- }
38712
- return { ...box, rotation };
38713
- }
38714
- var init_shape_transform = __esm({
38715
- "src/core/utils/smartart-engine/shape-transform.ts"() {
38716
- }
38717
- });
38718
38886
  function isFullySupported(root) {
38719
38887
  let ok = true;
38720
38888
  const visit = (node) => {
@@ -38741,10 +38909,10 @@ function buildRenderedNode(node, index, nodeById, palette, style, mergedSourceId
38741
38909
  const hidden = Boolean(node.shape?.hideGeom);
38742
38910
  const text22 = primary?.text ?? literalText ?? "";
38743
38911
  const sw = hidden ? 0 : styleStroke(style);
38744
- const x = transform6.x * PX_PER_PT4;
38745
- const y = transform6.y * PX_PER_PT4;
38746
- const width = transform6.w * PX_PER_PT4;
38747
- const height = transform6.h * PX_PER_PT4;
38912
+ const x = transform6.x * PX_PER_PT5;
38913
+ const y = transform6.y * PX_PER_PT5;
38914
+ const width = transform6.w * PX_PER_PT5;
38915
+ const height = transform6.h * PX_PER_PT5;
38748
38916
  const foldedNodeIds = [
38749
38917
  ...sourceIds.slice(1),
38750
38918
  ...(mergedSourceIds ?? []).filter((id) => !sourceIds.includes(id))
@@ -38771,15 +38939,23 @@ function buildRenderedNode(node, index, nodeById, palette, style, mergedSourceId
38771
38939
  rotation: transform6.rotation === 0 ? void 0 : transform6.rotation,
38772
38940
  presetOverride: node.shape?.type ?? "roundRect",
38773
38941
  foldedNodeIds: foldedNodeIds.length > 0 ? foldedNodeIds : void 0,
38774
- literalText
38942
+ literalText,
38943
+ styleLabel: engineStyleLabel(node)
38775
38944
  };
38776
38945
  }
38777
- function collectRenderedNodes(root, nodeById, palette, style) {
38946
+ function collectRenderedNodes(root, nodeById, palette, style, roleColors) {
38778
38947
  const out = [];
38948
+ const connectors2 = [];
38779
38949
  const visitSiblings = (siblings) => {
38780
38950
  const { extraIdsByTarget, suppressed, carrierByTarget } = computeMoveWithMerge(siblings);
38781
38951
  for (const node of siblings) {
38782
- if (node.alg.type !== "conn" && !suppressed.has(node)) {
38952
+ if (node.alg.type === "conn") {
38953
+ const index = out.length + connectors2.length;
38954
+ const arrow = buildConnectorNode(node, index, connectors2.length, palette, roleColors);
38955
+ if (arrow) {
38956
+ connectors2.push(arrow);
38957
+ }
38958
+ } else if (!suppressed.has(node)) {
38783
38959
  const mergedIds = extraIdsByTarget.get(node.name);
38784
38960
  const rendered = buildRenderedNode(node, out.length, nodeById, palette, style, mergedIds);
38785
38961
  if (rendered) {
@@ -38792,7 +38968,7 @@ function collectRenderedNodes(root, nodeById, palette, style) {
38792
38968
  }
38793
38969
  };
38794
38970
  visitSiblings([root]);
38795
- return out;
38971
+ return { collected: out, connectors: connectors2 };
38796
38972
  }
38797
38973
  function isFiniteGeometry(node) {
38798
38974
  return Number.isFinite(node.x) && Number.isFinite(node.y) && Number.isFinite(node.width) && Number.isFinite(node.height) && node.width > 0 && node.height > 0;
@@ -38820,9 +38996,15 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
38820
38996
  if (!run || !isFullySupported(run.root)) {
38821
38997
  return void 0;
38822
38998
  }
38823
- const collected = collectRenderedNodes(run.root, nodeById, palette, style);
38999
+ const { collected, connectors: connectors2 } = collectRenderedNodes(
39000
+ run.root,
39001
+ nodeById,
39002
+ palette,
39003
+ style,
39004
+ smartArtData.colorTransform?.roleColors
39005
+ );
38824
39006
  applyEngineFonts(collected, nodeById, smartArtData.themeMinorFont);
38825
- const rendered = collected.map((entry5) => entry5.rendered);
39007
+ const rendered = [...collected.map((entry5) => entry5.rendered), ...connectors2];
38826
39008
  if (rendered.length === 0 || !rendered.every(isFiniteGeometry)) {
38827
39009
  return void 0;
38828
39010
  }
@@ -38836,18 +39018,20 @@ function runEngineLayout(smartArtData, containerBounds, nodes, palette, style) {
38836
39018
  }
38837
39019
  var SUPPORTED_ALGS;
38838
39020
  var PT_PER_PX;
38839
- var PX_PER_PT4;
39021
+ var PX_PER_PT5;
38840
39022
  var init_engine_to_result = __esm({
38841
39023
  "src/core/utils/smartart-engine/engine-to-result.ts"() {
38842
39024
  init_smartart_layout_item_font_size();
38843
39025
  init_smartart_layout_style_helpers();
38844
39026
  init_alg_hier();
39027
+ init_connector_shape();
38845
39028
  init_engine();
38846
39029
  init_engine_fonts();
38847
39030
  init_move_with_merge();
38848
39031
  init_node_text();
38849
39032
  init_render_filter();
38850
39033
  init_shape_transform();
39034
+ init_style_label();
38851
39035
  init_text_measure();
38852
39036
  SUPPORTED_ALGS = /* @__PURE__ */ new Set([
38853
39037
  "composite",
@@ -38862,7 +39046,22 @@ var init_engine_to_result = __esm({
38862
39046
  "tx"
38863
39047
  ]);
38864
39048
  PT_PER_PX = 72 / 96;
38865
- PX_PER_PT4 = 1 / PT_PER_PX;
39049
+ PX_PER_PT5 = 1 / PT_PER_PX;
39050
+ }
39051
+ });
39052
+ function tagSmartArtElementStyleLabel(element, label) {
39053
+ if (label) {
39054
+ styleLabels.set(element, label);
39055
+ }
39056
+ return element;
39057
+ }
39058
+ function smartArtElementStyleLabel(element) {
39059
+ return styleLabels.get(element);
39060
+ }
39061
+ var styleLabels;
39062
+ var init_smartart_element_style_label = __esm({
39063
+ "src/core/utils/smartart-element-style-label.ts"() {
39064
+ styleLabels = /* @__PURE__ */ new WeakMap();
38866
39065
  }
38867
39066
  });
38868
39067
  function accentColor(index, themeColorMap) {
@@ -39785,8 +39984,8 @@ function parseParagraphLevel(pPr) {
39785
39984
  if (!pPr) {
39786
39985
  return 0;
39787
39986
  }
39788
- const level = Number.parseInt(String(pPr["@_lvl"] || "0"), 10);
39789
- return Number.isFinite(level) ? Math.min(Math.max(level, 0), 8) : 0;
39987
+ const level2 = Number.parseInt(String(pPr["@_lvl"] || "0"), 10);
39988
+ return Number.isFinite(level2) ? Math.min(Math.max(level2, 0), 8) : 0;
39790
39989
  }
39791
39990
  function parseParagraphExtraAttributes(pPr) {
39792
39991
  const result = {};
@@ -40160,12 +40359,12 @@ function paragraphStyle(paragraph, fallback) {
40160
40359
  }
40161
40360
  function paragraphMetadata(paragraph, paragraphIndex, bulletEnabled) {
40162
40361
  const pPr = paragraph.pPr;
40163
- const level = parseParagraphLevel(pPr);
40362
+ const level2 = parseParagraphLevel(pPr);
40164
40363
  const explicitBullet = parseBulletInfo(pPr, paragraphIndex) ?? void 0;
40165
- const bulletInfo = explicitBullet ?? (bulletEnabled && (level ?? 0) >= 1 ? { char: AUTO_BULLET_CHAR } : void 0);
40364
+ const bulletInfo = explicitBullet ?? (bulletEnabled && (level2 ?? 0) >= 1 ? { char: AUTO_BULLET_CHAR } : void 0);
40166
40365
  return {
40167
40366
  ...bulletInfo ? { bulletInfo } : {},
40168
- paragraphLevel: level,
40367
+ paragraphLevel: level2,
40169
40368
  ...paragraph.endParaRPr ? { endParaRunProperties: paragraph.endParaRPr } : {}
40170
40369
  };
40171
40370
  }
@@ -40402,10 +40601,12 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40402
40601
  fontSize,
40403
40602
  fontColor: rendered.fontColor ?? "#FFFFFF",
40404
40603
  textSegments,
40405
- rotation: rendered.rotation
40604
+ rotation: rendered.rotation,
40605
+ ...rendered.shapeAdjustments ? { shapeAdjustments: rendered.shapeAdjustments } : {}
40406
40606
  };
40607
+ const push2 = (element) => elements2.push(tagSmartArtElementStyleLabel(element, rendered.styleLabel));
40407
40608
  if (rendered.kind === "rect") {
40408
- elements2.push(
40609
+ push2(
40409
40610
  makeShapeElement(
40410
40611
  id,
40411
40612
  containerBounds.x + rendered.x,
@@ -40426,7 +40627,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40426
40627
  } else if (rendered.kind === "circle") {
40427
40628
  const halfWidth = rendered.rx ?? rendered.r;
40428
40629
  const halfHeight = rendered.ry ?? rendered.r;
40429
- elements2.push(
40630
+ push2(
40430
40631
  makeShapeElement(
40431
40632
  id,
40432
40633
  containerBounds.x + rendered.cx - halfWidth,
@@ -40446,7 +40647,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40446
40647
  );
40447
40648
  } else {
40448
40649
  const bbox = polygonBoundingBox(rendered.points);
40449
- elements2.push(
40650
+ push2(
40450
40651
  makeShapeElement(
40451
40652
  id,
40452
40653
  containerBounds.x + bbox.x,
@@ -40465,6 +40666,7 @@ function interpretedLayoutToElements(result, nodes, containerBounds, bulletEnabl
40465
40666
  }
40466
40667
  var init_smartart_interpreter_drawing_bridge = __esm({
40467
40668
  "src/core/utils/smartart-interpreter-drawing-bridge.ts"() {
40669
+ init_smartart_element_style_label();
40468
40670
  init_smartart_helpers();
40469
40671
  init_smartart_interpreter_fold_text();
40470
40672
  init_smartart_node_tree_axis();
@@ -41336,8 +41538,8 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
41336
41538
  const proportional = proportionalMarginFraction(index, role);
41337
41539
  const lineSpacingFactor = SMARTART_LINE_SPACING_FACTOR;
41338
41540
  const fitsAtPoint = (rootPt2) => {
41339
- const rootPx = rootPt2 * PX_PER_PT5;
41340
- const descendantPx = Math.round(rootPt2 * SMARTART_DESCENDANT_FONT_SCALE) * PX_PER_PT5;
41541
+ const rootPx = rootPt2 * PX_PER_PT6;
41542
+ const descendantPx = Math.round(rootPt2 * SMARTART_DESCENDANT_FONT_SCALE) * PX_PER_PT6;
41341
41543
  const margins = proportional ? { horizontal: proportional.horizontal * rootPx, vertical: proportional.vertical * rootPx } : fixedMargins;
41342
41544
  for (const item3 of items) {
41343
41545
  const naturalHeight = typeof naturalAspect === "number" ? Math.min(item3.height, item3.width * naturalAspect) : item3.height;
@@ -41359,8 +41561,8 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
41359
41561
  }
41360
41562
  return true;
41361
41563
  };
41362
- const ceilingPt = Math.max(1, Math.floor(ceilingPx / PX_PER_PT5 + 1e-9));
41363
- const floorPt = Math.min(ceilingPt, Math.max(1, Math.ceil(floorPx / PX_PER_PT5 - 1e-9)));
41564
+ const ceilingPt = Math.max(1, Math.floor(ceilingPx / PX_PER_PT6 + 1e-9));
41565
+ const floorPt = Math.min(ceilingPt, Math.max(1, Math.ceil(floorPx / PX_PER_PT6 - 1e-9)));
41364
41566
  let rootPt = floorPt;
41365
41567
  for (let candidate = ceilingPt; candidate > floorPt; candidate--) {
41366
41568
  if (fitsAtPoint(candidate)) {
@@ -41368,12 +41570,12 @@ function resolveTieredItemFontSize(plan, index, items, fontName, naturalAspect,
41368
41570
  break;
41369
41571
  }
41370
41572
  }
41371
- const rootSizePx = rootPt * PX_PER_PT5;
41573
+ const rootSizePx = rootPt * PX_PER_PT6;
41372
41574
  const descendantSizePx = snapToWholePoint(rootSizePx * SMARTART_DESCENDANT_FONT_SCALE);
41373
41575
  return { rootSizePx, descendantSizePx };
41374
41576
  }
41375
41577
  var SMARTART_DESCENDANT_FONT_SCALE;
41376
- var PX_PER_PT5;
41578
+ var PX_PER_PT6;
41377
41579
  var init_smartart_layout_item_font_tier = __esm({
41378
41580
  "src/core/utils/smartart-layout-item-font-tier.ts"() {
41379
41581
  init_smartart_layout_item_font_role();
@@ -41381,7 +41583,7 @@ var init_smartart_layout_item_font_tier = __esm({
41381
41583
  init_smartart_layout_item_font_tier_fit();
41382
41584
  init_smartart_text_wrap_fit();
41383
41585
  SMARTART_DESCENDANT_FONT_SCALE = 0.78;
41384
- PX_PER_PT5 = 96 / 72;
41586
+ PX_PER_PT6 = 96 / 72;
41385
41587
  }
41386
41588
  });
41387
41589
  function resolveCycleFontFit(plan, index, ringNodes, hubNode, ringNodeWidth, ringNodeHeight, hubWidth, hubHeight, cornerInsetPx, childrenOf, fontName) {
@@ -42668,7 +42870,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
42668
42870
  }
42669
42871
  }
42670
42872
  const roots = nodes.filter((n) => !childIds.has(n.id));
42671
- const depthOf = /* @__PURE__ */ new Map();
42873
+ const depthOf2 = /* @__PURE__ */ new Map();
42672
42874
  let maxDepth2 = 0;
42673
42875
  const depthStack = roots.map((r) => ({
42674
42876
  node: r,
@@ -42676,7 +42878,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
42676
42878
  }));
42677
42879
  while (depthStack.length > 0) {
42678
42880
  const { node, depth } = depthStack.pop();
42679
- depthOf.set(node.id, depth);
42881
+ depthOf2.set(node.id, depth);
42680
42882
  maxDepth2 = Math.max(maxDepth2, depth);
42681
42883
  for (const c of childrenIn(node)) {
42682
42884
  depthStack.push({ node: c, depth: depth + 1 });
@@ -42733,7 +42935,7 @@ function arrangeRecursiveTable(plan, nodes, box, palette, style, elementId, inde
42733
42935
  ({ node, x, width }, i2) => presetBoxNode({
42734
42936
  key: `${elementId}-lintbl-${node.id}-${i2}`,
42735
42937
  x,
42736
- y: rowY(depthOf.get(node.id) ?? 0),
42938
+ y: rowY(depthOf2.get(node.id) ?? 0),
42737
42939
  width,
42738
42940
  height: rowHeight,
42739
42941
  node,
@@ -44985,18 +45187,18 @@ function fanContinues(t, perRow, orgChart, siblingCount2, normalCount) {
44985
45187
  const spanW = effectiveWidth(t, orgChart);
44986
45188
  return chPrefFanEligible || isSoloChainLink && normalCount > 1 && spanW === normalCount;
44987
45189
  }
44988
- function walk2(t, level, perRow, orgChart, siblingCount2) {
45190
+ function walk2(t, level2, perRow, orgChart, siblingCount2) {
44989
45191
  const { normal } = partitionChildren(t, orgChart);
44990
45192
  if (normal.length === 0) {
44991
- return { deepestFanLevel: level, maxHangDepth: 0, maxHangRows: 0, hangingColumns: 0 };
45193
+ return { deepestFanLevel: level2, maxHangDepth: 0, maxHangRows: 0, hangingColumns: 0 };
44992
45194
  }
44993
- if (level === 0) {
44994
- let deepestFan = level;
45195
+ if (level2 === 0) {
45196
+ let deepestFan = level2;
44995
45197
  let maxHang = 0;
44996
45198
  let maxRows = 0;
44997
45199
  let hangingColumns = 0;
44998
45200
  for (const child262 of normal) {
44999
- const r = walk2(child262, level + 1, perRow, orgChart, normal.length);
45201
+ const r = walk2(child262, level2 + 1, perRow, orgChart, normal.length);
45000
45202
  deepestFan = Math.max(deepestFan, r.deepestFanLevel);
45001
45203
  maxHang = Math.max(maxHang, r.maxHangDepth);
45002
45204
  maxRows = Math.max(maxRows, r.maxHangRows);
@@ -45010,12 +45212,12 @@ function walk2(t, level, perRow, orgChart, siblingCount2) {
45010
45212
  };
45011
45213
  }
45012
45214
  if (fanContinues(t, perRow, orgChart, siblingCount2, normal.length)) {
45013
- let deepestFan = level + 1;
45215
+ let deepestFan = level2 + 1;
45014
45216
  let maxHang = 0;
45015
45217
  let maxRows = 0;
45016
45218
  let hangingColumns = 0;
45017
45219
  for (const child262 of normal) {
45018
- const r = walk2(child262, level + 1, perRow, orgChart, void 0);
45220
+ const r = walk2(child262, level2 + 1, perRow, orgChart, void 0);
45019
45221
  deepestFan = Math.max(deepestFan, r.deepestFanLevel);
45020
45222
  maxHang = Math.max(maxHang, r.maxHangDepth);
45021
45223
  maxRows = Math.max(maxRows, r.maxHangRows);
@@ -45029,7 +45231,7 @@ function walk2(t, level, perRow, orgChart, siblingCount2) {
45029
45231
  };
45030
45232
  }
45031
45233
  return {
45032
- deepestFanLevel: level,
45234
+ deepestFanLevel: level2,
45033
45235
  maxHangDepth: treeDepth(t) - 1,
45034
45236
  maxHangRows: countDescendants(t, orgChart),
45035
45237
  hangingColumns: 1
@@ -45072,20 +45274,20 @@ var init_smartart_hierarchy_hang_depth = __esm({
45072
45274
  init_smartart_hierarchy_orgchart_tree();
45073
45275
  }
45074
45276
  });
45075
- function widthWalk(t, level, perRow, orgChart, siblingCount2, map) {
45277
+ function widthWalk(t, level2, perRow, orgChart, siblingCount2, map) {
45076
45278
  const { normal } = partitionChildren(t, orgChart);
45077
45279
  let width;
45078
45280
  if (normal.length === 0) {
45079
45281
  width = 1;
45080
- } else if (level === 0) {
45282
+ } else if (level2 === 0) {
45081
45283
  width = 0;
45082
45284
  for (const child262 of normal) {
45083
- width += widthWalk(child262, level + 1, perRow, orgChart, normal.length, map);
45285
+ width += widthWalk(child262, level2 + 1, perRow, orgChart, normal.length, map);
45084
45286
  }
45085
45287
  } else if (fanContinues(t, perRow, orgChart, siblingCount2, normal.length)) {
45086
45288
  width = 0;
45087
45289
  for (const child262 of normal) {
45088
- width += widthWalk(child262, level + 1, perRow, orgChart, void 0, map);
45290
+ width += widthWalk(child262, level2 + 1, perRow, orgChart, void 0, map);
45089
45291
  }
45090
45292
  } else {
45091
45293
  width = 1;
@@ -45327,7 +45529,7 @@ function placeAssistants(hc, x, parentBottom, assistants, options, cursor) {
45327
45529
  stubConnector(hc, assistant.node.id, x + hc.boxH / 2, parentBottom, x + width / 2, y);
45328
45530
  }
45329
45531
  }
45330
- function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
45532
+ function placeHangingTree(hc, t, x, options, cursor, size, level2 = 0) {
45331
45533
  const y = cursor.y;
45332
45534
  const boxW = size?.w ?? hc.boxW;
45333
45535
  const boxH = size?.h ?? hc.boxH;
@@ -45340,7 +45542,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
45340
45542
  if (normal.length === 0) {
45341
45543
  return;
45342
45544
  }
45343
- if (options.foldDeeperGenerations && level >= 1) {
45545
+ if (options.foldDeeperGenerations && level2 >= 1) {
45344
45546
  return;
45345
45547
  }
45346
45548
  const childX = align ? placeX : options.direction === "left" ? x - options.indent : x + options.indent;
@@ -45355,7 +45557,7 @@ function placeHangingTree(hc, t, x, options, cursor, size, level = 0) {
45355
45557
  childY,
45356
45558
  child262.node.id
45357
45559
  );
45358
- placeHangingTree(hc, child262, childX, options, cursor, void 0, level + 1);
45560
+ placeHangingTree(hc, child262, childX, options, cursor, void 0, level2 + 1);
45359
45561
  }
45360
45562
  }
45361
45563
  function placeHangingForest(hc, roots, startX, startY, options, rootSize) {
@@ -45440,17 +45642,17 @@ var init_smartart_hierarchy_hanging_box = __esm({
45440
45642
  DEFAULT_HANGING_VGAP_RATIO = 0.55;
45441
45643
  }
45442
45644
  });
45443
- function countRows(t, level, orgChart, fold) {
45645
+ function countRows(t, level2, orgChart, fold) {
45444
45646
  const { assistants, normal } = partitionChildren(t, orgChart);
45445
45647
  let count = 1 + assistants.length;
45446
45648
  if (normal.length === 0) {
45447
45649
  return count;
45448
45650
  }
45449
- if (fold && level >= 1) {
45651
+ if (fold && level2 >= 1) {
45450
45652
  return count;
45451
45653
  }
45452
45654
  for (const child262 of normal) {
45453
- count += countRows(child262, level + 1, orgChart, fold);
45655
+ count += countRows(child262, level2 + 1, orgChart, fold);
45454
45656
  }
45455
45657
  return count;
45456
45658
  }
@@ -46086,8 +46288,8 @@ function planFan(childCount, perRow, siblingCxs) {
46086
46288
  }
46087
46289
  return { columns: siblingCxs, overflow: childCount - siblingCxs.length };
46088
46290
  }
46089
- function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, options, placeAtFn) {
46090
- const fanCy = (level + 1) * cellH + cellH / 2;
46291
+ function placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, options, placeAtFn) {
46292
+ const fanCy = (level2 + 1) * cellH + cellH / 2;
46091
46293
  const fanned = normal.slice(0, plan.columns.length);
46092
46294
  for (let i2 = 0; i2 < fanned.length; i2++) {
46093
46295
  const child262 = fanned[i2];
@@ -46101,7 +46303,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, option
46101
46303
  fanCy - hc.boxH / 2,
46102
46304
  child262.node.id
46103
46305
  );
46104
- placeAtFn(hc, child262, childCx, fanCy, 0, 1, level + 1, cellW, cellH, options);
46306
+ placeAtFn(hc, child262, childCx, fanCy, 0, 1, level2 + 1, cellW, cellH, options);
46105
46307
  }
46106
46308
  if (plan.overflow <= 0 || !options.hangingPlacer) {
46107
46309
  return;
@@ -46109,7 +46311,7 @@ function placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, option
46109
46311
  const remainder = normal.slice(plan.columns.length);
46110
46312
  const columnOffset = hc.boxW * HIER_TAIL_OFFSET_RATIO;
46111
46313
  const anchorX = plan.columns[0] - hc.boxW / 2 + columnOffset;
46112
- const anchorY = (level + 2) * cellH;
46314
+ const anchorY = (level2 + 2) * cellH;
46113
46315
  for (const child262 of remainder) {
46114
46316
  elbowConnector(
46115
46317
  hc,
@@ -46151,7 +46353,7 @@ function placeAssistantRow(hc, parentId, cx, cy, assistants) {
46151
46353
  x += assistW + ASSISTANT_GAP;
46152
46354
  }
46153
46355
  }
46154
- function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW, cellH, options, placeChild) {
46356
+ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level2, cellW, cellH, options, placeChild) {
46155
46357
  const siblingCxs = [];
46156
46358
  {
46157
46359
  let offset = xOffset;
@@ -46161,12 +46363,12 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW,
46161
46363
  offset += childW;
46162
46364
  }
46163
46365
  }
46164
- const cascadeShift = options.cascadeOffsetX && level + 1 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46366
+ const cascadeShift = options.cascadeOffsetX && level2 + 1 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46165
46367
  let childOffset = xOffset;
46166
46368
  for (const child262 of normal) {
46167
46369
  const childW = spanOf(child262, options);
46168
46370
  const childCx = (childOffset + childW / 2) * cellW + cascadeShift;
46169
- const childCy = (level + 1) * cellH + cellH / 2;
46371
+ const childCy = (level2 + 1) * cellH + cellH / 2;
46170
46372
  elbowConnector(
46171
46373
  hc,
46172
46374
  parentId,
@@ -46183,7 +46385,7 @@ function placeFlatChildren(hc, parentId, normal, cx, cy, xOffset, level, cellW,
46183
46385
  childCy,
46184
46386
  childOffset,
46185
46387
  childW,
46186
- level + 1,
46388
+ level2 + 1,
46187
46389
  cellW,
46188
46390
  cellH,
46189
46391
  options,
@@ -46215,13 +46417,13 @@ function wrappedGroupSlotCount(group2, orgChart) {
46215
46417
  }
46216
46418
  return group2.members.reduce((sum, m) => sum + effectiveWidth(m, orgChart), 0);
46217
46419
  }
46218
- function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, level, cellW, cellH, options, placeAtFn) {
46420
+ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, level2, cellW, cellH, options, placeAtFn) {
46219
46421
  const groups = planWrappedGroups(normal, options.perRow, options.orgChart);
46220
46422
  const totalSlots = groups.reduce((sum, g2) => sum + wrappedGroupSlotCount(g2, options.orgChart), 0);
46221
46423
  const totalW = spanW * cellW;
46222
46424
  const leftX = xOffset * cellW;
46223
46425
  const unitW = totalW / Math.max(1, totalSlots);
46224
- const rowCy = (level + 1) * cellH + cellH / 2;
46426
+ const rowCy = (level2 + 1) * cellH + cellH / 2;
46225
46427
  let slot = 0;
46226
46428
  for (const group2 of groups) {
46227
46429
  slot = group2.fansAsRow ? placeRowFanGroup(
@@ -46234,7 +46436,7 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
46234
46436
  unitW,
46235
46437
  slot,
46236
46438
  rowCy,
46237
- level,
46439
+ level2,
46238
46440
  cellW,
46239
46441
  cellH,
46240
46442
  options,
@@ -46251,25 +46453,25 @@ function placeWrappedChildren(hc, parentId, normal, cx, cy, xOffset, spanW, leve
46251
46453
  rowCy,
46252
46454
  cellW,
46253
46455
  cellH,
46254
- level,
46456
+ level2,
46255
46457
  options,
46256
46458
  placeAtFn
46257
46459
  );
46258
46460
  }
46259
46461
  }
46260
- function placeRowFanGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, level, cellW, cellH, options, placeAtFn) {
46462
+ function placeRowFanGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, level2, cellW, cellH, options, placeAtFn) {
46261
46463
  let cursor = slot;
46262
46464
  for (const child262 of group2.members) {
46263
46465
  const childW = effectiveWidth(child262, options.orgChart);
46264
46466
  const childCx = leftX + unitW * (cursor + childW / 2);
46265
46467
  elbowConnector(hc, parentId, cx, cy + hc.boxH / 2, childCx, rowCy - hc.boxH / 2, child262.node.id);
46266
46468
  const virtualOffset = childCx / cellW - childW / 2;
46267
- placeAtFn(hc, child262, childCx, rowCy, virtualOffset, childW, level + 1, cellW, cellH, options);
46469
+ placeAtFn(hc, child262, childCx, rowCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
46268
46470
  cursor += childW;
46269
46471
  }
46270
46472
  return cursor;
46271
46473
  }
46272
- function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, cellW, cellH, level, options, placeAtFn) {
46474
+ function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowCy, cellW, cellH, level2, options, placeAtFn) {
46273
46475
  const groupCx = leftX + unitW * (slot + 0.5);
46274
46476
  const subRowH = cellH / group2.members.length;
46275
46477
  let fromId = parentId;
@@ -46281,7 +46483,7 @@ function placeColumnGroup(hc, parentId, group2, cx, cy, leftX, unitW, slot, rowC
46281
46483
  elbowConnector(hc, fromId, fromX, fromY, groupCx, childCy - hc.boxH / 2, child262.node.id);
46282
46484
  const childW = effectiveWidth(child262, options.orgChart);
46283
46485
  const virtualOffset = groupCx / cellW - childW / 2;
46284
- placeAtFn(hc, child262, groupCx, childCy, virtualOffset, childW, level + 1, cellW, cellH, options);
46486
+ placeAtFn(hc, child262, groupCx, childCy, virtualOffset, childW, level2 + 1, cellW, cellH, options);
46285
46487
  fromId = child262.node.id;
46286
46488
  fromX = groupCx;
46287
46489
  fromY = childCy + hc.boxH / 2;
@@ -46294,7 +46496,7 @@ var init_smartart_hierarchy_wrapped_groups = __esm({
46294
46496
  init_smartart_hierarchy_shared();
46295
46497
  }
46296
46498
  });
46297
- function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level, cellW, cellH, options) {
46499
+ function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level2, cellW, cellH, options) {
46298
46500
  placeFlatChildren(
46299
46501
  hc,
46300
46502
  parentId,
@@ -46302,14 +46504,14 @@ function placeFlatChildren2(hc, parentId, normal, cx, cy, xOffset, level, cellW,
46302
46504
  cx,
46303
46505
  cy,
46304
46506
  xOffset,
46305
- level,
46507
+ level2,
46306
46508
  cellW,
46307
46509
  cellH,
46308
46510
  options,
46309
46511
  placeAt
46310
46512
  );
46311
46513
  }
46312
- function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, level, cellW, cellH, options) {
46514
+ function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, level2, cellW, cellH, options) {
46313
46515
  placeWrappedChildren(
46314
46516
  hc,
46315
46517
  parentId,
@@ -46318,32 +46520,32 @@ function placeWrappedChildren2(hc, parentId, normal, cx, cy, xOffset, spanW, lev
46318
46520
  cy,
46319
46521
  xOffset,
46320
46522
  spanW,
46321
- level,
46523
+ level2,
46322
46524
  cellW,
46323
46525
  cellH,
46324
46526
  options,
46325
46527
  placeAt
46326
46528
  );
46327
46529
  }
46328
- function placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options, siblingCxs) {
46530
+ function placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options, siblingCxs) {
46329
46531
  pushNode(hc, t.node, cx - hc.boxW / 2, cy - hc.boxH / 2);
46330
46532
  const { assistants, normal } = partitionChildren(t, options.orgChart);
46331
46533
  placeAssistantRow(hc, t.node.id, cx, cy, assistants);
46332
46534
  if (normal.length === 0) {
46333
46535
  return;
46334
46536
  }
46335
- if (options.foldDeeperGenerations && level >= 1) {
46537
+ if (options.foldDeeperGenerations && level2 >= 1) {
46336
46538
  return;
46337
46539
  }
46338
- if (options.hangingPlacer && level >= 1) {
46540
+ if (options.hangingPlacer && level2 >= 1) {
46339
46541
  const plan = planFan(normal.length, options.perRow, siblingCxs);
46340
46542
  if (plan) {
46341
- placeFannedRow(hc, t, normal, plan, cx, cy, level, cellW, cellH, options, placeAt);
46543
+ placeFannedRow(hc, t, normal, plan, cx, cy, level2, cellW, cellH, options, placeAt);
46342
46544
  return;
46343
46545
  }
46344
46546
  const isSoloChainLink = !siblingCxs || siblingCxs.length === 1;
46345
46547
  if (isSoloChainLink && normal.length > 1 && spanW === normal.length) {
46346
- placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level, cellW, cellH, options);
46548
+ placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level2, cellW, cellH, options);
46347
46549
  return;
46348
46550
  }
46349
46551
  const anchorY = cy + hc.boxH / 2 + (options.hangHeightRatio ?? HANG_HEIGHT_RATIO) * hc.boxH;
@@ -46371,21 +46573,21 @@ function placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options, si
46371
46573
  cy,
46372
46574
  xOffset,
46373
46575
  spanW,
46374
- level,
46576
+ level2,
46375
46577
  cellW,
46376
46578
  cellH,
46377
46579
  options
46378
46580
  );
46379
46581
  } else {
46380
- placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level, cellW, cellH, options);
46582
+ placeFlatChildren2(hc, t.node.id, normal, cx, cy, xOffset, level2, cellW, cellH, options);
46381
46583
  }
46382
46584
  }
46383
- function placeStandardTree(hc, t, xOffset, level, cellW, cellH, options) {
46585
+ function placeStandardTree(hc, t, xOffset, level2, cellW, cellH, options) {
46384
46586
  const spanW = spanOf(t, options);
46385
- const cascadeShift = options.cascadeOffsetX && level >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46587
+ const cascadeShift = options.cascadeOffsetX && level2 >= options.cascadeOffsetX.fromLevel ? options.cascadeOffsetX.offsetPx : 0;
46386
46588
  const cx = (xOffset + spanW / 2) * cellW + cascadeShift;
46387
- const cy = level * cellH + cellH / 2;
46388
- placeAt(hc, t, cx, cy, xOffset, spanW, level, cellW, cellH, options);
46589
+ const cy = level2 * cellH + cellH / 2;
46590
+ placeAt(hc, t, cx, cy, xOffset, spanW, level2, cellW, cellH, options);
46389
46591
  }
46390
46592
  var init_smartart_hierarchy_standard = __esm({
46391
46593
  "src/core/utils/smartart-hierarchy-standard.ts"() {
@@ -48047,10 +48249,10 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
48047
48249
  const boxH = Math.min(cellH * 0.35, 28);
48048
48250
  const elements2 = [];
48049
48251
  let colourIdx = 0;
48050
- function walk3(t, xOffset, level) {
48252
+ function walk3(t, xOffset, level2) {
48051
48253
  const w = treeWidth(t);
48052
48254
  const cx = bounds.x + padding + (xOffset + w / 2) * cellW;
48053
- const cy = bounds.y + padding + level * cellH + cellH / 2;
48255
+ const cy = bounds.y + padding + level2 * cellH + cellH / 2;
48054
48256
  const ci = colourIdx++;
48055
48257
  const fill = accentColor(ci, themeColorMap);
48056
48258
  elements2.push(
@@ -48073,7 +48275,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
48073
48275
  for (const child262 of t.children) {
48074
48276
  const childW = treeWidth(child262);
48075
48277
  const childCx = bounds.x + padding + (childOffset + childW / 2) * cellW;
48076
- const childCy = bounds.y + padding + (level + 1) * cellH + cellH / 2;
48278
+ const childCy = bounds.y + padding + (level2 + 1) * cellH + cellH / 2;
48077
48279
  elements2.push(
48078
48280
  makeConnectorElement(
48079
48281
  nextId("sa-hier-conn"),
@@ -48084,7 +48286,7 @@ function layoutHierarchy(nodes, bounds, themeColorMap) {
48084
48286
  lighten(fill, 0.5)
48085
48287
  )
48086
48288
  );
48087
- walk3(child262, childOffset, level + 1);
48289
+ walk3(child262, childOffset, level2 + 1);
48088
48290
  childOffset += childW;
48089
48291
  }
48090
48292
  return w;
@@ -49069,10 +49271,15 @@ function buildSmartArtColorRoleMap(styleLbls, deps) {
49069
49271
  const map = {};
49070
49272
  for (const lbl of styleLbls) {
49071
49273
  const parsed = parseLabel(lbl, deps);
49072
- if (!parsed.name || parsed.fill.length === 0 && parsed.line.length === 0) {
49274
+ const hasText = parsed.textFill.length > 0;
49275
+ if (!parsed.name || parsed.fill.length === 0 && parsed.line.length === 0 && !hasText) {
49073
49276
  continue;
49074
49277
  }
49075
- map[parsed.name] = { fill: parsed.fill, line: parsed.line };
49278
+ map[parsed.name] = {
49279
+ fill: parsed.fill,
49280
+ line: parsed.line,
49281
+ ...hasText ? { textFill: parsed.textFill } : {}
49282
+ };
49076
49283
  }
49077
49284
  return map;
49078
49285
  }
@@ -55167,10 +55374,10 @@ function parseCxRegionMapOptions(series, dataNode, xmlLookup, colorParser) {
55167
55374
  }
55168
55375
  function readIndexedDimension(dataNode, kind, type, xmlLookup) {
55169
55376
  const dimension = xmlLookup.getChildrenArrayByLocalName(dataNode, kind).find((candidate) => String(candidate["@_type"] ?? "") === type);
55170
- const level = xmlLookup.getChildByLocalName(dimension, "lvl");
55377
+ const level2 = xmlLookup.getChildByLocalName(dimension, "lvl");
55171
55378
  const values = [];
55172
55379
  const indices = [];
55173
- for (const [position2, point] of xmlLookup.getChildrenArrayByLocalName(level, "pt").entries()) {
55380
+ for (const [position2, point] of xmlLookup.getChildrenArrayByLocalName(level2, "pt").entries()) {
55174
55381
  const raw = xmlLookup.getScalarChildByLocalName(point, "v") ?? point["#text"];
55175
55382
  values.push(String(raw ?? "").trim());
55176
55383
  const parsed = Number.parseInt(String(point["@_idx"] ?? position2), 10);
@@ -55307,7 +55514,7 @@ function parseCxChartSeries(plotArea, xmlLookup, chartSpace, chartRoot, colorPar
55307
55514
  if (serIndex === 0) {
55308
55515
  const catDimLevels = strDims.get("cat") ?? strDims.values().next().value;
55309
55516
  if (catDimLevels) {
55310
- categoryLevels = catDimLevels.map((level) => [...level]);
55517
+ categoryLevels = catDimLevels.map((level2) => [...level2]);
55311
55518
  for (const val2 of catDimLevels[0] ?? []) {
55312
55519
  if (val2) {
55313
55520
  categories.push(val2);
@@ -63935,6 +64142,10 @@ function buildFabricatedDrawingXml(shapes, nodes, presentationGuidByNodeId) {
63935
64142
  return `${XML_PROLOG}\r
63936
64143
  <dsp:drawing ${DSP_XMLNS}><dsp:spTree><dsp:nvGrpSpPr><dsp:cNvPr id="0" name=""/><dsp:cNvGrpSpPr/></dsp:nvGrpSpPr><dsp:grpSpPr/>${body}</dsp:spTree></dsp:drawing>`;
63937
64144
  }
64145
+ function withStyleLabel(element) {
64146
+ const styleLabel = smartArtElementStyleLabel(element);
64147
+ return styleLabel ? { styleLabel } : {};
64148
+ }
63938
64149
  function smartArtElementsToDrawingShapes(elements2) {
63939
64150
  if (!elements2 || elements2.length === 0) {
63940
64151
  return [];
@@ -63977,7 +64188,8 @@ function smartArtElementsToDrawingShapes(elements2) {
63977
64188
  fontColor: shape.textStyle?.color,
63978
64189
  ...shape.shapeStyle?.scene3d ? { scene3d: shape.shapeStyle.scene3d } : {},
63979
64190
  ...shape.shapeStyle?.shape3d ? { shape3d: shape.shapeStyle.shape3d } : {},
63980
- ...shape.textStyle?.text3d ? { text3d: shape.textStyle.text3d } : {}
64191
+ ...shape.textStyle?.text3d ? { text3d: shape.textStyle.text3d } : {},
64192
+ ...withStyleLabel(el)
63981
64193
  });
63982
64194
  }
63983
64195
  return shapes;
@@ -63992,6 +64204,7 @@ var init_smartart_fabrication_drawing = __esm({
63992
64204
  init_constants();
63993
64205
  init_custom_geometry();
63994
64206
  init_custom_geometry_command_order();
64207
+ init_smartart_element_style_label();
63995
64208
  init_smartart_fabrication_3d();
63996
64209
  init_smartart_fabrication_data();
63997
64210
  init_smartart_fabrication_text();
@@ -64063,6 +64276,10 @@ function applySmartArtQuickStyle3d(shapes, data) {
64063
64276
  const nodeLabels = resolveNodeLabels(data.nodes);
64064
64277
  const fallback = labelsByName.get(PRIMARY_STYLE_LABEL) ?? labelsByName.get(nodeLabels.values().next().value ?? "");
64065
64278
  return shapes.map((shape) => {
64279
+ const own = shape.styleLabel ? labelsByName.get(shape.styleLabel) : void 0;
64280
+ if (own || shape.styleLabel) {
64281
+ return own ? withLabel3d(shape, own) : shape;
64282
+ }
64066
64283
  const nodeId = nodeIdForShape(shape.id, data.nodes);
64067
64284
  const labelName = nodeId ? nodeLabels.get(nodeId) : void 0;
64068
64285
  const label = (labelName ? labelsByName.get(labelName) : void 0) ?? fallback;
@@ -68715,17 +68932,17 @@ var init_placeholder_level_style_serializer = __esm({
68715
68932
  FILL_VARIANTS = ["a:noFill", "a:gradFill", "a:blipFill", "a:pattFill", "a:grpFill"];
68716
68933
  }
68717
68934
  });
68718
- function levelXmlKey(level) {
68719
- return level === -1 ? "a:defPPr" : `a:lvl${level + 1}pPr`;
68935
+ function levelXmlKey(level2) {
68936
+ return level2 === -1 ? "a:defPPr" : `a:lvl${level2 + 1}pPr`;
68720
68937
  }
68721
68938
  function serializeTextStyleLevels(levels, existing) {
68722
68939
  const childEdits = /* @__PURE__ */ new Map();
68723
68940
  for (const [key2, style] of Object.entries(levels)) {
68724
- const level = Number(key2);
68725
- if (!Number.isFinite(level)) {
68941
+ const level2 = Number(key2);
68942
+ if (!Number.isFinite(level2)) {
68726
68943
  continue;
68727
68944
  }
68728
- const xmlKey = levelXmlKey(level);
68945
+ const xmlKey = levelXmlKey(level2);
68729
68946
  childEdits.set(
68730
68947
  xmlKey,
68731
68948
  serializePlaceholderLevelStyle(style, existing?.[xmlKey])
@@ -78106,10 +78323,10 @@ function parseOleChartElement(shape) {
78106
78323
  if (!oleChartEl || oleChartEl["@_type"] === void 0) {
78107
78324
  return void 0;
78108
78325
  }
78109
- const level = oleChartEl["@_lvl"] !== void 0 ? Number(oleChartEl["@_lvl"]) : void 0;
78326
+ const level2 = oleChartEl["@_lvl"] !== void 0 ? Number(oleChartEl["@_lvl"]) : void 0;
78110
78327
  return {
78111
78328
  subelementType: String(oleChartEl["@_type"]),
78112
- ...level !== void 0 && !Number.isNaN(level) ? { level } : {}
78329
+ ...level2 !== void 0 && !Number.isNaN(level2) ? { level: level2 } : {}
78113
78330
  };
78114
78331
  }
78115
78332
  var init_animation_target_graphic_el = __esm({
@@ -78680,9 +78897,9 @@ function extractBldPTemplates(bldP) {
78680
78897
  continue;
78681
78898
  }
78682
78899
  const levelRaw = tmpl["@_lvl"];
78683
- const level = levelRaw !== void 0 ? Number.parseInt(String(levelRaw), 10) : 0;
78900
+ const level2 = levelRaw !== void 0 ? Number.parseInt(String(levelRaw), 10) : 0;
78684
78901
  result.push({
78685
- level: Number.isFinite(level) ? level : 0,
78902
+ level: Number.isFinite(level2) ? level2 : 0,
78686
78903
  timeNodeList: tnLst,
78687
78904
  rawXml: tmpl
78688
78905
  });
@@ -104459,6 +104676,113 @@ var init_chart_multi_level_category_parser = __esm({
104459
104676
  "src/core/utils/chart-multi-level-category-parser.ts"() {
104460
104677
  }
104461
104678
  });
104679
+ function prSetOf(pt2, localName292) {
104680
+ const key2 = Object.keys(pt2).find((candidate) => localName292(candidate) === "prSet");
104681
+ const value = key2 ? pt2[key2] : void 0;
104682
+ return Array.isArray(value) ? value[0] : value;
104683
+ }
104684
+ function readPresPoints(points4, localName292) {
104685
+ const byId = /* @__PURE__ */ new Map();
104686
+ for (const pt2 of points4) {
104687
+ if (!pt2 || typeof pt2 !== "object" || String(pt2["@_type"] ?? "").trim() !== "pres") {
104688
+ continue;
104689
+ }
104690
+ const id = String(pt2["@_modelId"] ?? "").trim();
104691
+ const prSet = prSetOf(pt2, localName292);
104692
+ if (!id || !prSet) {
104693
+ continue;
104694
+ }
104695
+ const styleIndex2 = Number(prSet["@_presStyleIdx"] ?? 0);
104696
+ byId.set(id, {
104697
+ id,
104698
+ name: String(prSet["@_presName"] ?? "").trim(),
104699
+ styleLabel: String(prSet["@_presStyleLbl"] ?? "").trim(),
104700
+ styleIndex: Number.isFinite(styleIndex2) && styleIndex2 > 0 ? Math.floor(styleIndex2) : 0,
104701
+ assocId: String(prSet["@_presAssocID"] ?? "").trim()
104702
+ });
104703
+ }
104704
+ return byId;
104705
+ }
104706
+ function algorithmByLayoutNodeName(root) {
104707
+ const byName = /* @__PURE__ */ new Map();
104708
+ const stack = root ? [root] : [];
104709
+ while (stack.length > 0) {
104710
+ const node = stack.pop();
104711
+ if (node.name && node.algorithm?.type && !byName.has(node.name)) {
104712
+ byName.set(node.name, node.algorithm.type);
104713
+ }
104714
+ stack.push(...node.children ?? []);
104715
+ }
104716
+ return byName;
104717
+ }
104718
+ function resolveSmartArtMergedTextLabels(points4, connections, layout, localName292) {
104719
+ const result = /* @__PURE__ */ new Map();
104720
+ const algorithms = algorithmByLayoutNodeName(layout?.rootNode);
104721
+ const presPoints = readPresPoints(points4, localName292);
104722
+ if (algorithms.size === 0 || presPoints.size === 0) {
104723
+ return result;
104724
+ }
104725
+ const presented = /* @__PURE__ */ new Set();
104726
+ const childrenByParent = /* @__PURE__ */ new Map();
104727
+ for (const connection of connections) {
104728
+ if (connection.type === "presOf") {
104729
+ presented.add(connection.destId);
104730
+ } else if (connection.type === "presParOf") {
104731
+ const siblings = childrenByParent.get(connection.sourceId) ?? [];
104732
+ siblings.push(connection.destId);
104733
+ childrenByParent.set(connection.sourceId, siblings);
104734
+ }
104735
+ }
104736
+ for (const siblingIds of childrenByParent.values()) {
104737
+ const siblings = siblingIds.map((id) => presPoints.get(id)).filter((pt2) => Boolean(pt2?.styleLabel && presented.has(pt2.id)));
104738
+ const texts = siblings.filter((pt2) => algorithms.get(pt2.name) === "tx");
104739
+ for (const shape of siblings) {
104740
+ if (algorithms.get(shape.name) === "tx" || result.has(shape.id)) {
104741
+ continue;
104742
+ }
104743
+ const text22 = texts.find(
104744
+ (pt2) => pt2.assocId === shape.assocId && pt2.styleLabel !== shape.styleLabel
104745
+ );
104746
+ if (text22) {
104747
+ result.set(shape.id, {
104748
+ styleLabel: text22.styleLabel,
104749
+ styleIndex: text22.styleIndex,
104750
+ textPointId: text22.id
104751
+ });
104752
+ }
104753
+ }
104754
+ }
104755
+ return result;
104756
+ }
104757
+ function smartArtMergedTextColor(label, textFillByLabel) {
104758
+ const list2 = textFillByLabel?.[label.styleLabel]?.textFill;
104759
+ if (!list2 || list2.length === 0) {
104760
+ return void 0;
104761
+ }
104762
+ return list2[label.styleIndex % list2.length];
104763
+ }
104764
+ function resolveSmartArtMergedTextColors(points4, connections, layout, textFillByLabel, localName292) {
104765
+ const colors = /* @__PURE__ */ new Map();
104766
+ if (!textFillByLabel) {
104767
+ return colors;
104768
+ }
104769
+ for (const [shapeId, label] of resolveSmartArtMergedTextLabels(
104770
+ points4,
104771
+ connections,
104772
+ layout,
104773
+ localName292
104774
+ )) {
104775
+ const color2 = smartArtMergedTextColor(label, textFillByLabel);
104776
+ if (color2) {
104777
+ colors.set(shapeId, color2);
104778
+ }
104779
+ }
104780
+ return colors;
104781
+ }
104782
+ var init_smartart_merged_text_label = __esm({
104783
+ "src/core/utils/smartart-merged-text-label.ts"() {
104784
+ }
104785
+ });
104462
104786
  function children12(node, name, localName292) {
104463
104787
  if (!node) {
104464
104788
  return [];
@@ -105958,21 +106282,21 @@ var init_text_body_has_content = __esm({
105958
106282
  function createAutoNumberSequence() {
105959
106283
  return { levels: /* @__PURE__ */ new Map() };
105960
106284
  }
105961
- function forgetFromLevel(sequence, level) {
106285
+ function forgetFromLevel(sequence, level2) {
105962
106286
  for (const recorded of sequence.levels.keys()) {
105963
- if (recorded >= level) {
106287
+ if (recorded >= level2) {
105964
106288
  sequence.levels.delete(recorded);
105965
106289
  }
105966
106290
  }
105967
106291
  }
105968
- function breakAutoNumberRun(sequence, level) {
105969
- forgetFromLevel(sequence, level);
106292
+ function breakAutoNumberRun(sequence, level2) {
106293
+ forgetFromLevel(sequence, level2);
105970
106294
  }
105971
- function nextAutoNumber(sequence, level, scheme, startAt) {
105972
- const running = sequence.levels.get(level);
106295
+ function nextAutoNumber(sequence, level2, scheme, startAt) {
106296
+ const running = sequence.levels.get(level2);
105973
106297
  const ordinal = running && running.scheme === scheme ? running.ordinal + 1 : startAt;
105974
- forgetFromLevel(sequence, level + 1);
105975
- sequence.levels.set(level, { scheme, ordinal });
106298
+ forgetFromLevel(sequence, level2 + 1);
106299
+ sequence.levels.set(level2, { scheme, ordinal });
105976
106300
  return ordinal;
105977
106301
  }
105978
106302
  var init_auto_number_sequence = __esm({
@@ -108683,7 +109007,7 @@ function masterStyleFonts(styles) {
108683
109007
  if (!styles) {
108684
109008
  return [];
108685
109009
  }
108686
- return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((level) => level.run.fontName).filter((name) => Boolean(name));
109010
+ return [styles.title, styles.body, styles.other].flatMap((levels) => levels ?? []).map((level2) => level2.run.fontName).filter((name) => Boolean(name));
108687
109011
  }
108688
109012
  var PPT_MASTER_LEVELS;
108689
109013
  var TITLE_LEVELS;
@@ -110369,8 +110693,8 @@ function textSpecInfo(count) {
110369
110693
  function promptText(textType, paragraphs2) {
110370
110694
  const text22 = paragraphs2.join("\r");
110371
110695
  const levels = new ByteWriter();
110372
- paragraphs2.forEach((para, level) => {
110373
- levels.u32(para.length + 1).u16(level);
110696
+ paragraphs2.forEach((para, level2) => {
110697
+ levels.u32(para.length + 1).u16(level2);
110374
110698
  });
110375
110699
  return new ByteWriter().bytes(textHeader(textType)).bytes(atom(RT.TextBytesAtom, new ByteWriter().ansi(text22).toBytes())).bytes(atom(RT.MasterTextPropAtom, levels.toBytes())).bytes(textSpecInfo(text22.length + 1)).toBytes();
110376
110700
  }
@@ -110536,9 +110860,9 @@ var init_master_placeholders_writer = __esm({
110536
110860
  });
110537
110861
  function buildMasterStyleAtom(recInstance, levels, fontIndex) {
110538
110862
  const w = new ByteWriter().u16(levels.length);
110539
- for (const level of levels) {
110540
- writePfException(w, level.paragraph);
110541
- writeCfException(w, level.run, fontIndex);
110863
+ for (const level2 of levels) {
110864
+ writePfException(w, level2.paragraph);
110865
+ writeCfException(w, level2.run, fontIndex);
110542
110866
  }
110543
110867
  return record(RT.TextMasterStyleAtom, w.toBytes(), recInstance, false, 0);
110544
110868
  }
@@ -111594,11 +111918,11 @@ function levelsFor(styles, textType) {
111594
111918
  return void 0;
111595
111919
  }
111596
111920
  }
111597
- function relativiseParagraph(para, level) {
111921
+ function relativiseParagraph(para, level2) {
111598
111922
  const runs = para.runs.map((run) => {
111599
111923
  const out = { ...run };
111600
111924
  for (const key2 of STYLE_KEYS) {
111601
- const inherited = level?.run[key2] ?? false;
111925
+ const inherited = level2?.run[key2] ?? false;
111602
111926
  if (out[key2] !== void 0 && out[key2] === inherited) {
111603
111927
  delete out[key2];
111604
111928
  }
@@ -112231,9 +112555,9 @@ function buildChartExData(chartData, series, id) {
112231
112555
  const stringDimensions = [
112232
112556
  {
112233
112557
  "@_type": "cat",
112234
- "cx:lvl": categoryLevels.map((level) => ({
112235
- "@_ptCount": String(level.length),
112236
- "cx:pt": chartData.chartType === "regionMap" && level === categoryLevels[0] ? indexedPoints(level, regionOptions?.categorySourceIndices) : points(level)
112558
+ "cx:lvl": categoryLevels.map((level2) => ({
112559
+ "@_ptCount": String(level2.length),
112560
+ "cx:pt": chartData.chartType === "regionMap" && level2 === categoryLevels[0] ? indexedPoints(level2, regionOptions?.categorySourceIndices) : points(level2)
112237
112561
  }))
112238
112562
  }
112239
112563
  ];
@@ -115826,10 +116150,10 @@ function replaceLevels(target, source, getLocalName2) {
115826
116150
  const targetKey = findKey26(target, "lvl", getLocalName2) ?? "cx:lvl";
115827
116151
  const sourceKey = findKey26(source, "lvl", getLocalName2);
115828
116152
  const oldLevels = asArray4(target[targetKey]);
115829
- const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level, index) => {
116153
+ const newLevels = asArray4(sourceKey ? source[sourceKey] : void 0).map((level2, index) => {
115830
116154
  const old = oldLevels[index];
115831
116155
  if (!old) {
115832
- return level;
116156
+ return level2;
115833
116157
  }
115834
116158
  const merged = {};
115835
116159
  for (const key2 of Object.keys(old)) {
@@ -115837,7 +116161,7 @@ function replaceLevels(target, source, getLocalName2) {
115837
116161
  merged[key2] = old[key2];
115838
116162
  }
115839
116163
  }
115840
- return { ...level, ...merged };
116164
+ return { ...level2, ...merged };
115841
116165
  });
115842
116166
  target[targetKey] = newLevels.length === 1 ? newLevels[0] : newLevels;
115843
116167
  }
@@ -118018,18 +118342,18 @@ var init_uniform_segment_overrides = __esm({
118018
118342
  "src/core/core/runtime/uniform-segment-overrides.ts"() {
118019
118343
  }
118020
118344
  });
118021
- function authoredPropertyGate(authoredProperties, level) {
118345
+ function authoredPropertyGate(authoredProperties, level2) {
118022
118346
  if (authoredProperties) {
118023
118347
  return (key2) => authoredProperties[key2] !== void 0;
118024
118348
  }
118025
- const isNested = typeof level === "number" && Number.isFinite(level) && level > 0;
118349
+ const isNested = typeof level2 === "number" && Number.isFinite(level2) && level2 > 0;
118026
118350
  return () => !isNested;
118027
118351
  }
118028
- function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing, level, authoredProperties) {
118352
+ function buildParagraphPropertiesXml(textStyle, paragraphAlign, bulletInfo, spacing, level2, authoredProperties) {
118029
118353
  const paragraphProps = {};
118030
- const owns = authoredPropertyGate(authoredProperties, level);
118031
- if (typeof level === "number" && Number.isFinite(level) && level >= 0) {
118032
- paragraphProps["@_lvl"] = String(Math.min(Math.max(Math.round(level), 0), 8));
118354
+ const owns = authoredPropertyGate(authoredProperties, level2);
118355
+ if (typeof level2 === "number" && Number.isFinite(level2) && level2 >= 0) {
118356
+ paragraphProps["@_lvl"] = String(Math.min(Math.max(Math.round(level2), 0), 8));
118033
118357
  }
118034
118358
  if (paragraphAlign && owns("align")) {
118035
118359
  paragraphProps["@_algn"] = paragraphAlign;
@@ -123339,7 +123663,7 @@ var init_PptxHandlerRuntimeSaveParagraphs = __esm({
123339
123663
  PptxHandlerRuntime13 = class extends PptxHandlerRuntime12 {
123340
123664
  createParagraphsFromTextContent(text22, textStyle, textSegments, resolveHyperlinkRelationshipId) {
123341
123665
  const runScopedTextStyle = toRunScopedTextStyle(textStyle);
123342
- const createParagraph = (runs, bulletInfo, level, endParaRunProperties, paragraphProperties2, markup) => {
123666
+ const createParagraph = (runs, bulletInfo, level2, endParaRunProperties, paragraphProperties2, markup) => {
123343
123667
  const effectiveStyle = paragraphProperties2 ? { ...textStyle, ...paragraphProperties2 } : textStyle;
123344
123668
  const paragraphAlign = this.textAlignToDrawingValue(effectiveStyle?.align);
123345
123669
  const spacing = {
@@ -123353,7 +123677,7 @@ var init_PptxHandlerRuntimeSaveParagraphs = __esm({
123353
123677
  paragraphAlign,
123354
123678
  bulletInfo,
123355
123679
  spacing,
123356
- level,
123680
+ level2,
123357
123681
  paragraphProperties2
123358
123682
  );
123359
123683
  return assembleParagraphXml(runs, paragraphProps, endParaRunProperties, markup);
@@ -129204,20 +129528,20 @@ var init_smartart_colors_builder = __esm({
129204
129528
  ]);
129205
129529
  }
129206
129530
  });
129207
- function prSetOf(pt2) {
129531
+ function prSetOf2(pt2) {
129208
129532
  const prSet = pt2["dgm:prSet"];
129209
129533
  return prSet && typeof prSet === "object" && !Array.isArray(prSet) ? prSet : {};
129210
129534
  }
129211
129535
  function findPresPointForAssoc(pts, assocId) {
129212
129536
  return pts.find(
129213
- (pt2) => pt2["@_type"] === "pres" && String(prSetOf(pt2)["@_presAssocID"] || "") === assocId
129537
+ (pt2) => pt2["@_type"] === "pres" && String(prSetOf2(pt2)["@_presAssocID"] || "") === assocId
129214
129538
  );
129215
129539
  }
129216
129540
  function maxPresParOfOrd(cxns, srcId) {
129217
129541
  return cxns.filter((c) => c["@_type"] === "presParOf" && c["@_srcId"] === srcId).reduce((max, c) => Math.max(max, parseInt(String(c["@_srcOrd"] ?? ""), 10) || 0), -1);
129218
129542
  }
129219
129543
  function countNodePresPoints(pts) {
129220
- return pts.filter((pt2) => pt2["@_type"] === "pres" && prSetOf(pt2)["@_presName"] === "node").length;
129544
+ return pts.filter((pt2) => pt2["@_type"] === "pres" && prSetOf2(pt2)["@_presName"] === "node").length;
129221
129545
  }
129222
129546
  function emptyTextBody() {
129223
129547
  return { "a:bodyPr": {}, "a:lstStyle": {}, "a:p": { "a:endParaRPr": { "@_lang": "en-US" } } };
@@ -129327,8 +129651,8 @@ function synthesizeNewSmartArtStructuralPoints(existingPts, existingCxns, nodes,
129327
129651
  pts.push(buildPresSibTransPoint(presSibTransId, sibTransId));
129328
129652
  const total = idx + 1;
129329
129653
  for (const pt2 of pts) {
129330
- if (pt2["@_type"] === "pres" && prSetOf(pt2)["@_presName"] === "node") {
129331
- prSetOf(pt2)["@_presStyleCnt"] = String(total);
129654
+ if (pt2["@_type"] === "pres" && prSetOf2(pt2)["@_presName"] === "node") {
129655
+ prSetOf2(pt2)["@_presStyleCnt"] = String(total);
129332
129656
  }
129333
129657
  }
129334
129658
  const srcOrd = connectionByChildId.get(node.id)?.srcOrd ?? 0;
@@ -138248,8 +138572,8 @@ var init_PptxHandlerRuntimePlaceholderLookup = __esm({
138248
138572
  mergePlaceholderLevelStyles(base, override) {
138249
138573
  const merged = {};
138250
138574
  for (const key2 of /* @__PURE__ */ new Set([...Object.keys(base ?? {}), ...Object.keys(override ?? {})])) {
138251
- const level = Number.parseInt(key2, 10);
138252
- merged[level] = { ...base?.[level], ...override?.[level] };
138575
+ const level2 = Number.parseInt(key2, 10);
138576
+ merged[level2] = { ...base?.[level2], ...override?.[level2] };
138253
138577
  }
138254
138578
  return merged;
138255
138579
  }
@@ -139161,8 +139485,8 @@ var init_PptxHandlerRuntimeBulletParsing = __esm({
139161
139485
  ...paragraphProps?.["a:buSzTx"] !== void 0 ? { sizeInherit: true } : {}
139162
139486
  };
139163
139487
  }
139164
- const level = Number.parseInt(String(paragraphProps?.["@_lvl"] || "0"), 10);
139165
- const normalizedLevel = Number.isFinite(level) ? Math.min(Math.max(level + 1, 1), 9) : 1;
139488
+ const level2 = Number.parseInt(String(paragraphProps?.["@_lvl"] || "0"), 10);
139489
+ const normalizedLevel = Number.isFinite(level2) ? Math.min(Math.max(level2 + 1, 1), 9) : 1;
139166
139490
  const levelKey = `a:lvl${normalizedLevel}pPr`;
139167
139491
  const inheritedLevelProps = xmlChild(xmlChild(inheritedTxBody, "a:lstStyle"), levelKey);
139168
139492
  const bodyLevelProps = xmlChild(xmlChild(txBody, "a:lstStyle"), levelKey);
@@ -139723,8 +140047,8 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139723
140047
  p["a:pPr"]
139724
140048
  );
139725
140049
  const parsedLevel = Number.parseInt(String(directPPr?.["@_lvl"] ?? "0"), 10);
139726
- const level = Number.isFinite(parsedLevel) ? Math.min(Math.max(parsedLevel, 0), 8) : 0;
139727
- const levelKey = `a:lvl${level + 1}pPr`;
140050
+ const level2 = Number.isFinite(parsedLevel) ? Math.min(Math.max(parsedLevel, 0), 8) : 0;
140051
+ const levelKey = `a:lvl${level2 + 1}pPr`;
139728
140052
  const ownLstStyle = ctx.txBody?.["a:lstStyle"];
139729
140053
  const inheritedLstStyle = ctx.inheritedTxBody?.["a:lstStyle"];
139730
140054
  const lstStyleParagraphDefaults = this.mergeXmlObjects(
@@ -139742,7 +140066,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139742
140066
  if (paragraphRtl !== void 0 && textStyle.rtl === void 0) {
139743
140067
  textStyle.rtl = paragraphRtl;
139744
140068
  }
139745
- const ownPlaceholderAlignment = ctx.effectiveLevelStyles?.[level]?.alignment ?? ctx.effectiveLevelStyles?.[-1]?.alignment;
140069
+ const ownPlaceholderAlignment = ctx.effectiveLevelStyles?.[level2]?.alignment ?? ctx.effectiveLevelStyles?.[-1]?.alignment;
139746
140070
  const paraAlign = resolveParagraphAlignment(
139747
140071
  pPr?.["@_algn"],
139748
140072
  ownPlaceholderAlignment,
@@ -139870,7 +140194,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139870
140194
  mergedDefaultRunStyle.fontFamily = ctx.styleFontRefTypeface;
139871
140195
  }
139872
140196
  if (ctx.effectiveLevelStyles) {
139873
- const phLevel = ctx.effectiveLevelStyles[level];
140197
+ const phLevel = ctx.effectiveLevelStyles[level2];
139874
140198
  const phBase = ctx.effectiveLevelStyles[-1];
139875
140199
  const runOwnRtl = mergedDefaultRunStyle.rtl;
139876
140200
  if (phLevel) {
@@ -139890,7 +140214,7 @@ var init_PptxHandlerRuntimeShapeTextParsing = __esm({
139890
140214
  let effectiveMarginLeft = parMarginLeft;
139891
140215
  let effectiveIndent = parIndent;
139892
140216
  if (ctx.effectiveLevelStyles) {
139893
- const phLevel = ctx.effectiveLevelStyles[level];
140217
+ const phLevel = ctx.effectiveLevelStyles[level2];
139894
140218
  const phBase = ctx.effectiveLevelStyles[-1];
139895
140219
  if (effectiveMarginLeft === void 0) {
139896
140220
  effectiveMarginLeft = phLevel?.marginLeft ?? phBase?.marginLeft;
@@ -143264,12 +143588,12 @@ var init_PptxHandlerRuntimeMasterElements = __esm({
143264
143588
  return;
143265
143589
  }
143266
143590
  const levelStyles = {};
143267
- for (let level = 1; level <= 9; level++) {
143591
+ for (let level2 = 1; level2 <= 9; level2++) {
143268
143592
  const parsed = this.parsePlaceholderLevelStyle(
143269
- defaultTextStyle[`a:lvl${level}pPr`]
143593
+ defaultTextStyle[`a:lvl${level2}pPr`]
143270
143594
  );
143271
143595
  if (parsed) {
143272
- levelStyles[level - 1] = parsed;
143596
+ levelStyles[level2 - 1] = parsed;
143273
143597
  }
143274
143598
  }
143275
143599
  const defaultLevel = this.parsePlaceholderLevelStyle(
@@ -146312,7 +146636,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
146312
146636
  return [];
146313
146637
  }
146314
146638
  }
146315
- parseDrawingShape(sp, index, emuPerPx) {
146639
+ parseDrawingShape(sp, index, emuPerPx, mergedTextColor) {
146316
146640
  const spPr = this.xmlLookupService.getChildByLocalName(sp, "spPr");
146317
146641
  if (!spPr) {
146318
146642
  return null;
@@ -146373,7 +146697,7 @@ var init_PptxHandlerRuntimeSmartArtParsing = __esm({
146373
146697
  }
146374
146698
  const text22 = textValues2.join("").trim() || void 0;
146375
146699
  const textStyle = extractDrawingShapeTextStyle(txBody, this.drawingShapeStyleDeps(), emuPerPx);
146376
- textStyle.fontColor ??= extractDrawingShapeFontRefColor(sp, this.drawingShapeStyleDeps());
146700
+ textStyle.fontColor ??= mergedTextColor ?? extractDrawingShapeFontRefColor(sp, this.drawingShapeStyleDeps());
146377
146701
  const { fontSize, fontColor } = textStyle;
146378
146702
  const txXfrm = this.xmlLookupService.getChildByLocalName(sp, "txXfrm");
146379
146703
  const txOff = this.xmlLookupService.getChildByLocalName(txXfrm, "off");
@@ -146601,6 +146925,7 @@ var PptxHandlerRuntime89;
146601
146925
  var init_PptxHandlerRuntimeSmartArt = __esm({
146602
146926
  "src/core/core/runtime/PptxHandlerRuntimeSmartArt.ts"() {
146603
146927
  init_utils();
146928
+ init_smartart_merged_text_label();
146604
146929
  init_smartart_point_metadata();
146605
146930
  init_smartart_pres_layout_vars();
146606
146931
  init_smart_art_text_helpers();
@@ -146699,7 +147024,16 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
146699
147024
  diagramDataRelationshipId,
146700
147025
  drawingExtensionRelId
146701
147026
  );
146702
- const drawingShapes = drawingResolution ? await this.parseSmartArtDrawingShapesFromPath(drawingResolution.path) : [];
147027
+ const drawingShapes = drawingResolution ? await this.parseSmartArtDrawingShapesFromPath(
147028
+ drawingResolution.path,
147029
+ resolveSmartArtMergedTextColors(
147030
+ points4,
147031
+ parsedConnections,
147032
+ layoutDefinition,
147033
+ colorTransform?.roleColors,
147034
+ localName292
147035
+ )
147036
+ ) : [];
146703
147037
  const drawingRelationshipId = drawingResolution?.relId;
146704
147038
  const styleRelationshipId = parsedRelationshipIds?.styleRelId ?? "";
146705
147039
  const quickStyle = await this.parseSmartArtQuickStyle(slidePath, styleRelationshipId);
@@ -146806,17 +147140,22 @@ var init_PptxHandlerRuntimeSmartArt = __esm({
146806
147140
  * resolves picture (blip) fills to data URLs via the drawing part's own
146807
147141
  * relationships. Delegates to a pure helper with an injected dep bundle.
146808
147142
  */
146809
- async parseSmartArtDrawingShapesFromPath(drawingPath) {
146810
- return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps());
147143
+ async parseSmartArtDrawingShapesFromPath(drawingPath, mergedTextColors) {
147144
+ return parseDrawingShapesFromPart(drawingPath, this.drawingBlipDeps(mergedTextColors));
146811
147145
  }
146812
147146
  /** Bind runtime zip / parser / lookup / image helpers for the drawing parser. */
146813
- drawingBlipDeps() {
147147
+ drawingBlipDeps(mergedTextColors) {
146814
147148
  return {
146815
147149
  readText: (path) => this.zip.file(path)?.async("string") ?? Promise.resolve(void 0),
146816
147150
  parse: (xml) => this.parser.parse(xml),
146817
147151
  getChild: (node, local) => this.xmlLookupService.getChildByLocalName(node, local),
146818
147152
  getChildren: (node, local) => this.xmlLookupService.getChildrenArrayByLocalName(node, local),
146819
- parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(sp, index, emuPerPx),
147153
+ parseDrawingShape: (sp, index, emuPerPx) => this.parseDrawingShape(
147154
+ sp,
147155
+ index,
147156
+ emuPerPx,
147157
+ mergedTextColors?.get(String(sp["@_modelId"] ?? ""))
147158
+ ),
146820
147159
  emuPerPx: _PptxHandlerRuntime.EMU_PER_PX,
146821
147160
  ensureArray: (value) => this.ensureArray(value),
146822
147161
  resolveImagePath: (base, target) => this.resolveImagePath(base, target),
@@ -149589,7 +149928,7 @@ var init_PptxHandlerRuntimeLoadPipeline = __esm({
149589
149928
  },
149590
149929
  placeholderType: (element) => this.getElementPlaceholderInfo(element)?.type,
149591
149930
  applyBodyDefaults: (textStyle, defaults) => this.applyPlaceholderBodyDefaults(textStyle, defaults),
149592
- applyLevelDefaults: (textStyle, level) => this.applyPlaceholderLevelDefaults(textStyle, level)
149931
+ applyLevelDefaults: (textStyle, level2) => this.applyPlaceholderLevelDefaults(textStyle, level2)
149593
149932
  }
149594
149933
  );
149595
149934
  const sldLayout = layoutXml["p:sldLayout"];
@@ -151659,38 +151998,38 @@ function parseMasterStyleAtom(view, rec, scheme, fonts) {
151659
151998
  break;
151660
151999
  }
151661
152000
  pos2 = cf.next;
151662
- const level = {};
152001
+ const level2 = {};
151663
152002
  if (cf.props.sizePt !== void 0) {
151664
- level.sizePt = cf.props.sizePt;
152003
+ level2.sizePt = cf.props.sizePt;
151665
152004
  }
151666
152005
  if (cf.props.bold !== void 0) {
151667
- level.bold = cf.props.bold;
152006
+ level2.bold = cf.props.bold;
151668
152007
  }
151669
152008
  if (cf.props.colorRgb !== void 0) {
151670
- level.colorRgb = cf.props.colorRgb;
152009
+ level2.colorRgb = cf.props.colorRgb;
151671
152010
  }
151672
152011
  if (cf.props.fontRef !== void 0 && fonts[cf.props.fontRef]) {
151673
- level.fontName = fonts[cf.props.fontRef];
152012
+ level2.fontName = fonts[cf.props.fontRef];
151674
152013
  }
151675
152014
  if (pf.props.align !== void 0) {
151676
- level.align = pf.props.align;
152015
+ level2.align = pf.props.align;
151677
152016
  }
151678
152017
  if (pf.props.hasBullet !== void 0) {
151679
- level.hasBullet = pf.props.hasBullet;
152018
+ level2.hasBullet = pf.props.hasBullet;
151680
152019
  }
151681
152020
  if (pf.props.bulletChar !== void 0) {
151682
- level.bulletChar = pf.props.bulletChar;
152021
+ level2.bulletChar = pf.props.bulletChar;
151683
152022
  }
151684
152023
  if (pf.props.bulletFontRef !== void 0 && fonts[pf.props.bulletFontRef]) {
151685
- level.bulletFontName = fonts[pf.props.bulletFontRef];
152024
+ level2.bulletFontName = fonts[pf.props.bulletFontRef];
151686
152025
  }
151687
152026
  if (pf.props.leftMarginMu !== void 0) {
151688
- level.marginLeftEmu = masterToEmu(pf.props.leftMarginMu);
152027
+ level2.marginLeftEmu = masterToEmu(pf.props.leftMarginMu);
151689
152028
  }
151690
152029
  if (pf.props.indentMu !== void 0) {
151691
- level.indentEmu = masterToEmu(pf.props.indentMu);
152030
+ level2.indentEmu = masterToEmu(pf.props.indentMu);
151692
152031
  }
151693
- levels.push(level);
152032
+ levels.push(level2);
151694
152033
  }
151695
152034
  return levels;
151696
152035
  }
@@ -152270,28 +152609,28 @@ var init_shape_writer2 = __esm({
152270
152609
  init_xml_utils();
152271
152610
  }
152272
152611
  });
152273
- function levelXml(tag, level, fallbackSizePt) {
152612
+ function levelXml(tag, level2, fallbackSizePt) {
152274
152613
  const attrs3 = [];
152275
- if (level.marginLeftEmu !== void 0) {
152276
- attrs3.push(`marL="${emu(level.marginLeftEmu)}"`);
152614
+ if (level2.marginLeftEmu !== void 0) {
152615
+ attrs3.push(`marL="${emu(level2.marginLeftEmu)}"`);
152277
152616
  }
152278
- if (level.indentEmu !== void 0) {
152279
- attrs3.push(`indent="${-Math.abs(emu(level.indentEmu))}"`);
152617
+ if (level2.indentEmu !== void 0) {
152618
+ attrs3.push(`indent="${-Math.abs(emu(level2.indentEmu))}"`);
152280
152619
  }
152281
- attrs3.push(`algn="${level.align ?? "l"}"`);
152620
+ attrs3.push(`algn="${level2.align ?? "l"}"`);
152282
152621
  let bullet = "";
152283
- if (level.hasBullet === false) {
152622
+ if (level2.hasBullet === false) {
152284
152623
  bullet = "<a:buNone/>";
152285
- } else if (level.hasBullet === true || level.bulletChar !== void 0) {
152286
- if (level.bulletFontName !== void 0) {
152287
- bullet += `<a:buFont typeface="${esc(level.bulletFontName)}"/>`;
152624
+ } else if (level2.hasBullet === true || level2.bulletChar !== void 0) {
152625
+ if (level2.bulletFontName !== void 0) {
152626
+ bullet += `<a:buFont typeface="${esc(level2.bulletFontName)}"/>`;
152288
152627
  }
152289
- bullet += `<a:buChar char="${esc(level.bulletChar ?? "\u2022")}"/>`;
152628
+ bullet += `<a:buChar char="${esc(level2.bulletChar ?? "\u2022")}"/>`;
152290
152629
  }
152291
- const size = Math.round((level.sizePt ?? fallbackSizePt) * 100);
152292
- const bold = level.bold ? ' b="1"' : "";
152293
- const color2 = level.colorRgb !== void 0 ? solidFill(level.colorRgb) : '<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>';
152294
- const font = level.fontName !== void 0 ? `<a:latin typeface="${esc(level.fontName)}"/>` : '<a:latin typeface="+mn-lt"/>';
152630
+ const size = Math.round((level2.sizePt ?? fallbackSizePt) * 100);
152631
+ const bold = level2.bold ? ' b="1"' : "";
152632
+ const color2 = level2.colorRgb !== void 0 ? solidFill(level2.colorRgb) : '<a:solidFill><a:schemeClr val="tx1"/></a:solidFill>';
152633
+ const font = level2.fontName !== void 0 ? `<a:latin typeface="${esc(level2.fontName)}"/>` : '<a:latin typeface="+mn-lt"/>';
152295
152634
  const defRPr = `<a:defRPr sz="${size}" kern="1200"${bold}>${color2}${font}</a:defRPr>`;
152296
152635
  return `<a:${tag} ${attrs3.join(" ")}>${bullet}${defRPr}</a:${tag}>`;
152297
152636
  }
@@ -164976,16 +165315,16 @@ var SmartArtElementProcessor = class {
164976
165315
  }
164977
165316
  return roots.length > 0 ? roots : [...nodeMap.values()];
164978
165317
  }
164979
- renderNestedList(nodes, level) {
165318
+ renderNestedList(nodes, level2) {
164980
165319
  const lines = [];
164981
- const indent = " ".repeat(level);
165320
+ const indent = " ".repeat(level2);
164982
165321
  for (const node of nodes) {
164983
165322
  const text22 = node.text.trim();
164984
165323
  if (text22) {
164985
165324
  lines.push(`${indent}- ${text22}`);
164986
165325
  }
164987
165326
  if (node.children && node.children.length > 0) {
164988
- lines.push(this.renderNestedList(node.children, level + 1));
165327
+ lines.push(this.renderNestedList(node.children, level2 + 1));
164989
165328
  }
164990
165329
  }
164991
165330
  return lines.join("\n");
@@ -166922,19 +167261,19 @@ var TextSegmentRenderer = class {
166922
167261
  if (!options.disableLists && !options.inlineMode) {
166923
167262
  const bullet = group2.segments.find((segment) => Boolean(segment.bulletInfo))?.bulletInfo;
166924
167263
  if (bullet && !bullet.none) {
166925
- const level = resolveListLevel(bullet, group2.index, options.paragraphIndents);
167264
+ const level2 = resolveListLevel(bullet, group2.index, options.paragraphIndents);
166926
167265
  const marker = resolveListMarker(bullet, group2.index);
166927
167266
  const alreadyNumbered = bullet.autoNumType && /^\d+[.)]\s/.test(rawText);
166928
167267
  const prefix = alreadyNumbered ? "" : `${marker} `;
166929
167268
  if (options.htmlFormatting) {
166930
- const pad23 = level * 1.5;
167269
+ const pad23 = level2 * 1.5;
166931
167270
  return {
166932
167271
  text: `<div style="padding-left:${pad23}em">${prefix}${rawText}</div>`,
166933
167272
  isListItem: true
166934
167273
  };
166935
167274
  }
166936
167275
  return {
166937
- text: `${" ".repeat(level)}${prefix}${rawText}`,
167276
+ text: `${" ".repeat(level2)}${prefix}${rawText}`,
166938
167277
  isListItem: true
166939
167278
  };
166940
167279
  }
@@ -169209,7 +169548,7 @@ function dataLabelBox(label) {
169209
169548
  const y = centred2 ? label.y - h2 / 2 : label.y - label.fontSize * ASCENT - DATA_LABEL_PAD_Y;
169210
169549
  return { x, y, w, h: h2 };
169211
169550
  }
169212
- var PX_PER_PT6;
169551
+ var PX_PER_PT7;
169213
169552
  var DATA_LABEL_PAD_X;
169214
169553
  var DATA_LABEL_PAD_Y;
169215
169554
  var DATA_LABEL_LINE_HEIGHT;
@@ -169217,9 +169556,9 @@ var ASCENT;
169217
169556
  var canvasContext;
169218
169557
  var init_chart_label_measure = __esm2({
169219
169558
  "src/render/chart-label-measure.ts"() {
169220
- PX_PER_PT6 = 4 / 3;
169221
- DATA_LABEL_PAD_X = 3 * PX_PER_PT6;
169222
- DATA_LABEL_PAD_Y = 1.5 * PX_PER_PT6;
169559
+ PX_PER_PT7 = 4 / 3;
169560
+ DATA_LABEL_PAD_X = 3 * PX_PER_PT7;
169561
+ DATA_LABEL_PAD_Y = 1.5 * PX_PER_PT7;
169223
169562
  DATA_LABEL_LINE_HEIGHT = 1.2207;
169224
169563
  ASCENT = 0.952;
169225
169564
  }
@@ -171214,8 +171553,8 @@ function buildMultiLevelCategoryLabels(categoryLabels, categoryLevels, sourceInd
171214
171553
  const fontPx = axis?.fontSize !== void 0 ? chartFontPx(axis.fontSize) : DEFAULT_CHART_TEXT_PX;
171215
171554
  const bandHeight = Math.max(fontPx, 8) + 4;
171216
171555
  const baselineShift = labelsAbove ? -0.2 * fontPx : 0.8 * fontPx;
171217
- return levels.flatMap((level, levelIndex) => {
171218
- const values = sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "");
171556
+ return levels.flatMap((level2, levelIndex) => {
171557
+ const values = sourceIndices2.map((sourceIndex) => level2[sourceIndex] ?? "");
171219
171558
  return groupedLabels(values).flatMap((group2) => {
171220
171559
  if (!group2.text || group2.start % skip !== 0) {
171221
171560
  return [];
@@ -171344,7 +171683,7 @@ function chartDataInCategoryOrder(chartData, sourceIndices2) {
171344
171683
  ...chartData,
171345
171684
  categories: sourceIndices2.map((sourceIndex) => chartData.categories[sourceIndex] ?? ""),
171346
171685
  categoryLevels: chartData.categoryLevels?.map(
171347
- (level) => sourceIndices2.map((sourceIndex) => level[sourceIndex] ?? "")
171686
+ (level2) => sourceIndices2.map((sourceIndex) => level2[sourceIndex] ?? "")
171348
171687
  ),
171349
171688
  series: chartData.series.map((series) => ({
171350
171689
  ...series,
@@ -175508,12 +175847,12 @@ function computeSunburstArcs(series, cx, cy, maxR, colorPalette) {
175508
175847
  }
175509
175848
  return out;
175510
175849
  }
175511
- function hierarchyKey(levels, level, index) {
175512
- return levels.slice(level).map((labels) => labels[index] ?? "").join("\0");
175850
+ function hierarchyKey(levels, level2, index) {
175851
+ return levels.slice(level2).map((labels) => labels[index] ?? "").join("\0");
175513
175852
  }
175514
175853
  function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, colorPalette) {
175515
- const levels = categoryLevels.filter((level) => level.length > 0);
175516
- const leafCount = Math.max(values.length, ...levels.map((level) => level.length), 0);
175854
+ const levels = categoryLevels.filter((level2) => level2.length > 0);
175855
+ const leafCount = Math.max(values.length, ...levels.map((level2) => level2.length), 0);
175517
175856
  if (levels.length === 0 || leafCount === 0) {
175518
175857
  return [];
175519
175858
  }
@@ -175528,15 +175867,15 @@ function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, c
175528
175867
  const rootLabels = levels[levels.length - 1] ?? [];
175529
175868
  const rootColors = /* @__PURE__ */ new Map();
175530
175869
  const out = [];
175531
- for (let level = levels.length - 1; level >= 0; level--) {
175532
- const ringIndex = levels.length - 1 - level;
175870
+ for (let level2 = levels.length - 1; level2 >= 0; level2--) {
175871
+ const ringIndex = levels.length - 1 - level2;
175533
175872
  const innerRadius = ringWidth * (ringIndex + 0.5);
175534
175873
  const outerRadius = ringWidth * (ringIndex + 1.5);
175535
175874
  let start = 0;
175536
175875
  while (start < leafCount) {
175537
- const key2 = hierarchyKey(levels, level, start);
175876
+ const key2 = hierarchyKey(levels, level2, start);
175538
175877
  let end = start + 1;
175539
- while (end < leafCount && hierarchyKey(levels, level, end) === key2) {
175878
+ while (end < leafCount && hierarchyKey(levels, level2, end) === key2) {
175540
175879
  end++;
175541
175880
  }
175542
175881
  const startAngle = -Math.PI / 2 + prefix[start] / total * Math.PI * 2;
@@ -175550,8 +175889,8 @@ function computeHierarchicalSunburstArcs(categoryLevels, values, cx, cy, maxR, c
175550
175889
  fill: paletteColor2(rootColors.get(rootLabel) ?? start, colorPalette),
175551
175890
  opacity: Math.max(0.1, 0.9 - ringIndex * 0.1),
175552
175891
  level: ringIndex,
175553
- label: levels[level][start] ?? "",
175554
- ...level === 0 && end === start + 1 ? { pointIndex: start } : {},
175892
+ label: levels[level2][start] ?? "",
175893
+ ...level2 === 0 && end === start + 1 ? { pointIndex: start } : {},
175555
175894
  ...arcLabelPlacement(cx, cy, (innerRadius + outerRadius) / 2, startAngle, endAngle)
175556
175895
  });
175557
175896
  start = end;
@@ -176700,10 +177039,10 @@ var init_chart_treemap_squarify = __esm2({
176700
177039
  }
176701
177040
  });
176702
177041
  function normalizedLevels(levels, pointCount2) {
176703
- return levels.map((level) => {
177042
+ return levels.map((level2) => {
176704
177043
  let previous = "";
176705
177044
  return Array.from({ length: pointCount2 }, (_, index) => {
176706
- const label = level[index]?.trim() ?? "";
177045
+ const label = level2[index]?.trim() ?? "";
176707
177046
  if (label) {
176708
177047
  previous = label;
176709
177048
  }
@@ -180541,9 +180880,13 @@ function smartArt3DRigSpecularLights(rig, perspective2) {
180541
180880
  const own = perspective2 && rig ? SMARTART_RIG_SPECULAR_LIGHTS[rig] : void 0;
180542
180881
  return own ?? DEFAULT_HIGHLIGHT;
180543
180882
  }
180883
+ function smartArt3DRigKeyLight(rig, sceneCamera) {
180884
+ return sceneCamera && rig ? SMARTART_RIG_SCENE_KEY_LIGHTS[rig] : void 0;
180885
+ }
180544
180886
  var DEFAULT_HIGHLIGHT_ELEVATION_DEG;
180545
180887
  var DEFAULT_HIGHLIGHT;
180546
180888
  var SMARTART_RIG_SPECULAR_LIGHTS;
180889
+ var SMARTART_RIG_SCENE_KEY_LIGHTS;
180547
180890
  var init_smartart_3d_light_rig = __esm2({
180548
180891
  "src/render/smartart-3d-light-rig.ts"() {
180549
180892
  DEFAULT_HIGHLIGHT_ELEVATION_DEG = 60;
@@ -180553,6 +180896,12 @@ var init_smartart_3d_light_rig = __esm2({
180553
180896
  SMARTART_RIG_SPECULAR_LIGHTS = {
180554
180897
  threePt: [{ azimuthDeg: 64, elevationDeg: 44, intensity: 4.6, sharpness: 3 }]
180555
180898
  };
180899
+ SMARTART_RIG_SCENE_KEY_LIGHTS = {
180900
+ flat: { azimuthDeg: 0, elevationDeg: 40 },
180901
+ threePt: { azimuthDeg: 0, elevationDeg: 90 },
180902
+ morning: { azimuthDeg: 0, elevationDeg: 60 },
180903
+ soft: { azimuthDeg: 0, elevationDeg: 80 }
180904
+ };
180556
180905
  }
180557
180906
  });
180558
180907
  function srgbChannelToLinear(c) {
@@ -180573,7 +180922,7 @@ function normalize2(v) {
180573
180922
  const len = Math.hypot(v.x, v.y, v.z) || 1;
180574
180923
  return { x: v.x / len, y: v.y / len, z: v.z / len };
180575
180924
  }
180576
- function resolveSmartArt3DLightModel(lighting, material, perspective2 = false) {
180925
+ function resolveSmartArt3DLightModel(lighting, material, perspective2 = false, sceneCamera = perspective2) {
180577
180926
  const snap2 = getBevelHighlightDirection(lighting?.direction ?? "t");
180578
180927
  const rev = (lighting?.revDeg ?? 0) * Math.PI / 180;
180579
180928
  const ax = snap2.dx;
@@ -180594,8 +180943,9 @@ function resolveSmartArt3DLightModel(lighting, material, perspective2 = false) {
180594
180943
  };
180595
180944
  const response = getMaterialLighting(material);
180596
180945
  const specular = response.specularConstant * SPECULAR_GAIN;
180946
+ const key2 = smartArt3DRigKeyLight(lighting?.rig, sceneCamera);
180597
180947
  return {
180598
- light: toward(KEY_ELEVATION_DEG),
180948
+ light: key2 ? toward(key2.elevationDeg, key2.azimuthDeg) : toward(KEY_ELEVATION_DEG),
180599
180949
  highlights: smartArt3DRigSpecularLights(lighting?.rig, perspective2).map((rigLight) => ({
180600
180950
  direction: toward(rigLight.elevationDeg, rigLight.azimuthDeg),
180601
180951
  weight: specular * rigLight.intensity,
@@ -185439,6 +185789,75 @@ var init_chart_3d_view_scene = __esm2({
185439
185789
  init_surface_chart_3d_scene();
185440
185790
  }
185441
185791
  });
185792
+ function isSmartArt3DGlassMaterial(material) {
185793
+ return material === "clear";
185794
+ }
185795
+ function smartArt3DSurfaceAlpha(material, opacity2, facing) {
185796
+ if (!isSmartArt3DGlassMaterial(material)) {
185797
+ return opacity2;
185798
+ }
185799
+ const tilt = 1 - Math.max(0, Math.min(1, facing));
185800
+ const share = CLEAR_FACE_ALPHA + CLEAR_EDGE_GAIN * tilt ** CLEAR_EDGE_EXPONENT;
185801
+ return Math.max(0, Math.min(1, opacity2 * share));
185802
+ }
185803
+ function smartArt3DVertexAlphas(positions2, normals, material, opacity2, eye) {
185804
+ const out = new Float32Array(positions2.length / 3);
185805
+ for (let i2 = 0, v = 0; i2 < positions2.length; i2 += 3, v++) {
185806
+ let view = { x: 0, y: 0, z: 1 };
185807
+ if (eye) {
185808
+ const dx = eye.x - positions2[i2];
185809
+ const dy = eye.y - positions2[i2 + 1];
185810
+ const dz = eye.z - positions2[i2 + 2];
185811
+ const len = Math.hypot(dx, dy, dz) || 1;
185812
+ view = { x: dx / len, y: dy / len, z: dz / len };
185813
+ }
185814
+ const facing = normals[i2] * view.x + normals[i2 + 1] * view.y + normals[i2 + 2] * view.z;
185815
+ out[v] = smartArt3DSurfaceAlpha(material, opacity2, facing);
185816
+ }
185817
+ return out;
185818
+ }
185819
+ function orientSmartArt3DTriangles(triangles) {
185820
+ const { positions: p, normals: n } = triangles;
185821
+ for (let t = 0; t + 9 <= p.length; t += 9) {
185822
+ const ux = p[t + 3] - p[t];
185823
+ const uy = p[t + 4] - p[t + 1];
185824
+ const uz = p[t + 5] - p[t + 2];
185825
+ const vx = p[t + 6] - p[t];
185826
+ const vy = p[t + 7] - p[t + 1];
185827
+ const vz = p[t + 8] - p[t + 2];
185828
+ const cx = uy * vz - uz * vy;
185829
+ const cy = uz * vx - ux * vz;
185830
+ const cz = ux * vy - uy * vx;
185831
+ const nx = n[t] + n[t + 3] + n[t + 6];
185832
+ const ny = n[t + 1] + n[t + 4] + n[t + 7];
185833
+ const nz = n[t + 2] + n[t + 5] + n[t + 8];
185834
+ if (cx * nx + cy * ny + cz * nz < 0) {
185835
+ for (const arr of [p, n]) {
185836
+ for (let c = 0; c < 3; c++) {
185837
+ const b = arr[t + 3 + c];
185838
+ arr[t + 3 + c] = arr[t + 6 + c];
185839
+ arr[t + 6 + c] = b;
185840
+ }
185841
+ }
185842
+ }
185843
+ }
185844
+ }
185845
+ function isSmartArt3DTranslucentMesh(mesh) {
185846
+ return !mesh.fillNone && (mesh.opacity < 1 || isSmartArt3DGlassMaterial(mesh.solid?.material));
185847
+ }
185848
+ function smartArt3DGlassLightModel(model) {
185849
+ return { ...model, ambient: 1, diffuse: 0 };
185850
+ }
185851
+ var CLEAR_FACE_ALPHA;
185852
+ var CLEAR_EDGE_GAIN;
185853
+ var CLEAR_EDGE_EXPONENT;
185854
+ var init_smartart_3d_translucency = __esm2({
185855
+ "src/render/smartart-3d-translucency.ts"() {
185856
+ CLEAR_FACE_ALPHA = 0.2;
185857
+ CLEAR_EDGE_GAIN = 2;
185858
+ CLEAR_EDGE_EXPONENT = 1;
185859
+ }
185860
+ });
185442
185861
  function buildTextBlockTexture(three, block) {
185443
185862
  if (typeof document === "undefined" || block.lines.every((l) => l.text.length === 0)) {
185444
185863
  return null;
@@ -185950,19 +186369,45 @@ function buildGradientTexture(three, gradient) {
185950
186369
  texture.needsUpdate = true;
185951
186370
  return texture;
185952
186371
  }
186372
+ function withAlpha(rgb2, alpha) {
186373
+ const out = new Float32Array(alpha.length * 4);
186374
+ for (let v = 0; v < alpha.length; v++) {
186375
+ out.set(rgb2.subarray(v * 3, v * 3 + 3), v * 4);
186376
+ out[v * 4 + 3] = alpha[v];
186377
+ }
186378
+ return out;
186379
+ }
185953
186380
  function buildPart(three, part, light, eye, disposables) {
185954
- const { positions: positions2, normals } = part.triangles;
185955
- if (positions2.length === 0) {
186381
+ if (part.triangles.positions.length === 0) {
185956
186382
  return null;
185957
186383
  }
186384
+ const glass = isSmartArt3DGlassMaterial(part.material);
186385
+ const translucent = part.opacity < 1 || glass;
186386
+ if (translucent) {
186387
+ orientSmartArt3DTriangles(part.triangles);
186388
+ }
186389
+ const { positions: positions2, normals } = part.triangles;
185958
186390
  const gradient = part.gradient;
185959
186391
  const flatColor = hexToRgb7(part.color);
185960
186392
  const baseAt = (p) => gradient ? smartArt3DGradientColor(gradient, p) : flatColor;
185961
186393
  const geometry = new three.BufferGeometry();
185962
186394
  geometry.setAttribute("position", new three.Float32BufferAttribute(positions2, 3));
186395
+ const shading = shadeSmartArt3DVertices(
186396
+ positions2,
186397
+ normals,
186398
+ baseAt,
186399
+ glass ? smartArt3DGlassLightModel(light) : light,
186400
+ eye
186401
+ );
185963
186402
  geometry.setAttribute(
185964
186403
  "color",
185965
- new three.BufferAttribute(shadeSmartArt3DVertices(positions2, normals, baseAt, light, eye), 3)
186404
+ glass ? new three.BufferAttribute(
186405
+ withAlpha(
186406
+ shading,
186407
+ smartArt3DVertexAlphas(positions2, normals, part.material, part.opacity, eye)
186408
+ ),
186409
+ 4
186410
+ ) : new three.BufferAttribute(shading, 3)
185966
186411
  );
185967
186412
  const texture = gradient ? buildGradientTexture(three, gradient) : null;
185968
186413
  if (gradient && texture) {
@@ -185980,9 +186425,13 @@ function buildPart(three, part, light, eye, disposables) {
185980
186425
  color: texture ? "#ffffff" : part.color,
185981
186426
  map: texture,
185982
186427
  vertexColors: true,
185983
- side: three.DoubleSide,
185984
- transparent: part.opacity < 1,
185985
- opacity: part.opacity
186428
+ side: translucent ? three.FrontSide : three.DoubleSide,
186429
+ transparent: translucent,
186430
+ // A glass carries its alpha per vertex; the material then stays at 1.
186431
+ opacity: glass ? 1 : part.opacity,
186432
+ // Translucent solids are layered in paint order, like PowerPoint's
186433
+ // per-shape compositing, rather than hiding one another.
186434
+ depthWrite: !translucent
185986
186435
  });
185987
186436
  disposables.push(geometry, material);
185988
186437
  return new three.Mesh(geometry, material);
@@ -186009,12 +186458,20 @@ function buildLitMeshObject(three, mesh, light, eye) {
186009
186458
  for (const cap of geometry?.contourCaps ?? []) {
186010
186459
  appendCap(three, contour, cap);
186011
186460
  }
186461
+ const material = mesh.solid?.material;
186012
186462
  const parts = [
186013
- { triangles: body, color: mesh.fill, gradient: mesh.gradient, opacity: mesh.opacity },
186463
+ {
186464
+ triangles: body,
186465
+ color: mesh.fill,
186466
+ gradient: mesh.gradient,
186467
+ opacity: mesh.opacity,
186468
+ material
186469
+ },
186014
186470
  {
186015
186471
  triangles: sides,
186016
186472
  color: mesh.solid?.extrusionColor ?? mesh.fill,
186017
- opacity: mesh.opacity
186473
+ opacity: mesh.opacity,
186474
+ material
186018
186475
  },
186019
186476
  {
186020
186477
  triangles: contour,
@@ -186022,33 +186479,36 @@ function buildLitMeshObject(three, mesh, light, eye) {
186022
186479
  opacity: mesh.opacity
186023
186480
  }
186024
186481
  ];
186025
- for (const part of parts) {
186482
+ parts.forEach((part, order) => {
186026
186483
  const built = buildPart(three, part, light, localEye, disposables);
186027
186484
  if (built) {
186028
- if (mesh.opacity < 1) {
186029
- const material = built.material;
186030
- material.transparent = true;
186031
- material.opacity = mesh.opacity;
186032
- }
186485
+ built.renderOrder = order;
186033
186486
  group2.add(built);
186034
186487
  }
186035
- }
186488
+ });
186036
186489
  }
186037
186490
  for (const line4 of buildStrokeLines(three, mesh, disposables)) {
186038
186491
  group2.add(line4);
186039
186492
  }
186493
+ const labelsFrom = group2.children.length;
186040
186494
  buildLitTextObject(three, mesh, group2, light, disposables);
186495
+ for (const label of group2.children.slice(labelsFrom)) {
186496
+ label.renderOrder = LABEL_RENDER_ORDER;
186497
+ }
186041
186498
  return { group: group2, disposables };
186042
186499
  }
186500
+ var LABEL_RENDER_ORDER;
186043
186501
  var GRADIENT_TEXELS;
186044
186502
  var init_lit_mesh_object = __esm2({
186045
186503
  "src/smartart-3d/lit-mesh-object.ts"() {
186046
186504
  init_smartart_3d_drawing_solid();
186047
186505
  init_smartart_3d_ring();
186048
186506
  init_smartart_3d_solid_geometry();
186507
+ init_smartart_3d_translucency();
186049
186508
  init_smartart_3d_vertex_shading();
186050
186509
  init_flat_mesh_object();
186051
186510
  init_lit_text_object();
186511
+ LABEL_RENDER_ORDER = 3;
186052
186512
  GRADIENT_TEXELS = 256;
186053
186513
  }
186054
186514
  });
@@ -186266,16 +186726,24 @@ async function mountSmartArt3DView(model, ctx) {
186266
186726
  );
186267
186727
  }
186268
186728
  scene.add(root);
186269
- for (const mesh of model.meshes) {
186729
+ model.meshes.forEach((mesh, index) => {
186270
186730
  const built = lit ? buildLitMeshObject(
186271
186731
  three,
186272
186732
  mesh,
186273
- resolveSmartArt3DLightModel(model.lighting, mesh.solid?.material, eye !== void 0),
186733
+ resolveSmartArt3DLightModel(
186734
+ model.lighting,
186735
+ mesh.solid?.material,
186736
+ eye !== void 0,
186737
+ model.camera !== void 0
186738
+ ),
186274
186739
  eye
186275
186740
  ) : buildFlatMeshObject(three, mesh);
186741
+ if (lit && isSmartArt3DTranslucentMesh(mesh)) {
186742
+ built.group.renderOrder = index + 1;
186743
+ }
186276
186744
  root.add(built.group);
186277
186745
  disposables.push(...built.disposables);
186278
- }
186746
+ });
186279
186747
  const camera = buildSmartArtViewCamera(three, model.bounds, model.camera, ctx.size);
186280
186748
  let overflow = frameSmartArtOverflow(three, root, camera, ctx.size, Boolean(model.camera));
186281
186749
  return {
@@ -186300,6 +186768,7 @@ var init_view_scene = __esm2({
186300
186768
  "src/smartart-3d/view-scene.ts"() {
186301
186769
  init_smartart_3d_lighting();
186302
186770
  init_smartart_3d_scene_camera();
186771
+ init_smartart_3d_translucency();
186303
186772
  init_flat_mesh_object();
186304
186773
  init_lit_mesh_object();
186305
186774
  init_view_camera();
@@ -191492,7 +191961,7 @@ function pointInRing(p, ring) {
191492
191961
  }
191493
191962
  return inside;
191494
191963
  }
191495
- function contourRaster(values, w, h2, level) {
191964
+ function contourRaster(values, w, h2, level2) {
191496
191965
  const at = (x, y) => x < 0 || y < 0 || x >= w || y >= h2 ? 0 : values[y * w + x];
191497
191966
  const stride = w + 2;
191498
191967
  const hKey = (x, y) => ((y + 1) * stride + (x + 1)) * 2;
@@ -191502,7 +191971,7 @@ function contourRaster(values, w, h2, level) {
191502
191971
  if (!points4.has(key2)) {
191503
191972
  const a = at(x, y);
191504
191973
  const b = horizontal ? at(x + 1, y) : at(x, y + 1);
191505
- const t = b !== a ? (level - a) / (b - a) : 0.5;
191974
+ const t = b !== a ? (level2 - a) / (b - a) : 0.5;
191506
191975
  points4.set(key2, horizontal ? { x: x + t, y } : { x, y: y + t });
191507
191976
  }
191508
191977
  return key2;
@@ -191526,15 +191995,15 @@ function contourRaster(values, w, h2, level) {
191526
191995
  };
191527
191996
  for (let y = -1; y < h2; y++) {
191528
191997
  for (let x = -1; x < w; x++) {
191529
- const tl = at(x, y) >= level ? 1 : 0;
191530
- const tr = at(x + 1, y) >= level ? 1 : 0;
191531
- const br = at(x + 1, y + 1) >= level ? 1 : 0;
191532
- const bl = at(x, y + 1) >= level ? 1 : 0;
191998
+ const tl = at(x, y) >= level2 ? 1 : 0;
191999
+ const tr = at(x + 1, y) >= level2 ? 1 : 0;
192000
+ const br = at(x + 1, y + 1) >= level2 ? 1 : 0;
192001
+ const bl = at(x, y + 1) >= level2 ? 1 : 0;
191533
192002
  const code = tl * 8 + tr * 4 + br * 2 + bl;
191534
192003
  if (code === 0 || code === 15) {
191535
192004
  continue;
191536
192005
  }
191537
- const centre = (at(x, y) + at(x + 1, y) + at(x + 1, y + 1) + at(x, y + 1)) / 4 >= level;
192006
+ const centre = (at(x, y) + at(x + 1, y) + at(x + 1, y + 1) + at(x, y + 1)) / 4 >= level2;
191538
192007
  switch (code) {
191539
192008
  case 1:
191540
192009
  case 14:
@@ -199354,14 +199823,14 @@ function round2(value, precision) {
199354
199823
  function svgDataUri(svg, filterId) {
199355
199824
  return `url("data:image/svg+xml,${encodeURIComponent(svg)}#${filterId}")`;
199356
199825
  }
199357
- function pixelateFilterMarkup(level, filterId) {
199358
- const tile4 = round2(level, 4);
199359
- const dot2 = round2(level * DOT_RATIO, 4);
199826
+ function pixelateFilterMarkup(level2, filterId) {
199827
+ const tile4 = round2(level2, 4);
199828
+ const dot2 = round2(level2 * DOT_RATIO, 4);
199360
199829
  return `<svg xmlns="http://www.w3.org/2000/svg"><filter id="${filterId}" primitiveUnits="objectBoundingBox" x="-0.5" y="-0.5" width="2" height="2" color-interpolation-filters="sRGB"><feFlood x="0" y="0" width="${dot2}" height="${dot2}" result="dot"/><feComposite in="dot" width="${tile4}" height="${tile4}" result="tile"/><feTile in="tile" result="grid"/><feComposite in="SourceGraphic" in2="grid" operator="in"/></filter></svg>`;
199361
199830
  }
199362
- var PIXELATE_FILTER_VALUES = PIXELATE_LEVELS.map((level, index) => {
199831
+ var PIXELATE_FILTER_VALUES = PIXELATE_LEVELS.map((level2, index) => {
199363
199832
  const filterId = `pptx-pixelate-${index}`;
199364
- return svgDataUri(pixelateFilterMarkup(level, filterId), filterId);
199833
+ return svgDataUri(pixelateFilterMarkup(level2, filterId), filterId);
199365
199834
  });
199366
199835
  function buildSteppedKeyframes(name, order, opacityFrom, opacityTo) {
199367
199836
  const lastIndex = order.length - 1;
@@ -200670,7 +201139,7 @@ function revealedByLevel(nodes, progress) {
200670
201139
  return nodes.length;
200671
201140
  }
200672
201141
  const allowed = new Set(uniqueLevels.slice(0, shownLevels));
200673
- return levels.filter((level) => allowed.has(level)).length;
201142
+ return levels.filter((level2) => allowed.has(level2)).length;
200674
201143
  }
200675
201144
  function revealedByBranch(nodes, progress) {
200676
201145
  const roots = nodeBranchRoots(nodes);
@@ -202446,8 +202915,8 @@ var DEFAULT_BUILD_LEVEL = 1;
202446
202915
  function groupParagraphsByBuildLevel(levels, buildLevel = DEFAULT_BUILD_LEVEL) {
202447
202916
  const groups = [];
202448
202917
  for (let i2 = 0; i2 < levels.length; i2++) {
202449
- const level = levels[i2] ?? 0;
202450
- const opensGroup = groups.length === 0 || level < buildLevel;
202918
+ const level2 = levels[i2] ?? 0;
202919
+ const opensGroup = groups.length === 0 || level2 < buildLevel;
202451
202920
  if (opensGroup) {
202452
202921
  groups.push([i2]);
202453
202922
  } else {
@@ -215494,8 +215963,8 @@ function resolveParagraphBullet(firstSegment, baseFontSize = firstSegment?.style
215494
215963
  return void 0;
215495
215964
  }
215496
215965
  var INDENT_PX_PER_LEVEL = 18;
215497
- function bulletIndentPx(level) {
215498
- const lvl = typeof level === "number" && level > 0 ? level : 0;
215966
+ function bulletIndentPx(level2) {
215967
+ const lvl = typeof level2 === "number" && level2 > 0 ? level2 : 0;
215499
215968
  return lvl * INDENT_PX_PER_LEVEL;
215500
215969
  }
215501
215970
  function resolveParagraphIndent(paraIndent, paragraphLevel) {
@@ -215693,15 +216162,15 @@ function setElementBullets(element, kind, range) {
215693
216162
  }
215694
216163
  const first = segments[0] ?? paragraph.terminator;
215695
216164
  const info = first?.bulletInfo;
215696
- const level = first?.paragraphLevel ?? 0;
216165
+ const level2 = first?.paragraphLevel ?? 0;
215697
216166
  if (info?.autoNumType && paragraphBulletKind(segments) === "numbered") {
215698
216167
  const startAt = info.autoNumStartAt ?? 1;
215699
- const ordinal = nextAutoNumber(sequence, level, info.autoNumType, startAt) - startAt;
216168
+ const ordinal = nextAutoNumber(sequence, level2, info.autoNumType, startAt) - startAt;
215700
216169
  if (info.paragraphIndex !== ordinal) {
215701
216170
  segments = toggleParagraphBullet(segments, "numbered", ordinal);
215702
216171
  }
215703
216172
  } else {
215704
- breakAutoNumberRun(sequence, level);
216173
+ breakAutoNumberRun(sequence, level2);
215705
216174
  }
215706
216175
  next.push(...segments);
215707
216176
  if (paragraph.terminator) {
@@ -219590,11 +220059,11 @@ function definedEntries(descriptor) {
219590
220059
  ([, value]) => value !== void 0
219591
220060
  );
219592
220061
  }
219593
- function resolveNotesLevelStyle(notesStyle, level = 0) {
220062
+ function resolveNotesLevelStyle(notesStyle, level2 = 0) {
219594
220063
  if (!notesStyle) {
219595
220064
  return {};
219596
220065
  }
219597
- const own = notesStyle[level];
220066
+ const own = notesStyle[level2];
219598
220067
  const fallback = notesStyle[-1];
219599
220068
  const descriptor = {
219600
220069
  fontFamily: own?.fontFamily ?? fallback?.fontFamily,
@@ -223419,12 +223888,12 @@ function renumberRemappedParagraphs(segments) {
223419
223888
  return segment;
223420
223889
  }
223421
223890
  const info = segment.bulletInfo;
223422
- const level = segment.paragraphLevel ?? 0;
223891
+ const level2 = segment.paragraphLevel ?? 0;
223423
223892
  if (!info?.autoNumType || !resolveParagraphBullet(segment)?.isNumbered) {
223424
- breakAutoNumberRun(sequence, level);
223893
+ breakAutoNumberRun(sequence, level2);
223425
223894
  return segment;
223426
223895
  }
223427
- const ordinal = nextAutoNumber(sequence, level, info.autoNumType, info.autoNumStartAt ?? 1) - (info.autoNumStartAt ?? 1);
223896
+ const ordinal = nextAutoNumber(sequence, level2, info.autoNumType, info.autoNumStartAt ?? 1) - (info.autoNumStartAt ?? 1);
223428
223897
  if (info.paragraphIndex === void 0 || info.paragraphIndex === ordinal) {
223429
223898
  return segment;
223430
223899
  }
@@ -230354,17 +230823,17 @@ function computeHierarchyLayout(nodes, box, palette, style, elementId) {
230354
230823
  const renderedNodes = [];
230355
230824
  const connectors2 = [];
230356
230825
  let colourIdx = 0;
230357
- function renderTreeNode(t, xOffset, level) {
230826
+ function renderTreeNode(t, xOffset, level2) {
230358
230827
  const w = treeWidth(t);
230359
230828
  const nodeCx = (xOffset + w / 2) * cellW;
230360
- const nodeCy = level * cellH + cellH / 2;
230829
+ const nodeCy = level2 * cellH + cellH / 2;
230361
230830
  const ci = colourIdx++;
230362
230831
  const fontSize = fitFontSize(t.node.text, boxW * 0.9, boxH, 11);
230363
230832
  let childOffset = xOffset;
230364
230833
  for (const child27 of t.children) {
230365
230834
  const childW = treeWidth(child27);
230366
230835
  const childCx = (childOffset + childW / 2) * cellW;
230367
- const childCy = (level + 1) * cellH + cellH / 2;
230836
+ const childCy = (level2 + 1) * cellH + cellH / 2;
230368
230837
  const midY = nodeCy + boxH / 2 + (childCy - boxH / 2 - (nodeCy + boxH / 2)) / 2;
230369
230838
  connectors2.push({
230370
230839
  key: `${elementId}-hier-conn-${t.node.id}-${child27.node.id}`,
@@ -230393,7 +230862,7 @@ function computeHierarchyLayout(nodes, box, palette, style, elementId) {
230393
230862
  renderedNodes.push(nodeEntry);
230394
230863
  let co = xOffset;
230395
230864
  for (const child27 of t.children) {
230396
- renderTreeNode(child27, co, level + 1);
230865
+ renderTreeNode(child27, co, level2 + 1);
230397
230866
  co += treeWidth(child27);
230398
230867
  }
230399
230868
  }
@@ -235742,8 +236211,8 @@ function paragraphGroupText(group2) {
235742
236211
  }
235743
236212
  function paragraphGroupLevel(group2) {
235744
236213
  const first = group2.marker ?? group2.content[0];
235745
- const level = first?.paragraphLevel;
235746
- return typeof level === "number" && level > 0 ? Math.min(level, MAX_PARAGRAPH_LEVEL) : 0;
236214
+ const level2 = first?.paragraphLevel;
236215
+ return typeof level2 === "number" && level2 > 0 ? Math.min(level2, MAX_PARAGRAPH_LEVEL) : 0;
235747
236216
  }
235748
236217
  function readElementParagraphs(element) {
235749
236218
  const groups = groupElementParagraphs(element);
@@ -235873,14 +236342,14 @@ function mapOutlineKey(input, rowKey) {
235873
236342
  }
235874
236343
  return none;
235875
236344
  }
235876
- function withLevel(segments, level) {
236345
+ function withLevel(segments, level2) {
235877
236346
  return segments.map((segment, index) => {
235878
236347
  if (index > 0) {
235879
236348
  return segment;
235880
236349
  }
235881
236350
  const next = { ...segment };
235882
- if (level > 0) {
235883
- next.paragraphLevel = Math.min(level, MAX_PARAGRAPH_LEVEL);
236351
+ if (level2 > 0) {
236352
+ next.paragraphLevel = Math.min(level2, MAX_PARAGRAPH_LEVEL);
235884
236353
  } else {
235885
236354
  delete next.paragraphLevel;
235886
236355
  }
@@ -236019,12 +236488,12 @@ function applyIndent(slides, row, delta) {
236019
236488
  }
236020
236489
  const result = editParagraphs(slides, row, (paragraphs2) => {
236021
236490
  const current = paragraphs2[row.paragraphIndex];
236022
- const level = Math.min(Math.max(current.level + (delta > 0 ? 1 : -1), 0), MAX_PARAGRAPH_LEVEL);
236023
- if (level === current.level) {
236491
+ const level2 = Math.min(Math.max(current.level + (delta > 0 ? 1 : -1), 0), MAX_PARAGRAPH_LEVEL);
236492
+ if (level2 === current.level) {
236024
236493
  return null;
236025
236494
  }
236026
236495
  const next = [...paragraphs2];
236027
- next[row.paragraphIndex] = { ...current, level };
236496
+ next[row.paragraphIndex] = { ...current, level: level2 };
236028
236497
  return next;
236029
236498
  });
236030
236499
  return result ?? unchanged2([...slides], row);
@@ -236081,6 +236550,44 @@ function applyOutlineEdit(slides, edit, options = {}) {
236081
236550
  return unchanged2([...slides], row);
236082
236551
  }
236083
236552
  }
236553
+ var NUDGE_SMALL = 1;
236554
+ var NUDGE_LARGE = 10;
236555
+ function editorNudgeDelta(key2, large) {
236556
+ const step = large ? NUDGE_LARGE : NUDGE_SMALL;
236557
+ switch (key2) {
236558
+ case "ArrowLeft":
236559
+ return { dx: -step, dy: 0 };
236560
+ case "ArrowRight":
236561
+ return { dx: step, dy: 0 };
236562
+ case "ArrowUp":
236563
+ return { dx: 0, dy: -step };
236564
+ case "ArrowDown":
236565
+ return { dx: 0, dy: step };
236566
+ default:
236567
+ return null;
236568
+ }
236569
+ }
236570
+ function editorSlideStep(key2, hasSelection, withModifier) {
236571
+ if (withModifier) {
236572
+ return null;
236573
+ }
236574
+ if (key2 === "PageUp") {
236575
+ return "prevSlide";
236576
+ }
236577
+ if (key2 === "PageDown") {
236578
+ return "nextSlide";
236579
+ }
236580
+ if (hasSelection) {
236581
+ return null;
236582
+ }
236583
+ if (key2 === "ArrowLeft" || key2 === "ArrowUp") {
236584
+ return "prevSlide";
236585
+ }
236586
+ if (key2 === "ArrowRight" || key2 === "ArrowDown") {
236587
+ return "nextSlide";
236588
+ }
236589
+ return null;
236590
+ }
236084
236591
  function resolveChord(key2, shiftKey, hasSelection) {
236085
236592
  switch (key2.toLowerCase()) {
236086
236593
  case "z":
@@ -236222,8 +236729,6 @@ function isEditorControlTarget(target) {
236222
236729
  }
236223
236730
  return Boolean(element.closest(CONTROL_SELECTOR));
236224
236731
  }
236225
- var NUDGE_SMALL = 1;
236226
- var NUDGE_LARGE = 10;
236227
236732
  var GUARD_DEFAULTS = {
236228
236733
  canEdit: true,
236229
236734
  isPresenting: false,
@@ -236234,21 +236739,6 @@ var GUARD_DEFAULTS = {
236234
236739
  isTextInputTarget: false,
236235
236740
  isControlTarget: false
236236
236741
  };
236237
- function editorNudgeDelta(key2, large) {
236238
- const step = large ? NUDGE_LARGE : NUDGE_SMALL;
236239
- switch (key2) {
236240
- case "ArrowLeft":
236241
- return { dx: -step, dy: 0 };
236242
- case "ArrowRight":
236243
- return { dx: step, dy: 0 };
236244
- case "ArrowUp":
236245
- return { dx: 0, dy: -step };
236246
- case "ArrowDown":
236247
- return { dx: 0, dy: step };
236248
- default:
236249
- return null;
236250
- }
236251
- }
236252
236742
  var NO_ACTION = { action: null };
236253
236743
  function mapEditorKey(input, guard = {}) {
236254
236744
  const state = { ...GUARD_DEFAULTS, ...guard };
@@ -236301,18 +236791,13 @@ function mapEditorKey(input, guard = {}) {
236301
236791
  return chord2;
236302
236792
  }
236303
236793
  }
236794
+ const paging = editorSlideStep(key2, state.hasSelection, mod || alt);
236795
+ if (paging) {
236796
+ return { action: paging };
236797
+ }
236304
236798
  if (state.hasSelection) {
236305
236799
  const delta = editorNudgeDelta(key2, Boolean(input.shiftKey));
236306
- if (delta) {
236307
- return { action: "nudge", dx: delta.dx, dy: delta.dy };
236308
- }
236309
- return NO_ACTION;
236310
- }
236311
- if (key2 === "ArrowLeft") {
236312
- return { action: "prevSlide" };
236313
- }
236314
- if (key2 === "ArrowRight") {
236315
- return { action: "nextSlide" };
236800
+ return delta ? { action: "nudge", dx: delta.dx, dy: delta.dy } : NO_ACTION;
236316
236801
  }
236317
236802
  return NO_ACTION;
236318
236803
  }
@@ -242665,8 +243150,8 @@ var VIEWER_SHORTCUT_REFERENCE = [
242665
243150
  { actionKey: "pptx.ribbon.ungroup", shortcut: "Ctrl/Cmd+Shift+G" },
242666
243151
  { actionKey: "pptx.shortcuts.action.nudgeElement", shortcut: "Arrow keys" },
242667
243152
  { actionKey: "pptx.shortcuts.action.nudgeElementLarge", shortcut: "Shift+Arrow keys" },
242668
- { actionKey: "pptx.shortcuts.action.prevSlide", shortcut: "Left arrow" },
242669
- { actionKey: "pptx.shortcuts.action.nextSlide", shortcut: "Right arrow" },
243153
+ { actionKey: "pptx.shortcuts.action.prevSlide", shortcut: "Left or Up arrow, Page Up" },
243154
+ { actionKey: "pptx.shortcuts.action.nextSlide", shortcut: "Right or Down arrow, Page Down" },
242670
243155
  { actionKey: "pptx.shortcuts.action.zoomCanvas", shortcut: "Ctrl/Cmd+Mouse wheel" },
242671
243156
  { actionKey: "pptx.shortcuts.action.commitTextEdit", shortcut: "Ctrl/Cmd+Enter" },
242672
243157
  { actionKey: "pptx.shortcuts.action.cancelTextEdit", shortcut: "Escape" },
@@ -251188,6 +251673,7 @@ function createElementClass() {
251188
251673
  #resize = null;
251189
251674
  #intersect = null;
251190
251675
  #poll = null;
251676
+ #teardownPending = false;
251191
251677
  get spec() {
251192
251678
  return this.#spec;
251193
251679
  }
@@ -251196,9 +251682,7 @@ function createElementClass() {
251196
251682
  return;
251197
251683
  }
251198
251684
  this.#spec = value;
251199
- if (this.isConnected) {
251200
- void this.#controller?.setSpec(value);
251201
- }
251685
+ void this.#controller?.setSpec(value);
251202
251686
  }
251203
251687
  get interactive() {
251204
251688
  return this.hasAttribute("interactive");
@@ -251239,6 +251723,10 @@ function createElementClass() {
251239
251723
  }
251240
251724
  connectedCallback() {
251241
251725
  this.setAttribute(THREE_VIEW_MARKER_ATTR, "");
251726
+ if (this.#controller) {
251727
+ this.#teardownPending = false;
251728
+ return;
251729
+ }
251242
251730
  const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
251243
251731
  if (!this.#canvas) {
251244
251732
  root.innerHTML = `<style>${SHADOW_CSS}</style><div class="fallback" part="fallback"><slot></slot></div><div class="stage" part="stage"><canvas></canvas><div class="hit" part="hit"></div><div class="overlay" part="overlay"></div></div>`;
@@ -251266,6 +251754,15 @@ function createElementClass() {
251266
251754
  void this.#controller.setSpec(this.#spec);
251267
251755
  }
251268
251756
  disconnectedCallback() {
251757
+ this.#teardownPending = true;
251758
+ queueMicrotask(() => {
251759
+ if (this.#teardownPending && !this.isConnected) {
251760
+ this.#teardown();
251761
+ }
251762
+ });
251763
+ }
251764
+ #teardown() {
251765
+ this.#teardownPending = false;
251269
251766
  this.#resize?.disconnect();
251270
251767
  this.#intersect?.disconnect();
251271
251768
  if (this.#poll !== null) {
@@ -253962,24 +254459,42 @@ function isChart3DViewEnabled(flags, chartType) {
253962
254459
  }
253963
254460
  var chartSpecs = /* @__PURE__ */ new WeakMap();
253964
254461
  var smartArtSpecs = /* @__PURE__ */ new WeakMap();
253965
- function chartThreeViewSpec(element) {
253966
- if (chartSpecs.has(element)) {
253967
- return chartSpecs.get(element) ?? null;
254462
+ var lastByIdChart = /* @__PURE__ */ new Map();
254463
+ var lastByIdSmartArt = /* @__PURE__ */ new Map();
254464
+ var POSITION_KEYS = /* @__PURE__ */ new Set(["x", "y"]);
254465
+ function differsOnlyInPosition(a, b) {
254466
+ const ra = a;
254467
+ const rb = b;
254468
+ const keys = /* @__PURE__ */ new Set([...Object.keys(ra), ...Object.keys(rb)]);
254469
+ for (const key2 of keys) {
254470
+ if (!POSITION_KEYS.has(key2) && ra[key2] !== rb[key2]) {
254471
+ return false;
254472
+ }
253968
254473
  }
253969
- const spec2 = buildChart3DSpecForElement(element);
253970
- const view = spec2 ? { kind: "chart", spec: spec2 } : null;
253971
- chartSpecs.set(element, view);
253972
- return view;
254474
+ return true;
253973
254475
  }
253974
- function smartArtThreeViewSpec(element) {
253975
- if (smartArtSpecs.has(element)) {
253976
- return smartArtSpecs.get(element) ?? null;
254476
+ function memoised(element, byObject, byId, build7) {
254477
+ if (byObject.has(element)) {
254478
+ return byObject.get(element) ?? null;
253977
254479
  }
253978
- const spec2 = buildSmartArt3DSpecForElement(element);
253979
- const view = spec2 ? { kind: "smartart", spec: spec2 } : null;
253980
- smartArtSpecs.set(element, view);
254480
+ const last = byId.get(element.id);
254481
+ const view = last && differsOnlyInPosition(last.element, element) ? last.view : build7();
254482
+ byObject.set(element, view);
254483
+ byId.set(element.id, { element, view });
253981
254484
  return view;
253982
254485
  }
254486
+ function chartThreeViewSpec(element) {
254487
+ return memoised(element, chartSpecs, lastByIdChart, () => {
254488
+ const spec2 = buildChart3DSpecForElement(element);
254489
+ return spec2 ? { kind: "chart", spec: spec2 } : null;
254490
+ });
254491
+ }
254492
+ function smartArtThreeViewSpec(element) {
254493
+ return memoised(element, smartArtSpecs, lastByIdSmartArt, () => {
254494
+ const spec2 = buildSmartArt3DSpecForElement(element);
254495
+ return spec2 ? { kind: "smartart", spec: spec2 } : null;
254496
+ });
254497
+ }
253983
254498
  function resolveChartThreeViewSpec(element, flags) {
253984
254499
  if (element.type !== "chart" || !isChart3DViewEnabled(flags, element.chartData?.chartType)) {
253985
254500
  return null;