omni-context-cli 0.0.91 → 0.0.92

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 (102) hide show
  1. package/README.md +3 -3
  2. package/README.zh-CN.md +3 -3
  3. package/dist/cli.js +7 -7
  4. package/dist/clients/extension.vsix +0 -0
  5. package/dist/clients/web/assets/App-CBmFCdgC.css +1 -0
  6. package/dist/clients/web/assets/App-CM8Va3JQ.js +2 -0
  7. package/dist/clients/web/assets/ImageWorkshop-D0woOaMP.js +1 -0
  8. package/dist/clients/web/assets/_baseUniq-8ZoXEUbL.js +1 -0
  9. package/dist/clients/web/assets/arc-B2TpLZAc.js +1 -0
  10. package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-sCw1Bqxj.js +1 -0
  11. package/dist/clients/web/assets/blockDiagram-VD42YOAC-TzLCV8cu.js +1 -0
  12. package/dist/clients/web/assets/c4Diagram-YG6GDRKO-CB75g8mk.js +1 -0
  13. package/dist/clients/web/assets/channel-Cc6WLpkH.js +1 -0
  14. package/dist/clients/web/assets/chunk-4BX2VUAB-CnCH9PHV.js +1 -0
  15. package/dist/clients/web/assets/chunk-55IACEB6-j6kgk2Ub.js +1 -0
  16. package/dist/clients/web/assets/chunk-B4BG7PRW-CU5TkBMe.js +1 -0
  17. package/dist/clients/web/assets/chunk-DI55MBZ5-B9PNM453.js +1 -0
  18. package/dist/clients/web/assets/chunk-FMBD7UC4-ubTGnudB.js +1 -0
  19. package/dist/clients/web/assets/chunk-QN33PNHL-D5no8Jfp.js +1 -0
  20. package/dist/clients/web/assets/chunk-QZHKN3VN-RIiVnjQx.js +1 -0
  21. package/dist/clients/web/assets/chunk-TZMSLE5B-DTy2vR2B.js +1 -0
  22. package/dist/clients/web/assets/classDiagram-2ON5EDUG-8oZ_o2z8.js +1 -0
  23. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-8oZ_o2z8.js +1 -0
  24. package/dist/clients/web/assets/clone-Z2wHm8pw.js +1 -0
  25. package/dist/clients/web/assets/cose-bilkent-S5V4N54A-Bqct6Lvl.js +1 -0
  26. package/dist/clients/web/assets/dagre-6UL2VRFP-441VQkK1.js +1 -0
  27. package/dist/clients/web/assets/diagram-PSM6KHXK-BO9H2Aak.js +1 -0
  28. package/dist/clients/web/assets/diagram-QEK2KX5R-3lGBBCVw.js +1 -0
  29. package/dist/clients/web/assets/diagram-S2PKOQOG-DY84HL8G.js +1 -0
  30. package/dist/clients/web/assets/erDiagram-Q2GNP2WA-DWcgMtNO.js +1 -0
  31. package/dist/clients/web/assets/flowDiagram-NV44I4VS-Ybex1wXj.js +1 -0
  32. package/dist/clients/web/assets/ganttDiagram-JELNMOA3-ChWIAt1T.js +1 -0
  33. package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-ClJFv0ul.js +1 -0
  34. package/dist/clients/web/assets/graph-Cs6Qxtax.js +1 -0
  35. package/dist/clients/web/assets/index-DPbcKIIg.js +2 -0
  36. package/dist/clients/web/assets/index-Fz55nSNP.css +1 -0
  37. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-DnTUhHY0.js +1 -0
  38. package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-CIENPsGT.js +1 -0
  39. package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-AhFkjsY3.js +1 -0
  40. package/dist/clients/web/assets/layout-BntZLQYy.js +1 -0
  41. package/dist/clients/web/assets/linear-CbNyjCBb.js +1 -0
  42. package/dist/clients/web/assets/min-1nUrt3JX.js +1 -0
  43. package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-Cs3o7Dfz.js +1 -0
  44. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-yQPBfZ8y.js +1 -0
  45. package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-5kPfWslR.js +1 -0
  46. package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-DoucrOtZ.js +1 -0
  47. package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-PTFbpc-u.js +1 -0
  48. package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-BZ33cKfm.js +1 -0
  49. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-C4idf-WB.js +1 -0
  50. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-B-b2Duqy.js +1 -0
  51. package/dist/clients/web/assets/timeline-definition-IT6M3QCI-P1su699P.js +1 -0
  52. package/dist/clients/web/assets/treemap-KMMF4GRG-BmD_DFh3.js +1 -0
  53. package/dist/clients/web/assets/useAppearance-PXtz8423.js +1 -0
  54. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-DtIpn1yU.js +1 -0
  55. package/dist/clients/web/index.html +2 -2
  56. package/package.json +1 -1
  57. package/dist/clients/web/assets/_baseUniq-BDYH-qGs.js +0 -1
  58. package/dist/clients/web/assets/arc-BgRuELYn.js +0 -1
  59. package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-Cex2_41d.js +0 -1
  60. package/dist/clients/web/assets/blockDiagram-VD42YOAC-DBvUs0rU.js +0 -1
  61. package/dist/clients/web/assets/c4Diagram-YG6GDRKO-CJd_7YxK.js +0 -1
  62. package/dist/clients/web/assets/channel-CkOdBXrJ.js +0 -1
  63. package/dist/clients/web/assets/chunk-4BX2VUAB-CjAiz39p.js +0 -1
  64. package/dist/clients/web/assets/chunk-55IACEB6-BIADemBk.js +0 -1
  65. package/dist/clients/web/assets/chunk-B4BG7PRW-CdZvue6N.js +0 -1
  66. package/dist/clients/web/assets/chunk-DI55MBZ5-CtPcG11Q.js +0 -1
  67. package/dist/clients/web/assets/chunk-FMBD7UC4-CnT2icSo.js +0 -1
  68. package/dist/clients/web/assets/chunk-QN33PNHL-BPPz_1GB.js +0 -1
  69. package/dist/clients/web/assets/chunk-QZHKN3VN-CQUazhia.js +0 -1
  70. package/dist/clients/web/assets/chunk-TZMSLE5B-Cus0DJbS.js +0 -1
  71. package/dist/clients/web/assets/classDiagram-2ON5EDUG-B9YA_U4r.js +0 -1
  72. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-B9YA_U4r.js +0 -1
  73. package/dist/clients/web/assets/clone-DEP9HaYN.js +0 -1
  74. package/dist/clients/web/assets/cose-bilkent-S5V4N54A-CDuuAfej.js +0 -1
  75. package/dist/clients/web/assets/dagre-6UL2VRFP-DBYvwMNJ.js +0 -1
  76. package/dist/clients/web/assets/diagram-PSM6KHXK-DmDHxKDU.js +0 -1
  77. package/dist/clients/web/assets/diagram-QEK2KX5R-CPCj5LYE.js +0 -1
  78. package/dist/clients/web/assets/diagram-S2PKOQOG-dKlW9LCp.js +0 -1
  79. package/dist/clients/web/assets/erDiagram-Q2GNP2WA-DXs4DL87.js +0 -1
  80. package/dist/clients/web/assets/flowDiagram-NV44I4VS-DyZigpkG.js +0 -1
  81. package/dist/clients/web/assets/ganttDiagram-JELNMOA3-ByonKtsF.js +0 -1
  82. package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-mdwsZDab.js +0 -1
  83. package/dist/clients/web/assets/graph-D3YdmkIz.js +0 -1
  84. package/dist/clients/web/assets/index-5mQ2UgiF.css +0 -1
  85. package/dist/clients/web/assets/index-C5d-CFGb.js +0 -2
  86. package/dist/clients/web/assets/infoDiagram-WHAUD3N6-D53YsuXV.js +0 -1
  87. package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-Dei_Z_bl.js +0 -1
  88. package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-jUOZB7H6.js +0 -1
  89. package/dist/clients/web/assets/layout-odJhx1DE.js +0 -1
  90. package/dist/clients/web/assets/linear-4xiWbSPB.js +0 -1
  91. package/dist/clients/web/assets/min-Cvpawy_w.js +0 -1
  92. package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-DEJbXPh3.js +0 -1
  93. package/dist/clients/web/assets/pieDiagram-ADFJNKIX-BgKrZrMs.js +0 -1
  94. package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-D_pD0WZC.js +0 -1
  95. package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-BNsHrc92.js +0 -1
  96. package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-BY0pyb4k.js +0 -1
  97. package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-BfMDa1rw.js +0 -1
  98. package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-BRWg7fz9.js +0 -1
  99. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-DizPjxtQ.js +0 -1
  100. package/dist/clients/web/assets/timeline-definition-IT6M3QCI-CLH3bcF4.js +0 -1
  101. package/dist/clients/web/assets/treemap-KMMF4GRG-CS9j6H9_.js +0 -1
  102. package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-CrvAORqu.js +0 -1
