@shaohui_jin/git-cockpit-mcp-server 0.1.25 → 0.1.27
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/dist/{chunk-QPNAXPTK.js → chunk-3ALI2CBW.js} +3 -3
- package/dist/{chunk-563C4WZJ.js → chunk-G6SEOLMU.js} +2 -2
- package/dist/{chunk-FDPM74UE.js → chunk-HWO2V3M5.js} +2 -2
- package/dist/{chunk-FDPM74UE.js.map → chunk-HWO2V3M5.js.map} +1 -1
- package/dist/cli-entry.js +3 -3
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/dist/mcpServer.js +1 -1
- package/dist/web/assets/abnfDiagram-O67JEVCF-Cpmc29Vo.js +1 -0
- package/dist/web/assets/arc-C4CdJ3cz.js +1 -0
- package/dist/web/assets/architectureDiagram-NJMV4G6O-D-3EH44b.js +36 -0
- package/dist/web/assets/blockDiagram-BEXU5L5S-4o8DaZHq.js +140 -0
- package/dist/web/assets/c4Diagram-YGBWAQC7-DLufKbff.js +38 -0
- package/dist/web/assets/channel-D3CmON_0.js +1 -0
- package/dist/web/assets/chunk-2Q5K7J3B-dEtvq-Sm.js +1 -0
- package/dist/web/assets/chunk-3FUC2YCW-D8IY6i0n.js +2 -0
- package/dist/web/assets/chunk-5VM5RSS4-DTtnT10M.js +15 -0
- package/dist/web/assets/chunk-GTNCS2PH-CRKiRt85.js +88 -0
- package/dist/web/assets/chunk-GWA4HPMP-CapkHNd2.js +1 -0
- package/dist/web/assets/chunk-JWPE2WC7-D1qG9232.js +1 -0
- package/dist/web/assets/chunk-NETBCI7D-Cf5bzyqy.js +1 -0
- package/dist/web/assets/chunk-WEXAMYUT-aMK135IE.js +1 -0
- package/dist/web/assets/chunk-XXDRQBXY-DKObcU_j.js +1 -0
- package/dist/web/assets/classDiagram-v2-NBCMYWYE-BFKjdANY.js +217 -0
- package/dist/web/assets/cose-bilkent-JH36ORCC-Bbl702qf.js +1 -0
- package/dist/web/assets/cynefin-OW5HDTMX-BwkqOigD.js +178 -0
- package/dist/web/assets/cynefinDiagram-VND7K2PF-C032B141.js +62 -0
- package/dist/web/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
- package/dist/web/assets/dagre-6A5THRUB-mtU2etOs.js +4 -0
- package/dist/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/web/assets/diagram-22UHCM2B-Bhef_gli.js +200 -0
- package/dist/web/assets/diagram-3UASUU5V-Bt5jGMJj.js +24 -0
- package/dist/web/assets/diagram-ATOU4E4O-E9OEgrvO.js +3 -0
- package/dist/web/assets/diagram-CDSNMT55-Ev4KURRW.js +30 -0
- package/dist/web/assets/diagram-MLGK6HIB-VyRxPiEM.js +24 -0
- package/dist/web/assets/diagram-MPIPVDR6-NZUHIzSK.js +41 -0
- package/dist/web/assets/ebnfDiagram-ZINNZB2B-BWrpXmAB.js +1 -0
- package/dist/web/assets/{element-plus-DqfuixMM.js → element-plus-IBMLLhb-.js} +16 -16
- package/dist/web/assets/elk-276RUBZZ-BGHyKt3X.js +27 -0
- package/dist/web/assets/erDiagram-OPXOYQCR-GrSAUtcQ.js +99 -0
- package/dist/web/assets/flowDiagram-KWPJA3E3-B_WVUUVf.js +213 -0
- package/dist/web/assets/ganttDiagram-FUAMR5RP-DajvFrX3.js +292 -0
- package/dist/web/assets/gitGraphDiagram-X574FWY7-CrHV5Rvk.js +106 -0
- package/dist/web/assets/graph-DcfhsBxO.js +1 -0
- package/dist/web/assets/{index-CcJ_rkpc.css → index-COls5qGF.css} +1 -1
- package/dist/web/assets/index-DNSP9H_v.js +733 -0
- package/dist/web/assets/infoDiagram-VRGFBTTK-BVr7SUMq.js +2 -0
- package/dist/web/assets/init-Gi6I4Gst.js +1 -0
- package/dist/web/assets/ishikawaDiagram-OU5B5YK6-Clo1T4Ou.js +70 -0
- package/dist/web/assets/journeyDiagram-ZHPQQLJL-BJJiqW1W.js +139 -0
- package/dist/web/assets/kanban-definition-PNTS6WVX-FIP6aaWx.js +89 -0
- package/dist/web/assets/katex-C5jXJg4s.js +257 -0
- package/dist/web/assets/linear-gNF2RYPF.js +1 -0
- package/dist/web/assets/mindmap-definition-NLK3R4M7-U9ZgUluP.js +96 -0
- package/dist/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/web/assets/pegDiagram-GJSIUBJH-kqET45uW.js +1 -0
- package/dist/web/assets/pieDiagram-5QR66LMP-0Vfqg8YJ.js +39 -0
- package/dist/web/assets/quadrantDiagram-O4NWA36T-BwbgrFii.js +7 -0
- package/dist/web/assets/railroadDiagram-XR7U4H2S-AQGvMbOL.js +1 -0
- package/dist/web/assets/requirementDiagram-PLB6GJNP-WJNa_ucq.js +84 -0
- package/dist/web/assets/sankeyDiagram-IPEJSGJF-DTOl4R33.js +40 -0
- package/dist/web/assets/sequenceDiagram-PO4LG4MO-4xQidS78.js +169 -0
- package/dist/web/assets/sizeCapture-INFHLROL--JObXzuK.js +1 -0
- package/dist/web/assets/stateDiagram-v2-GCMORJYK-DO54xQHQ.js +291 -0
- package/dist/web/assets/swimlanes-2SLR337P-D2RfEaDP.js +1 -0
- package/dist/web/assets/swimlanesDiagram-TC7HE7FX-BTVqf00K.js +8 -0
- package/dist/web/assets/timeline-definition-EJHVYXUP-CjEGHstB.js +120 -0
- package/dist/web/assets/usecaseDiagram-POWQR4AR-B_QSF3HN.js +370 -0
- package/dist/web/assets/vennDiagram-UO4OBE2U-DaXBK4lA.js +34 -0
- package/dist/web/assets/wardleyDiagram-VNRHLVJA-DAcGG1ul.js +78 -0
- package/dist/web/assets/xychartDiagram-PMCCYNJV-C9NMkFcl.js +7 -0
- package/dist/web/index.html +3 -3
- package/dist/webServer.js +2 -2
- package/package.json +2 -2
- package/dist/web/assets/index-DFpy0R8H.js +0 -413
- /package/dist/{chunk-QPNAXPTK.js.map → chunk-3ALI2CBW.js.map} +0 -0
- /package/dist/{chunk-563C4WZJ.js.map → chunk-G6SEOLMU.js.map} +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import{g as Fe}from"./chunk-5VM5RSS4-DTtnT10M.js";import{aJ as Me,aK as me,aL as Ke,aM as Ye,aN as We,aO as Ve,aP as Ue,aQ as He,aR as Xe,aS as Ge,aT as je,aU as qe,aV as Je,aW as Ze,aX as Qe,aY as $e,aZ as et,a_ as tt,a$ as st,b0 as rt,b1 as it,b2 as at,b3 as nt,b4 as ot,b5 as ct,_ as h,L as U,k as J,b6 as lt,av as ut,d as gt,l as y,A as ht,C as dt,D as pt,E as ft,F as St,G as xt,c as ye,az as Lt,aC as mt,b7 as yt,m as bt,b8 as wt,am as be,b9 as Et,an as _t}from"./index-DNSP9H_v.js";import{G as Dt}from"./graph-DcfhsBxO.js";import{c as Tt}from"./channel-D3CmON_0.js";import"./vue-BhwNxZ68.js";import"./element-plus-IBMLLhb-.js";function Nt(e){return Array.isArray(e)}function It(e){if(Me(e))return e;const a=me(e);if(!Ot(e))return{};if(Nt(e)){const r=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(r.index=e.index,r.input=e.input),r}if(Ke(e)){const r=e,l=r.constructor;return new l(r.buffer,r.byteOffset,r.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const r=e,l=r.buffer,p=r.byteOffset,s=r.byteLength,g=new ArrayBuffer(s),x=new Uint8Array(l,p,s);return new Uint8Array(g).set(x),new DataView(g)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const r=e.constructor,l=new r(e.valueOf());return a==="[object String]"?vt(l,e):re(l,e),l}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const r=e,l=new RegExp(r.source,r.flags);return l.lastIndex=r.lastIndex,l}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const r=e,l=new Map;return r.forEach((p,s)=>{l.set(s,p)}),l}if(a==="[object Set]"){const r=e,l=new Set;return r.forEach(p=>{l.add(p)}),l}if(a==="[object Arguments]"){const r=e,l={};return re(l,r),l.length=r.length,l[Symbol.iterator]=r[Symbol.iterator],l}const c={};return At(c,e),re(c,e),Ct(c,e),c}function Ot(e){switch(me(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case je:case Ge:case Xe:case He:case Ue:case Ve:case We:case Ye:return!0;default:return!1}}function re(e,a){for(const c in a)Object.hasOwn(a,c)&&(e[c]=a[c])}function Ct(e,a){const c=Object.getOwnPropertySymbols(a);for(let r=0;r<c.length;r++){const l=c[r];Object.prototype.propertyIsEnumerable.call(a,l)&&(e[l]=a[l])}}function vt(e,a){const c=a.valueOf().length;for(const r in a)Object.hasOwn(a,r)&&(Number.isNaN(Number(r))||Number(r)>=c)&&(e[r]=a[r])}function At(e,a){const c=Object.getPrototypeOf(a);c!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,c)}var ae=(function(){var e=h(function(T,d,i,o){for(i=i||{},o=T.length;o--;i[T[o]]=d);return i},"o"),a=[1,15],c=[1,7],r=[1,13],l=[1,14],p=[1,19],s=[1,16],g=[1,17],x=[1,18],L=[8,30],S=[8,10,21,28,29,30,31,39,43,46],E=[1,23],A=[1,24],z=[8,10,15,16,21,28,29,30,31,39,43,46],_=[8,10,15,16,21,27,28,29,30,31,39,43,46],N=[1,49],I={trace:h(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:h(function(d,i,o,u,m,t,O){var n=t.length-1;switch(m){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[n-1]),u.setHierarchy(t[n-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[n]),typeof t[n].length=="number"?this.$=t[n]:this.$=[t[n]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[n-1]),this.$=[t[n-1]].concat(t[n]);break;case 14:u.getLogger().debug("Rule: link: ",t[n],d),this.$={edgeTypeStr:t[n],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[n-3],t[n-1],t[n]),this.$={edgeTypeStr:t[n],label:t[n-1]};break;case 18:const f=parseInt(t[n]),w=u.generateId();this.$={id:w,type:"space",label:"",width:f,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[n-2],t[n-1],t[n]," typestr: ",t[n-1].edgeTypeStr);const C=u.edgeStrToEdgeData(t[n-1].edgeTypeStr),M=u.edgeStrToEdgeStartData(t[n-1].edgeTypeStr),K=u.edgeStrToThickness(t[n-1].edgeTypeStr),b=u.edgeStrToPattern(t[n-1].edgeTypeStr);this.$=[{id:t[n-2].id,label:t[n-2].label,type:t[n-2].type,directions:t[n-2].directions},{id:t[n-2].id+"-"+t[n].id,start:t[n-2].id,end:t[n].id,label:t[n-1].label,type:"edge",thickness:K,pattern:b,directions:t[n].directions,arrowTypeEnd:C,arrowTypeStart:M},{id:t[n].id,label:t[n].label,type:u.typeStr2Type(t[n].typeStr),directions:t[n].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[n-1],t[n]),this.$={id:t[n-1].id,label:t[n-1].label,type:u.typeStr2Type(t[n-1].typeStr),directions:t[n-1].directions,widthInColumns:parseInt(t[n],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[n]),this.$={id:t[n].id,label:t[n].label,type:u.typeStr2Type(t[n].typeStr),directions:t[n].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[n]),this.$={type:"column-setting",columns:t[n]==="auto"?-1:parseInt(t[n])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[n-2],t[n-1]),u.generateId(),this.$={...t[n-2],type:"composite",children:t[n-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[n-2],t[n-1],t[n]);const B=u.generateId();this.$={id:B,type:"composite",label:"",children:t[n-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[n]),this.$={id:t[n]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[n-1],t[n]),this.$={id:t[n-1],label:t[n].label,typeStr:t[n].typeStr,directions:t[n].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[n]),this.$=[t[n]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[n-1],t[n]),this.$=[t[n-1]].concat(t[n]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[n-2],t[n-1],t[n]),this.$={typeStr:t[n-2]+t[n],label:t[n-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[n-3],t[n-2]," #3:",t[n-1],t[n]),this.$={typeStr:t[n-3]+t[n],label:t[n-2],directions:t[n-1]};break;case 35:case 36:this.$={type:"classDef",id:t[n-1].trim(),css:t[n].trim()};break;case 37:this.$={type:"applyClass",id:t[n-1].trim(),styleClass:t[n].trim()};break;case 38:this.$={type:"applyStyles",id:t[n-1].trim(),stylesStr:t[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:p,39:s,43:g,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:c,28:r,29:l,31:p,39:s,43:g,46:x}),e(S,[2,16],{14:22,15:E,16:A}),e(S,[2,17]),e(S,[2,18]),e(S,[2,19]),e(S,[2,20]),e(S,[2,21]),e(S,[2,22]),e(z,[2,25],{27:[1,25]}),e(S,[2,26]),{19:26,26:12,31:p},{10:a,11:27,13:4,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:p,39:s,43:g,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(_,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:p},{31:[2,14]},{17:[1,36]},e(z,[2,24]),{10:a,11:37,13:4,14:22,15:E,16:A,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:r,29:l,31:p,39:s,43:g,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(_,[2,30]),{18:[1,43]},{18:[1,44]},e(z,[2,23]),{18:[1,45]},{30:[1,46]},e(S,[2,28]),e(S,[2,35]),e(S,[2,36]),e(S,[2,37]),e(S,[2,38]),{36:[1,47]},{33:48,34:N},{15:[1,50]},e(S,[2,27]),e(_,[2,33]),{38:[1,51]},{33:52,34:N,38:[2,31]},{31:[2,15]},e(_,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:h(function(d,i){if(i.recoverable)this.trace(d);else{var o=new Error(d);throw o.hash=i,o}},"parseError"),parse:h(function(d){var i=this,o=[0],u=[],m=[null],t=[],O=this.table,n="",f=0,w=0,C=2,M=1,K=t.slice.call(arguments,1),b=Object.create(this.lexer),B={yy:{}};for(var Y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Y)&&(B.yy[Y]=this.yy[Y]);b.setInput(d,B.yy),B.yy.lexer=b,B.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var X=b.yylloc;t.push(X);var ee=b.options&&b.options.ranges;typeof B.yy.parseError=="function"?this.parseError=B.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(R){o.length=o.length-2*R,m.length=m.length-R,t.length=t.length-R}h(Pe,"popStack");function pe(){var R;return R=u.pop()||b.lex()||M,typeof R!="number"&&(R instanceof Array&&(u=R,R=u.pop()),R=i.symbols_[R]||R),R}h(pe,"lex");for(var k,V,P,te,H={},j,W,fe,q;;){if(V=o[o.length-1],this.defaultActions[V]?P=this.defaultActions[V]:((k===null||typeof k>"u")&&(k=pe()),P=O[V]&&O[V][k]),typeof P>"u"||!P.length||!P[0]){var se="";q=[];for(j in O[V])this.terminals_[j]&&j>C&&q.push("'"+this.terminals_[j]+"'");b.showPosition?se="Parse error on line "+(f+1)+`:
|
|
2
|
+
`+b.showPosition()+`
|
|
3
|
+
Expecting `+q.join(", ")+", got '"+(this.terminals_[k]||k)+"'":se="Parse error on line "+(f+1)+": Unexpected "+(k==M?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(se,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:X,expected:q})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+k);switch(P[0]){case 1:o.push(k),m.push(b.yytext),t.push(b.yylloc),o.push(P[1]),k=null,w=b.yyleng,n=b.yytext,f=b.yylineno,X=b.yylloc;break;case 2:if(W=this.productions_[P[1]][1],H.$=m[m.length-W],H._$={first_line:t[t.length-(W||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(W||1)].first_column,last_column:t[t.length-1].last_column},ee&&(H._$.range=[t[t.length-(W||1)].range[0],t[t.length-1].range[1]]),te=this.performAction.apply(H,[n,w,f,B.yy,P[1],m,t].concat(K)),typeof te<"u")return te;W&&(o=o.slice(0,-1*W*2),m=m.slice(0,-1*W),t=t.slice(0,-1*W)),o.push(this.productions_[P[1]][0]),m.push(H.$),t.push(H._$),fe=O[o[o.length-2]][o[o.length-1]],o.push(fe);break;case 3:return!0}}return!0},"parse")},D=(function(){var T={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(d,i){return this.yy=i||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var i=d.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:h(function(d){var i=d.length,o=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var m=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===u.length?this.yylloc.first_column:0)+u[u.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[m[0],m[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(d){this.unput(this.match.slice(d))},"less"),pastInput:h(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var d=this.pastInput(),i=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
|
|
5
|
+
`+i+"^"},"showPosition"),test_match:h(function(d,i){var o,u,m;if(this.options.backtrack_lexer&&(m={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&&(m.yylloc.range=this.yylloc.range.slice(0))),u=d[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,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(d[0].length),this.matched+=d[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in m)this[t]=m[t];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,i,o,u;this._more||(this.yytext="",this.match="");for(var m=this._currentRules(),t=0;t<m.length;t++)if(o=this._input.match(this.rules[m[t]]),o&&(!i||o[0].length>i[0].length)){if(i=o,u=t,this.options.backtrack_lexer){if(d=this.test_match(o,m[t]),d!==!1)return d;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(d=this.test_match(i,m[u]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var i=this.next();return i||this.lex()},"lex"),begin:h(function(i){this.conditionStack.push(i)},"begin"),popState:h(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:h(function(i){this.begin(i)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:h(function(i,o,u,m){switch(u){case 0:return i.getLogger().debug("Found block-beta"),10;case 1:return i.getLogger().debug("Found id-block"),29;case 2:return i.getLogger().debug("Found block"),10;case 3:i.getLogger().debug(".",o.yytext);break;case 4:i.getLogger().debug("_",o.yytext);break;case 5:return 5;case 6:return o.yytext=-1,28;case 7:return o.yytext=o.yytext.replace(/columns\s+/,""),i.getLogger().debug("COLUMNS (LEX)",o.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:i.getLogger().debug("LEX: POPPING STR:",o.yytext),this.popState();break;case 13:return i.getLogger().debug("LEX: STR end:",o.yytext),"STR";case 14:return o.yytext=o.yytext.replace(/space\:/,""),i.getLogger().debug("SPACE NUM (LEX)",o.yytext),21;case 15:return o.yytext="1",i.getLogger().debug("COLUMNS (LEX)",o.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(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),i.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),i.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),i.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),i.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),i.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),i.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),i.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),i.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),i.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),i.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),i.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),i.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return i.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return i.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return i.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return i.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return i.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return i.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return i.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return i.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 i.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),i.getLogger().debug("LEX ARR START"),37;case 74:return i.getLogger().debug("Lex: NODE_ID",o.yytext),31;case 75:return i.getLogger().debug("Lex: EOF",o.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:i.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:i.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return i.getLogger().debug("LEX: NODE_DESCR:",o.yytext),"NODE_DESCR";case 83:i.getLogger().debug("LEX POPPING"),this.popState();break;case 84:i.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return o.yytext=o.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (right): dir:",o.yytext),"DIR";case 86:return o.yytext=o.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (left):",o.yytext),"DIR";case 87:return o.yytext=o.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (x):",o.yytext),"DIR";case 88:return o.yytext=o.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (y):",o.yytext),"DIR";case 89:return o.yytext=o.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (up):",o.yytext),"DIR";case 90:return o.yytext=o.yytext.replace(/^,\s*/,""),i.getLogger().debug("Lex (down):",o.yytext),"DIR";case 91:return o.yytext="]>",i.getLogger().debug("Lex (ARROW_DIR end):",o.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return i.getLogger().debug("Lex: LINK","#"+o.yytext+"#"),15;case 93:return i.getLogger().debug("Lex: LINK",o.yytext),15;case 94:return i.getLogger().debug("Lex: LINK",o.yytext),15;case 95:return i.getLogger().debug("Lex: LINK",o.yytext),15;case 96:return i.getLogger().debug("Lex: START_LINK",o.yytext),this.pushState("LLABEL"),16;case 97:return i.getLogger().debug("Lex: START_LINK",o.yytext),this.pushState("LLABEL"),16;case 98:return i.getLogger().debug("Lex: START_LINK",o.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return i.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),i.getLogger().debug("Lex: LINK","#"+o.yytext+"#"),15;case 102:return this.popState(),i.getLogger().debug("Lex: LINK",o.yytext),15;case 103:return this.popState(),i.getLogger().debug("Lex: LINK",o.yytext),15;case 104:return i.getLogger().debug("Lex: COLON",o.yytext),o.yytext=o.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 T})();I.lexer=D;function v(){this.yy={}}return h(v,"Parser"),v.prototype=I,I.Parser=v,new v})();ae.parser=ae;var zt=ae,F=new Map,ce=[],ne=new Map,Se="color",xe="fill",kt="bgFill",we=",",Z=new Map,le="",Bt=h(e=>bt.sanitizeText(e,ye()),"sanitizeText"),Rt=h(function(e,a=""){let c=Z.get(e);c||(c={id:e,styles:[],textStyles:[]},Z.set(e,c)),a!=null&&a.split(we).forEach(r=>{const l=r.replace(/([^;]*);/,"$1").trim();if(RegExp(Se).exec(r)){const s=l.replace(xe,kt).replace(Se,xe);c.textStyles.push(s)}c.styles.push(l)})},"addStyleClass"),Pt=h(function(e,a=""){const c=F.get(e);a!=null&&(c.styles=a.split(we))},"addStyle2Node"),Ft=h(function(e,a){e.split(",").forEach(function(c){let r=F.get(c);if(r===void 0){const l=c.trim();r={id:l,type:"na",children:[]},F.set(l,r)}r.classes||(r.classes=[]),r.classes.push(a)})},"setCssClass"),Ee=0,_e=h((e,a)=>{const c=e.flat(),r=[],l=c.find(s=>(s==null?void 0:s.type)==="column-setting"),p=(l==null?void 0:l.columns)??-1;for(const s of c){if(typeof p=="number"&&p>0&&s.type!=="column-setting"&&typeof s.widthInColumns=="number"&&s.widthInColumns>p&&y.warn(`Block ${s.id} width ${s.widthInColumns} exceeds configured column width ${p}`),s.label&&(s.label=Bt(s.label)),s.type==="classDef"){Rt(s.id,s.css);continue}if(s.type==="applyClass"){Ft(s.id,(s==null?void 0:s.styleClass)??"");continue}if(s.type==="applyStyles"){s!=null&&s.stylesStr&&Pt(s.id,s==null?void 0:s.stylesStr);continue}if(s.type==="column-setting")a.columns=s.columns??-1;else if(s.type==="edge"){const g=(ne.get(s.id)??0)+1;ne.set(s.id,g),s.id=g+"-"+s.id,ce.push(s)}else{s.label||(s.type==="composite"?s.label="":s.label=s.id);const g=F.get(s.id);if(g===void 0?(s.type==="composite"&&(s.colorIndex=Ee++),F.set(s.id,s)):(s.type!=="na"&&(g.type=s.type),s.label!==s.id&&(g.label=s.label)),s.children&&_e(s.children,s),s.type==="space"){const x=s.width??1;for(let L=0;L<x;L++){const S=It(s);S.id=S.id+"-"+L,F.set(S.id,S),r.push(S)}}else g===void 0&&r.push(s)}}a.children=r},"populateBlockDatabase"),ue=[],G={id:"root",type:"composite",children:[],columns:-1},Mt=h(()=>{y.debug("Clear called"),ht(),G={id:"root",type:"composite",children:[],columns:-1},F=new Map([["root",G]]),ue=[],Z=new Map,ce=[],ne=new Map,le="",Ee=0},"clear");function De(e){switch(y.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return y.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"}}h(De,"typeStr2Type");function Te(e){switch(y.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}h(Te,"edgeTypeStr2Type");function Ne(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}h(Ne,"edgeStrToEdgeData");function Ie(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}h(Ie,"edgeStrToEdgeStartData");function Oe(e){return e.includes("==")?"thick":"normal"}h(Oe,"edgeStrToThickness");function Ce(e){return e.includes(".-")?"dotted":"solid"}h(Ce,"edgeStrToPattern");var Le=0,Kt=h(()=>(Le++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Le),"generateId"),Yt=h(e=>{G.children=e,_e(e,G),ue=G.children},"setHierarchy"),Wt=h(e=>{const a=F.get(e);return a?a.columns?a.columns:a.children?a.children.length:-1:-1},"getColumns"),Vt=h(()=>[...F.values()],"getBlocksFlat"),Ut=h(()=>ue||[],"getBlocks"),Ht=h(()=>ce,"getEdges"),Xt=h(e=>F.get(e),"getBlock"),Gt=h(e=>{F.set(e.id,e)},"setBlock"),jt=h(e=>{le=e},"setDiagramId"),qt=h(()=>le,"getDiagramId"),Jt=h(()=>y,"getLogger"),Zt=h(function(){return Z},"getClasses"),Qt={getConfig:h(()=>U().block,"getConfig"),typeStr2Type:De,edgeTypeStr2Type:Te,edgeStrToEdgeData:Ne,edgeStrToEdgeStartData:Ie,edgeStrToThickness:Oe,edgeStrToPattern:Ce,getLogger:Jt,getBlocksFlat:Vt,getBlocks:Ut,getEdges:Ht,setHierarchy:Yt,getBlock:Xt,setBlock:Gt,getColumns:Wt,getClasses:Zt,clear:Mt,generateId:Kt,setDiagramId:jt,getDiagramId:qt},$t=Qt,es=h(e=>{const{theme:a,bkgColorArray:c,borderColorArray:r}=e;if(!dt(a,r))return"";const l=pt(e.look),p=ft(c);let s="";for(let g=0;g<St(e.THEME_COLOR_LIMIT,r);g++){const x=r[g%r.length],L=p?`fill: ${c[g%c.length]};`:"",S=`[data-look="${l}"][data-color-id="color-${g}"]`;s+=`
|
|
7
|
+
|
|
8
|
+
${S}.node rect.composite {
|
|
9
|
+
stroke: ${x};
|
|
10
|
+
${L}
|
|
11
|
+
}
|
|
12
|
+
`}return s},"genColor"),ie=h((e,a)=>{const c=Tt,r=c(e,"r"),l=c(e,"g"),p=c(e,"b");return xt(r,l,p,a)},"fade"),ts=h(e=>`${es(e)}
|
|
13
|
+
.label {
|
|
14
|
+
font-family: ${e.fontFamily};
|
|
15
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
16
|
+
}
|
|
17
|
+
.cluster-label text {
|
|
18
|
+
fill: ${e.titleColor};
|
|
19
|
+
}
|
|
20
|
+
.cluster-label span {
|
|
21
|
+
color: ${e.titleColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
.label text,span {
|
|
27
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
28
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.node rect,
|
|
32
|
+
.node circle,
|
|
33
|
+
.node ellipse,
|
|
34
|
+
.node polygon,
|
|
35
|
+
.node path {
|
|
36
|
+
fill: ${e.mainBkg};
|
|
37
|
+
stroke: ${e.nodeBorder};
|
|
38
|
+
/* From the theme, as every other diagram does. Pinned at 1px here, so block drew a
|
|
39
|
+
thinner border than an identical flowchart node under any theme asking for more --
|
|
40
|
+
the neo theme asks for 2. Nothing downstream corrected it: the neo rules set stroke
|
|
41
|
+
and filter, never stroke-width. */
|
|
42
|
+
stroke-width: ${e.strokeWidth??1}px;
|
|
43
|
+
}
|
|
44
|
+
.flowchart-label text {
|
|
45
|
+
text-anchor: middle;
|
|
46
|
+
}
|
|
47
|
+
// .flowchart-label .text-outer-tspan {
|
|
48
|
+
// text-anchor: middle;
|
|
49
|
+
// }
|
|
50
|
+
// .flowchart-label .text-inner-tspan {
|
|
51
|
+
// text-anchor: start;
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
.node .label {
|
|
55
|
+
text-align: center;
|
|
56
|
+
}
|
|
57
|
+
.node.clickable {
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.arrowheadPath {
|
|
62
|
+
fill: ${e.arrowheadColor};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.edgePaths .path {
|
|
66
|
+
stroke: ${e.lineColor};
|
|
67
|
+
stroke-width: 2.0px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.flowchart-link {
|
|
71
|
+
stroke: ${e.lineColor};
|
|
72
|
+
fill: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.edgeLabel {
|
|
76
|
+
background-color: ${e.edgeLabelBackground};
|
|
77
|
+
/*
|
|
78
|
+
* This is for backward compatibility with existing code that didn't
|
|
79
|
+
* add a \`<p>\` around edge labels.
|
|
80
|
+
*
|
|
81
|
+
* TODO: We should probably remove this in a future release.
|
|
82
|
+
*/
|
|
83
|
+
p {
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 0;
|
|
86
|
+
display: inline;
|
|
87
|
+
}
|
|
88
|
+
rect {
|
|
89
|
+
opacity: 0.5;
|
|
90
|
+
background-color: ${e.edgeLabelBackground};
|
|
91
|
+
fill: ${e.edgeLabelBackground};
|
|
92
|
+
}
|
|
93
|
+
text-align: center;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* For html labels only */
|
|
97
|
+
.labelBkg {
|
|
98
|
+
background-color: ${e.edgeLabelBackground};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.node .cluster {
|
|
102
|
+
// fill: ${ie(e.mainBkg,.5)};
|
|
103
|
+
fill: ${ie(e.clusterBkg,.5)};
|
|
104
|
+
stroke: ${ie(e.clusterBorder,.2)};
|
|
105
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
106
|
+
stroke-width: 1px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.cluster text {
|
|
110
|
+
fill: ${e.titleColor};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cluster span {
|
|
114
|
+
color: ${e.titleColor};
|
|
115
|
+
}
|
|
116
|
+
/* .cluster div {
|
|
117
|
+
color: ${e.titleColor};
|
|
118
|
+
} */
|
|
119
|
+
|
|
120
|
+
div.mermaidTooltip {
|
|
121
|
+
position: absolute;
|
|
122
|
+
text-align: center;
|
|
123
|
+
max-width: 200px;
|
|
124
|
+
padding: 2px;
|
|
125
|
+
font-family: ${e.fontFamily};
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
background: ${e.tertiaryColor};
|
|
128
|
+
border: 1px solid ${e.border2};
|
|
129
|
+
border-radius: 2px;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
z-index: 100;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.flowchartTitleText {
|
|
135
|
+
text-anchor: middle;
|
|
136
|
+
font-size: 18px;
|
|
137
|
+
fill: ${e.textColor};
|
|
138
|
+
}
|
|
139
|
+
${Fe()}
|
|
140
|
+
`,"getStyles"),ss=ts;function oe(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const c=a%e,r=Math.floor(a/e);return{px:c,py:r}}h(oe,"calculateBlockPosition");var rs=h(e=>{let a=0,c=0;for(const r of e.children){const{width:l,height:p,x:s,y:g}=r.size??{width:0,height:0,x:0,y:0};if(y.debug("getMaxChildSize abc95 child:",r.id,"width:",l,"height:",p,"x:",s,"y:",g,r.type),r.type==="space")continue;const x=l/(r.widthInColumns??1);x>a&&(a=x),p>c&&(c=p)}return{width:a,height:c}},"getMaxChildSize");function Q(e,a,c=0,r=0,l=8){var g,x,L,S,E,A,z,_,N,I,D;y.debug("setBlockSizes abc95 (start)",e.id,(g=e==null?void 0:e.size)==null?void 0:g.x,"block width =",e==null?void 0:e.size,"siblingWidth",c),(x=e==null?void 0:e.size)!=null&&x.width||(e.size={width:c,height:r,x:0,y:0});let p=0,s=0;if(((L=e.children)==null?void 0:L.length)>0){for(const t of e.children)Q(t,a,0,0,l);const v=rs(e);p=v.width,s=v.height,y.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",p,s);for(const t of e.children)t.size&&(y.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${p} ${s} ${JSON.stringify(t.size)}`),t.size.width=p*(t.widthInColumns??1)+l*((t.widthInColumns??1)-1),t.size.height=s,t.size.x=0,t.size.y=0,y.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${p} maxHeight:${s}`));for(const t of e.children)Q(t,a,p,s,l);const T=e.columns??-1;let d=0;for(const t of e.children)d+=t.widthInColumns??1;let i=e.children.length;T>0&&T<d&&(i=T);const o=Math.ceil(d/i);let u=i*(p+l)+l,m=o*(s+l)+l;if(u<c){y.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${c} siblingHeight ${r} width ${u}`),u=c,m=r;const t=(c-i*l-l)/i,O=(r-o*l-l)/o;y.debug("Size indata abc88",e.id,"childWidth",t,"maxWidth",p),y.debug("Size indata abc88",e.id,"childHeight",O,"maxHeight",s),y.debug("Size indata abc88 xSize",i,"padding",l);for(const n of e.children)n.size&&(n.size.width=t,n.size.height=O,n.size.x=0,n.size.y=0)}if(y.debug(`abc95 (finale calc) ${e.id} xSize ${i} ySize ${o} columns ${T}${e.children.length} width=${Math.max(u,((S=e.size)==null?void 0:S.width)||0)}`),u<(((E=e==null?void 0:e.size)==null?void 0:E.width)||0)){u=((A=e==null?void 0:e.size)==null?void 0:A.width)||0;const t=T>0?Math.min(e.children.length,T):e.children.length;if(t>0){const O=(u-t*l-l)/t;y.debug("abc95 (growing to fit) width",e.id,u,(z=e.size)==null?void 0:z.width,O);for(const n of e.children)n.size&&(n.size.width=O)}}e.size={width:u,height:m,x:0,y:0}}y.debug("setBlockSizes abc94 (done)",e.id,(_=e==null?void 0:e.size)==null?void 0:_.x,(N=e==null?void 0:e.size)==null?void 0:N.width,(I=e==null?void 0:e.size)==null?void 0:I.y,(D=e==null?void 0:e.size)==null?void 0:D.height)}h(Q,"setBlockSizes");function ge(e,a,c=8){var l,p,s,g,x,L,S,E,A,z,_,N,I,D,v,T,d;y.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(l=e==null?void 0:e.size)==null?void 0:l.x} y: ${(p=e==null?void 0:e.size)==null?void 0:p.y} width: ${(s=e==null?void 0:e.size)==null?void 0:s.width}`);const r=e.columns??-1;if(y.debug("layoutBlocks columns abc95",e.id,"=>",r,e),e.children&&e.children.length>0){const i=((x=(g=e==null?void 0:e.children[0])==null?void 0:g.size)==null?void 0:x.width)??0,o=e.children.length*i+(e.children.length-1)*c;y.debug("widthOfChildren 88",o,"posX");const u=new Map;{let f=0;for(const w of e.children){if(!w.size)continue;const{py:C}=oe(r,f),M=u.get(C)??0;w.size.height>M&&u.set(C,w.size.height);let K=(w==null?void 0:w.widthInColumns)??1;r>0&&(K=Math.min(K,r-f%r)),f+=K}}const m=new Map;{let f=0;const w=[...u.keys()].sort((C,M)=>C-M);for(const C of w)m.set(C,f),f+=(u.get(C)??0)+c}let t=0;y.debug("abc91 block?.size?.x",e.id,(L=e==null?void 0:e.size)==null?void 0:L.x);let O=(S=e==null?void 0:e.size)!=null&&S.x?((E=e==null?void 0:e.size)==null?void 0:E.x)+(-((A=e==null?void 0:e.size)==null?void 0:A.width)/2||0):-c,n=0;for(const f of e.children){const w=e;if(!f.size)continue;const{width:C,height:M}=f.size,{px:K,py:b}=oe(r,t);if(b!=n&&(n=b,O=(z=e==null?void 0:e.size)!=null&&z.x?((_=e==null?void 0:e.size)==null?void 0:_.x)+(-((N=e==null?void 0:e.size)==null?void 0:N.width)/2||0):-c,y.debug("New row in layout for block",e.id," and child ",f.id,n)),y.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${t} (px, py) ${K},${b} (${(I=w==null?void 0:w.size)==null?void 0:I.x},${(D=w==null?void 0:w.size)==null?void 0:D.y}) parent: ${w.id} width: ${C}${c}`),w.size){const Y=C/2;f.size.x=O+c+Y,y.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${O} new startingPosX${f.size.x} ${Y} padding=${c} width=${C} halfWidth=${Y} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${C*((f==null?void 0:f.widthInColumns)??1)/2}`),O=f.size.x+Y;const X=m.get(b)??0,ee=u.get(b)??M;f.size.y=w.size.y-w.size.height/2+X+ee/2+c,y.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${O}${c}${Y}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${C*((f==null?void 0:f.widthInColumns)??1)/2}`)}f.children&&ge(f,a,c);let B=(f==null?void 0:f.widthInColumns)??1;r>0&&(B=Math.min(B,r-t%r)),t+=B,y.debug("abc88 columnsPos",f,t)}}y.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(v=e==null?void 0:e.size)==null?void 0:v.x} y: ${(T=e==null?void 0:e.size)==null?void 0:T.y} width: ${(d=e==null?void 0:e.size)==null?void 0:d.width}`)}h(ge,"layoutBlocks");function he(e,{minX:a,minY:c,maxX:r,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:p,y:s,width:g,height:x}=e.size;p-g/2<a&&(a=p-g/2),s-x/2<c&&(c=s-x/2),p+g/2>r&&(r=p+g/2),s+x/2>l&&(l=s+x/2)}if(e.children)for(const p of e.children)({minX:a,minY:c,maxX:r,maxY:l}=he(p,{minX:a,minY:c,maxX:r,maxY:l}));return{minX:a,minY:c,maxX:r,maxY:l}}h(he,"findBounds");function ve(e){var L,S;const a=e.getBlock("root");if(!a)return;const c=((S=(L=ye())==null?void 0:L.block)==null?void 0:S.padding)??8;Q(a,e,0,0,c),ge(a,e,c),y.debug("getBlocks",JSON.stringify(a,null,2));const{minX:r,minY:l,maxX:p,maxY:s}=he(a),g=s-l,x=p-r;return{x:r,y:l,width:x,height:g}}h(ve,"layout");function de(e,a,c=!1){var _,N,I;const r=e;let l="default";(((_=r==null?void 0:r.classes)==null?void 0:_.length)||0)>0&&(l=((r==null?void 0:r.classes)??[]).join(" ")),l=l+" flowchart-label";const p=((r==null?void 0:r.classes)??[]).flatMap(D=>{var v;return((v=a.getClasses().get(D))==null?void 0:v.styles)??[]});let s=0,g="rect",x;switch(r.type){case"round":s=5,g="rect";break;case"composite":s=0,g="composite",x=0;break;case"square":g="rect";break;case"diamond":g="question";break;case"hexagon":g="hexagon";break;case"block_arrow":g="block_arrow";break;case"odd":g="rect_left_inv_arrow";break;case"lean_right":g="lean_right";break;case"lean_left":g="lean_left";break;case"trapezoid":g="trapezoid";break;case"inv_trapezoid":g="inv_trapezoid";break;case"rect_left_inv_arrow":g="rect_left_inv_arrow";break;case"circle":g="circle";break;case"ellipse":g="ellipse";break;case"stadium":g="stadium";break;case"subroutine":g="subroutine";break;case"cylinder":g="cylinder";break;case"group":g="rect";break;case"doublecircle":g="doublecircle";break;default:g="rect"}const L=wt((r==null?void 0:r.styles)??[]),S=r.label,E=r.size??{width:0,height:0,x:0,y:0},A=a.getDiagramId();return{labelStyle:L.labelStyle,shape:g,label:S,labelText:S,rx:s,ry:s,class:l,cssClasses:l,cssStyles:(r==null?void 0:r.styles)??[],cssCompiledStyles:p,style:L.style,id:r.id,domId:A?`${A}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:E.width||void 0,height:E.height||void 0,wrappingWidth:E.width||Number.POSITIVE_INFINITY,x:E.x,y:E.y,positioned:c,intersect:void 0,padding:x??((I=(N=U())==null?void 0:N.block)==null?void 0:I.padding)??0,widthInColumns:r.widthInColumns??1,colorIndex:r.colorIndex,look:U().look}}h(de,"getNodeFromBlock");async function Ae(e,a,c){var x;const r=de(a,c,!1);if(a.type==="group")return;const l=U(),p=await be(e,r,{config:l}),s=((x=p.node())==null?void 0:x.getBBox())??{width:0,height:0},g=c.getBlock(r.id);g.size={width:s.width,height:s.height,x:0,y:0,node:p},c.setBlock(g),p.remove()}h(Ae,"calculateBlockSize");async function ze(e,a,c){var p;const r=de(a,c,!0);if(c.getBlock(r.id).type!=="space"){const s=U(),g=await be(e,r,{config:s});r.colorIndex!==void 0&&Et(g,r.colorIndex,s.theme,(p=s.themeVariables)==null?void 0:p.borderColorArray),a.intersect=r==null?void 0:r.intersect,_t(r)}}h(ze,"insertBlockPositioned");async function $(e,a,c,r){for(const l of a)await r(e,l,c),l.children&&await $(e,l.children,c,r)}h($,"performOperations");async function ke(e,a,c){await $(e,a,c,Ae)}h(ke,"calculateBlockSizes");async function Be(e,a,c){await $(e,a,c,ze)}h(Be,"insertBlocks");async function Re(e,a,c,r,l){const p=new Dt({multigraph:!0,compound:!0});p.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of c)s.size&&p.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of a)if(s.start&&s.end){const g=r.getBlock(s.start),x=r.getBlock(s.end);if(g!=null&&g.size&&(x!=null&&x.size)){const L=g.size,S=x.size,E=[{x:L.x,y:L.y},{x:L.x+(S.x-L.x)/2,y:L.y+(S.y-L.y)/2},{x:S.x,y:S.y}],A=l?`${l}-${s.id}`:s.id,z=s.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",_=s.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",N=`${z} ${_} flowchart-link LS-a1 LE-b1`;Lt(e,{...s,id:A,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:E,classes:N},{},"block",p.node(s.start),p.node(s.end),l),s.label&&(await mt(e,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:E,classes:N}),yt({...s,x:E[1].x,y:E[1].y},{originalPath:E}))}}}h(Re,"insertEdges");var is=h(function(e,a){return a.db.getClasses()},"getClasses"),as=h(async function(e,a,c,r){var v;const{securityLevel:l,block:p}=U(),s=r.db;s.setDiagramId(a);let g;l==="sandbox"&&(g=J("#i"+a));const x=l==="sandbox"?J(g.nodes()[0].contentDocument.body):J("body"),L=l==="sandbox"?x.select(`[id="${a}"]`):J(`[id="${a}"]`);lt(L,U()),ut(L,["point","circle","cross"],r.type,a);const E=s.getBlocks(),A=s.getBlocksFlat(),z=s.getEdges(),_=L.insert("g").attr("class","block");await ke(_,E,s);const N=ve(s);await Be(_,E,s),await Re(_,z,A,s,a);const I=(v=_.node())==null?void 0:v.getBBox(),D=I&&Number.isFinite(I.width)&&Number.isFinite(I.height)?I:N;if(D){const T=Math.max(1,Math.round(.125*(D.width/D.height))),d=D.height+T+10,i=D.width+10,{useMaxWidth:o}=p;gt(L,d,i,!!o),y.debug("Here Bounds",N,D),L.attr("viewBox",`${D.x-5} ${D.y-5} ${D.width+10} ${D.height+10}`)}},"draw"),ns={draw:as,getClasses:is},ds={parser:zt,db:$t,renderer:ns,styles:ss};export{ds as diagram};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{d as Ie}from"./chunk-GWA4HPMP-CapkHNd2.js";import{s as Me,g as Be,a as Ve,b as Ye,_ as d,c as Ot,l as de,d as Fe,e as Ue,i as je,f as Nt,h as ze,j as me,k as Zt,w as We,m as te,n as pe}from"./index-DNSP9H_v.js";import"./vue-BhwNxZ68.js";import"./element-plus-IBMLLhb-.js";var jt=(function(){var t=d(function(_t,m,x,E){for(x=x||{},E=_t.length;E--;x[_t[E]]=m);return x},"o"),e=[1,24],a=[1,25],l=[1,26],u=[1,27],r=[1,28],n=[1,63],o=[1,64],s=[1,65],h=[1,66],y=[1,67],p=[1,68],g=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],X=[1,35],q=[1,36],H=[1,37],Q=[1,38],K=[1,39],G=[1,40],J=[1,41],Z=[1,42],$=[1,43],tt=[1,44],et=[1,45],nt=[1,46],st=[1,47],at=[1,48],rt=[1,50],it=[1,51],ot=[1,52],lt=[1,53],ct=[1,54],ut=[1,55],ht=[1,56],dt=[1,57],pt=[1,58],ft=[1,59],yt=[1,60],kt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Pt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],T=[1,83],k=[1,84],C=[1,85],R=[12,14,42],oe=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],xt=[12,33],qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,i,Dt){var f=i.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(i[f-3]);break;case 19:_.setTitle(i[f].substring(6)),this.$=i[f].substring(6);break;case 20:_.setAccDescription(i[f].substring(15)),this.$=i[f].substring(15);break;case 21:this.$=i[f].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=i[f].trim(),_.setAccDescription(this.$);break;case 28:i[f].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...i[f]),this.$=i[f];break;case 29:i[f].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...i[f]),this.$=i[f];break;case 30:_.addPersonOrSystemBoundary(...i[f]),this.$=i[f];break;case 31:i[f].splice(2,0,"CONTAINER"),_.addContainerBoundary(...i[f]),this.$=i[f];break;case 32:_.addDeploymentNode("node",...i[f]),this.$=i[f];break;case 33:_.addDeploymentNode("nodeL",...i[f]),this.$=i[f];break;case 34:_.addDeploymentNode("nodeR",...i[f]),this.$=i[f];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...i[f]),this.$=i[f];break;case 40:_.addPersonOrSystem("external_person",...i[f]),this.$=i[f];break;case 41:_.addPersonOrSystem("system",...i[f]),this.$=i[f];break;case 42:_.addPersonOrSystem("system_db",...i[f]),this.$=i[f];break;case 43:_.addPersonOrSystem("system_queue",...i[f]),this.$=i[f];break;case 44:_.addPersonOrSystem("external_system",...i[f]),this.$=i[f];break;case 45:_.addPersonOrSystem("external_system_db",...i[f]),this.$=i[f];break;case 46:_.addPersonOrSystem("external_system_queue",...i[f]),this.$=i[f];break;case 47:_.addContainer("container",...i[f]),this.$=i[f];break;case 48:_.addContainer("container_db",...i[f]),this.$=i[f];break;case 49:_.addContainer("container_queue",...i[f]),this.$=i[f];break;case 50:_.addContainer("external_container",...i[f]),this.$=i[f];break;case 51:_.addContainer("external_container_db",...i[f]),this.$=i[f];break;case 52:_.addContainer("external_container_queue",...i[f]),this.$=i[f];break;case 53:_.addComponent("component",...i[f]),this.$=i[f];break;case 54:_.addComponent("component_db",...i[f]),this.$=i[f];break;case 55:_.addComponent("component_queue",...i[f]),this.$=i[f];break;case 56:_.addComponent("external_component",...i[f]),this.$=i[f];break;case 57:_.addComponent("external_component_db",...i[f]),this.$=i[f];break;case 58:_.addComponent("external_component_queue",...i[f]),this.$=i[f];break;case 60:_.addRel("rel",...i[f]),this.$=i[f];break;case 61:_.addRel("birel",...i[f]),this.$=i[f];break;case 62:_.addRel("rel_u",...i[f]),this.$=i[f];break;case 63:_.addRel("rel_d",...i[f]),this.$=i[f];break;case 64:_.addRel("rel_l",...i[f]),this.$=i[f];break;case 65:_.addRel("rel_r",...i[f]),this.$=i[f];break;case 66:_.addRel("rel_b",...i[f]),this.$=i[f];break;case 67:i[f].splice(0,1),_.addRel("rel",...i[f]),this.$=i[f];break;case 68:_.updateElStyle("update_el_style",...i[f]),this.$=i[f];break;case 69:_.updateRelStyle("update_rel_style",...i[f]),this.$=i[f];break;case 70:_.updateLayoutConfig("update_layout_config",...i[f]),this.$=i[f];break;case 71:this.$=[i[f]];break;case 72:i[f].unshift(i[f-1]),this.$=i[f];break;case 73:case 75:this.$=i[f].trim();break;case 74:let vt={};vt[i[f-1].trim()]=i[f].trim(),this.$=vt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:a,24:l,26:u,28:r,29:49,30:61,32:62,34:n,36:o,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:70,19:20,20:21,21:22,22:e,23:a,24:l,26:u,28:r,29:49,30:61,32:62,34:n,36:o,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:71,19:20,20:21,21:22,22:e,23:a,24:l,26:u,28:r,29:49,30:61,32:62,34:n,36:o,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:72,19:20,20:21,21:22,22:e,23:a,24:l,26:u,28:r,29:49,30:61,32:62,34:n,36:o,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:73,19:20,20:21,21:22,22:e,23:a,24:l,26:u,28:r,29:49,30:61,32:62,34:n,36:o,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:o,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(kt,[2,14]),t(Xt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Pt,[2,19]),t(Pt,[2,20]),{25:[1,78]},{27:[1,79]},t(Pt,[2,23]),{35:80,75:81,76:S,77:T,79:k,80:C},{35:86,75:81,76:S,77:T,79:k,80:C},{35:87,75:81,76:S,77:T,79:k,80:C},{35:88,75:81,76:S,77:T,79:k,80:C},{35:89,75:81,76:S,77:T,79:k,80:C},{35:90,75:81,76:S,77:T,79:k,80:C},{35:91,75:81,76:S,77:T,79:k,80:C},{35:92,75:81,76:S,77:T,79:k,80:C},{35:93,75:81,76:S,77:T,79:k,80:C},{35:94,75:81,76:S,77:T,79:k,80:C},{35:95,75:81,76:S,77:T,79:k,80:C},{35:96,75:81,76:S,77:T,79:k,80:C},{35:97,75:81,76:S,77:T,79:k,80:C},{35:98,75:81,76:S,77:T,79:k,80:C},{35:99,75:81,76:S,77:T,79:k,80:C},{35:100,75:81,76:S,77:T,79:k,80:C},{35:101,75:81,76:S,77:T,79:k,80:C},{35:102,75:81,76:S,77:T,79:k,80:C},{35:103,75:81,76:S,77:T,79:k,80:C},{35:104,75:81,76:S,77:T,79:k,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:T,79:k,80:C},{35:106,75:81,76:S,77:T,79:k,80:C},{35:107,75:81,76:S,77:T,79:k,80:C},{35:108,75:81,76:S,77:T,79:k,80:C},{35:109,75:81,76:S,77:T,79:k,80:C},{35:110,75:81,76:S,77:T,79:k,80:C},{35:111,75:81,76:S,77:T,79:k,80:C},{35:112,75:81,76:S,77:T,79:k,80:C},{35:113,75:81,76:S,77:T,79:k,80:C},{35:114,75:81,76:S,77:T,79:k,80:C},{35:115,75:81,76:S,77:T,79:k,80:C},{20:116,29:49,30:61,32:62,34:n,36:o,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:T,79:k,80:C},{35:120,75:81,76:S,77:T,79:k,80:C},{35:121,75:81,76:S,77:T,79:k,80:C},{35:122,75:81,76:S,77:T,79:k,80:C},{35:123,75:81,76:S,77:T,79:k,80:C},{35:124,75:81,76:S,77:T,79:k,80:C},{35:125,75:81,76:S,77:T,79:k,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(Xt,[2,17],{21:22,19:130,22:e,23:a,24:l,26:u,28:r}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:a,24:l,26:u,28:r,34:n,36:o,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:J,57:Z,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(Pt,[2,21]),t(Pt,[2,22]),t(R,[2,39]),t(oe,[2,71],{75:81,35:132,76:S,77:T,79:k,80:C}),t(Bt,[2,73]),{78:[1,133]},t(Bt,[2,75]),t(Bt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(xt,[2,28]),t(xt,[2,29]),t(xt,[2,30]),t(xt,[2,31]),t(xt,[2,32]),t(xt,[2,33]),t(xt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Xt,[2,18]),t(kt,[2,38]),t(oe,[2,72]),t(Bt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(qt,[2,25]),t(qt,[2,26],{12:[1,138]}),t(qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],i=[],Dt=this.table,f="",vt=0,le=0,De=2,ce=1,Ne=i.slice.call(arguments,1),A=Object.create(this.lexer),Et={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(Et.yy[Qt]=this.yy[Qt]);A.setInput(m,Et.yy),Et.yy.lexer=A,Et.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var Kt=A.yylloc;i.push(Kt);var Ae=A.options&&A.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Le(B){E.length=E.length-2*B,D.length=D.length-B,i.length=i.length-B}d(Le,"popStack");function ue(){var B;return B=_.pop()||A.lex()||ce,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(ue,"lex");for(var M,St,V,Gt,Ct={},Yt,z,he,Ft;;){if(St=E[E.length-1],this.defaultActions[St]?V=this.defaultActions[St]:((M===null||typeof M>"u")&&(M=ue()),V=Dt[St]&&Dt[St][M]),typeof V>"u"||!V.length||!V[0]){var Jt="";Ft=[];for(Yt in Dt[St])this.terminals_[Yt]&&Yt>De&&Ft.push("'"+this.terminals_[Yt]+"'");A.showPosition?Jt="Parse error on line "+(vt+1)+`:
|
|
2
|
+
`+A.showPosition()+`
|
|
3
|
+
Expecting `+Ft.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Jt="Parse error on line "+(vt+1)+": Unexpected "+(M==ce?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Jt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:Kt,expected:Ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+St+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),i.push(A.yylloc),E.push(V[1]),M=null,le=A.yyleng,f=A.yytext,vt=A.yylineno,Kt=A.yylloc;break;case 2:if(z=this.productions_[V[1]][1],Ct.$=D[D.length-z],Ct._$={first_line:i[i.length-(z||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(z||1)].first_column,last_column:i[i.length-1].last_column},Ae&&(Ct._$.range=[i[i.length-(z||1)].range[0],i[i.length-1].range[1]]),Gt=this.performAction.apply(Ct,[f,le,vt,Et.yy,V[1],D,i].concat(Ne)),typeof Gt<"u")return Gt;z&&(E=E.slice(0,-1*z*2),D=D.slice(0,-1*z),i=i.slice(0,-1*z)),E.push(this.productions_[V[1]][0]),D.push(Ct.$),i.push(Ct._$),he=Dt[E[E.length-2]][E[E.length-1]],E.push(he);break;case 3:return!0}}return!0},"parse")},Pe=(function(){var _t={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,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 m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),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(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
|
|
5
|
+
`+x+"^"},"showPosition"),test_match:d(function(m,x){var E,_,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),_=m[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,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(m[0].length),this.matched+=m[0],E=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),E)return E;if(this._backtrack){for(var i in D)this[i]=D[i];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,x,E,_;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),i=0;i<D.length;i++)if(E=this._input.match(this.rules[D[i]]),E&&(!x||E[0].length>x[0].length)){if(x=E,_=i,this.options.backtrack_lexer){if(m=this.test_match(E,D[i]),m!==!1)return m;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(m=this.test_match(x,D[_]),m!==!1?m:!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 x=this.next();return x||this.lex()},"lex"),begin:d(function(x){this.conditionStack.push(x)},"begin"),popState:d(function(){var x=this.conditionStack.length-1;return x>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(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:d(function(x){this.begin(x)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(x,E,_,D){switch(_){case 0:return 6;case 1:return 7;case 2:return 8;case 3:return 9;case 4:return 22;case 5:return 23;case 6:return this.begin("acc_title"),24;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),26;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:break;case 14:c;break;case 15:return 12;case 16:break;case 17:return 11;case 18:return 15;case 19:return 16;case 20:return 17;case 21:return 18;case 22:return this.begin("person_ext"),45;case 23:return this.begin("person"),44;case 24:return this.begin("system_ext_queue"),51;case 25:return this.begin("system_ext_db"),50;case 26:return this.begin("system_ext"),49;case 27:return this.begin("system_queue"),48;case 28:return this.begin("system_db"),47;case 29:return this.begin("system"),46;case 30:return this.begin("boundary"),37;case 31:return this.begin("enterprise_boundary"),34;case 32:return this.begin("system_boundary"),36;case 33:return this.begin("container_ext_queue"),57;case 34:return this.begin("container_ext_db"),56;case 35:return this.begin("container_ext"),55;case 36:return this.begin("container_queue"),54;case 37:return this.begin("container_db"),53;case 38:return this.begin("container"),52;case 39:return this.begin("container_boundary"),38;case 40:return this.begin("component_ext_queue"),63;case 41:return this.begin("component_ext_db"),62;case 42:return this.begin("component_ext"),61;case 43:return this.begin("component_queue"),60;case 44:return this.begin("component_db"),59;case 45:return this.begin("component"),58;case 46:return this.begin("node"),39;case 47:return this.begin("node"),39;case 48:return this.begin("node_l"),40;case 49:return this.begin("node_r"),41;case 50:return this.begin("rel"),64;case 51:return this.begin("birel"),65;case 52:return this.begin("rel_u"),66;case 53:return this.begin("rel_u"),66;case 54:return this.begin("rel_d"),67;case 55:return this.begin("rel_d"),67;case 56:return this.begin("rel_l"),68;case 57:return this.begin("rel_l"),68;case 58:return this.begin("rel_r"),69;case 59:return this.begin("rel_r"),69;case 60:return this.begin("rel_b"),70;case 61:return this.begin("rel_index"),71;case 62:return this.begin("update_el_style"),72;case 63:return this.begin("update_rel_style"),73;case 64:return this.begin("update_layout_config"),74;case 65:return"EOF_IN_STRUCT";case 66:return this.begin("attribute"),"ATTRIBUTE_EMPTY";case 67:this.begin("attribute");break;case 68:this.popState(),this.popState();break;case 69:return 80;case 70:break;case 71:return 80;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";case 75:this.begin("string_kv");break;case 76:return this.begin("string_kv_key"),"STR_KEY";case 77:this.popState(),this.begin("string_kv_value");break;case 78:return"STR_VALUE";case 79:this.popState(),this.popState();break;case 80:return"STR";case 81:return"LBRACE";case 82:return"RBRACE";case 83:return"SPACE";case 84:return"EOL";case 85:return 14}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},string_kv_value:{rules:[78,79],inclusive:!1},string_kv_key:{rules:[77],inclusive:!1},string_kv:{rules:[76],inclusive:!1},string:{rules:[73,74],inclusive:!1},attribute:{rules:[68,69,70,71,72,75,80],inclusive:!1},update_layout_config:{rules:[65,66,67,68],inclusive:!1},update_rel_style:{rules:[65,66,67,68],inclusive:!1},update_el_style:{rules:[65,66,67,68],inclusive:!1},rel_b:{rules:[65,66,67,68],inclusive:!1},rel_r:{rules:[65,66,67,68],inclusive:!1},rel_l:{rules:[65,66,67,68],inclusive:!1},rel_d:{rules:[65,66,67,68],inclusive:!1},rel_u:{rules:[65,66,67,68],inclusive:!1},rel_bi:{rules:[],inclusive:!1},rel:{rules:[65,66,67,68],inclusive:!1},node_r:{rules:[65,66,67,68],inclusive:!1},node_l:{rules:[65,66,67,68],inclusive:!1},node:{rules:[65,66,67,68],inclusive:!1},index:{rules:[],inclusive:!1},rel_index:{rules:[65,66,67,68],inclusive:!1},component_ext_queue:{rules:[65,66,67,68],inclusive:!1},component_ext_db:{rules:[65,66,67,68],inclusive:!1},component_ext:{rules:[65,66,67,68],inclusive:!1},component_queue:{rules:[65,66,67,68],inclusive:!1},component_db:{rules:[65,66,67,68],inclusive:!1},component:{rules:[65,66,67,68],inclusive:!1},container_boundary:{rules:[65,66,67,68],inclusive:!1},container_ext_queue:{rules:[65,66,67,68],inclusive:!1},container_ext_db:{rules:[65,66,67,68],inclusive:!1},container_ext:{rules:[65,66,67,68],inclusive:!1},container_queue:{rules:[65,66,67,68],inclusive:!1},container_db:{rules:[65,66,67,68],inclusive:!1},container:{rules:[65,66,67,68],inclusive:!1},birel:{rules:[65,66,67,68],inclusive:!1},system_boundary:{rules:[65,66,67,68],inclusive:!1},enterprise_boundary:{rules:[65,66,67,68],inclusive:!1},boundary:{rules:[65,66,67,68],inclusive:!1},system_ext_queue:{rules:[65,66,67,68],inclusive:!1},system_ext_db:{rules:[65,66,67,68],inclusive:!1},system_ext:{rules:[65,66,67,68],inclusive:!1},system_queue:{rules:[65,66,67,68],inclusive:!1},system_db:{rules:[65,66,67,68],inclusive:!1},system:{rules:[65,66,67,68],inclusive:!1},person_ext:{rules:[65,66,67,68],inclusive:!1},person:{rules:[65,66,67,68],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],inclusive:!0}}};return _t})();Ht.lexer=Pe;function Vt(){this.yy={}}return d(Vt,"Parser"),Vt.prototype=Ht,Ht.Parser=Vt,new Vt})();jt.parser=jt;var Xe=jt,be=d(t=>Ot()[t],"getRequiredConfig"),Y=new Set(["label","descr","techn","type"]),Tt=d((t,e)=>{for(const[a,l]of Object.entries(e))if(l!==void 0)if(typeof l=="object"){const[u,r]=Object.entries(l)[0];t[u]=Y.has(u)?{text:r}:r}else t[a]=l},"assignAttributes"),xe=d(()=>({alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}),"createGlobalBoundary"),U=[],gt=[""],L="global",F="",j=[xe()],Mt=[],ae="",re=!1,zt=4,Wt=2,ve,qe=d(function(){return ve},"getC4Type"),He=d(function(t){ve=me(t,Ot())},"setC4Type"),Qe=d(function(t,e,a,l,u,r,n,o,s){if(t==null||e===void 0||e===null||a===void 0||a===null||l===void 0||l===null)return;let h={};const y=Mt.find(p=>p.from===e&&p.to===a);if(y?h=y:Mt.push(h),h.type=t,h.from=e,h.to=a,h.label={text:l},u==null)h.techn??(h.techn={text:""});else if(typeof u=="object"){const[p,g]=Object.entries(u)[0];h[p]=Y.has(p)?{text:g}:g}else h.techn={text:u};if(r==null)h.descr??(h.descr={text:""});else if(typeof r=="object"){const[p,g]=Object.entries(r)[0];h[p]=Y.has(p)?{text:g}:g}else h.descr={text:r};Tt(h,{sprite:n,tags:o,link:s}),h.wrap=bt()},"addRel"),Ke=d(function(t,e,a,l,u,r,n){if(e===null||a===null)return;let o={};const s=U.find(h=>h.alias===e);if(s&&e===s.alias?o=s:(o.alias=e,U.push(o)),a==null?o.label={text:""}:o.label={text:a},l==null)o.descr??(o.descr={text:""});else if(typeof l=="object"){const[h,y]=Object.entries(l)[0];o[h]=Y.has(h)?{text:y}:y}else o.descr={text:l};Tt(o,{sprite:u,tags:r,link:n}),o.typeC4Shape={text:t},o.parentBoundary=L,o.wrap=bt()},"addPersonOrSystem"),Ge=d(function(t,e,a,l,u,r,n,o){if(e===null||a===null)return;let s={};const h=U.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,U.push(s)),a==null?s.label={text:""}:s.label={text:a},l==null)s.techn??(s.techn={text:""});else if(typeof l=="object"){const[y,p]=Object.entries(l)[0];s[y]=Y.has(y)?{text:p}:p}else s.techn={text:l};if(u==null)s.descr??(s.descr={text:""});else if(typeof u=="object"){const[y,p]=Object.entries(u)[0];s[y]=Y.has(y)?{text:p}:p}else s.descr={text:u};Tt(s,{sprite:r,tags:n,link:o}),s.wrap=bt(),s.typeC4Shape={text:t},s.parentBoundary=L},"addContainer"),Je=d(function(t,e,a,l,u,r,n,o){if(e===null||a===null)return;let s={};const h=U.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,U.push(s)),a==null?s.label={text:""}:s.label={text:a},l==null)s.techn??(s.techn={text:""});else if(typeof l=="object"){const[y,p]=Object.entries(l)[0];s[y]=Y.has(y)?{text:p}:p}else s.techn={text:l};if(u==null)s.descr??(s.descr={text:""});else if(typeof u=="object"){const[y,p]=Object.entries(u)[0];s[y]=Y.has(y)?{text:p}:p}else s.descr={text:u};Tt(s,{sprite:r,tags:n,link:o}),s.wrap=bt(),s.typeC4Shape={text:t},s.parentBoundary=L},"addComponent"),Ze=d(function(t,e,a,l,u){if(t===null||e===null)return;let r={};const n=j.find(o=>o.alias===t);if(n&&t===n.alias?r=n:(r.alias=t,j.push(r)),e==null?r.label={text:""}:r.label={text:e},a==null)r.type={text:"system"};else if(typeof a=="object"){const[o,s]=Object.entries(a)[0];r[o]=Y.has(o)?{text:s}:s}else r.type={text:a};Tt(r,{tags:l,link:u}),r.parentBoundary=L,r.wrap=bt(),F=L,L=t,gt.push(F)},"addPersonOrSystemBoundary"),$e=d(function(t,e,a,l,u){if(t===null||e===null)return;let r={};const n=j.find(o=>o.alias===t);if(n&&t===n.alias?r=n:(r.alias=t,j.push(r)),e==null?r.label={text:""}:r.label={text:e},a==null)r.type={text:"container"};else if(typeof a=="object"){const[o,s]=Object.entries(a)[0];r[o]=Y.has(o)?{text:s}:s}else r.type={text:a};Tt(r,{tags:l,link:u}),r.parentBoundary=L,r.wrap=bt(),F=L,L=t,gt.push(F)},"addContainerBoundary"),t0=d(function(t,e,a,l,u,r,n,o){if(e===null||a===null)return;let s={};const h=j.find(y=>y.alias===e);if(h&&e===h.alias?s=h:(s.alias=e,j.push(s)),a==null?s.label={text:""}:s.label={text:a},l==null)s.type={text:"node"};else if(typeof l=="object"){const[y,p]=Object.entries(l)[0];s[y]=Y.has(y)?{text:p}:p}else s.type={text:l};if(u==null)s.descr??(s.descr={text:""});else if(typeof u=="object"){const[y,p]=Object.entries(u)[0];s[y]=Y.has(y)?{text:p}:p}else s.descr={text:u};Tt(s,{tags:n,link:o}),s.nodeType=t,s.parentBoundary=L,s.wrap=bt(),F=L,L=e,gt.push(F)},"addDeploymentNode"),e0=d(function(){L=F,gt.pop(),F=gt.pop(),gt.push(F)},"popBoundaryParseStack"),n0=d(function(t,e,a,l,u,r,n,o,s,h,y){let p=U.find(g=>g.alias===e);if(!(p===void 0&&(p=j.find(g=>g.alias===e),p===void 0))){if(a!=null)if(typeof a=="object"){const[g,v]=Object.entries(a)[0];p[g]=v}else p.bgColor=a;if(l!=null)if(typeof l=="object"){const[g,v]=Object.entries(l)[0];p[g]=v}else p.fontColor=l;if(u!=null)if(typeof u=="object"){const[g,v]=Object.entries(u)[0];p[g]=v}else p.borderColor=u;if(r!=null)if(typeof r=="object"){const[g,v]=Object.entries(r)[0];p[g]=v}else p.shadowing=r;if(n!=null)if(typeof n=="object"){const[g,v]=Object.entries(n)[0];p[g]=v}else p.shape=n;if(o!=null)if(typeof o=="object"){const[g,v]=Object.entries(o)[0];p[g]=v}else p.sprite=o;if(s!=null)if(typeof s=="object"){const[g,v]=Object.entries(s)[0];p[g]=v}else p.techn=s;if(h!=null)if(typeof h=="object"){const[g,v]=Object.entries(h)[0];p[g]=v}else p.legendText=h;if(y!=null)if(typeof y=="object"){const[g,v]=Object.entries(y)[0];p[g]=v}else p.legendSprite=y}},"updateElStyle"),s0=d(function(t,e,a,l,u,r,n){const o=Mt.find(s=>s.from===e&&s.to===a);if(o!==void 0){if(l!=null)if(typeof l=="object"){const[s,h]=Object.entries(l)[0];o[s]=h}else o.textColor=l;if(u!=null)if(typeof u=="object"){const[s,h]=Object.entries(u)[0];o[s]=h}else o.lineColor=u;if(r!=null)if(typeof r=="object"){const[s,h]=Object.entries(r)[0];o[s]=parseInt(h)}else o.offsetX=parseInt(r);if(n!=null)if(typeof n=="object"){const[s,h]=Object.entries(n)[0];o[s]=parseInt(h)}else o.offsetY=parseInt(n)}},"updateRelStyle"),a0=d(function(t,e,a){let l=zt,u=Wt;if(typeof e=="object"){const r=Object.values(e)[0];l=parseInt(r)}else l=parseInt(e);if(typeof a=="object"){const r=Object.values(a)[0];u=parseInt(r)}else u=parseInt(a);l>=1&&(zt=l),u>=1&&(Wt=u)},"updateLayoutConfig"),r0=d(function(){return zt},"getC4ShapeInRow"),i0=d(function(){return Wt},"getC4BoundaryInRow"),o0=d(function(){return L},"getCurrentBoundaryParse"),l0=d(function(){return F},"getParentBoundaryParse"),Ee=d(function(t){return t==null?U:U.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),c0=d(function(t){return U.find(e=>e.alias===t)??j.find(e=>e.alias===t)},"getC4Shape"),u0=d(function(t){return Object.keys(Ee(t))},"getC4ShapeKeys"),Se=d(function(t){return t==null?j:j.filter(e=>e.parentBoundary===t)},"getBoundaries"),h0=Se,d0=d(function(){return Mt},"getRels"),p0=d(function(){return ae},"getTitle"),f0=d(function(t){re=t},"setWrap"),bt=d(function(){return re},"autoWrap"),y0=d(function(){U=[],j=[xe()],F="",L="global",gt=[""],Mt=[],gt=[""],ae="",re=!1,zt=4,Wt=2},"clear"),_0={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},g0={FILLED:0,OPEN:1},m0={LEFTOF:0,RIGHTOF:1,OVER:2},b0=d(function(t){ae=me(t,Ot())},"setTitle"),ee={addPersonOrSystem:Ke,addPersonOrSystemBoundary:Ze,addContainer:Ge,addContainerBoundary:$e,addComponent:Je,addDeploymentNode:t0,popBoundaryParseStack:e0,addRel:Qe,updateElStyle:n0,updateRelStyle:s0,updateLayoutConfig:a0,autoWrap:bt,setWrap:f0,getC4ShapeArray:Ee,getC4Shape:c0,getC4ShapeKeys:u0,getBoundaries:Se,getBoundarys:h0,getCurrentBoundaryParse:o0,getParentBoundaryParse:l0,getRels:d0,getTitle:p0,getC4Type:qe,getC4ShapeInRow:r0,getC4BoundaryInRow:i0,setAccTitle:Ye,getAccTitle:Ve,getAccDescription:Be,setAccDescription:Me,getConfig:d(()=>be("c4"),"getConfig"),clear:y0,LINETYPE:_0,ARROWTYPE:g0,PLACEMENT:m0,setTitle:b0,setC4Type:He},Te=d(function(t,e){return Ie(t,e)},"drawRect"),x0=d((t,e,a,l)=>{const u=t.append("g");let r=0;for(const n of e){const o=n.textColor?n.textColor:"#444444",s=n.lineColor?n.lineColor:"#444444",h=n.offsetX?parseInt(String(n.offsetX)):0,y=n.offsetY?parseInt(String(n.offsetY)):0,p="";if(r===0){const w=u.append("line");w.attr("x1",n.startPoint.x),w.attr("y1",n.startPoint.y),w.attr("x2",n.endPoint.x),w.attr("y2",n.endPoint.y),w.attr("stroke-width","1"),w.attr("stroke",s),w.style("fill","none"),n.type!=="rel_b"&&w.attr("marker-end","url("+p+"#"+l+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&w.attr("marker-start","url("+p+"#"+l+"-arrowend)"),r=-1}else{const w=u.append("path");w.attr("fill","none").attr("stroke-width","1").attr("stroke",s).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",n.startPoint.x).replaceAll("starty",n.startPoint.y).replaceAll("controlx",n.startPoint.x+(n.endPoint.x-n.startPoint.x)/2-(n.endPoint.x-n.startPoint.x)/4).replaceAll("controly",n.startPoint.y+(n.endPoint.y-n.startPoint.y)/2).replaceAll("stopx",n.endPoint.x).replaceAll("stopy",n.endPoint.y)),n.type!=="rel_b"&&w.attr("marker-end","url("+p+"#"+l+"-arrowhead)"),(n.type==="birel"||n.type==="rel_b")&&w.attr("marker-start","url("+p+"#"+l+"-arrowend)")}const g=n.label.width;let v=a.messageFont();At(a)(n.label.text,u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+y,g,n.label.height,{fill:o},v),n.techn&&n.techn.text!==""&&(v=a.messageFont(),At(a)("["+n.techn.text+"]",u,Math.min(n.startPoint.x,n.endPoint.x)+Math.abs(n.endPoint.x-n.startPoint.x)/2+h,Math.min(n.startPoint.y,n.endPoint.y)+Math.abs(n.endPoint.y-n.startPoint.y)/2+a.messageFontSize+5+y,Math.max(g,n.techn.width),n.techn.height,{fill:o,"font-style":"italic"},v))}},"drawRels"),v0=d(function(t,e,a){const l=t.append("g"),u=e.bgColor?e.bgColor:"none",r=e.borderColor?e.borderColor:"#444444",n=e.fontColor?e.fontColor:"black";let o={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(o={"stroke-width":1});const s={x:e.x,y:e.y,fill:u,stroke:r,width:e.width,height:e.height,rx:2.5,ry:2.5,attrs:o};Te(l,s);let h=a.boundaryFont();h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=n,At(a)(e.label.text,l,e.x,e.y+e.label.Y,e.width,e.height,{fill:"#444444"},h),e.type&&e.type.text!==""&&(h=a.boundaryFont(),h.fontColor=n,At(a)(e.type.text,l,e.x,e.y+e.type.Y,e.width,e.height,{fill:"#444444"},h)),e.descr&&e.descr.text!==""&&(h=a.boundaryFont(),h.fontSize=h.fontSize-2,h.fontColor=n,At(a)(e.descr.text,l,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},h))},"drawBoundary"),E0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),S0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),T0=d(function(t,e){t.append("defs").append("symbol").attr("id",e+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),k0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",9).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")},"insertArrowHead"),C0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd"),R0=d(function(t,e){t.append("defs").append("marker").attr("id",e+"-filled-head").attr("refX",18).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")},"insertArrowFilledHead"),w0=d(function(t,e){const l=t.append("defs").append("marker").attr("id",e+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);l.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z"),l.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead"),At=(function(){function t(u,r,n,o,s,h,y){const p=r.append("text").attr("x",n+s/2).attr("y",o+h/2+5).style("text-anchor","middle").text(u);l(p,y)}d(t,"byText");function e(u,r,n,o,s,h,y,p){const{fontSize:g,fontFamily:v,fontWeight:w}=p,N=u.split(te.lineBreakRegex);for(let O=0;O<N.length;O++){const P=O*g-g*(N.length-1)/2,I=r.append("text").attr("x",n+s/2).attr("y",o).style("text-anchor","middle").attr("dominant-baseline","middle").style("font-size",g).style("font-weight",w).style("font-family",v);I.append("tspan").attr("dy",P).text(N[O]).attr("alignment-baseline","mathematical"),l(I,y)}}d(e,"byTspan");function a(u,r,n,o,s,h,y,p){const g=r.append("switch"),w=g.append("foreignObject").attr("x",n).attr("y",o).attr("width",s).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");w.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(u),e(u,g,n,o,s,h,y,p),l(w,y)}d(a,"byFo");function l(u,r){for(const n in r)r.hasOwnProperty(n)&&u.attr(n,r[n])}return d(l,"_setTextAttrs"),function(u){return u.textPlacement==="fo"?a:u.textPlacement==="old"?t:e}})(),W={drawRect:Te,drawBoundary:v0,drawRels:x0,insertArrowHead:k0,insertArrowEnd:C0,insertArrowFilledHead:R0,insertArrowCrossHead:w0,insertDatabaseIcon:E0,insertComputerIcon:S0,insertClockIcon:T0},O0=d((t,e)=>{var a;if(e==="sandbox"){const u=(a=Zt("#i"+t).node())==null?void 0:a.contentDocument;if(!u)throw new Error(`Sandbox iframe #i${t} is missing its content document`);return{root:Zt(u.body),doc:u}}return{root:Zt("body"),doc:document}},"getDiagramRoot"),P0=new Set(["system_queue","external_system_queue","container_queue","external_container_queue","component_queue","external_component_queue"]),D0=new Set(["system_db","external_system_db","container_db","external_container_db","component_db","external_component_db"]),N0={person:"person",box:"rounded",rounded:"rounded",cylinder:"cylinder",database:"cylinder",db:"cylinder",queue:"h-cyl",pipe:"h-cyl",component:"fr-rect"},$t=d(t=>t?N0[t.toLowerCase()]:void 0,"keywordShape"),A0=d(t=>{const e=$t(t.shape)??$t(t.sprite);if(e)return e;if(t.tags)for(const l of t.tags.split(",")){const u=$t(l.trim());if(u)return u}const a=t.typeC4Shape.text;return a==="person"||a==="external_person"?"person":D0.has(a)?"cylinder":P0.has(a)?"h-cyl":"rounded"},"resolveNodeShape"),L0={person:"Person",system:"Software System",container:"Container",component:"Component"},I0=d(t=>{const e=t.replace(/^external_/,"").replace(/_(db|queue)$/,"");return L0[e]??e.replace(/_/g," ")},"stereotypeLabel"),M0=d(t=>t.startsWith("external_"),"isExternal"),B0=d(t=>{var a;const e=I0(t.typeC4Shape.text);return(a=t.techn)!=null&&a.text?`[${e}: ${t.techn.text}]`:`[${e}]`},"stereotypeText"),ke=["person","system","system_db","system_queue","container","container_db","container_queue","component","component_db","component_queue"].flatMap(t=>[t,`external_${t}`]),V0=new Set(ke),fe=d(t=>V0.has(t),"isC4ElementType"),Y0=d((t,e)=>{const a=t.typeC4Shape.text,l=t.bgColor??(fe(a)&&e[`${a}_bg_color`]),u=t.borderColor??(fe(a)&&e[`${a}_border_color`]),r=[];return l&&r.push(`fill:${l}`),u&&r.push(`stroke:${u}`),r.push(`color:${t.fontColor??"#FFFFFF"}`),r},"elementCssStyles"),ye=d((t,e,a,l,u)=>{var h;const r=t.typeC4Shape.text,n=["c4-shape",`c4-${r}`];M0(r)&&n.push("c4-external");const o=A0(t),s=Y0(t,e);return(o==="rounded"||o==="fr-rect")&&s.push("rx:12px","ry:12px"),{id:t.alias,label:t.label.text,stereotype:B0(t),description:(h=t.descr)!=null&&h.text?[t.descr.text]:void 0,labelType:"string",isGroup:!1,shape:o,cssClasses:n.join(" "),cssStyles:s,padding:a,look:l,useHtmlLabels:!1,width:u}},"buildC4Node"),Lt=0,It=0,Ce=4,ne=2;jt.yy=ee;var b={},Rt,Re=(Rt=class{constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,se(e.db.getConfig())}setData(e,a,l,u){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=a,this.nextData.starty=this.data.starty=l,this.nextData.stopy=this.data.stopy=u}updateVal(e,a,l,u){e[a]===void 0?e[a]=l:e[a]=u(l,e[a])}insert(e){this.nextData.cnt=this.nextData.cnt+1;const a=this.nextData.stopx,l=this.data.widthLimit;let u=this.nextData.startx===this.nextData.stopx?a+e.margin:a+e.margin*2,r=u+e.width,n=this.nextData.starty+e.margin*2,o=n+e.height;(u>=l||r>=l||this.nextData.cnt>Ce)&&(u=this.nextData.startx+e.margin+b.nextLinePaddingX,n=this.nextData.stopy+e.margin*2,this.nextData.stopx=r=u+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=o=n+e.height,this.nextData.cnt=1),e.x=u,e.y=n,this.updateVal(this.data,"startx",u,Math.min),this.updateVal(this.data,"starty",n,Math.min),this.updateVal(this.data,"stopx",r,Math.max),this.updateVal(this.data,"stopy",o,Math.max),this.updateVal(this.nextData,"startx",u,Math.min),this.updateVal(this.nextData,"starty",n,Math.min),this.updateVal(this.nextData,"stopx",r,Math.max),this.updateVal(this.nextData,"stopy",o,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},se(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},d(Rt,"Bounds"),Rt),se=d(function(t){Ue(b,t),t!=null&&t.fontFamily&&(b.personFontFamily=b.systemFontFamily=b.messageFontFamily=t.fontFamily),t!=null&&t.fontSize&&(b.personFontSize=b.systemFontSize=b.messageFontSize=t.fontSize),t!=null&&t.fontWeight&&(b.personFontWeight=b.systemFontWeight=b.messageFontWeight=t.fontWeight)},"setConf"),Ut=d(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),F0=d(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function mt(t,e,a,l,u){const r=e[t];if(!r.width)if(a)r.text=We(r.text,u,l),r.textLines=r.text.split(te.lineBreakRegex).length,r.width=u,r.height=pe(r.text,l);else{const n=r.text.split(te.lineBreakRegex);r.textLines=n.length;let o=0;r.height=0,r.width=0;for(const s of n)r.width=Math.max(Nt(s,l),r.width),o=pe(s,l),r.height=r.height+o}return r}d(mt,"calcC4ShapeTextWH");var we=d(function(t,e,a){const l=a.data.startx,u=a.data.starty;e.x=l,e.y=u,e.width=a.data.stopx-l,e.height=a.data.stopy-u,e.intersect=s=>je.rect({x:e.x+e.width/2,y:e.y+e.height/2,width:e.width,height:e.height},s),e.label.y=b.c4ShapeMargin-35;const r=e.wrap&&b.wrap,n=Ut(b);n.fontSize=n.fontSize+2,n.fontWeight="bold";const o=Nt(e.label.text,n);mt("label",e,r,n,o),W.drawBoundary(t,e,b)},"drawBoundary"),Oe=d(async function(t,e,a,l){const u=Ot(),r=u.look??"classic",n={config:u},o=e.attr("id")??"",s=l.map(y=>a[Number(y)]),h=d(y=>{const p=y.shape?ze[y.shape]:void 0;if(!p)throw new Error(`C4: no shape handler for "${y.shape}"`);return p},"shapeHandlerFor");await Promise.all(s.map(async y=>{const p=ye(y,b,b.c4ShapePadding,r,b.width);p.domId=`${o}-${p.id}`;const g=await h(p)(e,p,n);y.width=p.width??b.width,y.height=p.height??b.height,y.margin=b.c4ShapeMargin,g.remove()}));for(const y of s)t.insert(y);await Promise.all(s.map(async y=>{const p=ye(y,b,b.c4ShapePadding,r,b.width);p.domId=`${o}-${p.id}`,p.x=y.x+y.width/2,p.y=y.y+y.height/2;const g=e.append("g").attr("transform",`translate(${y.x+y.width/2}, ${y.y+y.height/2})`);await h(p)(g,p,n),y.intersect=p.intersect})),t.bumpLastMargin(b.c4ShapeMargin)},"drawC4ShapeArray"),wt,U0=(wt=class{constructor(e,a){this.x=e,this.y=a}},d(wt,"Point"),wt),_e=d(function(t,e){if(!t.intersect)throw new Error(`C4 element "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`);const{x:a,y:l}=t.intersect(e);return new U0(a,l)},"getIntersectPoint"),j0=d(function(t,e){const a={x:0,y:0};a.x=e.x+e.width/2,a.y=e.y+e.height/2;const l=_e(t,a);a.x=t.x+t.width/2,a.y=t.y+t.height/2;const u=_e(e,a);return{startPoint:l,endPoint:u}},"getIntersectPoints"),z0=d(function(t,e,a,l,u){const r=l.db.getC4Type();let n=0;for(const o of e){n=n+1;const s=o.wrap&&b.wrap,h=F0(b);r==="C4Dynamic"&&(o.label.text=n+": "+o.label.text);let y=Nt(o.label.text,h);mt("label",o,s,h,y),o.techn&&o.techn.text!==""&&(y=Nt(o.techn.text,h),mt("techn",o,s,h,y)),o.descr&&o.descr.text!==""&&(y=Nt(o.descr.text,h),mt("descr",o,s,h,y));const p=a(o.from),g=a(o.to);if(!p||!g)throw new Error(`C4 rel "${o.from}" -> "${o.to}" references an unknown shape or boundary`);const v=j0(p,g);if(!v.startPoint||!v.endPoint)throw new Error(`Could not calculate intersection points for rel "${o.from}" -> "${o.to}"`);o.startPoint=v.startPoint,o.endPoint=v.endPoint}W.drawRels(t,e,b,u)},"drawRels");async function ie(t,e,a,l,u){const r=u.db,n=new Re(u);n.data.widthLimit=a.data.widthLimit/Math.min(ne,l.length);for(const[o,s]of l.entries()){let h=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=h,h=s.image.Y+s.image.height);const y=s.wrap&&b.wrap,p=Ut(b);p.fontSize=p.fontSize+2,p.fontWeight="bold";const g=mt("label",s,y,p,n.data.widthLimit);if(g.Y=h+8,h=g.Y+g.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";const O=Ut(b),P=mt("type",s,y,O,n.data.widthLimit);P.Y=h+5,h=P.Y+P.height}if(s.descr&&s.descr.text!==""){const O=Ut(b);O.fontSize=O.fontSize-2;const P=mt("descr",s,y,O,n.data.widthLimit);P.Y=h+20,h=P.Y+P.height}if(o==0||o%ne===0){const O=a.data.startx+b.diagramMarginX,P=a.data.stopy+b.diagramMarginY+h;n.setData(O,O,P,P)}else{const O=n.data.stopx!==n.data.startx?n.data.stopx+b.diagramMarginX:n.data.startx,P=n.data.starty;n.setData(O,O,P,P)}n.name=s.alias;const v=r.getC4ShapeArray(s.alias),w=r.getC4ShapeKeys(s.alias);w.length>0&&await Oe(n,t,v,w),e=s.alias;const N=r.getBoundaries(e);N.length>0&&await ie(t,e,n,N,u),s.alias!=="global"&&we(t,s,n),a.data.stopy=Math.max(n.data.stopy+b.c4ShapeMargin,a.data.stopy),a.data.stopx=Math.max(n.data.stopx+b.c4ShapeMargin,a.data.stopx),Lt=Math.max(Lt,a.data.stopx),It=Math.max(It,a.data.stopy)}}d(ie,"drawInsideBoundary");var W0=d(async function(t,e,a,l){b=be("c4");const u=Ot().securityLevel,{root:r}=O0(e,u),n=l.db;n.setWrap(b.wrap),Ce=n.getC4ShapeInRow(),ne=n.getC4BoundaryInRow(),de.debug(`C:${JSON.stringify(b,null,2)}`);const o=r.select(`[id="${e}"]`);W.insertComputerIcon(o,e),W.insertDatabaseIcon(o,e),W.insertClockIcon(o,e);const s=new Re(l);s.setData(b.diagramMarginX,b.diagramMarginX,b.diagramMarginY,b.diagramMarginY),s.data.widthLimit=screen.availWidth,Lt=b.diagramMarginX,It=b.diagramMarginY;const h=n.getTitle(),y=n.getBoundaries("");await ie(o,"",s,y,l),W.insertArrowHead(o,e),W.insertArrowEnd(o,e),W.insertArrowCrossHead(o,e),W.insertArrowFilledHead(o,e),z0(o,n.getRels(),n.getC4Shape,l,e),s.data.stopx=Lt,s.data.stopy=It;const p=s.data,g=p.startx,v=p.starty,N=It-v+2*b.diagramMarginY,O=Lt-g,P=O+2*b.diagramMarginX;h&&o.append("text").text(h).attr("x",O/2-4*b.diagramMarginX).attr("y",v+b.diagramMarginY),Fe(o,N,P,b.useMaxWidth);const I=h?60:0;o.attr("viewBox",g-b.diagramMarginX+" -"+(b.diagramMarginY+I)+" "+P+" "+(N+I)),de.debug("models:",p)},"draw"),ge={drawPersonOrSystemArray:Oe,drawBoundary:we,setConf:se,draw:W0},X0=d(()=>{const t=Ot().c4??{},e=new CSSStyleSheet;for(const a of ke){const l=e.cssRules[e.insertRule(`.c4-shape.c4-${a} .label {}`,e.cssRules.length)],u=t[`${a}FontFamily`],r=t[`${a}FontSize`],n=t[`${a}FontWeight`];u&&l.style.setProperty("font-family",u),r&&l.style.setProperty("font-size",typeof r=="number"?`${r}px`:r),n&&l.style.setProperty("font-weight",String(n))}return[...e.cssRules].filter(a=>a.style.length>0).map(a=>` ${a.cssText}`).join(`
|
|
7
|
+
`)},"elementFontStyles"),q0=d(t=>`.person {
|
|
8
|
+
stroke: ${t.personBorder};
|
|
9
|
+
fill: ${t.personBkg};
|
|
10
|
+
}
|
|
11
|
+
${X0()}
|
|
12
|
+
|
|
13
|
+
/* The element font colour is set inline per element (default white); the
|
|
14
|
+
label text takes it via currentColor. */
|
|
15
|
+
.c4-shape .label,
|
|
16
|
+
.c4-shape .label text {
|
|
17
|
+
color: inherit;
|
|
18
|
+
fill: currentColor;
|
|
19
|
+
}
|
|
20
|
+
/* Structurizr typography: bold name, smaller stereotype/type and description lines. */
|
|
21
|
+
.c4-shape .label .c4-name {
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
}
|
|
24
|
+
.c4-shape .label .c4-type {
|
|
25
|
+
font-size: 0.75em;
|
|
26
|
+
}
|
|
27
|
+
.c4-shape .label .c4-descr {
|
|
28
|
+
font-size: 0.82em;
|
|
29
|
+
}
|
|
30
|
+
.c4-shape .basic,
|
|
31
|
+
.c4-shape rect,
|
|
32
|
+
.c4-shape path,
|
|
33
|
+
.c4-shape circle,
|
|
34
|
+
.c4-shape ellipse,
|
|
35
|
+
.c4-shape line {
|
|
36
|
+
stroke-width: 2px;
|
|
37
|
+
}
|
|
38
|
+
`,"getStyles"),H0=q0,Z0={parser:Xe,db:ee,renderer:ge,styles:H0,init:d(({c4:t,wrap:e})=>{ge.setConf(t),ee.setWrap(e)},"init")};export{Z0 as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ao as r,ap as n}from"./index-DNSP9H_v.js";const t=(a,o)=>r.lang.round(n.parse(a)[o]);export{t as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as s}from"./index-DNSP9H_v.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sizeCapture-INFHLROL--JObXzuK.js","assets/index-DNSP9H_v.js","assets/vue-BhwNxZ68.js","assets/element-plus-IBMLLhb-.js","assets/index-COls5qGF.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as f,l,av as I,am as ee,aw as te,ax as ne,ay as se,an as S,al as re,az as ie,aA as T,aB as P,aC as R,c as ae,aD as oe,L as ce,aE as le,u as h,aF as C,aG as ue}from"./index-DNSP9H_v.js";import{G as _}from"./graph-DcfhsBxO.js";function B(e,{edgePathsClass:n="edges edgePaths"}={}){const s=e.insert("g").attr("class","root"),t=s.insert("g").attr("class","clusters"),o=s.insert("g").attr("class",n),a=s.insert("g").attr("class","edgeLabels"),r=s.insert("g").attr("class","nodes");return{clusters:t,edgePaths:o,edgeLabels:a,nodes:r,rootGroups:s}}f(B,"createLayoutElementGroups");async function M(e,n,s){if(n.label){const{shapeSvg:t,bbox:o}=await ue(e,s===void 0?n:{...n,width:s});n.labelBBox={width:o.width,height:o.height},t.remove()}else n.labelBBox={width:0,height:0}}f(M,"measureGroupLabel");async function G(e,n,s){var a;const t=await ee(e,n,s),o=((a=t.node())==null?void 0:a.getBBox())??{width:0,height:0};return n.width=o.width,n.height=o.height,t}f(G,"insertMeasuredNode");function X(e,n,s){let t=e;const o=new Set;for(;t;){if(t.dir)return t.dir;if(!t.parentId||o.has(t.parentId))break;o.add(t.parentId),t=n.get(t.parentId)}return s}f(X,"resolveNodeDir");async function $(e,n,s={}){const t=new _({multigraph:!0,compound:!0}),o=[...n.edges],a=ae(),r=B(e),{edgeLabels:c,nodes:i}=r,g=new Map,b=new Map(n.nodes.map(d=>[d.id,d])),N=n.direction,v=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(v){const w=s.unwrapGroupLabels&&d.labelType!=="markdown";await M(i,d,w?Number.POSITIVE_INFINITY:void 0)}t.setNode(d.id,{...d})}else{if(v){const w=await G(i,d,{config:a,dir:X(d,b,N)});g.set(d.id,w)}t.setNode(d.id,{...d})}}));for(const d of o)v&&T(d)&&await R(c,d),t.setEdge(d.start,d.end,{...d},d.id),n.edges.some(y=>y.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await oe(async()=>{const{captureNodeSizes:w}=await import("./sizeCapture-INFHLROL--JObXzuK.js");return{captureNodeSizes:w}},__vite__mapDeps([0,1,2,3,4]));d(e,n)}return{graph:t,groups:r,nodeElements:g}}f($,"createGraphWithElements");var u=new Map,m=new Map,A=new Map,fe=f(()=>{m.clear(),A.clear(),u.clear()},"clear"),E=f((e,n)=>{const s=m.get(n)||[];return l.trace("In isDescendant",n," ",e," = ",s.includes(e)),s.includes(e)},"isDescendant"),de=f((e,n)=>{const s=m.get(n)||[];return l.info("Descendants of ",n," is ",s),l.info("Edge is ",e),e.v===n||e.w===n?!1:s?s.includes(e.v)||E(e.v,n)||E(e.w,n)||s.includes(e.w):(l.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),p=f((e,n,s,t)=>{l.debug("Copying children of ",e,"root",t,"data",n.node(e),t);const o=n.children(e)||[];e!==t&&o.push(e),l.debug("Copying (nodes) clusterId",e,"nodes",o),o.forEach(a=>{if(n.children(a).length>0)p(a,n,s,t);else{const r=n.node(a);l.info("cp ",a," to ",t," with parent ",e),s.setNode(a,r),t!==n.parent(a)&&(l.debug("Setting parent",a,n.parent(a)),s.setParent(a,n.parent(a))),e!==t&&a!==e?(l.debug("Setting parent",a,e),s.setParent(a,e)):(l.info("In copy ",e,"root",t,"data",n.node(e),t),l.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==t,"node!==clusterId",a!==e));const c=n.edges(a);l.debug("Copying Edges",c),c.forEach(i=>{l.info("Edge",i);const g=n.edge(i.v,i.w,i.name);l.info("Edge data",g,t);try{de(i,t)?(l.info("Copying as ",i.v,i.w,g,i.name),s.setEdge(i.v,i.w,g,i.name),l.info("newGraph edges ",s.edges(),s.edge(s.edges()[0]))):l.info("Skipping copy of edge ",i.v,"-->",i.w," rootId: ",t," clusterId:",e)}catch(b){l.error(b)}})}l.debug("Removing node",a),n.removeNode(a)})},"copy"),O=f((e,n)=>{const s=n.children(e);let t=[...s];for(const o of s)A.set(o,e),t=[...t,...O(o,n)];return t},"extractDescendants"),ge=f((e,n,s)=>{const t=e.edges().filter(i=>i.v===n||i.w===n),o=e.edges().filter(i=>i.v===s||i.w===s),a=t.map(i=>({v:i.v===n?s:i.v,w:i.w===n?n:i.w})),r=o.map(i=>({v:i.v,w:i.w}));return a.filter(i=>r.some(g=>i.v===g.v&&i.w===g.w))},"findCommonEdges"),x=f((e,n,s)=>{const t=n.children(e);if(l.trace("Searching children of id ",e,t),t.length<1)return e;let o;for(const a of t){const r=x(a,n,s),c=ge(n,s,r);if(r)if(c.length>0)o=r;else return r}return o},"findNonClusterChild"),k=f(e=>!u.has(e)||!u.get(e).externalConnections?e:u.has(e)?u.get(e).id:e,"getAnchorId"),he=f((e,n)=>{var s;if(!e||n>10){l.debug("Opting out, no graph ");return}else l.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(l.debug("Cluster identified",t," Replacement id in edges: ",x(t,e,t)),m.set(t,O(t,e)),u.set(t,{id:x(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const o=e.children(t),a=e.edges();o.length>0?(l.debug("Cluster identified",t,m),a.forEach(r=>{const c=E(r.v,t),i=E(r.w,t);c^i&&(l.debug("Edge: ",r," leaves cluster ",t),l.debug("Descendants of XXX ",t,": ",m.get(t)),u.get(t).externalConnections=!0)})):l.debug("Not a cluster ",t,m)});for(let t of u.keys()){const o=u.get(t).id,a=e.parent(o);a!==t&&u.has(a)&&!u.get(a).externalConnections&&(u.get(t).id=a);const r=e.edges().some(c=>c.v===t);if(o&&((s=u.get(t))!=null&&s.externalConnections)&&r&&j(e,o,t)){const c=be(e,t,e.parent(o));c&&(u.get(t).id=c)}}e.edges().forEach(function(t){const o=e.edge(t);l.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),l.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let a=t.v,r=t.w;if(l.debug("Fix XXX",u,"ids:",t.v,t.w,"Translating: ",u.get(t.v)," --- ",u.get(t.w)),u.get(t.v)||u.get(t.w)){if(l.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),a=k(t.v),r=k(t.w),e.removeEdge(t.v,t.w,t.name),a!==t.v){const c=e.parent(a);u.get(c).externalConnections=!0,o.fromCluster=t.v}if(r!==t.w){const c=e.parent(r);u.get(c).externalConnections=!0,o.toCluster=t.w}l.debug("Fix Replacing with XXX",a,r,t.name),e.setEdge(a,r,o,t.name)}}),F(e,0),l.trace(u)},"adjustClustersAndEdges"),F=f((e,n)=>{var o,a;if(n>10){l.error("Bailing out");return}let s=e.nodes(),t=!1;for(const r of s){const c=e.children(r);t=t||c.length>0}if(!t){l.debug("Done, no node has children",e.nodes());return}l.debug("Nodes = ",s,n);for(const r of s)if(l.debug("Extracting node",r,u,u.has(r)&&!u.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",n),!u.has(r))l.debug("Not a cluster",r,n);else if(!u.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){l.debug("Cluster without external connections, without a parent and with children",r,n);let i=e.graph().rankdir==="TB"?"LR":"TB";(a=(o=u.get(r))==null?void 0:o.clusterData)!=null&&a.dir&&(i=u.get(r).clusterData.dir,l.debug("Fixing dir",u.get(r).clusterData.dir,i));const g=new _({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});p(r,e,g,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:u.get(r).clusterData,label:u.get(r).label,graph:g})}else l.debug("Cluster ** ",r," **not meeting the criteria !externalConnections:",!u.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),n),l.debug(u);s=e.nodes(),l.debug("New list of nodes",s);for(const r of s){const c=e.node(r);l.debug(" Now next level",r,c),c!=null&&c.clusterNode&&F(c.graph,n+1)}},"extractor"),z=f((e,n)=>{if(n.length===0)return[];let s=Object.assign([],n);return n.forEach(t=>{const o=e.children(t),a=z(e,o);s=[...s,...a]}),s},"sorter"),Ee=f(e=>z(e,e.children()),"sortNodesByHierarchy"),j=f((e,n,s)=>{let t=e.parent(n);for(;t&&t!==s;){const o=u.get(t);if(o&&!o.externalConnections)return!0;t=e.parent(t)}return!1},"isNodeInExtractableCluster"),be=f((e,n,s)=>{const t=e.children(n)??[];for(const o of t){if(o===s||E(o,s))continue;const a=x(o,e,n);if(a&&!j(e,a,n))return a}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:s,paintLayout:t,afterPaint:o,paintOptions:a}){const r=n??J;return f(async function(i,g,b,N){const v=g.select("g");((b==null?void 0:b.insertMarkers)??I)(v,i.markers,i.type,i.diagramId),H();const d={element:v,helpers:b,options:N};d.preparedLayout=await(e==null?void 0:e(i,d));const w=await r(i,d),y=await s(i,d),D={...d,measure:w};t?await t(i,D,y):await V(i,D,a),await(o==null?void 0:o(i,D,y))},"render")}f(we,"createCommonLayoutRenderer");function H(){te(),ne(),se(),fe()}f(H,"clearLayoutRenderState");async function J(e,{element:n},s){return await $(n,e,s)}f(J,"defaultMeasureLayout");async function V(e,n,s={}){var r,c;const{measure:t}=n,{groups:o}=t;for(const i of((r=s.getNodes)==null?void 0:r.call(s,e,n))??e.nodes)(c=s.skipNode)!=null&&c.call(s,i,n)||await W(o,i,n,s);const a=q(e.nodes);for(const i of e.edges)K(i,s)||await Q(o,i,a,e,s,n)}f(V,"paintLayoutData");async function W(e,n,s,t){n.clusterNode?S(n):Y(n,s,t)?await re(e.clusters,n):S(n)}f(W,"paintLayoutNode");function Y(e,n,s){var t;return e.isGroup===!0&&(((t=s.isCluster)==null?void 0:t.call(s,e,n))??!0)}f(Y,"shouldPaintAsCluster");function q(e){const n=new Map;for(const s of e)s!=null&&s.id&&n.set(s.id,s);return n}f(q,"buildNodeLookup");function K(e,n){var s;return e.isLayoutOnly||!!((s=n.skipEdge)!=null&&s.call(n,e))}f(K,"shouldSkipPaintEdge");async function Q(e,n,s,t,o,a){const r=ie(e.edgePaths,{...n},o.clusterDb??new Map,t.type,L(n.start,n,s,a,o),L(n.end,n,s,a,o),t.diagramId,U(n,o));T(n)&&(P.has(n.id)||await R(e.edgeLabels,n),Z(n,r))}f(Q,"paintLayoutEdge");function L(e,n,s,t,o){var a;return((a=o.getEdgeNode)==null?void 0:a.call(o,e,n,t))??(e?s.get(e)??{}:{})}f(L,"getRenderedNode");function U(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}f(U,"shouldSkipIntersect");function Z(e,n){const s=(n==null?void 0:n.updatedPath)??(n==null?void 0:n.originalPath),t=ce(),{subGraphTitleTotalMargin:o}=le({flowchart:t.flowchart??{}});if(e.label){const a=P.get(e.id);let r=e.x,c=e.y;if(s){const i=h.calcLabelPosition(s);l.debug("Moving label "+e.label+" from (",r,",",c,") to (",i.x,",",i.y,") abc88"),n!=null&&n.updatedPath&&(r=i.x,c=i.y)}a.attr("transform",`translate(${r}, ${c+o/2})`)}if(e!=null&&e.startLabelLeft){const a=C.get(e.id).startLeft;let r=e==null?void 0:e.x,c=e==null?void 0:e.y;if(s){const i=h.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",s);r=i.x,c=i.y}a.attr("transform",`translate(${r}, ${c})`)}if(e.startLabelRight){const a=C.get(e.id).startRight;let r=e.x,c=e.y;if(s){const i=h.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",s);r=i.x,c=i.y}a.attr("transform",`translate(${r}, ${c})`)}if(e.endLabelLeft){const a=C.get(e.id).endLeft;let r=e.x,c=e.y;if(s){const i=h.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",s);r=i.x,c=i.y}a.attr("transform",`translate(${r}, ${c})`)}if(e.endLabelRight){const a=C.get(e.id).endRight;let r=e.x,c=e.y;if(s){const i=h.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",s);r=i.x,c=i.y}a.attr("transform",`translate(${r}, ${c})`)}}f(Z,"positionRenderedEdgeLabel");export{he as a,B as b,we as c,J as d,u as e,x as f,G as i,Ee as s};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{_ as e}from"./index-DNSP9H_v.js";var l=e(()=>`
|
|
2
|
+
/* Font Awesome icon styling - consolidated */
|
|
3
|
+
.label-icon {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
height: 1em;
|
|
6
|
+
overflow: visible;
|
|
7
|
+
vertical-align: -0.125em;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.node .label-icon path {
|
|
11
|
+
fill: currentColor;
|
|
12
|
+
stroke: revert;
|
|
13
|
+
stroke-width: revert;
|
|
14
|
+
}
|
|
15
|
+
`,"getIconStyles");export{l as g};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import{_ as p,l as k,Q as H,L as B,A as q,R as G,d as U,j,c as K}from"./index-DNSP9H_v.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),Q=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),k.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),k.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),J=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};k.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&k.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),k.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
|
|
2
|
+
`),k.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ne=Y,ae=P,oe={clear:Q,setTitle:Y,getTitle:P,addRule:J,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:ae},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:a,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return le.test(a)?a:i},"sanitizeColorValue"),I=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return se.test(a)?a:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=I(e.fontFamily,f.fontFamily),a=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=B(),a={...G(),...i.themeVariables??{},...me(e)},n=pe(a),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??n.compactMode,padding:F(t.padding,n.padding),verticalSeparation:F(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,n.horizontalSeparation),arcRadius:F(t.arcRadius,n.arcRadius),fontSize:F(t.fontSize,n.fontSize),fontFamily:I(t.fontFamily,n.fontFamily),terminalFill:m(t.terminalFill,n.terminalFill),terminalStroke:m(t.terminalStroke,n.terminalStroke),terminalTextColor:m(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:m(t.lineColor,n.lineColor),strokeWidth:F(t.strokeWidth,n.strokeWidth),markerFill:m(t.markerFill,n.markerFill),commentFill:m(t.commentFill,n.commentFill),commentStroke:m(t.commentStroke,n.commentStroke),commentTextColor:m(t.commentTextColor,n.commentTextColor),specialFill:m(t.specialFill,n.specialFill),specialStroke:m(t.specialStroke,n.specialStroke),ruleNameColor:m(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:F(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
|
|
3
|
+
.railroad-diagram {
|
|
4
|
+
font-family: ${i};
|
|
5
|
+
font-size: ${a}px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.railroad-terminal rect {
|
|
9
|
+
fill: ${n};
|
|
10
|
+
stroke: ${t};
|
|
11
|
+
stroke-width: ${h}px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.railroad-terminal text {
|
|
15
|
+
fill: ${r};
|
|
16
|
+
font-family: ${i};
|
|
17
|
+
font-size: ${a}px;
|
|
18
|
+
text-anchor: middle;
|
|
19
|
+
dominant-baseline: middle;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.railroad-nonterminal rect {
|
|
23
|
+
fill: ${o};
|
|
24
|
+
stroke: ${g};
|
|
25
|
+
stroke-width: ${h}px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.railroad-nonterminal text {
|
|
29
|
+
fill: ${l};
|
|
30
|
+
font-family: ${i};
|
|
31
|
+
font-size: ${a}px;
|
|
32
|
+
text-anchor: middle;
|
|
33
|
+
dominant-baseline: middle;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.railroad-line {
|
|
37
|
+
stroke: ${s};
|
|
38
|
+
stroke-width: ${h}px;
|
|
39
|
+
fill: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.railroad-start circle,
|
|
43
|
+
.railroad-end circle {
|
|
44
|
+
fill: ${u};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.railroad-comment ellipse {
|
|
48
|
+
fill: ${c};
|
|
49
|
+
stroke: ${w};
|
|
50
|
+
stroke-width: ${h}px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.railroad-comment text {
|
|
54
|
+
fill: ${d};
|
|
55
|
+
font-style: italic;
|
|
56
|
+
font-family: ${i};
|
|
57
|
+
font-size: ${a}px;
|
|
58
|
+
text-anchor: middle;
|
|
59
|
+
dominant-baseline: middle;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.railroad-special rect {
|
|
63
|
+
fill: ${T};
|
|
64
|
+
stroke: ${z};
|
|
65
|
+
stroke-width: ${h}px;
|
|
66
|
+
stroke-dasharray: 5,3;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.railroad-special text {
|
|
70
|
+
fill: ${l};
|
|
71
|
+
font-family: ${i};
|
|
72
|
+
font-size: ${a}px;
|
|
73
|
+
text-anchor: middle;
|
|
74
|
+
dominant-baseline: middle;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.railroad-rule-name {
|
|
78
|
+
font-weight: bold;
|
|
79
|
+
fill: ${S};
|
|
80
|
+
font-family: ${i};
|
|
81
|
+
font-size: ${a}px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.railroad-group {
|
|
85
|
+
/* Grouping container, no specific styles */
|
|
86
|
+
}
|
|
87
|
+
`},"getStyles"),R,x=(R=class{constructor(){this.d=""}moveTo(i,a){return this.d+=`M ${i} ${a} `,this}lineTo(i,a){return this.d+=`L ${i} ${a} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,a,n,t,r,o,g){return this.d+=`A ${i} ${a} ${n} ${t?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},p(R,"PathBuilder"),R),$,ue=($=class{constructor(i,a=E()){this.textCache=new Map,this.svg=i,this.config=a}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);const a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=a.node().getBBox(),t={width:n.width,height:n.height};return a.remove(),this.textCache.set(i,t),t}renderTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,a){const n=this.measureText(a),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,a){const n=a.map(s=>this.renderExpression(i,s));let t=0,r=0,o=0;for(const s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;const g=i.append("g").attr("class","railroad-sequence");let l=0;for(let s=0;s<n.length;s++){const h=n[s],u=r-h.dimensions.up;if(g.node().appendChild(h.element).setAttribute("transform",`translate(${l}, ${u})`),s<n.length-1){const w=l+h.dimensions.width,d=w+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new x().moveTo(w,T).lineTo(d,T).build())}l+=h.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+o,up:r,down:o}}}renderChoice(i,a){const n=a.map(c=>this.renderExpression(i,c));let t=0,r=0;for(const c of n)t=Math.max(t,c.dimensions.width),r+=c.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius,g=o*4,l=t+g,s=i.append("g").attr("class","railroad-choice");let h=0;const u=r/2;for(const c of n){const w=h,d=w+c.dimensions.up,T=o*2+(t-c.dimensions.width)/2;s.node().appendChild(c.element).setAttribute("transform",`translate(${T}, ${w})`);const S=new x,C=d>u;d===u?S.moveTo(0,u).lineTo(T,d):S.moveTo(0,u).arcTo(o,o,0,!1,C,o,u+(C?o:-o)).lineTo(o,d-(C?o:-o)).arcTo(o,o,0,!1,!C,o*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",S.build());const N=new x,_=T+c.dimensions.width,X=l-o*2;d===u?N.moveTo(_,d).lineTo(l,u):N.moveTo(_,d).lineTo(X,d).arcTo(o,o,0,!1,!C,l-o,d+(C?-o:o)).lineTo(l-o,u+(C?o:-o)).arcTo(o,o,0,!1,C,l,u),s.append("path").attr("class","railroad-line").attr("d",N.build()),h+=c.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:u,down:r-u}}}renderOptional(i,a){const n=this.renderExpression(i,a),t=this.config.arcRadius,r=t*2,o=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,h=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${h})`);const c=h+n.dimensions.up,w=new x().moveTo(0,c).lineTo(t*2,c);l.append("path").attr("class","railroad-line").attr("d",w.build());const d=new x().moveTo(s+n.dimensions.width,c).lineTo(o,c);l.append("path").attr("class","railroad-line").attr("d",d.build());const T=new x().moveTo(0,c).arcTo(t,t,0,!1,!1,t,c-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(o-t*2,0).arcTo(t,t,0,!1,!0,o-t,t).lineTo(o-t,c-t).arcTo(t,t,0,!1,!1,o,c);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:o,height:g,up:c,down:g-c}}}renderRepetition(i,a,n){const t=this.renderExpression(i,a),r=this.config.arcRadius,o=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+o+(l?o:0),h=i.append("g").attr("class","railroad-repetition"),u=r*2,c=l?o:0;h.node().appendChild(t.element).setAttribute("transform",`translate(${u}, ${c})`);const d=c+t.dimensions.up;h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(0,d).lineTo(r*2,d).build()),h.append("path").attr("class","railroad-line").attr("d",new x().moveTo(u+t.dimensions.width,d).lineTo(g,d).build());const T=c+t.dimensions.height+r,z=new x().moveTo(u+t.dimensions.width,d).arcTo(r,r,0,!1,!0,u+t.dimensions.width+r,d+r).lineTo(u+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,u+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(h.append("path").attr("class","railroad-line").attr("d",z.build()),l){const S=new x().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,d-r).arcTo(r,r,0,!1,!1,g,d);h.append("path").attr("class","railroad-line").attr("d",S.build())}return{element:h.node(),dimensions:{width:g,height:s,up:d,down:s-d}}}renderSpecial(i,a){const n=this.measureText("? "+a+" ?"),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,o=i.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),o.append("text").attr("x",t/2).attr("y",r/2).text("? "+a+" ?"),{element:o.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderExpression(i,a){switch(a.type){case"terminal":return this.renderTerminal(i,a.value);case"nonterminal":return this.renderNonTerminal(i,a.name);case"sequence":return this.renderSequence(i,a.elements);case"choice":return this.renderChoice(i,a.alternatives);case"optional":return this.renderOptional(i,a.element);case"repetition":return this.renderRepetition(i,a.element,a.min);case"special":return this.renderSpecial(i,a.text);default:throw new Error(`Unknown node type: ${a.type}`)}}renderRule(i,a){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${a})`),t=i.name+" =",r=this.measureText(t).width+20,o=r+20,g=n.append("g"),l=this.renderExpression(g,i.definition),s=Math.max(20,l.dimensions.up),h=s-l.dimensions.up;return g.attr("transform",`translate(${o}, ${h})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(t),n.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",s).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",o+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(r+this.config.markerRadius,s).lineTo(o,s).build()),n.append("path").attr("class","railroad-line").attr("d",new x().moveTo(o+l.dimensions.width,s).lineTo(o+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:o+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(i){let a=this.config.padding,n=0;for(const t of i){const r=this.renderRule(t,a);a+=r.height+this.config.verticalSeparation,n=Math.max(n,r.width)}return{width:n+this.config.padding*2,height:a+this.config.padding}}},p($,"RailroadRenderer"),$),W=p((e,i,a)=>{U(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),ge=p((e,i,a)=>{k.debug(`[Railroad] Rendering diagram
|
|
88
|
+
`+e);try{const n=H(i);n.attr("class","railroad-diagram");const t=B().railroad,r=(t==null?void 0:t.useMaxWidth)??!0,o=oe.getRules();if(k.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){k.warn("[Railroad] No rules to render"),W(n,{height:100,width:200},r);return}const l=new ue(n,E()).renderDiagram(o);W(n,l,r),k.debug("[Railroad] Render complete")}catch(n){throw k.error("[Railroad] Render error:",n),n}},"draw"),xe={draw:ge};export{oe as d,Te as g,xe as r};
|