@codragraph/cli 2.1.5 → 2.2.0-rc.6
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.
- package/README.md +18 -13
- package/dist/cli/analyze.d.ts +9 -4
- package/dist/cli/analyze.js +37 -13
- package/dist/cli/graphpack.d.ts +48 -0
- package/dist/cli/graphpack.js +217 -0
- package/dist/cli/index.js +81 -3
- package/dist/cli/status.d.ts +1 -1
- package/dist/cli/status.js +8 -0
- package/dist/cli/tool.d.ts +11 -2
- package/dist/cli/tool.js +138 -8
- package/dist/core/adaptive-profile.d.ts +52 -0
- package/dist/core/adaptive-profile.js +180 -0
- package/dist/core/cgdb/cgdb-adapter.d.ts +34 -5
- package/dist/core/cgdb/cgdb-adapter.js +418 -5
- package/dist/core/cgdb/pool-adapter.js +1 -1
- package/dist/core/graphpack/index.d.ts +14 -0
- package/dist/core/graphpack/index.js +474 -0
- package/dist/core/graphpack/types.d.ts +129 -0
- package/dist/core/graphpack/types.js +4 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +3 -1
- package/dist/core/ingestion/pipeline-phases/structure.js +19 -3
- package/dist/core/ingestion/pipeline.d.ts +10 -0
- package/dist/core/run-analyze.d.ts +27 -2
- package/dist/core/run-analyze.js +598 -27
- package/dist/core/search/bm25-index.d.ts +19 -0
- package/dist/core/search/bm25-index.js +68 -29
- package/dist/core/semantic/relationships.d.ts +36 -0
- package/dist/core/semantic/relationships.js +261 -0
- package/dist/mcp/local/local-backend.js +48 -3
- package/dist/mcp/resources.js +125 -0
- package/dist/mcp/tools.js +105 -0
- package/dist/server/api.js +112 -0
- package/dist/storage/repo-manager.d.ts +29 -0
- package/dist/web/assets/agent-CQNZQ-hg.js +1139 -0
- package/dist/web/assets/architectureDiagram-UL44E2DR-B5_goS_i.js +36 -0
- package/dist/web/assets/blockDiagram-7IZFK4PR-D7ZAlDyv.js +132 -0
- package/dist/web/assets/{c4Diagram-DFAF54RM-C4Hl3J2U.js → c4Diagram-Y2BXMSZH-Djcgm_54.js} +1 -1
- package/dist/web/assets/{chunk-7RZVMHOQ-BitYcNVR.js → chunk-3SSMPTDK-Cv2Zy2FO.js} +1 -1
- package/dist/web/assets/{chunk-TBF5ZNIQ-DL5stGM1.js → chunk-6764PJDD-Cppb-jH-.js} +1 -1
- package/dist/web/assets/{chunk-KSICW3F5-BYzvDLNI.js → chunk-AZZRMDJM-BHlLC7p3.js} +1 -1
- package/dist/web/assets/{chunk-AEOMTBSW-BgTIXPsY.js → chunk-JQRUD6KW-3F8Zg-1N.js} +1 -1
- package/dist/web/assets/chunk-KRXBNO2N-C0mbN9a7.js +1 -0
- package/dist/web/assets/chunk-LCXTWHL2-BoiuJpIF.js +231 -0
- package/dist/web/assets/{chunk-O5ABG6QK-dHwHzA6n.js → chunk-LII3EMHJ-Dqq0Qguw.js} +1 -1
- package/dist/web/assets/chunk-RG4AUYOV-Bl5F_gDs.js +206 -0
- package/dist/web/assets/{chunk-TU3PZOEN-RLyvLcv-.js → chunk-T5OCTHI4-B2tIcggA.js} +1 -1
- package/dist/web/assets/chunk-W44A43WB-BHe37iN7.js +13 -0
- package/dist/web/assets/{chunk-RWUO3TPN-BgRTY0_k.js → chunk-ZXARS5L4-wcrIaQvY.js} +1 -1
- package/dist/web/assets/classDiagram-KGZ6W3CR-IbI6v_24.js +1 -0
- package/dist/web/assets/classDiagram-v2-72OJOZXJ-IbI6v_24.js +1 -0
- package/dist/web/assets/{cose-bilkent-PNC4W37J-DVhePRYg.js → cose-bilkent-UX7MHV2Q-BWr7v0Wr.js} +1 -1
- package/dist/web/assets/dagre-ND4H6XIP-De5LIh1B.js +4 -0
- package/dist/web/assets/diagram-3NCE3AQN-Dd22FSHy.js +43 -0
- package/dist/web/assets/diagram-GF46GFSD-Cev3THY8.js +24 -0
- package/dist/web/assets/diagram-HNR7UZ2L-D8Z8RQGs.js +3 -0
- package/dist/web/assets/diagram-QXG6HAR7-B8VOJOiE.js +24 -0
- package/dist/web/assets/diagram-WEQXMOUZ-va1bLoMD.js +10 -0
- package/dist/web/assets/{erDiagram-GCSMX5X6-C3dhDFA8.js → erDiagram-L5TCEMPS-B3_9uAoP.js} +5 -5
- package/dist/web/assets/{flowDiagram-OTCZ4VVT-CWSFWmhr.js → flowDiagram-H6V6AXG4-98m6maI1.js} +9 -9
- package/dist/web/assets/ganttDiagram-JCBTUEKG-vE2nzETb.js +292 -0
- package/dist/web/assets/gitGraphDiagram-S2ZK5IYY-DKc8uUg_.js +106 -0
- package/dist/web/assets/index-BAhe1HSk.css +1 -0
- package/dist/web/assets/index-VTKdaklA.js +1415 -0
- package/dist/web/assets/infoDiagram-3YFTVSEB-DYP-Srzx.js +2 -0
- package/dist/web/assets/{ishikawaDiagram-YMYX4NHK-DUoJvNP2.js → ishikawaDiagram-BNXS4ZKH-QZnkpmmb.js} +3 -3
- package/dist/web/assets/{journeyDiagram-SO5T7YLQ-RMFPNNqz.js → journeyDiagram-M6C3CM3L-B5ojIuqu.js} +1 -1
- package/dist/web/assets/{kanban-definition-LJHFXRCJ-BzpDs1K9.js → kanban-definition-75IXJCU3-BJA8liRR.js} +4 -4
- package/dist/web/assets/{katex-GD7MH7QM-DBQvrix-.js → katex-K3KEBU37-DUqZiCRL.js} +1 -1
- package/dist/web/assets/mindmap-definition-2TDM6QVE-BQj5yylD.js +96 -0
- package/dist/web/assets/pieDiagram-CU6KROY3-4eSrPiQz.js +30 -0
- package/dist/web/assets/quadrantDiagram-VICAPDV7-PzxN8j55.js +7 -0
- package/dist/web/assets/{requirementDiagram-M5DCFWZL-DLHOVTSv.js → requirementDiagram-JXO7QTGE-CtplTc5y.js} +2 -2
- package/dist/web/assets/sankeyDiagram-URQDO5SZ-CoSgvkxv.js +40 -0
- package/dist/web/assets/sequenceDiagram-VS2MUI6T-D7ygyXvJ.js +162 -0
- package/dist/web/assets/stateDiagram-7D4R322I-v01gvwji.js +1 -0
- package/dist/web/assets/stateDiagram-v2-36443NZ5-DFD2b8_x.js +1 -0
- package/dist/web/assets/{timeline-definition-5SPVSISX-TRSDRgPw.js → timeline-definition-O6YCAMPW-CTI3M65J.js} +4 -4
- package/dist/web/assets/{vennDiagram-IE5QUKF5-DNy7HRBM.js → vennDiagram-MWXL3ELB-RnB0XMP7.js} +6 -6
- package/dist/web/assets/wardley-L42UT6IY-5TKZOOLJ-C-ZcgEBb.js +173 -0
- package/dist/web/assets/wardleyDiagram-CUQ6CDDI-EwRi4kwo.js +78 -0
- package/dist/web/assets/{xychartDiagram-ZHJ5623Y-Dr9r7a35.js → xychartDiagram-N2JHSOCM-DA38II6y.js} +4 -4
- package/dist/web/index.html +2 -2
- package/package.json +2 -2
- package/vendor/node_modules/node-addon-api/node_addon_api_except.stamp +0 -0
- package/dist/web/assets/agent-D5lb0zXz.js +0 -1089
- package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +0 -36
- package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +0 -132
- package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +0 -231
- package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +0 -1
- package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +0 -13
- package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +0 -1
- package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +0 -206
- package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +0 -1
- package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +0 -1
- package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +0 -4
- package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +0 -43
- package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +0 -24
- package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +0 -10
- package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +0 -24
- package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +0 -292
- package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +0 -106
- package/dist/web/assets/index-BgeqpYgd.js +0 -1415
- package/dist/web/assets/index-CT0GtFLZ.css +0 -1
- package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +0 -2
- package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +0 -96
- package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +0 -30
- package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +0 -7
- package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +0 -10
- package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +0 -157
- package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +0 -1
- package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +0 -1
- package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +0 -161
- package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +0 -20
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import{m as ge}from"./chunk-HN6EAY2L-BBnyTNdB.js";import{o as ue}from"./chunk-KSICW3F5-BYzvDLNI.js";import{m as u,O as lt,i as C,b as ye,p as k,o as pe,R as xe,u as fe,az as be,af as me,am as we,q as A,aj as ke,aA as X,aB as _t,aC as at,aD as Le,U as it,C as Se,c as Bt,aE as Ot,aF as _e,aG as Ee}from"./index-BgeqpYgd.js";import{_ as De}from"./chunk-H3VCZNTA-Cx5XV_aC.js";var mt=function(){var e=u(function(N,h,y,b){for(y=y||{},b=N.length;b--;y[N[b]]=h);return y},"o"),t=[1,15],a=[1,7],s=[1,13],l=[1,14],i=[1,19],r=[1,16],n=[1,17],o=[1,18],x=[8,30],d=[8,10,21,28,29,30,31,39,43,46],p=[1,23],m=[1,24],f=[8,10,15,16,21,28,29,30,31,39,43,46],w=[8,10,15,16,21,27,28,29,30,31,39,43,46],E=[1,49],L={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(N,h,y,b,D,c,_){var g=c.length-1;switch(D){case 4:b.getLogger().debug("Rule: separator (NL) ");break;case 5:b.getLogger().debug("Rule: separator (Space) ");break;case 6:b.getLogger().debug("Rule: separator (EOF) ");break;case 7:b.getLogger().debug("Rule: hierarchy: ",c[g-1]),b.setHierarchy(c[g-1]);break;case 8:b.getLogger().debug("Stop NL ");break;case 9:b.getLogger().debug("Stop EOF ");break;case 10:b.getLogger().debug("Stop NL2 ");break;case 11:b.getLogger().debug("Stop EOF2 ");break;case 12:b.getLogger().debug("Rule: statement: ",c[g]),typeof c[g].length=="number"?this.$=c[g]:this.$=[c[g]];break;case 13:b.getLogger().debug("Rule: statement #2: ",c[g-1]),this.$=[c[g-1]].concat(c[g]);break;case 14:b.getLogger().debug("Rule: link: ",c[g],N),this.$={edgeTypeStr:c[g],label:""};break;case 15:b.getLogger().debug("Rule: LABEL link: ",c[g-3],c[g-1],c[g]),this.$={edgeTypeStr:c[g],label:c[g-1]};break;case 18:let S=parseInt(c[g]),v=b.generateId();this.$={id:v,type:"space",label:"",width:S,children:[]};break;case 23:b.getLogger().debug("Rule: (nodeStatement link node) ",c[g-2],c[g-1],c[g]," typestr: ",c[g-1].edgeTypeStr);let T=b.edgeStrToEdgeData(c[g-1].edgeTypeStr);this.$=[{id:c[g-2].id,label:c[g-2].label,type:c[g-2].type,directions:c[g-2].directions},{id:c[g-2].id+"-"+c[g].id,start:c[g-2].id,end:c[g].id,label:c[g-1].label,type:"edge",directions:c[g].directions,arrowTypeEnd:T,arrowTypeStart:"arrow_open"},{id:c[g].id,label:c[g].label,type:b.typeStr2Type(c[g].typeStr),directions:c[g].directions}];break;case 24:b.getLogger().debug("Rule: nodeStatement (abc88 node size) ",c[g-1],c[g]),this.$={id:c[g-1].id,label:c[g-1].label,type:b.typeStr2Type(c[g-1].typeStr),directions:c[g-1].directions,widthInColumns:parseInt(c[g],10)};break;case 25:b.getLogger().debug("Rule: nodeStatement (node) ",c[g]),this.$={id:c[g].id,label:c[g].label,type:b.typeStr2Type(c[g].typeStr),directions:c[g].directions,widthInColumns:1};break;case 26:b.getLogger().debug("APA123",this?this:"na"),b.getLogger().debug("COLUMNS: ",c[g]),this.$={type:"column-setting",columns:c[g]==="auto"?-1:parseInt(c[g])};break;case 27:b.getLogger().debug("Rule: id-block statement : ",c[g-2],c[g-1]),b.generateId(),this.$={...c[g-2],type:"composite",children:c[g-1]};break;case 28:b.getLogger().debug("Rule: blockStatement : ",c[g-2],c[g-1],c[g]);let F=b.generateId();this.$={id:F,type:"composite",label:"",children:c[g-1]};break;case 29:b.getLogger().debug("Rule: node (NODE_ID separator): ",c[g]),this.$={id:c[g]};break;case 30:b.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",c[g-1],c[g]),this.$={id:c[g-1],label:c[g].label,typeStr:c[g].typeStr,directions:c[g].directions};break;case 31:b.getLogger().debug("Rule: dirList: ",c[g]),this.$=[c[g]];break;case 32:b.getLogger().debug("Rule: dirList: ",c[g-1],c[g]),this.$=[c[g-1]].concat(c[g]);break;case 33:b.getLogger().debug("Rule: nodeShapeNLabel: ",c[g-2],c[g-1],c[g]),this.$={typeStr:c[g-2]+c[g],label:c[g-1]};break;case 34:b.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",c[g-3],c[g-2]," #3:",c[g-1],c[g]),this.$={typeStr:c[g-3]+c[g],label:c[g-2],directions:c[g-1]};break;case 35:case 36:this.$={type:"classDef",id:c[g-1].trim(),css:c[g].trim()};break;case 37:this.$={type:"applyClass",id:c[g-1].trim(),styleClass:c[g].trim()};break;case 38:this.$={type:"applyStyles",id:c[g-1].trim(),stylesStr:c[g].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,39:r,43:n,46:o},{8:[1,20]},e(x,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:l,31:i,39:r,43:n,46:o}),e(d,[2,16],{14:22,15:p,16:m}),e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,22]),e(f,[2,25],{27:[1,25]}),e(d,[2,26]),{19:26,26:12,31:i},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,39:r,43:n,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(w,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(x,[2,13]),{26:35,31:i},{31:[2,14]},{17:[1,36]},e(f,[2,24]),{10:t,11:37,13:4,14:22,15:p,16:m,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,39:r,43:n,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(f,[2,23]),{18:[1,45]},{30:[1,46]},e(d,[2,28]),e(d,[2,35]),e(d,[2,36]),e(d,[2,37]),e(d,[2,38]),{36:[1,47]},{33:48,34:E},{15:[1,50]},e(d,[2,27]),e(w,[2,33]),{38:[1,51]},{33:52,34:E,38:[2,31]},{31:[2,15]},e(w,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(N,h){if(h.recoverable)this.trace(N);else{var y=new Error(N);throw y.hash=h,y}},"parseError"),parse:u(function(N){var h=this,y=[0],b=[],D=[null],c=[],_=this.table,g="",S=0,v=0,T=0,F=2,W=1,G=c.slice.call(arguments,1),O=Object.create(this.lexer),K={yy:{}};for(var et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,et)&&(K.yy[et]=this.yy[et]);O.setInput(N,K.yy),K.yy.lexer=O,K.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var rt=O.yylloc;c.push(rt);var he=O.options&&O.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(U){y.length=y.length-2*U,D.length=D.length-U,c.length=c.length-U}u(de,"popStack");function It(){var U;return U=b.pop()||O.lex()||W,typeof U!="number"&&(U instanceof Array&&(b=U,U=b.pop()),U=h.symbols_[U]||U),U}u(It,"lex");for(var Y,pt,Q,Z,Qr,xt,tt={},ot,V,Ct,ct;;){if(Q=y[y.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((Y===null||typeof Y>"u")&&(Y=It()),Z=_[Q]&&_[Q][Y]),typeof Z>"u"||!Z.length||!Z[0]){var ft="";ct=[];for(ot in _[Q])this.terminals_[ot]&&ot>F&&ct.push("'"+this.terminals_[ot]+"'");O.showPosition?ft="Parse error on line "+(S+1)+`:
|
|
2
|
-
`+O.showPosition()+`
|
|
3
|
-
Expecting `+ct.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":ft="Parse error on line "+(S+1)+": Unexpected "+(Y==W?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[Y]||Y,line:O.yylineno,loc:rt,expected:ct})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+Y);switch(Z[0]){case 1:y.push(Y),D.push(O.yytext),c.push(O.yylloc),y.push(Z[1]),Y=null,pt?(Y=pt,pt=null):(v=O.yyleng,g=O.yytext,S=O.yylineno,rt=O.yylloc,T>0);break;case 2:if(V=this.productions_[Z[1]][1],tt.$=D[D.length-V],tt._$={first_line:c[c.length-(V||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(V||1)].first_column,last_column:c[c.length-1].last_column},he&&(tt._$.range=[c[c.length-(V||1)].range[0],c[c.length-1].range[1]]),xt=this.performAction.apply(tt,[g,v,S,K.yy,Z[1],D,c].concat(G)),typeof xt<"u")return xt;V&&(y=y.slice(0,-1*V*2),D=D.slice(0,-1*V),c=c.slice(0,-1*V)),y.push(this.productions_[Z[1]][0]),D.push(tt.$),c.push(tt._$),Ct=_[y[y.length-2]][y[y.length-1]],y.push(Ct);break;case 3:return!0}}return!0},"parse")},I=function(){var N={EOF:1,parseError:u(function(h,y){if(this.yy.parser)this.yy.parser.parseError(h,y);else throw new Error(h)},"parseError"),setInput:u(function(h,y){return this.yy=y||this.yy||{},this._input=h,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 h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var y=h.match(/(?:\r\n?|\n).*/g);return y?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:u(function(h){var y=h.length,b=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-y),this.offset-=y;var D=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var c=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:b?(b.length===D.length?this.yylloc.first_column:0)+D[D.length-b.length].length-b[0].length:this.yylloc.first_column-y},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-y]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:u(function(h){this.unput(this.match.slice(h))},"less"),pastInput:u(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var h=this.pastInput(),y=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
|
5
|
-
`+y+"^"},"showPosition"),test_match:u(function(h,y){var b,D,c;if(this.options.backtrack_lexer&&(c={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&&(c.yylloc.range=this.yylloc.range.slice(0))),D=h[0].match(/(?:\r\n?|\n).*/g),D&&(this.yylineno+=D.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:D?D[D.length-1].length-D[D.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],b=this.performAction.call(this,this.yy,this,y,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var _ in c)this[_]=c[_];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,y,b,D;this._more||(this.yytext="",this.match="");for(var c=this._currentRules(),_=0;_<c.length;_++)if(b=this._input.match(this.rules[c[_]]),b&&(!y||b[0].length>y[0].length)){if(y=b,D=_,this.options.backtrack_lexer){if(h=this.test_match(b,c[_]),h!==!1)return h;if(this._backtrack){y=!1;continue}else return!1}else if(!this.options.flex)break}return y?(h=this.test_match(y,c[D]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var h=this.next();return h||this.lex()},"lex"),begin:u(function(h){this.conditionStack.push(h)},"begin"),popState:u(function(){var h=this.conditionStack.length-1;return h>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(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:u(function(h){this.begin(h)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:u(function(h,y,b,D){switch(b){case 0:return h.getLogger().debug("Found block-beta"),10;case 1:return h.getLogger().debug("Found id-block"),29;case 2:return h.getLogger().debug("Found block"),10;case 3:h.getLogger().debug(".",y.yytext);break;case 4:h.getLogger().debug("_",y.yytext);break;case 5:return 5;case 6:return y.yytext=-1,28;case 7:return y.yytext=y.yytext.replace(/columns\s+/,""),h.getLogger().debug("COLUMNS (LEX)",y.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:h.getLogger().debug("LEX: POPPING STR:",y.yytext),this.popState();break;case 13:return h.getLogger().debug("LEX: STR end:",y.yytext),"STR";case 14:return y.yytext=y.yytext.replace(/space\:/,""),h.getLogger().debug("SPACE NUM (LEX)",y.yytext),21;case 15:return y.yytext="1",h.getLogger().debug("COLUMNS (LEX)",y.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),h.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),h.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),h.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),h.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),h.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),h.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),h.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),h.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),h.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),h.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),h.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),h.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),h.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return h.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return h.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return h.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return h.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return h.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return h.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return h.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return h.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),h.getLogger().debug("LEX ARR START"),37;case 74:return h.getLogger().debug("Lex: NODE_ID",y.yytext),31;case 75:return h.getLogger().debug("Lex: EOF",y.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:h.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:h.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return h.getLogger().debug("LEX: NODE_DESCR:",y.yytext),"NODE_DESCR";case 83:h.getLogger().debug("LEX POPPING"),this.popState();break;case 84:h.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (right): dir:",y.yytext),"DIR";case 86:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (left):",y.yytext),"DIR";case 87:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (x):",y.yytext),"DIR";case 88:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (y):",y.yytext),"DIR";case 89:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (up):",y.yytext),"DIR";case 90:return y.yytext=y.yytext.replace(/^,\s*/,""),h.getLogger().debug("Lex (down):",y.yytext),"DIR";case 91:return y.yytext="]>",h.getLogger().debug("Lex (ARROW_DIR end):",y.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return h.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 93:return h.getLogger().debug("Lex: LINK",y.yytext),15;case 94:return h.getLogger().debug("Lex: LINK",y.yytext),15;case 95:return h.getLogger().debug("Lex: LINK",y.yytext),15;case 96:return h.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 97:return h.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 98:return h.getLogger().debug("Lex: START_LINK",y.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return h.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),h.getLogger().debug("Lex: LINK","#"+y.yytext+"#"),15;case 102:return this.popState(),h.getLogger().debug("Lex: LINK",y.yytext),15;case 103:return this.popState(),h.getLogger().debug("Lex: LINK",y.yytext),15;case 104:return h.getLogger().debug("Lex: COLON",y.yytext),y.yytext=y.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return N}();L.lexer=I;function $(){this.yy={}}return u($,"Parser"),$.prototype=L,L.Parser=$,new $}();mt.parser=mt;var ve=mt,j=new Map,Et=[],wt=new Map,Rt="color",zt="fill",Ne="bgFill",Ht=",",Te=A(),dt=new Map,Dt="",$e=u(e=>Se.sanitizeText(e,Te),"sanitizeText"),Ie=u(function(e,t=""){let a=dt.get(e);a||(a={id:e,styles:[],textStyles:[]},dt.set(e,a)),t==null||t.split(Ht).forEach(s=>{let l=s.replace(/([^;]*);/,"$1").trim();if(RegExp(Rt).exec(s)){let i=l.replace(zt,Ne).replace(Rt,zt);a.textStyles.push(i)}a.styles.push(l)})},"addStyleClass"),Ce=u(function(e,t=""){let a=j.get(e);t!=null&&(a.styles=t.split(Ht))},"addStyle2Node"),Be=u(function(e,t){e.split(",").forEach(function(a){let s=j.get(a);if(s===void 0){let l=a.trim();s={id:l,type:"na",children:[]},j.set(l,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),Zt=u((e,t)=>{var i;let a=e.flat(),s=[],l=((i=a.find(r=>(r==null?void 0:r.type)==="column-setting"))==null?void 0:i.columns)??-1;for(let r of a){if(typeof l=="number"&&l>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>l&&k.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${l}`),r.label&&(r.label=$e(r.label)),r.type==="classDef"){Ie(r.id,r.css);continue}if(r.type==="applyClass"){Be(r.id,(r==null?void 0:r.styleClass)??"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&Ce(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){let n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,Et.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);let n=j.get(r.id);if(n===void 0?j.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Zt(r.children,r),r.type==="space"){let o=r.width??1;for(let x=0;x<o;x++){let d=De(r);d.id=d.id+"-"+x,j.set(d.id,d),s.push(d)}}else n===void 0&&s.push(r)}}t.children=s},"populateBlockDatabase"),vt=[],nt={id:"root",type:"composite",children:[],columns:-1},Oe=u(()=>{k.debug("Clear called"),pe(),nt={id:"root",type:"composite",children:[],columns:-1},j=new Map([["root",nt]]),vt=[],dt=new Map,Et=[],wt=new Map,Dt=""},"clear");function qt(e){switch(k.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return k.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}u(qt,"typeStr2Type");function jt(e){switch(k.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}u(jt,"edgeTypeStr2Type");function Jt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}u(Jt,"edgeStrToEdgeData");var At=0,Re=u(()=>(At++,"id-"+Math.random().toString(36).substr(2,12)+"-"+At),"generateId"),ze=u(e=>{nt.children=e,Zt(e,nt),vt=nt.children},"setHierarchy"),Ae=u(e=>{let t=j.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),Me=u(()=>[...j.values()],"getBlocksFlat"),Pe=u(()=>vt||[],"getBlocks"),Ye=u(()=>Et,"getEdges"),Xe=u(e=>j.get(e),"getBlock"),We=u(e=>{j.set(e.id,e)},"setBlock"),Fe=u(e=>{Dt=e},"setDiagramId"),Ke=u(()=>Dt,"getDiagramId"),Ue=u(()=>k,"getLogger"),He=u(function(){return dt},"getClasses"),Ze={getConfig:u(()=>lt().block,"getConfig"),typeStr2Type:qt,edgeTypeStr2Type:jt,edgeStrToEdgeData:Jt,getLogger:Ue,getBlocksFlat:Me,getBlocks:Pe,getEdges:Ye,setHierarchy:ze,getBlock:Xe,setBlock:We,getColumns:Ae,getClasses:He,clear:Oe,generateId:Re,setDiagramId:Fe,getDiagramId:Ke},qe=Ze,bt=u((e,t)=>{let a=fe,s=a(e,"r"),l=a(e,"g"),i=a(e,"b");return xe(s,l,i,t)},"fade"),je=u(e=>`.label {
|
|
7
|
-
font-family: ${e.fontFamily};
|
|
8
|
-
color: ${e.nodeTextColor||e.textColor};
|
|
9
|
-
}
|
|
10
|
-
.cluster-label text {
|
|
11
|
-
fill: ${e.titleColor};
|
|
12
|
-
}
|
|
13
|
-
.cluster-label span,p {
|
|
14
|
-
color: ${e.titleColor};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.label text,span,p {
|
|
20
|
-
fill: ${e.nodeTextColor||e.textColor};
|
|
21
|
-
color: ${e.nodeTextColor||e.textColor};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.node rect,
|
|
25
|
-
.node circle,
|
|
26
|
-
.node ellipse,
|
|
27
|
-
.node polygon,
|
|
28
|
-
.node path {
|
|
29
|
-
fill: ${e.mainBkg};
|
|
30
|
-
stroke: ${e.nodeBorder};
|
|
31
|
-
stroke-width: 1px;
|
|
32
|
-
}
|
|
33
|
-
.flowchart-label text {
|
|
34
|
-
text-anchor: middle;
|
|
35
|
-
}
|
|
36
|
-
// .flowchart-label .text-outer-tspan {
|
|
37
|
-
// text-anchor: middle;
|
|
38
|
-
// }
|
|
39
|
-
// .flowchart-label .text-inner-tspan {
|
|
40
|
-
// text-anchor: start;
|
|
41
|
-
// }
|
|
42
|
-
|
|
43
|
-
.node .label {
|
|
44
|
-
text-align: center;
|
|
45
|
-
}
|
|
46
|
-
.node.clickable {
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.arrowheadPath {
|
|
51
|
-
fill: ${e.arrowheadColor};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.edgePath .path {
|
|
55
|
-
stroke: ${e.lineColor};
|
|
56
|
-
stroke-width: 2.0px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.flowchart-link {
|
|
60
|
-
stroke: ${e.lineColor};
|
|
61
|
-
fill: none;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.edgeLabel {
|
|
65
|
-
background-color: ${e.edgeLabelBackground};
|
|
66
|
-
/*
|
|
67
|
-
* This is for backward compatibility with existing code that didn't
|
|
68
|
-
* add a \`<p>\` around edge labels.
|
|
69
|
-
*
|
|
70
|
-
* TODO: We should probably remove this in a future release.
|
|
71
|
-
*/
|
|
72
|
-
p {
|
|
73
|
-
margin: 0;
|
|
74
|
-
padding: 0;
|
|
75
|
-
display: inline;
|
|
76
|
-
}
|
|
77
|
-
rect {
|
|
78
|
-
opacity: 0.5;
|
|
79
|
-
background-color: ${e.edgeLabelBackground};
|
|
80
|
-
fill: ${e.edgeLabelBackground};
|
|
81
|
-
}
|
|
82
|
-
text-align: center;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/* For html labels only */
|
|
86
|
-
.labelBkg {
|
|
87
|
-
background-color: ${e.edgeLabelBackground};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.node .cluster {
|
|
91
|
-
// fill: ${bt(e.mainBkg,.5)};
|
|
92
|
-
fill: ${bt(e.clusterBkg,.5)};
|
|
93
|
-
stroke: ${bt(e.clusterBorder,.2)};
|
|
94
|
-
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
95
|
-
stroke-width: 1px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.cluster text {
|
|
99
|
-
fill: ${e.titleColor};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.cluster span,p {
|
|
103
|
-
color: ${e.titleColor};
|
|
104
|
-
}
|
|
105
|
-
/* .cluster div {
|
|
106
|
-
color: ${e.titleColor};
|
|
107
|
-
} */
|
|
108
|
-
|
|
109
|
-
div.mermaidTooltip {
|
|
110
|
-
position: absolute;
|
|
111
|
-
text-align: center;
|
|
112
|
-
max-width: 200px;
|
|
113
|
-
padding: 2px;
|
|
114
|
-
font-family: ${e.fontFamily};
|
|
115
|
-
font-size: 12px;
|
|
116
|
-
background: ${e.tertiaryColor};
|
|
117
|
-
border: 1px solid ${e.border2};
|
|
118
|
-
border-radius: 2px;
|
|
119
|
-
pointer-events: none;
|
|
120
|
-
z-index: 100;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.flowchartTitleText {
|
|
124
|
-
text-anchor: middle;
|
|
125
|
-
font-size: 18px;
|
|
126
|
-
fill: ${e.textColor};
|
|
127
|
-
}
|
|
128
|
-
${ue()}
|
|
129
|
-
`,"getStyles"),Je=je,Ve=u((e,t,a,s)=>{t.forEach(l=>{lr[l](e,a,s)})},"insertMarkers"),Ge=u((e,t,a)=>{k.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Qe=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),tr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),er=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),rr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),ar=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),ir=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),sr=u((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),nr=u((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),lr={extension:Ge,composition:Qe,aggregation:tr,dependency:er,lollipop:rr,point:ar,circle:ir,cross:sr,barb:nr},or=Ve,Kt,Ut,z=((Ut=(Kt=A())==null?void 0:Kt.block)==null?void 0:Ut.padding)??8;function kt(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};let a=t%e,s=Math.floor(t/e);return{px:a,py:s}}u(kt,"calculateBlockPosition");var cr=u(e=>{let t=0,a=0;for(let s of e.children){let{width:l,height:i,x:r,y:n}=s.size??{width:0,height:0,x:0,y:0};k.debug("getMaxChildSize abc95 child:",s.id,"width:",l,"height:",i,"x:",r,"y:",n,s.type),s.type!=="space"&&(l>t&&(t=l/(s.widthInColumns??1)),i>a&&(a=i))}return{width:t,height:a}},"getMaxChildSize");function gt(e,t,a=0,s=0){var r,n,o,x,d,p,m,f,w,E,L;k.debug("setBlockSizes abc95 (start)",e.id,(r=e==null?void 0:e.size)==null?void 0:r.x,"block width =",e==null?void 0:e.size,"siblingWidth",a),(n=e==null?void 0:e.size)!=null&&n.width||(e.size={width:a,height:s,x:0,y:0});let l=0,i=0;if(((o=e.children)==null?void 0:o.length)>0){for(let c of e.children)gt(c,t);let I=cr(e);l=I.width,i=I.height,k.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,i);for(let c of e.children)c.size&&(k.debug(`abc95 Setting size of children of ${e.id} id=${c.id} ${l} ${i} ${JSON.stringify(c.size)}`),c.size.width=l*(c.widthInColumns??1)+z*((c.widthInColumns??1)-1),c.size.height=i,c.size.x=0,c.size.y=0,k.debug(`abc95 updating size of ${e.id} children child:${c.id} maxWidth:${l} maxHeight:${i}`));for(let c of e.children)gt(c,t,l,i);let $=e.columns??-1,N=0;for(let c of e.children)N+=c.widthInColumns??1;let h=e.children.length;$>0&&$<N&&(h=$);let y=Math.ceil(N/h),b=h*(l+z)+z,D=y*(i+z)+z;if(b<a){k.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${s} width ${b}`),b=a,D=s;let c=(a-h*z-z)/h,_=(s-y*z-z)/y;k.debug("Size indata abc88",e.id,"childWidth",c,"maxWidth",l),k.debug("Size indata abc88",e.id,"childHeight",_,"maxHeight",i),k.debug("Size indata abc88 xSize",h,"padding",z);for(let g of e.children)g.size&&(g.size.width=c,g.size.height=_,g.size.x=0,g.size.y=0)}if(k.debug(`abc95 (finale calc) ${e.id} xSize ${h} ySize ${y} columns ${$}${e.children.length} width=${Math.max(b,((x=e.size)==null?void 0:x.width)||0)}`),b<(((d=e==null?void 0:e.size)==null?void 0:d.width)||0)){b=((p=e==null?void 0:e.size)==null?void 0:p.width)||0;let c=$>0?Math.min(e.children.length,$):e.children.length;if(c>0){let _=(b-c*z-z)/c;k.debug("abc95 (growing to fit) width",e.id,b,(m=e.size)==null?void 0:m.width,_);for(let g of e.children)g.size&&(g.size.width=_)}}e.size={width:b,height:D,x:0,y:0}}k.debug("setBlockSizes abc94 (done)",e.id,(f=e==null?void 0:e.size)==null?void 0:f.x,(w=e==null?void 0:e.size)==null?void 0:w.width,(E=e==null?void 0:e.size)==null?void 0:E.y,(L=e==null?void 0:e.size)==null?void 0:L.height)}u(gt,"setBlockSizes");function Nt(e,t){var s,l,i,r,n,o,x,d,p,m,f,w,E,L,I,$,N;k.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(s=e==null?void 0:e.size)==null?void 0:s.x} y: ${(l=e==null?void 0:e.size)==null?void 0:l.y} width: ${(i=e==null?void 0:e.size)==null?void 0:i.width}`);let a=e.columns??-1;if(k.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){let h=((n=(r=e==null?void 0:e.children[0])==null?void 0:r.size)==null?void 0:n.width)??0,y=e.children.length*h+(e.children.length-1)*z;k.debug("widthOfChildren 88",y,"posX");let b=new Map;{let S=0;for(let v of e.children){if(!v.size)continue;let{py:T}=kt(a,S),F=b.get(T)??0;v.size.height>F&&b.set(T,v.size.height);let W=(v==null?void 0:v.widthInColumns)??1;a>0&&(W=Math.min(W,a-S%a)),S+=W}}let D=new Map;{let S=0,v=[...b.keys()].sort((T,F)=>T-F);for(let T of v)D.set(T,S),S+=(b.get(T)??0)+z}let c=0;k.debug("abc91 block?.size?.x",e.id,(o=e==null?void 0:e.size)==null?void 0:o.x);let _=(x=e==null?void 0:e.size)!=null&&x.x?((d=e==null?void 0:e.size)==null?void 0:d.x)+(-((p=e==null?void 0:e.size)==null?void 0:p.width)/2||0):-z,g=0;for(let S of e.children){let v=e;if(!S.size)continue;let{width:T,height:F}=S.size,{px:W,py:G}=kt(a,c);if(G!=g&&(g=G,_=(m=e==null?void 0:e.size)!=null&&m.x?((f=e==null?void 0:e.size)==null?void 0:f.x)+(-((w=e==null?void 0:e.size)==null?void 0:w.width)/2||0):-z,k.debug("New row in layout for block",e.id," and child ",S.id,g)),k.debug(`abc89 layout blocks (child) id: ${S.id} Pos: ${c} (px, py) ${W},${G} (${(E=v==null?void 0:v.size)==null?void 0:E.x},${(L=v==null?void 0:v.size)==null?void 0:L.y}) parent: ${v.id} width: ${T}${z}`),v.size){let K=T/2;S.size.x=_+z+K,k.debug(`abc91 layout blocks (calc) px, pyid:${S.id} startingPos=X${_} new startingPosX${S.size.x} ${K} padding=${z} width=${T} halfWidth=${K} => x:${S.size.x} y:${S.size.y} ${S.widthInColumns} (width * (child?.w || 1)) / 2 ${T*((S==null?void 0:S.widthInColumns)??1)/2}`),_=S.size.x+K;let et=D.get(G)??0,rt=b.get(G)??F;S.size.y=v.size.y-v.size.height/2+et+rt/2+z,k.debug(`abc88 layout blocks (calc) px, pyid:${S.id}startingPosX${_}${z}${K}=>x:${S.size.x}y:${S.size.y}${S.widthInColumns}(width * (child?.w || 1)) / 2${T*((S==null?void 0:S.widthInColumns)??1)/2}`)}S.children&&Nt(S);let O=(S==null?void 0:S.widthInColumns)??1;a>0&&(O=Math.min(O,a-c%a)),c+=O,k.debug("abc88 columnsPos",S,c)}}k.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(I=e==null?void 0:e.size)==null?void 0:I.x} y: ${($=e==null?void 0:e.size)==null?void 0:$.y} width: ${(N=e==null?void 0:e.size)==null?void 0:N.width}`)}u(Nt,"layoutBlocks");function Tt(e,{minX:t,minY:a,maxX:s,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:i,y:r,width:n,height:o}=e.size;i-n/2<t&&(t=i-n/2),r-o/2<a&&(a=r-o/2),i+n/2>s&&(s=i+n/2),r+o/2>l&&(l=r+o/2)}if(e.children)for(let i of e.children)({minX:t,minY:a,maxX:s,maxY:l}=Tt(i,{minX:t,minY:a,maxX:s,maxY:l}));return{minX:t,minY:a,maxX:s,maxY:l}}u(Tt,"findBounds");function Vt(e){let t=e.getBlock("root");if(!t)return;gt(t,e,0,0),Nt(t),k.debug("getBlocks",JSON.stringify(t,null,2));let{minX:a,minY:s,maxX:l,maxY:i}=Tt(t),r=i-s,n=l-a;return{x:a,y:s,width:n,height:r}}u(Vt,"layout");var hr=u(async(e,t,a,s=!1,l=!1)=>{let i=t||"";typeof i=="object"&&(i=i[0]);let r=A(),n=X(r);return await _t(e,i,{style:a,isTitle:s,useHtmlLabels:n,markdown:!1,isNode:l,width:Number.POSITIVE_INFINITY},r)},"createLabel"),q=hr,dr=u((e,t,a,s,l)=>{t.arrowTypeStart&&Mt(e,"start",t.arrowTypeStart,a,s,l),t.arrowTypeEnd&&Mt(e,"end",t.arrowTypeEnd,a,s,l)},"addEdgeMarkers"),gr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Mt=u((e,t,a,s,l,i)=>{let r=gr[a];if(!r){k.warn(`Unknown arrow type: ${a}`);return}let n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${s}#${l}_${i}-${r}${n})`)},"addEdgeMarker"),Lt={},P={},ur=u(async(e,t)=>{let a=A(),s=X(a),l=e.insert("g").attr("class","edgeLabel"),i=l.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await _t(e,t.label,{style:t.labelStyle,useHtmlLabels:s,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);i.node().appendChild(n);let o=n.getBBox(),x=o;if(s){let p=n.children[0],m=C(n);o=p.getBoundingClientRect(),x=o,m.attr("width",o.width),m.attr("height",o.height)}else{let p=C(n).select("text").node();p&&typeof p.getBBox=="function"&&(x=p.getBBox())}i.attr("transform",at(x,s)),Lt[t.id]=l,t.width=o.width,t.height=o.height;let d;if(t.startLabelLeft){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(m,t.startLabelLeft,t.labelStyle);d=f;let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),P[t.id]||(P[t.id]={}),P[t.id].startLeft=p,st(d,t.startLabelLeft)}if(t.startLabelRight){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(p,t.startLabelRight,t.labelStyle);d=f,m.node().appendChild(f);let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),P[t.id]||(P[t.id]={}),P[t.id].startRight=p,st(d,t.startLabelRight)}if(t.endLabelLeft){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(m,t.endLabelLeft,t.labelStyle);d=f;let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),p.node().appendChild(f),P[t.id]||(P[t.id]={}),P[t.id].endLeft=p,st(d,t.endLabelLeft)}if(t.endLabelRight){let p=e.insert("g").attr("class","edgeTerminals"),m=p.insert("g").attr("class","inner"),f=await q(m,t.endLabelRight,t.labelStyle);d=f;let w=f.getBBox();if(s){let E=f.children[0],L=C(f);w=E.getBoundingClientRect(),L.attr("width",w.width),L.attr("height",w.height)}m.attr("transform",at(w,s)),p.node().appendChild(f),P[t.id]||(P[t.id]={}),P[t.id].endRight=p,st(d,t.endLabelRight)}return n},"insertEdgeLabel");function st(e,t){X(A())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}u(st,"setTerminalWidth");var yr=u((e,t)=>{k.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath,s=A(),{subGraphTitleTotalMargin:l}=Le(s);if(e.label){let i=Lt[e.id],r=e.x,n=e.y;if(a){let o=it.calcLabelPosition(a);k.debug("Moving label "+e.label+" from (",r,",",n,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(r=o.x,n=o.y)}i.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){let i=P[e.id].startLeft,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){let i=P[e.id].startRight,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){let i=P[e.id].endLeft,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){let i=P[e.id].endRight,r=e.x,n=e.y;if(a){let o=it.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=o.x,n=o.y}i.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),pr=u((e,t)=>{let a=e.x,s=e.y,l=Math.abs(t.x-a),i=Math.abs(t.y-s),r=e.width/2,n=e.height/2;return l>=r||i>=n},"outsideNode"),xr=u((e,t,a)=>{k.debug(`intersection calc abc89:
|
|
130
|
-
outsidePoint: ${JSON.stringify(t)}
|
|
131
|
-
insidePoint : ${JSON.stringify(a)}
|
|
132
|
-
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let s=e.x,l=e.y,i=Math.abs(s-a.x),r=e.width/2,n=a.x<t.x?r-i:r+i,o=e.height/2,x=Math.abs(t.y-a.y),d=Math.abs(t.x-a.x);if(Math.abs(l-t.y)*r>Math.abs(s-t.x)*o){let p=a.y<t.y?t.y-o-l:l-o-t.y;n=d*p/x;let m={x:a.x<t.x?a.x+n:a.x-d+n,y:a.y<t.y?a.y+x-p:a.y-x+p};return n===0&&(m.x=t.x,m.y=t.y),d===0&&(m.x=t.x),x===0&&(m.y=t.y),k.debug(`abc89 topp/bott calc, Q ${x}, q ${p}, R ${d}, r ${n}`,m),m}else{a.x<t.x?n=t.x-r-s:n=s-r-t.x;let p=x*n/d,m=a.x<t.x?a.x+d-n:a.x-d+n,f=a.y<t.y?a.y+p:a.y-p;return k.debug(`sides calc abc89, Q ${x}, q ${p}, R ${d}, r ${n}`,{_x:m,_y:f}),n===0&&(m=t.x,f=t.y),d===0&&(m=t.x),x===0&&(f=t.y),{x:m,y:f}}},"intersection"),Pt=u((e,t)=>{k.debug("abc88 cutPathAtIntersect",e,t);let a=[],s=e[0],l=!1;return e.forEach(i=>{if(!pr(t,i)&&!l){let r=xr(t,s,i),n=!1;a.forEach(o=>{n=n||o.x===r.x&&o.y===r.y}),a.some(o=>o.x===r.x&&o.y===r.y)||a.push(r),l=!0}else s=i,l||a.push(i)}),a},"cutPathAtIntersect"),fr=u(function(e,t,a,s,l,i,r){let n=a.points;k.debug("abc88 InsertEdge: edge=",a,"e=",t);let o=!1,x=i.node(t.v);var d=i.node(t.w);d!=null&&d.intersect&&(x!=null&&x.intersect)&&(n=n.slice(1,a.points.length-1),n.unshift(x.intersect(n[0])),n.push(d.intersect(n[n.length-1]))),a.toCluster&&(k.debug("to cluster abc88",s[a.toCluster]),n=Pt(a.points,s[a.toCluster].node),o=!0),a.fromCluster&&(k.debug("from cluster abc88",s[a.fromCluster]),n=Pt(n.reverse(),s[a.fromCluster].node).reverse(),o=!0);let p=n.filter(h=>!Number.isNaN(h.y)),m=we;a.curve&&(l==="graph"||l==="flowchart")&&(m=a.curve);let{x:f,y:w}=be(a),E=me().x(f).y(w).curve(m),L;switch(a.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-thick";break;default:L=""}switch(a.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break}let I=e.append("path").attr("d",E(p)).attr("id",a.id).attr("class"," "+L+(a.classes?" "+a.classes:"")).attr("style",a.style),$="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&($=ke(!0)),dr(I,a,$,r,l);let N={};return o&&(N.updatedPath=n),N.originalPath=a.points,N},"insertEdge"),br=u(e=>{let t=new Set;for(let a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),mr=u((e,t,a)=>{let s=br(e),l=2,i=t.height+2*a.padding,r=i/l,n=t.width+2*r+a.padding,o=a.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*o},{x:n-r,y:0},{x:n,y:0},{x:n,y:-i/3},{x:n+2*o,y:-i/2},{x:n,y:-2*i/3},{x:n,y:-i},{x:n-r,y:-i},{x:n/2,y:-i-2*o},{x:r,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*o,y:-i/2},{x:0,y:-i/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:r,y:-i},{x:0,y:-i/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:r,y:-i},{x:n-r,y:-i},{x:n,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-i+r},{x:0,y:-i}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-i+r},{x:n,y:-i}]:s.has("right")&&s.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:n-r,y:-i+o},{x:r,y:-i+o},{x:r,y:-i},{x:0,y:-i/2}]:s.has("up")&&s.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-i+o},{x:0,y:-i+o},{x:n/2,y:-i},{x:n,y:-i+o},{x:n-r,y:-i+o},{x:n-r,y:-o},{x:n,y:-o}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-i}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-i}]:s.has("left")&&s.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-i}]:s.has("left")&&s.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-i}]:s.has("right")?[{x:r,y:-o},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:n-r,y:-i+o},{x:r,y:-i+o},{x:r,y:-i+o}]:s.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:-i+o},{x:r,y:-i+o},{x:r,y:-i},{x:0,y:-i/2}]:s.has("up")?[{x:r,y:-o},{x:r,y:-i+o},{x:0,y:-i+o},{x:n/2,y:-i},{x:n,y:-i+o},{x:n-r,y:-i+o},{x:n-r,y:-o}]:s.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-i+o},{x:n-r,y:-i+o},{x:n-r,y:-o},{x:n,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function Gt(e,t){return e.intersect(t)}u(Gt,"intersectNode");var wr=Gt;function Qt(e,t,a,s){var l=e.x,i=e.y,r=l-s.x,n=i-s.y,o=Math.sqrt(t*t*n*n+a*a*r*r),x=Math.abs(t*a*r/o);s.x<l&&(x=-x);var d=Math.abs(t*a*n/o);return s.y<i&&(d=-d),{x:l+x,y:i+d}}u(Qt,"intersectEllipse");var te=Qt;function ee(e,t,a){return te(e,t,t,a)}u(ee,"intersectCircle");var kr=ee;function re(e,t,a,s){var l,i,r,n,o,x,d,p,m,f,w,E,L,I,$;if(l=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,m=l*a.x+r*a.y+o,f=l*s.x+r*s.y+o,!(m!==0&&f!==0&&St(m,f))&&(i=s.y-a.y,n=a.x-s.x,x=s.x*a.y-a.x*s.y,d=i*e.x+n*e.y+x,p=i*t.x+n*t.y+x,!(d!==0&&p!==0&&St(d,p))&&(w=l*n-i*r,w!==0)))return E=Math.abs(w/2),L=r*x-n*o,I=L<0?(L-E)/w:(L+E)/w,L=i*o-l*x,$=L<0?(L-E)/w:(L+E)/w,{x:I,y:$}}u(re,"intersectLine");function St(e,t){return e*t>0}u(St,"sameSign");var Lr=re,Sr=ae;function ae(e,t,a){var s=e.x,l=e.y,i=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),n=Math.min(n,w.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var o=s-e.width/2-r,x=l-e.height/2-n,d=0;d<t.length;d++){var p=t[d],m=t[d<t.length-1?d+1:0],f=Lr(e,a,{x:o+p.x,y:x+p.y},{x:o+m.x,y:x+m.y});f&&i.push(f)}return i.length?(i.length>1&&i.sort(function(w,E){var L=w.x-a.x,I=w.y-a.y,$=Math.sqrt(L*L+I*I),N=E.x-a.x,h=E.y-a.y,y=Math.sqrt(N*N+h*h);return $<y?-1:$===y?0:1}),i[0]):e}u(ae,"intersectPolygon");var _r=u((e,t)=>{var a=e.x,s=e.y,l=t.x-a,i=t.y-s,r=e.width/2,n=e.height/2,o,x;return Math.abs(i)*r>Math.abs(l)*n?(i<0&&(n=-n),o=i===0?0:n*l/i,x=n):(l<0&&(r=-r),o=r,x=l===0?0:r*i/l),{x:a+o,y:s+x}},"intersectRect"),Er=_r,B={node:wr,circle:kr,ellipse:te,polygon:Sr,rect:Er},M=u(async(e,t,a,s)=>{let l=A(),i,r=t.useHtmlLabels||X(l);a?i=a:i="node default";let n=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=n.insert("g").attr("class","label").attr("style",t.labelStyle),x;t.labelText===void 0?x="":x=typeof t.labelText=="string"?t.labelText:t.labelText[0];let d;t.labelType==="markdown"?d=_t(o,Bt(Ot(x),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):d=await q(o,Bt(Ot(x),l),t.labelStyle,!1,s);let p=d.getBBox(),m=t.padding/2;if(X(l)){let f=d.children[0],w=C(d);await _e(f,x),p=f.getBoundingClientRect(),w.attr("width",p.width),w.attr("height",p.height)}return r?o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):o.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:p,halfPadding:m,label:o}},"labelHelper"),R=u((e,t)=>{let a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function J(e,t,a,s){return e.insert("polygon",":first-child").attr("points",s.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}u(J,"insertPolygonShape");var Dr=u(async(e,t)=>{t.useHtmlLabels||X(A())||(t.centerLabel=!0);let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,"node "+t.classes,!0);k.info("Classes = ",t.classes);let i=a.insert("rect",":first-child");return i.attr("rx",t.rx).attr("ry",t.ry).attr("x",-s.width/2-l).attr("y",-s.height/2-l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),R(t,i),t.intersect=function(r){return B.rect(t,r)},a},"note"),vr=Dr,Yt=u(e=>e?" "+e:"","formatClass"),H=u((e,t)=>`${t||"node default"}${Yt(e.classes)} ${Yt(e.class)}`,"getClassesFromNode"),Xt=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=l+i,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];k.info("Question main (Circle)");let o=J(a,r,r,n);return o.attr("style",t.style),R(t,o),t.intersect=function(x){return k.warn("Intersect called"),B.polygon(t,n,x)},a},"question"),Nr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=28,l=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(i){return B.circle(t,14,i)},a},"choice"),Tr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=4,i=s.height+t.padding,r=i/l,n=s.width+2*r+t.padding,o=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-i/2},{x:n-r,y:-i},{x:r,y:-i},{x:0,y:-i/2}],x=J(a,n,i,o);return x.attr("style",t.style),R(t,x),t.intersect=function(d){return B.polygon(t,o,d)},a},"hexagon"),$r=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,void 0,!0),l=2,i=s.height+2*t.padding,r=i/l,n=s.width+2*r+t.padding,o=mr(t.directions,s,t),x=J(a,n,i,o);return x.attr("style",t.style),R(t,x),t.intersect=function(d){return B.polygon(t,o,d)},a},"block_arrow"),Ir=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:-i/2,y:0},{x:l,y:0},{x:l,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}];return J(a,l,i,r).attr("style",t.style),t.width=l+i,t.height=i,t.intersect=function(n){return B.polygon(t,r,n)},a},"rect_left_inv_arrow"),Cr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:-2*i/6,y:0},{x:l-i/6,y:0},{x:l+2*i/6,y:-i},{x:i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"lean_right"),Br=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:2*i/6,y:0},{x:l+i/6,y:0},{x:l-2*i/6,y:-i},{x:-i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"lean_left"),Or=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:-2*i/6,y:0},{x:l+2*i/6,y:0},{x:l-i/6,y:-i},{x:i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"trapezoid"),Rr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:i/6,y:0},{x:l-i/6,y:0},{x:l+2*i/6,y:-i},{x:-2*i/6,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"inv_trapezoid"),zr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:0,y:0},{x:l+i/2,y:0},{x:l,y:-i/2},{x:l+i/2,y:-i},{x:0,y:-i}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"rect_right_inv_arrow"),Ar=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=l/2,r=i/(2.5+l/50),n=s.height+r+t.padding,o="M 0,"+r+" a "+i+","+r+" 0,0,0 "+l+" 0 a "+i+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+i+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,x=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return R(t,x),t.intersect=function(d){let p=B.rect(t,d),m=p.x-t.x;if(i!=0&&(Math.abs(m)<t.width/2||Math.abs(m)==t.width/2&&Math.abs(p.y-t.y)>t.height/2-r)){let f=r*r*(1-m*m/(i*i));f!=0&&(f=Math.sqrt(f)),f=r-f,d.y-t.y>0&&(f=-f),p.y+=f}return p},a},"cylinder"),Mr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,"node "+t.classes+" "+t.class,!0),i=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,o=t.positioned?-r/2:-s.width/2-l,x=t.positioned?-n/2:-s.height/2-l;if(i.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",x).attr("width",r).attr("height",n),t.props){let d=new Set(Object.keys(t.props));t.props.borders&&(ut(i,t.props.borders,r,n),d.delete("borders")),d.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return R(t,i),t.intersect=function(d){return B.rect(t,d)},a},"rect"),Pr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,"node "+t.classes,!0),i=a.insert("rect",":first-child"),r=t.positioned?t.width:s.width+t.padding,n=t.positioned?t.height:s.height+t.padding,o=t.positioned?-r/2:-s.width/2-l,x=t.positioned?-n/2:-s.height/2-l;if(i.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",x).attr("width",r).attr("height",n),t.props){let d=new Set(Object.keys(t.props));t.props.borders&&(ut(i,t.props.borders,r,n),d.delete("borders")),d.forEach(p=>{k.warn(`Unknown node property ${p}`)})}return R(t,i),t.intersect=function(d){return B.rect(t,d)},a},"composite"),Yr=u(async(e,t)=>{let{shapeSvg:a}=await M(e,t,"label",!0);k.trace("Classes = ",t.class);let s=a.insert("rect",":first-child"),l=0,i=0;if(s.attr("width",l).attr("height",i),a.attr("class","label edgeLabel"),t.props){let r=new Set(Object.keys(t.props));t.props.borders&&(ut(s,t.props.borders,l,i),r.delete("borders")),r.forEach(n=>{k.warn(`Unknown node property ${n}`)})}return R(t,s),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function ut(e,t,a,s){let l=[],i=u(n=>{l.push(n,0)},"addBorder"),r=u(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(k.debug("add top border"),i(a)):r(a),t.includes("r")?(k.debug("add right border"),i(s)):r(s),t.includes("b")?(k.debug("add bottom border"),i(a)):r(a),t.includes("l")?(k.debug("add left border"),i(s)):r(s),e.attr("stroke-dasharray",l.join(" "))}u(ut,"applyNodePropertyBorders");var Xr=u(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";let s=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=s.insert("rect",":first-child"),i=s.insert("line"),r=s.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText,o="";typeof n=="object"?o=n[0]:o=n,k.info("Label text abc79",o,n,typeof n=="object");let x=await q(r,o,t.labelStyle,!0,!0),d={width:0,height:0};if(X(A())){let E=x.children[0],L=C(x);d=E.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}k.info("Text 2",n);let p=n.slice(1,n.length),m=x.getBBox(),f=await q(r,p.join?p.join("<br/>"):p,t.labelStyle,!0,!0);if(X(A())){let E=f.children[0],L=C(f);d=E.getBoundingClientRect(),L.attr("width",d.width),L.attr("height",d.height)}let w=t.padding/2;return C(f).attr("transform","translate( "+(d.width>m.width?0:(m.width-d.width)/2)+", "+(m.height+w+5)+")"),C(x).attr("transform","translate( "+(d.width<m.width?0:-(m.width-d.width)/2)+", 0)"),d=r.node().getBBox(),r.attr("transform","translate("+-d.width/2+", "+(-d.height/2-w+3)+")"),l.attr("class","outer title-state").attr("x",-d.width/2-w).attr("y",-d.height/2-w).attr("width",d.width+t.padding).attr("height",d.height+t.padding),i.attr("class","divider").attr("x1",-d.width/2-w).attr("x2",d.width/2+w).attr("y1",-d.height/2-w+m.height+w).attr("y2",-d.height/2-w+m.height+w),R(t,l),t.intersect=function(E){return B.rect(t,E)},s},"rectWithTitle"),Wr=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.height+t.padding,i=s.width+l/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-i/2).attr("y",-l/2).attr("width",i).attr("height",l);return R(t,r),t.intersect=function(n){return B.rect(t,n)},a},"stadium"),Fr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,H(t,void 0),!0),i=a.insert("circle",":first-child");return i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("Circle main"),R(t,i),t.intersect=function(r){return k.info("Circle intersect",t,s.width/2+l,r),B.circle(t,s.width/2+l,r)},a},"circle"),Kr=u(async(e,t)=>{let{shapeSvg:a,bbox:s,halfPadding:l}=await M(e,t,H(t,void 0),!0),i=5,r=a.insert("g",":first-child"),n=r.insert("circle"),o=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l+i).attr("width",s.width+t.padding+i*2).attr("height",s.height+t.padding+i*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",s.width/2+l).attr("width",s.width+t.padding).attr("height",s.height+t.padding),k.info("DoubleCircle main"),R(t,n),t.intersect=function(x){return k.info("DoubleCircle intersect",t,s.width/2+l+i,x),B.circle(t,s.width/2+l+i,x)},a},"doublecircle"),Ur=u(async(e,t)=>{let{shapeSvg:a,bbox:s}=await M(e,t,H(t,void 0),!0),l=s.width+t.padding,i=s.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-i},{x:0,y:-i},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-i},{x:-8,y:-i},{x:-8,y:0}],n=J(a,l,i,r);return n.attr("style",t.style),R(t,n),t.intersect=function(o){return B.polygon(t,r,o)},a},"subroutine"),Hr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),R(t,s),t.intersect=function(l){return B.circle(t,7,l)},a},"start"),Wt=u((e,t,a)=>{let s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=70,i=10;a==="LR"&&(l=10,i=70);let r=s.append("rect").attr("x",-1*l/2).attr("y",-1*i/2).attr("width",l).attr("height",i).attr("class","fork-join");return R(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return B.rect(t,n)},s},"forkJoin"),Zr=u((e,t)=>{let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),s.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),R(t,l),t.intersect=function(i){return B.circle(t,7,i)},a},"end"),qr=u(async(e,t)=>{var c;let a=t.padding/2,s=4,l=8,i;t.classes?i="node "+t.classes:i="node default";let r=e.insert("g").attr("class",i).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),o=r.insert("line"),x=r.insert("line"),d=0,p=s,m=r.insert("g").attr("class","label"),f=0,w=(c=t.classData.annotations)==null?void 0:c[0],E=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",L=await q(m,E,t.labelStyle,!0,!0),I=L.getBBox();if(X(A())){let _=L.children[0],g=C(L);I=_.getBoundingClientRect(),g.attr("width",I.width),g.attr("height",I.height)}t.classData.annotations[0]&&(p+=I.height+s,d+=I.width);let $=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(X(A())?$+="<"+t.classData.type+">":$+="<"+t.classData.type+">");let N=await q(m,$,t.labelStyle,!0,!0);C(N).attr("class","classTitle");let h=N.getBBox();if(X(A())){let _=N.children[0],g=C(N);h=_.getBoundingClientRect(),g.attr("width",h.width),g.attr("height",h.height)}p+=h.height+s,h.width>d&&(d=h.width);let y=[];t.classData.members.forEach(async _=>{let g=_.getDisplayDetails(),S=g.displayText;X(A())&&(S=S.replace(/</g,"<").replace(/>/g,">"));let v=await q(m,S,g.cssStyle?g.cssStyle:t.labelStyle,!0,!0),T=v.getBBox();if(X(A())){let F=v.children[0],W=C(v);T=F.getBoundingClientRect(),W.attr("width",T.width),W.attr("height",T.height)}T.width>d&&(d=T.width),p+=T.height+s,y.push(v)}),p+=l;let b=[];if(t.classData.methods.forEach(async _=>{let g=_.getDisplayDetails(),S=g.displayText;X(A())&&(S=S.replace(/</g,"<").replace(/>/g,">"));let v=await q(m,S,g.cssStyle?g.cssStyle:t.labelStyle,!0,!0),T=v.getBBox();if(X(A())){let F=v.children[0],W=C(v);T=F.getBoundingClientRect(),W.attr("width",T.width),W.attr("height",T.height)}T.width>d&&(d=T.width),p+=T.height+s,b.push(v)}),p+=l,w){let _=(d-I.width)/2;C(L).attr("transform","translate( "+(-1*d/2+_)+", "+-1*p/2+")"),f=I.height+s}let D=(d-h.width)/2;return C(N).attr("transform","translate( "+(-1*d/2+D)+", "+(-1*p/2+f)+")"),f+=h.height+s,o.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-p/2-a+l+f).attr("y2",-p/2-a+l+f),f+=l,y.forEach(_=>{C(_).attr("transform","translate( "+-d/2+", "+(-1*p/2+f+l/2)+")");let g=_==null?void 0:_.getBBox();f+=((g==null?void 0:g.height)??0)+s}),f+=l,x.attr("class","divider").attr("x1",-d/2-a).attr("x2",d/2+a).attr("y1",-p/2-a+l+f).attr("y2",-p/2-a+l+f),f+=l,b.forEach(_=>{C(_).attr("transform","translate( "+-d/2+", "+(-1*p/2+f)+")");let g=_==null?void 0:_.getBBox();f+=((g==null?void 0:g.height)??0)+s}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-d/2-a).attr("y",-(p/2)-a).attr("width",d+t.padding).attr("height",p+t.padding),R(t,n),t.intersect=function(_){return B.rect(t,_)},r},"class_box"),Ft={rhombus:Xt,composite:Pr,question:Xt,rect:Mr,labelRect:Yr,rectWithTitle:Xr,choice:Nr,circle:Fr,doublecircle:Kr,stadium:Wr,hexagon:Tr,block_arrow:$r,rect_left_inv_arrow:Ir,lean_right:Cr,lean_left:Br,trapezoid:Or,inv_trapezoid:Rr,rect_right_inv_arrow:zr,cylinder:Ar,start:Hr,end:Zr,note:vr,subroutine:Ur,fork:Wt,join:Wt,class_box:qr},ht={},ie=u(async(e,t,a)=>{let s,l;if(t.link){let i;A().securityLevel==="sandbox"?i="_top":t.linkTarget&&(i=t.linkTarget||"_blank"),s=e.insert("svg:a").attr("xlink:href",t.link).attr("target",i),l=await Ft[t.shape](s,t,a)}else l=await Ft[t.shape](e,t,a),s=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),ht[t.id]=s,t.haveCallback&&ht[t.id].attr("class",ht[t.id].attr("class")+" clickable"),s},"insertNode"),jr=u(e=>{let t=ht[e.id];k.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let a=8,s=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+s-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),s},"positionNode");function $t(e,t,a=!1){var m,f,w;let s=e,l="default";(((m=s==null?void 0:s.classes)==null?void 0:m.length)||0)>0&&(l=((s==null?void 0:s.classes)??[]).join(" ")),l=l+" flowchart-label";let i=0,r="",n;switch(s.type){case"round":i=5,r="rect";break;case"composite":i=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}let o=Ee((s==null?void 0:s.styles)??[]),x=s.label,d=s.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:o.labelStyle,shape:r,labelText:x,rx:i,ry:i,class:l,style:o.style,id:s.id,domId:p?`${p}-${s.id}`:s.id,directions:s.directions,width:d.width,height:d.height,x:d.x,y:d.y,positioned:a,intersect:void 0,type:s.type,padding:n??((w=(f=lt())==null?void 0:f.block)==null?void 0:w.padding)??0}}u($t,"getNodeFromBlock");async function se(e,t,a){let s=$t(t,a,!1);if(s.type==="group")return;let l=lt(),i=await ie(e,s,{config:l}),r=i.node().getBBox(),n=a.getBlock(s.id);n.size={width:r.width,height:r.height,x:0,y:0,node:i},a.setBlock(n),i.remove()}u(se,"calculateBlockSize");async function ne(e,t,a){let s=$t(t,a,!0);if(a.getBlock(s.id).type!=="space"){let l=lt();await ie(e,s,{config:l}),t.intersect=s==null?void 0:s.intersect,jr(s)}}u(ne,"insertBlockPositioned");async function yt(e,t,a,s){for(let l of t)await s(e,l,a),l.children&&await yt(e,l.children,a,s)}u(yt,"performOperations");async function le(e,t,a){await yt(e,t,a,se)}u(le,"calculateBlockSizes");async function oe(e,t,a){await yt(e,t,a,ne)}u(oe,"insertBlocks");async function ce(e,t,a,s,l){let i=new ge({multigraph:!0,compound:!0});i.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let r of a)r.size&&i.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(let r of t)if(r.start&&r.end){let n=s.getBlock(r.start),o=s.getBlock(r.end);if(n!=null&&n.size&&(o!=null&&o.size)){let x=n.size,d=o.size,p=[{x:x.x,y:x.y},{x:x.x+(d.x-x.x)/2,y:x.y+(d.y-x.y)/2},{x:d.x,y:d.y}],m=l?`${l}-${r.id}`:r.id;fr(e,{v:r.start,w:r.end,name:m},{...r,id:m,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",i,l),r.label&&(await ur(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:p,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),yr({...r,x:p[1].x,y:p[1].y},{originalPath:p}))}}}u(ce,"insertEdges");var Jr=u(function(e,t){return t.db.getClasses()},"getClasses"),Vr=u(async function(e,t,a,s){let{securityLevel:l,block:i}=lt(),r=s.db;r.setDiagramId(t);let n;l==="sandbox"&&(n=C("#i"+t));let o=l==="sandbox"?C(n.nodes()[0].contentDocument.body):C("body"),x=l==="sandbox"?o.select(`[id="${t}"]`):C(`[id="${t}"]`);or(x,["point","circle","cross"],s.type,t);let d=r.getBlocks(),p=r.getBlocksFlat(),m=r.getEdges(),f=x.insert("g").attr("class","block");await le(f,d,r);let w=Vt(r);if(await oe(f,d,r),await ce(f,m,p,r,t),w){let E=w,L=Math.max(1,Math.round(.125*(E.width/E.height))),I=E.height+L+10,$=E.width+10,{useMaxWidth:N}=i;ye(x,I,$,!!N),k.debug("Here Bounds",w,E),x.attr("viewBox",`${E.x-5} ${E.y-5} ${E.width+10} ${E.height+10}`)}},"draw"),Gr={draw:Vr,getClasses:Jr},ia={parser:ve,db:qe,renderer:Gr,styles:Je};export{ia as diagram};
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import{m as Zt}from"./chunk-TBF5ZNIQ-DL5stGM1.js";import{y as Qt}from"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as d,p as _,q as w,P as te,U as ee,s as se,e as ie,l as re,a as ae,h as ne,n as oe,an as le,C as K,o as ce}from"./index-BgeqpYgd.js";var Ct=function(){var t=d(function(F,n,o,g){for(o=o||{},g=F.length;g--;o[F[g]]=n);return o},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],l=[1,9],h=[1,11],y=[1,16],u=[1,17],S=[1,18],m=[1,19],b=[1,33],D=[1,20],O=[1,21],I=[1,22],R=[1,23],E=[1,24],p=[1,26],x=[1,27],v=[1,28],B=[1,29],j=[1,30],G=[1,31],P=[1,32],it=[1,35],rt=[1,36],at=[1,37],nt=[1,38],J=[1,34],f=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ot=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],vt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:d(function(F,n,o,g,k,r,L){var c=r.length-1;switch(k){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:let ht=r[c-1];ht.description=g.trimColon(r[c]),this.$=ht;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:let dt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:dt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var z=r[c],V=r[c-2].trim();if(r[c].match(":")){var ct=r[c].split(":");z=ct[0],V=[V,ct[1]]}this.$={stmt:"state",id:z,type:"default",description:V};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:l,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:u,19:S,22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:u,19:S,22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,7]),t(f,[2,8]),t(f,[2,9]),t(f,[2,10]),t(f,[2,11]),t(f,[2,12],{14:[1,40],15:[1,41]}),t(f,[2,16]),{18:[1,42]},t(f,[2,18],{20:[1,43]}),{23:[1,44]},t(f,[2,22]),t(f,[2,23]),t(f,[2,24]),t(f,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(f,[2,28]),{34:[1,49]},{36:[1,50]},t(f,[2,31]),{13:51,24:b,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ot,[2,44],{58:[1,56]}),t(ot,[2,45],{58:[1,57]}),t(f,[2,38]),t(f,[2,39]),t(f,[2,40]),t(f,[2,41]),t(f,[2,6]),t(f,[2,13]),{13:58,24:b,57:J},t(f,[2,17]),t(vt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(f,[2,29]),t(f,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(f,[2,14],{14:[1,71]}),{4:l,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:u,19:S,21:[1,72],22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(f,[2,34]),t(f,[2,35]),t(f,[2,36]),t(f,[2,37]),t(ot,[2,46]),t(ot,[2,47]),t(f,[2,15]),t(f,[2,19]),t(vt,i,{7:78}),t(f,[2,26]),t(f,[2,27]),{5:[1,79]},{5:[1,80]},{4:l,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:u,19:S,21:[1,81],22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,32]),t(f,[2,33]),t(f,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:d(function(F,n){if(n.recoverable)this.trace(F);else{var o=new Error(F);throw o.hash=n,o}},"parseError"),parse:d(function(F){var n=this,o=[0],g=[],k=[null],r=[],L=this.table,c="",z=0,V=0,ct=0,ht=2,dt=1,Vt=r.slice.call(arguments,1),T=Object.create(this.lexer),U={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(U.yy[St]=this.yy[St]);T.setInput(F,U.yy),U.yy.lexer=T,U.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var kt=T.yylloc;r.push(kt);var Xt=T.options&&T.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ht(A){o.length=o.length-2*A,k.length=k.length-A,r.length=r.length-A}d(Ht,"popStack");function Lt(){var A;return A=g.pop()||T.lex()||dt,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=n.symbols_[A]||A),A}d(Lt,"lex");for(var $,_t,M,N,we,Tt,X={},ut,Y,It,pt;;){if(M=o[o.length-1],this.defaultActions[M]?N=this.defaultActions[M]:(($===null||typeof $>"u")&&($=Lt()),N=L[M]&&L[M][$]),typeof N>"u"||!N.length||!N[0]){var bt="";pt=[];for(ut in L[M])this.terminals_[ut]&&ut>ht&&pt.push("'"+this.terminals_[ut]+"'");T.showPosition?bt="Parse error on line "+(z+1)+`:
|
|
2
|
-
`+T.showPosition()+`
|
|
3
|
-
Expecting `+pt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":bt="Parse error on line "+(z+1)+": Unexpected "+($==dt?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(bt,{text:T.match,token:this.terminals_[$]||$,line:T.yylineno,loc:kt,expected:pt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+$);switch(N[0]){case 1:o.push($),k.push(T.yytext),r.push(T.yylloc),o.push(N[1]),$=null,_t?($=_t,_t=null):(V=T.yyleng,c=T.yytext,z=T.yylineno,kt=T.yylloc,ct>0);break;case 2:if(Y=this.productions_[N[1]][1],X.$=k[k.length-Y],X._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},Xt&&(X._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]]),Tt=this.performAction.apply(X,[c,V,z,U.yy,N[1],k,r].concat(Vt)),typeof Tt<"u")return Tt;Y&&(o=o.slice(0,-1*Y*2),k=k.slice(0,-1*Y),r=r.slice(0,-1*Y)),o.push(this.productions_[N[1]][0]),k.push(X.$),r.push(X._$),It=L[o[o.length-2]][o[o.length-1]],o.push(It);break;case 3:return!0}}return!0},"parse")},Jt=function(){var F={EOF:1,parseError:d(function(n,o){if(this.yy.parser)this.yy.parser.parseError(n,o);else throw new Error(n)},"parseError"),setInput:d(function(n,o){return this.yy=o||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:d(function(n){var o=n.length,g=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.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:g?(g.length===k.length?this.yylloc.first_column:0)+k[k.length-g.length].length-g[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(n){this.unput(this.match.slice(n))},"less"),pastInput:d(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
-
`+o+"^"},"showPosition"),test_match:d(function(n,o){var g,k,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))),k=n[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],g=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var L in r)this[L]=r[L];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,o,g,k;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),L=0;L<r.length;L++)if(g=this._input.match(this.rules[r[L]]),g&&(!o||g[0].length>o[0].length)){if(o=g,k=L,this.options.backtrack_lexer){if(n=this.test_match(g,r[L]),n!==!1)return n;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(n=this.test_match(o,r[k]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var n=this.next();return n||this.lex()},"lex"),begin:d(function(n){this.conditionStack.push(n)},"begin"),popState:d(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:d(function(n){this.begin(n)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(n,o,g,k){switch(g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),o.yytext=o.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),o.yytext=o.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),o.yytext=o.yytext.substr(2).trim(),31;case 70:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return o.yytext=o.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78,79],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return F}();mt.lexer=Jt;function lt(){this.yy={}}return d(lt,"Parser"),lt.prototype=mt,mt.Parser=lt,new lt}();Ct.parser=Ct;var Ye=Ct,Z="state",H="root",Dt="relation",he="classDef",de="style",ue="applyClass",et="default",Ft="divider",Yt="fill:none",Gt="fill: #333",Pt="markdown",Wt="normal",Et="rect",$t="rectWithTitle",pe="stateStart",ye="stateEnd",At="divider",Nt="roundedWithTitle",fe="note",ge="noteGroup",st="statediagram",me="state",Se=`${st}-${me}`,jt="transition",ke="note",_e="note-edge",Te=`${jt} ${_e}`,be=`${st}-${ke}`,Ee="cluster",$e=`${st}-${Ee}`,Ce="cluster-alt",De=`${st}-${Ce}`,zt="parent",Ut="note",xe="state",xt="----",ve=`${xt}${Ut}`,Ot=`${xt}${zt}`,Mt=d((t,e="TB")=>{if(!t.doc)return e;let s=e;for(let a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),Le=d(function(t,e){return e.db.getClasses()},"getClasses"),Ie=d(async function(t,e,s,a){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);let{securityLevel:i,state:l,layout:h}=w();a.db.extract(a.db.getRootDocV2());let y=a.db.getData(),u=Zt(e,i);y.type=a.type,y.layoutAlgorithm=h,y.nodeSpacing=(l==null?void 0:l.nodeSpacing)||50,y.rankSpacing=(l==null?void 0:l.rankSpacing)||50,w().look==="neo"?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=e,await te(y,u);let S=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((m,b)=>{var x;let D=typeof b=="string"?b:typeof(b==null?void 0:b.id)=="string"?b.id:"";if(!D){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(b));return}let O=(x=u.node())==null?void 0:x.querySelectorAll("g"),I;if(O==null||O.forEach(v=>{var B;((B=v.textContent)==null?void 0:B.trim())===D&&(I=v)}),!I){_.warn("⚠️ Could not find node matching text:",D);return}let R=I.parentNode;if(!R){_.warn("⚠️ Node has no parent, cannot wrap:",D);return}let E=document.createElementNS("http://www.w3.org/2000/svg","a"),p=m.url.replace(/^"+|"+$/g,"");if(E.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p),E.setAttribute("target","_blank"),m.tooltip){let v=m.tooltip.replace(/^"+|"+$/g,"");E.setAttribute("title",v)}R.replaceChild(E,I),E.appendChild(I),_.info("🔗 Wrapped node in <a> tag for:",D,m.url)})}catch(m){_.error("❌ Error injecting clickable links:",m)}ee.insertTitle(u,"statediagramTitleText",(l==null?void 0:l.titleTopMargin)??25,a.db.getDiagramTitle()),Qt(u,S,st,(l==null?void 0:l.useMaxWidth)??!0)},"draw"),Ge={getClasses:Le,draw:Ie,getDir:Mt},ft=new Map,W=0;function gt(t="",e=0,s="",a=xt){let i=s!==null&&s.length>0?`${a}${s}`:"";return`${xe}-${t}${i}-${e}`}d(gt,"stateDomId");var Ae=d((t,e,s,a,i,l,h,y)=>{_.trace("items",e),e.forEach(u=>{switch(u.stmt){case Z:tt(t,u,s,a,i,l,h,y);break;case et:tt(t,u,s,a,i,l,h,y);break;case Dt:{tt(t,u.state1,s,a,i,l,h,y),tt(t,u.state2,s,a,i,l,h,y);let S=h==="neo",m={id:"edge"+W,start:u.state1.id,end:u.state2.id,arrowhead:"normal",arrowTypeEnd:S?"arrow_barb_neo":"arrow_barb",style:Yt,labelStyle:"",label:K.sanitizeText(u.description??"",w()),arrowheadStyle:Gt,labelpos:"c",labelType:Pt,thickness:Wt,classes:jt,look:h};i.push(m),W++}break}})},"setupDoc"),wt=d((t,e="TB")=>{let s=e;if(t.doc)for(let a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function Q(t,e,s){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{let l=s.get(i);l&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...l.styles])}));let a=t.find(i=>i.id===e.id);a?Object.assign(a,e):t.push(e)}d(Q,"insertOrUpdateNode");function Kt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}d(Kt,"getClassesFromDbInfo");function qt(t){return(t==null?void 0:t.styles)??[]}d(qt,"getStylesFromDbInfo");var tt=d((t,e,s,a,i,l,h,y)=>{var O,I,R;let u=e.id,S=s.get(u),m=Kt(S),b=qt(S),D=w();if(_.info("dataFetcher parsedItem",e,S,b),u!=="root"){let E=Et;e.start===!0?E=pe:e.start===!1&&(E=ye),e.type!==et&&(E=e.type),ft.get(u)||ft.set(u,{id:u,shape:E,description:K.sanitizeText(u,D),cssClasses:`${m} ${Se}`,cssStyles:b});let p=ft.get(u);e.description&&(Array.isArray(p.description)?(p.shape=$t,p.description.push(e.description)):(O=p.description)!=null&&O.length&&p.description.length>0?(p.shape=$t,p.description===u?p.description=[e.description]:p.description=[p.description,e.description]):(p.shape=Et,p.description=e.description),p.description=K.sanitizeTextOrArray(p.description,D)),((I=p.description)==null?void 0:I.length)===1&&p.shape===$t&&(p.type==="group"?p.shape=Nt:p.shape=Et),!p.type&&e.doc&&(_.info("Setting cluster for XCX",u,wt(e)),p.type="group",p.isGroup=!0,p.dir=wt(e),p.shape=e.type===Ft?At:Nt,p.cssClasses=`${p.cssClasses} ${$e} ${l?De:""}`);let x={labelStyle:"",shape:p.shape,label:p.description,cssClasses:p.cssClasses,cssCompiledStyles:[],cssStyles:p.cssStyles,id:u,dir:p.dir,domId:gt(u,W),type:p.type,isGroup:p.type==="group",padding:8,rx:10,ry:10,look:h,labelType:"markdown"};if(x.shape===At&&(x.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",u," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){let v={labelStyle:"",shape:fe,label:e.note.text,labelType:"markdown",cssClasses:be,cssStyles:[],cssCompiledStyles:[],id:u+ve+"-"+W,domId:gt(u,W,Ut),type:p.type,isGroup:p.type==="group",padding:(R=D.flowchart)==null?void 0:R.padding,look:h,position:e.note.position},B=u+Ot,j={labelStyle:"",shape:ge,label:e.note.text,cssClasses:p.cssClasses,cssStyles:[],id:u+Ot,domId:gt(u,W,zt),type:"group",isGroup:!0,padding:16,look:h,position:e.note.position};W++,j.id=B,v.parentId=B,Q(a,j,y),Q(a,v,y),Q(a,x,y);let G=u,P=v.id;e.note.position==="left of"&&(G=v.id,P=u),i.push({id:G+"-"+P,start:G,end:P,arrowhead:"none",arrowTypeEnd:"",style:Yt,labelStyle:"",classes:Te,arrowheadStyle:Gt,labelpos:"c",labelType:Pt,thickness:Wt,look:h})}else Q(a,x,y)}e.doc&&(_.trace("Adding nodes children "),Ae(e,e.doc,s,a,i,!l,h,y))},"dataFetcher"),Ne=d(()=>{ft.clear(),W=0},"reset"),C={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Rt=d(()=>new Map,"newClassesList"),Bt=d(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),yt=d(t=>JSON.parse(JSON.stringify(t)),"clone"),q,Pe=(q=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Rt(),this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=se,this.setAccTitle=ie,this.getAccDescription=re,this.setAccDescription=ae,this.setDiagramTitle=ne,this.getDiagramTitle=oe,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(let i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Z:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case Dt:this.addRelation(i.state1,i.state2,i.description);break;case he:this.addStyleClass(i.id.trim(),i.classes);break;case de:this.handleStyleDef(i);break;case ue:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}let s=this.getStates(),a=w();Ne(),tt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(let i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){let s=e.id.trim().split(","),a=e.styleClass.split(",");for(let i of s){let l=this.getState(i);if(!l){let h=i.trim();this.addState(h),l=this.getState(h)}l&&(l.styles=a.map(h=>{var y;return(y=h.replace(/;/g,""))==null?void 0:y.trim()}))}}setRootDoc(e){_.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===Dt){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===Z&&(s.id===C.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==H&&s.stmt!==Z||!s.doc)return;let i=[],l=[];for(let h of s.doc)if(h.type===Ft){let y=yt(h);y.doc=yt(l),i.push(y),l=[]}else l.push(h);if(i.length>0&&l.length>0){let h={stmt:Z,id:le(),type:"divider",doc:yt(l)};i.push(yt(h)),s.doc=i}s.doc.forEach(h=>this.docTranslator(s,h,!0))}getRootDocV2(){return this.docTranslator({id:H,stmt:H},{id:H,stmt:H,doc:this.rootDoc},!0),{id:H,doc:this.rootDoc}}addState(e,s=et,a=void 0,i=void 0,l=void 0,h=void 0,y=void 0,u=void 0){let S=e==null?void 0:e.trim();if(!this.currentDocument.states.has(S))_.info("Adding state ",S,i),this.currentDocument.states.set(S,{stmt:Z,id:S,descriptions:[],type:s,doc:a,note:l,classes:[],styles:[],textStyles:[]});else{let m=this.currentDocument.states.get(S);if(!m)throw new Error(`State not found: ${S}`);m.doc||(m.doc=a),m.type||(m.type=s)}if(i&&(_.info("Setting state description",S,i),(Array.isArray(i)?i:[i]).forEach(m=>this.addDescription(S,m.trim()))),l){let m=this.currentDocument.states.get(S);if(!m)throw new Error(`State not found: ${S}`);m.note=l,m.note.text=K.sanitizeText(m.note.text,w())}h&&(_.info("Setting state classes",S,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(S,m.trim()))),y&&(_.info("Setting state styles",S,y),(Array.isArray(y)?y:[y]).forEach(m=>this.setStyle(S,m.trim()))),u&&(_.info("Setting state styles",S,y),(Array.isArray(u)?u:[u]).forEach(m=>this.setTextStyle(S,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Rt(),e||(this.links=new Map,ce())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),_.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===C.START_NODE?(this.startEndCount++,`${C.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=et){return e===C.START_NODE?C.START_TYPE:s}endIdIfNeeded(e=""){return e===C.END_NODE?(this.startEndCount++,`${C.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=et){return e===C.END_NODE?C.END_TYPE:s}addRelationObjs(e,s,a=""){let i=this.startIdIfNeeded(e.id.trim()),l=this.startTypeIfNeeded(e.id.trim(),e.type),h=this.startIdIfNeeded(s.id.trim()),y=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(i,l,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(h,y,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:K.sanitizeText(a,w())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){let i=this.startIdIfNeeded(e.trim()),l=this.startTypeIfNeeded(e),h=this.endIdIfNeeded(s.trim()),y=this.endTypeIfNeeded(s);this.addState(i,l),this.addState(h,y),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:a?K.sanitizeText(a,w()):void 0})}}addDescription(e,s){var l;let a=this.currentDocument.states.get(e),i=s.startsWith(":")?s.replace(":","").trim():s;(l=a==null?void 0:a.descriptions)==null||l.push(K.sanitizeText(i,w()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let a=this.classes.get(e);s&&a&&s.split(C.STYLECLASS_SEP).forEach(i=>{let l=i.replace(/([^;]*);/,"$1").trim();if(RegExp(C.COLOR_KEYWORD).exec(i)){let h=l.replace(C.FILL_KEYWORD,C.BG_FILL).replace(C.COLOR_KEYWORD,C.FILL_KEYWORD);a.textStyles.push(h)}a.styles.push(l)})}getClasses(){return this.classes}setCssClass(e,s){e.split(",").forEach(a=>{var l;let i=this.getState(a);if(!i){let h=a.trim();this.addState(h),i=this.getState(h)}(l=i==null?void 0:i.classes)==null||l.push(s)})}setStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.styles)==null||i.push(s)}setTextStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.textStyles)==null||i.push(s)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt==="dir")}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??"TB"}setDirection(e){let s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:"dir",value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){let e=w();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Mt(this.getRootDocV2())}}getConfig(){return w().state}},d(q,"StateDB"),q.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},q),Oe=d(t=>`
|
|
7
|
-
defs [id$="-barbEnd"] {
|
|
8
|
-
fill: ${t.transitionColor};
|
|
9
|
-
stroke: ${t.transitionColor};
|
|
10
|
-
}
|
|
11
|
-
g.stateGroup text {
|
|
12
|
-
fill: ${t.nodeBorder};
|
|
13
|
-
stroke: none;
|
|
14
|
-
font-size: 10px;
|
|
15
|
-
}
|
|
16
|
-
g.stateGroup text {
|
|
17
|
-
fill: ${t.textColor};
|
|
18
|
-
stroke: none;
|
|
19
|
-
font-size: 10px;
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
g.stateGroup .state-title {
|
|
23
|
-
font-weight: bolder;
|
|
24
|
-
fill: ${t.stateLabelColor};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
g.stateGroup rect {
|
|
28
|
-
fill: ${t.mainBkg};
|
|
29
|
-
stroke: ${t.nodeBorder};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
g.stateGroup line {
|
|
33
|
-
stroke: ${t.lineColor};
|
|
34
|
-
stroke-width: ${t.strokeWidth||1};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.transition {
|
|
38
|
-
stroke: ${t.transitionColor};
|
|
39
|
-
stroke-width: ${t.strokeWidth||1};
|
|
40
|
-
fill: none;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.stateGroup .composit {
|
|
44
|
-
fill: ${t.background};
|
|
45
|
-
border-bottom: 1px
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.stateGroup .alt-composit {
|
|
49
|
-
fill: #e0e0e0;
|
|
50
|
-
border-bottom: 1px
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.state-note {
|
|
54
|
-
stroke: ${t.noteBorderColor};
|
|
55
|
-
fill: ${t.noteBkgColor};
|
|
56
|
-
|
|
57
|
-
text {
|
|
58
|
-
fill: ${t.noteTextColor};
|
|
59
|
-
stroke: none;
|
|
60
|
-
font-size: 10px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.stateLabel .box {
|
|
65
|
-
stroke: none;
|
|
66
|
-
stroke-width: 0;
|
|
67
|
-
fill: ${t.mainBkg};
|
|
68
|
-
opacity: 0.5;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.edgeLabel .label rect {
|
|
72
|
-
fill: ${t.labelBackgroundColor};
|
|
73
|
-
opacity: 0.5;
|
|
74
|
-
}
|
|
75
|
-
.edgeLabel {
|
|
76
|
-
background-color: ${t.edgeLabelBackground};
|
|
77
|
-
p {
|
|
78
|
-
background-color: ${t.edgeLabelBackground};
|
|
79
|
-
}
|
|
80
|
-
rect {
|
|
81
|
-
opacity: 0.5;
|
|
82
|
-
background-color: ${t.edgeLabelBackground};
|
|
83
|
-
fill: ${t.edgeLabelBackground};
|
|
84
|
-
}
|
|
85
|
-
text-align: center;
|
|
86
|
-
}
|
|
87
|
-
.edgeLabel .label text {
|
|
88
|
-
fill: ${t.transitionLabelColor||t.tertiaryTextColor};
|
|
89
|
-
}
|
|
90
|
-
.label div .edgeLabel {
|
|
91
|
-
color: ${t.transitionLabelColor||t.tertiaryTextColor};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.stateLabel text {
|
|
95
|
-
fill: ${t.stateLabelColor};
|
|
96
|
-
font-size: 10px;
|
|
97
|
-
font-weight: bold;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.node circle.state-start {
|
|
101
|
-
fill: ${t.specialStateColor};
|
|
102
|
-
stroke: ${t.specialStateColor};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.node .fork-join {
|
|
106
|
-
fill: ${t.specialStateColor};
|
|
107
|
-
stroke: ${t.specialStateColor};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.node circle.state-end {
|
|
111
|
-
fill: ${t.innerEndBackground};
|
|
112
|
-
stroke: ${t.background};
|
|
113
|
-
stroke-width: 1.5
|
|
114
|
-
}
|
|
115
|
-
.end-state-inner {
|
|
116
|
-
fill: ${t.compositeBackground||t.background};
|
|
117
|
-
// stroke: ${t.background};
|
|
118
|
-
stroke-width: 1.5
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.node rect {
|
|
122
|
-
fill: ${t.stateBkg||t.mainBkg};
|
|
123
|
-
stroke: ${t.stateBorder||t.nodeBorder};
|
|
124
|
-
stroke-width: ${t.strokeWidth||1}px;
|
|
125
|
-
}
|
|
126
|
-
.node polygon {
|
|
127
|
-
fill: ${t.mainBkg};
|
|
128
|
-
stroke: ${t.stateBorder||t.nodeBorder};;
|
|
129
|
-
stroke-width: ${t.strokeWidth||1}px;
|
|
130
|
-
}
|
|
131
|
-
[id$="-barbEnd"] {
|
|
132
|
-
fill: ${t.lineColor};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.statediagram-cluster rect {
|
|
136
|
-
fill: ${t.compositeTitleBackground};
|
|
137
|
-
stroke: ${t.stateBorder||t.nodeBorder};
|
|
138
|
-
stroke-width: ${t.strokeWidth||1}px;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.cluster-label, .nodeLabel {
|
|
142
|
-
color: ${t.stateLabelColor};
|
|
143
|
-
// line-height: 1;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.statediagram-cluster rect.outer {
|
|
147
|
-
rx: 5px;
|
|
148
|
-
ry: 5px;
|
|
149
|
-
}
|
|
150
|
-
.statediagram-state .divider {
|
|
151
|
-
stroke: ${t.stateBorder||t.nodeBorder};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.statediagram-state .title-state {
|
|
155
|
-
rx: 5px;
|
|
156
|
-
ry: 5px;
|
|
157
|
-
}
|
|
158
|
-
.statediagram-cluster.statediagram-cluster .inner {
|
|
159
|
-
fill: ${t.compositeBackground||t.background};
|
|
160
|
-
}
|
|
161
|
-
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
162
|
-
fill: ${t.altBackground?t.altBackground:"#efefef"};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.statediagram-cluster .inner {
|
|
166
|
-
rx:0;
|
|
167
|
-
ry:0;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.statediagram-state rect.basic {
|
|
171
|
-
rx: 5px;
|
|
172
|
-
ry: 5px;
|
|
173
|
-
}
|
|
174
|
-
.statediagram-state rect.divider {
|
|
175
|
-
stroke-dasharray: 10,10;
|
|
176
|
-
fill: ${t.altBackground?t.altBackground:"#efefef"};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.note-edge {
|
|
180
|
-
stroke-dasharray: 5;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.statediagram-note rect {
|
|
184
|
-
fill: ${t.noteBkgColor};
|
|
185
|
-
stroke: ${t.noteBorderColor};
|
|
186
|
-
stroke-width: 1px;
|
|
187
|
-
rx: 0;
|
|
188
|
-
ry: 0;
|
|
189
|
-
}
|
|
190
|
-
.statediagram-note rect {
|
|
191
|
-
fill: ${t.noteBkgColor};
|
|
192
|
-
stroke: ${t.noteBorderColor};
|
|
193
|
-
stroke-width: 1px;
|
|
194
|
-
rx: 0;
|
|
195
|
-
ry: 0;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.statediagram-note text {
|
|
199
|
-
fill: ${t.noteTextColor};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.statediagram-note .nodeLabel {
|
|
203
|
-
color: ${t.noteTextColor};
|
|
204
|
-
}
|
|
205
|
-
.statediagram .edgeLabel {
|
|
206
|
-
color: red; // ${t.noteTextColor};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
[id$="-dependencyStart"], [id$="-dependencyEnd"] {
|
|
210
|
-
fill: ${t.lineColor};
|
|
211
|
-
stroke: ${t.lineColor};
|
|
212
|
-
stroke-width: ${t.strokeWidth||1};
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.statediagramTitleText {
|
|
216
|
-
text-anchor: middle;
|
|
217
|
-
font-size: 18px;
|
|
218
|
-
fill: ${t.textColor};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
[data-look="neo"].statediagram-cluster rect {
|
|
222
|
-
fill: ${t.mainBkg};
|
|
223
|
-
stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};
|
|
224
|
-
stroke-width: ${t.strokeWidth??1};
|
|
225
|
-
}
|
|
226
|
-
[data-look="neo"].statediagram-cluster rect.outer {
|
|
227
|
-
rx: ${t.radius}px;
|
|
228
|
-
ry: ${t.radius}px;
|
|
229
|
-
filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}
|
|
230
|
-
}
|
|
231
|
-
`,"getStyles"),We=Oe;export{Ye as Y,Pe as _,We as g,Ge as q};
|