orbitchat 3.10.7 → 3.10.8

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 (83) hide show
  1. package/LICENSE +201 -0
  2. package/dist/assets/{ChartRenderer-9FnwPEBX.js → ChartRenderer-DmEe5ux0.js} +1 -1
  3. package/dist/assets/MermaidRenderer-BNgxU_bM.js +312 -0
  4. package/dist/assets/architectureDiagram-3BPJPVTR-Bfi6eFLn.js +36 -0
  5. package/dist/assets/blockDiagram-GPEHLZMM-C_xOdSW3.js +132 -0
  6. package/dist/assets/{c4Diagram-LMCZKHZV-BUftbNWY.js → c4Diagram-AAUBKEIU-CfvQYM_q.js} +1 -1
  7. package/dist/assets/channel-zLwrxaPB.js +1 -0
  8. package/dist/assets/{chunk-VR4S4FIN-uT68_7rT.js → chunk-2J33WTMH-DeY8TrNw.js} +1 -1
  9. package/dist/assets/{chunk-JWPE2WC7-BjHi_aEM.js → chunk-4BX2VUAB-DIj3bLrU.js} +1 -1
  10. package/dist/assets/{chunk-XXDRQBXY-BrvJt-u-.js → chunk-55IACEB6-I4-oEJEd.js} +1 -1
  11. package/dist/assets/{chunk-V7JOEXUC-hSR6fEWT.js → chunk-727SXJPM-DCx2l0Oh.js} +4 -4
  12. package/dist/assets/chunk-AQP2D5EJ-D4KlRvHF.js +231 -0
  13. package/dist/assets/{chunk-5VM5RSS4-CQacO1HV.js → chunk-FMBD7UC4-CqHLqk3L.js} +1 -1
  14. package/dist/assets/{chunk-32BRIVSS-DnDG740s.js → chunk-ND2GUHAM-CHJjdC0m.js} +1 -1
  15. package/dist/assets/{chunk-2Q5K7J3B-CdU2Q6YZ.js → chunk-QZHKN3VN-slcsUOxD.js} +1 -1
  16. package/dist/assets/classDiagram-4FO5ZUOK-CDbYhIhU.js +1 -0
  17. package/dist/assets/classDiagram-v2-Q7XG4LA2-CDbYhIhU.js +1 -0
  18. package/dist/assets/{cose-bilkent-JH36ORCC-C0vhiJLV.js → cose-bilkent-S5V4N54A-HnZrIUzr.js} +1 -1
  19. package/dist/assets/{cynefin-VYW2F7L2-CyM6ijR6.js → cynefin-VYW2F7L2-CPNTSJVR.js} +1 -1
  20. package/dist/assets/dagre-BM42HDAG-Cl88doFf.js +4 -0
  21. package/dist/assets/diagram-2AECGRRQ-2lPidS0l.js +43 -0
  22. package/dist/assets/diagram-5GNKFQAL-_tROgYB3.js +10 -0
  23. package/dist/assets/{diagram-FQU43EPY-IlESJ0wh.js → diagram-KO2AKTUF-7mueA6fZ.js} +3 -3
  24. package/dist/assets/{diagram-NH7WQ7WH-B63W-pyC.js → diagram-LMA3HP47-BxKOasa5.js} +2 -2
  25. package/dist/assets/diagram-OG6HWLK6-Bwf3i6eI.js +24 -0
  26. package/dist/assets/erDiagram-TEJ5UH35-hortthG_.js +85 -0
  27. package/dist/assets/flowDiagram-I6XJVG4X-DgvKpDc5.js +162 -0
  28. package/dist/assets/ganttDiagram-6RSMTGT7-DR5xWqhT.js +292 -0
  29. package/dist/assets/{gitGraphDiagram-IHSO6WYX-DsT87XU7.js → gitGraphDiagram-PVQCEYII-RJLy0nV8.js} +7 -7
  30. package/dist/assets/{graph-C9eacEi8.js → graph-CAnANduQ.js} +1 -1
  31. package/dist/assets/{index-DfypiZL2.js → index-DnyY0OCY.js} +3 -3
  32. package/dist/assets/{infoDiagram-FWYZ7A6U-CkLm2oOh.js → infoDiagram-5YYISTIA-CdzF2MjL.js} +2 -2
  33. package/dist/assets/{ishikawaDiagram-FXEZZL3T-BEPnPebm.js → ishikawaDiagram-YF4QCWOH-8YrFferA.js} +5 -5
  34. package/dist/assets/{journeyDiagram-5HDEW3XC-B3Sx5g-O.js → journeyDiagram-JHISSGLW-Bix7jj_6.js} +1 -1
  35. package/dist/assets/{kanban-definition-HUTT4EX6-BZwqoKM8.js → kanban-definition-UN3LZRKU-CJP7JJpX.js} +6 -6
  36. package/dist/assets/layout-DGIYPm2g.js +1 -0
  37. package/dist/assets/{mindmap-definition-LN4V7U3C-CyjRWos4.js → mindmap-definition-RKZ34NQL-Dk78wf-k.js} +9 -9
  38. package/dist/assets/pieDiagram-4H26LBE5-DkAjb9PV.js +30 -0
  39. package/dist/assets/{quadrantDiagram-ABIIQ3AL-DW4gRbec.js → quadrantDiagram-W4KKPZXB-DhA3Ltj3.js} +3 -3
  40. package/dist/assets/{requirementDiagram-TGXJPOKE-D898qBnU.js → requirementDiagram-4Y6WPE33-BwRKT1Ti.js} +1 -1
  41. package/dist/assets/sankeyDiagram-5OEKKPKP-Cq7Z3xZr.js +40 -0
  42. package/dist/assets/sequenceDiagram-3UESZ5HK-IjZb9M7w.js +162 -0
  43. package/dist/assets/stateDiagram-AJRCARHV-CbH0JxsR.js +1 -0
  44. package/dist/assets/stateDiagram-v2-BHNVJYJU-CzKw24Ws.js +1 -0
  45. package/dist/assets/{timeline-definition-FHXFAJF6-CgFiawCT.js → timeline-definition-PNZ67QCA-ZZ8vXqsw.js} +3 -3
  46. package/dist/assets/vennDiagram-CIIHVFJN-Dqi0_zje.js +34 -0
  47. package/dist/assets/{wardleyDiagram-EHGQE667-CtRzQ3q6.js → wardleyDiagram-YWT4CUSO-D7_vAxp3.js} +3 -3
  48. package/dist/assets/xychartDiagram-2RQKCTM6-BgFNWh3u.js +7 -0
  49. package/dist/index.html +1 -1
  50. package/package.json +2 -2
  51. package/dist/assets/MermaidRenderer-CnzIvTlj.js +0 -317
  52. package/dist/assets/abnfDiagram-VRR7QNED-DChuAW5u.js +0 -1
  53. package/dist/assets/architectureDiagram-ZJ3FMSHR-DHJZWJhu.js +0 -36
  54. package/dist/assets/blockDiagram-677ZJIJ3-H_CNYF5m.js +0 -132
  55. package/dist/assets/channel-Cfw3OpIn.js +0 -1
  56. package/dist/assets/chunk-EX3LRPZG-Bq0HhB2B.js +0 -231
  57. package/dist/assets/chunk-MOJQB5TN-D2zfH4wm.js +0 -88
  58. package/dist/assets/chunk-RYQCIY6F-DSJh0d2F.js +0 -1
  59. package/dist/assets/classDiagram-OUVF2IWQ-BkFPBJiF.js +0 -1
  60. package/dist/assets/classDiagram-v2-EOCWNBFH-BkFPBJiF.js +0 -1
  61. package/dist/assets/cynefinDiagram-TSTJHNR4-MevACWGH.js +0 -62
  62. package/dist/assets/dagre-VKFMJZFB-BqR7tzk8.js +0 -4
  63. package/dist/assets/diagram-G47NLZAW-Bqjk3ZYu.js +0 -24
  64. package/dist/assets/diagram-OA4YK3LP-B0THRF0G.js +0 -30
  65. package/dist/assets/diagram-WEI45ONY-IZZ69bsz.js +0 -41
  66. package/dist/assets/ebnfDiagram-CCIWWBDH-B_U7c6VT.js +0 -1
  67. package/dist/assets/erDiagram-Q63AITRT-oGWxlmE8.js +0 -85
  68. package/dist/assets/flowDiagram-23GEKE2U-0scCMi71.js +0 -156
  69. package/dist/assets/ganttDiagram-NO4QXBWP-DIS-iO_q.js +0 -292
  70. package/dist/assets/layout-DEXfKzaS.js +0 -1
  71. package/dist/assets/map-Czzmt4hB.js +0 -1
  72. package/dist/assets/pegDiagram-2B236MQR-DItVX4G3.js +0 -1
  73. package/dist/assets/pieDiagram-ENE6RG2P-CTRyME0H.js +0 -39
  74. package/dist/assets/railroadDiagram-RFXS5EU6-_rBw9Q9b.js +0 -1
  75. package/dist/assets/sankeyDiagram-HTMAVEWB-doAkRLNI.js +0 -40
  76. package/dist/assets/sequenceDiagram-DBY2YBRQ-D4HUsfB2.js +0 -162
  77. package/dist/assets/sizeCapture-X5ZJPWSS-DJJLR6R7.js +0 -1
  78. package/dist/assets/stateDiagram-2N3HPSRC-0IOXcLaP.js +0 -1
  79. package/dist/assets/stateDiagram-v2-6OUMAXLB-BjcuRalB.js +0 -1
  80. package/dist/assets/swimlanes-5IMT3BWC-HIPL1mdx.js +0 -2
  81. package/dist/assets/swimlanesDiagram-G3AALYLV-usVEFD6y.js +0 -8
  82. package/dist/assets/vennDiagram-L72KCM5P-DiY3ySIT.js +0 -34
  83. package/dist/assets/xychartDiagram-FW5EYKEG-OjszPLMV.js +0 -7
