@codragraph/cli 2.1.0 → 2.1.4

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 (156) hide show
  1. package/README.md +62 -21
  2. package/dist/_shared/cgdb/schema-constants.d.ts +2 -2
  3. package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -1
  4. package/dist/_shared/cgdb/schema-constants.js +3 -0
  5. package/dist/_shared/cgdb/schema-constants.js.map +1 -1
  6. package/dist/_shared/feature-clusters.d.ts +99 -0
  7. package/dist/_shared/feature-clusters.d.ts.map +1 -0
  8. package/dist/_shared/feature-clusters.js +2 -0
  9. package/dist/_shared/feature-clusters.js.map +1 -0
  10. package/dist/_shared/graph/types.d.ts +16 -2
  11. package/dist/_shared/graph/types.d.ts.map +1 -1
  12. package/dist/_shared/index.d.ts +1 -0
  13. package/dist/_shared/index.d.ts.map +1 -1
  14. package/dist/_shared/index.js.map +1 -1
  15. package/dist/_shared/pipeline.d.ts +1 -1
  16. package/dist/_shared/pipeline.d.ts.map +1 -1
  17. package/dist/cli/ai-context.js +4 -0
  18. package/dist/cli/analyze.js +46 -26
  19. package/dist/cli/index.js +39 -1
  20. package/dist/cli/serve.d.ts +1 -0
  21. package/dist/cli/serve.js +3 -1
  22. package/dist/cli/setup.js +42 -21
  23. package/dist/cli/status.d.ts +13 -0
  24. package/dist/cli/status.js +99 -0
  25. package/dist/cli/tool.d.ts +25 -0
  26. package/dist/cli/tool.js +74 -0
  27. package/dist/config/ignore-service.js +2 -0
  28. package/dist/config/supported-languages.d.ts +3 -3
  29. package/dist/config/supported-languages.js +3 -3
  30. package/dist/core/cgdb/cgdb-adapter.js +19 -3
  31. package/dist/core/cgdb/csv-generator.js +33 -2
  32. package/dist/core/cgdb/schema.d.ts +2 -1
  33. package/dist/core/cgdb/schema.js +55 -0
  34. package/dist/core/embeddings/embedder.js +4 -2
  35. package/dist/core/graphstore/cgdb-row-source.js +3 -2
  36. package/dist/core/graphstore/index.d.ts +1 -1
  37. package/dist/core/graphstore/index.js +1 -1
  38. package/dist/core/group/bridge-db.js +42 -10
  39. package/dist/core/group/service.d.ts +16 -0
  40. package/dist/core/group/service.js +360 -0
  41. package/dist/core/ingestion/emit-references.d.ts +1 -1
  42. package/dist/core/ingestion/emit-references.js +1 -1
  43. package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
  44. package/dist/core/ingestion/feature-cluster-processor.js +626 -0
  45. package/dist/core/ingestion/finalize-orchestrator.js +1 -1
  46. package/dist/core/ingestion/model/registration-table.js +1 -0
  47. package/dist/core/ingestion/model/resolve.d.ts +2 -2
  48. package/dist/core/ingestion/model/resolve.js +3 -3
  49. package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
  50. package/dist/core/ingestion/model/semantic-model.js +1 -1
  51. package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
  52. package/dist/core/ingestion/model/symbol-table.js +1 -1
  53. package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
  54. package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
  55. package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
  56. package/dist/core/ingestion/pipeline-phases/index.js +1 -0
  57. package/dist/core/ingestion/pipeline.d.ts +4 -0
  58. package/dist/core/ingestion/pipeline.js +9 -5
  59. package/dist/core/run-analyze.d.ts +21 -0
  60. package/dist/core/run-analyze.js +213 -6
  61. package/dist/core/search/hybrid-search.js +11 -3
  62. package/dist/mcp/core/embedder.js +5 -2
  63. package/dist/mcp/local/local-backend.d.ts +12 -0
  64. package/dist/mcp/local/local-backend.js +381 -3
  65. package/dist/mcp/resources.js +139 -0
  66. package/dist/mcp/tools.js +174 -2
  67. package/dist/server/api.d.ts +14 -2
  68. package/dist/server/api.js +206 -7
  69. package/dist/server/mcp-http.d.ts +22 -0
  70. package/dist/server/mcp-http.js +21 -2
  71. package/dist/server/web-dashboard.d.ts +28 -0
  72. package/dist/server/web-dashboard.js +61 -0
  73. package/dist/storage/repo-manager.d.ts +6 -1
  74. package/dist/storage/repo-manager.js +5 -1
  75. package/dist/types/pipeline.d.ts +2 -0
  76. package/dist/web/assets/agent-D5lb0zXz.js +1089 -0
  77. package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +36 -0
  78. package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +132 -0
  79. package/dist/web/assets/c4Diagram-DFAF54RM-C4Hl3J2U.js +10 -0
  80. package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +231 -0
  81. package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +1 -0
  82. package/dist/web/assets/chunk-7RZVMHOQ-BitYcNVR.js +338 -0
  83. package/dist/web/assets/chunk-AEOMTBSW-BgTIXPsY.js +1 -0
  84. package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +13 -0
  85. package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +1 -0
  86. package/dist/web/assets/chunk-KSICW3F5-BYzvDLNI.js +15 -0
  87. package/dist/web/assets/chunk-O5ABG6QK-dHwHzA6n.js +1 -0
  88. package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +206 -0
  89. package/dist/web/assets/chunk-RWUO3TPN-BgRTY0_k.js +1 -0
  90. package/dist/web/assets/chunk-TBF5ZNIQ-DL5stGM1.js +1 -0
  91. package/dist/web/assets/chunk-TU3PZOEN-RLyvLcv-.js +1 -0
  92. package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +1 -0
  93. package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +1 -0
  94. package/dist/web/assets/context-builder-22jU3V56.js +16 -0
  95. package/dist/web/assets/cose-bilkent-PNC4W37J-DVhePRYg.js +1 -0
  96. package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +4 -0
  97. package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +43 -0
  98. package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +24 -0
  99. package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +10 -0
  100. package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +24 -0
  101. package/dist/web/assets/erDiagram-GCSMX5X6-C3dhDFA8.js +85 -0
  102. package/dist/web/assets/flowDiagram-OTCZ4VVT-CWSFWmhr.js +162 -0
  103. package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +292 -0
  104. package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +106 -0
  105. package/dist/web/assets/index-BgeqpYgd.js +1415 -0
  106. package/dist/web/assets/index-CT0GtFLZ.css +1 -0
  107. package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +2 -0
  108. package/dist/web/assets/ishikawaDiagram-YMYX4NHK-DUoJvNP2.js +70 -0
  109. package/dist/web/assets/journeyDiagram-SO5T7YLQ-RMFPNNqz.js +139 -0
  110. package/dist/web/assets/kanban-definition-LJHFXRCJ-BzpDs1K9.js +89 -0
  111. package/dist/web/assets/katex-GD7MH7QM-DBQvrix-.js +261 -0
  112. package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +96 -0
  113. package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +30 -0
  114. package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +7 -0
  115. package/dist/web/assets/requirementDiagram-M5DCFWZL-DLHOVTSv.js +84 -0
  116. package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +10 -0
  117. package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +157 -0
  118. package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +1 -0
  119. package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +1 -0
  120. package/dist/web/assets/timeline-definition-5SPVSISX-TRSDRgPw.js +120 -0
  121. package/dist/web/assets/vennDiagram-IE5QUKF5-DNy7HRBM.js +34 -0
  122. package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +161 -0
  123. package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +20 -0
  124. package/dist/web/assets/xychartDiagram-ZHJ5623Y-Dr9r7a35.js +7 -0
  125. package/dist/web/codragraph-logo-512.png +0 -0
  126. package/dist/web/codragraph-logo.png +0 -0
  127. package/dist/web/favicon.png +0 -0
  128. package/dist/web/index.html +36 -0
  129. package/hooks/claude/codragraph-hook.cjs +24 -9
  130. package/hooks/claude/pre-tool-use.sh +6 -1
  131. package/package.json +15 -4
  132. package/scripts/build.js +75 -16
  133. package/scripts/patch-tree-sitter-swift.cjs +0 -1
  134. package/skills/codragraph-cli.md +17 -1
  135. package/skills/codragraph-guide.md +6 -2
  136. package/skills/codragraph-onboarding.md +2 -2
  137. package/vendor/leiden/index.cjs +272 -285
  138. package/vendor/leiden/utils.cjs +264 -274
  139. package/dist/_shared/lbug/schema-constants.d.ts +0 -16
  140. package/dist/_shared/lbug/schema-constants.d.ts.map +0 -1
  141. package/dist/_shared/lbug/schema-constants.js +0 -67
  142. package/dist/_shared/lbug/schema-constants.js.map +0 -1
  143. package/dist/core/graphstore/lbug-row-source.d.ts +0 -19
  144. package/dist/core/graphstore/lbug-row-source.js +0 -141
  145. package/dist/core/lbug/content-read.d.ts +0 -46
  146. package/dist/core/lbug/content-read.js +0 -64
  147. package/dist/core/lbug/csv-generator.d.ts +0 -29
  148. package/dist/core/lbug/csv-generator.js +0 -492
  149. package/dist/core/lbug/lbug-adapter.d.ts +0 -176
  150. package/dist/core/lbug/lbug-adapter.js +0 -1320
  151. package/dist/core/lbug/pool-adapter.d.ts +0 -93
  152. package/dist/core/lbug/pool-adapter.js +0 -550
  153. package/dist/core/lbug/schema.d.ts +0 -62
  154. package/dist/core/lbug/schema.js +0 -502
  155. package/dist/mcp/core/lbug-adapter.d.ts +0 -5
  156. package/dist/mcp/core/lbug-adapter.js +0 -5