@@ -1 +0,0 @@
1
- import{_ as r,l as e,H as s,e as a,I as i}from"./index-C5d-CFGb.js";import{p as n}from"./treemap-KMMF4GRG-CS9j6H9_.js";import"./min-Cvpawy_w.js";import"./_baseUniq-BDYH-qGs.js";var o={parse:r(async r=>{const s=await n("info",r);e.debug(s)},"parse")},t={version:i.version+""},d={parser:o,db:{getVersion:r(()=>t.version,"getVersion")},renderer:{draw:r((r,i,n)=>{e.debug("rendering info diagram\n"+r);const o=s(i);a(o,100,400,!0);o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw")}};export{d as diagram};
@@ -1 +0,0 @@
1
- import{a as t,g as n,f as i,d as s}from"./chunk-TZMSLE5B-Cus0DJbS.js";import{g as e}from"./chunk-FMBD7UC4-CnT2icSo.js";import{g as r,s as o,a as c,b as a,q as l,p as h,_ as u,c as f,d,e as p,y}from"./index-C5d-CFGb.js";import{d as k}from"./arc-BgRuELYn.js";var x=function(){var t=u(function(t,n,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=n);return i},"o"),n=[6,8,10,11,12,14,16,17,18],i=[1,9],s=[1,10],e=[1,11],r=[1,12],o=[1,13],c=[1,14],a={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:u(function(t,n,i,s,e,r,o){var c=r.length-1;switch(e){case 1:return r[c-1];case 2:case 6:case 7:this.$=[];break;case 3:r[c-1].push(r[c]),this.$=r[c-1];break;case 4:case 5:this.$=r[c];break;case 8:s.setDiagramTitle(r[c].substr(6)),this.$=r[c].substr(6);break;case 9:this.$=r[c].trim(),s.setAccTitle(this.$);break;case 10:case 11:this.$=r[c].trim(),s.setAccDescription(this.$);break;case 12:s.addSection(r[c].substr(8)),this.$=r[c].substr(8);break;case 13:s.addTask(r[c-1],r[c]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:s,14:e,16:r,17:o,18:c},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:i,12:s,14:e,16:r,17:o,18:c},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},parseError:u(function(t,n){if(!n.recoverable){var i=new Error(t);throw i.hash=n,i}this.trace(t)},"parseError"),parse:u(function(t){var n=this,i=[0],s=[],e=[null],r=[],o=this.table,c="",a=0,l=0,h=r.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;r.push(y);var k=f.options&&f.options.ranges;function x(){var t;return"number"!=typeof(t=s.pop()||f.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,u(function(t){i.length=i.length-2*t,e.length=e.length-t,r.length=r.length-t},"popStack"),u(x,"lex");for(var m,g,b,v,_,$,w,M,T={};;){if(g=i[i.length-1],this.defaultActions[g]?b=this.defaultActions[g]:(null==m&&(m=x()),b=o[g]&&o[g][m]),void 0===b||!b.length||!b[0]){var S="";for(_ in M=[],o[g])this.terminals_[_]&&_>2&&M.push("'"+this.terminals_[_]+"'");S=f.showPosition?"Parse error on line "+(a+1)+":\n"+f.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(S,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:y,expected:M})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+m);switch(b[0]){case 1:i.push(m),e.push(f.yytext),r.push(f.yylloc),i.push(b[1]),m=null,l=f.yyleng,c=f.yytext,a=f.yylineno,y=f.yylloc;break;case 2:if($=this.productions_[b[1]][1],T.$=e[e.length-$],T._$={first_line:r[r.length-($||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-($||1)].first_column,last_column:r[r.length-1].last_column},k&&(T._$.range=[r[r.length-($||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.apply(T,[c,l,a,d.yy,b[1],e,r].concat(h))))return v;$&&(i=i.slice(0,-1*$*2),e=e.slice(0,-1*$),r=r.slice(0,-1*$)),i.push(this.productions_[b[1]][0]),e.push(T.$),r.push(T._$),w=o[i[i.length-2]][i[i.length-1]],i.push(w);break;case 3:return!0}}return!0},"parse")},l=function(){return{EOF:1,parseError:u(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:u(function(t,n){return this.yy=n||this.yy||{},this._input=t,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:u(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:u(function(t){var n=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var s=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),i.length-1&&(this.yylineno-=i.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:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:u(function(t){this.unput(this.match.slice(t))},"less"),pastInput:u(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:u(function(t,n){var i,s,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))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in e)this[r]=e[r];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;var t,n,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),r=0;r<e.length;r++)if((i=this._input.match(this.rules[e[r]]))&&(!n||i[0].length>n[0].length)){if(n=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,e[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,e[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var t=this.next();return t||this.lex()},"lex"),begin:u(function(t){this.conditionStack.push(t)},"begin"),popState:u(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:u(function(t){this.begin(t)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(t,n,i,s){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}}();function h(){this.yy={}}return a.lexer=l,u(h,"Parser"),h.prototype=a,a.Parser=h,new h}();x.parser=x;var m=x,g="",b=[],v=[],_=[],$=u(function(){b.length=0,v.length=0,g="",_.length=0,y()},"clear"),w=u(function(t){g=t,b.push(t)},"addSection"),M=u(function(){return b},"getSections"),T=u(function(){let t=j();let n=0;for(;!t&&n<100;)t=j(),n++;return v.push(..._),v},"getTasks"),S=u(function(){const t=[];v.forEach(n=>{n.people&&t.push(...n.people)});return[...new Set(t)].sort()},"updateActors"),A=u(function(t,n){const i=n.substr(1).split(":");let s=0,e=[];1===i.length?(s=Number(i[0]),e=[]):(s=Number(i[0]),e=i[1].split(","));const r=e.map(t=>t.trim()),o={section:g,type:g,people:r,task:t,score:s};_.push(o)},"addTask"),I=u(function(t){const n={section:g,type:g,description:t,task:t,classes:[]};v.push(n)},"addTaskOrg"),j=u(function(){const t=u(function(t){return _[t].processed},"compileTask");let n=!0;for(const[i,s]of _.entries())t(i),n=n&&s.processed;return n},"compileTasks"),E=u(function(){return S()},"getActors"),P={getConfig:u(()=>f().journey,"getConfig"),clear:$,setDiagramTitle:h,getDiagramTitle:l,setAccTitle:a,getAccTitle:c,setAccDescription:o,getAccDescription:r,addSection:w,getSections:M,getTasks:T,addTask:A,addTaskOrg:I,getActors:E},C=u(t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n font-family: ${t.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n ${e()}\n`,"getStyles"),L=u(function(t,n){return s(t,n)},"drawRect"),F=u(function(t,n){const i=15,s=t.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",i).attr("stroke-width",2).attr("overflow","visible"),e=t.append("g");function r(t){const s=k().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",s).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function o(t){const s=k().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(i/2.2);t.append("path").attr("class","mouth").attr("d",s).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return e.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),e.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),u(r,"smile"),u(o,"sad"),u(c,"ambivalent"),n.score>3?r(e):n.score<3?o(e):c(e),s},"drawFace"),N=u(function(t,n){const i=t.append("circle");return i.attr("cx",n.cx),i.attr("cy",n.cy),i.attr("class","actor-"+n.pos),i.attr("fill",n.fill),i.attr("stroke",n.stroke),i.attr("r",n.r),void 0!==i.class&&i.attr("class",i.class),void 0!==n.title&&i.append("title").text(n.title),i},"drawCircle"),O=u(function(t,n){return i(t,n)},"drawText"),B=u(function(t,n){function i(t,n,i,s,e){return t+","+n+" "+(t+i)+","+n+" "+(t+i)+","+(n+s-e)+" "+(t+i-1.2*e)+","+(n+s)+" "+t+","+(n+s)}u(i,"genPoints");const s=t.append("polygon");s.attr("points",i(n.x,n.y,50,20,7)),s.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,O(t,n)},"drawLabel"),D=u(function(t,i,s){const e=t.append("g"),r=n();r.x=i.x,r.y=i.y,r.fill=i.fill,r.width=s.width*i.taskCount+s.diagramMarginX*(i.taskCount-1),r.height=s.height,r.class="journey-section section-type-"+i.num,r.rx=3,r.ry=3,L(e,r),U(s)(i.text,e,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+i.num},s,i.colour)},"drawSection"),z=-1,V=u(function(t,i,s){const e=i.x+s.width/2,r=t.append("g");z++;r.append("line").attr("id","task"+z).attr("x1",e).attr("y1",i.y).attr("x2",e).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),F(r,{cx:e,cy:300+30*(5-i.score),score:i.score});const o=n();o.x=i.x,o.y=i.y,o.fill=i.fill,o.width=s.width,o.height=s.height,o.class="task task-type-"+i.num,o.rx=3,o.ry=3,L(r,o);let c=i.x+14;i.people.forEach(t=>{const n=i.actors[t].color,s={cx:c,cy:i.y,r:7,fill:n,stroke:"#000",title:t,pos:i.actors[t].position};N(r,s),c+=10}),U(s)(i.task,r,o.x,o.y,o.width,o.height,{class:"task"},s,i.colour)},"drawTask"),R=u(function(n,i){t(n,i)},"drawBackgroundRect"),U=function(){function t(t,n,i,e,r,o,c,a){s(n.append("text").attr("x",i+r/2).attr("y",e+o/2+5).style("font-color",a).style("text-anchor","middle").text(t),c)}function n(t,n,i,e,r,o,c,a,l){const{taskFontSize:h,taskFontFamily:u}=a,f=t.split(/<br\s*\/?>/gi);for(let d=0;d<f.length;d++){const t=d*h-h*(f.length-1)/2,a=n.append("text").attr("x",i+r/2).attr("y",e).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);a.append("tspan").attr("x",i+r/2).attr("dy",t).text(f[d]),a.attr("y",e+o/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(a,c)}}function i(t,i,e,r,o,c,a,l){const h=i.append("switch"),u=h.append("foreignObject").attr("x",e).attr("y",r).attr("width",o).attr("height",c).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,e,r,o,c,a,l),s(u,a)}function s(t,n){for(const i in n)i in n&&t.attr(i,n[i])}return u(t,"byText"),u(n,"byTspan"),u(i,"byFo"),u(s,"_setTextAttrs"),function(s){return"fo"===s.textPlacement?i:"old"===s.textPlacement?t:n}}(),W={drawRect:L,drawCircle:N,drawSection:D,drawText:O,drawLabel:B,drawTask:V,drawBackgroundRect:R,initGraphics:u(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics")},Y=u(function(t){Object.keys(t).forEach(function(n){H[n]=t[n]})},"setConf"),q={},G=0;function Z(t){const n=f().journey,i=n.maxLabelWidth;G=0;let s=60;Object.keys(q).forEach(e=>{const r=q[e].color,o={cx:20,cy:s,r:7,fill:r,stroke:"#000",pos:q[e].position};W.drawCircle(t,o);let c=t.append("text").attr("visibility","hidden").text(e);const a=c.node().getBoundingClientRect().width;c.remove();let l=[];if(a<=i)l=[e];else{const n=e.split(" ");let s="";c=t.append("text").attr("visibility","hidden"),n.forEach(t=>{const n=s?`${s} ${t}`:t;c.text(n);if(c.node().getBoundingClientRect().width>i){if(s&&l.push(s),s=t,c.text(t),c.node().getBoundingClientRect().width>i){let n="";for(const s of t)n+=s,c.text(n+"-"),c.node().getBoundingClientRect().width>i&&(l.push(n.slice(0,-1)+"-"),n=s);s=n}}else s=n}),s&&l.push(s),c.remove()}l.forEach((i,e)=>{const r={x:40,y:s+7+20*e,fill:"#666",text:i,textMargin:n.boxTextMargin??5},o=W.drawText(t,r).node().getBoundingClientRect().width;o>G&&o>n.leftMargin-o&&(G=o)}),s+=Math.max(20,20*l.length)})}u(Z,"drawActorLegend");var H=f().journey,X=0,J=u(function(t,n,i,s){const e=f(),r=e.journey.titleColor,o=e.journey.titleFontSize,c=e.journey.titleFontFamily,a=e.securityLevel;let l;"sandbox"===a&&(l=d("#i"+n));const h=d("sandbox"===a?l.nodes()[0].contentDocument.body:"body");K.init();const u=h.select("#"+n);W.initGraphics(u);const y=s.db.getTasks(),k=s.db.getDiagramTitle(),x=s.db.getActors();for(const f in q)delete q[f];let m=0;x.forEach(t=>{q[t]={color:H.actorColours[m%H.actorColours.length],position:m},m++}),Z(u),X=H.leftMargin+G,K.insert(0,0,X,50*Object.keys(q).length),nt(u,y,0);const g=K.getBounds();k&&u.append("text").text(k).attr("x",X).attr("font-size",o).attr("font-weight","bold").attr("y",25).attr("fill",r).attr("font-family",c);const b=g.stopy-g.starty+2*H.diagramMarginY,v=X+g.stopx+2*H.diagramMarginX;p(u,b,v,H.useMaxWidth),u.append("line").attr("x1",X).attr("y1",4*H.height).attr("x2",v-X-4).attr("y2",4*H.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const _=k?70:0;u.attr("viewBox",`${g.startx} -25 ${v} ${b+_}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",b+_+25)},"draw"),K={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:u(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:u(function(t,n,i,s){void 0===t[n]?t[n]=i:t[n]=s(i,t[n])},"updateVal"),updateBounds:u(function(t,n,i,s){const e=f().journey,r=this;let o=0;function c(c){return u(function(a){o++;const l=r.sequenceItems.length-o+1;r.updateVal(a,"starty",n-l*e.boxMargin,Math.min),r.updateVal(a,"stopy",s+l*e.boxMargin,Math.max),r.updateVal(K.data,"startx",t-l*e.boxMargin,Math.min),r.updateVal(K.data,"stopx",i+l*e.boxMargin,Math.max),"activation"!==c&&(r.updateVal(a,"startx",t-l*e.boxMargin,Math.min),r.updateVal(a,"stopx",i+l*e.boxMargin,Math.max),r.updateVal(K.data,"starty",n-l*e.boxMargin,Math.min),r.updateVal(K.data,"stopy",s+l*e.boxMargin,Math.max))},"updateItemBounds")}u(c,"updateFn"),this.sequenceItems.forEach(c())},"updateBounds"),insert:u(function(t,n,i,s){const e=Math.min(t,i),r=Math.max(t,i),o=Math.min(n,s),c=Math.max(n,s);this.updateVal(K.data,"startx",e,Math.min),this.updateVal(K.data,"starty",o,Math.min),this.updateVal(K.data,"stopx",r,Math.max),this.updateVal(K.data,"stopy",c,Math.max),this.updateBounds(e,o,r,c)},"insert"),bumpVerticalPos:u(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:u(function(){return this.verticalPos},"getVerticalPos"),getBounds:u(function(){return this.data},"getBounds")},Q=H.sectionFills,tt=H.sectionColours,nt=u(function(t,n,i){const s=f().journey;let e="";const r=i+(2*s.height+s.diagramMarginY);let o=0,c="#CCC",a="black",l=0;for(const[h,u]of n.entries()){if(e!==u.section){c=Q[o%Q.length],l=o%Q.length,a=tt[o%tt.length];let i=0;const r=u.section;for(let t=h;t<n.length&&n[t].section==r;t++)i+=1;const f={x:h*s.taskMargin+h*s.width+X,y:50,text:u.section,fill:c,num:l,colour:a,taskCount:i};W.drawSection(t,f,s),e=u.section,o++}const i=u.people.reduce((t,n)=>(q[n]&&(t[n]=q[n]),t),{});u.x=h*s.taskMargin+h*s.width+X,u.y=r,u.width=s.diagramMarginX,u.height=s.diagramMarginY,u.colour=a,u.fill=c,u.num=l,u.actors=i,W.drawTask(t,u,s),K.insert(u.x,u.y,u.x+u.width+s.taskMargin,450)}},"drawTasks"),it={setConf:Y,draw:J},st={parser:m,db:P,renderer:it,styles:C,init:u(t=>{it.setConf(t.journey),P.clear()},"init")};export{st as diagram};
@@ -1 +0,0 @@
1
- import{_ as t,l as e,c as n,H as i,af as s,ag as r,ah as o,V as a,E as c,i as l,t as h,J as u,W as d,X as f,Y as p}from"./index-C5d-CFGb.js";import{g as E}from"./chunk-FMBD7UC4-CnT2icSo.js";var v=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],c=[1,19],l=[6,7,8],h=[1,26],u=[1,24],d=[1,25],f=[6,7,11],p=[1,31],E=[6,7,11,24],v=[1,6,13,16,17,20,23],g=[1,35],b=[1,36],S=[1,6,7,11,13,16,17,20,23],N=[1,38],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},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,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:h,7:u,10:23,11:d},e(f,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:c}),e(f,[2,19]),e(f,[2,21],{15:30,24:p}),e(f,[2,22]),e(f,[2,23]),e(E,[2,25]),e(E,[2,26]),e(E,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:d},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(v,[2,14],{7:g,11:b}),e(S,[2,8]),e(S,[2,9]),e(S,[2,10]),e(f,[2,16],{15:37,24:p}),e(f,[2,17]),e(f,[2,18]),e(f,[2,20],{24:N}),e(E,[2,31]),{21:[1,39]},{22:[1,40]},e(v,[2,13],{7:g,11:b}),e(S,[2,11]),e(S,[2,12]),e(f,[2,15],{24:N}),e(E,[2,30]),{22:[1,41]},e(E,[2,27]),e(E,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,c="",l=0,h=0,u=o.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(f.yy[p]=this.yy[p]);d.setInput(e,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var E=d.yylloc;o.push(E);var v=d.options&&d.options.ranges;function g(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),t(g,"lex");for(var b,S,N,k,D,m,_,y,I={};;){if(S=i[i.length-1],this.defaultActions[S]?N=this.defaultActions[S]:(null==b&&(b=g()),N=a[S]&&a[S][b]),void 0===N||!N.length||!N[0]){var O="";for(D in y=[],a[S])this.terminals_[D]&&D>2&&y.push("'"+this.terminals_[D]+"'");O=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(O,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:E,expected:y})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+S+", token: "+b);switch(N[0]){case 1:i.push(b),r.push(d.yytext),o.push(d.yylloc),i.push(N[1]),b=null,h=d.yyleng,c=d.yytext,l=d.yylineno,E=d.yylloc;break;case 2:if(m=this.productions_[N[1]][1],I.$=r[r.length-m],I._$={first_line:o[o.length-(m||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(m||1)].first_column,last_column:o[o.length-1].last_column},v&&(I._$.range=[o[o.length-(m||1)].range[0],o[o.length-1].range[1]]),void 0!==(k=this.performAction.apply(I,[c,h,l,f.yy,N[1],r,o].concat(u))))return k;m&&(i=i.slice(0,-1*m*2),r=r.slice(0,-1*m),o=o.slice(0,-1*m)),i.push(this.productions_[N[1]][0]),r.push(I.$),o.push(I._$),_=a[i[i.length-2]][i[i.length-1]],i.push(_);break;case 3:return!0}}return!0},"parse")},D=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,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))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var t=this.next();return t||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(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:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:case 21:case 22:case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\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:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}}();function m(){this.yy={}}return k.lexer=D,t(m,"Parser"),m.prototype=k,k.Parser=m,new m}();v.parser=v;var g=v,b=[],S=[],N=0,k={},D=t(()=>{b=[],S=[],N=0,k={}},"clear"),m=t(t=>{if(0===b.length)return null;const e=b[0].level;let n=null;for(let i=b.length-1;i>=0;i--)if(b[i].level!==e||n||(n=b[i]),b[i].level<e)throw new Error('Items without section detected, found section ("'+b[i].label+'")');return t===(null==n?void 0:n.level)?null:n},"getSection"),_=t(function(){return S},"getSections"),y=t(function(){const t=[],e=_(),i=n();for(const n of e){const e={id:n.id,label:l(n.label??"",i),isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=b.filter(t=>t.parentId===n.id);for(const r of s){const e={id:r.id,parentId:n.id,label:l(r.label??"",i),isGroup:!1,ticket:null==r?void 0:r.ticket,priority:null==r?void 0:r.priority,assigned:null==r?void 0:r.assigned,icon:null==r?void 0:r.icon,shape:"kanbanItem",level:r.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(e)}}return{nodes:t,edges:[],other:{},config:n()}},"getData"),I=t((t,e,i,s,r)=>{var o,a;const d=n();let f=(null==(o=d.mindmap)?void 0:o.padding)??c.mindmap.padding;switch(s){case O.ROUNDED_RECT:case O.RECT:case O.HEXAGON:f*=2}const p={id:l(e,d)||"kbn"+N++,level:t,label:l(i,d),width:(null==(a=d.mindmap)?void 0:a.maxNodeWidth)??c.mindmap.maxNodeWidth,padding:f,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);(null==e?void 0:e.shape)&&"kanbanItem"===e.shape&&(p.shape=null==e?void 0:e.shape),(null==e?void 0:e.label)&&(p.label=null==e?void 0:e.label),(null==e?void 0:e.icon)&&(p.icon=null==e?void 0:e.icon.toString()),(null==e?void 0:e.assigned)&&(p.assigned=null==e?void 0:e.assigned.toString()),(null==e?void 0:e.ticket)&&(p.ticket=null==e?void 0:e.ticket.toString()),(null==e?void 0:e.priority)&&(p.priority=null==e?void 0:e.priority)}const E=m(t);E?p.parentId=E.id||"kbn"+N++:S.push(p),b.push(p)},"addNode"),O={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w={clear:D,addNode:I,getSections:_,getData:y,nodeType:O,getType:t((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return O.RECT;case"(":return")"===n?O.ROUNDED_RECT:O.CLOUD;case"((":return O.CIRCLE;case")":return O.CLOUD;case"))":return O.BANG;case"{{":return O.HEXAGON;default:return O.DEFAULT}},"getType"),setElementForId:t((t,e)=>{k[t]=e},"setElementForId"),decorateNode:t(t=>{if(!t)return;const e=n(),i=b[b.length-1];t.icon&&(i.icon=l(t.icon,e)),t.class&&(i.cssClasses=l(t.class,e))},"decorateNode"),type2Str:t(t=>{switch(t){case O.DEFAULT:return"no-border";case O.RECT:return"rect";case O.ROUNDED_RECT:return"rounded-rect";case O.CIRCLE:return"circle";case O.CLOUD:return"cloud";case O.BANG:return"bang";case O.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),getLogger:t(()=>e,"getLogger"),getElementById:t(t=>k[t],"getElementById")},x={draw:t(async(t,l,h,u)=>{var d,f,p,E,v;e.debug("Rendering kanban diagram\n"+t);const g=u.db.getData(),b=n();b.htmlLabels=!1;const S=i(l),N=S.append("g");N.attr("class","sections");const k=S.append("g");k.attr("class","items");const D=g.nodes.filter(t=>t.isGroup);let m=0;const _=[];let y=25;for(const e of D){const t=(null==(d=null==b?void 0:b.kanban)?void 0:d.sectionWidth)||200;m+=1,e.x=t*m+10*(m-1)/2,e.width=t,e.y=0,e.height=3*t,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+" section-"+m;const n=await s(N,e);y=Math.max(y,null==(f=null==n?void 0:n.labelBBox)?void 0:f.height),_.push(n)}let I=0;for(const e of D){const t=_[I];I+=1;const n=(null==(p=null==b?void 0:b.kanban)?void 0:p.sectionWidth)||200,i=3*-n/2+y;let s=i;const a=g.nodes.filter(t=>t.parentId===e.id);for(const h of a){if(h.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");h.x=e.x,h.width=n-15;const t=(await r(k,h,{config:b})).node().getBBox();h.y=s+t.height/2,await o(h),s=h.y+t.height/2+5}const c=t.cluster.select("rect"),l=Math.max(s-i+30,50)+(y-25);c.attr("height",l)}a(void 0,S,(null==(E=b.mindmap)?void 0:E.padding)??c.kanban.padding,(null==(v=b.mindmap)?void 0:v.useMaxWidth)??c.kanban.useMaxWidth)},"draw")},A=t(e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],d(e["lineColor"+t])?e["lineColor"+t]=f(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t((t,n)=>e.darkMode?p(t,n):f(t,n),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n},"genSections"),C={db:w,renderer:x,parser:g,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${A(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n ${E()}\n`,"getStyles")};export{C as diagram};
@@ -1 +0,0 @@
1
- import{b as n,G as r,i as t,v as u}from"./graph-D3YdmkIz.js";import{i,c as o,k as e,o as f,p as a,q as c,t as v,u as s,v as l,w as d,d as b,x as h,b as g,y as p,n as m,m as w,r as y}from"./_baseUniq-BDYH-qGs.js";import{f as j,b as O,a as k,c as x,m as M,d as N}from"./min-Cvpawy_w.js";import{aZ as E,bj as _,bk as L,b4 as S,bl as R,aQ as G,bm as q,aD as z,bn as B,bo as C,aF as I,bp as P,b3 as T,aE as $,aX as A,b6 as D,bq as F}from"./index-C5d-CFGb.js";var J=/\s/;var Q=/^\s+/;function U(n){return n?n.slice(0,function(n){for(var r=n.length;r--&&J.test(n.charAt(r)););return r}(n)+1).replace(Q,""):n}var X=/^[-+]0x[0-9a-f]+$/i,Z=/^0b[01]+$/i,H=/^0o[0-7]+$/i,K=parseInt;var V=1/0;function W(n){return n?(n=function(n){if("number"==typeof n)return n;if(i(n))return NaN;if(E(n)){var r="function"==typeof n.valueOf?n.valueOf():n;n=E(r)?r+"":r}if("string"!=typeof n)return 0===n?n:+n;n=U(n);var t=Z.test(n);return t||H.test(n)?K(n.slice(2),t?2:8):X.test(n)?NaN:+n}(n))===V||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function Y(r){return n(r,5)}var nn=Object.prototype,rn=nn.hasOwnProperty,tn=S(function(n,r){n=Object(n);var t=-1,u=r.length,i=u>2?r[2]:void 0;for(i&&R(r[0],r[1],i)&&(u=1);++t<u;)for(var o=r[t],e=G(o),f=-1,a=e.length;++f<a;){var c=e[f],v=n[c];(void 0===v||q(v,nn[c])&&!rn.call(n,c))&&(n[c]=o[c])}return n});function un(n){var r=null==n?0:n.length;return r?n[r-1]:void 0}var on=Math.max;var en,fn=(en=function(n,r,t){var u=null==n?0:n.length;if(!u)return-1;var i,e,a=null==t?0:(i=W(t),e=i%1,i==i?e?i-e:i:0);return a<0&&(a=on(u+a,0)),f(n,o(r),a)},function(n,r,t){var u=Object(n);if(!z(n)){var i=o(r);n=e(n),r=function(n){return i(u[n],n,u)}}var f=en(n,r,t);return f>-1?u[i?n[f]:f]:void 0});function an(n,r){return n>r}var cn=Object.prototype.hasOwnProperty;function vn(n,r){return null!=n&&cn.call(n,r)}function sn(n,r){return null!=n&&v(n,r,vn)}function ln(n,r){var t={};return r=o(r),c(n,function(n,u,i){C(t,u,r(n,u,i))}),t}function dn(n){return n&&n.length?O(n,I,an):void 0}function bn(n,r){return n&&n.length?O(n,o(r),k):void 0}function hn(n,r,t,u){if(!E(n))return n;for(var i=-1,o=(r=s(r,n)).length,e=o-1,f=n;null!=f&&++i<o;){var a=l(r[i]),c=t;if("__proto__"===a||"constructor"===a||"prototype"===a)return n;if(i!=e){var v=f[a];void 0===(c=void 0)&&(c=E(v)?v:P(r[i+1])?[]:{})}T(f,a,c),f=f[a]}return n}function gn(n,r){if(n!==r){var t=void 0!==n,u=null===n,o=n==n,e=i(n),f=void 0!==r,a=null===r,c=r==r,v=i(r);if(!a&&!v&&!e&&n>r||e&&f&&c&&!a&&!v||u&&f&&c||!t&&c||!o)return 1;if(!u&&!e&&!v&&n<r||v&&t&&o&&!u&&!e||a&&t&&o||!f&&o||!c)return-1}return 0}function pn(n,r,t){r=r.length?b(r,function(n){return $(n)?function(r){return d(r,1===n.length?n[0]:n)}:n}):[I];var u=-1;return r=b(r,A(o)),function(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].value;return n}(x(n,function(n,t,i){return{criteria:b(r,function(r){return r(n)}),index:++u,value:n}}),function(n,r){return function(n,r,t){for(var u=-1,i=n.criteria,o=r.criteria,e=i.length,f=t.length;++u<e;){var a=gn(i[u],o[u]);if(a)return u>=f?a:a*("desc"==t[u]?-1:1)}return n.index-r.index}(n,r,t)})}function mn(n,r){return function(n,r,t){for(var u=-1,i=r.length,o={};++u<i;){var e=r[u],f=d(n,e);t(f,e)&&hn(o,s(e,n),f)}return o}(n,r,function(r,t){return h(n,t)})}var wn,yn=_(L(wn=function(n,r){return null==n?{}:mn(n,r)},void 0,j),wn+""),jn=Math.ceil,On=Math.max;var kn=function(n,r,t){return t&&"number"!=typeof t&&R(n,r,t)&&(r=t=void 0),n=W(n),void 0===r?(r=n,n=0):r=W(r),function(n,r,t){for(var u=-1,i=On(jn((r-n)/(t||1)),0),o=Array(i);i--;)o[++u]=n,n+=t;return o}(n,r,t=void 0===t?n<r?1:-1:W(t))},xn=S(function(n,r){if(null==n)return[];var t=r.length;return t>1&&R(n,r[0],r[1])?r=[]:t>2&&R(r[0],r[1],r[2])&&(r=[r[0]]),pn(n,g(r),[])}),Mn=0;function Nn(n){var r=++Mn;return p(n)+r}class En{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return _n(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&_n(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Ln)),t=t._prev;return"["+n.join(", ")+"]"}}function _n(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Ln(n,r){if("_next"!==n&&"_prev"!==n)return r}var Sn=D(1);function Rn(n,t){if(n.nodeCount()<=1)return[];var u=function(n,t){var u=new r,i=0,o=0;m(n.nodes(),function(n){u.setNode(n,{v:n,in:0,out:0})}),m(n.edges(),function(n){var r=u.edge(n.v,n.w)||0,e=t(n),f=r+e;u.setEdge(n.v,n.w,f),o=Math.max(o,u.node(n.v).out+=e),i=Math.max(i,u.node(n.w).in+=e)});var e=kn(o+i+3).map(function(){return new En}),f=i+1;return m(u.nodes(),function(n){qn(e,f,u.node(n))}),{graph:u,buckets:e,zeroIdx:f}}(n,t||Sn),i=function(n,r,t){var u,i=[],o=r[r.length-1],e=r[0];for(;n.nodeCount();){for(;u=e.dequeue();)Gn(n,r,t,u);for(;u=o.dequeue();)Gn(n,r,t,u);if(n.nodeCount())for(var f=r.length-2;f>0;--f)if(u=r[f].dequeue()){i=i.concat(Gn(n,r,t,u,!0));break}}return i}(u.graph,u.buckets,u.zeroIdx);return j(M(i,function(r){return n.outEdges(r.v,r.w)}))}function Gn(n,r,t,u,i){var o=i?[]:void 0;return m(n.inEdges(u.v),function(u){var e=n.edge(u),f=n.node(u.v);i&&o.push({v:u.v,w:u.w}),f.out-=e,qn(r,t,f)}),m(n.outEdges(u.v),function(u){var i=n.edge(u),o=u.w,e=n.node(o);e.in-=i,qn(r,t,e)}),n.removeNode(u.v),o}function qn(n,r,t){t.out?t.in?n[t.out-t.in+r].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}function zn(n){var r,t="greedy"===n.graph().acyclicer?Rn(n,(r=n,function(n){return r.edge(n).weight})):function(n){var r=[],t={},u={};function i(o){Object.prototype.hasOwnProperty.call(u,o)||(u[o]=!0,t[o]=!0,m(n.outEdges(o),function(n){Object.prototype.hasOwnProperty.call(t,n.w)?r.push(n):i(n.w)}),delete t[o])}return m(n.nodes(),i),r}(n);m(t,function(r){var t=n.edge(r);n.removeEdge(r),t.forwardName=r.name,t.reversed=!0,n.setEdge(r.w,r.v,t,Nn("rev"))})}function Bn(n,r,t,u){var i;do{i=Nn(u)}while(n.hasNode(i));return t.dummy=r,n.setNode(i,t),i}function Cn(n){var t=new r({multigraph:n.isMultigraph()}).setGraph(n.graph());return m(n.nodes(),function(r){n.children(r).length||t.setNode(r,n.node(r))}),m(n.edges(),function(r){t.setEdge(r,n.edge(r))}),t}function In(n,r){var t,u,i=n.x,o=n.y,e=r.x-i,f=r.y-o,a=n.width/2,c=n.height/2;if(!e&&!f)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(f)*a>Math.abs(e)*c?(f<0&&(c=-c),t=c*e/f,u=c):(e<0&&(a=-a),t=a,u=a*f/e),{x:i+t,y:o+u}}function Pn(n){var r=M(kn($n(n)+1),function(){return[]});return m(n.nodes(),function(u){var i=n.node(u),o=i.rank;t(o)||(r[o][i.order]=u)}),r}function Tn(n,r,t,u){var i={width:0,height:0};return arguments.length>=4&&(i.rank=t,i.order=u),Bn(n,"border",i,r)}function $n(n){return dn(M(n.nodes(),function(r){var u=n.node(r).rank;if(!t(u))return u}))}function An(n,r){return r()}function Dn(n,r,t,u,i,o){var e={width:0,height:0,rank:o,borderType:r},f=i[r][o-1],a=Bn(n,"border",e,t);i[r][o]=a,n.setParent(a,u),f&&n.setEdge(f,a,{weight:1})}function Fn(n){var r=n.graph().rankdir.toLowerCase();"bt"!==r&&"rl"!==r||function(n){m(n.nodes(),function(r){Un(n.node(r))}),m(n.edges(),function(r){var t=n.edge(r);m(t.points,Un),Object.prototype.hasOwnProperty.call(t,"y")&&Un(t)})}(n),"lr"!==r&&"rl"!==r||(!function(n){m(n.nodes(),function(r){Xn(n.node(r))}),m(n.edges(),function(r){var t=n.edge(r);m(t.points,Xn),Object.prototype.hasOwnProperty.call(t,"x")&&Xn(t)})}(n),Jn(n))}function Jn(n){m(n.nodes(),function(r){Qn(n.node(r))}),m(n.edges(),function(r){Qn(n.edge(r))})}function Qn(n){var r=n.width;n.width=n.height,n.height=r}function Un(n){n.y=-n.y}function Xn(n){var r=n.x;n.x=n.y,n.y=r}function Zn(n){n.graph().dummyChains=[],m(n.edges(),function(r){!function(n,r){var t=r.v,u=n.node(t).rank,i=r.w,o=n.node(i).rank,e=r.name,f=n.edge(r),a=f.labelRank;if(o===u+1)return;n.removeEdge(r);var c,v,s=void 0;for(v=0,++u;u<o;++v,++u)f.points=[],c=Bn(n,"edge",s={width:0,height:0,edgeLabel:f,edgeObj:r,rank:u},"_d"),u===a&&(s.width=f.width,s.height=f.height,s.dummy="edge-label",s.labelpos=f.labelpos),n.setEdge(t,c,{weight:f.weight},e),0===v&&n.graph().dummyChains.push(c),t=c;n.setEdge(t,i,{weight:f.weight},e)}(n,r)})}function Hn(n){var r={};m(n.sources(),function t(u){var i=n.node(u);if(Object.prototype.hasOwnProperty.call(r,u))return i.rank;r[u]=!0;var o=N(M(n.outEdges(u),function(r){return t(r.w)-n.edge(r).minlen}));return o!==Number.POSITIVE_INFINITY&&null!=o||(o=0),i.rank=o})}function Kn(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}function Vn(n){var t,u,i=new r({directed:!1}),o=n.nodes()[0],e=n.nodeCount();for(i.setNode(o,{});Wn(i,n)<e;)t=Yn(i,n),u=i.hasNode(t.v)?Kn(n,t):-Kn(n,t),nr(i,n,u);return i}function Wn(n,r){return m(n.nodes(),function t(u){m(r.nodeEdges(u),function(i){var o=i.v,e=u===o?i.w:o;n.hasNode(e)||Kn(r,i)||(n.setNode(e,{}),n.setEdge(u,e,{}),t(e))})}),n.nodeCount()}function Yn(n,r){return bn(r.edges(),function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return Kn(r,t)})}function nr(n,r,t){m(n.nodes(),function(n){r.node(n).rank+=t})}function rr(n,r,t){$(r)||(r=[r]);var u=(n.isDirected()?n.successors:n.neighbors).bind(n),i=[],o={};return m(r,function(r){if(!n.hasNode(r))throw new Error("Graph does not have node: "+r);tr(n,r,"post"===t,o,u,i)}),i}function tr(n,r,t,u,i,o){Object.prototype.hasOwnProperty.call(u,r)||(u[r]=!0,t||o.push(r),m(i(r),function(r){tr(n,r,t,u,i,o)}),t&&o.push(r))}function ur(n){n=function(n){var t=(new r).setGraph(n.graph());return m(n.nodes(),function(r){t.setNode(r,n.node(r))}),m(n.edges(),function(r){var u=t.edge(r.v,r.w)||{weight:0,minlen:1},i=n.edge(r);t.setEdge(r.v,r.w,{weight:u.weight+i.weight,minlen:Math.max(u.minlen,i.minlen)})}),t}(n),Hn(n);var t,u=Vn(n);for(er(u),ir(u,n);t=ar(u);)vr(u,n,t,cr(u,n,t))}function ir(n,r){var t=function(n,r){return rr(n,r,"post")}(n,n.nodes());t=t.slice(0,t.length-1),m(t,function(t){!function(n,r,t){var u=n.node(t),i=u.parent;n.edge(t,i).cutvalue=or(n,r,t)}(n,r,t)})}function or(n,r,t){var u=n.node(t).parent,i=!0,o=r.edge(t,u),e=0;return o||(i=!1,o=r.edge(u,t)),e=o.weight,m(r.nodeEdges(t),function(o){var f,a,c=o.v===t,v=c?o.w:o.v;if(v!==u){var s=c===i,l=r.edge(o).weight;if(e+=s?l:-l,f=t,a=v,n.hasEdge(f,a)){var d=n.edge(t,v).cutvalue;e+=s?-d:d}}}),e}function er(n,r){arguments.length<2&&(r=n.nodes()[0]),fr(n,{},1,r)}function fr(n,r,t,u,i){var o=t,e=n.node(u);return r[u]=!0,m(n.neighbors(u),function(i){Object.prototype.hasOwnProperty.call(r,i)||(t=fr(n,r,t,i,u))}),e.low=o,e.lim=t++,i?e.parent=i:delete e.parent,t}function ar(n){return fn(n.edges(),function(r){return n.edge(r).cutvalue<0})}function cr(n,r,t){var u=t.v,i=t.w;r.hasEdge(u,i)||(u=t.w,i=t.v);var o=n.node(u),e=n.node(i),f=o,a=!1;return o.lim>e.lim&&(f=e,a=!0),bn(w(r.edges(),function(r){return a===sr(n,n.node(r.v),f)&&a!==sr(n,n.node(r.w),f)}),function(n){return Kn(r,n)})}function vr(n,r,t,u){var i=t.v,o=t.w;n.removeEdge(i,o),n.setEdge(u.v,u.w,{}),er(n),ir(n,r),function(n,r){var t=fn(n.nodes(),function(n){return!r.node(n).parent}),u=function(n,r){return rr(n,r,"pre")}(n,t);u=u.slice(1),m(u,function(t){var u=n.node(t).parent,i=r.edge(t,u),o=!1;i||(i=r.edge(u,t),o=!0),r.node(t).rank=r.node(u).rank+(o?i.minlen:-i.minlen)})}(n,r)}function sr(n,r,t){return t.low<=r.lim&&r.lim<=t.lim}function lr(n){switch(n.graph().ranker){case"network-simplex":default:br(n);break;case"tight-tree":!function(n){Hn(n),Vn(n)}(n);break;case"longest-path":dr(n)}}new Error,ur.initLowLimValues=er,ur.initCutValues=ir,ur.calcCutValue=or,ur.leaveEdge=ar,ur.enterEdge=cr,ur.exchangeEdges=vr;var dr=Hn;function br(n){ur(n)}function hr(n){var r=Bn(n,"root",{},"_root"),t=function(n){var r={};function t(u,i){var o=n.children(u);o&&o.length&&m(o,function(n){t(n,i+1)}),r[u]=i}return m(n.children(),function(n){t(n,1)}),r}(n),i=dn(u(t))-1,o=2*i+1;n.graph().nestingRoot=r,m(n.edges(),function(r){n.edge(r).minlen*=o});var e=function(n){return y(n.edges(),function(r,t){return r+n.edge(t).weight},0)}(n)+1;m(n.children(),function(u){gr(n,r,o,e,i,t,u)}),n.graph().nodeRankFactor=o}function gr(n,r,t,u,i,o,e){var f=n.children(e);if(f.length){var a=Tn(n,"_bt"),c=Tn(n,"_bb"),v=n.node(e);n.setParent(a,e),v.borderTop=a,n.setParent(c,e),v.borderBottom=c,m(f,function(f){gr(n,r,t,u,i,o,f);var v=n.node(f),s=v.borderTop?v.borderTop:f,l=v.borderBottom?v.borderBottom:f,d=v.borderTop?u:2*u,b=s!==l?1:i-o[e]+1;n.setEdge(a,s,{weight:d,minlen:b,nestingEdge:!0}),n.setEdge(l,c,{weight:d,minlen:b,nestingEdge:!0})}),n.parent(e)||n.setEdge(r,a,{weight:0,minlen:i+o[e]})}else e!==r&&n.setEdge(r,e,{weight:0,minlen:t})}function pr(n,u,i){var o=function(n){var r;for(;n.hasNode(r=Nn("_root")););return r}(n),e=new r({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(r){return n.node(r)});return m(n.nodes(),function(r){var f=n.node(r),a=n.parent(r);(f.rank===u||f.minRank<=u&&u<=f.maxRank)&&(e.setNode(r),e.setParent(r,a||o),m(n[i](r),function(u){var i=u.v===r?u.w:u.v,o=e.edge(i,r),f=t(o)?0:o.weight;e.setEdge(i,r,{weight:n.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(f,"minRank")&&e.setNode(r,{borderLeft:f.borderLeft[u],borderRight:f.borderRight[u]}))}),e}function mr(n,r){for(var t=0,u=1;u<r.length;++u)t+=wr(n,r[u-1],r[u]);return t}function wr(n,r,t){for(var u,i,o=(u=t,i=M(t,function(n,r){return r}),function(n,r,t){for(var u=-1,i=n.length,o=r.length,e={};++u<i;){var f=u<o?r[u]:void 0;t(e,n[u],f)}return e}(u||[],i||[],T)),e=j(M(r,function(r){return xn(M(n.outEdges(r),function(r){return{pos:o[r.w],weight:n.edge(r).weight}}),"pos")})),f=1;f<t.length;)f<<=1;var a=2*f-1;f-=1;var c=M(new Array(a),function(){return 0}),v=0;return m(e.forEach(function(n){var r=n.pos+f;c[r]+=n.weight;for(var t=0;r>0;)r%2&&(t+=c[r+1]),c[r=r-1>>1]+=n.weight;v+=n.weight*t})),v}function yr(n,r){var u={};return m(n,function(n,r){var i=u[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:r};t(n.barycenter)||(i.barycenter=n.barycenter,i.weight=n.weight)}),m(r.edges(),function(n){var r=u[n.v],i=u[n.w];t(r)||t(i)||(i.indegree++,r.out.push(u[n.w]))}),function(n){var r=[];function u(n){return function(r){r.merged||(t(r.barycenter)||t(n.barycenter)||r.barycenter>=n.barycenter)&&function(n,r){var t=0,u=0;n.weight&&(t+=n.barycenter*n.weight,u+=n.weight);r.weight&&(t+=r.barycenter*r.weight,u+=r.weight);n.vs=r.vs.concat(n.vs),n.barycenter=t/u,n.weight=u,n.i=Math.min(r.i,n.i),r.merged=!0}(n,r)}}function i(r){return function(t){t.in.push(r),0===--t.indegree&&n.push(t)}}for(;n.length;){var o=n.pop();r.push(o),m(o.in.reverse(),u(o)),m(o.out,i(o))}return M(w(r,function(n){return!n.merged}),function(n){return yn(n,["vs","i","barycenter","weight"])})}(w(u,function(n){return!n.indegree}))}function jr(n,r){var t,u=function(n,r){var t={lhs:[],rhs:[]};return m(n,function(n){r(n)?t.lhs.push(n):t.rhs.push(n)}),t}(n,function(n){return Object.prototype.hasOwnProperty.call(n,"barycenter")}),i=u.lhs,o=xn(u.rhs,function(n){return-n.i}),e=[],f=0,a=0,c=0;i.sort((t=!!r,function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:t?r.i-n.i:n.i-r.i})),c=Or(e,o,c),m(i,function(n){c+=n.vs.length,e.push(n.vs),f+=n.barycenter*n.weight,a+=n.weight,c=Or(e,o,c)});var v={vs:j(e)};return a&&(v.barycenter=f/a,v.weight=a),v}function Or(n,r,t){for(var u;r.length&&(u=un(r)).i<=t;)r.pop(),n.push(u.vs),t++;return t}function kr(n,r,u,i){var o=n.children(r),e=n.node(r),f=e?e.borderLeft:void 0,a=e?e.borderRight:void 0,c={};f&&(o=w(o,function(n){return n!==f&&n!==a}));var v=function(n,r){return M(r,function(r){var t=n.inEdges(r);if(t.length){var u=y(t,function(r,t){var u=n.edge(t),i=n.node(t.v);return{sum:r.sum+u.weight*i.order,weight:r.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:u.sum/u.weight,weight:u.weight}}return{v:r}})}(n,o);m(v,function(r){if(n.children(r.v).length){var o=kr(n,r.v,u,i);c[r.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&(f=o,t((e=r).barycenter)?(e.barycenter=f.barycenter,e.weight=f.weight):(e.barycenter=(e.barycenter*e.weight+f.barycenter*f.weight)/(e.weight+f.weight),e.weight+=f.weight))}var e,f});var s=yr(v,u);!function(n,r){m(n,function(n){n.vs=j(n.vs.map(function(n){return r[n]?r[n].vs:n}))})}(s,c);var l=jr(s,i);if(f&&(l.vs=j([f,l.vs,a]),n.predecessors(f).length)){var d=n.node(n.predecessors(f)[0]),b=n.node(n.predecessors(a)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+d.order+b.order)/(l.weight+2),l.weight+=2}return l}function xr(n){var r=$n(n),t=Mr(n,kn(1,r+1),"inEdges"),u=Mr(n,kn(r-1,-1,-1),"outEdges"),i=function(n){var r={},t=w(n.nodes(),function(r){return!n.children(r).length}),u=dn(M(t,function(r){return n.node(r).rank})),i=M(kn(u+1),function(){return[]}),o=xn(t,function(r){return n.node(r).rank});return m(o,function t(u){if(!sn(r,u)){r[u]=!0;var o=n.node(u);i[o.rank].push(u),m(n.successors(u),t)}}),i}(n);Er(n,i);for(var o,e=Number.POSITIVE_INFINITY,f=0,a=0;a<4;++f,++a){Nr(f%2?t:u,f%4>=2);var c=mr(n,i=Pn(n));c<e&&(a=0,o=Y(i),e=c)}Er(n,o)}function Mr(n,r,t){return M(r,function(r){return pr(n,r,t)})}function Nr(n,t){var u=new r;m(n,function(n){var r=n.graph().root,i=kr(n,r,u,t);m(i.vs,function(r,t){n.node(r).order=t}),function(n,r,t){var u,i={};m(t,function(t){for(var o,e,f=n.parent(t);f;){if((o=n.parent(f))?(e=i[o],i[o]=f):(e=u,u=f),e&&e!==f)return void r.setEdge(e,f);f=o}})}(n,u,i.vs)})}function Er(n,r){m(r,function(r){m(r,function(r,t){n.node(r).order=t})})}function _r(n){var r=function(n){var r={},t=0;function u(i){var o=t;m(n.children(i),u),r[i]={low:o,lim:t++}}return m(n.children(),u),r}(n);m(n.graph().dummyChains,function(t){for(var u=n.node(t),i=u.edgeObj,o=function(n,r,t,u){var i,o,e=[],f=[],a=Math.min(r[t].low,r[u].low),c=Math.max(r[t].lim,r[u].lim);i=t;do{i=n.parent(i),e.push(i)}while(i&&(r[i].low>a||c>r[i].lim));o=i,i=u;for(;(i=n.parent(i))!==o;)f.push(i);return{path:e.concat(f.reverse()),lca:o}}(n,r,i.v,i.w),e=o.path,f=o.lca,a=0,c=e[a],v=!0;t!==i.w;){if(u=n.node(t),v){for(;(c=e[a])!==f&&n.node(c).maxRank<u.rank;)a++;c===f&&(v=!1)}if(!v){for(;a<e.length-1&&n.node(c=e[a+1]).minRank<=u.rank;)a++;c=e[a]}n.setParent(t,c),t=n.successors(t)[0]}})}function Lr(n,r){var t={};return y(r,function(r,u){var i=0,o=0,e=r.length,f=un(u);return m(u,function(r,a){var c=function(n,r){if(n.node(r).dummy)return fn(n.predecessors(r),function(r){return n.node(r).dummy})}(n,r),v=c?n.node(c).order:e;(c||r===f)&&(m(u.slice(o,a+1),function(r){m(n.predecessors(r),function(u){var o=n.node(u),e=o.order;!(e<i||v<e)||o.dummy&&n.node(r).dummy||Sr(t,u,r)})}),o=a+1,i=v)}),u}),t}function Sr(n,r,t){if(r>t){var u=r;r=t,t=u}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=n[r];Object.defineProperty(i,t,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Rr(n,r,t){if(r>t){var u=r;r=t,t=u}return!!n[r]&&Object.prototype.hasOwnProperty.call(n[r],t)}function Gr(n,t,u,i,o){var e={},f=function(n,t,u,i){var o=new r,e=n.graph(),f=function(n,r,t){return function(u,i,o){var e,f=u.node(i),a=u.node(o),c=0;if(c+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":e=-f.width/2;break;case"r":e=f.width/2}if(e&&(c+=t?e:-e),e=0,c+=(f.dummy?r:n)/2,c+=(a.dummy?r:n)/2,c+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":e=a.width/2;break;case"r":e=-a.width/2}return e&&(c+=t?e:-e),e=0,c}}(e.nodesep,e.edgesep,i);return m(t,function(r){var t;m(r,function(r){var i=u[r];if(o.setNode(i),t){var e=u[t],a=o.edge(e,i);o.setEdge(e,i,Math.max(f(n,r,t),a||0))}t=r})}),o}(n,t,u,o),a=o?"borderLeft":"borderRight";function c(n,r){for(var t=f.nodes(),u=t.pop(),i={};u;)i[u]?n(u):(i[u]=!0,t.push(u),t=t.concat(r(u))),u=t.pop()}return c(function(n){e[n]=f.inEdges(n).reduce(function(n,r){return Math.max(n,e[r.v]+f.edge(r))},0)},f.predecessors.bind(f)),c(function(r){var t=f.outEdges(r).reduce(function(n,r){return Math.min(n,e[r.w]-f.edge(r))},Number.POSITIVE_INFINITY),u=n.node(r);t!==Number.POSITIVE_INFINITY&&u.borderType!==a&&(e[r]=Math.max(e[r],t))},f.successors.bind(f)),m(i,function(n){e[n]=e[u[n]]}),e}function qr(n,r){return bn(u(r),function(r){var t,u,i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return u=function(r,t){var u=function(n,r){return n.node(r).width}(n,t)/2;i=Math.max(r+u,i),o=Math.min(r-u,o)},null==(t=r)||B(t,a(u),G),i-o})}function zr(n){var r,t=Pn(n),i=F(Lr(n,t),function(n,r){var t={};function u(r,u,i,o,e){var f;m(kn(u,i),function(u){f=r[u],n.node(f).dummy&&m(n.predecessors(f),function(r){var u=n.node(r);u.dummy&&(u.order<o||u.order>e)&&Sr(t,r,f)})})}return y(r,function(r,t){var i,o=-1,e=0;return m(t,function(f,a){if("border"===n.node(f).dummy){var c=n.predecessors(f);c.length&&(i=n.node(c[0]).order,u(t,e,a,o,i),e=a,o=i)}u(t,e,t.length,i,r.length)}),t}),t}(n,t)),o={};m(["u","d"],function(e){r="u"===e?t:u(t).reverse(),m(["l","r"],function(t){"r"===t&&(r=M(r,function(n){return u(n).reverse()}));var f=("u"===e?n.predecessors:n.successors).bind(n),a=function(n,r,t,u){var i={},o={},e={};return m(r,function(n){m(n,function(n,r){i[n]=n,o[n]=n,e[n]=r})}),m(r,function(n){var r=-1;m(n,function(n){var f=u(n);if(f.length)for(var a=((f=xn(f,function(n){return e[n]})).length-1)/2,c=Math.floor(a),v=Math.ceil(a);c<=v;++c){var s=f[c];o[n]===n&&r<e[s]&&!Rr(t,n,s)&&(o[s]=n,o[n]=i[n]=i[s],r=e[s])}})}),{root:i,align:o}}(0,r,i,f),c=Gr(n,r,a.root,a.align,"r"===t);"r"===t&&(c=ln(c,function(n){return-n})),o[e+t]=c})});var e=qr(n,o);return function(n,r){var t=u(r),i=N(t),o=dn(t);m(["u","d"],function(t){m(["l","r"],function(e){var f,a=t+e,c=n[a];if(c!==r){var v=u(c);(f="l"===e?i-N(v):o-dn(v))&&(n[a]=ln(c,function(n){return n+f}))}})})}(o,e),function(n,r){return ln(n.ul,function(t,u){if(r)return n[r.toLowerCase()][u];var i=xn(M(n,u));return(i[1]+i[2])/2})}(o,n.graph().align)}function Br(n){var r,t;(function(n){var r=Pn(n),t=n.graph().ranksep,u=0;m(r,function(r){var i=dn(M(r,function(r){return n.node(r).height}));m(r,function(r){n.node(r).y=u+i/2}),u+=i+t})})(n=Cn(n)),r=zr(n),t=function(r,t){n.node(t).x=r},r&&c(r,a(t))}function Cr(n,u){var i=An;i("layout",()=>{var u=i(" buildLayoutGraph",()=>function(n){var t=new r({multigraph:!0,compound:!0}),u=Ur(n.graph());return t.setGraph(F({},Pr,Qr(u,Ir),yn(u,Tr))),m(n.nodes(),function(r){var u=Ur(n.node(r));t.setNode(r,tn(Qr(u,$r),Ar)),t.setParent(r,n.parent(r))}),m(n.edges(),function(r){var u=Ur(n.edge(r));t.setEdge(r,F({},Fr,Qr(u,Dr),yn(u,Jr)))}),t}(n));i(" runLayout",()=>function(n,r){r(" makeSpaceForEdgeLabels",()=>function(n){var r=n.graph();r.ranksep/=2,m(n.edges(),function(t){var u=n.edge(t);u.minlen*=2,"c"!==u.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?u.width+=u.labeloffset:u.height+=u.labeloffset)})}(n)),r(" removeSelfEdges",()=>function(n){m(n.edges(),function(r){if(r.v===r.w){var t=n.node(r.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:r,label:n.edge(r)}),n.removeEdge(r)}})}(n)),r(" acyclic",()=>zn(n)),r(" nestingGraph.run",()=>hr(n)),r(" rank",()=>lr(Cn(n))),r(" injectEdgeLabelProxies",()=>function(n){m(n.edges(),function(r){var t=n.edge(r);if(t.width&&t.height){var u=n.node(r.v),i={rank:(n.node(r.w).rank-u.rank)/2+u.rank,e:r};Bn(n,"edge-proxy",i,"_ep")}})}(n)),r(" removeEmptyRanks",()=>function(n){var r=N(M(n.nodes(),function(r){return n.node(r).rank})),u=[];m(n.nodes(),function(t){var i=n.node(t).rank-r;u[i]||(u[i]=[]),u[i].push(t)});var i=0,o=n.graph().nodeRankFactor;m(u,function(r,u){t(r)&&u%o!==0?--i:i&&m(r,function(r){n.node(r).rank+=i})})}(n)),r(" nestingGraph.cleanup",()=>function(n){var r=n.graph();n.removeNode(r.nestingRoot),delete r.nestingRoot,m(n.edges(),function(r){n.edge(r).nestingEdge&&n.removeEdge(r)})}(n)),r(" normalizeRanks",()=>function(n){var r=N(M(n.nodes(),function(r){return n.node(r).rank}));m(n.nodes(),function(t){var u=n.node(t);sn(u,"rank")&&(u.rank-=r)})}(n)),r(" assignRankMinMax",()=>function(n){var r=0;m(n.nodes(),function(t){var u=n.node(t);u.borderTop&&(u.minRank=n.node(u.borderTop).rank,u.maxRank=n.node(u.borderBottom).rank,r=dn(r,u.maxRank))}),n.graph().maxRank=r}(n)),r(" removeEdgeLabelProxies",()=>function(n){m(n.nodes(),function(r){var t=n.node(r);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(r))})}(n)),r(" normalize.run",()=>Zn(n)),r(" parentDummyChains",()=>_r(n)),r(" addBorderSegments",()=>function(n){m(n.children(),function r(t){var u=n.children(t),i=n.node(t);if(u.length&&m(u,r),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,e=i.maxRank+1;o<e;++o)Dn(n,"borderLeft","_bl",t,i,o),Dn(n,"borderRight","_br",t,i,o)}})}(n)),r(" order",()=>xr(n)),r(" insertSelfEdges",()=>function(n){var r=Pn(n);m(r,function(r){var t=0;m(r,function(r,u){var i=n.node(r);i.order=u+t,m(i.selfEdges,function(r){Bn(n,"selfedge",{width:r.label.width,height:r.label.height,rank:i.rank,order:u+ ++t,e:r.e,label:r.label},"_se")}),delete i.selfEdges})})}(n)),r(" adjustCoordinateSystem",()=>function(n){var r=n.graph().rankdir.toLowerCase();"lr"!==r&&"rl"!==r||Jn(n)}(n)),r(" position",()=>Br(n)),r(" positionSelfEdges",()=>function(n){m(n.nodes(),function(r){var t=n.node(r);if("selfedge"===t.dummy){var u=n.node(t.e.v),i=u.x+u.width/2,o=u.y,e=t.x-i,f=u.height/2;n.setEdge(t.e,t.label),n.removeNode(r),t.label.points=[{x:i+2*e/3,y:o-f},{x:i+5*e/6,y:o-f},{x:i+e,y:o},{x:i+5*e/6,y:o+f},{x:i+2*e/3,y:o+f}],t.label.x=t.x,t.label.y=t.y}})}(n)),r(" removeBorderNodes",()=>function(n){m(n.nodes(),function(r){if(n.children(r).length){var t=n.node(r),u=n.node(t.borderTop),i=n.node(t.borderBottom),o=n.node(un(t.borderLeft)),e=n.node(un(t.borderRight));t.width=Math.abs(e.x-o.x),t.height=Math.abs(i.y-u.y),t.x=o.x+t.width/2,t.y=u.y+t.height/2}}),m(n.nodes(),function(r){"border"===n.node(r).dummy&&n.removeNode(r)})}(n)),r(" normalize.undo",()=>function(n){m(n.graph().dummyChains,function(r){var t,u=n.node(r),i=u.edgeLabel;for(n.setEdge(u.edgeObj,i);u.dummy;)t=n.successors(r)[0],n.removeNode(r),i.points.push({x:u.x,y:u.y}),"edge-label"===u.dummy&&(i.x=u.x,i.y=u.y,i.width=u.width,i.height=u.height),r=t,u=n.node(r)})}(n)),r(" fixupEdgeLabelCoords",()=>function(n){m(n.edges(),function(r){var t=n.edge(r);if(Object.prototype.hasOwnProperty.call(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}})}(n)),r(" undoCoordinateSystem",()=>Fn(n)),r(" translateGraph",()=>function(n){var r=Number.POSITIVE_INFINITY,t=0,u=Number.POSITIVE_INFINITY,i=0,o=n.graph(),e=o.marginx||0,f=o.marginy||0;function a(n){var o=n.x,e=n.y,f=n.width,a=n.height;r=Math.min(r,o-f/2),t=Math.max(t,o+f/2),u=Math.min(u,e-a/2),i=Math.max(i,e+a/2)}m(n.nodes(),function(r){a(n.node(r))}),m(n.edges(),function(r){var t=n.edge(r);Object.prototype.hasOwnProperty.call(t,"x")&&a(t)}),r-=e,u-=f,m(n.nodes(),function(t){var i=n.node(t);i.x-=r,i.y-=u}),m(n.edges(),function(t){var i=n.edge(t);m(i.points,function(n){n.x-=r,n.y-=u}),Object.prototype.hasOwnProperty.call(i,"x")&&(i.x-=r),Object.prototype.hasOwnProperty.call(i,"y")&&(i.y-=u)}),o.width=t-r+e,o.height=i-u+f}(n)),r(" assignNodeIntersects",()=>function(n){m(n.edges(),function(r){var t,u,i=n.edge(r),o=n.node(r.v),e=n.node(r.w);i.points?(t=i.points[0],u=i.points[i.points.length-1]):(i.points=[],t=e,u=o),i.points.unshift(In(o,t)),i.points.push(In(e,u))})}(n)),r(" reversePoints",()=>function(n){m(n.edges(),function(r){var t=n.edge(r);t.reversed&&t.points.reverse()})}(n)),r(" acyclic.undo",()=>function(n){m(n.edges(),function(r){var t=n.edge(r);if(t.reversed){n.removeEdge(r);var u=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(r.w,r.v,t,u)}})}(n))}(u,i)),i(" updateInputGraph",()=>function(n,r){m(n.nodes(),function(t){var u=n.node(t),i=r.node(t);u&&(u.x=i.x,u.y=i.y,r.children(t).length&&(u.width=i.width,u.height=i.height))}),m(n.edges(),function(t){var u=n.edge(t),i=r.edge(t);u.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(u.x=i.x,u.y=i.y)}),n.graph().width=r.graph().width,n.graph().height=r.graph().height}(n,u))})}var Ir=["nodesep","edgesep","ranksep","marginx","marginy"],Pr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Tr=["acyclicer","ranker","rankdir","align"],$r=["width","height"],Ar={width:0,height:0},Dr=["minlen","weight","width","height","labeloffset"],Fr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Jr=["labelpos"];function Qr(n,r){return ln(yn(n,r),Number)}function Ur(n){var r={};return m(n,function(n,t){r[t.toLowerCase()]=n}),r}export{Cr as l};
@@ -1 +0,0 @@
1
- import{aK as n,aL as t,aM as r,aN as u,aO as a}from"./index-C5d-CFGb.js";import{i as e}from"./init-C9Lo50Hz.js";import{e as f,f as o,a as i,b as c}from"./defaultLocale-DK_abR1s.js";function l(n,t){return null==n||null==t?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function s(n,t){return null==n||null==t?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function h(n){let t,r,u;function a(n,u,a=0,e=n.length){if(a<e){if(0!==t(u,u))return e;do{const t=a+e>>>1;r(n[t],u)<0?a=t+1:e=t}while(a<e)}return a}return 2!==n.length?(t=l,r=(t,r)=>l(n(t),r),u=(t,r)=>n(t)-r):(t=n===l||n===s?n:M,r=n,u=n),{left:a,center:function(n,t,r=0,e=n.length){const f=a(n,t,r,e-1);return f>r&&u(n[f-1],t)>-u(n[f],t)?f-1:f},right:function(n,u,a=0,e=n.length){if(a<e){if(0!==t(u,u))return e;do{const t=a+e>>>1;r(n[t],u)<=0?a=t+1:e=t}while(a<e)}return a}}}function M(){return 0}const N=h(l).right;h(function(n){return null===n?NaN:+n}).center;const v=Math.sqrt(50),y=Math.sqrt(10),p=Math.sqrt(2);function w(n,t,r){const u=(t-n)/Math.max(0,r),a=Math.floor(Math.log10(u)),e=u/Math.pow(10,a),f=e>=v?10:e>=y?5:e>=p?2:1;let o,i,c;return a<0?(c=Math.pow(10,-a)/f,o=Math.round(n*c),i=Math.round(t*c),o/c<n&&++o,i/c>t&&--i,c=-c):(c=Math.pow(10,a)*f,o=Math.round(n/c),i=Math.round(t/c),o*c<n&&++o,i*c>t&&--i),i<o&&.5<=r&&r<2?w(n,t,2*r):[o,i,c]}function A(n,t,r){return w(n=+n,t=+t,r=+r)[2]}function b(n,t,r){r=+r;const u=(t=+t)<(n=+n),a=u?A(t,n,r):A(n,t,r);return(u?-1:1)*(a<0?1/-a:a)}function m(n,t){t||(t=[]);var r,u=n?Math.min(t.length,n.length):0,a=t.slice();return function(e){for(r=0;r<u;++r)a[r]=n[r]*(1-e)+t[r]*e;return a}}function j(n,t){var r,u=t?t.length:0,a=n?Math.min(u,n.length):0,e=new Array(a),f=new Array(u);for(r=0;r<a;++r)e[r]=k(n[r],t[r]);for(;r<u;++r)f[r]=t[r];return function(n){for(r=0;r<a;++r)f[r]=e[r](n);return f}}function d(n,t){var r=new Date;return n=+n,t=+t,function(u){return r.setTime(n*(1-u)+t*u),r}}function g(n,t){var r,u={},a={};for(r in null!==n&&"object"==typeof n||(n={}),null!==t&&"object"==typeof t||(t={}),t)r in n?u[r]=k(n[r],t[r]):a[r]=t[r];return function(n){for(r in u)a[r]=u[r](n);return a}}function k(e,f){var o,i,c=typeof f;return null==f||"boolean"===c?n(f):("number"===c?t:"string"===c?(o=r(f))?(f=o,u):a:f instanceof r?u:f instanceof Date?d:(i=f,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(f)?j:"function"!=typeof f.valueOf&&"function"!=typeof f.toString||isNaN(f)?g:t:m))(e,f)}function D(n,t){return n=+n,t=+t,function(r){return Math.round(n*(1-r)+t*r)}}function x(n){return+n}var L=[0,1];function B(n){return n}function K(n,t){return(t-=n=+n)?function(r){return(r-n)/t}:(r=isNaN(t)?NaN:.5,function(){return r});var r}function O(n,t,r){var u=n[0],a=n[1],e=t[0],f=t[1];return a<u?(u=K(a,u),e=r(f,e)):(u=K(u,a),e=r(e,f)),function(n){return e(u(n))}}function V(n,t,r){var u=Math.min(n.length,t.length)-1,a=new Array(u),e=new Array(u),f=-1;for(n[u]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++f<u;)a[f]=K(n[f],n[f+1]),e[f]=r(t[f],t[f+1]);return function(t){var r=N(n,t,1,u)-1;return e[r](a[r](t))}}function q(n,t){return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function z(){var n,r,u,a,e,f,o=L,i=L,c=k,l=B;function s(){var n,t,r,u=Math.min(o.length,i.length);return l!==B&&(n=o[0],t=o[u-1],n>t&&(r=n,n=t,t=r),l=function(r){return Math.max(n,Math.min(t,r))}),a=u>2?V:O,e=f=null,h}function h(t){return null==t||isNaN(t=+t)?u:(e||(e=a(o.map(n),i,c)))(n(l(t)))}return h.invert=function(u){return l(r((f||(f=a(i,o.map(n),t)))(u)))},h.domain=function(n){return arguments.length?(o=Array.from(n,x),s()):o.slice()},h.range=function(n){return arguments.length?(i=Array.from(n),s()):i.slice()},h.rangeRound=function(n){return i=Array.from(n),c=D,s()},h.clamp=function(n){return arguments.length?(l=!!n||B,s()):l!==B},h.interpolate=function(n){return arguments.length?(c=n,s()):c},h.unknown=function(n){return arguments.length?(u=n,h):u},function(t,u){return n=t,r=u,s()}}function C(){return z()(B,B)}function E(n,t,r,u){var a,e=b(n,t,r);switch((u=o(null==u?",f":u)).type){case"s":var l=Math.max(Math.abs(n),Math.abs(t));return null!=u.precision||isNaN(a=function(n,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(f(t)/3)))-f(Math.abs(n)))}(e,l))||(u.precision=a),i(u,l);case"":case"e":case"g":case"p":case"r":null!=u.precision||isNaN(a=function(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,f(t)-f(n))+1}(e,Math.max(Math.abs(n),Math.abs(t))))||(u.precision=a-("e"===u.type));break;case"f":case"%":null!=u.precision||isNaN(a=function(n){return Math.max(0,-f(Math.abs(n)))}(e))||(u.precision=a-2*("%"===u.type))}return c(u)}function F(n){var t=n.domain;return n.ticks=function(n){var r=t();return function(n,t,r){if(!((r=+r)>0))return[];if((n=+n)===(t=+t))return[n];const u=t<n,[a,e,f]=u?w(t,n,r):w(n,t,r);if(!(e>=a))return[];const o=e-a+1,i=new Array(o);if(u)if(f<0)for(let c=0;c<o;++c)i[c]=(e-c)/-f;else for(let c=0;c<o;++c)i[c]=(e-c)*f;else if(f<0)for(let c=0;c<o;++c)i[c]=(a+c)/-f;else for(let c=0;c<o;++c)i[c]=(a+c)*f;return i}(r[0],r[r.length-1],null==n?10:n)},n.tickFormat=function(n,r){var u=t();return E(u[0],u[u.length-1],null==n?10:n,r)},n.nice=function(r){null==r&&(r=10);var u,a,e=t(),f=0,o=e.length-1,i=e[f],c=e[o],l=10;for(c<i&&(a=i,i=c,c=a,a=f,f=o,o=a);l-- >0;){if((a=A(i,c,r))===u)return e[f]=i,e[o]=c,t(e);if(a>0)i=Math.floor(i/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;i=Math.ceil(i*a)/a,c=Math.floor(c*a)/a}u=a}return n},n}function G(){var n=C();return n.copy=function(){return q(n,G())},e.apply(n,arguments),F(n)}export{q as a,h as b,C as c,G as l,b as t};
@@ -1 +0,0 @@
1
- import{b as a,a as n,c as r,d as s,i as t}from"./_baseUniq-BDYH-qGs.js";import{aD as i,aE as o,aF as u}from"./index-C5d-CFGb.js";function f(n){return(null==n?0:n.length)?a(n):[]}function c(a,r){var s=-1,t=i(a)?Array(a.length):[];return n(a,function(a,n,i){t[++s]=r(a,n,i)}),t}function e(a,n){return(o(a)?s:c)(a,r(n))}function v(a,n){return a<n}function d(a,n,r){for(var s=-1,i=a.length;++s<i;){var o=a[s],u=n(o);if(null!=u&&(void 0===f?u==u&&!t(u):r(u,f)))var f=u,c=o}return c}function m(a){return a&&a.length?d(a,u,v):void 0}export{v as a,d as b,c,m as d,f,e as m};
@@ -1 +0,0 @@
1
- var t;import{g as e}from"./chunk-55IACEB6-BIADemBk.js";import{s as i}from"./chunk-QN33PNHL-BPPz_1GB.js";import{_ as s,l as n,o as r,r as o,E as h,c,i as a,aC as u,W as l,X as d,Y as f}from"./index-C5d-CFGb.js";const p=[];for(let O=0;O<256;++O)p.push((O+256).toString(16).slice(1));let m;const g=new Uint8Array(16);const E={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function N(t,e,i){var s;if(E.randomUUID&&!t)return E.randomUUID();const n=(t=t||{}).random??(null==(s=t.rng)?void 0:s.call(t))??function(){if(!m){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");m=crypto.getRandomValues.bind(crypto)}return m(g)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(t,e=0){return(p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]).toLowerCase()}(n)}var y=function(){var t=s(function(t,e,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=e);return i},"o"),e=[1,4],i=[1,13],n=[1,12],r=[1,15],o=[1,16],h=[1,20],c=[1,19],a=[6,7,8],u=[1,26],l=[1,24],d=[1,25],f=[6,7,11],p=[1,6,13,15,16,19,22],m=[1,33],g=[1,34],E=[1,6,7,11,13,15,16,19,22],N={trace:s(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:s(function(t,e,i,s,n,r,o){var h=r.length-1;switch(n){case 6:case 7:return s;case 8:s.getLogger().trace("Stop NL ");break;case 9:s.getLogger().trace("Stop EOF ");break;case 11:s.getLogger().trace("Stop NL2 ");break;case 12:s.getLogger().trace("Stop EOF2 ");break;case 15:s.getLogger().info("Node: ",r[h].id),s.addNode(r[h-1].length,r[h].id,r[h].descr,r[h].type);break;case 16:s.getLogger().trace("Icon: ",r[h]),s.decorateNode({icon:r[h]});break;case 17:case 21:s.decorateNode({class:r[h]});break;case 18:s.getLogger().trace("SPACELIST");break;case 19:s.getLogger().trace("Node: ",r[h].id),s.addNode(0,r[h].id,r[h].descr,r[h].type);break;case 20:s.decorateNode({icon:r[h]});break;case 25:s.getLogger().trace("node found ..",r[h-2]),this.$={id:r[h-1],descr:r[h-1],type:s.getType(r[h-2],r[h])};break;case 26:this.$={id:r[h],descr:r[h],type:s.nodeType.DEFAULT};break;case 27:s.getLogger().trace("node found ..",r[h-3]),this.$={id:r[h-3],descr:r[h-1],type:s.getType(r[h-2],r[h])}}},"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:i,7:[1,10],9:9,12:11,13:n,14:14,15:r,16:o,17:17,18:18,19:h,22:c},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:i,12:21,13:n,14:14,15:r,16:o,17:17,18:18,19:h,22:c},{6:i,9:22,12:11,13:n,14:14,15:r,16:o,17:17,18:18,19:h,22:c},{6:u,7:l,10:23,11:d},t(f,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:h,22:c}),t(f,[2,18]),t(f,[2,19]),t(f,[2,20]),t(f,[2,21]),t(f,[2,23]),t(f,[2,24]),t(f,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:l,10:32,11:d},{1:[2,7],6:i,12:21,13:n,14:14,15:r,16:o,17:17,18:18,19:h,22:c},t(p,[2,14],{7:m,11:g}),t(E,[2,8]),t(E,[2,9]),t(E,[2,10]),t(f,[2,15]),t(f,[2,16]),t(f,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:m,11:g}),t(E,[2,11]),t(E,[2,12]),{21:[1,37]},t(f,[2,25]),t(f,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:s(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:s(function(t){var e=this,i=[0],n=[],r=[null],o=[],h=this.table,c="",a=0,u=0,l=o.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(f.yy[p]=this.yy[p]);d.setInput(t,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var m=d.yylloc;o.push(m);var g=d.options&&d.options.ranges;function E(){var t;return"number"!=typeof(t=n.pop()||d.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),s(E,"lex");for(var N,y,S,b,v,D,_,k,I={};;){if(y=i[i.length-1],this.defaultActions[y]?S=this.defaultActions[y]:(null==N&&(N=E()),S=h[y]&&h[y][N]),void 0===S||!S.length||!S[0]){var O="";for(v in k=[],h[y])this.terminals_[v]&&v>2&&k.push("'"+this.terminals_[v]+"'");O=d.showPosition?"Parse error on line "+(a+1)+":\n"+d.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[N]||N)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==N?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(O,{text:d.match,token:this.terminals_[N]||N,line:d.yylineno,loc:m,expected:k})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+N);switch(S[0]){case 1:i.push(N),r.push(d.yytext),o.push(d.yylloc),i.push(S[1]),N=null,u=d.yyleng,c=d.yytext,a=d.yylineno,m=d.yylloc;break;case 2:if(D=this.productions_[S[1]][1],I.$=r[r.length-D],I._$={first_line:o[o.length-(D||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(D||1)].first_column,last_column:o[o.length-1].last_column},g&&(I._$.range=[o[o.length-(D||1)].range[0],o[o.length-1].range[1]]),void 0!==(b=this.performAction.apply(I,[c,u,a,f.yy,S[1],r,o].concat(l))))return b;D&&(i=i.slice(0,-1*D*2),r=r.slice(0,-1*D),o=o.slice(0,-1*D)),i.push(this.productions_[S[1]][0]),r.push(I.$),o.push(I._$),_=h[i[i.length-2]][i[i.length-1]],i.push(_);break;case 3:return!0}}return!0},"parse")},y=function(){return{EOF:1,parseError:s(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:s(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:s(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:s(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),i.length-1&&(this.yylineno-=i.length-1);var n=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:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:s(function(t){this.unput(this.match.slice(t))},"less"),pastInput:s(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:s(function(t,e){var i,s,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;var t,e,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var t=this.next();return t||this.lex()},"lex"),begin:s(function(t){this.conditionStack.push(t)},"begin"),popState:s(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:s(function(t){this.begin(t)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(t,e,i,s){switch(i){case 0:return t.getLogger().trace("Found comment",e.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:case 23:case 26:this.popState();break;case 5:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:case 15:case 16: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 24:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",e.yytext),"NODE_DEND";case 30:case 33:case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 35:case 36:return t.getLogger().trace("Long description:",e.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}}}}();function S(){this.yy={}}return N.lexer=y,s(S,"Parser"),S.prototype=N,N.Parser=S,new S}();y.parser=y;var S=y,b={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},v=(s(t=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=b,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(t){for(let e=this.nodes.length-1;e>=0;e--)if(this.nodes[e].level<t)return this.nodes[e];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(t,e,i,s){var r,o;n.info("addNode",t,e,i,s);let u=!1;0===this.nodes.length?(this.baseLevel=t,t=0,u=!0):void 0!==this.baseLevel&&(t-=this.baseLevel,u=!1);const l=c();let d=(null==(r=l.mindmap)?void 0:r.padding)??h.mindmap.padding;switch(s){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:d*=2}const f={id:this.count++,nodeId:a(e,l),level:t,descr:a(i,l),type:s,children:[],width:(null==(o=l.mindmap)?void 0:o.maxNodeWidth)??h.mindmap.maxNodeWidth,padding:d,isRoot:u},p=this.getParent(t);if(p)p.children.push(f),this.nodes.push(f);else{if(!u)throw new Error(`There can be only one root. No parent could be found for ("${f.descr}")`);this.nodes.push(f)}}getType(t,e){switch(n.debug("In get type",t,e),t){case"[":return this.nodeType.RECT;case"(":return")"===e?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(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}decorateNode(t){if(!t)return;const e=c(),i=this.nodes[this.nodes.length-1];t.icon&&(i.icon=a(t.icon,e)),t.class&&(i.class=a(t.class,e))}type2Str(t){switch(t){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(t,e){if(0===t.level?t.section=void 0:t.section=e,t.children)for(const[i,s]of t.children.entries()){const n=0===t.level?i:e;this.assignSections(s,n)}}flattenNodes(t,e){const i=["mindmap-node"];!0===t.isRoot?i.push("section-root","section--1"):void 0!==t.section&&i.push(`section-${t.section}`),t.class&&i.push(t.class);const n=i.join(" "),r=s(t=>{switch(t){case b.CIRCLE:return"mindmapCircle";case b.RECT:return"rect";case b.ROUNDED_RECT:return"rounded";case b.CLOUD:return"cloud";case b.BANG:return"bang";case b.HEXAGON:return"hexagon";case b.DEFAULT:return"defaultMindmapNode";default:return"rect"}},"getShapeFromType"),o={id:t.id.toString(),domId:"node_"+t.id.toString(),label:t.descr,isGroup:!1,shape:r(t.type),width:t.width,height:t.height??0,padding:t.padding,cssClasses:n,cssStyles:[],look:"default",icon:t.icon,x:t.x,y:t.y,level:t.level,nodeId:t.nodeId,type:t.type,section:t.section};if(e.push(o),t.children)for(const s of t.children)this.flattenNodes(s,e)}generateEdges(t,e){if(t.children)for(const i of t.children){let s="edge";void 0!==i.section&&(s+=` section-edge-${i.section}`);s+=` edge-depth-${t.level+1}`;const n={id:`edge_${t.id}_${i.id}`,start:t.id.toString(),end:i.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:"default",classes:s,depth:t.level,section:i.section};e.push(n),this.generateEdges(i,e)}}getData(){const t=this.getMindmap(),e=c(),i=e;if(void 0!==u().layout||(i.layout="cose-bilkent"),!t)return{nodes:[],edges:[],config:i};n.debug("getData: mindmapRoot",t,e),this.assignSections(t);const s=[],r=[];this.flattenNodes(t,s),this.generateEdges(t,r),n.debug(`getData: processed ${s.length} nodes and ${r.length} edges`);const o=new Map;for(const n of s)o.set(n.id,{shape:n.shape,width:n.width,height:n.height,padding:n.padding});return{nodes:s,edges:r,config:i,rootNode:t,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(o),type:"mindmap",diagramId:"mindmap-"+N()}}getLogger(){return n}},"MindmapDB"),t),D={draw:s(async(t,s,c,a)=>{var u,l;n.debug("Rendering mindmap diagram\n"+t);const d=a.db,f=d.getData(),p=e(s,f.config.securityLevel);f.type=a.type,f.layoutAlgorithm=r(f.config.layout,{fallback:"cose-bilkent"}),f.diagramId=s;d.getMindmap()&&(f.nodes.forEach(t=>{"rounded"===t.shape?(t.radius=15,t.taper=15,t.stroke="none",t.width=0,t.padding=15):"circle"===t.shape?t.padding=10:"rect"===t.shape&&(t.width=0,t.padding=10)}),await o(f,p),i(p,(null==(u=f.config.mindmap)?void 0:u.padding)??h.mindmap.padding,"mindmapDiagram",(null==(l=f.config.mindmap)?void 0:l.useMaxWidth)??h.mindmap.useMaxWidth))},"draw")},_=s(t=>{let e="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],l(t["lineColor"+i])?t["lineColor"+i]=d(t["lineColor"+i],20):t["lineColor"+i]=f(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){const s=""+(17-3*i);e+=`\n .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} polygon, .section-${i-1} path {\n fill: ${t["cScale"+i]};\n }\n .section-${i-1} text {\n fill: ${t["cScaleLabel"+i]};\n }\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+i]};\n }\n .section-edge-${i-1}{\n stroke: ${t["cScale"+i]};\n }\n .edge-depth-${i-1}{\n stroke-width: ${s};\n }\n .section-${i-1} line {\n stroke: ${t["cScaleInv"+i]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e},"genSections"),k=s(t=>`\n .edge {\n stroke-width: 3;\n }\n ${_(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .section-root span {\n color: ${t.gitBranchLabel0};\n }\n .section-2 span {\n color: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`,"getStyles"),I={get db(){return new v},renderer:D,parser:S,styles:k};export{I as diagram};
@@ -1 +0,0 @@
1
- import{ab as t,a3 as e,aB as n,g as a,s as r,a as i,b as s,q as l,p as o,_ as c,l as u,c as f,D as p,H as d,N as h,e as m,y as g,E as w}from"./index-C5d-CFGb.js";import{p as $}from"./chunk-4BX2VUAB-CjAiz39p.js";import{p as y}from"./treemap-KMMF4GRG-CS9j6H9_.js";import{d as x}from"./arc-BgRuELYn.js";import{o as v}from"./ordinal-2upbOM02.js";import"./min-Cvpawy_w.js";import"./_baseUniq-BDYH-qGs.js";import"./init-C9Lo50Hz.js";function A(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function b(t){return t}var D=w.pie,S={sections:new Map,showData:!1},M=S.sections,j=S.showData,C=structuredClone(D),T={getConfig:c(()=>structuredClone(C),"getConfig"),clear:c(()=>{M=new Map,j=S.showData,g()},"clear"),setDiagramTitle:o,getDiagramTitle:l,setAccTitle:s,getAccTitle:i,setAccDescription:r,getAccDescription:a,addSection:c(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);M.has(t)||(M.set(t,e),u.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),getSections:c(()=>M,"getSections"),setShowData:c(t=>{j=t},"setShowData"),getShowData:c(()=>j,"getShowData")},k=c((t,e)=>{$(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),B={parse:c(async t=>{const e=await y("pie",t);u.debug(e),k(e,T)},"parse")},N=c(t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`,"getStyles"),z=c(a=>{const r=[...a.values()].reduce((t,e)=>t+e,0),i=[...a.entries()].map(([t,e])=>({label:t,value:e})).filter(t=>t.value/r*100>=1).sort((t,e)=>e.value-t.value),s=function(){var a=b,r=A,i=null,s=t(0),l=t(e),o=t(0);function c(t){var c,u,f,p,d,h=(t=n(t)).length,m=0,g=new Array(h),w=new Array(h),$=+s.apply(this,arguments),y=Math.min(e,Math.max(-e,l.apply(this,arguments)-$)),x=Math.min(Math.abs(y)/h,o.apply(this,arguments)),v=x*(y<0?-1:1);for(c=0;c<h;++c)(d=w[g[c]=c]=+a(t[c],c,t))>0&&(m+=d);for(null!=r?g.sort(function(t,e){return r(w[t],w[e])}):null!=i&&g.sort(function(e,n){return i(t[e],t[n])}),c=0,f=m?(y-h*v)/m:0;c<h;++c,$=p)u=g[c],p=$+((d=w[u])>0?d*f:0)+v,w[u]={data:t[u],index:c,value:d,startAngle:$,endAngle:p,padAngle:x};return w}return c.value=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),c):a},c.sortValues=function(t){return arguments.length?(r=t,i=null,c):r},c.sort=function(t){return arguments.length?(i=t,r=null,c):i},c.startAngle=function(e){return arguments.length?(s="function"==typeof e?e:t(+e),c):s},c.endAngle=function(e){return arguments.length?(l="function"==typeof e?e:t(+e),c):l},c.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),c):o},c}().value(t=>t.value);return s(i)},"createPieArcs"),E={parser:B,db:T,renderer:{draw:c((t,e,n,a)=>{u.debug("rendering pie chart\n"+t);const r=a.db,i=f(),s=p(r.getConfig(),i.pie),l=18,o=450,c=o,g=d(e),w=g.append("g");w.attr("transform","translate(225,225)");const{themeVariables:$}=i;let[y]=h($.pieOuterStrokeWidth);y??(y=2);const A=s.textPosition,b=Math.min(c,o)/2-40,D=x().innerRadius(0).outerRadius(b),S=x().innerRadius(b*A).outerRadius(b*A);w.append("circle").attr("cx",0).attr("cy",0).attr("r",b+y/2).attr("class","pieOuterCircle");const M=r.getSections(),j=z(M),C=[$.pie1,$.pie2,$.pie3,$.pie4,$.pie5,$.pie6,$.pie7,$.pie8,$.pie9,$.pie10,$.pie11,$.pie12];let T=0;M.forEach(t=>{T+=t});const k=j.filter(t=>"0"!==(t.data.value/T*100).toFixed(0)),B=v(C);w.selectAll("mySlices").data(k).enter().append("path").attr("d",D).attr("fill",t=>B(t.data.label)).attr("class","pieCircle"),w.selectAll("mySlices").data(k).enter().append("text").text(t=>(t.data.value/T*100).toFixed(0)+"%").attr("transform",t=>"translate("+S.centroid(t)+")").style("text-anchor","middle").attr("class","slice"),w.append("text").text(r.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const N=[...M.entries()].map(([t,e])=>({label:t,value:e})),E=w.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(t,e)=>"translate(216,"+(22*e-22*N.length/2)+")");E.append("rect").attr("width",l).attr("height",l).style("fill",t=>B(t.label)).style("stroke",t=>B(t.label)),E.append("text").attr("x",22).attr("y",14).text(t=>r.getShowData()?`${t.label} [${t.value}]`:t.label);const q=512+Math.max(...E.selectAll("text").nodes().map(t=>(null==t?void 0:t.getBoundingClientRect().width)??0));g.attr("viewBox",`0 0 ${q} 450`),m(g,o,q,s.useMaxWidth)},"draw")},styles:N};export{E as diagram};
@@ -1 +0,0 @@
1
- var t,i;import{s as e,g as s,q as a,p as n,a as r,b as h,_ as o,c as l,l as c,d as u,e as d,y as x,E as f,i as p,K as T}from"./index-C5d-CFGb.js";import{l as _}from"./linear-4xiWbSPB.js";import"./init-C9Lo50Hz.js";import"./defaultLocale-DK_abR1s.js";var v=function(){var t=o(function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e},"o"),i=[1,3],e=[1,4],s=[1,5],a=[1,6],n=[1,7],r=[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],h=[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],l=[55,56,57],c=[2,36],u=[1,37],d=[1,36],x=[1,38],f=[1,35],p=[1,43],T=[1,41],_=[1,14],v=[1,23],g=[1,18],A=[1,19],m=[1,20],q=[1,21],y=[1,22],S=[1,24],k=[1,25],b=[1,26],P=[1,27],E=[1,28],F=[1,29],D=[1,32],I=[1,33],w=[1,34],L=[1,39],N=[1,40],z=[1,42],R=[1,44],U=[1,62],C=[1,61],O=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Q=[1,65],W=[1,66],H=[1,67],M=[1,68],X=[1,69],B=[1,70],$=[1,71],Y=[1,72],j=[1,73],K=[1,74],G=[1,75],V=[1,76],Z=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],tt=[1,91],it=[1,92],et=[1,99],st=[1,93],at=[1,96],nt=[1,94],rt=[1,95],ht=[1,97],ot=[1,98],lt=[1,102],ct=[10,55,56,57],ut=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],dt={trace:o(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:o(function(t,i,e,s,a,n,r){var h=n.length-1;switch(a){case 23:case 68:this.$=n[h];break;case 24:case 69:this.$=n[h-1]+""+n[h];break;case 26:this.$=n[h-1]+n[h];break;case 27:this.$=[n[h].trim()];break;case 28:n[h-2].push(n[h].trim()),this.$=n[h-2];break;case 29:this.$=n[h-4],s.addClass(n[h-2],n[h]);break;case 37:this.$=[];break;case 42:this.$=n[h].trim(),s.setDiagramTitle(this.$);break;case 43:this.$=n[h].trim(),s.setAccTitle(this.$);break;case 44:case 45:this.$=n[h].trim(),s.setAccDescription(this.$);break;case 46:s.addSection(n[h].substr(8)),this.$=n[h].substr(8);break;case 47:s.addPoint(n[h-3],"",n[h-1],n[h],[]);break;case 48:s.addPoint(n[h-4],n[h-3],n[h-1],n[h],[]);break;case 49:s.addPoint(n[h-4],"",n[h-2],n[h-1],n[h]);break;case 50:s.addPoint(n[h-5],n[h-4],n[h-2],n[h-1],n[h]);break;case 51:s.setXAxisLeftText(n[h-2]),s.setXAxisRightText(n[h]);break;case 52:n[h-1].text+=" ⟶ ",s.setXAxisLeftText(n[h-1]);break;case 53:s.setXAxisLeftText(n[h]);break;case 54:s.setYAxisBottomText(n[h-2]),s.setYAxisTopText(n[h]);break;case 55:n[h-1].text+=" ⟶ ",s.setYAxisBottomText(n[h-1]);break;case 56:s.setYAxisBottomText(n[h]);break;case 57:s.setQuadrant1Text(n[h]);break;case 58:s.setQuadrant2Text(n[h]);break;case 59:s.setQuadrant3Text(n[h]);break;case 60:s.setQuadrant4Text(n[h]);break;case 64:case 66:this.$={text:n[h],type:"text"};break;case 65:this.$={text:n[h-1].text+""+n[h],type:n[h-1].type};break;case 67:this.$={text:n[h],type:"markdown"}}},"anonymous"),table:[{18:i,26:1,27:2,28:e,55:s,56:a,57:n},{1:[3]},{18:i,26:8,27:2,28:e,55:s,56:a,57:n},{18:i,26:9,27:2,28:e,55:s,56:a,57:n},t(r,[2,33],{29:10}),t(h,[2,61]),t(h,[2,62]),t(h,[2,63]),{1:[2,30]},{1:[2,31]},t(l,c,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:d,10:x,12:f,13:p,14:T,18:_,25:v,35:g,37:A,39:m,41:q,42:y,48:S,50:k,51:b,52:P,53:E,54:F,60:D,61:I,63:w,64:L,65:N,66:z,67:R}),t(r,[2,34]),{27:45,55:s,56:a,57:n},t(l,[2,37]),t(l,c,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:d,10:x,12:f,13:p,14:T,18:_,25:v,35:g,37:A,39:m,41:q,42:y,48:S,50:k,51:b,52:P,53:E,54:F,60:D,61:I,63:w,64:L,65:N,66:z,67:R}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(l,[2,45]),t(l,[2,46]),{18:[1,50]},{4:u,5:d,10:x,12:f,13:p,14:T,43:51,58:31,60:D,61:I,63:w,64:L,65:N,66:z,67:R},{4:u,5:d,10:x,12:f,13:p,14:T,43:52,58:31,60:D,61:I,63:w,64:L,65:N,66:z,67:R},{4:u,5:d,10:x,12:f,13:p,14:T,43:53,58:31,60:D,61:I,63:w,64:L,65:N,66:z,67:R},{4:u,5:d,10:x,12:f,13:p,14:T,43:54,58:31,60:D,61:I,63:w,64:L,65:N,66:z,67:R},{4:u,5:d,10:x,12:f,13:p,14:T,43:55,58:31,60:D,61:I,63:w,64:L,65:N,66:z,67:R},{4:u,5:d,10:x,12:f,13:p,14:T,43:56,58:31,60:D,61:I,63:w,64:L,65:N,66:z,67:R},{4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,44:[1,57],47:[1,58],58:60,59:59,63:w,64:L,65:N,66:z,67:R},t(O,[2,64]),t(O,[2,66]),t(O,[2,67]),t(O,[2,70]),t(O,[2,71]),t(O,[2,72]),t(O,[2,73]),t(O,[2,74]),t(O,[2,75]),t(O,[2,76]),t(O,[2,77]),t(O,[2,78]),t(O,[2,79]),t(O,[2,80]),t(r,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:64,4:Q,5:W,6:H,7:M,8:X,9:B,10:$,11:Y,12:j,13:K,14:G,15:V,21:63},t(l,[2,53],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,49:[1,77],63:w,64:L,65:N,66:z,67:R}),t(l,[2,56],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,49:[1,78],63:w,64:L,65:N,66:z,67:R}),t(l,[2,57],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,63:w,64:L,65:N,66:z,67:R}),t(l,[2,58],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,63:w,64:L,65:N,66:z,67:R}),t(l,[2,59],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,63:w,64:L,65:N,66:z,67:R}),t(l,[2,60],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,63:w,64:L,65:N,66:z,67:R}),{45:[1,79]},{44:[1,80]},t(O,[2,65]),t(O,[2,81]),t(O,[2,82]),t(O,[2,83]),{3:82,4:Q,5:W,6:H,7:M,8:X,9:B,10:$,11:Y,12:j,13:K,14:G,15:V,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(l,[2,52],{58:31,43:83,4:u,5:d,10:x,12:f,13:p,14:T,60:D,61:I,63:w,64:L,65:N,66:z,67:R}),t(l,[2,55],{58:31,43:84,4:u,5:d,10:x,12:f,13:p,14:T,60:D,61:I,63:w,64:L,65:N,66:z,67:R}),{46:[1,85]},{45:[1,86]},{4:J,5:tt,6:it,8:et,11:st,13:at,16:89,17:nt,18:rt,19:ht,20:ot,22:88,23:87},t(Z,[2,24]),t(l,[2,51],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,63:w,64:L,65:N,66:z,67:R}),t(l,[2,54],{59:59,58:60,4:u,5:d,8:U,10:x,12:f,13:p,14:T,18:C,63:w,64:L,65:N,66:z,67:R}),t(l,[2,47],{22:88,16:89,23:100,4:J,5:tt,6:it,8:et,11:st,13:at,17:nt,18:rt,19:ht,20:ot}),{46:[1,101]},t(l,[2,29],{10:lt}),t(ct,[2,27],{16:103,4:J,5:tt,6:it,8:et,11:st,13:at,17:nt,18:rt,19:ht,20:ot}),t(ut,[2,25]),t(ut,[2,13]),t(ut,[2,14]),t(ut,[2,15]),t(ut,[2,16]),t(ut,[2,17]),t(ut,[2,18]),t(ut,[2,19]),t(ut,[2,20]),t(ut,[2,21]),t(ut,[2,22]),t(l,[2,49],{10:lt}),t(l,[2,48],{22:88,16:89,23:104,4:J,5:tt,6:it,8:et,11:st,13:at,17:nt,18:rt,19:ht,20:ot}),{4:J,5:tt,6:it,8:et,11:st,13:at,16:89,17:nt,18:rt,19:ht,20:ot,22:105},t(ut,[2,26]),t(l,[2,50],{10:lt}),t(ct,[2,28],{16:103,4:J,5:tt,6:it,8:et,11:st,13:at,17:nt,18:rt,19:ht,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)},"parseError"),parse:o(function(t){var i=this,e=[0],s=[],a=[null],n=[],r=this.table,h="",l=0,c=0,u=n.slice.call(arguments,1),d=Object.create(this.lexer),x={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(x.yy[f]=this.yy[f]);d.setInput(t,x.yy),x.yy.lexer=d,x.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var p=d.yylloc;n.push(p);var T=d.options&&d.options.ranges;function _(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof x.yy.parseError?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),o(_,"lex");for(var v,g,A,m,q,y,S,k,b={};;){if(g=e[e.length-1],this.defaultActions[g]?A=this.defaultActions[g]:(null==v&&(v=_()),A=r[g]&&r[g][v]),void 0===A||!A.length||!A[0]){var P="";for(q in k=[],r[g])this.terminals_[q]&&q>2&&k.push("'"+this.terminals_[q]+"'");P=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==v?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(P,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:p,expected:k})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+v);switch(A[0]){case 1:e.push(v),a.push(d.yytext),n.push(d.yylloc),e.push(A[1]),v=null,c=d.yyleng,h=d.yytext,l=d.yylineno,p=d.yylloc;break;case 2:if(y=this.productions_[A[1]][1],b.$=a[a.length-y],b._$={first_line:n[n.length-(y||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(y||1)].first_column,last_column:n[n.length-1].last_column},T&&(b._$.range=[n[n.length-(y||1)].range[0],n[n.length-1].range[1]]),void 0!==(m=this.performAction.apply(b,[h,c,l,x.yy,A[1],a,n].concat(u))))return m;y&&(e=e.slice(0,-1*y*2),a=a.slice(0,-1*y),n=n.slice(0,-1*y)),e.push(this.productions_[A[1]][0]),a.push(b.$),n.push(b._$),S=r[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0},"parse")},xt=function(){return{EOF:1,parseError:o(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:o(function(t,i){return this.yy=i||this.yy||{},this._input=t,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:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=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),e.length-1&&(this.yylineno-=e.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:o(function(t,i){var e,s,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,i,e,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if((e=this._input.match(this.rules[a[n]]))&&(!i||e[0].length>i[0].length)){if(i=e,s=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,a[n])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,a[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,i,e,s){switch(e){case 0:case 1:case 3:break;case 2:return 55;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:case 23:case 25:case 31: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 24:this.begin("string");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 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: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}}}}();function ft(){this.yy={}}return dt.lexer=xt,o(ft,"Parser"),ft.prototype=dt,dt.Parser=ft,new ft}();v.parser=v;var g=v,A=T(),m=(o(t=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 t,i,e,s,a,n,r,h,o,l,c,u,d,x,p,T,_,v;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:(null==(t=f.quadrantChart)?void 0:t.chartWidth)||500,chartWidth:(null==(i=f.quadrantChart)?void 0:i.chartHeight)||500,titlePadding:(null==(e=f.quadrantChart)?void 0:e.titlePadding)||10,titleFontSize:(null==(s=f.quadrantChart)?void 0:s.titleFontSize)||20,quadrantPadding:(null==(a=f.quadrantChart)?void 0:a.quadrantPadding)||5,xAxisLabelPadding:(null==(n=f.quadrantChart)?void 0:n.xAxisLabelPadding)||5,yAxisLabelPadding:(null==(r=f.quadrantChart)?void 0:r.yAxisLabelPadding)||5,xAxisLabelFontSize:(null==(h=f.quadrantChart)?void 0:h.xAxisLabelFontSize)||16,yAxisLabelFontSize:(null==(o=f.quadrantChart)?void 0:o.yAxisLabelFontSize)||16,quadrantLabelFontSize:(null==(l=f.quadrantChart)?void 0:l.quadrantLabelFontSize)||16,quadrantTextTopPadding:(null==(c=f.quadrantChart)?void 0:c.quadrantTextTopPadding)||5,pointTextPadding:(null==(u=f.quadrantChart)?void 0:u.pointTextPadding)||5,pointLabelFontSize:(null==(d=f.quadrantChart)?void 0:d.pointLabelFontSize)||12,pointRadius:(null==(x=f.quadrantChart)?void 0:x.pointRadius)||5,xAxisPosition:(null==(p=f.quadrantChart)?void 0:p.xAxisPosition)||"top",yAxisPosition:(null==(T=f.quadrantChart)?void 0:T.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:(null==(_=f.quadrantChart)?void 0:_.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:(null==(v=f.quadrantChart)?void 0:v.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:A.quadrant1Fill,quadrant2Fill:A.quadrant2Fill,quadrant3Fill:A.quadrant3Fill,quadrant4Fill:A.quadrant4Fill,quadrant1TextFill:A.quadrant1TextFill,quadrant2TextFill:A.quadrant2TextFill,quadrant3TextFill:A.quadrant3TextFill,quadrant4TextFill:A.quadrant4TextFill,quadrantPointFill:A.quadrantPointFill,quadrantPointTextFill:A.quadrantPointTextFill,quadrantXAxisTextFill:A.quadrantXAxisTextFill,quadrantYAxisTextFill:A.quadrantYAxisTextFill,quadrantTitleFill:A.quadrantTitleFill,quadrantInternalBorderStrokeFill:A.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:A.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,c.info("clear called")}setData(t){this.data={...this.data,...t}}addPoints(t){this.data.points=[...t,...this.data.points]}addClass(t,i){this.classes.set(t,i)}setConfig(t){c.trace("setConfig called with: ",t),this.config={...this.config,...t}}setThemeConfig(t){c.trace("setThemeConfig called with: ",t),this.themeConfig={...this.themeConfig,...t}}calculateSpace(t,i,e,s){const a=2*this.config.xAxisLabelPadding+this.config.xAxisLabelFontSize,n={top:"top"===t&&i?a:0,bottom:"bottom"===t&&i?a:0},r=2*this.config.yAxisLabelPadding+this.config.yAxisLabelFontSize,h={left:"left"===this.config.yAxisPosition&&e?r:0,right:"right"===this.config.yAxisPosition&&e?r:0},o=this.config.titleFontSize+2*this.config.titlePadding,l={top:s?o:0},c=this.config.quadrantPadding+h.left,u=this.config.quadrantPadding+n.top+l.top,d=this.config.chartWidth-2*this.config.quadrantPadding-h.left-h.right,x=this.config.chartHeight-2*this.config.quadrantPadding-n.top-n.bottom-l.top;return{xAxisSpace:n,yAxisSpace:h,titleSpace:l,quadrantSpace:{quadrantLeft:c,quadrantTop:u,quadrantWidth:d,quadrantHalfWidth:d/2,quadrantHeight:x,quadrantHalfHeight:x/2}}}getAxisLabels(t,i,e,s){const{quadrantSpace:a,titleSpace:n}=s,{quadrantHalfHeight:r,quadrantHeight:h,quadrantLeft:o,quadrantHalfWidth:l,quadrantTop:c,quadrantWidth:u}=a,d=Boolean(this.data.xAxisRightText),x=Boolean(this.data.yAxisTopText),f=[];return this.data.xAxisLeftText&&i&&f.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:o+(d?l/2:0),y:"top"===t?this.config.xAxisLabelPadding+n.top:this.config.xAxisLabelPadding+c+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&i&&f.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:o+l+(d?l/2:0),y:"top"===t?this.config.xAxisLabelPadding+n.top:this.config.xAxisLabelPadding+c+h+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:d?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&e&&f.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+o+u+this.config.quadrantPadding,y:c+h-(x?r/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&e&&f.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:"left"===this.config.yAxisPosition?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+o+u+this.config.quadrantPadding,y:c+r-(x?r/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:x?"center":"left",horizontalPos:"top",rotation:-90}),f}getQuadrants(t){const{quadrantSpace:i}=t,{quadrantHalfHeight:e,quadrantLeft:s,quadrantHalfWidth:a,quadrantTop:n}=i,r=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:s+a,y:n,width:a,height:e,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:s,y:n,width:a,height:e,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:s,y:n+e,width:a,height:e,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:s+a,y:n+e,width:a,height:e,fill:this.themeConfig.quadrant4Fill}];for(const h of r)h.text.x=h.x+h.width/2,0===this.data.points.length?(h.text.y=h.y+h.height/2,h.text.horizontalPos="middle"):(h.text.y=h.y+this.config.quadrantTextTopPadding,h.text.horizontalPos="top");return r}getQuadrantPoints(t){const{quadrantSpace:i}=t,{quadrantHeight:e,quadrantLeft:s,quadrantTop:a,quadrantWidth:n}=i,r=_().domain([0,1]).range([s,n+s]),h=_().domain([0,1]).range([e+a,a]);return this.data.points.map(t=>{const i=this.classes.get(t.className);i&&(t={...i,...t});return{x:r(t.x),y:h(t.y),fill:t.color??this.themeConfig.quadrantPointFill,radius:t.radius??this.config.pointRadius,text:{text:t.text,fill:this.themeConfig.quadrantPointTextFill,x:r(t.x),y:h(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(t){const i=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:e}=t,{quadrantHalfHeight:s,quadrantHeight:a,quadrantLeft:n,quadrantHalfWidth:r,quadrantTop:h,quadrantWidth:o}=e;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n-i,y1:h,x2:n+o+i,y2:h},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n+o,y1:h+i,x2:n+o,y2:h+a-i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n-i,y1:h+a,x2:n+o+i,y2:h+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:n,y1:h+i,x2:n,y2:h+a-i},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:n+r,y1:h+i,x2:n+r,y2:h+a-i},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:n+i,y1:h+s,x2:n+o-i,y2:h+s}]}getTitle(t){if(t)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(){const t=this.config.showXAxis&&!(!this.data.xAxisLeftText&&!this.data.xAxisRightText),i=this.config.showYAxis&&!(!this.data.yAxisTopText&&!this.data.yAxisBottomText),e=this.config.showTitle&&!!this.data.titleText,s=this.data.points.length>0?"bottom":this.config.xAxisPosition,a=this.calculateSpace(s,t,i,e);return{points:this.getQuadrantPoints(a),quadrants:this.getQuadrants(a),axisLabels:this.getAxisLabels(s,t,i,a),borderLines:this.getBorders(a),title:this.getTitle(e)}}},"QuadrantBuilder"),t),q=(i=class extends Error{constructor(t,i,e){super(`value for ${t} ${i} is invalid, please use a valid ${e}`),this.name="InvalidStyleError"}},o(i,"InvalidStyleError"),i);function y(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}function S(t){return!/^\d+$/.test(t)}function k(t){return!/^\d+px$/.test(t)}o(y,"validateHexCode"),o(S,"validateNumber"),o(k,"validateSizeInPixels");var b=l();function P(t){return p(t.trim(),b)}o(P,"textSanitizer");var E=new m;function F(t){E.setData({quadrant1Text:P(t.text)})}function D(t){E.setData({quadrant2Text:P(t.text)})}function I(t){E.setData({quadrant3Text:P(t.text)})}function w(t){E.setData({quadrant4Text:P(t.text)})}function L(t){E.setData({xAxisLeftText:P(t.text)})}function N(t){E.setData({xAxisRightText:P(t.text)})}function z(t){E.setData({yAxisTopText:P(t.text)})}function R(t){E.setData({yAxisBottomText:P(t.text)})}function U(t){const i={};for(const e of t){const[t,s]=e.trim().split(/\s*:\s*/);if("radius"===t){if(S(s))throw new q(t,s,"number");i.radius=parseInt(s)}else if("color"===t){if(y(s))throw new q(t,s,"hex code");i.color=s}else if("stroke-color"===t){if(y(s))throw new q(t,s,"hex code");i.strokeColor=s}else{if("stroke-width"!==t)throw new Error(`style named ${t} is not supported.`);if(k(s))throw new q(t,s,"number of pixels (eg. 10px)");i.strokeWidth=s}}return i}function C(t,i,e,s,a){const n=U(a);E.addPoints([{x:e,y:s,text:P(t.text),className:i,...n}])}function O(t,i){E.addClass(t,U(i))}function Q(t){E.setConfig({chartWidth:t})}function W(t){E.setConfig({chartHeight:t})}function H(){const t=l(),{themeVariables:i,quadrantChart:e}=t;return e&&E.setConfig(e),E.setThemeConfig({quadrant1Fill:i.quadrant1Fill,quadrant2Fill:i.quadrant2Fill,quadrant3Fill:i.quadrant3Fill,quadrant4Fill:i.quadrant4Fill,quadrant1TextFill:i.quadrant1TextFill,quadrant2TextFill:i.quadrant2TextFill,quadrant3TextFill:i.quadrant3TextFill,quadrant4TextFill:i.quadrant4TextFill,quadrantPointFill:i.quadrantPointFill,quadrantPointTextFill:i.quadrantPointTextFill,quadrantXAxisTextFill:i.quadrantXAxisTextFill,quadrantYAxisTextFill:i.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:i.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:i.quadrantInternalBorderStrokeFill,quadrantTitleFill:i.quadrantTitleFill}),E.setData({titleText:a()}),E.build()}o(F,"setQuadrant1Text"),o(D,"setQuadrant2Text"),o(I,"setQuadrant3Text"),o(w,"setQuadrant4Text"),o(L,"setXAxisLeftText"),o(N,"setXAxisRightText"),o(z,"setYAxisTopText"),o(R,"setYAxisBottomText"),o(U,"parseStyles"),o(C,"addPoint"),o(O,"addClass"),o(Q,"setWidth"),o(W,"setHeight"),o(H,"getQuadrantData");var M={parser:g,db:{setWidth:Q,setHeight:W,setQuadrant1Text:F,setQuadrant2Text:D,setQuadrant3Text:I,setQuadrant4Text:w,setXAxisLeftText:L,setXAxisRightText:N,setYAxisTopText:z,setYAxisBottomText:R,parseStyles:U,addPoint:C,addClass:O,getQuadrantData:H,clear:o(function(){E.clear(),x()},"clear"),setAccTitle:h,getAccTitle:r,setDiagramTitle:n,getDiagramTitle:a,getAccDescription:s,setAccDescription:e},renderer:{draw:o((t,i,e,s)=>{var a,n,r;function h(t){return"top"===t?"hanging":"middle"}function x(t){return"left"===t?"start":"middle"}function f(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}o(h,"getDominantBaseLine"),o(x,"getTextAnchor"),o(f,"getTransformation");const p=l();c.debug("Rendering quadrant chart\n"+t);const T=p.securityLevel;let _;"sandbox"===T&&(_=u("#i"+i));const v=u("sandbox"===T?_.nodes()[0].contentDocument.body:"body").select(`[id="${i}"]`),g=v.append("g").attr("class","main"),A=(null==(a=p.quadrantChart)?void 0:a.chartWidth)??500,m=(null==(n=p.quadrantChart)?void 0:n.chartHeight)??500;d(v,m,A,(null==(r=p.quadrantChart)?void 0:r.useMaxWidth)??!0),v.attr("viewBox","0 0 "+A+" "+m),s.db.setHeight(m),s.db.setWidth(A);const q=s.db.getQuadrantData(),y=g.append("g").attr("class","quadrants"),S=g.append("g").attr("class","border"),k=g.append("g").attr("class","data-points"),b=g.append("g").attr("class","labels"),P=g.append("g").attr("class","title");q.title&&P.append("text").attr("x",0).attr("y",0).attr("fill",q.title.fill).attr("font-size",q.title.fontSize).attr("dominant-baseline",h(q.title.horizontalPos)).attr("text-anchor",x(q.title.verticalPos)).attr("transform",f(q.title)).text(q.title.text),q.borderLines&&S.selectAll("line").data(q.borderLines).enter().append("line").attr("x1",t=>t.x1).attr("y1",t=>t.y1).attr("x2",t=>t.x2).attr("y2",t=>t.y2).style("stroke",t=>t.strokeFill).style("stroke-width",t=>t.strokeWidth);const E=y.selectAll("g.quadrant").data(q.quadrants).enter().append("g").attr("class","quadrant");E.append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill),E.append("text").attr("x",0).attr("y",0).attr("fill",t=>t.text.fill).attr("font-size",t=>t.text.fontSize).attr("dominant-baseline",t=>h(t.text.horizontalPos)).attr("text-anchor",t=>x(t.text.verticalPos)).attr("transform",t=>f(t.text)).text(t=>t.text.text);b.selectAll("g.label").data(q.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(t=>t.text).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>h(t.horizontalPos)).attr("text-anchor",t=>x(t.verticalPos)).attr("transform",t=>f(t));const F=k.selectAll("g.data-point").data(q.points).enter().append("g").attr("class","data-point");F.append("circle").attr("cx",t=>t.x).attr("cy",t=>t.y).attr("r",t=>t.radius).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeColor).attr("stroke-width",t=>t.strokeWidth),F.append("text").attr("x",0).attr("y",0).text(t=>t.text.text).attr("fill",t=>t.text.fill).attr("font-size",t=>t.text.fontSize).attr("dominant-baseline",t=>h(t.text.horizontalPos)).attr("text-anchor",t=>x(t.text.verticalPos)).attr("transform",t=>f(t.text))},"draw")},styles:o(()=>"","styles")};export{M as diagram};
@@ -1 +0,0 @@
1
- var t;import{g as e}from"./chunk-55IACEB6-BIADemBk.js";import{s}from"./chunk-QN33PNHL-BPPz_1GB.js";import{_ as i,b as r,a as n,s as a,g as h,p as c,q as o,c as u,l,y as E,B as f,o as R,r as I,u as _}from"./index-C5d-CFGb.js";var S=function(){var t=i(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,3],s=[1,4],r=[1,5],n=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],h=[1,22],c=[2,7],o=[1,26],u=[1,27],l=[1,28],E=[1,29],f=[1,33],R=[1,34],I=[1,35],_=[1,36],S=[1,37],d=[1,38],b=[1,24],m=[1,31],T=[1,32],N=[1,30],k=[1,39],p=[1,40],v=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],y=[1,61],A=[89,90],L=[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],C=[27,29],O=[1,70],g=[1,71],M=[1,72],q=[1,73],w=[1,74],D=[1,75],F=[1,76],P=[1,83],x=[1,80],U=[1,84],Y=[1,85],$=[1,86],V=[1,87],B=[1,88],Q=[1,89],H=[1,90],K=[1,91],j=[1,92],W=[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],G=[63,64],z=[1,101],X=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],J=[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],Z=[1,110],tt=[1,106],et=[1,107],st=[1,108],it=[1,109],rt=[1,111],nt=[1,116],at=[1,117],ht=[1,114],ct=[1,115],ot={trace:i(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:i(function(t,e,s,i,r,n,a){var h=n.length-1;switch(r){case 4:this.$=n[h].trim(),i.setAccTitle(this.$);break;case 5:case 6:this.$=n[h].trim(),i.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:i.setDirection("TB");break;case 18:i.setDirection("BT");break;case 19:i.setDirection("RL");break;case 20:i.setDirection("LR");break;case 21:i.addRequirement(n[h-3],n[h-4]);break;case 22:i.addRequirement(n[h-5],n[h-6]),i.setClass([n[h-5]],n[h-3]);break;case 23:i.setNewReqId(n[h-2]);break;case 24:i.setNewReqText(n[h-2]);break;case 25:i.setNewReqRisk(n[h-2]);break;case 26:i.setNewReqVerifyMethod(n[h-2]);break;case 29:this.$=i.RequirementType.REQUIREMENT;break;case 30:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=i.RiskLevel.LOW_RISK;break;case 36:this.$=i.RiskLevel.MED_RISK;break;case 37:this.$=i.RiskLevel.HIGH_RISK;break;case 38:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=i.VerifyType.VERIFY_TEST;break;case 42:i.addElement(n[h-3]);break;case 43:i.addElement(n[h-5]),i.setClass([n[h-5]],n[h-3]);break;case 44:i.setNewElementType(n[h-2]);break;case 45:i.setNewElementDocRef(n[h-2]);break;case 48:i.addRelationship(n[h-2],n[h],n[h-4]);break;case 49:i.addRelationship(n[h-2],n[h-4],n[h]);break;case 50:this.$=i.Relationships.CONTAINS;break;case 51:this.$=i.Relationships.COPIES;break;case 52:this.$=i.Relationships.DERIVES;break;case 53:this.$=i.Relationships.SATISFIES;break;case 54:this.$=i.Relationships.VERIFIES;break;case 55:this.$=i.Relationships.REFINES;break;case 56:this.$=i.Relationships.TRACES;break;case 57:this.$=n[h-2],i.defineClass(n[h-1],n[h]);break;case 58:i.setClass(n[h-1],n[h]);break;case 59:i.setClass([n[h-2]],n[h]);break;case 60:case 62:case 65:this.$=[n[h]];break;case 61:case 63:this.$=n[h-2].concat([n[h]]);break;case 64:this.$=n[h-2],i.setCssStyle(n[h-1],n[h]);break;case 66:n[h-2].push(n[h]),this.$=n[h-2];break;case 68:this.$=n[h-1]+n[h]}},"anonymous"),table:[{3:1,4:2,6:e,9:s,11:r,13:n},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:s,11:r,13:n},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:s,11:r,13:n},{1:[2,2]},{4:17,5:h,7:13,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:h,7:42,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:43,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:44,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:45,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:46,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:47,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:48,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:49,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:50,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{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]},t(v,[2,17]),t(v,[2,18]),t(v,[2,19]),t(v,[2,20]),{30:60,33:62,75:y,89:k,90:p},{30:63,33:62,75:y,89:k,90:p},{30:64,33:62,75:y,89:k,90:p},t(A,[2,29]),t(A,[2,30]),t(A,[2,31]),t(A,[2,32]),t(A,[2,33]),t(A,[2,34]),t(L,[2,81]),t(L,[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]},t(C,[2,79]),t(C,[2,80]),{27:[1,67],29:[1,68]},t(C,[2,85]),t(C,[2,86]),{62:69,65:O,66:g,67:M,68:q,69:w,70:D,71:F},{62:77,65:O,66:g,67:M,68:q,69:w,70:D,71:F},{30:78,33:62,75:y,89:k,90:p},{73:79,75:P,76:x,78:81,79:82,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j},t(W,[2,60]),t(W,[2,62]),{73:93,75:P,76:x,78:81,79:82,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j},{30:94,33:62,75:y,76:x,89:k,90:p},{5:[1,95]},{30:96,33:62,75:y,89:k,90:p},{5:[1,97]},{30:98,33:62,75:y,89:k,90:p},{63:[1,99]},t(G,[2,50]),t(G,[2,51]),t(G,[2,52]),t(G,[2,53]),t(G,[2,54]),t(G,[2,55]),t(G,[2,56]),{64:[1,100]},t(v,[2,59],{76:x}),t(v,[2,64],{76:z}),{33:103,75:[1,102],89:k,90:p},t(X,[2,65],{79:104,75:P,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j}),t(J,[2,67]),t(J,[2,69]),t(J,[2,70]),t(J,[2,71]),t(J,[2,72]),t(J,[2,73]),t(J,[2,74]),t(J,[2,75]),t(J,[2,76]),t(J,[2,77]),t(J,[2,78]),t(v,[2,57],{76:z}),t(v,[2,58],{76:x}),{5:Z,28:105,31:tt,34:et,36:st,38:it,40:rt},{27:[1,112],76:x},{5:nt,40:at,56:113,57:ht,59:ct},{27:[1,118],76:x},{33:119,89:k,90:p},{33:120,89:k,90:p},{75:P,78:121,79:82,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j},t(W,[2,61]),t(W,[2,63]),t(J,[2,68]),t(v,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Z,28:126,31:tt,34:et,36:st,38:it,40:rt},t(v,[2,28]),{5:[1,127]},t(v,[2,42]),{32:[1,128]},{32:[1,129]},{5:nt,40:at,56:130,57:ht,59:ct},t(v,[2,47]),{5:[1,131]},t(v,[2,48]),t(v,[2,49]),t(X,[2,66],{79:104,75:P,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j}),{33:132,89:k,90:p},{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]},t(v,[2,27]),{5:Z,28:145,31:tt,34:et,36:st,38:it,40:rt},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(v,[2,46]),{5:nt,40:at,56:152,57:ht,59:ct},{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]},t(v,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(v,[2,43]),{5:Z,28:159,31:tt,34:et,36:st,38:it,40:rt},{5:Z,28:160,31:tt,34:et,36:st,38:it,40:rt},{5:Z,28:161,31:tt,34:et,36:st,38:it,40:rt},{5:Z,28:162,31:tt,34:et,36:st,38:it,40:rt},{5:nt,40:at,56:163,57:ht,59:ct},{5:nt,40:at,56:164,57:ht,59:ct},t(v,[2,23]),t(v,[2,24]),t(v,[2,25]),t(v,[2,26]),t(v,[2,44]),t(v,[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:i(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:i(function(t){var e=this,s=[0],r=[],n=[null],a=[],h=this.table,c="",o=0,u=0,l=a.slice.call(arguments,1),E=Object.create(this.lexer),f={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(f.yy[R]=this.yy[R]);E.setInput(t,f.yy),f.yy.lexer=E,f.yy.parser=this,void 0===E.yylloc&&(E.yylloc={});var I=E.yylloc;a.push(I);var _=E.options&&E.options.ranges;function S(){var t;return"number"!=typeof(t=r.pop()||E.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i(function(t){s.length=s.length-2*t,n.length=n.length-t,a.length=a.length-t},"popStack"),i(S,"lex");for(var d,b,m,T,N,k,p,v,y={};;){if(b=s[s.length-1],this.defaultActions[b]?m=this.defaultActions[b]:(null==d&&(d=S()),m=h[b]&&h[b][d]),void 0===m||!m.length||!m[0]){var A="";for(N in v=[],h[b])this.terminals_[N]&&N>2&&v.push("'"+this.terminals_[N]+"'");A=E.showPosition?"Parse error on line "+(o+1)+":\n"+E.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(A,{text:E.match,token:this.terminals_[d]||d,line:E.yylineno,loc:I,expected:v})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+d);switch(m[0]){case 1:s.push(d),n.push(E.yytext),a.push(E.yylloc),s.push(m[1]),d=null,u=E.yyleng,c=E.yytext,o=E.yylineno,I=E.yylloc;break;case 2:if(k=this.productions_[m[1]][1],y.$=n[n.length-k],y._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},_&&(y._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(y,[c,u,o,f.yy,m[1],n,a].concat(l))))return T;k&&(s=s.slice(0,-1*k*2),n=n.slice(0,-1*k),a=a.slice(0,-1*k)),s.push(this.productions_[m[1]][0]),n.push(y.$),a.push(y._$),p=h[s[s.length-2]][s[s.length-1]],s.push(p);break;case 3:return!0}}return!0},"parse")},ut=function(){return{EOF:1,parseError:i(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:i(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:i(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:i(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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 r=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===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:i(function(){return this._more=!0,this},"more"),reject:i(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:i(function(t){this.unput(this.match.slice(t))},"less"),pastInput:i(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:i(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:i(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:i(function(t,e){var s,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var n in r)this[n]=r[n];return!1}return!1},"test_match"),next:i(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),n=0;n<r.length;n++)if((s=this._input.match(this.rules[r[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:i(function(){var t=this.next();return t||this.lex()},"lex"),begin:i(function(t){this.conditionStack.push(t)},"begin"),popState:i(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:i(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:i(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:i(function(t){this.begin(t)},"pushState"),stateStackSize:i(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:i(function(t,e,s,i){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:case 58:case 65: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:case 14:case 15:case 56: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:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");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 66:return"qString";case 67:return e.yytext=e.yytext.trim(),89;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}}}}();function lt(){this.yy={}}return ot.lexer=ut,i(lt,"Parser"),lt.prototype=ot,ot.Parser=lt,new lt}();S.parser=S;var d=S,b=(i(t=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=r,this.getAccTitle=n,this.setAccDescription=a,this.getAccDescription=h,this.setDiagramTitle=c,this.getDiagramTitle=o,this.getConfig=i(()=>u().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(t){this.direction=t}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(t,e){return this.requirements.has(t)||this.requirements.set(t,{name:t,type:e,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=t)}setNewReqText(t){void 0!==this.latestRequirement&&(this.latestRequirement.text=t)}setNewReqRisk(t){void 0!==this.latestRequirement&&(this.latestRequirement.risk=t)}setNewReqVerifyMethod(t){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=t)}addElement(t){return this.elements.has(t)||(this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),l.info("Added new element: ",t)),this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){void 0!==this.latestElement&&(this.latestElement.type=t)}setNewElementDocRef(t){void 0!==this.latestElement&&(this.latestElement.docRef=t)}addRelationship(t,e,s){this.relations.push({type:t,src:e,dst:s})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,E()}setCssStyle(t,e){for(const s of t){const t=this.requirements.get(s)??this.elements.get(s);if(!e||!t)return;for(const s of e)s.includes(",")?t.cssStyles.push(...s.split(",")):t.cssStyles.push(s)}}setClass(t,e){var s;for(const i of t){const t=this.requirements.get(i)??this.elements.get(i);if(t)for(const i of e){t.classes.push(i);const e=null==(s=this.classes.get(i))?void 0:s.styles;e&&t.cssStyles.push(...e)}}}defineClass(t,e){for(const s of t){let t=this.classes.get(s);void 0===t&&(t={id:s,styles:[],textStyles:[]},this.classes.set(s,t)),e&&e.forEach(function(e){if(/color/.exec(e)){const s=e.replace("fill","bgFill");t.textStyles.push(s)}t.styles.push(e)}),this.requirements.forEach(t=>{t.classes.includes(s)&&t.cssStyles.push(...e.flatMap(t=>t.split(",")))}),this.elements.forEach(t=>{t.classes.includes(s)&&t.cssStyles.push(...e.flatMap(t=>t.split(",")))})}}getClasses(){return this.classes}getData(){var t,e,s,i;const r=u(),n=[],a=[];for(const h of this.requirements.values()){const t=h;t.id=h.name,t.cssStyles=h.cssStyles,t.cssClasses=h.classes.join(" "),t.shape="requirementBox",t.look=r.look,n.push(t)}for(const h of this.elements.values()){const t=h;t.shape="requirementBox",t.look=r.look,t.id=h.name,t.cssStyles=h.cssStyles,t.cssClasses=h.classes.join(" "),n.push(t)}for(const h of this.relations){let n=0;const c=h.type===this.Relationships.CONTAINS,o={id:`${h.src}-${h.dst}-${n}`,start:(null==(t=this.requirements.get(h.src))?void 0:t.name)??(null==(e=this.elements.get(h.src))?void 0:e.name),end:(null==(s=this.requirements.get(h.dst))?void 0:s.name)??(null==(i=this.elements.get(h.dst))?void 0:i.name),label:`&lt;&lt;${h.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",c?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:c?"normal":"dashed",arrowTypeStart:c?"requirement_contains":"",arrowTypeEnd:c?"":"requirement_arrow",look:r.look};a.push(o),n++}return{nodes:n,edges:a,other:{},config:r,direction:this.getDirection()}}},"RequirementDB"),t),m=i(t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n .divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n .labelBkg {\n background-color: ${t.edgeLabelBackground};\n }\n\n`,"getStyles"),T={};f(T,{draw:()=>N});var N=i(async function(t,i,r,n){l.info("REF0:"),l.info("Drawing requirement diagram (unified)",i);const{securityLevel:a,state:h,layout:c}=u(),o=n.db.getData(),E=e(i,a);o.type=n.type,o.layoutAlgorithm=R(c),o.nodeSpacing=(null==h?void 0:h.nodeSpacing)??50,o.rankSpacing=(null==h?void 0:h.rankSpacing)??50,o.markers=["requirement_contains","requirement_arrow"],o.diagramId=i,await I(o,E);_.insertTitle(E,"requirementDiagramTitleText",(null==h?void 0:h.titleTopMargin)??25,n.db.getDiagramTitle()),s(E,8,"requirementDiagram",(null==h?void 0:h.useMaxWidth)??!0)},"draw"),k={parser:d,get db(){return new b},renderer:T,styles:m};export{k as diagram};
@@ -1 +0,0 @@
1
- var t,n,i;import{p as s,q as e,s as r,g as o,b as u,a as c,_ as h,c as f,z as a,d as l,V as d,y as p,k as v}from"./index-C5d-CFGb.js";import{o as g}from"./ordinal-2upbOM02.js";import"./init-C9Lo50Hz.js";const k=function(t){for(var n=t.length/6|0,i=new Array(n),s=0;s<n;)i[s]="#"+t.slice(6*s,6*++s);return i}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function y(t,n){let i;if(void 0===n)for(const s of t)null!=s&&(i<s||void 0===i&&s>=s)&&(i=s);else{let s=-1;for(let e of t)null!=(e=n(e,++s,t))&&(i<e||void 0===i&&e>=e)&&(i=e)}return i}function w(t,n){let i;if(void 0===n)for(const s of t)null!=s&&(i>s||void 0===i&&s>=s)&&(i=s);else{let s=-1;for(let e of t)null!=(e=n(e,++s,t))&&(i>e||void 0===i&&e>=e)&&(i=e)}return i}function b(t,n){let i=0;if(void 0===n)for(let s of t)(s=+s)&&(i+=s);else{let s=-1;for(let e of t)(e=+n(e,++s,t))&&(i+=e)}return i}function m(t){return t.target.depth}function _(t,n){return t.sourceLinks.length?t.depth:n-1}function E(t){return function(){return t}}function x(t,n){return S(t.source,n.source)||t.index-n.index}function M(t,n){return S(t.target,n.target)||t.index-n.index}function S(t,n){return t.y0-n.y0}function A(t){return t.value}function L(t){return t.index}function T(t){return t.nodes}function N(t){return t.links}function I(t,n){const i=t.get(n);if(!i)throw new Error("missing: "+n);return i}function C({nodes:t}){for(const n of t){let t=n.y0,i=t;for(const s of n.sourceLinks)s.y0=t+s.width/2,t+=s.width;for(const s of n.targetLinks)s.y1=i+s.width/2,i+=s.width}}function O(){let t,n,i,s=0,e=0,r=1,o=1,u=24,c=8,h=L,f=_,a=T,l=N,d=6;function p(){const p={nodes:a.apply(null,arguments),links:l.apply(null,arguments)};return function({nodes:t,links:n}){for(const[i,e]of t.entries())e.index=i,e.sourceLinks=[],e.targetLinks=[];const s=new Map(t.map((n,i)=>[h(n,i,t),n]));for(const[i,e]of n.entries()){e.index=i;let{source:t,target:n}=e;"object"!=typeof t&&(t=e.source=I(s,t)),"object"!=typeof n&&(n=e.target=I(s,n)),t.sourceLinks.push(e),n.targetLinks.push(e)}if(null!=i)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(i),r.sort(i)}(p),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(b(n.sourceLinks,A),b(n.targetLinks,A)):n.fixedValue}(p),function({nodes:t}){const n=t.length;let i=new Set(t),s=new Set,e=0;for(;i.size;){for(const t of i){t.depth=e;for(const{target:n}of t.sourceLinks)s.add(n)}if(++e>n)throw new Error("circular link");i=s,s=new Set}}(p),function({nodes:t}){const n=t.length;let i=new Set(t),s=new Set,e=0;for(;i.size;){for(const t of i){t.height=e;for(const{source:n}of t.targetLinks)s.add(n)}if(++e>n)throw new Error("circular link");i=s,s=new Set}}(p),function(i){const h=function({nodes:t}){const i=y(t,t=>t.depth)+1,e=(r-s-u)/(i-1),o=new Array(i);for(const n of t){const t=Math.max(0,Math.min(i-1,Math.floor(f.call(null,n,i))));n.layer=t,n.x0=s+t*e,n.x1=n.x0+u,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const s of o)s.sort(n);return o}(i);t=Math.min(c,(o-e)/(y(h,t=>t.length)-1)),function(n){const i=w(n,n=>(o-e-(n.length-1)*t)/b(n,A));for(const s of n){let n=e;for(const e of s){e.y0=n,e.y1=n+e.value*i,n=e.y1+t;for(const t of e.sourceLinks)t.width=t.value*i}n=(o-n+t)/(s.length+1);for(let t=0;t<s.length;++t){const i=s[t];i.y0+=n*(t+1),i.y1+=n*(t+1)}j(s)}}(h);for(let t=0;t<d;++t){const n=Math.pow(.99,t),i=Math.max(1-n,(t+1)/d);g(h,n,i),v(h,n,i)}}(p),C(p),p}function v(t,i,s){for(let e=1,r=t.length;e<r;++e){const r=t[e];for(const t of r){let n=0,s=0;for(const{source:i,value:r}of t.targetLinks){let e=r*(t.layer-i.layer);n+=P(i,t)*e,s+=e}if(!(s>0))continue;let e=(n/s-t.y0)*i;t.y0+=e,t.y1+=e,D(t)}void 0===n&&r.sort(S),k(r,s)}}function g(t,i,s){for(let e=t.length-2;e>=0;--e){const r=t[e];for(const t of r){let n=0,s=0;for(const{target:i,value:r}of t.sourceLinks){let e=r*(i.layer-t.layer);n+=$(t,i)*e,s+=e}if(!(s>0))continue;let e=(n/s-t.y0)*i;t.y0+=e,t.y1+=e,D(t)}void 0===n&&r.sort(S),k(r,s)}}function k(n,i){const s=n.length>>1,r=n[s];O(n,r.y0-t,s-1,i),m(n,r.y1+t,s+1,i),O(n,o,n.length-1,i),m(n,e,0,i)}function m(n,i,s,e){for(;s<n.length;++s){const r=n[s],o=(i-r.y0)*e;o>1e-6&&(r.y0+=o,r.y1+=o),i=r.y1+t}}function O(n,i,s,e){for(;s>=0;--s){const r=n[s],o=(r.y1-i)*e;o>1e-6&&(r.y0-=o,r.y1-=o),i=r.y0-t}}function D({sourceLinks:t,targetLinks:n}){if(void 0===i){for(const{source:{sourceLinks:t}}of n)t.sort(M);for(const{target:{targetLinks:n}}of t)n.sort(x)}}function j(t){if(void 0===i)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(M),i.sort(x)}function P(n,i){let s=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:e,width:r}of n.sourceLinks){if(e===i)break;s+=r+t}for(const{source:t,width:e}of i.targetLinks){if(t===n)break;s-=e}return s}function $(n,i){let s=i.y0-(i.targetLinks.length-1)*t/2;for(const{source:e,width:r}of i.targetLinks){if(e===n)break;s+=r+t}for(const{target:t,width:e}of n.sourceLinks){if(t===i)break;s-=e}return s}return p.update=function(t){return C(t),t},p.nodeId=function(t){return arguments.length?(h="function"==typeof t?t:E(t),p):h},p.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:E(t),p):f},p.nodeSort=function(t){return arguments.length?(n=t,p):n},p.nodeWidth=function(t){return arguments.length?(u=+t,p):u},p.nodePadding=function(n){return arguments.length?(c=t=+n,p):c},p.nodes=function(t){return arguments.length?(a="function"==typeof t?t:E(t),p):a},p.links=function(t){return arguments.length?(l="function"==typeof t?t:E(t),p):l},p.linkSort=function(t){return arguments.length?(i=t,p):i},p.size=function(t){return arguments.length?(s=e=0,r=+t[0],o=+t[1],p):[r-s,o-e]},p.extent=function(t){return arguments.length?(s=+t[0][0],r=+t[1][0],e=+t[0][1],o=+t[1][1],p):[[s,e],[r,o]]},p.iterations=function(t){return arguments.length?(d=+t,p):d},p}var D=Math.PI,j=2*D,P=1e-6,$=j-P;function U(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function z(){return new U}function F(t){return function(){return t}}function G(t){return t[0]}function X(t){return t[1]}U.prototype=z.prototype={constructor:U,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,i,s){this._+="Q"+ +t+","+ +n+","+(this._x1=+i)+","+(this._y1=+s)},bezierCurveTo:function(t,n,i,s,e,r){this._+="C"+ +t+","+ +n+","+ +i+","+ +s+","+(this._x1=+e)+","+(this._y1=+r)},arcTo:function(t,n,i,s,e){t=+t,n=+n,i=+i,s=+s,e=+e;var r=this._x1,o=this._y1,u=i-t,c=s-n,h=r-t,f=o-n,a=h*h+f*f;if(e<0)throw new Error("negative radius: "+e);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(a>P)if(Math.abs(f*u-c*h)>P&&e){var l=i-r,d=s-o,p=u*u+c*c,v=l*l+d*d,g=Math.sqrt(p),k=Math.sqrt(a),y=e*Math.tan((D-Math.acos((p+a-v)/(2*g*k)))/2),w=y/k,b=y/g;Math.abs(w-1)>P&&(this._+="L"+(t+w*h)+","+(n+w*f)),this._+="A"+e+","+e+",0,0,"+ +(f*l>h*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,i,s,e,r){t=+t,n=+n,r=!!r;var o=(i=+i)*Math.cos(s),u=i*Math.sin(s),c=t+o,h=n+u,f=1^r,a=r?s-e:e-s;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+c+","+h:(Math.abs(this._x1-c)>P||Math.abs(this._y1-h)>P)&&(this._+="L"+c+","+h),i&&(a<0&&(a=a%j+j),a>$?this._+="A"+i+","+i+",0,1,"+f+","+(t-o)+","+(n-u)+"A"+i+","+i+",0,1,"+f+","+(this._x1=c)+","+(this._y1=h):a>P&&(this._+="A"+i+","+i+",0,"+ +(a>=D)+","+f+","+(this._x1=t+i*Math.cos(e))+","+(this._y1=n+i*Math.sin(e))))},rect:function(t,n,i,s){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +s+"h"+-i+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function Y(t){return t.source}function q(t){return t.target}function B(t,n,i,s,e){t.moveTo(n,i),t.bezierCurveTo(n=(n+s)/2,i,n,e,s,e)}function K(){return function(t){var n=Y,i=q,s=G,e=X,r=null;function o(){var o,u=Q.call(arguments),c=n.apply(this,u),h=i.apply(this,u);if(r||(r=o=z()),t(r,+s.apply(this,(u[0]=c,u)),+e.apply(this,u),+s.apply(this,(u[0]=h,u)),+e.apply(this,u)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(i=t,o):i},o.x=function(t){return arguments.length?(s="function"==typeof t?t:F(+t),o):s},o.y=function(t){return arguments.length?(e="function"==typeof t?t:F(+t),o):e},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(B)}function R(t){return[t.source.x1,t.y0]}function W(t){return[t.target.x0,t.y1]}var Z=function(){var t=h(function(t,n,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=n);return i},"o"),n=[1,9],i=[1,10],s=[1,5,10,12],e={trace:h(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:h(function(t,n,i,s,e,r,o){var u=r.length-1;switch(e){case 7:const t=s.findOrCreateNode(r[u-4].trim().replaceAll('""','"')),n=s.findOrCreateNode(r[u-2].trim().replaceAll('""','"')),i=parseFloat(r[u].trim());s.addLink(t,n,i);break;case 8:case 9:case 11:this.$=r[u];break;case 10:this.$=r[u-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(s,[2,8]),t(s,[2,9]),{19:[1,16]},t(s,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:i},{15:18,16:7,17:8,18:n,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(s,[2,10]),{15:21,16:7,17:8,18:n,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:h(function(t,n){if(!n.recoverable){var i=new Error(t);throw i.hash=n,i}this.trace(t)},"parseError"),parse:h(function(t){var n=this,i=[0],s=[],e=[null],r=[],o=this.table,u="",c=0,f=0,a=r.slice.call(arguments,1),l=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);l.setInput(t,d.yy),d.yy.lexer=l,d.yy.parser=this,void 0===l.yylloc&&(l.yylloc={});var v=l.yylloc;r.push(v);var g=l.options&&l.options.ranges;function k(){var t;return"number"!=typeof(t=s.pop()||l.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,h(function(t){i.length=i.length-2*t,e.length=e.length-t,r.length=r.length-t},"popStack"),h(k,"lex");for(var y,w,b,m,_,E,x,M,S={};;){if(w=i[i.length-1],this.defaultActions[w]?b=this.defaultActions[w]:(null==y&&(y=k()),b=o[w]&&o[w][y]),void 0===b||!b.length||!b[0]){var A="";for(_ in M=[],o[w])this.terminals_[_]&&_>2&&M.push("'"+this.terminals_[_]+"'");A=l.showPosition?"Parse error on line "+(c+1)+":\n"+l.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(A,{text:l.match,token:this.terminals_[y]||y,line:l.yylineno,loc:v,expected:M})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+y);switch(b[0]){case 1:i.push(y),e.push(l.yytext),r.push(l.yylloc),i.push(b[1]),y=null,f=l.yyleng,u=l.yytext,c=l.yylineno,v=l.yylloc;break;case 2:if(E=this.productions_[b[1]][1],S.$=e[e.length-E],S._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},g&&(S._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),void 0!==(m=this.performAction.apply(S,[u,f,c,d.yy,b[1],e,r].concat(a))))return m;E&&(i=i.slice(0,-1*E*2),e=e.slice(0,-1*E),r=r.slice(0,-1*E)),i.push(this.productions_[b[1]][0]),e.push(S.$),r.push(S._$),x=o[i[i.length-2]][i[i.length-1]],i.push(x);break;case 3:return!0}}return!0},"parse")},r=function(){return{EOF:1,parseError:h(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:h(function(t,n){return this.yy=n||this.yy||{},this._input=t,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 t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:h(function(t){var n=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var s=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),i.length-1&&(this.yylineno-=i.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:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:h(function(t){this.unput(this.match.slice(t))},"less"),pastInput:h(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:h(function(t,n){var i,s,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))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in e)this[r]=e[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;var t,n,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),r=0;r<e.length;r++)if((i=this._input.match(this.rules[e[r]]))&&(!n||i[0].length>n[0].length)){if(n=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,e[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,e[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var t=this.next();return t||this.lex()},"lex"),begin:h(function(t){this.conditionStack.push(t)},"begin"),popState:h(function(){return this.conditionStack.length-1>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(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:h(function(t){this.begin(t)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(t,n,i,s){switch(i){case 0: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}}}}();function o(){this.yy={}}return e.lexer=r,h(o,"Parser"),o.prototype=e,e.Parser=o,new o}();Z.parser=Z;var V=Z,H=[],J=[],tt=new Map,nt=h(()=>{H=[],J=[],tt=new Map,p()},"clear"),it=(h(t=class{constructor(t,n,i=0){this.source=t,this.target=n,this.value=i}},"SankeyLink"),t),st=h((t,n,i)=>{H.push(new it(t,n,i))},"addLink"),et=(h(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),rt=h(t=>{t=v.sanitizeText(t,f());let n=tt.get(t);return void 0===n&&(n=new et(t),tt.set(t,n),J.push(n)),n},"findOrCreateNode"),ot=h(()=>J,"getNodes"),ut=h(()=>H,"getLinks"),ct=h(()=>({nodes:J.map(t=>({id:t.ID})),links:H.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ht={nodesMap:tt,getConfig:h(()=>f().sankey,"getConfig"),getNodes:ot,getLinks:ut,getGraph:ct,addLink:st,findOrCreateNode:rt,getAccTitle:c,setAccTitle:u,getAccDescription:o,setAccDescription:r,getDiagramTitle:e,setDiagramTitle:s,clear:nt},ft=(h(i=class{static next(t){return new i(t+ ++i.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),i.count=0,i),at={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,m)-1:0},justify:_},lt={draw:h(function(t,n,i,s){const{securityLevel:e,sankey:r}=f(),o=a.sankey;let u;"sandbox"===e&&(u=l("#i"+n));const c=l("sandbox"===e?u.nodes()[0].contentDocument.body:"body"),p="sandbox"===e?c.select(`[id="${n}"]`):l(`[id="${n}"]`),v=(null==r?void 0:r.width)??o.width,y=(null==r?void 0:r.height)??o.width,w=(null==r?void 0:r.useMaxWidth)??o.useMaxWidth,b=(null==r?void 0:r.nodeAlignment)??o.nodeAlignment,m=(null==r?void 0:r.prefix)??o.prefix,_=(null==r?void 0:r.suffix)??o.suffix,E=(null==r?void 0:r.showValues)??o.showValues,x=s.db.getGraph(),M=at[b];O().nodeId(t=>t.id).nodeWidth(10).nodePadding(10+(E?15:0)).nodeAlign(M).extent([[0,0],[v,y]])(x);const S=g(k);p.append("g").attr("class","nodes").selectAll(".node").data(x.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=ft.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>S(t.id));const A=h(({id:t,value:n})=>E?`${t}\n${m}${Math.round(100*n)/100}${_}`:t,"getText");p.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(x.nodes).join("text").attr("x",t=>t.x0<v/2?t.x1+6:t.x0-6).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(E?"0":"0.35")+"em").attr("text-anchor",t=>t.x0<v/2?"start":"end").text(A);const L=p.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(x.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),T=(null==r?void 0:r.linkColor)??"gradient";if("gradient"===T){const t=L.append("linearGradient").attr("id",t=>(t.uid=ft.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>S(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>S(t.target.id))}let N;switch(T){case"gradient":N=h(t=>t.uid,"coloring");break;case"source":N=h(t=>S(t.source.id),"coloring");break;case"target":N=h(t=>S(t.target.id),"coloring");break;default:N=T}L.append("path").attr("d",K().source(R).target(W)).attr("stroke",N).attr("stroke-width",t=>Math.max(1,t.width)),d(void 0,p,0,w)},"draw")},dt=h(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),pt=h(t=>`.label {\n font-family: ${t.fontFamily};\n }`,"getStyles"),vt=V.parse.bind(V);V.parse=t=>vt(dt(t));var gt={styles:pt,parser:V,db:ht,renderer:lt};export{gt as diagram};