@usepagelet/runtime 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +24 -0
  2. package/dist/v1/capabilities.md +59 -0
  3. package/dist/v1/chunks/architecture-7EHR7CIX-CDRXMAVQ.js +2 -0
  4. package/dist/v1/chunks/architecture-7EHR7CIX-CDRXMAVQ.js.map +7 -0
  5. package/dist/v1/chunks/architectureDiagram-3BPJPVTR-EYIVUOEK.js +37 -0
  6. package/dist/v1/chunks/architectureDiagram-3BPJPVTR-EYIVUOEK.js.map +7 -0
  7. package/dist/v1/chunks/blockDiagram-GPEHLZMM-P7MBAWVH.js +133 -0
  8. package/dist/v1/chunks/blockDiagram-GPEHLZMM-P7MBAWVH.js.map +7 -0
  9. package/dist/v1/chunks/c4Diagram-AAUBKEIU-2XSL5LGB.js +11 -0
  10. package/dist/v1/chunks/c4Diagram-AAUBKEIU-2XSL5LGB.js.map +7 -0
  11. package/dist/v1/chunks/chunk-2STBDRRH.js +2 -0
  12. package/dist/v1/chunks/chunk-2STBDRRH.js.map +7 -0
  13. package/dist/v1/chunks/chunk-6AA7JQNC.js +71 -0
  14. package/dist/v1/chunks/chunk-6AA7JQNC.js.map +7 -0
  15. package/dist/v1/chunks/chunk-72WSJX2P.js +2 -0
  16. package/dist/v1/chunks/chunk-72WSJX2P.js.map +7 -0
  17. package/dist/v1/chunks/chunk-AUV7QZZ7.js +2 -0
  18. package/dist/v1/chunks/chunk-AUV7QZZ7.js.map +7 -0
  19. package/dist/v1/chunks/chunk-AZFF2WJO.js +2 -0
  20. package/dist/v1/chunks/chunk-AZFF2WJO.js.map +7 -0
  21. package/dist/v1/chunks/chunk-C2IUOGBD.js +2 -0
  22. package/dist/v1/chunks/chunk-C2IUOGBD.js.map +7 -0
  23. package/dist/v1/chunks/chunk-DKQVSAO3.js +2 -0
  24. package/dist/v1/chunks/chunk-DKQVSAO3.js.map +7 -0
  25. package/dist/v1/chunks/chunk-DS52DG6H.js +2 -0
  26. package/dist/v1/chunks/chunk-DS52DG6H.js.map +7 -0
  27. package/dist/v1/chunks/chunk-DXEOG5W4.js +2 -0
  28. package/dist/v1/chunks/chunk-DXEOG5W4.js.map +7 -0
  29. package/dist/v1/chunks/chunk-EHSK6IMI.js +3 -0
  30. package/dist/v1/chunks/chunk-EHSK6IMI.js.map +7 -0
  31. package/dist/v1/chunks/chunk-FWZR474D.js +2 -0
  32. package/dist/v1/chunks/chunk-FWZR474D.js.map +7 -0
  33. package/dist/v1/chunks/chunk-FYLAOHYS.js +2 -0
  34. package/dist/v1/chunks/chunk-FYLAOHYS.js.map +7 -0
  35. package/dist/v1/chunks/chunk-G6W4FKMG.js +2 -0
  36. package/dist/v1/chunks/chunk-G6W4FKMG.js.map +7 -0
  37. package/dist/v1/chunks/chunk-HLP6UJDY.js +2 -0
  38. package/dist/v1/chunks/chunk-HLP6UJDY.js.map +7 -0
  39. package/dist/v1/chunks/chunk-IGLPGT7W.js +160 -0
  40. package/dist/v1/chunks/chunk-IGLPGT7W.js.map +7 -0
  41. package/dist/v1/chunks/chunk-IQVRW6XA.js +322 -0
  42. package/dist/v1/chunks/chunk-IQVRW6XA.js.map +7 -0
  43. package/dist/v1/chunks/chunk-IY5OUPDU.js +5 -0
  44. package/dist/v1/chunks/chunk-IY5OUPDU.js.map +7 -0
  45. package/dist/v1/chunks/chunk-JOJIMF7A.js +2 -0
  46. package/dist/v1/chunks/chunk-JOJIMF7A.js.map +7 -0
  47. package/dist/v1/chunks/chunk-NWD66TP4.js +2 -0
  48. package/dist/v1/chunks/chunk-NWD66TP4.js.map +7 -0
  49. package/dist/v1/chunks/chunk-PLQZIFSO.js +2 -0
  50. package/dist/v1/chunks/chunk-PLQZIFSO.js.map +7 -0
  51. package/dist/v1/chunks/chunk-PVPXGQIV.js +2 -0
  52. package/dist/v1/chunks/chunk-PVPXGQIV.js.map +7 -0
  53. package/dist/v1/chunks/chunk-QDJGX3SU.js +16 -0
  54. package/dist/v1/chunks/chunk-QDJGX3SU.js.map +7 -0
  55. package/dist/v1/chunks/chunk-QSGUWHXF.js +2 -0
  56. package/dist/v1/chunks/chunk-QSGUWHXF.js.map +7 -0
  57. package/dist/v1/chunks/chunk-RCIRWMC7.js +2 -0
  58. package/dist/v1/chunks/chunk-RCIRWMC7.js.map +7 -0
  59. package/dist/v1/chunks/chunk-S4ACHXBI.js +2 -0
  60. package/dist/v1/chunks/chunk-S4ACHXBI.js.map +7 -0
  61. package/dist/v1/chunks/chunk-SA4K3XYV.js +2 -0
  62. package/dist/v1/chunks/chunk-SA4K3XYV.js.map +7 -0
  63. package/dist/v1/chunks/chunk-SAENYLYK.js +232 -0
  64. package/dist/v1/chunks/chunk-SAENYLYK.js.map +7 -0
  65. package/dist/v1/chunks/chunk-SN6BTAM3.js +4 -0
  66. package/dist/v1/chunks/chunk-SN6BTAM3.js.map +7 -0
  67. package/dist/v1/chunks/chunk-SWJRRCAF.js +2 -0
  68. package/dist/v1/chunks/chunk-SWJRRCAF.js.map +7 -0
  69. package/dist/v1/chunks/chunk-TGL5CWDU.js +63 -0
  70. package/dist/v1/chunks/chunk-TGL5CWDU.js.map +7 -0
  71. package/dist/v1/chunks/chunk-TVSQ2OZ6.js +11 -0
  72. package/dist/v1/chunks/chunk-TVSQ2OZ6.js.map +7 -0
  73. package/dist/v1/chunks/chunk-URGT6V7R.js +2 -0
  74. package/dist/v1/chunks/chunk-URGT6V7R.js.map +7 -0
  75. package/dist/v1/chunks/chunk-WBEUYPCI.js +123 -0
  76. package/dist/v1/chunks/chunk-WBEUYPCI.js.map +7 -0
  77. package/dist/v1/chunks/chunk-WEZ3ELJO.js +2 -0
  78. package/dist/v1/chunks/chunk-WEZ3ELJO.js.map +7 -0
  79. package/dist/v1/chunks/chunk-WIIGSS4X.js +2 -0
  80. package/dist/v1/chunks/chunk-WIIGSS4X.js.map +7 -0
  81. package/dist/v1/chunks/chunk-XUJKMBZ5.js +2 -0
  82. package/dist/v1/chunks/chunk-XUJKMBZ5.js.map +7 -0
  83. package/dist/v1/chunks/chunk-YC75LZ32.js +33 -0
  84. package/dist/v1/chunks/chunk-YC75LZ32.js.map +7 -0
  85. package/dist/v1/chunks/chunk-YK2CHHQT.js +207 -0
  86. package/dist/v1/chunks/chunk-YK2CHHQT.js.map +7 -0
  87. package/dist/v1/chunks/chunk-YYWGGXI6.js +2 -0
  88. package/dist/v1/chunks/chunk-YYWGGXI6.js.map +7 -0
  89. package/dist/v1/chunks/chunk-ZY7EQCMR.js +4 -0
  90. package/dist/v1/chunks/chunk-ZY7EQCMR.js.map +7 -0
  91. package/dist/v1/chunks/classDiagram-4FO5ZUOK-4VU3VATX.js +2 -0
  92. package/dist/v1/chunks/classDiagram-4FO5ZUOK-4VU3VATX.js.map +7 -0
  93. package/dist/v1/chunks/classDiagram-v2-Q7XG4LA2-QIBN3KO6.js +2 -0
  94. package/dist/v1/chunks/classDiagram-v2-Q7XG4LA2-QIBN3KO6.js.map +7 -0
  95. package/dist/v1/chunks/cose-bilkent-S5V4N54A-MHLDSCZY.js +2 -0
  96. package/dist/v1/chunks/cose-bilkent-S5V4N54A-MHLDSCZY.js.map +7 -0
  97. package/dist/v1/chunks/dagre-BM42HDAG-U3ECKIMS.js +5 -0
  98. package/dist/v1/chunks/dagre-BM42HDAG-U3ECKIMS.js.map +7 -0
  99. package/dist/v1/chunks/diagram-2AECGRRQ-BNRGNWOM.js +44 -0
  100. package/dist/v1/chunks/diagram-2AECGRRQ-BNRGNWOM.js.map +7 -0
  101. package/dist/v1/chunks/diagram-5GNKFQAL-CPWZIJ4M.js +11 -0
  102. package/dist/v1/chunks/diagram-5GNKFQAL-CPWZIJ4M.js.map +7 -0
  103. package/dist/v1/chunks/diagram-KO2AKTUF-7CDCIBL3.js +4 -0
  104. package/dist/v1/chunks/diagram-KO2AKTUF-7CDCIBL3.js.map +7 -0
  105. package/dist/v1/chunks/diagram-LMA3HP47-LPHFNXWX.js +25 -0
  106. package/dist/v1/chunks/diagram-LMA3HP47-LPHFNXWX.js.map +7 -0
  107. package/dist/v1/chunks/diagram-OG6HWLK6-FWJ2MCGI.js +25 -0
  108. package/dist/v1/chunks/diagram-OG6HWLK6-FWJ2MCGI.js.map +7 -0
  109. package/dist/v1/chunks/erDiagram-TEJ5UH35-OX62GPYU.js +86 -0
  110. package/dist/v1/chunks/erDiagram-TEJ5UH35-OX62GPYU.js.map +7 -0
  111. package/dist/v1/chunks/eventmodeling-FCH6USID-NRRIBZEB.js +2 -0
  112. package/dist/v1/chunks/eventmodeling-FCH6USID-NRRIBZEB.js.map +7 -0
  113. package/dist/v1/chunks/flowDiagram-I6XJVG4X-I4ULL6MS.js +163 -0
  114. package/dist/v1/chunks/flowDiagram-I6XJVG4X-I4ULL6MS.js.map +7 -0
  115. package/dist/v1/chunks/ganttDiagram-6RSMTGT7-TIDOVKXT.js +293 -0
  116. package/dist/v1/chunks/ganttDiagram-6RSMTGT7-TIDOVKXT.js.map +7 -0
  117. package/dist/v1/chunks/gitGraph-WXDBUCRP-4LEEA2GI.js +2 -0
  118. package/dist/v1/chunks/gitGraph-WXDBUCRP-4LEEA2GI.js.map +7 -0
  119. package/dist/v1/chunks/gitGraphDiagram-PVQCEYII-BPEBW2KG.js +107 -0
  120. package/dist/v1/chunks/gitGraphDiagram-PVQCEYII-BPEBW2KG.js.map +7 -0
  121. package/dist/v1/chunks/info-J43DQDTF-EI2RS372.js +2 -0
  122. package/dist/v1/chunks/info-J43DQDTF-EI2RS372.js.map +7 -0
  123. package/dist/v1/chunks/infoDiagram-5YYISTIA-5GFVQYI7.js +3 -0
  124. package/dist/v1/chunks/infoDiagram-5YYISTIA-5GFVQYI7.js.map +7 -0
  125. package/dist/v1/chunks/ishikawaDiagram-YF4QCWOH-AZ7PAHIN.js +71 -0
  126. package/dist/v1/chunks/ishikawaDiagram-YF4QCWOH-AZ7PAHIN.js.map +7 -0
  127. package/dist/v1/chunks/journeyDiagram-JHISSGLW-B4ZN6VTS.js +140 -0
  128. package/dist/v1/chunks/journeyDiagram-JHISSGLW-B4ZN6VTS.js.map +7 -0
  129. package/dist/v1/chunks/kanban-definition-UN3LZRKU-5THRXHJP.js +90 -0
  130. package/dist/v1/chunks/kanban-definition-UN3LZRKU-5THRXHJP.js.map +7 -0
  131. package/dist/v1/chunks/katex-CLI7E3QC.js +258 -0
  132. package/dist/v1/chunks/katex-CLI7E3QC.js.map +7 -0
  133. package/dist/v1/chunks/mindmap-definition-RKZ34NQL-E57QDEMN.js +97 -0
  134. package/dist/v1/chunks/mindmap-definition-RKZ34NQL-E57QDEMN.js.map +7 -0
  135. package/dist/v1/chunks/packet-YPE3B663-PKWGZRBL.js +2 -0
  136. package/dist/v1/chunks/packet-YPE3B663-PKWGZRBL.js.map +7 -0
  137. package/dist/v1/chunks/pie-LRSECV5Y-QSTOXR4H.js +2 -0
  138. package/dist/v1/chunks/pie-LRSECV5Y-QSTOXR4H.js.map +7 -0
  139. package/dist/v1/chunks/pieDiagram-4H26LBE5-CZULUIHM.js +31 -0
  140. package/dist/v1/chunks/pieDiagram-4H26LBE5-CZULUIHM.js.map +7 -0
  141. package/dist/v1/chunks/quadrantDiagram-W4KKPZXB-WRXQ2LCP.js +8 -0
  142. package/dist/v1/chunks/quadrantDiagram-W4KKPZXB-WRXQ2LCP.js.map +7 -0
  143. package/dist/v1/chunks/radar-GUYGQ44K-UJHF7VJA.js +2 -0
  144. package/dist/v1/chunks/radar-GUYGQ44K-UJHF7VJA.js.map +7 -0
  145. package/dist/v1/chunks/requirementDiagram-4Y6WPE33-LUKBHY3G.js +85 -0
  146. package/dist/v1/chunks/requirementDiagram-4Y6WPE33-LUKBHY3G.js.map +7 -0
  147. package/dist/v1/chunks/sankeyDiagram-5OEKKPKP-IHGIKQ7Q.js +41 -0
  148. package/dist/v1/chunks/sankeyDiagram-5OEKKPKP-IHGIKQ7Q.js.map +7 -0
  149. package/dist/v1/chunks/sequenceDiagram-3UESZ5HK-AZIJM7V2.js +163 -0
  150. package/dist/v1/chunks/sequenceDiagram-3UESZ5HK-AZIJM7V2.js.map +7 -0
  151. package/dist/v1/chunks/stateDiagram-AJRCARHV-7TL53ICK.js +2 -0
  152. package/dist/v1/chunks/stateDiagram-AJRCARHV-7TL53ICK.js.map +7 -0
  153. package/dist/v1/chunks/stateDiagram-v2-BHNVJYJU-TJ245A24.js +2 -0
  154. package/dist/v1/chunks/stateDiagram-v2-BHNVJYJU-TJ245A24.js.map +7 -0
  155. package/dist/v1/chunks/timeline-definition-PNZ67QCA-C5FF5CVI.js +121 -0
  156. package/dist/v1/chunks/timeline-definition-PNZ67QCA-C5FF5CVI.js.map +7 -0
  157. package/dist/v1/chunks/treeView-BLDUP644-2MCPJRE2.js +2 -0
  158. package/dist/v1/chunks/treeView-BLDUP644-2MCPJRE2.js.map +7 -0
  159. package/dist/v1/chunks/treemap-LRROVOQU-WSVRI32O.js +2 -0
  160. package/dist/v1/chunks/treemap-LRROVOQU-WSVRI32O.js.map +7 -0
  161. package/dist/v1/chunks/vennDiagram-CIIHVFJN-NQU7FBQX.js +35 -0
  162. package/dist/v1/chunks/vennDiagram-CIIHVFJN-NQU7FBQX.js.map +7 -0
  163. package/dist/v1/chunks/wardley-L42UT6IY-GONRRIFG.js +2 -0
  164. package/dist/v1/chunks/wardley-L42UT6IY-GONRRIFG.js.map +7 -0
  165. package/dist/v1/chunks/wardleyDiagram-YWT4CUSO-KNM7EB5A.js +79 -0
  166. package/dist/v1/chunks/wardleyDiagram-YWT4CUSO-KNM7EB5A.js.map +7 -0
  167. package/dist/v1/chunks/xychartDiagram-2RQKCTM6-CMGOBHPC.js +8 -0
  168. package/dist/v1/chunks/xychartDiagram-2RQKCTM6-CMGOBHPC.js.map +7 -0
  169. package/dist/v1/modules/charts.js +4 -0
  170. package/dist/v1/modules/charts.js.map +7 -0
  171. package/dist/v1/modules/code.js +26 -0
  172. package/dist/v1/modules/code.js.map +7 -0
  173. package/dist/v1/modules/markdown.js +65 -0
  174. package/dist/v1/modules/markdown.js.map +7 -0
  175. package/dist/v1/modules/math.js +258 -0
  176. package/dist/v1/modules/math.js.map +7 -0
  177. package/dist/v1/modules/mermaid.js +9 -0
  178. package/dist/v1/modules/mermaid.js.map +7 -0
  179. package/dist/v1/modules/png.js +3 -0
  180. package/dist/v1/modules/png.js.map +7 -0
  181. package/dist/v1/pagelet.js +128 -0
  182. package/dist/v1/pagelet.js.map +7 -0
  183. package/package.json +40 -0