@@ -0,0 +1,96 @@
1
+ import{m as ue}from"./chunk-TBF5ZNIQ-DL5stGM1.js";import{y as pe}from"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as h,p as C,g as ye,P as me,O as fe,y as H,q as B,c as j,au as be,ap as _e,aq as ke,ar as Ee}from"./index-BgeqpYgd.js";var Q=function(){var t=h(function(D,n,o,a){for(o=o||{},a=D.length;a--;o[D[a]]=n);return o},"o"),e=[1,4],r=[1,13],l=[1,12],i=[1,15],c=[1,16],u=[1,20],f=[1,19],p=[6,7,8],x=[1,26],L=[1,24],I=[1,25],_=[6,7,11],y=[1,6,13,15,16,19,22],A=[1,33],Y=[1,34],U=[1,6,7,11,13,15,16,19,22],z={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(D,n,o,a,d,s,E){var g=s.length-1;switch(d){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",s[g].id),a.addNode(s[g-1].length,s[g].id,s[g].descr,s[g].type);break;case 16:a.getLogger().trace("Icon: ",s[g]),a.decorateNode({icon:s[g]});break;case 17:case 21:a.decorateNode({class:s[g]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",s[g].id),a.addNode(0,s[g].id,s[g].descr,s[g].type);break;case 20:a.decorateNode({icon:s[g]});break;case 25:a.getLogger().trace("node found ..",s[g-2]),this.$={id:s[g-1],descr:s[g-1],type:a.getType(s[g-2],s[g])};break;case 26:this.$={id:s[g],descr:s[g],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",s[g-3]),this.$={id:s[g-3],descr:s[g-1],type:a.getType(s[g-2],s[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:r,12:21,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},{6:r,9:22,12:11,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},{6:x,7:L,10:23,11:I},t(_,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:f}),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),t(_,[2,21]),t(_,[2,23]),t(_,[2,24]),t(_,[2,26],{19:[1,30]}),{20:[1,31]},{6:x,7:L,10:32,11:I},{1:[2,7],6:r,12:21,13:l,14:14,15:i,16:c,17:17,18:18,19:u,22:f},t(y,[2,14],{7:A,11:Y}),t(U,[2,8]),t(U,[2,9]),t(U,[2,10]),t(_,[2,15]),t(_,[2,16]),t(_,[2,17]),{20:[1,35]},{21:[1,36]},t(y,[2,13],{7:A,11:Y}),t(U,[2,11]),t(U,[2,12]),{21:[1,37]},t(_,[2,25]),t(_,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(D,n){if(n.recoverable)this.trace(D);else{var o=new Error(D);throw o.hash=n,o}},"parseError"),parse:h(function(D){var n=this,o=[0],a=[],d=[null],s=[],E=this.table,g="",P=0,Z=0,ce=0,le=2,ee=1,he=s.slice.call(arguments,1),m=Object.create(this.lexer),$={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&($.yy[V]=this.yy[V]);m.setInput(D,$.yy),$.yy.lexer=m,$.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var W=m.yylloc;s.push(W);var de=m.options&&m.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ge(S){o.length=o.length-2*S,d.length=d.length-S,s.length=s.length-S}h(ge,"popStack");function te(){var S;return S=a.pop()||m.lex()||ee,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}h(te,"lex");for(var k,q,w,N,Re,X,T={},F,v,ne,G;;){if(w=o[o.length-1],this.defaultActions[w]?N=this.defaultActions[w]:((k===null||typeof k>"u")&&(k=te()),N=E[w]&&E[w][k]),typeof N>"u"||!N.length||!N[0]){var J="";G=[];for(F in E[w])this.terminals_[F]&&F>le&&G.push("'"+this.terminals_[F]+"'");m.showPosition?J="Parse error on line "+(P+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+G.join(", ")+", got '"+(this.terminals_[k]||k)+"'":J="Parse error on line "+(P+1)+": Unexpected "+(k==ee?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(J,{text:m.match,token:this.terminals_[k]||k,line:m.yylineno,loc:W,expected:G})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+k);switch(N[0]){case 1:o.push(k),d.push(m.yytext),s.push(m.yylloc),o.push(N[1]),k=null,q?(k=q,q=null):(Z=m.yyleng,g=m.yytext,P=m.yylineno,W=m.yylloc,ce>0);break;case 2:if(v=this.productions_[N[1]][1],T.$=d[d.length-v],T._$={first_line:s[s.length-(v||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(v||1)].first_column,last_column:s[s.length-1].last_column},de&&(T._$.range=[s[s.length-(v||1)].range[0],s[s.length-1].range[1]]),X=this.performAction.apply(T,[g,Z,P,$.yy,N[1],d,s].concat(he)),typeof X<"u")return X;v&&(o=o.slice(0,-1*v*2),d=d.slice(0,-1*v),s=s.slice(0,-1*v)),o.push(this.productions_[N[1]][0]),d.push(T.$),s.push(T._$),ne=E[o[o.length-2]][o[o.length-1]],o.push(ne);break;case 3:return!0}}return!0},"parse")},ae=function(){var D={EOF:1,parseError:h(function(n,o){if(this.yy.parser)this.yy.parser.parseError(n,o);else throw new Error(n)},"parseError"),setInput:h(function(n,o){return this.yy=o||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:h(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(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:h(function(n){var o=n.length,a=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var d=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),a.length-1&&(this.yylineno-=a.length-1);var s=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:a?(a.length===d.length?this.yylloc.first_column:0)+d[d.length-a.length].length-a[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(n){this.unput(this.match.slice(n))},"less"),pastInput:h(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:h(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:h(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
5
+ `+o+"^"},"showPosition"),test_match:h(function(n,o){var a,d,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),d=n[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.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],a=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var E in s)this[E]=s[E];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,o,a,d;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),E=0;E<s.length;E++)if(a=this._input.match(this.rules[s[E]]),a&&(!o||a[0].length>o[0].length)){if(o=a,d=E,this.options.backtrack_lexer){if(n=this.test_match(a,s[E]),n!==!1)return n;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(n=this.test_match(o,s[d]),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:h(function(){var n=this.next();return n||this.lex()},"lex"),begin:h(function(n){this.conditionStack.push(n)},"begin"),popState:h(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(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:h(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:h(function(n){this.begin(n)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(n,o,a,d){switch(a){case 0:return n.getLogger().trace("Found comment",o.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return n.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:n.getLogger().trace("end icon"),this.popState();break;case 10:return n.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return n.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return n.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),n.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 30:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 35:return n.getLogger().trace("Long description:",o.yytext),20;case 36:return n.getLogger().trace("Long description:",o.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return D}();z.lexer=ae;function M(){this.yy={}}return h(M,"Parser"),M.prototype=z,z.Parser=M,new M}();Q.parser=Q;var Se=Q,b=[];for(let t=0;t<256;++t)b.push((t+256).toString(16).slice(1));function se(t,e=0){return(b[t[e+0]]+b[t[e+1]]+b[t[e+2]]+b[t[e+3]]+"-"+b[t[e+4]]+b[t[e+5]]+"-"+b[t[e+6]]+b[t[e+7]]+"-"+b[t[e+8]]+b[t[e+9]]+"-"+b[t[e+10]]+b[t[e+11]]+b[t[e+12]]+b[t[e+13]]+b[t[e+14]]+b[t[e+15]]).toLowerCase()}h(se,"unsafeStringify");var K,Ne=new Uint8Array(16);function oe(){if(!K){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");K=crypto.getRandomValues.bind(crypto)}return K(Ne)}h(oe,"rng");var Le=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ie={randomUUID:Le};function re(t,e,r){var i;if(ie.randomUUID&&!e&&!t)return ie.randomUUID();t=t||{};let l=t.random??((i=t.rng)==null?void 0:i.call(t))??oe();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let c=0;c<16;++c)e[r+c]=l[c];return e}return se(l)}h(re,"v4");var xe=re,De=12,O={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},R,ve=(R=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=O,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let r=this.nodes.length-1;r>=0;r--)if(this.nodes[r].level<e)return this.nodes[r];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,r,l,i){var L,I;C.info("addNode",e,r,l,i);let c=!1;this.nodes.length===0?(this.baseLevel=e,e=0,c=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,c=!1);let u=B(),f=((L=u.mindmap)==null?void 0:L.padding)??H.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}let p={id:this.count++,nodeId:j(r,u),level:e,descr:j(l,u),type:i,children:[],width:((I=u.mindmap)==null?void 0:I.maxNodeWidth)??H.mindmap.maxNodeWidth,padding:f,isRoot:c},x=this.getParent(e);if(x)x.children.push(p),this.nodes.push(p);else if(c)this.nodes.push(p);else throw new Error(`There can be only one root. No parent could be found for ("${p.descr}")`)}getType(e,r){switch(C.debug("In get type",e,r),e){case"[":return this.nodeType.RECT;case"(":return r===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,r){this.elements[e]=r}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let r=B(),l=this.nodes[this.nodes.length-1];e.icon&&(l.icon=j(e.icon,r)),e.class&&(l.class=j(e.class,r))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,r){if(e.level===0?e.section=void 0:e.section=r,e.children)for(let[l,i]of e.children.entries()){let c=e.level===0?l%(De-1):r;this.assignSections(i,c)}}flattenNodes(e,r){let l=B(),i=["mindmap-node"];e.isRoot===!0?i.push("section-root","section--1"):e.section!==void 0&&i.push(`section-${e.section}`),e.class&&i.push(e.class);let c=i.join(" "),u=h(p=>{var L;let x=(((L=l.theme)==null?void 0:L.toLowerCase())??"").includes("redux");switch(p){case O.CIRCLE:return"mindmapCircle";case O.RECT:return"rect";case O.ROUNDED_RECT:return"rounded";case O.CLOUD:return"cloud";case O.BANG:return"bang";case O.HEXAGON:return"hexagon";case O.DEFAULT:return x?"rounded":"defaultMindmapNode";case O.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:u(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:c,cssStyles:[],look:l.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(r.push(f),e.children)for(let p of e.children)this.flattenNodes(p,r)}generateEdges(e,r){if(!e.children)return;let l=B();for(let i of e.children){let c="edge";i.section!==void 0&&(c+=` section-edge-${i.section}`);let u=e.level+1;c+=` edge-depth-${u}`;let f={id:`edge_${e.id}_${i.id}`,start:e.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:l.look,classes:c,depth:e.level,section:i.section};r.push(f),this.generateEdges(i,r)}}getData(){let e=this.getMindmap(),r=B(),l=be().layout!==void 0,i=r;if(l||(i.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:i};C.debug("getData: mindmapRoot",e,r),this.assignSections(e);let c=[],u=[];this.flattenNodes(e,c),this.generateEdges(e,u),C.debug(`getData: processed ${c.length} nodes and ${u.length} edges`);let f=new Map;for(let p of c)f.set(p.id,{shape:p.shape,width:p.width,height:p.height,padding:p.padding});return{nodes:c,edges:u,config:i,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(f),type:"mindmap",diagramId:"mindmap-"+xe()}}getLogger(){return C}},h(R,"MindmapDB"),R),Oe=h(async(t,e,r,l)=>{var I,_;C.debug(`Rendering mindmap diagram
7
+ `+t);let i=l.db,c=i.getData(),u=ue(e,c.config.securityLevel);if(c.type=l.type,c.layoutAlgorithm=ye(c.config.layout,{fallback:"cose-bilkent"}),c.diagramId=e,!i.getMindmap())return;c.nodes.forEach(y=>{y.shape==="rounded"?(y.radius=15,y.taper=15,y.stroke="none",y.width=0,y.padding=15):y.shape==="circle"?y.padding=10:y.shape==="rect"?(y.width=0,y.padding=10):y.shape==="hexagon"&&(y.width=0,y.height=0)}),await me(c,u);let{themeVariables:f}=fe(),{useGradient:p,gradientStart:x,gradientStop:L}=f;if(p&&x&&L){let y=u.attr("id"),A=u.append("defs").append("linearGradient").attr("id",`${y}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",L).attr("stop-opacity",1)}pe(u,((I=c.config.mindmap)==null?void 0:I.padding)??H.mindmap.padding,"mindmapDiagram",((_=c.config.mindmap)==null?void 0:_.useMaxWidth)??H.mindmap.useMaxWidth)},"draw"),Ie={draw:Oe},$e=h(t=>{let{theme:e,look:r}=t,l="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],_e(t["lineColor"+i])?t["lineColor"+i]=ke(t["lineColor"+i],20):t["lineColor"+i]=Ee(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){let c=""+(r==="neo"?Math.max(10-(i-1)*2,2):17-3*i);l+=`
8
+ .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path {
9
+ fill: ${t["cScale"+i]};
10
+ }
11
+ .section-${i-1} text {
12
+ fill: ${t["cScaleLabel"+i]};
13
+ }
14
+ .section-${i-1} span {
15
+ color: ${t["cScaleLabel"+i]};
16
+ }
17
+ .node-icon-${i-1} {
18
+ font-size: 40px;
19
+ color: ${t["cScaleLabel"+i]};
20
+ }
21
+ .section-edge-${i-1}{
22
+ stroke: ${t["cScale"+i]};
23
+ }
24
+ .edge-depth-${i-1}{
25
+ stroke-width: ${c};
26
+ }
27
+ .section-${i-1} line {
28
+ stroke: ${t["cScaleInv"+i]} ;
29
+ stroke-width: 3;
30
+ }
31
+
32
+ .disabled, .disabled circle, .disabled text {
33
+ fill: lightgray;
34
+ }
35
+ .disabled text {
36
+ fill: #efefef;
37
+ }
38
+ [data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {
39
+ fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?t.mainBkg:t["cScale"+i]};
40
+ stroke: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScale"+i]};
41
+ stroke-width: ${t.strokeWidth??2}px;
42
+ }
43
+ [data-look="neo"].section-edge-${i-1}{
44
+ stroke: ${e!=null&&e.includes("redux")||e==="neo-dark"?t.nodeBorder:t["cScale"+i]};
45
+ }
46
+ [data-look="neo"].mindmap-node.section-${i-1} text {
47
+ fill: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:i)]};
48
+ }
49
+ `}return l},"genSections"),we=h((t,e,r)=>{let l="";for(let i=0;i<t;i++)l+=`
50
+ [data-look="neo"].mindmap-node.section-${i-1} rect, [data-look="neo"].mindmap-node.section-${i-1} path, [data-look="neo"].mindmap-node.section-${i-1} circle, [data-look="neo"].mindmap-node.section-${i-1} polygon {
51
+ stroke: url(${e}-gradient);
52
+ fill: ${r};
53
+ }
54
+ .section-${i-1} line {
55
+ stroke-width: 0;
56
+ }`;return l},"genGradient"),Te=h(t=>{let{theme:e}=t,r=t.svgId,l=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return`
57
+ .edge {
58
+ stroke-width: 3;
59
+ }
60
+ ${$e(t)}
61
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
62
+ fill: ${t.git0};
63
+ }
64
+ .section-root text {
65
+ fill: ${t.gitBranchLabel0};
66
+ }
67
+ .section-root span {
68
+ color: ${e!=null&&e.includes("redux")?t.nodeBorder:t.gitBranchLabel0};
69
+ }
70
+ .icon-container {
71
+ height:100%;
72
+ display: flex;
73
+ justify-content: center;
74
+ align-items: center;
75
+ }
76
+ .edge {
77
+ fill: none;
78
+ }
79
+ .mindmap-node-label {
80
+ dy: 1em;
81
+ alignment-baseline: middle;
82
+ text-anchor: middle;
83
+ dominant-baseline: middle;
84
+ text-align: center;
85
+ }
86
+ [data-look="neo"].mindmap-node {
87
+ filter: ${l};
88
+ }
89
+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
90
+ fill: ${e!=null&&e.includes("redux")?t.mainBkg:t.git0};
91
+ }
92
+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan {
93
+ fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]};
94
+ }
95
+ ${t.useGradient&&r&&t.mainBkg?we(t.THEME_COLOR_LIMIT,r,t.mainBkg):""}
96
+ `},"getStyles"),Ce=Te,Me={get db(){return new ve},renderer:Ie,parser:Se,styles:Ce};export{Me as diagram};
@@ -0,0 +1,30 @@
1
+ import{c as U}from"./chunk-AEOMTBSW-BgTIXPsY.js";import{d as X}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{l as Z,a as _,s as ee,e as te,n as ae,h as ie,m as l,p as S,q as le,L as re,a7 as se,a8 as oe,a9 as W,aa as ne,b as pe,o as de,ab as ce,y as ue}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var he=ue.pie,v={sections:new Map,showData:!1},g=v.sections,y=v.showData,ge=structuredClone(he),me=l(()=>structuredClone(ge),"getConfig"),fe=l(()=>{g=new Map,y=v.showData,de()},"clear"),xe=l(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);g.has(e)||(g.set(e,a),S.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),$e=l(()=>g,"getSections"),we=l(e=>{y=e},"setShowData"),Se=l(()=>y,"getShowData"),E={getConfig:me,clear:fe,setDiagramTitle:ie,getDiagramTitle:ae,setAccTitle:te,getAccTitle:ee,setAccDescription:_,getAccDescription:Z,addSection:xe,getSections:$e,setShowData:we,getShowData:Se},ve=l((e,a)=>{U(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ye={parse:l(async e=>{let a=await X("pie",e);S.debug(a),ve(a,E)},"parse")},Te=l(e=>`
2
+ .pieCircle{
3
+ stroke: ${e.pieStrokeColor};
4
+ stroke-width : ${e.pieStrokeWidth};
5
+ opacity : ${e.pieOpacity};
6
+ }
7
+ .pieOuterCircle{
8
+ stroke: ${e.pieOuterStrokeColor};
9
+ stroke-width: ${e.pieOuterStrokeWidth};
10
+ fill: none;
11
+ }
12
+ .pieTitleText {
13
+ text-anchor: middle;
14
+ font-size: ${e.pieTitleTextSize};
15
+ fill: ${e.pieTitleTextColor};
16
+ font-family: ${e.fontFamily};
17
+ }
18
+ .slice {
19
+ font-family: ${e.fontFamily};
20
+ fill: ${e.pieSectionTextColor};
21
+ font-size:${e.pieSectionTextSize};
22
+ // fill: white;
23
+ }
24
+ .legend text {
25
+ fill: ${e.pieLegendTextColor};
26
+ font-family: ${e.fontFamily};
27
+ font-size: ${e.pieLegendTextSize};
28
+ }
29
+ `,"getStyles"),be=Te,De=l(e=>{let a=[...e.values()].reduce((r,s)=>r+s,0),T=[...e.entries()].map(([r,s])=>({label:r,value:s})).filter(r=>r.value/a*100>=1);return ce().value(r=>r.value).sort(null)(T)},"createPieArcs"),Ce=l((e,a,T,r)=>{var B;S.debug(`rendering pie chart
30
+ `+e);let s=r.db,b=le(),D=re(s.getConfig(),b.pie),C=40,o=18,c=4,p=450,d=p,m=se(a),n=m.append("g");n.attr("transform","translate("+d/2+","+p/2+")");let{themeVariables:i}=b,[k]=oe(i.pieOuterStrokeWidth);k??(k=2);let A=D.textPosition,u=Math.min(d,p)/2-C,P=W().innerRadius(0).outerRadius(u),q=W().innerRadius(u*A).outerRadius(u*A);n.append("circle").attr("cx",0).attr("cy",0).attr("r",u+k/2).attr("class","pieOuterCircle");let h=s.getSections(),j=De(h),G=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12],f=0;h.forEach(t=>{f+=t});let M=j.filter(t=>(t.data.value/f*100).toFixed(0)!=="0"),x=ne(G).domain([...h.keys()]);n.selectAll("mySlices").data(M).enter().append("path").attr("d",P).attr("fill",t=>x(t.data.label)).attr("class","pieCircle"),n.selectAll("mySlices").data(M).enter().append("text").text(t=>(t.data.value/f*100).toFixed(0)+"%").attr("transform",t=>"translate("+q.centroid(t)+")").style("text-anchor","middle").attr("class","slice");let H=n.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),O=[...h.entries()].map(([t,w])=>({label:t,value:w})),$=n.selectAll(".legend").data(O).enter().append("g").attr("class","legend").attr("transform",(t,w)=>{let L=o+c,J=L*O.length/2,K=12*o,Q=w*L-J;return"translate("+K+","+Q+")"});$.append("rect").attr("width",o).attr("height",o).style("fill",t=>x(t.label)).style("stroke",t=>x(t.label)),$.append("text").attr("x",o+c).attr("y",o-c).text(t=>s.getShowData()?`${t.label} [${t.value}]`:t.label);let N=Math.max(...$.selectAll("text").nodes().map(t=>(t==null?void 0:t.getBoundingClientRect().width)??0)),V=d+C+o+c+N,R=((B=H.node())==null?void 0:B.getBoundingClientRect().width)??0,Y=d/2-R/2,I=d/2+R/2,z=Math.min(0,Y),F=Math.max(V,I)-z;m.attr("viewBox",`${z} 0 ${F} ${p}`),pe(m,p,F,D.useMaxWidth)},"draw"),ke={draw:Ce},ze={parser:ye,db:E,renderer:ke,styles:be};export{ze as diagram};
@@ -0,0 +1,7 @@
1
+ import{a as _e,l as ke,n as ie,h as Fe,s as Pe,e as Ce,m as l,q as wt,p as bt,i as Et,b as ve,o as Le,y as E,Z as ee,c as Ee,ac as De}from"./index-BgeqpYgd.js";var Dt=function(){var t=l(function(H,s,c,o){for(c=c||{},o=H.length;o--;c[H[o]]=s);return c},"o"),n=[1,3],d=[1,4],u=[1,5],h=[1,6],f=[1,7],g=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],T=[2,36],p=[1,37],y=[1,36],A=[1,38],q=[1,35],x=[1,43],m=[1,41],U=[1,14],j=[1,23],K=[1,18],pt=[1,19],ut=[1,20],dt=[1,21],xt=[1,22],ft=[1,24],gt=[1,25],i=[1,26],zt=[1,27],Nt=[1,28],Wt=[1,29],$=[1,32],Q=[1,33],_=[1,34],k=[1,39],F=[1,40],P=[1,42],C=[1,44],M=[1,62],O=[1,61],v=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Bt=[1,65],Rt=[1,66],$t=[1,67],Qt=[1,68],Ht=[1,69],Xt=[1,70],Ut=[1,71],Mt=[1,72],Ot=[1,73],Yt=[1,74],jt=[1,75],Kt=[1,76],z=[4,5,6,7,8,9,10,11,12,13,14,15,18],V=[1,90],J=[1,91],tt=[1,92],et=[1,99],it=[1,93],at=[1,96],nt=[1,94],st=[1,95],rt=[1,97],lt=[1,98],_t=[1,102],Zt=[10,55,56,57],B=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:l(function(H,s,c,o,b,e,N){var r=e.length-1;switch(b){case 23:this.$=e[r];break;case 24:this.$=e[r-1]+""+e[r];break;case 26:this.$=e[r-1]+e[r];break;case 27:this.$=[e[r].trim()];break;case 28:e[r-2].push(e[r].trim()),this.$=e[r-2];break;case 29:this.$=e[r-4],o.addClass(e[r-2],e[r]);break;case 37:this.$=[];break;case 42:this.$=e[r].trim(),o.setDiagramTitle(this.$);break;case 43:this.$=e[r].trim(),o.setAccTitle(this.$);break;case 44:case 45:this.$=e[r].trim(),o.setAccDescription(this.$);break;case 46:o.addSection(e[r].substr(8)),this.$=e[r].substr(8);break;case 47:o.addPoint(e[r-3],"",e[r-1],e[r],[]);break;case 48:o.addPoint(e[r-4],e[r-3],e[r-1],e[r],[]);break;case 49:o.addPoint(e[r-4],"",e[r-2],e[r-1],e[r]);break;case 50:o.addPoint(e[r-5],e[r-4],e[r-2],e[r-1],e[r]);break;case 51:o.setXAxisLeftText(e[r-2]),o.setXAxisRightText(e[r]);break;case 52:e[r-1].text+=" ⟶ ",o.setXAxisLeftText(e[r-1]);break;case 53:o.setXAxisLeftText(e[r]);break;case 54:o.setYAxisBottomText(e[r-2]),o.setYAxisTopText(e[r]);break;case 55:e[r-1].text+=" ⟶ ",o.setYAxisBottomText(e[r-1]);break;case 56:o.setYAxisBottomText(e[r]);break;case 57:o.setQuadrant1Text(e[r]);break;case 58:o.setQuadrant2Text(e[r]);break;case 59:o.setQuadrant3Text(e[r]);break;case 60:o.setQuadrant4Text(e[r]);break;case 64:this.$={text:e[r],type:"text"};break;case 65:this.$={text:e[r-1].text+""+e[r],type:e[r-1].type};break;case 66:this.$={text:e[r],type:"text"};break;case 67:this.$={text:e[r],type:"markdown"};break;case 68:this.$=e[r];break;case 69:this.$=e[r-1]+""+e[r];break}},"anonymous"),table:[{18:n,26:1,27:2,28:d,55:u,56:h,57:f},{1:[3]},{18:n,26:8,27:2,28:d,55:u,56:h,57:f},{18:n,26:9,27:2,28:d,55:u,56:h,57:f},t(g,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,T,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:p,5:y,10:A,12:q,13:x,14:m,18:U,25:j,35:K,37:pt,39:ut,41:dt,42:xt,48:ft,50:gt,51:i,52:zt,53:Nt,54:Wt,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),t(g,[2,34]),{27:45,55:u,56:h,57:f},t(a,[2,37]),t(a,T,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:p,5:y,10:A,12:q,13:x,14:m,18:U,25:j,35:K,37:pt,39:ut,41:dt,42:xt,48:ft,50:gt,51:i,52:zt,53:Nt,54:Wt,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(a,[2,45]),t(a,[2,46]),{18:[1,50]},{4:p,5:y,10:A,12:q,13:x,14:m,43:51,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:52,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:53,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:54,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:55,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,10:A,12:q,13:x,14:m,43:56,58:31,60:$,61:Q,63:_,64:k,65:F,66:P,67:C},{4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,44:[1,57],47:[1,58],58:60,59:59,63:_,64:k,65:F,66:P,67:C},t(v,[2,64]),t(v,[2,66]),t(v,[2,67]),t(v,[2,70]),t(v,[2,71]),t(v,[2,72]),t(v,[2,73]),t(v,[2,74]),t(v,[2,75]),t(v,[2,76]),t(v,[2,77]),t(v,[2,78]),t(v,[2,79]),t(v,[2,80]),t(g,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:64,4:Bt,5:Rt,6:$t,7:Qt,8:Ht,9:Xt,10:Ut,11:Mt,12:Ot,13:Yt,14:jt,15:Kt,21:63},t(a,[2,53],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,49:[1,77],63:_,64:k,65:F,66:P,67:C}),t(a,[2,56],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,49:[1,78],63:_,64:k,65:F,66:P,67:C}),t(a,[2,57],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,58],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,59],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,60],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),{45:[1,79]},{44:[1,80]},t(v,[2,65]),t(v,[2,81]),t(v,[2,82]),t(v,[2,83]),{3:82,4:Bt,5:Rt,6:$t,7:Qt,8:Ht,9:Xt,10:Ut,11:Mt,12:Ot,13:Yt,14:jt,15:Kt,18:[1,81]},t(z,[2,23]),t(z,[2,1]),t(z,[2,2]),t(z,[2,3]),t(z,[2,4]),t(z,[2,5]),t(z,[2,6]),t(z,[2,7]),t(z,[2,8]),t(z,[2,9]),t(z,[2,10]),t(z,[2,11]),t(z,[2,12]),t(a,[2,52],{58:31,43:83,4:p,5:y,10:A,12:q,13:x,14:m,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),t(a,[2,55],{58:31,43:84,4:p,5:y,10:A,12:q,13:x,14:m,60:$,61:Q,63:_,64:k,65:F,66:P,67:C}),{46:[1,85]},{45:[1,86]},{4:V,5:J,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:lt,22:88,23:87},t(z,[2,24]),t(a,[2,51],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,54],{59:59,58:60,4:p,5:y,8:M,10:A,12:q,13:x,14:m,18:O,63:_,64:k,65:F,66:P,67:C}),t(a,[2,47],{22:88,16:89,23:100,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt}),{46:[1,101]},t(a,[2,29],{10:_t}),t(Zt,[2,27],{16:103,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt}),t(B,[2,25]),t(B,[2,13]),t(B,[2,14]),t(B,[2,15]),t(B,[2,16]),t(B,[2,17]),t(B,[2,18]),t(B,[2,19]),t(B,[2,20]),t(B,[2,21]),t(B,[2,22]),t(a,[2,49],{10:_t}),t(a,[2,48],{22:88,16:89,23:104,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt}),{4:V,5:J,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:lt,22:105},t(B,[2,26]),t(a,[2,50],{10:_t}),t(Zt,[2,28],{16:103,4:V,5:J,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:lt})],defaultActions:{8:[2,30],9:[2,31]},parseError:l(function(H,s){if(s.recoverable)this.trace(H);else{var c=new Error(H);throw c.hash=s,c}},"parseError"),parse:l(function(H){var s=this,c=[0],o=[],b=[null],e=[],N=this.table,r="",Tt=0,Gt=0,qe=0,me=2,Vt=1,Ae=e.slice.call(arguments,1),L=Object.create(this.lexer),Z={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(Z.yy[Ft]=this.yy[Ft]);L.setInput(H,Z.yy),Z.yy.lexer=L,Z.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var Pt=L.yylloc;e.push(Pt);var be=L.options&&L.options.ranges;typeof Z.yy.parseError=="function"?this.parseError=Z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(W){c.length=c.length-2*W,b.length=b.length-W,e.length=e.length-W}l(Se,"popStack");function Jt(){var W;return W=o.pop()||L.lex()||Vt,typeof W!="number"&&(W instanceof Array&&(o=W,W=o.pop()),W=s.symbols_[W]||W),W}l(Jt,"lex");for(var I,Ct,G,R,$e,vt,ot={},qt,Y,te,mt;;){if(G=c[c.length-1],this.defaultActions[G]?R=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=Jt()),R=N[G]&&N[G][I]),typeof R>"u"||!R.length||!R[0]){var Lt="";mt=[];for(qt in N[G])this.terminals_[qt]&&qt>me&&mt.push("'"+this.terminals_[qt]+"'");L.showPosition?Lt="Parse error on line "+(Tt+1)+`:
2
+ `+L.showPosition()+`
3
+ Expecting `+mt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Lt="Parse error on line "+(Tt+1)+": Unexpected "+(I==Vt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Lt,{text:L.match,token:this.terminals_[I]||I,line:L.yylineno,loc:Pt,expected:mt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+I);switch(R[0]){case 1:c.push(I),b.push(L.yytext),e.push(L.yylloc),c.push(R[1]),I=null,Ct?(I=Ct,Ct=null):(Gt=L.yyleng,r=L.yytext,Tt=L.yylineno,Pt=L.yylloc,qe>0);break;case 2:if(Y=this.productions_[R[1]][1],ot.$=b[b.length-Y],ot._$={first_line:e[e.length-(Y||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(Y||1)].first_column,last_column:e[e.length-1].last_column},be&&(ot._$.range=[e[e.length-(Y||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(ot,[r,Gt,Tt,Z.yy,R[1],b,e].concat(Ae)),typeof vt<"u")return vt;Y&&(c=c.slice(0,-1*Y*2),b=b.slice(0,-1*Y),e=e.slice(0,-1*Y)),c.push(this.productions_[R[1]][0]),b.push(ot.$),e.push(ot._$),te=N[c[c.length-2]][c[c.length-1]],c.push(te);break;case 3:return!0}}return!0},"parse")},Te=function(){var H={EOF:1,parseError:l(function(s,c){if(this.yy.parser)this.yy.parser.parseError(s,c);else throw new Error(s)},"parseError"),setInput:l(function(s,c){return this.yy=c||this.yy||{},this._input=s,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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var c=s.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var c=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var b=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),o.length-1&&(this.yylineno-=o.length-1);var e=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:o?(o.length===b.length?this.yylloc.first_column:0)+b[b.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),c=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+c+"^"},"showPosition"),test_match:l(function(s,c){var o,b,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),b=s[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var N in e)this[N]=e[N];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,c,o,b;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),N=0;N<e.length;N++)if(o=this._input.match(this.rules[e[N]]),o&&(!c||o[0].length>c[0].length)){if(c=o,b=N,this.options.backtrack_lexer){if(s=this.test_match(o,e[N]),s!==!1)return s;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(s=this.test_match(c,e[b]),s!==!1?s:!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:l(function(){var s=this.next();return s||this.lex()},"lex"),begin:l(function(s){this.conditionStack.push(s)},"begin"),popState:l(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:l(function(s){this.begin(s)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(s,c,o,b){switch(o){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return H}();kt.lexer=Te;function yt(){this.yy={}}return l(yt,"Parser"),yt.prototype=kt,kt.Parser=yt,new yt}();Dt.parser=Dt;var Ie=Dt,w=De(),ht,we=(ht=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var n,d,u,h,f,g,S,a,T,p,y,A,q,x,m,U,j,K;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((n=E.quadrantChart)==null?void 0:n.chartWidth)||500,chartWidth:((d=E.quadrantChart)==null?void 0:d.chartHeight)||500,titlePadding:((u=E.quadrantChart)==null?void 0:u.titlePadding)||10,titleFontSize:((h=E.quadrantChart)==null?void 0:h.titleFontSize)||20,quadrantPadding:((f=E.quadrantChart)==null?void 0:f.quadrantPadding)||5,xAxisLabelPadding:((g=E.quadrantChart)==null?void 0:g.xAxisLabelPadding)||5,yAxisLabelPadding:((S=E.quadrantChart)==null?void 0:S.yAxisLabelPadding)||5,xAxisLabelFontSize:((a=E.quadrantChart)==null?void 0:a.xAxisLabelFontSize)||16,yAxisLabelFontSize:((T=E.quadrantChart)==null?void 0:T.yAxisLabelFontSize)||16,quadrantLabelFontSize:((p=E.quadrantChart)==null?void 0:p.quadrantLabelFontSize)||16,quadrantTextTopPadding:((y=E.quadrantChart)==null?void 0:y.quadrantTextTopPadding)||5,pointTextPadding:((A=E.quadrantChart)==null?void 0:A.pointTextPadding)||5,pointLabelFontSize:((q=E.quadrantChart)==null?void 0:q.pointLabelFontSize)||12,pointRadius:((x=E.quadrantChart)==null?void 0:x.pointRadius)||5,xAxisPosition:((m=E.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((U=E.quadrantChart)==null?void 0:U.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((j=E.quadrantChart)==null?void 0:j.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((K=E.quadrantChart)==null?void 0:K.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:w.quadrant1Fill,quadrant2Fill:w.quadrant2Fill,quadrant3Fill:w.quadrant3Fill,quadrant4Fill:w.quadrant4Fill,quadrant1TextFill:w.quadrant1TextFill,quadrant2TextFill:w.quadrant2TextFill,quadrant3TextFill:w.quadrant3TextFill,quadrant4TextFill:w.quadrant4TextFill,quadrantPointFill:w.quadrantPointFill,quadrantPointTextFill:w.quadrantPointTextFill,quadrantXAxisTextFill:w.quadrantXAxisTextFill,quadrantYAxisTextFill:w.quadrantYAxisTextFill,quadrantTitleFill:w.quadrantTitleFill,quadrantInternalBorderStrokeFill:w.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:w.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,d){this.classes.set(n,d)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,d,u,h){let f=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,g={top:n==="top"&&d?f:0,bottom:n==="bottom"&&d?f:0},S=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&u?S:0,right:this.config.yAxisPosition==="right"&&u?S:0},T=this.config.titleFontSize+this.config.titlePadding*2,p={top:h?T:0},y=this.config.quadrantPadding+a.left,A=this.config.quadrantPadding+g.top+p.top,q=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,x=this.config.chartHeight-this.config.quadrantPadding*2-g.top-g.bottom-p.top,m=q/2,U=x/2;return{xAxisSpace:g,yAxisSpace:a,titleSpace:p,quadrantSpace:{quadrantLeft:y,quadrantTop:A,quadrantWidth:q,quadrantHalfWidth:m,quadrantHeight:x,quadrantHalfHeight:U}}}getAxisLabels(n,d,u,h){let{quadrantSpace:f,titleSpace:g}=h,{quadrantHalfHeight:S,quadrantHeight:a,quadrantLeft:T,quadrantHalfWidth:p,quadrantTop:y,quadrantWidth:A}=f,q=!!this.data.xAxisRightText,x=!!this.data.yAxisTopText,m=[];return this.data.xAxisLeftText&&d&&m.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:T+(q?p/2:0),y:n==="top"?this.config.xAxisLabelPadding+g.top:this.config.xAxisLabelPadding+y+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&d&&m.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:T+p+(q?p/2:0),y:n==="top"?this.config.xAxisLabelPadding+g.top:this.config.xAxisLabelPadding+y+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&u&&m.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+T+A+this.config.quadrantPadding,y:y+a-(x?S/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&u&&m.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+T+A+this.config.quadrantPadding,y:y+S-(x?S/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),m}getQuadrants(n){let{quadrantSpace:d}=n,{quadrantHalfHeight:u,quadrantLeft:h,quadrantHalfWidth:f,quadrantTop:g}=d,S=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+f,y:g,width:f,height:u,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:g,width:f,height:u,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:g+u,width:f,height:u,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+f,y:g+u,width:f,height:u,fill:this.themeConfig.quadrant4Fill}];for(let a of S)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return S}getQuadrantPoints(n){let{quadrantSpace:d}=n,{quadrantHeight:u,quadrantLeft:h,quadrantTop:f,quadrantWidth:g}=d,S=ee().domain([0,1]).range([h,g+h]),a=ee().domain([0,1]).range([u+f,f]);return this.data.points.map(T=>{let p=this.classes.get(T.className);return p&&(T={...p,...T}),{x:S(T.x),y:a(T.y),fill:T.color??this.themeConfig.quadrantPointFill,radius:T.radius??this.config.pointRadius,text:{text:T.text,fill:this.themeConfig.quadrantPointTextFill,x:S(T.x),y:a(T.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:T.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:T.strokeWidth??"0px"}})}getBorders(n){let d=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:u}=n,{quadrantHalfHeight:h,quadrantHeight:f,quadrantLeft:g,quadrantHalfWidth:S,quadrantTop:a,quadrantWidth:T}=u;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g-d,y1:a,x2:g+T+d,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g+T,y1:a+d,x2:g+T,y2:a+f-d},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g-d,y1:a+f,x2:g+T+d,y2:a+f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:g,y1:a+d,x2:g,y2:a+f-d},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:g+S,y1:a+d,x2:g+S,y2:a+f-d},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:g+d,y1:a+h,x2:g+T-d,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){let n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),d=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),u=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,f=this.calculateSpace(h,n,d,u);return{points:this.getQuadrantPoints(f),quadrants:this.getQuadrants(f),axisLabels:this.getAxisLabels(h,n,d,f),borderLines:this.getBorders(f),title:this.getTitle(u)}}},l(ht,"QuadrantBuilder"),ht),ct,At=(ct=class extends Error{constructor(n,d,u){super(`value for ${n} ${d} is invalid, please use a valid ${u}`),this.name="InvalidStyleError"}},l(ct,"InvalidStyleError"),ct);function It(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}l(It,"validateHexCode");function ae(t){return!/^\d+$/.test(t)}l(ae,"validateNumber");function ne(t){return!/^\d+px$/.test(t)}l(ne,"validateSizeInPixels");var ze=wt();function X(t){return Ee(t.trim(),ze)}l(X,"textSanitizer");var D=new we;function se(t){D.setData({quadrant1Text:X(t.text)})}l(se,"setQuadrant1Text");function re(t){D.setData({quadrant2Text:X(t.text)})}l(re,"setQuadrant2Text");function le(t){D.setData({quadrant3Text:X(t.text)})}l(le,"setQuadrant3Text");function oe(t){D.setData({quadrant4Text:X(t.text)})}l(oe,"setQuadrant4Text");function he(t){D.setData({xAxisLeftText:X(t.text)})}l(he,"setXAxisLeftText");function ce(t){D.setData({xAxisRightText:X(t.text)})}l(ce,"setXAxisRightText");function ue(t){D.setData({yAxisTopText:X(t.text)})}l(ue,"setYAxisTopText");function de(t){D.setData({yAxisBottomText:X(t.text)})}l(de,"setYAxisBottomText");function St(t){let n={};for(let d of t){let[u,h]=d.trim().split(/\s*:\s*/);if(u==="radius"){if(ae(h))throw new At(u,h,"number");n.radius=parseInt(h)}else if(u==="color"){if(It(h))throw new At(u,h,"hex code");n.color=h}else if(u==="stroke-color"){if(It(h))throw new At(u,h,"hex code");n.strokeColor=h}else if(u==="stroke-width"){if(ne(h))throw new At(u,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${u} is not supported.`)}return n}l(St,"parseStyles");function xe(t,n,d,u,h){let f=St(h);D.addPoints([{x:d,y:u,text:X(t.text),className:n,...f}])}l(xe,"addPoint");function fe(t,n){D.addClass(t,St(n))}l(fe,"addClass");function ge(t){D.setConfig({chartWidth:t})}l(ge,"setWidth");function pe(t){D.setConfig({chartHeight:t})}l(pe,"setHeight");function ye(){let t=wt(),{themeVariables:n,quadrantChart:d}=t;return d&&D.setConfig(d),D.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),D.setData({titleText:ie()}),D.build()}l(ye,"getQuadrantData");var Ne=l(function(){D.clear(),Le()},"clear"),We={setWidth:ge,setHeight:pe,setQuadrant1Text:se,setQuadrant2Text:re,setQuadrant3Text:le,setQuadrant4Text:oe,setXAxisLeftText:he,setXAxisRightText:ce,setYAxisTopText:ue,setYAxisBottomText:de,parseStyles:St,addPoint:xe,addClass:fe,getQuadrantData:ye,clear:Ne,setAccTitle:Ce,getAccTitle:Pe,setDiagramTitle:Fe,getDiagramTitle:ie,getAccDescription:ke,setAccDescription:_e},Be=l((t,n,d,u)=>{var xt,ft,gt;function h(i){return i==="top"?"hanging":"middle"}l(h,"getDominantBaseLine");function f(i){return i==="left"?"start":"middle"}l(f,"getTextAnchor");function g(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}l(g,"getTransformation");let S=wt();bt.debug(`Rendering quadrant chart
7
+ `+t);let a=S.securityLevel,T;a==="sandbox"&&(T=Et("#i"+n));let p=(a==="sandbox"?Et(T.nodes()[0].contentDocument.body):Et("body")).select(`[id="${n}"]`),y=p.append("g").attr("class","main"),A=((xt=S.quadrantChart)==null?void 0:xt.chartWidth)??500,q=((ft=S.quadrantChart)==null?void 0:ft.chartHeight)??500;ve(p,q,A,((gt=S.quadrantChart)==null?void 0:gt.useMaxWidth)??!0),p.attr("viewBox","0 0 "+A+" "+q),u.db.setHeight(q),u.db.setWidth(A);let x=u.db.getQuadrantData(),m=y.append("g").attr("class","quadrants"),U=y.append("g").attr("class","border"),j=y.append("g").attr("class","data-points"),K=y.append("g").attr("class","labels"),pt=y.append("g").attr("class","title");x.title&&pt.append("text").attr("x",0).attr("y",0).attr("fill",x.title.fill).attr("font-size",x.title.fontSize).attr("dominant-baseline",h(x.title.horizontalPos)).attr("text-anchor",f(x.title.verticalPos)).attr("transform",g(x.title)).text(x.title.text),x.borderLines&&U.selectAll("line").data(x.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);let ut=m.selectAll("g.quadrant").data(x.quadrants).enter().append("g").attr("class","quadrant");ut.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ut.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>f(i.text.verticalPos)).attr("transform",i=>g(i.text)).text(i=>i.text.text),K.selectAll("g.label").data(x.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>f(i.verticalPos)).attr("transform",i=>g(i));let dt=j.selectAll("g.data-point").data(x.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>f(i.text.verticalPos)).attr("transform",i=>g(i.text))},"draw"),Re={draw:Be},He={parser:Ie,db:We,renderer:Re,styles:l(()=>"","styles")};export{He as diagram};
@@ -0,0 +1,84 @@
1
+ import{m as ze}from"./chunk-TBF5ZNIQ-DL5stGM1.js";import{y as Ze}from"./chunk-RWUO3TPN-BgRTY0_k.js";import{m,O as Be,e as Je,s as et,a as tt,l as st,h as it,n as rt,q as Ne,p as qe,o as nt,v as at,g as lt,P as ot,U as ct}from"./index-BgeqpYgd.js";var Ce=function(){var e=m(function(F,i,n,s){for(n=n||{},s=F.length;s--;n[F[s]]=i);return n},"o"),r=[1,3],h=[1,4],c=[1,5],o=[1,6],l=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],d=[1,22],E=[2,7],u=[1,26],y=[1,27],b=[1,28],k=[1,29],C=[1,33],A=[1,34],L=[1,35],v=[1,36],$=[1,37],O=[1,38],x=[1,24],M=[1,31],w=[1,32],D=[1,30],R=[1,39],g=[1,40],f=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],U=[1,61],z=[89,90],Ae=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],pe=[27,29],Le=[1,70],ve=[1,71],$e=[1,72],Oe=[1,73],xe=[1,74],Me=[1,75],we=[1,76],ee=[1,83],V=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],oe=[1,91],ce=[1,92],de=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],De=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],ye=[1,114],me=[1,115],_e={trace:m(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:m(function(F,i,n,s,p,t,I){var a=t.length-1;switch(p){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:h,11:c,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:h,11:c,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(l,[2,6]),{3:12,4:2,6:r,9:h,11:c,13:o},{1:[2,2]},{4:17,5:d,7:13,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},e(l,[2,4]),e(l,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:d,7:42,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:43,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:44,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:45,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:46,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:47,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:48,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:49,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{4:17,5:d,7:50,8:E,9:h,11:c,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:u,22:y,23:b,24:k,25:23,33:25,41:C,42:A,43:L,44:v,45:$,46:O,54:x,72:M,74:w,77:D,89:R,90:g},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(f,[2,17]),e(f,[2,18]),e(f,[2,19]),e(f,[2,20]),{30:60,33:62,75:U,89:R,90:g},{30:63,33:62,75:U,89:R,90:g},{30:64,33:62,75:U,89:R,90:g},e(z,[2,29]),e(z,[2,30]),e(z,[2,31]),e(z,[2,32]),e(z,[2,33]),e(z,[2,34]),e(Ae,[2,81]),e(Ae,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(pe,[2,79]),e(pe,[2,80]),{27:[1,67],29:[1,68]},e(pe,[2,85]),e(pe,[2,86]),{62:69,65:Le,66:ve,67:$e,68:Oe,69:xe,70:Me,71:we},{62:77,65:Le,66:ve,67:$e,68:Oe,69:xe,70:Me,71:we},{30:78,33:62,75:U,89:R,90:g},{73:79,75:ee,76:V,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:oe,88:ce},e(de,[2,60]),e(de,[2,62]),{73:93,75:ee,76:V,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:oe,88:ce},{30:94,33:62,75:U,76:V,89:R,90:g},{5:[1,95]},{30:96,33:62,75:U,89:R,90:g},{5:[1,97]},{30:98,33:62,75:U,89:R,90:g},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(f,[2,59],{76:V}),e(f,[2,64],{76:De}),{33:103,75:[1,102],89:R,90:g},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:oe,88:ce}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(f,[2,57],{76:De}),e(f,[2,58],{76:V}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:V},{5:he,40:ue,56:113,57:ye,59:me},{27:[1,118],76:V},{33:119,89:R,90:g},{33:120,89:R,90:g},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:oe,88:ce},e(de,[2,61]),e(de,[2,63]),e(N,[2,68]),e(f,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(f,[2,28]),{5:[1,127]},e(f,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:ye,59:me},e(f,[2,47]),{5:[1,131]},e(f,[2,48]),e(f,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:oe,88:ce}),{33:132,89:R,90:g},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(f,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(f,[2,46]),{5:he,40:ue,56:152,57:ye,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(f,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(f,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:ye,59:me},{5:he,40:ue,56:164,57:ye,59:me},e(f,[2,23]),e(f,[2,24]),e(f,[2,25]),e(f,[2,26]),e(f,[2,44]),e(f,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:m(function(F,i){if(i.recoverable)this.trace(F);else{var n=new Error(F);throw n.hash=i,n}},"parseError"),parse:m(function(F){var i=this,n=[0],s=[],p=[null],t=[],I=this.table,a="",fe=0,Pe=0,Ke=0,We=2,Ue=1,je=t.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);_.setInput(F,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Se=_.yylloc;t.push(Se);var Ge=_.options&&_.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Xe(T){n.length=n.length-2*T,p.length=p.length-T,t.length=t.length-T}m(Xe,"popStack");function Ve(){var T;return T=s.pop()||_.lex()||Ue,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=i.symbols_[T]||T),T}m(Ve,"lex");for(var S,Ie,X,q,Et,Te,Z={},Re,P,Ye,ge;;){if(X=n[n.length-1],this.defaultActions[X]?q=this.defaultActions[X]:((S===null||typeof S>"u")&&(S=Ve()),q=I[X]&&I[X][S]),typeof q>"u"||!q.length||!q[0]){var ke="";ge=[];for(Re in I[X])this.terminals_[Re]&&Re>We&&ge.push("'"+this.terminals_[Re]+"'");_.showPosition?ke="Parse error on line "+(fe+1)+`:
2
+ `+_.showPosition()+`
3
+ Expecting `+ge.join(", ")+", got '"+(this.terminals_[S]||S)+"'":ke="Parse error on line "+(fe+1)+": Unexpected "+(S==Ue?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(ke,{text:_.match,token:this.terminals_[S]||S,line:_.yylineno,loc:Se,expected:ge})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+S);switch(q[0]){case 1:n.push(S),p.push(_.yytext),t.push(_.yylloc),n.push(q[1]),S=null,Ie?(S=Ie,Ie=null):(Pe=_.yyleng,a=_.yytext,fe=_.yylineno,Se=_.yylloc,Ke>0);break;case 2:if(P=this.productions_[q[1]][1],Z.$=p[p.length-P],Z._$={first_line:t[t.length-(P||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(P||1)].first_column,last_column:t[t.length-1].last_column},Ge&&(Z._$.range=[t[t.length-(P||1)].range[0],t[t.length-1].range[1]]),Te=this.performAction.apply(Z,[a,Pe,fe,G.yy,q[1],p,t].concat(je)),typeof Te<"u")return Te;P&&(n=n.slice(0,-1*P*2),p=p.slice(0,-1*P),t=t.slice(0,-1*P)),n.push(this.productions_[q[1]][0]),p.push(Z.$),t.push(Z._$),Ye=I[n[n.length-2]][n[n.length-1]],n.push(Ye);break;case 3:return!0}}return!0},"parse")},He=function(){var F={EOF:1,parseError:m(function(i,n){if(this.yy.parser)this.yy.parser.parseError(i,n);else throw new Error(i)},"parseError"),setInput:m(function(i,n){return this.yy=n||this.yy||{},this._input=i,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:m(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:m(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var p=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),s.length-1&&(this.yylineno-=s.length-1);var t=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:s?(s.length===p.length?this.yylloc.first_column:0)+p[p.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:m(function(){return this._more=!0,this},"more"),reject:m(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:m(function(i){this.unput(this.match.slice(i))},"less"),pastInput:m(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:m(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:m(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
+ `+n+"^"},"showPosition"),test_match:m(function(i,n){var s,p,t;if(this.options.backtrack_lexer&&(t={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&&(t.yylloc.range=this.yylloc.range.slice(0))),p=i[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],s=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var I in t)this[I]=t[I];return!1}return!1},"test_match"),next:m(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,n,s,p;this._more||(this.yytext="",this.match="");for(var t=this._currentRules(),I=0;I<t.length;I++)if(s=this._input.match(this.rules[t[I]]),s&&(!n||s[0].length>n[0].length)){if(n=s,p=I,this.options.backtrack_lexer){if(i=this.test_match(s,t[I]),i!==!1)return i;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(i=this.test_match(n,t[p]),i!==!1?i:!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:m(function(){var i=this.next();return i||this.lex()},"lex"),begin:m(function(i){this.conditionStack.push(i)},"begin"),popState:m(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:m(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:m(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:m(function(i){this.begin(i)},"pushState"),stateStackSize:m(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:m(function(i,n,s,p){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return n.yytext=n.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?: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,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return F}();_e.lexer=He;function Ee(){this.yy={}}return m(Ee,"Parser"),Ee.prototype=_e,_e.Parser=Ee,new Ee}();Ce.parser=Ce;var ht=Ce,J,ut=(J=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Je,this.getAccTitle=et,this.setAccDescription=tt,this.getAccDescription=st,this.setDiagramTitle=it,this.getDiagramTitle=rt,this.getConfig=m(()=>Ne().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(r){this.direction=r}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(r,h){return this.requirements.has(r)||this.requirements.set(r,{name:r,type:h,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(r)}getRequirements(){return this.requirements}setNewReqId(r){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=r)}setNewReqText(r){this.latestRequirement!==void 0&&(this.latestRequirement.text=r)}setNewReqRisk(r){this.latestRequirement!==void 0&&(this.latestRequirement.risk=r)}setNewReqVerifyMethod(r){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=r)}addElement(r){return this.elements.has(r)||(this.elements.set(r,{name:r,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),qe.info("Added new element: ",r)),this.resetLatestElement(),this.elements.get(r)}getElements(){return this.elements}setNewElementType(r){this.latestElement!==void 0&&(this.latestElement.type=r)}setNewElementDocRef(r){this.latestElement!==void 0&&(this.latestElement.docRef=r)}addRelationship(r,h,c){this.relations.push({type:r,src:h,dst:c})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,nt()}setCssStyle(r,h){for(let c of r){let o=this.requirements.get(c)??this.elements.get(c);if(!h||!o)return;for(let l of h)l.includes(",")?o.cssStyles.push(...l.split(",")):o.cssStyles.push(l)}}setClass(r,h){var c;for(let o of r){let l=this.requirements.get(o)??this.elements.get(o);if(l)for(let d of h){l.classes.push(d);let E=(c=this.classes.get(d))==null?void 0:c.styles;E&&l.cssStyles.push(...E)}}}defineClass(r,h){for(let c of r){let o=this.classes.get(c);o===void 0&&(o={id:c,styles:[],textStyles:[]},this.classes.set(c,o)),h&&h.forEach(function(l){if(/color/.exec(l)){let d=l.replace("fill","bgFill");o.textStyles.push(d)}o.styles.push(l)}),this.requirements.forEach(l=>{l.classes.includes(c)&&l.cssStyles.push(...h.flatMap(d=>d.split(",")))}),this.elements.forEach(l=>{l.classes.includes(c)&&l.cssStyles.push(...h.flatMap(d=>d.split(",")))})}}getClasses(){return this.classes}getData(){var o,l,d,E;let r=Ne(),h=[],c=[];for(let u of this.requirements.values()){let y=u;y.id=u.name,y.cssStyles=u.cssStyles,y.cssClasses=u.classes.join(" "),y.shape="requirementBox",y.look=r.look,y.colorIndex=h.length,h.push(y)}for(let u of this.elements.values()){let y=u;y.shape="requirementBox",y.look=r.look,y.id=u.name,y.cssStyles=u.cssStyles,y.cssClasses=u.classes.join(" "),y.colorIndex=h.length,h.push(y)}for(let u of this.relations){let y=0,b=u.type===this.Relationships.CONTAINS,k={id:`${u.src}-${u.dst}-${y}`,start:((o=this.requirements.get(u.src))==null?void 0:o.name)??((l=this.elements.get(u.src))==null?void 0:l.name),end:((d=this.requirements.get(u.dst))==null?void 0:d.name)??((E=this.elements.get(u.dst))==null?void 0:E.name),label:`&lt;&lt;${u.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",b?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:b?"normal":"dashed",arrowTypeStart:b?"requirement_contains":"",arrowTypeEnd:b?"":"requirement_arrow",look:r.look,labelType:"markdown"};c.push(k),y++}return{nodes:h,edges:c,other:{},config:r,direction:this.getDirection()}}},m(J,"RequirementDB"),J),yt=m(e=>{let r=Be(),{themeVariables:h,look:c}=r,{bkgColorArray:o,borderColorArray:l}=h;if(!(l!=null&&l.length))return"";let d="";for(let E=0;E<e.THEME_COLOR_LIMIT;E++)d+=`
7
+
8
+ [data-look="${c}"][data-color-id="color-${E}"].node path {
9
+ stroke: ${l[E]};
10
+ fill: ${o!=null&&o.length?o[E]:""};
11
+ }
12
+
13
+ [data-look="${c}"][data-color-id="color-${E}"].node rect {
14
+ stroke: ${l[E]};
15
+ fill: ${o!=null&&o.length?o[E]:""};
16
+ }
17
+ `;return d},"genColor"),mt=m(e=>{let r=Be(),{look:h,themeVariables:c}=r,{requirementEdgeLabelBackground:o}=c;return`
18
+ ${yt(e)}
19
+ marker {
20
+ fill: ${e.relationColor};
21
+ stroke: ${e.relationColor};
22
+ }
23
+
24
+ marker.cross {
25
+ stroke: ${e.lineColor};
26
+ }
27
+
28
+ svg {
29
+ font-family: ${e.fontFamily};
30
+ font-size: ${e.fontSize};
31
+ }
32
+
33
+ .reqBox {
34
+ fill: ${e.requirementBackground};
35
+ fill-opacity: 1.0;
36
+ stroke: ${e.requirementBorderColor};
37
+ stroke-width: ${e.requirementBorderSize};
38
+ }
39
+
40
+ .reqTitle, .reqLabel{
41
+ fill: ${e.requirementTextColor};
42
+ }
43
+ .reqLabelBox {
44
+ fill: ${e.relationLabelBackground};
45
+ fill-opacity: 1.0;
46
+ }
47
+
48
+ .req-title-line {
49
+ stroke: ${e.requirementBorderColor};
50
+ stroke-width: ${e.requirementBorderSize};
51
+ }
52
+ .relationshipLine {
53
+ stroke: ${e.relationColor};
54
+ stroke-width: ${h==="neo"?e.strokeWidth:"1px"};
55
+ }
56
+ .relationshipLabel {
57
+ fill: ${e.relationLabelColor};
58
+ }
59
+ .edgeLabel {
60
+ background-color: ${e.edgeLabelBackground};
61
+ }
62
+ .edgeLabel .label rect {
63
+ fill: ${e.edgeLabelBackground};
64
+ }
65
+ .edgeLabel .label text {
66
+ fill: ${e.relationLabelColor};
67
+ }
68
+ .divider {
69
+ stroke: ${e.nodeBorder};
70
+ stroke-width: 1;
71
+ }
72
+ .label {
73
+ font-family: ${e.fontFamily};
74
+ color: ${e.nodeTextColor||e.textColor};
75
+ }
76
+ .label text,span {
77
+ fill: ${e.nodeTextColor||e.textColor};
78
+ color: ${e.nodeTextColor||e.textColor};
79
+ }
80
+ .labelBkg {
81
+ background-color: ${o??e.edgeLabelBackground};
82
+ }
83
+
84
+ `},"getStyles"),pt=mt,Qe={};at(Qe,{draw:()=>dt});var dt=m(async function(e,r,h,c){qe.info("REF0:"),qe.info("Drawing requirement diagram (unified)",r);let{securityLevel:o,state:l,layout:d,look:E}=Ne(),u=c.db.getData(),y=ze(r,o);u.type=c.type,u.layoutAlgorithm=lt(d),u.nodeSpacing=(l==null?void 0:l.nodeSpacing)??50,u.rankSpacing=(l==null?void 0:l.rankSpacing)??50,u.markers=E==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],u.diagramId=r,await ot(u,y),ct.insertTitle(y,"requirementDiagramTitleText",(l==null?void 0:l.titleTopMargin)??25,c.db.getDiagramTitle()),Ze(y,8,"requirementDiagram",(l==null?void 0:l.useMaxWidth)??!0)},"draw"),_t={parser:ht,get db(){return new ut},renderer:Qe,styles:pt};export{_t as diagram};
@@ -0,0 +1,10 @@
1
+ import{h as zt,n as jt,a as Bt,l as Ft,e as qt,s as Rt,m as n,q as dt,t as Ut,i as K,aa as Wt,as as Gt,o as Vt,C as Ht,ay as Qt}from"./index-BgeqpYgd.js";var rt=function(){var t=n(function(x,s,a,f){for(a=a||{},f=x.length;f--;a[x[f]]=s);return a},"o"),i=[1,9],r=[1,10],l=[1,5,10,12],h={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:n(function(x,s,a,f,k,d,b){var v=d.length-1;switch(k){case 7:let I=f.findOrCreateNode(d[v-4].trim().replaceAll('""','"')),A=f.findOrCreateNode(d[v-2].trim().replaceAll('""','"')),N=parseFloat(d[v].trim());f.addLink(I,A,N);break;case 8:case 9:case 11:this.$=d[v];break;case 10:this.$=d[v-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:i,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(l,[2,8]),t(l,[2,9]),{19:[1,16]},t(l,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:i,20:r},{15:18,16:7,17:8,18:i,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(l,[2,10]),{15:21,16:7,17:8,18:i,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:n(function(x,s){if(s.recoverable)this.trace(x);else{var a=new Error(x);throw a.hash=s,a}},"parseError"),parse:n(function(x){var s=this,a=[0],f=[],k=[null],d=[],b=this.table,v="",I=0,A=0,N=0,z=2,M=1,j=d.slice.call(arguments,1),L=Object.create(this.lexer),C={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(C.yy[D]=this.yy[D]);L.setInput(x,C.yy),C.yy.lexer=L,C.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var g=L.yylloc;d.push(g);var S=L.options&&L.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function G(E){a.length=a.length-2*E,k.length=k.length-E,d.length=d.length-E}n(G,"popStack");function q(){var E;return E=f.pop()||L.lex()||M,typeof E!="number"&&(E instanceof Array&&(f=E,E=f.pop()),E=s.symbols_[E]||E),E}n(q,"lex");for(var T,R,P,e,y,u,c={},o,p,w,$;;){if(P=a[a.length-1],this.defaultActions[P]?e=this.defaultActions[P]:((T===null||typeof T>"u")&&(T=q()),e=b[P]&&b[P][T]),typeof e>"u"||!e.length||!e[0]){var O="";$=[];for(o in b[P])this.terminals_[o]&&o>z&&$.push("'"+this.terminals_[o]+"'");L.showPosition?O="Parse error on line "+(I+1)+`:
2
+ `+L.showPosition()+`
3
+ Expecting `+$.join(", ")+", got '"+(this.terminals_[T]||T)+"'":O="Parse error on line "+(I+1)+": Unexpected "+(T==M?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(O,{text:L.match,token:this.terminals_[T]||T,line:L.yylineno,loc:g,expected:$})}if(e[0]instanceof Array&&e.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+T);switch(e[0]){case 1:a.push(T),k.push(L.yytext),d.push(L.yylloc),a.push(e[1]),T=null,R?(T=R,R=null):(A=L.yyleng,v=L.yytext,I=L.yylineno,g=L.yylloc,N>0);break;case 2:if(p=this.productions_[e[1]][1],c.$=k[k.length-p],c._$={first_line:d[d.length-(p||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(p||1)].first_column,last_column:d[d.length-1].last_column},S&&(c._$.range=[d[d.length-(p||1)].range[0],d[d.length-1].range[1]]),u=this.performAction.apply(c,[v,A,I,C.yy,e[1],k,d].concat(j)),typeof u<"u")return u;p&&(a=a.slice(0,-1*p*2),k=k.slice(0,-1*p),d=d.slice(0,-1*p)),a.push(this.productions_[e[1]][0]),k.push(c.$),d.push(c._$),w=b[a[a.length-2]][a[a.length-1]],a.push(w);break;case 3:return!0}}return!0},"parse")},m=function(){var x={EOF:1,parseError:n(function(s,a){if(this.yy.parser)this.yy.parser.parseError(s,a);else throw new Error(s)},"parseError"),setInput:n(function(s,a){return this.yy=a||this.yy||{},this._input=s,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:n(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.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),s},"input"),unput:n(function(s){var a=s.length,f=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var k=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),f.length-1&&(this.yylineno-=f.length-1);var d=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:f?(f.length===k.length?this.yylloc.first_column:0)+k[k.length-f.length].length-f[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(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:n(function(s){this.unput(this.match.slice(s))},"less"),pastInput:n(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+a+"^"},"showPosition"),test_match:n(function(s,a){var f,k,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),k=s[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],f=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var b in d)this[b]=d[b];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,f,k;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),b=0;b<d.length;b++)if(f=this._input.match(this.rules[d[b]]),f&&(!a||f[0].length>a[0].length)){if(a=f,k=b,this.options.backtrack_lexer){if(s=this.test_match(f,d[b]),s!==!1)return s;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(s=this.test_match(a,d[k]),s!==!1?s:!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:n(function(){var s=this.next();return s||this.lex()},"lex"),begin:n(function(s){this.conditionStack.push(s)},"begin"),popState:n(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(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:n(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:n(function(s){this.begin(s)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(s,a,f,k){switch(f){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return x}();h.lexer=m;function _(){this.yy={}}return n(_,"Parser"),_.prototype=h,h.Parser=_,new _}();rt.parser=rt;var J=rt,nt=[],it=[],tt=new Map,Xt=n(()=>{nt=[],it=[],tt=new Map,Vt()},"clear"),U,Kt=(U=class{constructor(i,r,l=0){this.source=i,this.target=r,this.value=l}},n(U,"SankeyLink"),U),Zt=n((t,i,r)=>{nt.push(new Kt(t,i,r))},"addLink"),W,Yt=(W=class{constructor(i){this.ID=i}},n(W,"SankeyNode"),W),Jt=n(t=>{t=Ht.sanitizeText(t,dt());let i=tt.get(t);return i===void 0&&(i=new Yt(t),tt.set(t,i),it.push(i)),i},"findOrCreateNode"),te=n(()=>it,"getNodes"),ee=n(()=>nt,"getLinks"),ne=n(()=>({nodes:it.map(t=>({id:t.ID})),links:nt.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ie={nodesMap:tt,getConfig:n(()=>dt().sankey,"getConfig"),getNodes:te,getLinks:ee,getGraph:ne,addLink:Zt,findOrCreateNode:Jt,getAccTitle:Rt,setAccTitle:qt,getAccDescription:Ft,setAccDescription:Bt,getDiagramTitle:jt,setDiagramTitle:zt,clear:Xt};function ot(t,i){let r;if(i===void 0)for(let l of t)l!=null&&(r<l||r===void 0&&l>=l)&&(r=l);else{let l=-1;for(let h of t)(h=i(h,++l,t))!=null&&(r<h||r===void 0&&h>=h)&&(r=h)}return r}n(ot,"max");function gt(t,i){let r;if(i===void 0)for(let l of t)l!=null&&(r>l||r===void 0&&l>=l)&&(r=l);else{let l=-1;for(let h of t)(h=i(h,++l,t))!=null&&(r>h||r===void 0&&h>=h)&&(r=h)}return r}n(gt,"min");function Z(t,i){let r=0;if(i===void 0)for(let l of t)(l=+l)&&(r+=l);else{let l=-1;for(let h of t)(h=+i(h,++l,t))&&(r+=h)}return r}n(Z,"sum");function kt(t){return t.target.depth}n(kt,"targetDepth");function xt(t){return t.depth}n(xt,"left");function vt(t,i){return i-1-t.height}n(vt,"right");function pt(t,i){return t.sourceLinks.length?t.depth:i-1}n(pt,"justify");function wt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?gt(t.sourceLinks,kt)-1:0}n(wt,"center");function Q(t){return function(){return t}}n(Q,"constant");function at(t,i){return X(t.source,i.source)||t.index-i.index}n(at,"ascendingSourceBreadth");function lt(t,i){return X(t.target,i.target)||t.index-i.index}n(lt,"ascendingTargetBreadth");function X(t,i){return t.y0-i.y0}n(X,"ascendingBreadth");function Y(t){return t.value}n(Y,"value");function bt(t){return t.index}n(bt,"defaultId");function Lt(t){return t.nodes}n(Lt,"defaultNodes");function Et(t){return t.links}n(Et,"defaultLinks");function ht(t,i){let r=t.get(i);if(!r)throw new Error("missing: "+i);return r}n(ht,"find");function ut({nodes:t}){for(let i of t){let r=i.y0,l=r;for(let h of i.sourceLinks)h.y0=r+h.width/2,r+=h.width;for(let h of i.targetLinks)h.y1=l+h.width/2,l+=h.width}}n(ut,"computeLinkBreadths");function Tt(){let t=0,i=0,r=1,l=1,h=24,m=8,_,x=bt,s=pt,a,f,k=Lt,d=Et,b=6;function v(){let e={nodes:k.apply(null,arguments),links:d.apply(null,arguments)};return I(e),A(e),N(e),z(e),L(e),ut(e),e}n(v,"sankey"),v.update=function(e){return ut(e),e},v.nodeId=function(e){return arguments.length?(x=typeof e=="function"?e:Q(e),v):x},v.nodeAlign=function(e){return arguments.length?(s=typeof e=="function"?e:Q(e),v):s},v.nodeSort=function(e){return arguments.length?(a=e,v):a},v.nodeWidth=function(e){return arguments.length?(h=+e,v):h},v.nodePadding=function(e){return arguments.length?(m=_=+e,v):m},v.nodes=function(e){return arguments.length?(k=typeof e=="function"?e:Q(e),v):k},v.links=function(e){return arguments.length?(d=typeof e=="function"?e:Q(e),v):d},v.linkSort=function(e){return arguments.length?(f=e,v):f},v.size=function(e){return arguments.length?(t=i=0,r=+e[0],l=+e[1],v):[r-t,l-i]},v.extent=function(e){return arguments.length?(t=+e[0][0],r=+e[1][0],i=+e[0][1],l=+e[1][1],v):[[t,i],[r,l]]},v.iterations=function(e){return arguments.length?(b=+e,v):b};function I({nodes:e,links:y}){for(let[c,o]of e.entries())o.index=c,o.sourceLinks=[],o.targetLinks=[];let u=new Map(e.map((c,o)=>[x(c,o,e),c]));for(let[c,o]of y.entries()){o.index=c;let{source:p,target:w}=o;typeof p!="object"&&(p=o.source=ht(u,p)),typeof w!="object"&&(w=o.target=ht(u,w)),p.sourceLinks.push(o),w.targetLinks.push(o)}if(f!=null)for(let{sourceLinks:c,targetLinks:o}of e)c.sort(f),o.sort(f)}n(I,"computeNodeLinks");function A({nodes:e}){for(let y of e)y.value=y.fixedValue===void 0?Math.max(Z(y.sourceLinks,Y),Z(y.targetLinks,Y)):y.fixedValue}n(A,"computeNodeValues");function N({nodes:e}){let y=e.length,u=new Set(e),c=new Set,o=0;for(;u.size;){for(let p of u){p.depth=o;for(let{target:w}of p.sourceLinks)c.add(w)}if(++o>y)throw new Error("circular link");u=c,c=new Set}}n(N,"computeNodeDepths");function z({nodes:e}){let y=e.length,u=new Set(e),c=new Set,o=0;for(;u.size;){for(let p of u){p.height=o;for(let{source:w}of p.targetLinks)c.add(w)}if(++o>y)throw new Error("circular link");u=c,c=new Set}}n(z,"computeNodeHeights");function M({nodes:e}){let y=ot(e,o=>o.depth)+1,u=(r-t-h)/(y-1),c=new Array(y);for(let o of e){let p=Math.max(0,Math.min(y-1,Math.floor(s.call(null,o,y))));o.layer=p,o.x0=t+p*u,o.x1=o.x0+h,c[p]?c[p].push(o):c[p]=[o]}if(a)for(let o of c)o.sort(a);return c}n(M,"computeNodeLayers");function j(e){let y=gt(e,u=>(l-i-(u.length-1)*_)/Z(u,Y));for(let u of e){let c=i;for(let o of u){o.y0=c,o.y1=c+o.value*y,c=o.y1+_;for(let p of o.sourceLinks)p.width=p.value*y}c=(l-c+_)/(u.length+1);for(let o=0;o<u.length;++o){let p=u[o];p.y0+=c*(o+1),p.y1+=c*(o+1)}T(u)}}n(j,"initializeNodeBreadths");function L(e){let y=M(e);_=Math.min(m,(l-i)/(ot(y,u=>u.length)-1)),j(y);for(let u=0;u<b;++u){let c=Math.pow(.99,u),o=Math.max(1-c,(u+1)/b);D(y,c,o),C(y,c,o)}}n(L,"computeNodeBreadths");function C(e,y,u){for(let c=1,o=e.length;c<o;++c){let p=e[c];for(let w of p){let $=0,O=0;for(let{source:V,value:st}of w.targetLinks){let H=st*(w.layer-V.layer);$+=R(V,w)*H,O+=H}if(!(O>0))continue;let E=($/O-w.y0)*y;w.y0+=E,w.y1+=E,q(w)}a===void 0&&p.sort(X),g(p,u)}}n(C,"relaxLeftToRight");function D(e,y,u){for(let c=e.length,o=c-2;o>=0;--o){let p=e[o];for(let w of p){let $=0,O=0;for(let{target:V,value:st}of w.sourceLinks){let H=st*(V.layer-w.layer);$+=P(w,V)*H,O+=H}if(!(O>0))continue;let E=($/O-w.y0)*y;w.y0+=E,w.y1+=E,q(w)}a===void 0&&p.sort(X),g(p,u)}}n(D,"relaxRightToLeft");function g(e,y){let u=e.length>>1,c=e[u];G(e,c.y0-_,u-1,y),S(e,c.y1+_,u+1,y),G(e,l,e.length-1,y),S(e,i,0,y)}n(g,"resolveCollisions");function S(e,y,u,c){for(;u<e.length;++u){let o=e[u],p=(y-o.y0)*c;p>1e-6&&(o.y0+=p,o.y1+=p),y=o.y1+_}}n(S,"resolveCollisionsTopToBottom");function G(e,y,u,c){for(;u>=0;--u){let o=e[u],p=(o.y1-y)*c;p>1e-6&&(o.y0-=p,o.y1-=p),y=o.y0-_}}n(G,"resolveCollisionsBottomToTop");function q({sourceLinks:e,targetLinks:y}){if(f===void 0){for(let{source:{sourceLinks:u}}of y)u.sort(lt);for(let{target:{targetLinks:u}}of e)u.sort(at)}}n(q,"reorderNodeLinks");function T(e){if(f===void 0)for(let{sourceLinks:y,targetLinks:u}of e)y.sort(lt),u.sort(at)}n(T,"reorderLinks");function R(e,y){let u=e.y0-(e.sourceLinks.length-1)*_/2;for(let{target:c,width:o}of e.sourceLinks){if(c===y)break;u+=o+_}for(let{source:c,width:o}of y.targetLinks){if(c===e)break;u-=o}return u}n(R,"targetTop");function P(e,y){let u=y.y0-(y.targetLinks.length-1)*_/2;for(let{source:c,width:o}of y.targetLinks){if(c===e)break;u+=o+_}for(let{target:c,width:o}of e.sourceLinks){if(c===y)break;u-=o}return u}return n(P,"sourceTop"),v}n(Tt,"Sankey");var ct=Math.PI,ft=2*ct,F=1e-6,se=ft-F;function et(){this._x0=this._y0=this._x1=this._y1=null,this._=""}n(et,"Path");function mt(){return new et}n(mt,"path");et.prototype=mt.prototype={constructor:et,moveTo:n(function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},"moveTo"),closePath:n(function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:n(function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},"lineTo"),quadraticCurveTo:n(function(t,i,r,l){this._+="Q"+ +t+","+ +i+","+(this._x1=+r)+","+(this._y1=+l)},"quadraticCurveTo"),bezierCurveTo:n(function(t,i,r,l,h,m){this._+="C"+ +t+","+ +i+","+ +r+","+ +l+","+(this._x1=+h)+","+(this._y1=+m)},"bezierCurveTo"),arcTo:n(function(t,i,r,l,h){t=+t,i=+i,r=+r,l=+l,h=+h;var m=this._x1,_=this._y1,x=r-t,s=l-i,a=m-t,f=_-i,k=a*a+f*f;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=i);else if(k>F)if(!(Math.abs(f*x-s*a)>F)||!h)this._+="L"+(this._x1=t)+","+(this._y1=i);else{var d=r-m,b=l-_,v=x*x+s*s,I=d*d+b*b,A=Math.sqrt(v),N=Math.sqrt(k),z=h*Math.tan((ct-Math.acos((v+k-I)/(2*A*N)))/2),M=z/N,j=z/A;Math.abs(M-1)>F&&(this._+="L"+(t+M*a)+","+(i+M*f)),this._+="A"+h+","+h+",0,0,"+ +(f*d>a*b)+","+(this._x1=t+j*x)+","+(this._y1=i+j*s)}},"arcTo"),arc:n(function(t,i,r,l,h,m){t=+t,i=+i,r=+r,m=!!m;var _=r*Math.cos(l),x=r*Math.sin(l),s=t+_,a=i+x,f=1^m,k=m?l-h:h-l;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+s+","+a:(Math.abs(this._x1-s)>F||Math.abs(this._y1-a)>F)&&(this._+="L"+s+","+a),r&&(k<0&&(k=k%ft+ft),k>se?this._+="A"+r+","+r+",0,1,"+f+","+(t-_)+","+(i-x)+"A"+r+","+r+",0,1,"+f+","+(this._x1=s)+","+(this._y1=a):k>F&&(this._+="A"+r+","+r+",0,"+ +(k>=ct)+","+f+","+(this._x1=t+r*Math.cos(h))+","+(this._y1=i+r*Math.sin(h))))},"arc"),rect:n(function(t,i,r,l){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +r+"v"+ +l+"h"+-r+"Z"},"rect"),toString:n(function(){return this._},"toString")};var re=mt;function yt(t){return n(function(){return t},"constant")}n(yt,"default");function St(t){return t[0]}n(St,"x");function Mt(t){return t[1]}n(Mt,"y");var oe=Array.prototype.slice;function At(t){return t.source}n(At,"linkSource");function Nt(t){return t.target}n(Nt,"linkTarget");function Ct(t){var i=At,r=Nt,l=St,h=Mt,m=null;function _(){var x,s=oe.call(arguments),a=i.apply(this,s),f=r.apply(this,s);if(m||(m=x=re()),t(m,+l.apply(this,(s[0]=a,s)),+h.apply(this,s),+l.apply(this,(s[0]=f,s)),+h.apply(this,s)),x)return m=null,x+""||null}return n(_,"link"),_.source=function(x){return arguments.length?(i=x,_):i},_.target=function(x){return arguments.length?(r=x,_):r},_.x=function(x){return arguments.length?(l=typeof x=="function"?x:yt(+x),_):l},_.y=function(x){return arguments.length?(h=typeof x=="function"?x:yt(+x),_):h},_.context=function(x){return arguments.length?(m=x??null,_):m},_}n(Ct,"link");function It(t,i,r,l,h){t.moveTo(i,r),t.bezierCurveTo(i=(i+l)/2,r,i,h,l,h)}n(It,"curveHorizontal");function Dt(){return Ct(It)}n(Dt,"linkHorizontal");function Ot(t){return[t.source.x1,t.y0]}n(Ot,"horizontalSource");function Pt(t){return[t.target.x0,t.y1]}n(Pt,"horizontalTarget");function $t(){return Dt().source(Ot).target(Pt)}n($t,"default");var B,_t=(B=class{static next(i){return new B(i+ ++B.count)}constructor(i){this.id=i,this.href=`#${i}`}toString(){return"url("+this.href+")"}},n(B,"Uid"),B.count=0,B),ae={left:xt,right:vt,center:wt,justify:pt},le=n(function(t,i,r,l){let{securityLevel:h,sankey:m}=dt(),_=Ut.sankey,x;h==="sandbox"&&(x=K("#i"+i));let s=h==="sandbox"?K(x.nodes()[0].contentDocument.body):K("body"),a=h==="sandbox"?s.select(`[id="${i}"]`):K(`[id="${i}"]`),f=(m==null?void 0:m.width)??_.width,k=(m==null?void 0:m.height)??_.width,d=(m==null?void 0:m.useMaxWidth)??_.useMaxWidth,b=(m==null?void 0:m.nodeAlignment)??_.nodeAlignment,v=(m==null?void 0:m.prefix)??_.prefix,I=(m==null?void 0:m.suffix)??_.suffix,A=(m==null?void 0:m.showValues)??_.showValues,N=l.db.getGraph(),z=ae[b];Tt().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(A?15:0)).nodeAlign(z).extent([[0,0],[f,k]])(N);let M=Wt(Qt);a.append("g").attr("class","nodes").selectAll(".node").data(N.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=_t.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>M(g.id));let j=n(({id:g,value:S})=>A?`${g}
7
+ ${v}${Math.round(S*100)/100}${I}`:g,"getText");a.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(N.nodes).join("text").attr("x",g=>g.x0<f/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<f/2?"start":"end").text(j);let L=a.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(N.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),C=(m==null?void 0:m.linkColor)??"gradient";if(C==="gradient"){let g=L.append("linearGradient").attr("id",S=>(S.uid=_t.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",S=>S.source.x1).attr("x2",S=>S.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",S=>M(S.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",S=>M(S.target.id))}let D;switch(C){case"gradient":D=n(g=>g.uid,"coloring");break;case"source":D=n(g=>M(g.source.id),"coloring");break;case"target":D=n(g=>M(g.target.id),"coloring");break;default:D=C}L.append("path").attr("d",$t()).attr("stroke",D).attr("stroke-width",g=>Math.max(1,g.width)),Gt(void 0,a,0,d)},"draw"),he={draw:le},ue=n(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
+ `).trim(),"prepareTextForParsing"),ce=n(t=>`.label {
9
+ font-family: ${t.fontFamily};
10
+ }`,"getStyles"),fe=ce,ye=J.parse.bind(J);J.parse=t=>ye(ue(t));var ge={styles:fe,parser:J,db:ie,renderer:he};export{ge as diagram};