@@ -1,88 +0,0 @@
1
- import{_ as p,l as k,D as H,y as B,p as q,E as G,e as U,i as j,c as K}from"./MermaidRenderer-CnzIvTlj.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
2
- `),k.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),I=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return se.test(a)?a:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=I(e.fontFamily,f.fontFamily),a=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=B(),a={...G(),...i.themeVariables??{},...me(e)},n=pe(a),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??n.compactMode,padding:F(t.padding,n.padding),verticalSeparation:F(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,n.horizontalSeparation),arcRadius:F(t.arcRadius,n.arcRadius),fontSize:F(t.fontSize,n.fontSize),fontFamily:I(t.fontFamily,n.fontFamily),terminalFill:m(t.terminalFill,n.terminalFill),terminalStroke:m(t.terminalStroke,n.terminalStroke),terminalTextColor:m(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:m(t.lineColor,n.lineColor),strokeWidth:F(t.strokeWidth,n.strokeWidth),markerFill:m(t.markerFill,n.markerFill),commentFill:m(t.commentFill,n.commentFill),commentStroke:m(t.commentStroke,n.commentStroke),commentTextColor:m(t.commentTextColor,n.commentTextColor),specialFill:m(t.specialFill,n.specialFill),specialStroke:m(t.specialStroke,n.specialStroke),ruleNameColor:m(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:F(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
3
- .railroad-diagram {
4
- font-family: ${i};
5
- font-size: ${a}px;
6
- }
7
-
8
- .railroad-terminal rect {
9
- fill: ${n};
10
- stroke: ${t};
11
- stroke-width: ${h}px;
12
- }
13
-
14
- .railroad-terminal text {
15
- fill: ${r};
16
- font-family: ${i};
17
- font-size: ${a}px;
18
- text-anchor: middle;
19
- dominant-baseline: middle;
20
- }
21
-
22
- .railroad-nonterminal rect {
23
- fill: ${o};
24
- stroke: ${g};
25
- stroke-width: ${h}px;
26
- }
27
-
28
- .railroad-nonterminal text {
29
- fill: ${l};
30
- font-family: ${i};
31
- font-size: ${a}px;
32
- text-anchor: middle;
33
- dominant-baseline: middle;
34
- }
35
-
36
- .railroad-line {
37
- stroke: ${s};
38
- stroke-width: ${h}px;
39
- fill: none;
40
- }
41
-
42
- .railroad-start circle,
43
- .railroad-end circle {
44
- fill: ${u};
45
- }
46
-
47
- .railroad-comment ellipse {
48
- fill: ${c};
49
- stroke: ${w};
50
- stroke-width: ${h}px;
51
- }
52
-
53
- .railroad-comment text {
54
- fill: ${d};
55
- font-style: italic;
56
- font-family: ${i};
57
- font-size: ${a}px;
58
- text-anchor: middle;
59
- dominant-baseline: middle;
60
- }
61
-
62
- .railroad-special rect {
63
- fill: ${T};
64
- stroke: ${z};
65
- stroke-width: ${h}px;
66
- stroke-dasharray: 5,3;
67
- }
68
-
69
- .railroad-special text {
70
- fill: ${l};
71
- font-family: ${i};
72
- font-size: ${a}px;
73
- text-anchor: middle;
74
- dominant-baseline: middle;
75
- }
76
-
77
- .railroad-rule-name {
78
- font-weight: bold;
79
- fill: ${S};
80
- font-family: ${i};
81
- font-size: ${a}px;
82
- }
83
-
84
- .railroad-group {
85
- /* Grouping container, no specific styles */
86
- }
87
- `},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const h=n[s],u=r-h.dimensions.up;if(g.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${u})`),s<n.length-1){const w=l+h.dimensions.width,d=w+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new x().moveTo(w,T).lineTo(d,T).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+o,up:r,down:o}}}renderChoice(i,a){const n=a.map(c=>this.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,C=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,C,o,u+(C?o:-o)).lineTo(o,d-(C?o:-o)).arcTo(o,o,0,!1,!C,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,X=l-o*2;d===u?N.moveTo(_,d).lineTo(l,u):N.moveTo(_,d).lineTo(X,d).arcTo(o,o,0,!1,!C,l-o,d+(C?-o:o)).lineTo(l-o,u+(C?o:-o)).arcTo(o,o,0,!1,C,l,u),s.append("path").attr("class","railroad-line").attr("d",N.build()),h+=c.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:u,down:r-u}}}renderOptional(i,a){const n=this.renderExpression(i,a),t=this.config.arcRadius,r=t*2,o=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,h=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${h})`);const c=h+n.dimensions.up,w=new x().moveTo(0,c).lineTo(t*2,c);l.append("path").attr("class","railroad-line").attr("d",w.build());const d=new x().moveTo(s+n.dimensions.width,c).lineTo(o,c);l.append("path").attr("class","railroad-line").attr("d",d.build());const T=new x().moveTo(0,c).arcTo(t,t,0,!1,!1,t,c-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(o-t*2,0).arcTo(t,t,0,!1,!0,o-t,t).lineTo(o-t,c-t).arcTo(t,t,0,!1,!1,o,c);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:o,height:g,up:c,down:g-c}}}renderRepetition(i,a,n){const t=this.renderExpression(i,a),r=this.config.arcRadius,o=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+o+(l?o:0),h=i.append("g").attr("class","railroad-repetition"),u=r*2,c=l?o:0;h.node().appendChild(t.element).setAttribute("transform",`translate(${u}, ${c})`);const d=c+t.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(0,d).lineTo(r*2,d).build()),h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(u+t.dimensions.width,d).lineTo(g,d).build());const T=c+t.dimensions.height+r,z=new x().moveTo(u+t.dimensions.width,d).arcTo(r,r,0,!1,!0,u+t.dimensions.width+r,d+r).lineTo(u+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,u+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(h.append("path").attr("class","railroad-line").attr("d",z.build()),l){const S=new x().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,d-r).arcTo(r,r,0,!1,!1,g,d);h.append("path").attr("class","railroad-line").attr("d",S.build())}return{element:h.node(),dimensions:{width:g,height:s,up:d,down:s-d}}}renderSpecial(i,a){const n=this.measureText("? "+a+" ?"),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text("? "+a+" ?"),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderExpression(i,a){switch(a.type){case"terminal":return this.renderTerminal(i,a.value);case"nonterminal":return this.renderNonTerminal(i,a.name);case"sequence":return this.renderSequence(i,a.elements);case"choice":return this.renderChoice(i,a.alternatives);case"optional":return this.renderOptional(i,a.element);case"repetition":return this.renderRepetition(i,a.element,a.min);case"special":return this.renderSpecial(i,a.text);default:throw new Error(`Unknown node type: ${a.type}`)}}renderRule(i,a){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${a})`),t=i.name+" =",r=this.measureText(t).width+20,o=r+20,g=n.append("g"),l=this.renderExpression(g,i.definition),s=Math.max(20,l.dimensions.up),h=s-l.dimensions.up;return g.attr("transform",`translate(${o}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(t),n.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",s).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",o+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(r+this.config.markerRadius,s).lineTo(o,s).build()),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(o+l.dimensions.width,s).lineTo(o+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:o+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(i){let a=this.config.padding,n=0;for(const t of i){const r=this.renderRule(t,a);a+=r.height+this.config.verticalSeparation,n=Math.max(n,r.width)}return{width:n+this.config.padding*2,height:a+this.config.padding}}},p($,"RailroadRenderer"),$),W=p((e,i,a)=>{U(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),ge=p((e,i,a)=>{k.debug(`[Railroad] Rendering diagram
88
- `+e);try{const n=H(i);n.attr("class","railroad-diagram");const t=B().railroad,r=(t==null?void 0:t.useMaxWidth)??!0,o=oe.getRules();if(k.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){k.warn("[Railroad] No rules to render"),W(n,{height:100,width:200},r);return}const l=new ue(n,E()).renderDiagram(o);W(n,l,r),k.debug("[Railroad] Render complete")}catch(n){throw k.error("[Railroad] Render error:",n),n}},"draw"),xe={draw:ge};export{oe as d,Te as g,xe as r};
@@ -1 +0,0 @@
1
- import{_ as d,l as i}from"./MermaidRenderer-CnzIvTlj.js";import{i as C,G as y}from"./graph-C9eacEi8.js";import{b as _,m as X}from"./map-Czzmt4hB.js";var j=4;function p(e){return _(e,j)}function b(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return C(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var s=e.node(r),n=e.parent(r),a={v:r};return C(s)||(a.value=s),C(n)||(a.parent=n),a})}function M(e){return X(e.edges(),function(r){var s=e.edge(r),n={v:r.v,w:r.w};return C(r.name)||(n.name=r.name),C(s)||(n.value=s),n})}var c=new Map,v=new Map,A=new Map,J=d(()=>{v.clear(),A.clear(),c.clear()},"clear"),g=d((e,r)=>{const s=v.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",s.includes(e)),s.includes(e)},"isDescendant"),R=d((e,r)=>{const s=v.get(r)||[];return i.info("Descendants of ",r," is ",s),i.info("Edge is ",e),e.v===r||e.w===r?!1:s?s.includes(e.v)||g(e.v,r)||g(e.w,r)||s.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),x=d((e,r,s,n)=>{i.warn("Copying children of ",e,"root",n,"data",r.node(e),n);const a=r.children(e)||[];e!==n&&a.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",a),a.forEach(o=>{if(r.children(o).length>0)x(o,r,s,n);else{const l=r.node(o);i.info("cp ",o," to ",n," with parent ",e),s.setNode(o,l),n!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),s.setParent(o,r.parent(o))),e!==n&&o!==e?(i.debug("Setting parent",o,e),s.setParent(o,e)):(i.info("In copy ",e,"root",n,"data",r.node(e),n),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==n,"node!==clusterId",o!==e));const u=r.edges(o);i.debug("Copying Edges",u),u.forEach(t=>{i.info("Edge",t);const f=r.edge(t.v,t.w,t.name);i.info("Edge data",f,n);try{if(R(t,n)){const w=v.get(n)||[],m=w.includes(t.v)||g(t.v,n)||t.v===n,D=w.includes(t.w)||g(t.w,n)||t.w===n;if(m&&D)i.info("Copying as ",t.v,t.w,f,t.name),s.setEdge(t.v,t.w,f,t.name),i.info("newGraph edges ",s.edges(),s.edge(s.edges()[0]));else{const N=m?n:t.v,h=D?n:t.w;i.info("Rebinding cross-boundary edge as ",N,h,f,t.name),r.setEdge(N,h,f,t.name)}}else i.info("Skipping copy of edge ",t.v,"-->",t.w," rootId: ",n," clusterId:",e)}catch(w){i.error(w)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=d((e,r)=>{const s=r.children(e);let n=[...s];for(const a of s)A.set(a,e),n=[...n,...O(a,r)];return n},"extractDescendants"),P=d((e,r,s)=>{const n=e.edges().filter(t=>t.v===r||t.w===r),a=e.edges().filter(t=>t.v===s||t.w===s),o=n.map(t=>({v:t.v===r?s:t.v,w:t.w===r?r:t.w})),l=a.map(t=>({v:t.v,w:t.w}));return o.filter(t=>l.some(f=>t.v===f.v&&t.w===f.w))},"findCommonEdges"),E=d((e,r,s)=>{const n=r.children(e);if(i.trace("Searching children of id ",e,n),n.length<1)return e;let a;for(const o of n){const l=E(o,r,s),u=P(r,s,l);if(l)if(u.length>0)a=l;else return l}return a},"findNonClusterChild"),S=d(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=d((e,r)=>{var s;if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",E(n,e,n)),v.set(n,O(n,e)),c.set(n,{id:E(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),o=e.edges();a.length>0?(i.debug("Cluster identified",n,v),o.forEach(l=>{const u=g(l.v,n),t=g(l.w,n);u^t&&(i.warn("Edge: ",l," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",v.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,v)});for(let n of c.keys()){const a=c.get(n).id,o=e.parent(a);o!==n&&c.has(o)&&!c.get(o).externalConnections&&(c.get(n).id=o);const l=e.edges().some(u=>u.v===n);if(a&&((s=c.get(n))!=null&&s.externalConnections)&&l&&L(e,a,n)){const u=T(e,n,e.parent(a));u&&(c.get(n).id=u)}}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let o=n.v,l=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),o=S(n.v),l=S(n.w),e.removeEdge(n.v,n.w,n.name),o!==n.v){const u=e.parent(o);c.get(u).externalConnections=!0,a.fromCluster=n.v}if(l!==n.w){const u=e.parent(l);c.get(u).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",o,l,n.name),e.setEdge(o,l,a,n.name)}}),i.warn("Adjusted Graph",b(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=d((e,r)=>{var a,o,l,u;if(i.warn("extractor - ",r,b(e),e.children("D")),r>10){i.error("Bailing out");return}let s=e.nodes(),n=!1;for(const t of s){const f=e.children(t);n=n||f.length>0}if(!n){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",s,r);for(const t of s)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if((o=(a=c.get(t))==null?void 0:a.clusterData)!=null&&o.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const f=c.get(t).clusterData.dir,w=new y({multigraph:!0,compound:!0}).setGraph({rankdir:f,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,w,t);const m=e.node(t)||{};e.setNode(t,{...m,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:w}),i.warn("Subgraph for cluster with explicit dir created:",t,b(w))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let w=e.graph().rankdir==="TB"?"LR":"TB";(u=(l=c.get(t))==null?void 0:l.clusterData)!=null&&u.dir&&(w=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,w));const m=new y({multigraph:!0,compound:!0}).setGraph({rankdir:w,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(t,e,m,t);const D=e.node(t)||{};e.setNode(t,{...D,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:m}),i.debug("Old graph after copy",b(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);s=e.nodes(),i.warn("New list of nodes",s);for(const t of s){const f=e.node(t);i.warn(" Now next level",t,f),f!=null&&f.clusterNode&&k(f.graph,r+1)}},"extractor"),B=d((e,r)=>{if(r.length===0)return[];let s=Object.assign([],r);return r.forEach(n=>{const a=e.children(n),o=B(e,a);s=[...s,...o]}),s},"sorter"),W=d(e=>B(e,e.children()),"sortNodesByHierarchy"),L=d((e,r,s)=>{let n=e.parent(r);for(;n&&n!==s;){const a=c.get(n);if(a&&!a.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),T=d((e,r,s)=>{const n=e.children(r)??[];for(const a of n){if(a===s||g(a,s))continue;const o=E(a,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,E as f,W as s,b as w};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-hSR6fEWT.js";import{_ as i}from"./MermaidRenderer-CnzIvTlj.js";import"./chunk-5VM5RSS4-CQacO1HV.js";import"./chunk-XXDRQBXY-BrvJt-u-.js";import"./chunk-VR4S4FIN-uT68_7rT.js";import"./chunk-32BRIVSS-DnDG740s.js";import"./purify.es-D6gMnemd.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./isPrototype-DezZrpQP.js";var c={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{c as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-hSR6fEWT.js";import{_ as i}from"./MermaidRenderer-CnzIvTlj.js";import"./chunk-5VM5RSS4-CQacO1HV.js";import"./chunk-XXDRQBXY-BrvJt-u-.js";import"./chunk-VR4S4FIN-uT68_7rT.js";import"./chunk-32BRIVSS-DnDG740s.js";import"./purify.es-D6gMnemd.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./isPrototype-DezZrpQP.js";var c={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{c as diagram};
@@ -1,62 +0,0 @@
1
- import{p as xt}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as i,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./MermaidRenderer-CnzIvTlj.js";import{p as Bt}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var rt=i(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=i(()=>H.domains,"getDomains"),Mt=i(()=>H.transitions,"getTransitions"),zt=i(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=i(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=i(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=i(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=i(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:i(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}i(V,"seededRandom");function it(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}i(it,"hashString");function st(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:it(e)}i(st,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,W=e/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*17)*m*2-m;d.push({x:c+p,y:o*W})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],s=d[o+1],f=(p.y+s.y)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*31+7),R=p.x+h,_=f,E=s.x-h;D+=` C${R},${_} ${E},${f} ${s.x},${s.y}`}return D}i(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,W=t/v,d=[];for(let o=0;o<=v;o++){const p=V(n+o*23)*m*2-m;d.push({x:o*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],s=d[o+1],f=(p.x+s.x)/2,b=o%2===0?1:-1,h=m*1.5*b*V(n+o*37+11),R=f,_=p.y+h,E=f,z=s.y-h;D+=` C${R},${_} ${E},${z} ${s.x},${s.y}`}return D}i(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}i(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}i(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=i((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=i(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=i((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const s=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=s+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(s,f),Z=st(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(s,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(s,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(s,f)).attr("fill","none");const pt=s*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(s/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",s/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",s/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",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("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",s/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=i(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=i(()=>{const t=Vt();return`
2
- .cynefinDomain {
3
- stroke: none;
4
- }
5
- .cynefinDomainLabel {
6
- font-size: ${t.domainFontSize}px;
7
- font-weight: bold;
8
- fill: ${t.labelColor};
9
- }
10
- .cynefinSubtitle {
11
- font-size: ${t.itemFontSize-1}px;
12
- fill: ${t.textColor};
13
- font-style: italic;
14
- }
15
- .cynefinItem {
16
- fill-opacity: 0.95;
17
- stroke: ${t.boundaryColor};
18
- stroke-width: 1;
19
- }
20
- .cynefinItemText {
21
- font-size: ${t.itemFontSize}px;
22
- fill: ${t.textColor};
23
- }
24
- .cynefinItemOverflow {
25
- fill-opacity: 0.6;
26
- stroke: ${t.boundaryColor};
27
- stroke-width: 1;
28
- stroke-dasharray: 3 2;
29
- }
30
- .cynefinBoundary {
31
- stroke: ${t.boundaryColor};
32
- stroke-width: ${t.boundaryWidth};
33
- stroke-dasharray: 6 3;
34
- }
35
- .cynefinCliff {
36
- stroke: ${t.cliffColor};
37
- stroke-width: ${t.cliffWidth};
38
- }
39
- .cynefinConfusion {
40
- stroke: ${t.boundaryColor};
41
- stroke-width: 1.5;
42
- stroke-dasharray: 4 2;
43
- }
44
- .cynefinArrowLine {
45
- stroke: ${t.arrowColor};
46
- stroke-width: ${t.arrowWidth};
47
- fill: none;
48
- }
49
- .cynefinArrowHead {
50
- fill: ${t.arrowColor};
51
- stroke: none;
52
- }
53
- .cynefinArrowLabel {
54
- font-size: ${t.itemFontSize-1}px;
55
- fill: ${t.textColor};
56
- }
57
- .cynefinTitle {
58
- font-size: ${t.domainFontSize+2}px;
59
- font-weight: bold;
60
- fill: ${t.labelColor};
61
- }
62
- `},"styles"),Gt=Ht,Zt={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{Zt as diagram};
@@ -1,4 +0,0 @@
1
- import{c as O,w as M,a as J,f as P,b as N,s as A}from"./chunk-RYQCIY6F-DSJh0d2F.js";import{_ as X,a5 as v,a6 as D,a7 as Y,a8 as H,l as d,c as _,a9 as $,aa as W,$ as j,ab as F,a0 as R,Y as q,ac as z,ad as K,ae as G}from"./MermaidRenderer-CnzIvTlj.js";import{G as Q}from"./graph-C9eacEi8.js";import{l as U}from"./layout-DEXfKzaS.js";import"./map-Czzmt4hB.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var C=X((o,s,l)=>Math.max(s,Math.min(l,o)),"clamp"),B=X((o="TB")=>{switch(o){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=X(o=>o==="flowchart"||o==="flowchart-v2"||o==="stateDiagram","shouldMergeSelfLoopSegments"),Z=X((o,s,l,y,a)=>{const f=[],p=new Set;if(l.forEach(({start:r,end:t})=>{r!==y&&p.add(r),t!==y&&p.add(t)}),p.forEach(r=>{const t=o.node(r);typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)}),f.length===0&&l.forEach(({edge:r})=>{(r.points??[]).forEach(t=>{typeof(t==null?void 0:t.x)=="number"&&typeof(t==null?void 0:t.y)=="number"&&f.push(t)})}),f.length===0)return B(a);const c=f.reduce((r,t)=>({x:r.x+t.x/f.length,y:r.y+t.y/f.length}),{x:0,y:0}),h=c.x-s.x,i=c.y-s.y;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":B(a)},"getSelfLoopSide"),ee=X((o,s="top",l=0,y=0)=>{const a=o.x,f=o.y-l,p=o.width/2,c=o.height/2,h=Math.max(36,Math.min(100,o.width*.8)),i=C(Math.max(y,o.width*.35),36,h),r=C(Math.min(o.width,o.height)*.45,24,48);switch(s){case"bottom":{const t=f+c;return[{x:a-i/2,y:t},{x:a-i/2,y:t+r},{x:a+i/2,y:t+r},{x:a+i/2,y:t}]}case"right":{const t=a+p;return[{x:t,y:f-i/2},{x:t+r,y:f-i/2},{x:t+r,y:f+i/2},{x:t,y:f+i/2}]}case"left":{const t=a-p;return[{x:t,y:f-i/2},{x:t-r,y:f-i/2},{x:t-r,y:f+i/2},{x:t,y:f+i/2}]}case"top":default:{const t=f-c;return[{x:a-i/2,y:t},{x:a-i/2,y:t-r},{x:a+i/2,y:t-r},{x:a+i/2,y:t}]}}},"getSelfLoopPoints"),te=X((o,s,l="top",y=0,a={})=>{const p=o.x,c=o.y-y,h=a.width??0,i=a.height??0;switch(l){case"bottom":return{x:p,y:Math.max(...s.map(r=>r.y))+i/2+4};case"right":return{x:Math.max(...s.map(r=>r.x))+h/2+4,y:c};case"left":return{x:Math.min(...s.map(r=>r.x))-h/2-4,y:c};case"top":default:return{x:p,y:Math.min(...s.map(r=>r.y))-i/2-4}}},"getSelfLoopLabelPosition"),se=X((o,s=0,{mergeSelfLoops:l=!0}={})=>{var p;const y=new Map,a=[],f=(p=o.graph())==null?void 0:p.rankdir;return o.edges().forEach(c=>{const h=o.edge(c);if(l&&h.selfLoop){const i=h.selfLoop.id;y.has(i)||y.set(i,[]),y.get(i).push({edge:h,start:c.v,end:c.w})}else a.push({edge:h,start:c.v,end:c.w})}),y.forEach(c=>{if(c.length!==3){c.forEach(n=>a.push(n));return}c.sort((n,e)=>n.edge.selfLoop.order-e.edge.selfLoop.order);const[h,i,r]=c,t=h.edge.originalEdge??i.edge.originalEdge??r.edge.originalEdge??i.edge,g=o.node(t.start);if(!g){c.forEach(n=>a.push(n));return}const S={width:i.edge.width,height:i.edge.height},w=Z(o,g,c,t.start,f),b=ee(g,w,s,S.width??0),E=te(g,b,w,s,S),m={...i.edge,...t,id:t.id,points:b,start:t.start,end:t.end,x:E.x,y:E.y,width:S.width,height:S.height,labelStyle:i.edge.labelStyle,fromCluster:h.edge.fromCluster??i.edge.fromCluster??r.edge.fromCluster,toCluster:h.edge.toCluster??i.edge.toCluster??r.edge.toCluster};delete m.selfLoop,delete m.originalEdge,a.push({edge:m,start:m.start,end:m.end})}),a},"getEdgesToRender"),T=X(async(o,s,l,y,a,f)=>{d.warn("Graph in recursive render:XAX",M(s),a);const p=s.graph().rankdir;d.trace("Dir in recursive render - dir:",p);const c=o.insert("g").attr("class","root");s.nodes()?d.info("Recursive render XXX",s.nodes()):d.info("No nodes found for",s),s.edges().length>0&&d.info("Recursive edges",s.edge(s.edges()[0]));const h=c.insert("g").attr("class","clusters"),i=c.insert("g").attr("class","edgePaths"),r=c.insert("g").attr("class","edgeLabels"),t=c.insert("g").attr("class","nodes"),g=V(l);await Promise.all(s.nodes().map(async function(n){const e=s.node(n);if(a!==void 0){const u=JSON.parse(JSON.stringify(a.clusterData));d.trace(`Setting data for parent cluster XXX
2
- Node.id = `,n,`
3
- data=`,u.height,`
4
- Parent cluster`,a.height),s.setNode(a.id,u),s.parent(n)||(d.trace("Setting parent",n,a.id),s.setParent(n,a.id,u))}if(d.info("(Insert) Node XXX"+n+": "+JSON.stringify(s.node(n))),e!=null&&e.clusterNode){d.info("Cluster identified XBX",n,e.width,s.node(n));const{ranksep:u,nodesep:x}=s.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const L=await T(t,e.graph,l,y,s.node(n),f),I=L.elem;$(e,I),e.diff=L.diff||0,d.info("New compound node after recursive render XAX",n,"width",e.width,"height",e.height),W(I,e)}else s.children(n).length>0?(d.trace("Cluster - the non recursive path XBX",n,e.id,e,e.width,"Graph:",s),d.trace(P(e.id,s)),N.set(e.id,{id:P(e.id,s),node:e})):(d.trace("Node - the non recursive path XAX",n,t,s.node(n),p),await j(t,s.node(n),{config:f,dir:p}))})),await X(async()=>{const n=s.edges().map(async function(e){const u=s.edge(e.v,e.w,e.name);if(d.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),d.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(s.edge(e))),d.info("Fix",N,"ids:",e.v,e.w,"Translating: ",N.get(e.v),N.get(e.w)),g&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(r,u),u.id=x;return}await G(r,u)});await Promise.all(n)},"processEdges")(),d.info("Graph before layout:",JSON.stringify(M(s))),d.info("############################################# XXX"),d.info("### Layout ### XXX"),d.info("############################################# XXX"),U(s),d.info("Graph after layout:",JSON.stringify(M(s)));let w=0,{subGraphTitleTotalMargin:b}=F(f);await Promise.all(A(s).map(async function(n){var u;const e=s.node(n);if(d.info("Position XBX => "+n+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e!=null&&e.clusterNode)e.y+=b,d.info("A tainted cluster node XBX1",n,e.id,e.width,e.height,e.x,e.y,s.parent(n)),N.get(e.id).node=e,R(e);else if(s.children(n).length>0){d.info("A pure cluster node XBX1",n,e.id,e.x,e.y,e.width,e.height,s.parent(n)),e.height+=b,s.node(e.parentId);const x=(e==null?void 0:e.padding)/2||0,L=((u=e==null?void 0:e.labelBBox)==null?void 0:u.height)||0,I=L-x||0;d.debug("OffsetY",I,"labelHeight",L,"halfPadding",x),await q(h,e),N.get(e.id).node=e}else{const x=s.node(e.parentId);e.y+=b/2,d.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",x,x==null?void 0:x.offsetY,e),R(e)}}));const E=b/2;return se(s,E,{mergeSelfLoops:g}).forEach(function({edge:n,start:e,end:u}){d.info("Edge "+e+" -> "+u+": "+JSON.stringify(n),n),n.points.forEach(k=>k.y+=E);const x=s.node(e),L=s.node(u),I=z(i,n,N,l,x,L,y);K(n,I)}),s.nodes().forEach(function(n){const e=s.node(n);d.info(n,e.type,e.diff),e.isGroup&&(w=e.diff)}),d.warn("Returning from recursive render XAX",c,w),{elem:c,diff:w}},"recursiveRender"),ge=X(async(o,s)=>{var f,p,c,h,i,r;const l=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:o.direction,nodesep:((f=o.config)==null?void 0:f.nodeSpacing)||((c=(p=o.config)==null?void 0:p.flowchart)==null?void 0:c.nodeSpacing)||o.nodeSpacing,ranksep:((h=o.config)==null?void 0:h.rankSpacing)||((r=(i=o.config)==null?void 0:i.flowchart)==null?void 0:r.rankSpacing)||o.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),y=s.select("g");v(y,o.markers,o.type,o.diagramId),D(),Y(),H(),O(),o.nodes.forEach(t=>{l.setNode(t.id,{...t}),t.parentId&&l.setParent(t.id,t.parentId)}),d.debug("Edges:",o.edges),o.edges.forEach(t=>{if(t.start===t.end){const g=t.start,S=g+"---"+g+"---1",w=g+"---"+g+"---2",b=l.node(g);l.setNode(S,{domId:S,id:S,parentId:b.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),l.setParent(S,b.parentId),l.setNode(w,{domId:w,id:w,parentId:b.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),l.setParent(w,b.parentId);const E=structuredClone(t),m=structuredClone(t),n=structuredClone(t),e=structuredClone(t);m.originalEdge=E,m.selfLoop={id:E.id,order:0},n.originalEdge=E,n.selfLoop={id:E.id,order:1},e.originalEdge=E,e.selfLoop={id:E.id,order:2},m.label="",m.arrowTypeEnd="none",m.endLabelLeft="",m.endLabelRight="",m.startLabelLeft="",m.id=g+"-cyclic-special-1",n.startLabelRight="",n.startLabelLeft="",n.endLabelLeft="",n.endLabelRight="",n.arrowTypeStart="none",n.arrowTypeEnd="none",n.id=g+"-cyclic-special-mid",e.label="",e.startLabelRight="",e.startLabelLeft="",e.arrowTypeStart="none",b.isGroup&&(m.fromCluster=g,e.toCluster=g),e.id=g+"-cyclic-special-2",e.arrowTypeStart="none",l.setEdge(g,S,m,g+"-cyclic-special-0"),l.setEdge(S,w,n,g+"-cyclic-special-1"),l.setEdge(w,g,e,g+"-cyclic-special-2")}else l.setEdge(t.start,t.end,{...t},t.id)}),d.warn("Graph at first:",JSON.stringify(M(l))),J(l),d.warn("Graph after XAX:",JSON.stringify(M(l)));const a=_();await T(y,l,o.type,o.diagramId,void 0,a)},"render");export{se as getEdgesToRender,ge as render};
@@ -1,24 +0,0 @@
1
- import{p as ge}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,e as ve,l as te,au as B,d as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,av as Ae,p as Fe}from"./MermaidRenderer-CnzIvTlj.js";import{s as Ne}from"./chunk-VR4S4FIN-uT68_7rT.js";import{p as Me}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Q}from"./ordinal-DILIJJjt.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";import"./init-Dmth1JHB.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h<d;++h)n.push(s[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=je)):a===void 0&&(a=Ye);for(var l=new Z(t),n,r=[l],s,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(s=h[d]=new Z(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++d<g;)h=s[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(r-l)/t.value;++d<g;)h=s[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,s){for(var h=[],d=a.children,g,c,p=0,b=0,i=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<i;){x=r-l,S=s-n;do u=d[b++].value;while(!u&&b<i);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<i;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,r,v?n+=S*u/v:s):et(g,l,n,v?l+=x*u/v:r,s),v-=u,p=b}return h}const nt=(function t(a){function l(n,r,s,h,d){at(a,n,r,s,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=G,h=G,d=G,g=G,c=G;function p(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Ke),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,u=i.x1-x,y=i.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),i.x0=S,i.y0=v,i.x1=u,i.y1=y,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=h(i)-x,u-=d(i)-x,y-=g(i)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(i,S,v,u,y))}return p.round=function(i){return arguments.length?(a=!!i,p):a},p.size=function(i){return arguments.length?(l=+i[0],n=+i[1],p):[l,n]},p.tile=function(i){return arguments.length?(t=Je(i),p):t},p.padding=function(i){return arguments.length?p.paddingInner(i).paddingOuter(i):p.paddingInner()},p.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:q(+i),p):s},p.paddingOuter=function(i){return arguments.length?p.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):p.paddingTop()},p.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:q(+i),p):h},p.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:q(+i),p):d},p.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:q(+i),p):g},p.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:q(+i),p):c},p}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*E:960,x=s.nodeHeight?s.nodeHeight*E:500,S=i,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=Q().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=Q().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=Q().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=U(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(z+"..."),_.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),A=re.length>20,pe=A?16:38,Y=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,se=A?8:10,K=A?1:2,j=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=U(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*J,P=C-2*J;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const _=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(Y,Math.round(m*_))),k=m+K+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(Y,Math.round(m*_))),!(F<I&&m===D));)o.style("font-size",`${m}px`),k=m+K+F;o.style("font-size",`${m}px`),A?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=U(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=U(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+K;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*J;f.node().getComputedTextLength()>me||F+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=s.diagramPadding??8;Ne(b,ue,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
2
- .treemapNode.section {
3
- stroke: ${r.sectionStrokeColor};
4
- stroke-width: ${r.sectionStrokeWidth};
5
- fill: ${r.sectionFillColor};
6
- }
7
- .treemapNode.leaf {
8
- stroke: ${r.leafStrokeColor};
9
- stroke-width: ${r.leafStrokeWidth};
10
- fill: ${r.leafFillColor};
11
- }
12
- .treemapLabel {
13
- fill: ${h};
14
- font-size: ${r.labelFontSize};
15
- }
16
- .treemapValue {
17
- fill: ${d};
18
- font-size: ${r.valueFontSize};
19
- }
20
- .treemapTitle {
21
- fill: ${s};
22
- font-size: ${r.titleFontSize};
23
- }
24
- `},"getStyles"),ut=pt,$t={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{$t as diagram};
@@ -1,30 +0,0 @@
1
- import{I as X}from"./chunk-2Q5K7J3B-CdU2Q6YZ.js";import{p as O}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{n as G,b as Y,s as P,o as F,g as j,a as Z,_ as p,A as D,l as N,D as q,e as U,y as E,p as J,i as K,a1 as Q,B as ee,a2 as te}from"./MermaidRenderer-CnzIvTlj.js";import{p as re}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var S=/[─━│┃└┗├┣]/,L=/[└┗├┣]/,ne=/[─━]/,$=/^[\s│┃]+$/,k=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,ie=" ";function _(r){return r.some(e=>S.test(e))}p(_,"isBoxDrawingFormat");function M(r){for(const e of r){const t=L.exec(e);if(t!=null&&t.index&&t.index>0)return t.index}return 4}p(M,"inferSegmentWidth");function R(r,e){return r.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{const o=parseInt(i,10),c=e.get(o);return c?`line ${c}`:t})}p(R,"remapErrorLines");function H(r){const e=r.split(`
2
- `),t=new Map;let i=-1;for(const[a,s]of e.entries())if(s.trim()==="treeView-beta"){i=a;break}if(i===-1)return{text:r,lineMap:t};const o=[];for(let a=i+1;a<e.length;a++){const s=e[a];s.trim()===""||T.test(s)||k.test(s)||$.test(s)||o.push(s.replace(/\t/g," "))}if(!_(o))return{text:r,lineMap:t};const c=M(o),n=[];let l=0;for(let a=0;a<=i;a++)n.push(e[a]),l++,t.set(l,a+1);for(let a=i+1;a<e.length;a++){const s=e[a],u=s.trim(),d=a+1;if(u===""){n.push(s),l++,t.set(l,d);continue}if(T.test(s)){n.push(s),l++,t.set(l,d);continue}if(k.test(s)){n.push(s),l++,t.set(l,d);continue}if($.test(s))continue;const f=s.replace(/\t/g," "),h=L.exec(f);if((h==null?void 0:h.index)!==void 0){const m=h.index,w=Math.round(m/c)+1;let g=m+1;for(;g<f.length&&ne.test(f[g]);)g++;for(;g<f.length&&f[g]===" ";)g++;const v=f.slice(g).trimEnd();if(!v)throw new Error(`Line ${d}: Empty node — expected a filename or directory name after the box-drawing prefix`);const b=ie.repeat(w);n.push(b+v),l++,t.set(l,d)}else{if(/^[\s─━│┃└┗├┣]+$/.test(f))continue;if(S.test(f))n.push(s),l++,t.set(l,d);else{if(/^\s+/.test(f))throw new Error(`Line ${d}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);n.push(s),l++,t.set(l,d)}}}return{text:n.join(`
3
- `),lineMap:t}}p(H,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=p(()=>{x.reset(),J()},"clear"),se=p(()=>x.records.stack[0],"getRoot"),ae=p(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=p(()=>D(ce,E().treeView),"getConfig"),de=p((r,e,t,i,o,c)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const n={id:x.records.cnt++,level:r,name:e,nodeType:t,icon:o,cssClass:i,description:c,children:[]};x.records.stack[x.records.stack.length-1].children.push(n),x.records.stack.push(n)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:j,getDiagramTitle:F,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},y=he,pe=p(r=>{O(r,y);for(const e of r.nodes){const t=typeof e.indent=="number"?e.indent:0;let i=e.name;const o=i.endsWith("/");o&&(i=i.slice(0,-1));const c=o?"directory":"file",n=e.classAnnotation||void 0,l=e.iconAnnotation,a=l!==void 0?l||"none":void 0,s=e.descAnnotation||void 0,u=s?K(s,E()):void 0;y.addNode(t,i,c,n,a,u)}},"populate"),fe={parse:p(async r=>{const{text:e,lineMap:t}=H(r);try{const i=await re("treeView",e);N.debug(i),pe(i)}catch(i){throw t.size>0&&i instanceof Error&&(i.message=R(i.message,t)),i}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function z(r,e){var o;const t=(o=e==null?void 0:e.filenameIcons)==null?void 0:o[r];if(t)return t;const i=r.lastIndexOf(".");if(i>0){const c=r.substring(i).toLowerCase(),n=e==null?void 0:e.extensionIcons;return(n==null?void 0:n[c])??(n==null?void 0:n[c.slice(1)])}}p(z,"detectIcon");function I(r,e){return r.includes(":")?r:r in C.icons||!e?`${C.prefix}:${r}`:`${e}:${r}`}p(I,"qualifyIcon");function V(r,e){if(r.icon!=="none"){if(r.icon)return I(r.icon,e.defaultIconPack);if(e.showIcons){if(r.nodeType==="file"){const t=z(r.name,e);if(t==="none")return;if(t)return I(t,e.defaultIconPack)}return`${C.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}p(V,"getNodeIcon");te([{name:C.prefix,icons:C}]);var B=14,ge=4,ue=16,W=p((r,e)=>`tv-icon-${r}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=p(async(r,e,t,i)=>{const o=new Set,c=p(a=>{const s=V(a,t);s&&o.add(s),a.children.forEach(c)},"collect");if(c(e),o.size===0)return;const n=await Promise.all([...o].map(async a=>({icon:a,svg:await Q(a,{height:B,width:B})}))),l=r.append("defs");for(const{icon:a,svg:s}of n)l.append("g").attr("id",W(i,a)).html(s)},"injectIconDefs"),me=p((r,e,t,i,o,c)=>{var b;const n=i.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const a=B+ge,s=V(t,o),u=s!==void 0;s&&n.append("use").attr("xlink:href",`#${W(c,s)}`).attr("x",r+o.paddingX).attr("y",e+o.paddingY).attr("class","treeView-node-icon");const d=n.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:f,width:h}=d.node().getBBox(),m=f+o.paddingY*2,w=r+o.paddingX+(u?a:0);d.attr("x",w),d.attr("y",e+m/2);const g=w+h,v=h+o.paddingX*2+(u?a:0);return t.BBox={x:r,y:e,width:v,height:m},(b=t.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&n.insert("rect",":first-child").attr("x",r).attr("y",e+1).attr("width",0).attr("height",m-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:n,labelRightEdge:g,centerY:e+m/2}},"positionLabel"),A=p((r,e,t,i,o,c)=>r.append("line").attr("x1",e).attr("y1",t).attr("x2",i).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),ve=p((r,e,t,i)=>{var u;let o=0,c=0;const n=[],l=p((d,f,h,m)=>{const w=m*(h.rowIndent+h.paddingX),g=me(w,o,f,d,h,i);n.push(g);const{height:v,width:b}=f.BBox;A(d,w-h.rowIndent,o+v/2,w,o+v/2,h.lineThickness),c=Math.max(c,w+b),o+=v},"drawNode"),a=p((d,f=0)=>{l(r,d,t,f),d.children.forEach(g=>{a(g,f+1)});const{x:h,y:m,height:w}=d.BBox;if(d.children.length){const{y:g,height:v}=d.children[d.children.length-1].BBox;A(r,h+t.paddingX,m+w,h+t.paddingX,g+v/2+t.lineThickness/2,t.lineThickness)}},"processNode");a(e);const s=n.filter(d=>d.node.description);if(s.length>0){const f=Math.max(...n.map(h=>h.labelRightEdge))+ue;for(const h of s){const w=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();c=Math.max(c,f+w.width+t.paddingX)}}for(const d of n)if((u=d.node.cssClass)!=null&&u.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const h=c-d.node.BBox.x+8;f.attr("width",h),c=Math.max(c,d.node.BBox.x+h+2)}}return{totalHeight:o,totalWidth:c}},"drawTree"),xe=p(async(r,e,t,i)=>{N.debug(`Rendering treeView diagram
4
- `+r);const o=i.db,c=o.getRoot(),n=o.getConfig(),l=q(e);await we(l,c,n,e);const a=l.append("g");a.attr("class","tree-view");const{totalHeight:s,totalWidth:u}=ve(a,c,n,e);l.attr("viewBox",`-${n.lineThickness/2} 0 ${u} ${s}`),U(l,s,u,n.useMaxWidth)},"draw"),be={draw:xe},Ce=be,ye={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=p(({treeView:r})=>{const{labelFontSize:e,labelColor:t,lineColor:i,iconColor:o,descriptionColor:c,highlightBg:n,highlightStroke:l}=D(ye,r);return`
5
- .treeView-node-label {
6
- font-size: ${e};
7
- fill: ${t};
8
- white-space: pre;
9
- }
10
- .treeView-node-dir {
11
- font-weight: bold;
12
- }
13
- .treeView-node-line {
14
- stroke: ${i};
15
- }
16
- .treeView-node-icon {
17
- color: ${o};
18
- }
19
- .treeView-node-description {
20
- font-size: ${e};
21
- fill: ${c};
22
- font-style: italic;
23
- white-space: pre;
24
- }
25
- .treeView-highlight-bg {
26
- fill: ${n};
27
- stroke: ${l};
28
- stroke-width: 1;
29
- }
30
- `},"styles"),Be=Ie,Se={db:y,renderer:Ce,parser:fe,styles:Be};export{Se as diagram};
@@ -1,41 +0,0 @@
1
- import{p as k}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./MermaidRenderer-CnzIvTlj.js";import{p as H}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:x},m=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>m.axes,"getAxes"),U=c(()=>m.curves,"getCurves"),X=c(()=>m.options,"getOptions"),Y=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule}},"setOptions"),K=c(()=>{z(),m=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;rt(u,n,v,o.ticks,o.graticule),st(u,n,v,i),A(u,n,l,h,g,o.graticule,i),T(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n<r;n++){const l=e*(n+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const n=t.length;for(let l=0;l<r;l++){const o=e*(l+1)/r,i=t.map((d,p)=>{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let n=0;n<s;n++){const l=t[n].label,o=2*n*Math.PI/s-Math.PI/2,i=Math.cos(o),d=Math.sin(o);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*i).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=i>.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=M(g,r,s,i),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});n==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const n=a[(s-1+e)%e],l=a[s],o=a[(s+1)%e],i=a[(s+2)%e],d={x:l.x+(o.x-n.x)*t,y:l.y+(o.y-n.y)*t},p={x:o.x-(i.x-l.x)*t,y:o.y-(i.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${o.x},${o.y}`}return`${r} Z`}c(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((o,i)=>{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
2
- .radarCurve-${r} {
3
- color: ${s};
4
- fill: ${s};
5
- fill-opacity: ${t.curveOpacity};
6
- stroke: ${s};
7
- stroke-width: ${t.curveStrokeWidth};
8
- }
9
- .radarLegendBox-${r} {
10
- fill: ${s};
11
- fill-opacity: ${t.curveOpacity};
12
- stroke: ${s};
13
- }
14
- `}return e},"genIndexStyles"),it=c(a=>{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return`
15
- .radarTitle {
16
- font-size: ${t.fontSize};
17
- color: ${t.titleColor};
18
- dominant-baseline: hanging;
19
- text-anchor: middle;
20
- }
21
- .radarAxisLine {
22
- stroke: ${e.axisColor};
23
- stroke-width: ${e.axisStrokeWidth};
24
- }
25
- .radarAxisLabel {
26
- font-size: ${e.axisLabelFontSize}px;
27
- color: ${e.axisColor};
28
- }
29
- .radarGraticule {
30
- fill: ${e.graticuleColor};
31
- fill-opacity: ${e.graticuleOpacity};
32
- stroke: ${e.graticuleColor};
33
- stroke-width: ${e.graticuleStrokeWidth};
34
- }
35
- .radarLegendText {
36
- text-anchor: start;
37
- font-size: ${e.legendFontSize}px;
38
- dominant-baseline: hanging;
39
- }
40
- ${ot(t,e)}
41
- `},"styles"),ht={parser:tt,db:$,renderer:nt,styles:lt};export{ht as diagram};
@@ -1 +0,0 @@
1
- import{g as m,r as l,d as n}from"./chunk-MOJQB5TN-D2zfH4wm.js";import{p}from"./chunk-JWPE2WC7-BjHi_aEM.js";import{_ as t,l as o}from"./MermaidRenderer-CnzIvTlj.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-CyM6ijR6.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},B={parser:g,db:n,renderer:l,styles:m};export{B as diagram};
@@ -1,85 +0,0 @@
1
- import{g as Bt}from"./chunk-XXDRQBXY-BrvJt-u-.js";import{s as Ft}from"./chunk-VR4S4FIN-uT68_7rT.js";import{_ as p,b as Yt,a as Pt,s as zt,g as Gt,n as Kt,o as Ut,c as rt,l as V,p as Zt,q as jt,r as Wt,t as qt,u as Qt,v as Xt,d as Ht,x as Jt}from"./MermaidRenderer-CnzIvTlj.js";import{c as $t}from"./channel-Cfw3OpIn.js";import"./vendor-markdown-BRX1CUPf.js";import"./vendor-syntax-DG6Vo7Ci.js";import"./purify.es-D6gMnemd.js";import"./isPrototype-DezZrpQP.js";var gt=(function(){var s=p(function(I,n,a,l){for(a=a||{},l=I.length;l--;a[I[l]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],o=[1,10],h=[1,11],c=[1,12],u=[1,13],y=[1,23],d=[1,24],m=[1,25],W=[1,26],q=[1,27],S=[1,19],Q=[1,28],B=[1,29],D=[1,20],R=[1,18],T=[1,21],x=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],G=[1,64],A=[1,61],K=[1,65],U=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],St=[1,83],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:p(function(n,a,l,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:x},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:o,24:h,26:c,28:u,29:14,30:15,31:16,32:17,33:y,34:d,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:x},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:x},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:S,48:D,50:R,51:T,52:x},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:G,42:A,45:62,46:63,48:K,49:U},s(X,[2,37]),s(X,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:G,42:A,45:62,46:63,48:K,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:St},{40:[1,86],41:[1,87]},s(Tt,[2,43],{46:88,13:z,41:G,48:K,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:St},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:x},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:G,45:105,46:63,48:K,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(X,[2,39]),s(X,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(Tt,[2,44],{46:88,13:z,41:G,48:K,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:p(function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},"parseError"),parse:p(function(n){var a=this,l=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,It=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(C.yy[pt]=this.yy[pt]);_.setInput(n,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){l.length=l.length-2*b,f.length=f.length-b,t.length=t.length-b}p(Mt,"popStack");function Rt(){var b;return b=r.pop()||_.lex()||It,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}p(Rt,"lex");for(var g,v,k,yt,w={},st,E,xt,it;;){if(v=l[l.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Rt()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`:
2
- `+_.showPosition()+`
3
- Expecting `+it.join(", ")+", got '"+(this.terminals_[g]||g)+"'":_t="Parse error on line "+(et+1)+": Unexpected "+(g==It?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(_t,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:l.push(g),f.push(_.yytext),t.push(_.yylloc),l.push(k[1]),g=null,At=_.yyleng,e=_.yytext,et=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Vt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),yt=this.performAction.apply(w,[e,At,et,C.yy,k[1],f,t].concat(wt)),typeof yt<"u")return yt;E&&(l=l.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),xt=j[l[l.length-2]][l[l.length-1]],l.push(xt);break;case 3:return!0}}return!0},"parse")},Dt=(function(){var I={EOF:1,parseError:p(function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},"parseError"),setInput:p(function(n,a){return this.yy=a||this.yy||{},this._input=n,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:p(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:p(function(n){var a=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=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),l.length-1&&(this.yylineno-=l.length-1);var f=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:l?(l.length===r.length?this.yylloc.first_column:0)+r[r.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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:p(function(n){this.unput(this.match.slice(n))},"less"),pastInput:p(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
5
- `+a+"^"},"showPosition"),test_match:p(function(n,a){var l,r,f;if(this.options.backtrack_lexer&&(f={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&&(f.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,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(n[0].length),this.matched+=n[0],l=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,l,r;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;t<f.length;t++)if(l=this._input.match(this.rules[f[t]]),l&&(!a||l[0].length>a[0].length)){if(a=l,r=t,this.options.backtrack_lexer){if(n=this.test_match(l,f[t]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,f[r]),n!==!1?n:!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:p(function(){var a=this.next();return a||this.lex()},"lex"),begin:p(function(a){this.conditionStack.push(a)},"begin"),popState:p(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(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:p(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:p(function(a){this.begin(a)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(a,l,r,f){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return l.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return l.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return I})();dt.lexer=Dt;function tt(){this.yy={}}return p(tt,"Parser"),tt.prototype=dt,dt.Parser=tt,new tt})();gt.parser=gt;var te=gt,M,ee=(M=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Yt,this.getAccTitle=Pt,this.setAccDescription=zt,this.getAccDescription=Gt,this.setDiagramTitle=Kt,this.getDiagramTitle=Ut,this.getConfig=p(()=>rt().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,o=""){var h;return this.entities.has(i)?!((h=this.entities.get(i))!=null&&h.alias)&&o&&(this.entities.get(i).alias=o,V.info(`Add alias '${o}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:o,shape:"erBox",look:rt().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,o){const h=this.addEntity(i);let c;for(c=o.length-1;c>=0;c--)o[c].keys||(o[c].keys=[]),o[c].comment||(o[c].comment=""),h.attributes.push(o[c]),V.debug("Added attribute ",o[c].name)}addRelationship(i,o,h,c){const u=this.entities.get(i),y=this.entities.get(h);if(!u||!y)return;const d={entityA:u.id,roleA:o,entityB:y.id,relSpec:c};this.relationships.push(d),V.debug("Added new relationship :",d)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let o=[];for(const h of i){const c=this.classes.get(h);c!=null&&c.styles&&(o=[...o,...c.styles??[]].map(u=>u.trim())),c!=null&&c.textStyles&&(o=[...o,...c.textStyles??[]].map(u=>u.trim()))}return o}addCssStyles(i,o){for(const h of i){const c=this.entities.get(h);if(!o||!c)return;for(const u of o)c.cssStyles.push(u)}}addClass(i,o){i.forEach(h=>{let c=this.classes.get(h);c===void 0&&(c={id:h,styles:[],textStyles:[]},this.classes.set(h,c)),o&&o.forEach(function(u){if(/color/.exec(u)){const y=u.replace("fill","bgFill");c.textStyles.push(y)}c.styles.push(u)})})}setClass(i,o){for(const h of i){const c=this.entities.get(h);if(c)for(const u of o)c.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Zt()}getData(){const i=[],o=[],h=rt();let c=0;for(const y of this.entities.keys()){const d=this.entities.get(y);d&&(d.cssCompiledStyles=this.getCompiledStyles(d.cssClasses.split(" ")),d.colorIndex=c++,i.push(d))}let u=0;for(const y of this.relationships){const d={id:jt(y.entityA,y.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:y.entityA,end:y.entityB,label:y.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:y.relSpec.cardB.toLowerCase(),arrowTypeEnd:y.relSpec.cardA.toLowerCase(),pattern:y.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};o.push(d)}return{nodes:i,edges:o,other:{},config:h,direction:"TB"}}},p(M,"ErDB"),M),vt={};qt(vt,{draw:()=>se});var se=p(async function(s,i,o,h){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:c,er:u,layout:y}=rt(),d=h.db.getData(),m=Bt(i,c);d.type=h.type,d.layoutAlgorithm=Qt(y),d.config.flowchart.nodeSpacing=(u==null?void 0:u.nodeSpacing)||140,d.config.flowchart.rankSpacing=(u==null?void 0:u.rankSpacing)||80,d.direction=h.db.getDirection();const{config:W}=d,{look:q}=W;q==="neo"?d.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:d.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],d.diagramId=i,await Xt(d,m),d.layoutAlgorithm==="elk"&&m.select(".edges").lower();const S=m.selectAll('[id*="-background"]');Array.from(S).length>0&&S.each(function(){const B=Ht(this),R=B.attr("id").replace("-background",""),T=m.select(`#${CSS.escape(R)}`);if(!T.empty()){const x=T.attr("transform");B.attr("transform",x)}});const Q=8;Jt.insertTitle(m,"erDiagramTitleText",(u==null?void 0:u.titleTopMargin)??25,h.db.getDiagramTitle()),Ft(m,Q,"erDiagram",(u==null?void 0:u.useMaxWidth)??!0)},"draw"),Ct=p((s,i)=>{const o=$t,h=o(s,"r"),c=o(s,"g"),u=o(s,"b");return Wt(h,c,u,i)},"fade"),nt=new Set(["redux-color","redux-dark-color"]),ie=p(s=>{const{theme:i,look:o,bkgColorArray:h,borderColorArray:c}=s;if(!nt.has(i))return"";const u=(h==null?void 0:h.length)>0;let y="";for(let d=0;d<s.THEME_COLOR_LIMIT;d++)y+=`
7
-
8
- [data-look="${o}"][data-color-id="color-${d}"].node path {
9
- stroke: ${c[d]};
10
- ${u?`fill: ${h[d]};`:""}
11
- }
12
-
13
- [data-look="${o}"][data-color-id="color-${d}"].node rect {
14
- stroke: ${c[d]};
15
- ${u?`fill: ${h[d]};`:""}
16
- }
17
- `;return y},"genColor"),re=p(s=>{const{look:i,theme:o,erEdgeLabelBackground:h,strokeWidth:c}=s;return`
18
- ${ie(s)}
19
- .entityBox {
20
- fill: ${s.mainBkg};
21
- stroke: ${s.nodeBorder};
22
- }
23
-
24
- .relationshipLabelBox {
25
- fill: ${s.tertiaryColor};
26
- opacity: 0.7;
27
- background-color: ${s.tertiaryColor};
28
- rect {
29
- opacity: 0.5;
30
- }
31
- }
32
-
33
- .labelBkg {
34
- background-color: ${nt.has(o)&&h?h:Ct(s.tertiaryColor,.5)};
35
- }
36
-
37
- .edgeLabel {
38
- background-color: ${nt.has(o)&&h?h:s.edgeLabelBackground};
39
- }
40
- .edgeLabel .label rect {
41
- fill: ${nt.has(o)&&h?h:s.edgeLabelBackground};
42
- }
43
- .edgeLabel .label text {
44
- fill: ${s.textColor};
45
- }
46
-
47
- .edgeLabel .label {
48
- fill: ${s.nodeBorder};
49
- font-size: 14px;
50
- }
51
-
52
- .label {
53
- font-family: ${s.fontFamily};
54
- color: ${s.nodeTextColor||s.textColor};
55
- }
56
-
57
- .edge-pattern-dashed {
58
- stroke-dasharray: 8,8;
59
- }
60
-
61
- .node rect,
62
- .node circle,
63
- .node ellipse,
64
- .node polygon
65
- {
66
- fill: ${s.mainBkg};
67
- stroke: ${s.nodeBorder};
68
- stroke-width: ${i==="neo"?c:"1px"};
69
- }
70
-
71
- .relationshipLine {
72
- stroke: ${s.lineColor};
73
- stroke-width: ${i==="neo"?c:"1px"};
74
- fill: none;
75
- }
76
-
77
- .marker {
78
- fill: none !important;
79
- stroke: ${s.lineColor} !important;
80
- stroke-width: 1;
81
- }
82
- [data-look=neo].labelBkg {
83
- background-color: ${Ct(s.tertiaryColor,.5)};
84
- }
85
- `},"getStyles"),ne=re,fe={parser:te,get db(){return new ee},renderer:vt,styles:ne};export{fe as diagram};