@@ -0,0 +1,79 @@
1
+ import{a as ct}from"./chunk-DS52DG6H.js";import{a as pt}from"./chunk-ZY7EQCMR.js";import"./chunk-72WSJX2P.js";import"./chunk-WIIGSS4X.js";import"./chunk-FWZR474D.js";import"./chunk-C2IUOGBD.js";import"./chunk-YYWGGXI6.js";import"./chunk-SWJRRCAF.js";import"./chunk-WEZ3ELJO.js";import"./chunk-NWD66TP4.js";import"./chunk-PLQZIFSO.js";import"./chunk-QSGUWHXF.js";import"./chunk-IGLPGT7W.js";import{a as lt}from"./chunk-DXEOG5W4.js";import{o as Z}from"./chunk-EHSK6IMI.js";import"./chunk-SA4K3XYV.js";import{A as tt,N as et,S as at,T as rt,U as ot,V as nt,W as st,X as it,Y as dt,Z as G,o as Q}from"./chunk-WBEUYPCI.js";import{b as u,d as _}from"./chunk-PVPXGQIV.js";import"./chunk-SN6BTAM3.js";import"./chunk-URGT6V7R.js";var q=u((o,r)=>{let e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:q(r,`${e} evolution`),y:q(o,`${e} visibility`)}),"toCoordinates"),ft=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};let e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(ct(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){let e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{let h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{let h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{let h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{let h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{let w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=q(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{let h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-.")),a=ft(e.fromPort)??ft(e.toPort),{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);let C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{let h=r.getNode(e.component);if(h?.y!==void 0){let a=q(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){let e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{let h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{let h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{let h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),ht={parser:{yy:void 0},parse:u(async o=>{let r=await pt("wardley",o);_.debug(r);let e=ht.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){let e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});let e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){let h=this.pipelines.get(r);h&&h.componentIds.push(e);let a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(let[e,h]of this.nodes)if(h.label===r)return e;return r}build(){let r=[];for(let e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function xt(){return G()["wardley-beta"]}u(xt,"getConfig");function gt(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(gt,"addNode");function yt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(yt,"addLink");function ut(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ut,"addTrend");function wt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(wt,"addAnnotation");function mt(o,r,e){k.addNote({text:o,x:r,y:e})}u(mt,"addNote");function kt(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(kt,"addAccelerator");function bt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(bt,"addDeaccelerator");function $t(o,r){k.setAnnotationsBox(o,r)}u($t,"setAnnotationsBox");function vt(o,r){k.setSize(o,r)}u(vt,"setSize");function Pt(o){k.startPipeline(o)}u(Pt,"startPipeline");function Ct(o,r){k.addPipelineComponent(o,r)}u(Ct,"addPipelineComponent");function St(o){k.setAxes(o)}u(St,"updateAxes");function Mt(o){return k.getNode(o)}u(Mt,"getNode");function Nt(o){return k.resolveNodeId(o)}u(Nt,"resolveNodeId");function zt(){return k.build()}u(zt,"getWardleyData");function Lt(){k.clear(),at()}u(Lt,"clear");var Gt={getConfig:xt,addNode:gt,addLink:yt,addTrend:ut,addAnnotation:wt,addNote:mt,addAccelerator:kt,addDeaccelerator:bt,setAnnotationsBox:$t,setSize:vt,startPipeline:Pt,addPipelineComponent:Ct,updateAxes:St,getNode:Mt,resolveNodeId:Nt,getWardleyData:zt,clear:Lt,setAccTitle:rt,getAccTitle:ot,setDiagramTitle:it,getDiagramTitle:dt,getAccDescription:st,setAccDescription:nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{let{themeVariables:o}=G();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{let o=G()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{_.debug(`Rendering Wardley map
2
+ `+o);let a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=lt(r);Y.selectAll("*").remove(),et(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);let v=Y.append("g").attr("class","wardley-map"),H=Y.append("defs");H.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),H.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);let I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);let z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);let Tt=g.axes.xLabel??"Evolution",At=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Tt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(At);let F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){let t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{let i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{let l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){let t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){let n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}let c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){let t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){let y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{let y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){let y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){let N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let U=v.append("g").attr("class","wardley-links"),J=new Map;g.pipelines.forEach(t=>{J.set(t.nodeId,new Set(t.componentIds))});let K=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||J.get(t.target)?.has(t.source)));U.selectAll("line").data(K).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{let s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{let s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{let s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{let s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),U.selectAll("text").data(K.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{let s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{let s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{let s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y,X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);let Xt=v.append("g").attr("class","wardley-trends"),Et=g.trends.map(t=>{let s=c.get(t.nodeId);if(!s)return null;let n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);Xt.selectAll("line").data(Et).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);let M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);let j=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",j).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",j).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",j).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{let s=c.get(t.id),n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{let s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{let s=c.get(t.id),n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{let s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{let s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);let i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{let s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);let i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){let t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{let n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{let p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y),i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{let N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(V=>{let D=V.node(),Ft=D.getComputedTextLength();m=Math.max(m,Ft);let Rt=D.getBBox();P=Math.max(P,Rt.height)});let N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,Yt=S-a.padding-N,It=a.padding,Bt=b-a.padding-W;s=Math.max(X,Math.min(s,Yt)),n=Math.max(It,Math.min(n,Bt)),y.forEach((V,D)=>{V.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){let t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{let n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){let t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{let n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
3
+ M ${n} ${i-l/2}
4
+ L ${n+p-f} ${i-l/2}
5
+ L ${n+p-f} ${i-l/2-8}
6
+ L ${n+p} ${i}
7
+ L ${n+p-f} ${i+l/2+8}
8
+ L ${n+p-f} ${i+l/2}
9
+ L ${n} ${i+l/2}
10
+ Z
11
+ `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}if(g.deaccelerators.length>0){let t=v.append("g").attr("class","wardley-deaccelerators");g.deaccelerators.forEach(s=>{let n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
12
+ M ${n+p} ${i-l/2}
13
+ L ${n+f} ${i-l/2}
14
+ L ${n+f} ${i-l/2-8}
15
+ L ${n} ${i}
16
+ L ${n+f} ${i+l/2+8}
17
+ L ${n+f} ${i+l/2}
18
+ L ${n+p} ${i+l/2}
19
+ Z
20
+ `;t.append("path").attr("d",x).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),t.append("text").attr("x",n+p/2).attr("y",i+l/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.name)})}},"draw"),_t={draw:Vt},Zt=u(({wardley:o}={})=>{let r=Q(),e=tt(),h=Z(r,e.themeVariables),a=Z(h.wardley,o);return`
21
+ .wardley-background {
22
+ fill: ${a.backgroundColor};
23
+ }
24
+ .wardley-axes line, .wardley-axes path {
25
+ stroke: ${a.axisColor};
26
+ }
27
+ .wardley-axis-label {
28
+ fill: ${a.axisTextColor};
29
+ }
30
+ .wardley-stage-label {
31
+ fill: ${a.axisTextColor};
32
+ }
33
+ .wardley-grid line {
34
+ stroke: ${a.gridColor};
35
+ }
36
+ .wardley-node circle {
37
+ fill: ${a.componentFill};
38
+ stroke: ${a.componentStroke};
39
+ }
40
+ .wardley-node-label {
41
+ fill: ${a.componentLabelColor};
42
+ }
43
+ .wardley-link {
44
+ stroke: ${a.linkStroke};
45
+ }
46
+ .wardley-link--dashed {
47
+ stroke-dasharray: 4 4;
48
+ }
49
+ .wardley-link-label {
50
+ fill: ${a.axisTextColor};
51
+ }
52
+ .wardley-trend line {
53
+ stroke: ${a.evolutionStroke};
54
+ }
55
+ .wardley-annotation-line {
56
+ stroke: ${a.annotationStroke};
57
+ }
58
+ .wardley-annotation circle {
59
+ fill: ${a.annotationFill};
60
+ stroke: ${a.annotationStroke};
61
+ }
62
+ .wardley-annotation text {
63
+ fill: ${a.annotationTextColor};
64
+ }
65
+ .wardley-annotations-box rect {
66
+ fill: ${a.annotationFill};
67
+ stroke: ${a.annotationStroke};
68
+ }
69
+ .wardley-annotations-box text {
70
+ fill: ${a.annotationTextColor};
71
+ }
72
+ .wardley-pipeline-box {
73
+ stroke: ${a.componentStroke};
74
+ }
75
+ .wardley-notes text {
76
+ fill: ${a.axisTextColor};
77
+ }
78
+ `},"styles"),re={parser:ht,db:Gt,renderer:_t,styles:Zt};export{re as diagram};
79
+ //# sourceMappingURL=wardleyDiagram-YWT4CUSO-KNM7EB5A.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../node_modules/.pnpm/mermaid@11.15.0/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-YWT4CUSO.mjs"],
4
+ "sourcesContent": ["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n getAccDescription,\n getAccTitle,\n getConfig,\n getConfig2,\n getDiagramTitle,\n getThemeVariables,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/wardley/wardleyParser.ts\nimport { parse } from \"@mermaid-js/parser\";\nvar toPercent = /* @__PURE__ */ __name((value, context) => {\n const normalized = value <= 1 ? value * 100 : value;\n if (normalized < 0 || normalized > 100) {\n throw new Error(\n `${context} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${value}`\n );\n }\n return normalized;\n}, \"toPercent\");\nvar toCoordinates = /* @__PURE__ */ __name((visibility, evolution, context) => {\n return {\n x: toPercent(evolution, `${context} evolution`),\n y: toPercent(visibility, `${context} visibility`)\n };\n}, \"toCoordinates\");\nvar getFlowFromPort = /* @__PURE__ */ __name((port) => {\n if (!port) {\n return void 0;\n }\n if (port === \"+<>\") {\n return \"bidirectional\";\n }\n if (port === \"+<\") {\n return \"backward\";\n }\n if (port === \"+>\") {\n return \"forward\";\n }\n return void 0;\n}, \"getFlowFromPort\");\nvar extractFlowFromArrow = /* @__PURE__ */ __name((arrow) => {\n if (!arrow?.startsWith(\"+\")) {\n return {};\n }\n const labelMatch = /^\\+'([^']*)'/.exec(arrow);\n const flowLabel = labelMatch?.[1];\n if (arrow.includes(\"<>\")) {\n return { flow: \"bidirectional\", label: flowLabel };\n }\n if (arrow.includes(\"<\")) {\n return { flow: \"backward\", label: flowLabel };\n }\n if (arrow.includes(\">\")) {\n return { flow: \"forward\", label: flowLabel };\n }\n return { label: flowLabel };\n}, \"extractFlowFromArrow\");\nvar populateDb = /* @__PURE__ */ __name((ast, db) => {\n populateCommonDb(ast, db);\n if (ast.size) {\n db.setSize(ast.size.width, ast.size.height);\n }\n if (ast.evolution) {\n const stages = ast.evolution.stages.map((stage) => {\n if (stage.secondName) {\n return `${stage.name.trim()} / ${stage.secondName.trim()}`;\n }\n return stage.name.trim();\n });\n const stageBoundaries = ast.evolution.stages.filter((stage) => stage.boundary !== void 0).map((stage) => stage.boundary);\n db.updateAxes({ stages, stageBoundaries });\n }\n ast.anchors.forEach((anchor) => {\n const coords = toCoordinates(anchor.visibility, anchor.evolution, `Anchor \"${anchor.name}\"`);\n db.addNode(anchor.name, anchor.name, coords.x, coords.y, \"anchor\");\n });\n ast.components.forEach((component) => {\n const coords = toCoordinates(\n component.visibility,\n component.evolution,\n `Component \"${component.name}\"`\n );\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const sourceStrategy = component.decorator?.strategy;\n db.addNode(\n component.name,\n component.name,\n coords.x,\n coords.y,\n \"component\",\n labelOffsetX,\n labelOffsetY,\n component.inertia,\n sourceStrategy\n );\n });\n ast.notes.forEach((note) => {\n const coords = toCoordinates(note.visibility, note.evolution, `Note \"${note.text}\"`);\n db.addNote(note.text, coords.x, coords.y);\n });\n ast.pipelines.forEach((pipeline) => {\n const parentNode = db.getNode(pipeline.parent);\n if (!parentNode || typeof parentNode.y !== \"number\") {\n throw new Error(\n `Pipeline \"${pipeline.parent}\" must reference an existing component with coordinates.`\n );\n }\n const parentY = parentNode.y;\n db.startPipeline(pipeline.parent);\n pipeline.components.forEach((component) => {\n const componentId = `${pipeline.parent}_${component.name}`;\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const x = toPercent(component.evolution, `Pipeline component \"${component.name}\" evolution`);\n db.addNode(\n componentId,\n component.name,\n x,\n parentY,\n \"pipeline-component\",\n labelOffsetX,\n labelOffsetY\n );\n db.addPipelineComponent(pipeline.parent, componentId);\n });\n });\n ast.links.forEach((link) => {\n const isDashed = !!link.arrow && (link.arrow.includes(\"-.->\") || link.arrow.includes(\".-.\"));\n let flow = getFlowFromPort(link.fromPort) ?? getFlowFromPort(link.toPort);\n const { flow: arrowFlow, label: flowLabel } = extractFlowFromArrow(link.arrow);\n if (!flow && arrowFlow) {\n flow = arrowFlow;\n }\n const annotation = link.linkLabel;\n const label = flowLabel ?? annotation;\n db.addLink(db.resolveNodeId(link.from), db.resolveNodeId(link.to), isDashed, label, flow);\n });\n ast.evolves.forEach((evolve) => {\n const node = db.getNode(evolve.component);\n if (node?.y !== void 0) {\n const target = toPercent(evolve.target, `Evolve target for \"${evolve.component}\"`);\n db.addTrend(evolve.component, target, node.y);\n }\n });\n if (ast.annotations.length > 0) {\n const annotationsBox = ast.annotations[0];\n const coords = toCoordinates(annotationsBox.x, annotationsBox.y, \"Annotations box\");\n db.setAnnotationsBox(coords.x, coords.y);\n }\n ast.annotation.forEach((annotation) => {\n const coords = toCoordinates(annotation.x, annotation.y, `Annotation ${annotation.number}`);\n db.addAnnotation(annotation.number, [{ x: coords.x, y: coords.y }], annotation.text);\n });\n ast.accelerators.forEach((accelerator) => {\n const coords = toCoordinates(accelerator.x, accelerator.y, `Accelerator \"${accelerator.name}\"`);\n db.addAccelerator(accelerator.name, coords.x, coords.y);\n });\n ast.deaccelerators.forEach((deaccelerator) => {\n const coords = toCoordinates(\n deaccelerator.x,\n deaccelerator.y,\n `Deaccelerator \"${deaccelerator.name}\"`\n );\n db.addDeaccelerator(deaccelerator.name, coords.x, coords.y);\n });\n}, \"populateDb\");\nvar parser = {\n parser: {\n // @ts-expect-error - WardleyDB is not assignable to DiagramDB\n yy: void 0\n },\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"wardley\", input);\n log.debug(ast);\n const db = parser.parser?.yy;\n if (!db || typeof db.addNode !== \"function\") {\n throw new Error(\n \"parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.\"\n );\n }\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/wardley/wardleyBuilder.ts\nvar WardleyBuilder = class {\n constructor() {\n this.nodes = /* @__PURE__ */ new Map();\n this.links = [];\n this.trends = /* @__PURE__ */ new Map();\n this.pipelines = /* @__PURE__ */ new Map();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.axes = {};\n }\n static {\n __name(this, \"WardleyBuilder\");\n }\n addNode(node) {\n const existing = this.nodes.get(node.id) ?? { id: node.id, label: node.label };\n const merged = {\n ...existing,\n ...node,\n className: node.className ?? existing.className,\n labelOffsetX: node.labelOffsetX ?? existing.labelOffsetX,\n labelOffsetY: node.labelOffsetY ?? existing.labelOffsetY\n };\n this.nodes.set(node.id, merged);\n }\n addLink(link) {\n this.links.push(link);\n }\n addTrend(trend) {\n this.trends.set(trend.nodeId, trend);\n }\n startPipeline(nodeId) {\n this.pipelines.set(nodeId, { nodeId, componentIds: [] });\n const node = this.nodes.get(nodeId);\n if (node) {\n node.isPipelineParent = true;\n }\n }\n addPipelineComponent(pipelineNodeId, componentId) {\n const pipeline = this.pipelines.get(pipelineNodeId);\n if (pipeline) {\n pipeline.componentIds.push(componentId);\n }\n const node = this.nodes.get(componentId);\n if (node) {\n node.inPipeline = true;\n }\n }\n addAnnotation(annotation) {\n this.annotations.push(annotation);\n }\n addNote(note) {\n this.notes.push(note);\n }\n addAccelerator(accelerator) {\n this.accelerators.push(accelerator);\n }\n addDeaccelerator(deaccelerator) {\n this.deaccelerators.push(deaccelerator);\n }\n setAnnotationsBox(x, y) {\n this.annotationsBox = { x, y };\n }\n setAxes(partial) {\n this.axes = {\n ...this.axes,\n ...partial\n };\n }\n setSize(width, height) {\n this.size = { width, height };\n }\n getNode(id) {\n return this.nodes.get(id);\n }\n /**\n * Resolve a name to a node ID. Tries exact ID match first,\n * then falls back to finding a node whose label matches the name\n * (handles pipeline components which have synthetic IDs like \"Parent_Child\").\n */\n resolveNodeId(name) {\n if (this.nodes.has(name)) {\n return name;\n }\n for (const [id, node] of this.nodes) {\n if (node.label === name) {\n return id;\n }\n }\n return name;\n }\n build() {\n const nodes = [];\n for (const node of this.nodes.values()) {\n if (typeof node.x !== \"number\" || typeof node.y !== \"number\") {\n throw new Error(`Node \"${node.label}\" is missing coordinates`);\n }\n nodes.push(node);\n }\n return {\n nodes,\n links: [...this.links],\n trends: [...this.trends.values()],\n pipelines: [...this.pipelines.values()],\n annotations: [...this.annotations],\n notes: [...this.notes],\n accelerators: [...this.accelerators],\n deaccelerators: [...this.deaccelerators],\n annotationsBox: this.annotationsBox,\n axes: { ...this.axes },\n size: this.size\n };\n }\n clear() {\n this.nodes.clear();\n this.links = [];\n this.trends.clear();\n this.pipelines.clear();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.annotationsBox = void 0;\n this.axes = {};\n this.size = void 0;\n }\n};\n\n// src/diagrams/wardley/wardleyDb.ts\nvar builder = new WardleyBuilder();\nfunction getConfig3() {\n return getConfig2()[\"wardley-beta\"];\n}\n__name(getConfig3, \"getConfig\");\nfunction addNode(id, label, x, y, className, labelOffsetX, labelOffsetY, inertia, sourceStrategy) {\n builder.addNode({\n id,\n label,\n x,\n y,\n className,\n labelOffsetX,\n labelOffsetY,\n inertia,\n sourceStrategy\n });\n}\n__name(addNode, \"addNode\");\nfunction addLink(sourceId, targetId, dashed = false, label, flow) {\n builder.addLink({\n source: sourceId,\n target: targetId,\n dashed,\n label,\n flow\n });\n}\n__name(addLink, \"addLink\");\nfunction addTrend(nodeId, targetX, targetY) {\n builder.addTrend({ nodeId, targetX, targetY });\n}\n__name(addTrend, \"addTrend\");\nfunction addAnnotation(number, coordinates, text) {\n builder.addAnnotation({\n number,\n coordinates,\n text\n });\n}\n__name(addAnnotation, \"addAnnotation\");\nfunction addNote(text, x, y) {\n builder.addNote({\n text,\n x,\n y\n });\n}\n__name(addNote, \"addNote\");\nfunction addAccelerator(name, x, y) {\n builder.addAccelerator({\n name,\n x,\n y\n });\n}\n__name(addAccelerator, \"addAccelerator\");\nfunction addDeaccelerator(name, x, y) {\n builder.addDeaccelerator({\n name,\n x,\n y\n });\n}\n__name(addDeaccelerator, \"addDeaccelerator\");\nfunction setAnnotationsBox(x, y) {\n builder.setAnnotationsBox(x, y);\n}\n__name(setAnnotationsBox, \"setAnnotationsBox\");\nfunction setSize(width, height) {\n builder.setSize(width, height);\n}\n__name(setSize, \"setSize\");\nfunction startPipeline(nodeId) {\n builder.startPipeline(nodeId);\n}\n__name(startPipeline, \"startPipeline\");\nfunction addPipelineComponent(pipelineNodeId, componentId) {\n builder.addPipelineComponent(pipelineNodeId, componentId);\n}\n__name(addPipelineComponent, \"addPipelineComponent\");\nfunction updateAxes(partial) {\n builder.setAxes(partial);\n}\n__name(updateAxes, \"updateAxes\");\nfunction getNode(id) {\n return builder.getNode(id);\n}\n__name(getNode, \"getNode\");\nfunction resolveNodeId(name) {\n return builder.resolveNodeId(name);\n}\n__name(resolveNodeId, \"resolveNodeId\");\nfunction getWardleyData() {\n return builder.build();\n}\n__name(getWardleyData, \"getWardleyData\");\nfunction clear2() {\n builder.clear();\n clear();\n}\n__name(clear2, \"clear\");\nvar wardleyDb_default = {\n getConfig: getConfig3,\n addNode,\n addLink,\n addTrend,\n addAnnotation,\n addNote,\n addAccelerator,\n addDeaccelerator,\n setAnnotationsBox,\n setSize,\n startPipeline,\n addPipelineComponent,\n updateAxes,\n getNode,\n resolveNodeId,\n getWardleyData,\n clear: clear2,\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle,\n getAccDescription,\n setAccDescription\n};\n\n// src/diagrams/wardley/wardleyRenderer.ts\nvar DEFAULT_STAGES = [\"Genesis\", \"Custom Built\", \"Product\", \"Commodity\"];\nvar getTheme = /* @__PURE__ */ __name(() => {\n const { themeVariables } = getConfig2();\n return {\n backgroundColor: themeVariables.wardley?.backgroundColor ?? themeVariables.background ?? \"#fff\",\n axisColor: themeVariables.wardley?.axisColor ?? \"#000\",\n axisTextColor: themeVariables.wardley?.axisTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n gridColor: themeVariables.wardley?.gridColor ?? \"rgba(100, 100, 100, 0.2)\",\n componentFill: themeVariables.wardley?.componentFill ?? \"#fff\",\n componentStroke: themeVariables.wardley?.componentStroke ?? \"#000\",\n componentLabelColor: themeVariables.wardley?.componentLabelColor ?? themeVariables.primaryTextColor ?? \"#222\",\n linkStroke: themeVariables.wardley?.linkStroke ?? \"#000\",\n evolutionStroke: themeVariables.wardley?.evolutionStroke ?? \"#dc3545\",\n annotationStroke: themeVariables.wardley?.annotationStroke ?? \"#000\",\n annotationTextColor: themeVariables.wardley?.annotationTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n annotationFill: themeVariables.wardley?.annotationFill ?? themeVariables.background ?? \"#fff\"\n };\n}, \"getTheme\");\nvar getConfigValues = /* @__PURE__ */ __name(() => {\n const wardleyConfig = getConfig2()[\"wardley-beta\"];\n return {\n width: wardleyConfig?.width ?? 900,\n height: wardleyConfig?.height ?? 600,\n padding: wardleyConfig?.padding ?? 48,\n nodeRadius: wardleyConfig?.nodeRadius ?? 6,\n nodeLabelOffset: wardleyConfig?.nodeLabelOffset ?? 8,\n axisFontSize: wardleyConfig?.axisFontSize ?? 12,\n labelFontSize: wardleyConfig?.labelFontSize ?? 10,\n showGrid: wardleyConfig?.showGrid ?? false,\n useMaxWidth: wardleyConfig?.useMaxWidth ?? true\n };\n}, \"getConfigValues\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"Rendering Wardley map\\n\" + text);\n const configValues = getConfigValues();\n const theme = getTheme();\n const squareSize = configValues.nodeRadius * 1.6;\n const db = diagObj.db;\n const data = db.getWardleyData();\n const title = db.getDiagramTitle();\n const width = data.size?.width ?? configValues.width;\n const height = data.size?.height ?? configValues.height;\n const svg = selectSvgElement(id);\n svg.selectAll(\"*\").remove();\n configureSvgSize(svg, height, width, configValues.useMaxWidth);\n svg.attr(\"viewBox\", `0 0 ${width} ${height}`);\n const root = svg.append(\"g\").attr(\"class\", \"wardley-map\");\n const defs = svg.append(\"defs\");\n defs.append(\"marker\").attr(\"id\", `arrow-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 6).attr(\"markerHeight\", 6).attr(\"orient\", \"auto-start-reverse\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.evolutionStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-end-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-start-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 1).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 10 0 L 0 5 L 10 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n root.append(\"rect\").attr(\"class\", \"wardley-background\").attr(\"width\", width).attr(\"height\", height).attr(\"fill\", theme.backgroundColor);\n const chartWidth = width - configValues.padding * 2;\n const chartHeight = height - configValues.padding * 2;\n if (title) {\n root.append(\"text\").attr(\"class\", \"wardley-title\").attr(\"x\", width / 2).attr(\"y\", configValues.padding / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize * 1.05).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n }\n const projectX = /* @__PURE__ */ __name((value) => configValues.padding + value / 100 * chartWidth, \"projectX\");\n const projectY = /* @__PURE__ */ __name((value) => height - configValues.padding - value / 100 * chartHeight, \"projectY\");\n const axisGroup = root.append(\"g\").attr(\"class\", \"wardley-axes\");\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", configValues.padding).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n const xLabel = data.axes.xLabel ?? \"Evolution\";\n const yLabel = data.axes.yLabel ?? \"Visibility\";\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-x\").attr(\"x\", configValues.padding + chartWidth / 2).attr(\"y\", height - configValues.padding / 4).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").text(xLabel);\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-y\").attr(\"x\", configValues.padding / 3).attr(\"y\", configValues.padding + chartHeight / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\n \"transform\",\n `rotate(-90 ${configValues.padding / 3} ${configValues.padding + chartHeight / 2})`\n ).text(yLabel);\n const stages = data.axes.stages && data.axes.stages.length > 0 ? data.axes.stages : DEFAULT_STAGES;\n if (stages.length > 0) {\n const stageGroup = root.append(\"g\").attr(\"class\", \"wardley-stages\");\n const boundaries = data.axes.stageBoundaries;\n const stagePositions = [];\n if (boundaries && boundaries.length === stages.length) {\n let prevBoundary = 0;\n boundaries.forEach((boundary) => {\n stagePositions.push({ start: prevBoundary, end: boundary });\n prevBoundary = boundary;\n });\n } else {\n const stageWidth = 1 / stages.length;\n stages.forEach((_, index) => {\n stagePositions.push({\n start: index * stageWidth,\n end: (index + 1) * stageWidth\n });\n });\n }\n stages.forEach((stage, index) => {\n const pos = stagePositions[index];\n const startX = configValues.padding + pos.start * chartWidth;\n const endX = configValues.padding + pos.end * chartWidth;\n const centerX = (startX + endX) / 2;\n if (index > 0) {\n stageGroup.append(\"line\").attr(\"x1\", startX).attr(\"x2\", startX).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"5 5\").attr(\"opacity\", 0.8);\n }\n stageGroup.append(\"text\").attr(\"class\", \"wardley-stage-label\").attr(\"x\", centerX).attr(\"y\", height - configValues.padding / 1.5).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize - 2).attr(\"text-anchor\", \"middle\").text(stage);\n });\n }\n if (configValues.showGrid) {\n const gridGroup = root.append(\"g\").attr(\"class\", \"wardley-grid\");\n for (let i = 1; i < 4; i++) {\n const ratio = i / 4;\n const x = configValues.padding + chartWidth * ratio;\n gridGroup.append(\"line\").attr(\"x1\", x).attr(\"x2\", x).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n gridGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding - chartHeight * ratio).attr(\"y2\", height - configValues.padding - chartHeight * ratio).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n }\n }\n const positions = /* @__PURE__ */ new Map();\n data.nodes.forEach((node) => {\n positions.set(node.id, {\n x: projectX(node.x),\n y: projectY(node.y),\n node\n });\n });\n if (data.pipelines.length > 0) {\n const pipelineGroup = root.append(\"g\").attr(\"class\", \"wardley-pipelines\");\n const pipelineLinksGroup = root.append(\"g\").attr(\"class\", \"wardley-pipeline-links\");\n data.pipelines.forEach((pipeline) => {\n if (pipeline.componentIds.length === 0) {\n return;\n }\n const sortedComponents = pipeline.componentIds.map((id2) => ({ id: id2, pos: positions.get(id2), node: data.nodes.find((n) => n.id === id2) })).filter((c) => c.pos && c.node).sort((a, b) => a.node.x - b.node.x);\n for (let i = 0; i < sortedComponents.length - 1; i++) {\n const current = sortedComponents[i];\n const next = sortedComponents[i + 1];\n pipelineLinksGroup.append(\"line\").attr(\"class\", \"wardley-pipeline-evolution-link\").attr(\"x1\", current.pos.x).attr(\"y1\", current.pos.y).attr(\"x2\", next.pos.x).attr(\"y2\", next.pos.y).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\");\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let y = 0;\n pipeline.componentIds.forEach((componentId) => {\n const pos = positions.get(componentId);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n y = pos.y;\n }\n });\n if (minX !== Infinity && maxX !== -Infinity) {\n const padding = 15;\n const height2 = configValues.nodeRadius * 4;\n const boxTop = y - height2 / 2;\n const parentPos = positions.get(pipeline.nodeId);\n if (parentPos) {\n const centerX = (minX + maxX) / 2;\n parentPos.x = centerX;\n parentPos.y = boxTop - squareSize / 6;\n }\n pipelineGroup.append(\"rect\").attr(\"class\", \"wardley-pipeline-box\").attr(\"x\", minX - padding).attr(\"y\", boxTop).attr(\"width\", maxX - minX + padding * 2).attr(\"height\", height2).attr(\"fill\", \"none\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n });\n }\n const linksGroup = root.append(\"g\").attr(\"class\", \"wardley-links\");\n const pipelineMap = /* @__PURE__ */ new Map();\n data.pipelines.forEach((pipeline) => {\n pipelineMap.set(pipeline.nodeId, new Set(pipeline.componentIds));\n });\n const validLinks = data.links.filter((link) => {\n if (!positions.has(link.source) || !positions.has(link.target)) {\n return false;\n }\n const pipelineComponents = pipelineMap.get(link.target);\n if (pipelineComponents?.has(link.source)) {\n return false;\n }\n return true;\n });\n linksGroup.selectAll(\"line\").data(validLinks).enter().append(\"line\").attr(\"class\", (link) => `wardley-link${link.dashed ? \" wardley-link--dashed\" : \"\"}`).attr(\"x1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.x + dx / distance * radius;\n }).attr(\"y1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.y + dy / distance * radius;\n }).attr(\"x2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.x + dx / distance * radius;\n }).attr(\"y2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.y + dy / distance * radius;\n }).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", (link) => link.dashed ? \"6 6\" : null).attr(\"marker-end\", (link) => {\n if (link.flow === \"forward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-end-${id})`;\n }\n return null;\n }).attr(\"marker-start\", (link) => {\n if (link.flow === \"backward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-start-${id})`;\n }\n return null;\n });\n linksGroup.selectAll(\"text\").data(validLinks.filter((link) => link.label)).enter().append(\"text\").attr(\"class\", \"wardley-link-label\").attr(\"x\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const dy = targetPos.y - sourcePos.y;\n const dx = targetPos.x - sourcePos.x;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n return midX + perpX * offset;\n }).attr(\"y\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpY = -dx / distance;\n return midY + perpY * offset;\n }).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.labelFontSize).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").attr(\"transform\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n const perpY = -dx / distance;\n const labelX = midX + perpX * offset;\n const labelY = midY + perpY * offset;\n let angle = Math.atan2(dy, dx) * 180 / Math.PI;\n if (angle > 90 || angle < -90) {\n angle += 180;\n }\n return `rotate(${angle} ${labelX} ${labelY})`;\n }).text((link) => link.label);\n const trendGroup = root.append(\"g\").attr(\"class\", \"wardley-trends\");\n const trendsWithPositions = data.trends.map((trend) => {\n const origin = positions.get(trend.nodeId);\n if (!origin) {\n return null;\n }\n const targetX = projectX(trend.targetX);\n const targetY = projectY(trend.targetY);\n const dx = targetX - origin.x;\n const dy = targetY - origin.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const shortenBy = configValues.nodeRadius + 2;\n const adjustedX2 = distance > shortenBy ? targetX - dx / distance * shortenBy : targetX;\n const adjustedY2 = distance > shortenBy ? targetY - dy / distance * shortenBy : targetY;\n return {\n origin,\n targetX,\n targetY,\n adjustedX2,\n adjustedY2\n };\n }).filter((trend) => trend !== null);\n trendGroup.selectAll(\"line\").data(trendsWithPositions).enter().append(\"line\").attr(\"class\", \"wardley-trend\").attr(\"x1\", (trend) => trend.origin.x).attr(\"y1\", (trend) => trend.origin.y).attr(\"x2\", (trend) => trend.adjustedX2).attr(\"y2\", (trend) => trend.adjustedY2).attr(\"stroke\", theme.evolutionStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\").attr(\"marker-end\", `url(#arrow-${id})`);\n const nodesGroup = root.append(\"g\").attr(\"class\", \"wardley-nodes\");\n const nodeEnter = nodesGroup.selectAll(\"g\").data(data.nodes).enter().append(\"g\").attr(\n \"class\",\n (node) => [\"wardley-node\", node.className ? `wardley-node--${node.className}` : \"\"].filter(Boolean).join(\" \")\n );\n nodeEnter.filter((node) => node.sourceStrategy === \"outsource\").append(\"circle\").attr(\"class\", \"wardley-outsource-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#666\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"buy\").append(\"circle\").attr(\"class\", \"wardley-buy-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#ccc\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"build\").append(\"circle\").attr(\"class\", \"wardley-build-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#eee\").attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1);\n const marketNodes = nodeEnter.filter((node) => node.sourceStrategy === \"market\");\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter(\n (node) => !node.isPipelineParent && node.sourceStrategy !== \"market\" && node.className !== \"anchor\"\n ).append(\"circle\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n const smallCircleRadius = configValues.nodeRadius * 0.7;\n const triangleRadius = configValues.nodeRadius * 1.2;\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x).attr(\"y1\", (node) => positions.get(node.id).y - triangleRadius).attr(\"x2\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x).attr(\"y2\", (node) => positions.get(node.id).y - triangleRadius).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y - triangleRadius).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n nodeEnter.filter((node) => node.isPipelineParent === true).append(\"rect\").attr(\"x\", (node) => positions.get(node.id).x - squareSize / 2).attr(\"y\", (node) => positions.get(node.id).y - squareSize / 2).attr(\"width\", squareSize).attr(\"height\", squareSize).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.inertia === true).append(\"line\").attr(\"class\", \"wardley-inertia\").attr(\"x1\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y1\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y - lineHeight / 2;\n }).attr(\"x2\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y2\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y + lineHeight / 2;\n }).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 6);\n nodeEnter.append(\"text\").attr(\"x\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetX !== void 0 ? pos.x + node.labelOffsetX : pos.x;\n }\n let defaultOffset = configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetX === void 0) {\n defaultOffset += 10;\n }\n const customOffset = node.labelOffsetX ?? defaultOffset;\n return pos.x + customOffset;\n }).attr(\"y\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetY !== void 0 ? pos.y + node.labelOffsetY : pos.y - 3;\n }\n let defaultOffset = -configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetY === void 0) {\n defaultOffset -= 10;\n }\n const customOffset = node.labelOffsetY ?? defaultOffset;\n return pos.y + customOffset;\n }).attr(\"class\", \"wardley-node-label\").attr(\"fill\", (node) => {\n if (node.className === \"evolved\") {\n return theme.evolutionStroke;\n }\n if (node.className === \"anchor\") {\n return \"#000\";\n }\n return theme.componentLabelColor;\n }).attr(\"font-size\", configValues.labelFontSize).attr(\"font-weight\", (node) => node.className === \"anchor\" ? \"bold\" : \"normal\").attr(\"text-anchor\", (node) => node.className === \"anchor\" ? \"middle\" : \"start\").attr(\"dominant-baseline\", (node) => node.className === \"anchor\" ? \"middle\" : \"auto\").text((node) => node.label);\n if (data.annotations.length > 0) {\n const annotationsGroup = root.append(\"g\").attr(\"class\", \"wardley-annotations\");\n data.annotations.forEach((annotation) => {\n const projectedCoords = annotation.coordinates.map((coord) => ({\n x: projectX(coord.x),\n y: projectY(coord.y)\n }));\n if (projectedCoords.length > 1) {\n for (let i = 0; i < projectedCoords.length - 1; i++) {\n annotationsGroup.append(\"line\").attr(\"class\", \"wardley-annotation-line\").attr(\"x1\", projectedCoords[i].x).attr(\"y1\", projectedCoords[i].y).attr(\"x2\", projectedCoords[i + 1].x).attr(\"y2\", projectedCoords[i + 1].y).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"stroke-dasharray\", \"4 4\");\n }\n }\n projectedCoords.forEach((coord) => {\n const annotationNode = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotation\");\n annotationNode.append(\"circle\").attr(\"cx\", coord.x).attr(\"cy\", coord.y).attr(\"r\", 10).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5);\n annotationNode.append(\"text\").attr(\"x\", coord.x).attr(\"y\", coord.y).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(annotation.number);\n });\n });\n if (data.annotationsBox) {\n let boxX = projectX(data.annotationsBox.x);\n let boxY = projectY(data.annotationsBox.y);\n const padding = 10;\n const lineHeight = 16;\n const fontSize = 11;\n const textBoxGroup = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotations-box\");\n const sortedAnnotations = [...data.annotations].filter((a) => a.text).sort((a, b) => a.number - b.number);\n const textElements = [];\n sortedAnnotations.forEach((annotation, idx) => {\n const text2 = textBoxGroup.append(\"text\").attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight).attr(\"font-size\", fontSize).attr(\"fill\", theme.axisTextColor).attr(\"text-anchor\", \"start\").attr(\"dominant-baseline\", \"middle\").text(`${annotation.number}. ${annotation.text}`);\n textElements.push(text2);\n });\n if (textElements.length > 0) {\n let maxWidth = 0;\n let maxHeight = 0;\n textElements.forEach((text2) => {\n const textNode = text2.node();\n const textWidth = textNode.getComputedTextLength();\n maxWidth = Math.max(maxWidth, textWidth);\n const bbox = textNode.getBBox();\n maxHeight = Math.max(maxHeight, bbox.height);\n });\n const boxWidth = maxWidth + padding * 2 + 105;\n const boxHeight = sortedAnnotations.length * lineHeight + padding * 2 + maxHeight / 2;\n const minX = configValues.padding;\n const maxX = width - configValues.padding - boxWidth;\n const minY = configValues.padding;\n const maxY = height - configValues.padding - boxHeight;\n boxX = Math.max(minX, Math.min(boxX, maxX));\n boxY = Math.max(minY, Math.min(boxY, maxY));\n textElements.forEach((text2, idx) => {\n text2.attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight);\n });\n textBoxGroup.insert(\"rect\", \"text\").attr(\"x\", boxX).attr(\"y\", boxY).attr(\"width\", boxWidth).attr(\"height\", boxHeight).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n }\n }\n if (data.notes.length > 0) {\n const notesGroup = root.append(\"g\").attr(\"class\", \"wardley-notes\");\n data.notes.forEach((note) => {\n const noteX = projectX(note.x);\n const noteY = projectY(note.y);\n notesGroup.append(\"text\").attr(\"x\", noteX).attr(\"y\", noteY).attr(\"text-anchor\", \"start\").attr(\"font-size\", 11).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(note.text);\n });\n }\n if (data.accelerators.length > 0) {\n const acceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-accelerators\");\n data.accelerators.forEach((accelerator) => {\n const accX = projectX(accelerator.x);\n const accY = projectY(accelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${accX} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2 - 8}\n L ${accX + arrowWidth} ${accY}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2 + 8}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2}\n L ${accX} ${accY + arrowHeight / 2}\n Z\n `;\n acceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n acceleratorsGroup.append(\"text\").attr(\"x\", accX + arrowWidth / 2).attr(\"y\", accY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(accelerator.name);\n });\n }\n if (data.deaccelerators.length > 0) {\n const deacceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-deaccelerators\");\n data.deaccelerators.forEach((deaccelerator) => {\n const decX = projectX(deaccelerator.x);\n const decY = projectY(deaccelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${decX + arrowWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2 - 8}\n L ${decX} ${decY}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2 + 8}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2}\n L ${decX + arrowWidth} ${decY + arrowHeight / 2}\n Z\n `;\n deacceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n deacceleratorsGroup.append(\"text\").attr(\"x\", decX + arrowWidth / 2).attr(\"y\", decY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(deaccelerator.name);\n });\n }\n}, \"draw\");\nvar wardleyRenderer_default = {\n draw\n};\n\n// src/diagrams/wardley/styles.ts\nvar styles = /* @__PURE__ */ __name(({\n wardley\n} = {}) => {\n const defaultThemeVariables = getThemeVariables();\n const currentConfig = getConfig();\n const themeVariables = cleanAndMerge(defaultThemeVariables, currentConfig.themeVariables);\n const w = cleanAndMerge(themeVariables.wardley, wardley);\n return `\n .wardley-background {\n fill: ${w.backgroundColor};\n }\n .wardley-axes line, .wardley-axes path {\n stroke: ${w.axisColor};\n }\n .wardley-axis-label {\n fill: ${w.axisTextColor};\n }\n .wardley-stage-label {\n fill: ${w.axisTextColor};\n }\n .wardley-grid line {\n stroke: ${w.gridColor};\n }\n .wardley-node circle {\n fill: ${w.componentFill};\n stroke: ${w.componentStroke};\n }\n .wardley-node-label {\n fill: ${w.componentLabelColor};\n }\n .wardley-link {\n stroke: ${w.linkStroke};\n }\n .wardley-link--dashed {\n stroke-dasharray: 4 4;\n }\n .wardley-link-label {\n fill: ${w.axisTextColor};\n }\n .wardley-trend line {\n stroke: ${w.evolutionStroke};\n }\n .wardley-annotation-line {\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation circle {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotation text {\n fill: ${w.annotationTextColor};\n }\n .wardley-annotations-box rect {\n fill: ${w.annotationFill};\n stroke: ${w.annotationStroke};\n }\n .wardley-annotations-box text {\n fill: ${w.annotationTextColor};\n }\n .wardley-pipeline-box {\n stroke: ${w.componentStroke};\n }\n .wardley-notes text {\n fill: ${w.axisTextColor};\n }\n `;\n}, \"styles\");\n\n// src/diagrams/wardley/wardleyDiagram.ts\nvar diagram = {\n parser,\n db: wardleyDb_default,\n renderer: wardleyRenderer_default,\n styles\n};\nexport {\n diagram\n};\n"],
5
+ "mappings": "itBA6BA,IAAIA,EAA4BC,EAAO,CAACC,EAAOC,IAAY,CACzD,IAAMC,EAAaF,GAAS,EAAIA,EAAQ,IAAMA,EAC9C,GAAIE,EAAa,GAAKA,EAAa,IACjC,MAAM,IAAI,MACR,GAAGD,CAAO,mEAAmED,CAAK,EACpF,EAEF,OAAOE,CACT,EAAG,WAAW,EACVC,EAAgCJ,EAAO,CAACK,EAAYC,EAAWJ,KAC1D,CACL,EAAG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AGpBA,EAAE,mBAAmB;AAAA;AAAA;AAAA,cAGnBA,EAAE,eAAe;AAAA;AAAA;AAAA,YAGnBA,EAAE,aAAa;AAAA;AAAA,GAG3B,EAAG,QAAQ,EAGPC,GAAU,CACZ,OAAAzL,GACA,GAAIgD,GACJ,SAAUgI,GACV,OAAAC,EACF",
6
+ "names": ["toPercent", "__name", "value", "context", "normalized", "toCoordinates", "visibility", "evolution", "getFlowFromPort", "port", "extractFlowFromArrow", "arrow", "flowLabel", "populateDb", "ast", "db", "populateCommonDb", "stages", "stage", "stageBoundaries", "anchor", "coords", "component", "labelOffsetX", "labelOffsetY", "sourceStrategy", "note", "pipeline", "parentNode", "parentY", "componentId", "x", "link", "isDashed", "flow", "arrowFlow", "annotation", "label", "evolve", "node", "target", "annotationsBox", "accelerator", "deaccelerator", "parser", "input", "parse", "log", "_a", "WardleyBuilder", "existing", "merged", "trend", "nodeId", "pipelineNodeId", "y", "partial", "width", "height", "id", "name", "nodes", "builder", "getConfig3", "getConfig2", "addNode", "className", "inertia", "addLink", "sourceId", "targetId", "dashed", "addTrend", "targetX", "targetY", "addAnnotation", "number", "coordinates", "text", "addNote", "addAccelerator", "addDeaccelerator", "setAnnotationsBox", "setSize", "startPipeline", "addPipelineComponent", "updateAxes", "getNode", "resolveNodeId", "getWardleyData", "clear2", "clear", "wardleyDb_default", "setAccTitle", "getAccTitle", "setDiagramTitle", "getDiagramTitle", "getAccDescription", "setAccDescription", "DEFAULT_STAGES", "getTheme", "themeVariables", "getConfigValues", "wardleyConfig", "draw", "_version", "diagObj", "configValues", "theme", "squareSize", "data", "title", "svg", "selectSvgElement", "configureSvgSize", "root", "defs", "chartWidth", "chartHeight", "projectX", "projectY", "axisGroup", "xLabel", "yLabel", "stageGroup", "boundaries", "stagePositions", "prevBoundary", "boundary", "stageWidth", "_", "index", "pos", "startX", "endX", "centerX", "gridGroup", "i", "ratio", "positions", "pipelineGroup", "pipelineLinksGroup", "sortedComponents", "id2", "n", "c", "a", "b", "current", "next", "minX", "maxX", "height2", "boxTop", "parentPos", "linksGroup", "pipelineMap", "validLinks", "sourcePos", "targetPos", "radius", "dx", "dy", "distance", "midX", "offset", "perpX", "midY", "perpY", "labelX", "labelY", "angle", "trendGroup", "trendsWithPositions", "origin", "shortenBy", "adjustedX2", "adjustedY2", "nodeEnter", "marketNodes", "smallCircleRadius", "triangleRadius", "lineHeight", "defaultOffset", "customOffset", "annotationsGroup", "projectedCoords", "coord", "annotationNode", "boxX", "boxY", "padding", "fontSize", "textBoxGroup", "sortedAnnotations", "textElements", "idx", "text2", "maxWidth", "maxHeight", "textNode", "textWidth", "bbox", "boxWidth", "boxHeight", "minY", "maxY", "notesGroup", "noteX", "noteY", "acceleratorsGroup", "accX", "accY", "arrowWidth", "arrowHeight", "arrowHeadWidth", "arrowPath", "deacceleratorsGroup", "decX", "decY", "wardleyRenderer_default", "styles", "wardley", "defaultThemeVariables", "getThemeVariables3", "currentConfig", "getConfig", "cleanAndMerge", "w", "diagram"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import{a as ti}from"./chunk-DXEOG5W4.js";import{e as ii}from"./chunk-6AA7JQNC.js";import{o as Tt}from"./chunk-EHSK6IMI.js";import"./chunk-SA4K3XYV.js";import{A as xt,G as $t,N as qt,S as Gt,T as jt,U as Qt,V as Kt,W as Zt,X as Jt,Y as wt,o as Ht,q as Ut}from"./chunk-WBEUYPCI.js";import{J as _t,b as a,d as kt,p as Ct,q as St}from"./chunk-PVPXGQIV.js";import"./chunk-SN6BTAM3.js";import"./chunk-URGT6V7R.js";var Rt=(function(){var s=a(function(y,o,l,u){for(l=l||{},u=y.length;u--;l[y[u]]=o);return l},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],e=[1,3],n=[1,5],h=[1,6],x=[1,7],k=[1,5,10,12,14,16,18,19,21,23,34,35,36],w=[1,25],V=[1,26],W=[1,28],v=[1,29],B=[1,30],F=[1,31],O=[1,32],P=[1,33],z=[1,34],X=[1,35],Y=[1,36],f=[1,37],L=[1,43],c=[1,42],R=[1,47],E=[1,50],m=[1,10,12,14,16,18,19,21,23,34,35,36],H=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],_=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],G=[1,64],C={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(o,l,u,g,A,r,U){var d=r.length-1;switch(A){case 5:g.setOrientation(r[d]);break;case 9:g.setDiagramTitle(r[d].text.trim());break;case 12:g.setLineData({text:"",type:"text"},r[d]);break;case 13:g.setLineData(r[d-1],r[d]);break;case 14:g.setBarData({text:"",type:"text"},r[d]);break;case 15:g.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),g.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),g.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:g.setXAxisTitle(r[d]);break;case 23:g.setXAxisTitle(r[d-1]);break;case 24:g.setXAxisTitle({type:"text",text:""});break;case 25:g.setXAxisBand(r[d]);break;case 26:g.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:g.setYAxisTitle(r[d]);break;case 31:g.setYAxisTitle(r[d-1]);break;case 32:g.setYAxisTitle({type:"text",text:""});break;case 33:g.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[s(t,i,{3:1,4:2,7:4,5:e,34:n,35:h,36:x}),{1:[3]},s(t,i,{4:2,7:4,3:8,5:e,34:n,35:h,36:x}),s(t,i,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:n,35:h,36:x}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},s(k,[2,34]),s(k,[2,35]),s(k,[2,36]),{1:[2,1]},s(t,i,{4:2,7:4,3:21,5:e,34:n,35:h,36:x}),{1:[2,3]},s(k,[2,5]),s(t,[2,7],{4:22,34:n,35:h,36:x}),{11:23,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},{11:39,13:38,24:L,27:c,29:40,30:41,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},{11:45,15:44,27:R,33:46,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},{11:49,17:48,24:E,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},{11:52,17:51,24:E,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},{20:[1,53]},{22:[1,54]},s(m,[2,18]),{1:[2,2]},s(m,[2,8]),s(m,[2,9]),s(H,[2,37],{40:55,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f}),s(H,[2,38]),s(H,[2,39]),s(_,[2,40]),s(_,[2,42]),s(_,[2,43]),s(_,[2,44]),s(_,[2,45]),s(_,[2,46]),s(_,[2,47]),s(_,[2,48]),s(_,[2,49]),s(_,[2,50]),s(_,[2,51]),s(m,[2,10]),s(m,[2,22],{30:41,29:56,24:L,27:c}),s(m,[2,24]),s(m,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},s(m,[2,11]),s(m,[2,30],{33:60,27:R}),s(m,[2,32]),{31:[1,61]},s(m,[2,12]),{17:62,24:E},{25:63,27:G},s(m,[2,14]),{17:65,24:E},s(m,[2,16]),s(m,[2,17]),s(_,[2,41]),s(m,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},s(m,[2,31]),{27:[1,69]},s(m,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},s(m,[2,15]),s(m,[2,26]),s(m,[2,27]),{11:59,32:72,37:24,38:w,39:V,40:27,41:W,42:v,43:B,44:F,45:O,46:P,47:z,48:X,49:Y,50:f},s(m,[2,33]),s(m,[2,19]),{25:73,27:G},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(o,l){if(l.recoverable)this.trace(o);else{var u=new Error(o);throw u.hash=l,u}},"parseError"),parse:a(function(o){var l=this,u=[0],g=[],A=[null],r=[],U=this.table,d="",ct=0,Ft=0,Ot=0,wi=2,Xt=1,Ci=r.slice.call(arguments,1),S=Object.create(this.lexer),$={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&($.yy[pt]=this.yy[pt]);S.setInput(o,$.yy),$.yy.lexer=S,$.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var mt=S.yylloc;r.push(mt);var Si=S.options&&S.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _i(I){u.length=u.length-2*I,A.length=A.length-I,r.length=r.length-I}a(_i,"popStack");function Yt(){var I;return I=g.pop()||S.lex()||Xt,typeof I!="number"&&(I instanceof Array&&(g=I,I=g.pop()),I=l.symbols_[I]||I),I}a(Yt,"lex");for(var T,yt,q,M,Fi,bt,j={},ut,N,Nt,gt;;){if(q=u[u.length-1],this.defaultActions[q]?M=this.defaultActions[q]:((T===null||typeof T>"u")&&(T=Yt()),M=U[q]&&U[q][T]),typeof M>"u"||!M.length||!M[0]){var At="";gt=[];for(ut in U[q])this.terminals_[ut]&&ut>wi&&gt.push("'"+this.terminals_[ut]+"'");S.showPosition?At="Parse error on line "+(ct+1)+`:
2
+ `+S.showPosition()+`
3
+ Expecting `+gt.join(", ")+", got '"+(this.terminals_[T]||T)+"'":At="Parse error on line "+(ct+1)+": Unexpected "+(T==Xt?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(At,{text:S.match,token:this.terminals_[T]||T,line:S.yylineno,loc:mt,expected:gt})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+T);switch(M[0]){case 1:u.push(T),A.push(S.yytext),r.push(S.yylloc),u.push(M[1]),T=null,yt?(T=yt,yt=null):(Ft=S.yyleng,d=S.yytext,ct=S.yylineno,mt=S.yylloc,Ot>0&&Ot--);break;case 2:if(N=this.productions_[M[1]][1],j.$=A[A.length-N],j._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},Si&&(j._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),bt=this.performAction.apply(j,[d,Ft,ct,$.yy,M[1],A,r].concat(Ci)),typeof bt<"u")return bt;N&&(u=u.slice(0,-1*N*2),A=A.slice(0,-1*N),r=r.slice(0,-1*N)),u.push(this.productions_[M[1]][0]),A.push(j.$),r.push(j._$),Nt=U[u[u.length-2]][u[u.length-1]],u.push(Nt);break;case 3:return!0}}return!0},"parse")},b=(function(){var y={EOF:1,parseError:a(function(l,u){if(this.yy.parser)this.yy.parser.parseError(l,u);else throw new Error(l)},"parseError"),setInput:a(function(o,l){return this.yy=l||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:a(function(o){var l=o.length,u=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),u.length-1&&(this.yylineno-=u.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:u?(u.length===g.length?this.yylloc.first_column:0)+g[g.length-u.length].length-u[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(o){this.unput(this.match.slice(o))},"less"),pastInput:a(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
5
+ `+l+"^"},"showPosition"),test_match:a(function(o,l){var u,g,A;if(this.options.backtrack_lexer&&(A={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(A.yylloc.range=this.yylloc.range.slice(0))),g=o[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],u=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var r in A)this[r]=A[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,l,u,g;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),r=0;r<A.length;r++)if(u=this._input.match(this.rules[A[r]]),u&&(!l||u[0].length>l[0].length)){if(l=u,g=r,this.options.backtrack_lexer){if(o=this.test_match(u,A[r]),o!==!1)return o;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(o=this.test_match(l,A[g]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var l=this.next();return l||this.lex()},"lex"),begin:a(function(l){this.conditionStack.push(l)},"begin"),popState:a(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:a(function(l){this.begin(l)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(l,u,g,A){var r=A;switch(g){case 0:break;case 1:break;case 2:return this.popState(),34;break;case 3:return this.popState(),34;break;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 31;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 27;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return y})();C.lexer=b;function D(){this.yy={}}return a(D,"Parser"),D.prototype=C,C.Parser=D,new D})();Rt.parser=Rt;var Ti=Rt;function Dt(s){return s.type==="bar"}a(Dt,"isBarPlot");function Lt(s){return s.type==="band"}a(Lt,"isBandAxisData");function Q(s){return s.type==="linear"}a(Q,"isLinearAxisData");var K,ai=(K=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((h,x)=>Math.max(x.length,h),0)*i,height:i};let e={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let h of t){let x=ii(n,1,h),k=x?x.width:h.length*i,w=x?x.height:i;e.width=Math.max(e.width,k),e.height=Math.max(e.height,w)}return n.remove(),e}},a(K,"TextDimensionCalculatorWithFont"),K),ei=.7,si=.2,Z,ni=(Z=class{constructor(t,i,e,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){let t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){ei*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(ei*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let e=this.getLabelDimension(),n=si*t.width;this.outerPadding=Math.min(e.width/2,n);let h=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let e=this.getLabelDimension(),n=si*t.height;this.outerPadding=Math.min(e.height/2,n);let h=e.width+this.axisConfig.labelPadding*2;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){let t=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){let i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},a(Z,"BaseAxis"),Z),J,Ri=(J=class extends ni{constructor(t,i,e,n,h){super(t,n,h,i),this.categories=e,this.scale=Ct().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Ct().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),kt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},a(J,"BandAxis"),J),tt,Di=(tt=class extends ni{constructor(t,i,e,n,h){super(t,n,h,i),this.domain=e,this.scale=St().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=St().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},a(tt,"LinearAxis"),tt);function vt(s,t,i,e){let n=new ai(e);return Lt(s)?new Ri(t,i,s.categories,s.title,n):new Di(t,i,[s.min,s.max],s.title,n)}a(vt,"getAxis");var it,vi=(it=class{constructor(t,i,e,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},a(it,"ChartTitle"),it);function ri(s,t,i,e){let n=new ai(e);return new vi(n,s,t,i)}a(ri,"getChartTitleComponent");var et,Pi=(et=class{constructor(t,i,e,n,h){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=n,this.plotIndex=h}getDrawableElement(){let t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),i;return this.orientation==="horizontal"?i=_t().y(e=>e[0]).x(e=>e[1])(t):i=_t().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},a(et,"LinePlot"),et),st,Li=(st=class{constructor(t,i,e,n,h,x){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=n,this.orientation=h,this.plotIndex=x}getDrawableElement(){let t=this.barData.data.map(h=>[this.xAxis.getScaleValue(h[0]),this.yAxis.getScaleValue(h[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:this.boundingRect.x,y:h[0]-n,height:e,width:h[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:h[0]-n,y:h[1],width:e,height:this.boundingRect.y+this.boundingRect.height-h[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},a(st,"BarPlot"),st),at,Ei=(at=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let t=[];for(let[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{let n=new Pi(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{let n=new Li(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}},a(at,"BasePlot"),at);function oi(s,t,i){return new Ei(s,t,i)}a(oi,"getPlotComponent");var nt,Ii=(nt=class{constructor(t,i,e,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:ri(t,i,e,n),plot:oi(t,i,e),xAxis:vt(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},n),yAxis:vt(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,n=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),k=this.componentStore.plot.calculateSpace({width:h,height:x});t-=k.width,i-=k.height,k=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=k.height,i-=k.height,this.componentStore.xAxis.setAxisPosition("bottom"),k=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=k.height,this.componentStore.yAxis.setAxisPosition("left"),k=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=k.width,t-=k.width,t>0&&(h+=t,t=0),i>0&&(x+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:x}),this.componentStore.plot.setBoundingBoxXY({x:e,y:n}),this.componentStore.xAxis.setRange([e,e+h]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:n+x}),this.componentStore.yAxis.setRange([n,n+x]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(w=>Dt(w))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,n=0,h=0,x=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),k=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),w=this.componentStore.plot.calculateSpace({width:x,height:k});t-=w.width,i-=w.height,w=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=w.height,i-=w.height,this.componentStore.xAxis.setAxisPosition("left"),w=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=w.width,n=w.width,this.componentStore.yAxis.setAxisPosition("top"),w=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=w.height,h=e+w.height,t>0&&(x+=t,t=0),i>0&&(k+=i,i=0),this.componentStore.plot.calculateSpace({width:x,height:k}),this.componentStore.plot.setBoundingBoxXY({x:n,y:h}),this.componentStore.yAxis.setRange([n,n+x]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:e}),this.componentStore.xAxis.setRange([h,h+k]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(V=>Dt(V))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},a(nt,"Orchestrator"),nt),rt,Vi=(rt=class{static build(t,i,e,n){return new Ii(t,i,e,n).getDrawableElement()}},a(rt,"XYChartBuilder"),rt),ot=0,hi,ht=Vt(),lt=It(),p=Bt(),Pt=lt.plotColorPalette.split(",").map(s=>s.trim()),dt=!1,Et=!1;function It(){let s=Ht(),t=xt();return Tt(s.xyChart,t.themeVariables.xyChart)}a(It,"getChartDefaultThemeConfig");function Vt(){let s=xt();return Tt(Ut.xyChart,s.xyChart)}a(Vt,"getChartDefaultConfig");function Bt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(Bt,"getChartDefaultData");function ft(s){let t=xt();return $t(s.trim(),t)}a(ft,"textSanitizer");function li(s){hi=s}a(li,"setTmpSVGG");function ci(s){s==="horizontal"?ht.chartOrientation="horizontal":ht.chartOrientation="vertical"}a(ci,"setOrientation");function ui(s){p.xAxis.title=ft(s.text)}a(ui,"setXAxisTitle");function Mt(s,t){p.xAxis={type:"linear",title:p.xAxis.title,min:s,max:t},dt=!0}a(Mt,"setXAxisRangeData");function gi(s){p.xAxis={type:"band",title:p.xAxis.title,categories:s.map(t=>ft(t.text))},dt=!0}a(gi,"setXAxisBand");function xi(s){p.yAxis.title=ft(s.text)}a(xi,"setYAxisTitle");function di(s,t){p.yAxis={type:"linear",title:p.yAxis.title,min:s,max:t},Et=!0}a(di,"setYAxisRangeData");function fi(s){let t=Math.min(...s),i=Math.max(...s),e=Q(p.yAxis)?p.yAxis.min:1/0,n=Q(p.yAxis)?p.yAxis.max:-1/0;p.yAxis={type:"linear",title:p.yAxis.title,min:Math.min(e,t),max:Math.max(n,i)}}a(fi,"setYAxisRangeFromPlotData");function Wt(s){let t=[];if(s.length===0)return t;if(!dt){let i=Q(p.xAxis)?p.xAxis.min:1/0,e=Q(p.xAxis)?p.xAxis.max:-1/0;Mt(Math.min(i,1),Math.max(e,s.length))}if(Et||fi(s),Lt(p.xAxis)&&(t=p.xAxis.categories.map((i,e)=>[i,s[e]])),Q(p.xAxis)){let i=p.xAxis.min,e=p.xAxis.max,n=(e-i)/(s.length-1),h=[];for(let x=i;x<=e;x+=n)h.push(`${x}`);t=h.map((x,k)=>[x,s[k]])}return t}a(Wt,"transformDataWithoutCategory");function zt(s){return Pt[s===0?0:s%Pt.length]}a(zt,"getPlotColorFromPalette");function pi(s,t){let i=Wt(t);p.plots.push({type:"line",strokeFill:zt(ot),strokeWidth:2,data:i}),ot++}a(pi,"setLineData");function mi(s,t){let i=Wt(t);p.plots.push({type:"bar",fill:zt(ot),data:i}),ot++}a(mi,"setBarData");function yi(){if(p.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return p.title=wt(),Vi.build(ht,p,lt,hi)}a(yi,"getDrawableElem");function bi(){return lt}a(bi,"getChartThemeConfig");function Ai(){return ht}a(Ai,"getChartConfig");function ki(){return p}a(ki,"getXYChartData");var Bi=a(function(){Gt(),ot=0,ht=Vt(),p=Bt(),lt=It(),Pt=lt.plotColorPalette.split(",").map(s=>s.trim()),dt=!1,Et=!1},"clear"),Mi={getDrawableElem:yi,clear:Bi,setAccTitle:jt,getAccTitle:Qt,setDiagramTitle:Jt,getDiagramTitle:wt,getAccDescription:Zt,setAccDescription:Kt,setOrientation:ci,setXAxisTitle:ui,setXAxisRangeData:Mt,setXAxisBand:gi,setYAxisTitle:xi,setYAxisRangeData:di,setLineData:pi,setBarData:mi,setTmpSVGG:li,getChartThemeConfig:bi,getChartConfig:Ai,getXYChartData:ki},Wi=a((s,t,i,e)=>{let n=e.db,h=n.getChartThemeConfig(),x=n.getChartConfig(),k=n.getXYChartData().plots[0].data.map(f=>f[1]);function w(f){return f==="top"?"text-before-edge":"middle"}a(w,"getDominantBaseLine");function V(f){return f==="left"?"start":f==="right"?"end":"middle"}a(V,"getTextAnchor");function W(f){return`translate(${f.x}, ${f.y}) rotate(${f.rotation||0})`}a(W,"getTextTransformation"),kt.debug(`Rendering xychart chart
7
+ `+s);let v=ti(t),B=v.append("g").attr("class","main"),F=B.append("rect").attr("width",x.width).attr("height",x.height).attr("class","background");qt(v,x.height,x.width,!0),v.attr("viewBox",`0 0 ${x.width} ${x.height}`),F.attr("fill",h.backgroundColor),n.setTmpSVGG(v.append("g").attr("class","mermaid-tmp-group"));let O=n.getDrawableElem(),P={};function z(f){let L=B,c="";for(let[R]of f.entries()){let E=B;R>0&&P[c]&&(E=P[c]),c+=f[R],L=P[c],L||(L=P[c]=E.append("g").attr("class",f[R]))}return L}a(z,"getGroup");for(let f of O){if(f.data.length===0)continue;let L=z(f.groupTexts);switch(f.type){case"rect":if(L.selectAll("rect").data(f.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),x.showDataLabel){let c=x.showDataLabelOutsideBar;if(x.chartOrientation==="horizontal"){let R=function(b,D){let{data:y,label:o}=b;return D*o.length*E<=y.width-m};var X=R;a(R,"fitsHorizontally");let E=.7,m=10,H=f.data.map((b,D)=>({data:b,label:k[D].toString()})).filter(b=>b.data.width>0&&b.data.height>0),_=H.map(b=>{let{data:D}=b,y=D.height*.7;for(;!R(b,y)&&y>0;)y-=1;return y}),G=Math.floor(Math.min(..._)),C=a(b=>c?b.data.x+b.data.width+m:b.data.x+b.data.width-m,"determineLabelXPosition");L.selectAll("text").data(H).enter().append("text").attr("x",C).attr("y",b=>b.data.y+b.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${G}px`).text(b=>b.label)}else{let R=function(C,b,D){let{data:y,label:o}=C,u=b*o.length*.7,g=y.x+y.width/2,A=g-u/2,r=g+u/2,U=A>=y.x&&r<=y.x+y.width,d=y.y+D+b<=y.y+y.height;return U&&d};var Y=R;a(R,"fitsInBar");let E=10,m=f.data.map((C,b)=>({data:C,label:k[b].toString()})).filter(C=>C.data.width>0&&C.data.height>0),H=m.map(C=>{let{data:b,label:D}=C,y=b.width/(D.length*.7);for(;!R(C,y,E)&&y>0;)y-=1;return y}),_=Math.floor(Math.min(...H)),G=a(C=>c?C.data.y-E:C.data.y+E,"determineLabelYPosition");L.selectAll("text").data(m).enter().append("text").attr("x",C=>C.data.x+C.data.width/2).attr("y",G).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${_}px`).text(C=>C.label)}}break;case"text":L.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>w(c.verticalPos)).attr("text-anchor",c=>V(c.horizontalPos)).attr("transform",c=>W(c)).text(c=>c.text);break;case"path":L.selectAll("path").data(f.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),zi={draw:Wi},Gi={parser:Ti,db:Mi,renderer:zi};export{Gi as diagram};
8
+ //# sourceMappingURL=xychartDiagram-2RQKCTM6-CMGOBHPC.js.map