@wandox/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/arc-BJMRTG9S.cjs +1 -0
- package/dist/arc-Vdco0qfw.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BjEqcvey.js +4695 -0
- package/dist/architectureDiagram-3BPJPVTR-BvjJfAkh.cjs +36 -0
- package/dist/blockDiagram-GPEHLZMM-B1xf7RE9.js +2427 -0
- package/dist/blockDiagram-GPEHLZMM-B5VqovGY.cjs +132 -0
- package/dist/c4Diagram-AAUBKEIU-C4kjMRea.js +1578 -0
- package/dist/c4Diagram-AAUBKEIU-Ck5uEnJI.cjs +10 -0
- package/dist/channel-DlRtLuYv.js +5 -0
- package/dist/channel-Dm_yrRYJ.cjs +1 -0
- package/dist/chunk-2J33WTMH-CG2n_n4y.cjs +1 -0
- package/dist/chunk-2J33WTMH-CWvmGb4H.js +20 -0
- package/dist/chunk-4BX2VUAB-Bq3GzsD8.js +9 -0
- package/dist/chunk-4BX2VUAB-CdMctZeT.cjs +1 -0
- package/dist/chunk-55IACEB6-BdJhzL0d.js +8 -0
- package/dist/chunk-55IACEB6-sHyHtvg8.cjs +1 -0
- package/dist/chunk-727SXJPM-D-Vmam30.cjs +206 -0
- package/dist/chunk-727SXJPM-DmruCqjM.js +1529 -0
- package/dist/chunk-AQP2D5EJ-CWhKjcV3.cjs +231 -0
- package/dist/chunk-AQP2D5EJ-Ca0ak6w7.js +1399 -0
- package/dist/chunk-FMBD7UC4-CqV0NWQQ.js +19 -0
- package/dist/chunk-FMBD7UC4-DOxtd0OO.cjs +15 -0
- package/dist/chunk-ND2GUHAM-6EMX5Mu8.js +68 -0
- package/dist/chunk-ND2GUHAM-BXeDBtSC.cjs +1 -0
- package/dist/chunk-QZHKN3VN-B7FSI55w.js +15 -0
- package/dist/chunk-QZHKN3VN-CbbdNKnD.cjs +1 -0
- package/dist/classDiagram-4FO5ZUOK-0Kaf7WfA.js +16 -0
- package/dist/classDiagram-4FO5ZUOK-C4it2xBI.cjs +1 -0
- package/dist/classDiagram-v2-Q7XG4LA2-Byom5adL.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-C4it2xBI.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-CuUv9oIm.js +2606 -0
- package/dist/cose-bilkent-S5V4N54A-Dh6nTopA.cjs +1 -0
- package/dist/cytoscape.esm-Cp8cXbK2.js +18729 -0
- package/dist/cytoscape.esm-fcqEUasK.cjs +331 -0
- package/dist/dagre-BM42HDAG-CwxJjZ2n.cjs +4 -0
- package/dist/dagre-BM42HDAG-DMBidMxP.js +448 -0
- package/dist/defaultLocale-BDVPUiG2.js +171 -0
- package/dist/defaultLocale-k2G_58r6.cjs +1 -0
- package/dist/diagram-2AECGRRQ-B2a4nXgJ.js +221 -0
- package/dist/diagram-2AECGRRQ-r7De7taS.cjs +43 -0
- package/dist/diagram-5GNKFQAL-CDiO79WC.cjs +10 -0
- package/dist/diagram-5GNKFQAL-DrHBNZzF.js +123 -0
- package/dist/diagram-KO2AKTUF-BcjWCXZr.js +466 -0
- package/dist/diagram-KO2AKTUF-CDlJCxVO.cjs +3 -0
- package/dist/diagram-LMA3HP47-BXFSAyNV.cjs +24 -0
- package/dist/diagram-LMA3HP47-DJxmyqn0.js +143 -0
- package/dist/diagram-OG6HWLK6-ATK__ca8.js +531 -0
- package/dist/diagram-OG6HWLK6-CgIyEO8_.cjs +24 -0
- package/dist/erDiagram-TEJ5UH35-D4baWNzQ.js +900 -0
- package/dist/erDiagram-TEJ5UH35-Dyuc5EB6.cjs +85 -0
- package/dist/flowDiagram-I6XJVG4X-BMZOncyU.js +1635 -0
- package/dist/flowDiagram-I6XJVG4X-C45fICr4.cjs +162 -0
- package/dist/ganttDiagram-6RSMTGT7-CiYZmmke.js +2526 -0
- package/dist/ganttDiagram-6RSMTGT7-Cxoj6IK8.cjs +292 -0
- package/dist/gitGraphDiagram-PVQCEYII-CQ9bNuwN.js +828 -0
- package/dist/gitGraphDiagram-PVQCEYII-rlaY9dfj.cjs +106 -0
- package/dist/graph-CBizzZ7K.js +1545 -0
- package/dist/graph-V5BNIbHU.cjs +1 -0
- package/dist/index-jBRold1l.js +173159 -0
- package/dist/index-sFrjovbM.cjs +804 -0
- package/dist/index.d.ts +54 -0
- package/dist/infoDiagram-5YYISTIA-CAzYIvUX.js +24 -0
- package/dist/infoDiagram-5YYISTIA-zX5rQglQ.cjs +2 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-09prKBsn.cjs +70 -0
- package/dist/ishikawaDiagram-YF4QCWOH-Co8BnN24.js +622 -0
- package/dist/journeyDiagram-JHISSGLW-DkdWRF_-.cjs +139 -0
- package/dist/journeyDiagram-JHISSGLW-riCLiMCC.js +836 -0
- package/dist/kanban-definition-UN3LZRKU-DWipOCsx.cjs +89 -0
- package/dist/kanban-definition-UN3LZRKU-SRyCSn2H.js +725 -0
- package/dist/katex-Cf_UVKIT.cjs +257 -0
- package/dist/katex-RNjvZ8pg.js +11681 -0
- package/dist/layout-CbksXFOD.js +1728 -0
- package/dist/layout-Dh52gsIJ.cjs +1 -0
- package/dist/linear-C3xSMJV8.cjs +1 -0
- package/dist/linear-CmUCzX9U.js +259 -0
- package/dist/mermaid.core-BzNKr-OJ.cjs +308 -0
- package/dist/mermaid.core-CdBIz6FY.js +15475 -0
- package/dist/mindmap-definition-RKZ34NQL-Cs63oyIX.cjs +96 -0
- package/dist/mindmap-definition-RKZ34NQL-Gcma5iTd.js +830 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/pieDiagram-4H26LBE5-CBGkD8dp.cjs +30 -0
- package/dist/pieDiagram-4H26LBE5-DSL8cVK1.js +164 -0
- package/dist/quadrantDiagram-W4KKPZXB-D3nCWRjF.cjs +7 -0
- package/dist/quadrantDiagram-W4KKPZXB-uod6bhUy.js +1026 -0
- package/dist/requirementDiagram-4Y6WPE33-Bc_6y7SM.js +884 -0
- package/dist/requirementDiagram-4Y6WPE33-D2mHlh5i.cjs +84 -0
- package/dist/sankeyDiagram-5OEKKPKP-DL_kXejW.cjs +40 -0
- package/dist/sankeyDiagram-5OEKKPKP-DMsjY4G4.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-CBGalGOV.cjs +162 -0
- package/dist/sequenceDiagram-3UESZ5HK-CH2Z-Pis.js +2901 -0
- package/dist/stateDiagram-AJRCARHV-gEqlAI6t.js +263 -0
- package/dist/stateDiagram-AJRCARHV-rNMrAI-A.cjs +1 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CDj7L1wi.js +16 -0
- package/dist/stateDiagram-v2-BHNVJYJU-LLlFJ1GM.cjs +1 -0
- package/dist/timeline-definition-PNZ67QCA-Bbuv3uu-.cjs +120 -0
- package/dist/timeline-definition-PNZ67QCA-DrGFbQdC.js +1068 -0
- package/dist/types.d.ts +295 -0
- package/dist/vennDiagram-CIIHVFJN-CGcAwVxU.js +1564 -0
- package/dist/vennDiagram-CIIHVFJN-DsSjXluJ.cjs +34 -0
- package/dist/wandox.cjs +1 -0
- package/dist/wandox.css +1 -0
- package/dist/wandox.js +6 -0
- package/dist/wandox.umd.js +4172 -0
- package/dist/wardley-L42UT6IY-DUnkyH_z.js +22539 -0
- package/dist/wardley-L42UT6IY-tDp0NbFW.cjs +165 -0
- package/dist/wardleyDiagram-YWT4CUSO-CB_Qa4lR.js +684 -0
- package/dist/wardleyDiagram-YWT4CUSO-D0BUmvVW.cjs +78 -0
- package/dist/xychartDiagram-2RQKCTM6-Bcq-ACuw.js +1342 -0
- package/dist/xychartDiagram-2RQKCTM6-BjeAPKLo.cjs +7 -0
- package/package.json +42 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ie=require("./chunk-FMBD7UC4-DOxtd0OO.cjs"),s=require("./mermaid.core-BzNKr-OJ.cjs"),ne=require("./graph-V5BNIbHU.cjs"),le=require("./channel-Dm_yrRYJ.cjs");function ce(e){return Array.isArray(e)}function oe(e){if(s.isPrimitive(e))return e;const t=s.getTag(e);if(!he(e))return{};if(ce(e)){const i=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(i.index=e.index,i.input=e.input),i}if(s.isTypedArray(e)){const i=e,n=i.constructor;return new n(i.buffer,i.byteOffset,i.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const i=e,n=i.buffer,c=i.byteOffset,r=i.byteLength,l=new ArrayBuffer(r),o=new Uint8Array(n,c,r);return new Uint8Array(l).set(o),new DataView(l)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const i=e.constructor,n=new i(e.valueOf());return t==="[object String]"?ue(n,e):ht(n,e),n}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const i=e,n=new RegExp(i.source,i.flags);return n.lastIndex=i.lastIndex,n}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const i=e,n=new Map;return i.forEach((c,r)=>{n.set(r,c)}),n}if(t==="[object Set]"){const i=e,n=new Set;return i.forEach(c=>{n.add(c)}),n}if(t==="[object Arguments]"){const i=e,n={};return ht(n,i),n.length=i.length,n[Symbol.iterator]=i[Symbol.iterator],n}const a={};return de(a,e),ht(a,e),ge(a,e),a}function he(e){switch(s.getTag(e)){case s.argumentsTag:case s.arrayTag:case s.arrayBufferTag:case s.dataViewTag:case s.booleanTag:case s.dateTag:case s.float32ArrayTag:case s.float64ArrayTag:case s.int8ArrayTag:case s.int16ArrayTag:case s.int32ArrayTag:case s.mapTag:case s.numberTag:case s.objectTag:case s.regexpTag:case s.setTag:case s.stringTag:case s.symbolTag:case s.uint8ArrayTag:case s.uint8ClampedArrayTag:case s.uint16ArrayTag:case s.uint32ArrayTag:return!0;default:return!1}}function ht(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function ge(e,t){const a=Object.getOwnPropertySymbols(t);for(let i=0;i<a.length;i++){const n=a[i];Object.prototype.propertyIsEnumerable.call(t,n)&&(e[n]=t[n])}}function ue(e,t){const a=t.valueOf().length;for(const i in t)Object.hasOwn(t,i)&&(Number.isNaN(Number(i))||Number(i)>=a)&&(e[i]=t[i])}function de(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var ut=function(){var e=s.__name(function(D,x,f,p){for(f=f||{},p=D.length;p--;f[D[p]]=x);return f},"o"),t=[1,15],a=[1,7],i=[1,13],n=[1,14],c=[1,19],r=[1,16],l=[1,17],o=[1,18],d=[8,30],u=[8,10,21,28,29,30,31,39,43,46],y=[1,23],_=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],L={trace:s.__name(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:s.__name(function(x,f,p,w,S,h,E){var g=h.length-1;switch(S){case 4:w.getLogger().debug("Rule: separator (NL) ");break;case 5:w.getLogger().debug("Rule: separator (Space) ");break;case 6:w.getLogger().debug("Rule: separator (EOF) ");break;case 7:w.getLogger().debug("Rule: hierarchy: ",h[g-1]),w.setHierarchy(h[g-1]);break;case 8:w.getLogger().debug("Stop NL ");break;case 9:w.getLogger().debug("Stop EOF ");break;case 10:w.getLogger().debug("Stop NL2 ");break;case 11:w.getLogger().debug("Stop EOF2 ");break;case 12:w.getLogger().debug("Rule: statement: ",h[g]),typeof h[g].length=="number"?this.$=h[g]:this.$=[h[g]];break;case 13:w.getLogger().debug("Rule: statement #2: ",h[g-1]),this.$=[h[g-1]].concat(h[g]);break;case 14:w.getLogger().debug("Rule: link: ",h[g],x),this.$={edgeTypeStr:h[g],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",h[g-3],h[g-1],h[g]),this.$={edgeTypeStr:h[g],label:h[g-1]};break;case 18:const k=parseInt(h[g]),T=w.generateId();this.$={id:T,type:"space",label:"",width:k,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",h[g-2],h[g-1],h[g]," typestr: ",h[g-1].edgeTypeStr);const H=w.edgeStrToEdgeData(h[g-1].edgeTypeStr),z=w.edgeStrToEdgeStartData(h[g-1].edgeTypeStr),j=w.edgeStrToThickness(h[g-1].edgeTypeStr),I=w.edgeStrToPattern(h[g-1].edgeTypeStr);this.$=[{id:h[g-2].id,label:h[g-2].label,type:h[g-2].type,directions:h[g-2].directions},{id:h[g-2].id+"-"+h[g].id,start:h[g-2].id,end:h[g].id,label:h[g-1].label,type:"edge",thickness:j,pattern:I,directions:h[g].directions,arrowTypeEnd:H,arrowTypeStart:z},{id:h[g].id,label:h[g].label,type:w.typeStr2Type(h[g].typeStr),directions:h[g].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[g-1],h[g]),this.$={id:h[g-1].id,label:h[g-1].label,type:w.typeStr2Type(h[g-1].typeStr),directions:h[g-1].directions,widthInColumns:parseInt(h[g],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",h[g]),this.$={id:h[g].id,label:h[g].label,type:w.typeStr2Type(h[g].typeStr),directions:h[g].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",h[g]),this.$={type:"column-setting",columns:h[g]==="auto"?-1:parseInt(h[g])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",h[g-2],h[g-1]),w.generateId(),this.$={...h[g-2],type:"composite",children:h[g-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",h[g-2],h[g-1],h[g]);const P=w.generateId();this.$={id:P,type:"composite",label:"",children:h[g-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",h[g]),this.$={id:h[g]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[g-1],h[g]),this.$={id:h[g-1],label:h[g].label,typeStr:h[g].typeStr,directions:h[g].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",h[g]),this.$=[h[g]];break;case 32:w.getLogger().debug("Rule: dirList: ",h[g-1],h[g]),this.$=[h[g-1]].concat(h[g]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",h[g-2],h[g-1],h[g]),this.$={typeStr:h[g-2]+h[g],label:h[g-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[g-3],h[g-2]," #3:",h[g-1],h[g]),this.$={typeStr:h[g-3]+h[g],label:h[g-2],directions:h[g-1]};break;case 35:case 36:this.$={type:"classDef",id:h[g-1].trim(),css:h[g].trim()};break;case 37:this.$={type:"applyClass",id:h[g-1].trim(),styleClass:h[g].trim()};break;case 38:this.$={type:"applyStyles",id:h[g-1].trim(),stylesStr:h[g].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:n,31:c,39:r,43:l,46:o},{8:[1,20]},e(d,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:i,29:n,31:c,39:r,43:l,46:o}),e(u,[2,16],{14:22,15:y,16:_}),e(u,[2,17]),e(u,[2,18]),e(u,[2,19]),e(u,[2,20]),e(u,[2,21]),e(u,[2,22]),e(m,[2,25],{27:[1,25]}),e(u,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:n,31:c,39:r,43:l,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(b,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(d,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(m,[2,24]),{10:t,11:37,13:4,14:22,15:y,16:_,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:n,31:c,39:r,43:l,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(b,[2,30]),{18:[1,43]},{18:[1,44]},e(m,[2,23]),{18:[1,45]},{30:[1,46]},e(u,[2,28]),e(u,[2,35]),e(u,[2,36]),e(u,[2,37]),e(u,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(u,[2,27]),e(b,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(b,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:s.__name(function(x,f){if(f.recoverable)this.trace(x);else{var p=new Error(x);throw p.hash=f,p}},"parseError"),parse:s.__name(function(x){var f=this,p=[0],w=[],S=[null],h=[],E=this.table,g="",k=0,T=0,H=2,z=1,j=h.slice.call(arguments,1),I=Object.create(this.lexer),P={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(P.yy[J]=this.yy[J]);I.setInput(x,P.yy),P.yy.lexer=I,P.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var Q=I.yylloc;h.push(Q);var ae=I.options&&I.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function se(W){p.length=p.length-2*W,S.length=S.length-W,h.length=h.length-W}s.__name(se,"popStack");function St(){var W;return W=w.pop()||I.lex()||z,typeof W!="number"&&(W instanceof Array&&(w=W,W=w.pop()),W=f.symbols_[W]||W),W}s.__name(St,"lex");for(var F,Z,K,ct,G={},et,q,vt,rt;;){if(Z=p[p.length-1],this.defaultActions[Z]?K=this.defaultActions[Z]:((F===null||typeof F>"u")&&(F=St()),K=E[Z]&&E[Z][F]),typeof K>"u"||!K.length||!K[0]){var ot="";rt=[];for(et in E[Z])this.terminals_[et]&&et>H&&rt.push("'"+this.terminals_[et]+"'");I.showPosition?ot="Parse error on line "+(k+1)+`:
|
|
2
|
+
`+I.showPosition()+`
|
|
3
|
+
Expecting `+rt.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ot="Parse error on line "+(k+1)+": Unexpected "+(F==z?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(ot,{text:I.match,token:this.terminals_[F]||F,line:I.yylineno,loc:Q,expected:rt})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+F);switch(K[0]){case 1:p.push(F),S.push(I.yytext),h.push(I.yylloc),p.push(K[1]),F=null,T=I.yyleng,g=I.yytext,k=I.yylineno,Q=I.yylloc;break;case 2:if(q=this.productions_[K[1]][1],G.$=S[S.length-q],G._$={first_line:h[h.length-(q||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(q||1)].first_column,last_column:h[h.length-1].last_column},ae&&(G._$.range=[h[h.length-(q||1)].range[0],h[h.length-1].range[1]]),ct=this.performAction.apply(G,[g,T,k,P.yy,K[1],S,h].concat(j)),typeof ct<"u")return ct;q&&(p=p.slice(0,-1*q*2),S=S.slice(0,-1*q),h=h.slice(0,-1*q)),p.push(this.productions_[K[1]][0]),S.push(G.$),h.push(G._$),vt=E[p[p.length-2]][p[p.length-1]],p.push(vt);break;case 3:return!0}}return!0},"parse")},N=function(){var D={EOF:1,parseError:s.__name(function(f,p){if(this.yy.parser)this.yy.parser.parseError(f,p);else throw new Error(f)},"parseError"),setInput:s.__name(function(x,f){return this.yy=f||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s.__name(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var f=x.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:s.__name(function(x){var f=x.length,p=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var w=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),p.length-1&&(this.yylineno-=p.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===w.length?this.yylloc.first_column:0)+w[w.length-p.length].length-p[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:s.__name(function(){return this._more=!0,this},"more"),reject:s.__name(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:s.__name(function(x){this.unput(this.match.slice(x))},"less"),pastInput:s.__name(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s.__name(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s.__name(function(){var x=this.pastInput(),f=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
|
|
5
|
+
`+f+"^"},"showPosition"),test_match:s.__name(function(x,f){var p,w,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),w=x[0].match(/(?:\r\n?|\n).*/g),w&&(this.yylineno+=w.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:w?w[w.length-1].length-w[w.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+x[0].length},this.yytext+=x[0],this.match+=x[0],this.matches=x,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(x[0].length),this.matched+=x[0],p=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var h in S)this[h]=S[h];return!1}return!1},"test_match"),next:s.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var x,f,p,w;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),h=0;h<S.length;h++)if(p=this._input.match(this.rules[S[h]]),p&&(!f||p[0].length>f[0].length)){if(f=p,w=h,this.options.backtrack_lexer){if(x=this.test_match(p,S[h]),x!==!1)return x;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(x=this.test_match(f,S[w]),x!==!1?x:!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:s.__name(function(){var f=this.next();return f||this.lex()},"lex"),begin:s.__name(function(f){this.conditionStack.push(f)},"begin"),popState:s.__name(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:s.__name(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:s.__name(function(f){this.begin(f)},"pushState"),stateStackSize:s.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:s.__name(function(f,p,w,S){switch(w){case 0:return f.getLogger().debug("Found block-beta"),10;case 1:return f.getLogger().debug("Found id-block"),29;case 2:return f.getLogger().debug("Found block"),10;case 3:f.getLogger().debug(".",p.yytext);break;case 4:f.getLogger().debug("_",p.yytext);break;case 5:return 5;case 6:return p.yytext=-1,28;case 7:return p.yytext=p.yytext.replace(/columns\s+/,""),f.getLogger().debug("COLUMNS (LEX)",p.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:f.getLogger().debug("LEX: POPPING STR:",p.yytext),this.popState();break;case 13:return f.getLogger().debug("LEX: STR end:",p.yytext),"STR";case 14:return p.yytext=p.yytext.replace(/space\:/,""),f.getLogger().debug("SPACE NUM (LEX)",p.yytext),21;case 15:return p.yytext="1",f.getLogger().debug("COLUMNS (LEX)",p.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(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),f.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),f.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),f.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),f.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),f.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),f.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),f.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),f.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),f.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),f.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),f.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),f.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),f.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return f.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return f.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return f.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return f.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return f.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return f.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return f.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return f.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 f.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),f.getLogger().debug("LEX ARR START"),37;case 74:return f.getLogger().debug("Lex: NODE_ID",p.yytext),31;case 75:return f.getLogger().debug("Lex: EOF",p.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:f.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:f.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return f.getLogger().debug("LEX: NODE_DESCR:",p.yytext),"NODE_DESCR";case 83:f.getLogger().debug("LEX POPPING"),this.popState();break;case 84:f.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return p.yytext=p.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (right): dir:",p.yytext),"DIR";case 86:return p.yytext=p.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (left):",p.yytext),"DIR";case 87:return p.yytext=p.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (x):",p.yytext),"DIR";case 88:return p.yytext=p.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (y):",p.yytext),"DIR";case 89:return p.yytext=p.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (up):",p.yytext),"DIR";case 90:return p.yytext=p.yytext.replace(/^,\s*/,""),f.getLogger().debug("Lex (down):",p.yytext),"DIR";case 91:return p.yytext="]>",f.getLogger().debug("Lex (ARROW_DIR end):",p.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return f.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 93:return f.getLogger().debug("Lex: LINK",p.yytext),15;case 94:return f.getLogger().debug("Lex: LINK",p.yytext),15;case 95:return f.getLogger().debug("Lex: LINK",p.yytext),15;case 96:return f.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 97:return f.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 98:return f.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return f.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),f.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 102:return this.popState(),f.getLogger().debug("Lex: LINK",p.yytext),15;case 103:return this.popState(),f.getLogger().debug("Lex: LINK",p.yytext),15;case 104:return f.getLogger().debug("Lex: COLON",p.yytext),p.yytext=p.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 D}();L.lexer=N;function C(){this.yy={}}return s.__name(C,"Parser"),C.prototype=L,L.Parser=C,new C}();ut.parser=ut;var fe=ut,X=new Map,xt=[],dt=new Map,Et="color",kt="fill",pe="bgFill",zt=",",ye=s.getConfig2(),st=new Map,mt="",xe=s.__name(e=>s.common_default.sanitizeText(e,ye),"sanitizeText"),me=s.__name(function(e,t=""){let a=st.get(e);a||(a={id:e,styles:[],textStyles:[]},st.set(e,a)),t!=null&&t.split(zt).forEach(i=>{const n=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Et).exec(i)){const r=n.replace(kt,pe).replace(Et,kt);a.textStyles.push(r)}a.styles.push(n)})},"addStyleClass"),_e=s.__name(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(zt))},"addStyle2Node"),be=s.__name(function(e,t){e.split(",").forEach(function(a){let i=X.get(a);if(i===void 0){const n=a.trim();i={id:n,type:"na",children:[]},X.set(n,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Mt=s.__name((e,t)=>{const a=e.flat(),i=[],n=a.find(r=>(r==null?void 0:r.type)==="column-setting"),c=(n==null?void 0:n.columns)??-1;for(const r of a){if(typeof c=="number"&&c>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>c&&s.log.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${c}`),r.label&&(r.label=xe(r.label)),r.type==="classDef"){me(r.id,r.css);continue}if(r.type==="applyClass"){be(r.id,(r==null?void 0:r.styleClass)??"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&_e(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const l=(dt.get(r.id)??0)+1;dt.set(r.id,l),r.id=l+"-"+r.id,xt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const l=X.get(r.id);if(l===void 0?X.set(r.id,r):(r.type!=="na"&&(l.type=r.type),r.label!==r.id&&(l.label=r.label)),r.children&&Mt(r.children,r),r.type==="space"){const o=r.width??1;for(let d=0;d<o;d++){const u=oe(r);u.id=u.id+"-"+d,X.set(u.id,u),i.push(u)}}else l===void 0&&i.push(r)}}t.children=i},"populateBlockDatabase"),_t=[],tt={id:"root",type:"composite",children:[],columns:-1},we=s.__name(()=>{s.log.debug("Clear called"),s.clear(),tt={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",tt]]),_t=[],st=new Map,xt=[],dt=new Map,mt=""},"clear");function Pt(e){switch(s.log.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return s.log.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"}}s.__name(Pt,"typeStr2Type");function Ft(e){switch(s.log.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}s.__name(Ft,"edgeTypeStr2Type");function Ht(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}s.__name(Ht,"edgeStrToEdgeData");function Wt(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}s.__name(Wt,"edgeStrToEdgeStartData");function Yt(e){return e.includes("==")?"thick":"normal"}s.__name(Yt,"edgeStrToThickness");function Kt(e){return e.includes(".-")?"dotted":"solid"}s.__name(Kt,"edgeStrToPattern");var Tt=0,Le=s.__name(()=>(Tt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Tt),"generateId"),Se=s.__name(e=>{tt.children=e,Mt(e,tt),_t=tt.children},"setHierarchy"),ve=s.__name(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),Ee=s.__name(()=>[...X.values()],"getBlocksFlat"),ke=s.__name(()=>_t||[],"getBlocks"),Te=s.__name(()=>xt,"getEdges"),De=s.__name(e=>X.get(e),"getBlock"),Ce=s.__name(e=>{X.set(e.id,e)},"setBlock"),Ne=s.__name(e=>{mt=e},"setDiagramId"),Ie=s.__name(()=>mt,"getDiagramId"),Be=s.__name(()=>s.log,"getLogger"),Oe=s.__name(function(){return st},"getClasses"),Re={getConfig:s.__name(()=>s.getConfig().block,"getConfig"),typeStr2Type:Pt,edgeTypeStr2Type:Ft,edgeStrToEdgeData:Ht,edgeStrToEdgeStartData:Wt,edgeStrToThickness:Yt,edgeStrToPattern:Kt,getLogger:Be,getBlocksFlat:Ee,getBlocks:ke,getEdges:Te,setHierarchy:Se,getBlock:De,setBlock:Ce,getColumns:ve,getClasses:Oe,clear:we,generateId:Le,setDiagramId:Ne,getDiagramId:Ie},Ae=Re,gt=s.__name((e,t)=>{const a=le.channel,i=a(e,"r"),n=a(e,"g"),c=a(e,"b");return s.rgba(i,n,c,t)},"fade"),ze=s.__name(e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.cluster-label text {
|
|
11
|
+
fill: ${e.titleColor};
|
|
12
|
+
}
|
|
13
|
+
.cluster-label span,p {
|
|
14
|
+
color: ${e.titleColor};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
.label text,span,p {
|
|
20
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
21
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.node rect,
|
|
25
|
+
.node circle,
|
|
26
|
+
.node ellipse,
|
|
27
|
+
.node polygon,
|
|
28
|
+
.node path {
|
|
29
|
+
fill: ${e.mainBkg};
|
|
30
|
+
stroke: ${e.nodeBorder};
|
|
31
|
+
stroke-width: 1px;
|
|
32
|
+
}
|
|
33
|
+
.flowchart-label text {
|
|
34
|
+
text-anchor: middle;
|
|
35
|
+
}
|
|
36
|
+
// .flowchart-label .text-outer-tspan {
|
|
37
|
+
// text-anchor: middle;
|
|
38
|
+
// }
|
|
39
|
+
// .flowchart-label .text-inner-tspan {
|
|
40
|
+
// text-anchor: start;
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
.node .label {
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
.node.clickable {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrowheadPath {
|
|
51
|
+
fill: ${e.arrowheadColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.edgePath .path {
|
|
55
|
+
stroke: ${e.lineColor};
|
|
56
|
+
stroke-width: 2.0px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.flowchart-link {
|
|
60
|
+
stroke: ${e.lineColor};
|
|
61
|
+
fill: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edgeLabel {
|
|
65
|
+
background-color: ${e.edgeLabelBackground};
|
|
66
|
+
/*
|
|
67
|
+
* This is for backward compatibility with existing code that didn't
|
|
68
|
+
* add a \`<p>\` around edge labels.
|
|
69
|
+
*
|
|
70
|
+
* TODO: We should probably remove this in a future release.
|
|
71
|
+
*/
|
|
72
|
+
p {
|
|
73
|
+
margin: 0;
|
|
74
|
+
padding: 0;
|
|
75
|
+
display: inline;
|
|
76
|
+
}
|
|
77
|
+
rect {
|
|
78
|
+
opacity: 0.5;
|
|
79
|
+
background-color: ${e.edgeLabelBackground};
|
|
80
|
+
fill: ${e.edgeLabelBackground};
|
|
81
|
+
}
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* For html labels only */
|
|
86
|
+
.labelBkg {
|
|
87
|
+
background-color: ${e.edgeLabelBackground};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.node .cluster {
|
|
91
|
+
// fill: ${gt(e.mainBkg,.5)};
|
|
92
|
+
fill: ${gt(e.clusterBkg,.5)};
|
|
93
|
+
stroke: ${gt(e.clusterBorder,.2)};
|
|
94
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
95
|
+
stroke-width: 1px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.cluster text {
|
|
99
|
+
fill: ${e.titleColor};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.cluster span,p {
|
|
103
|
+
color: ${e.titleColor};
|
|
104
|
+
}
|
|
105
|
+
/* .cluster div {
|
|
106
|
+
color: ${e.titleColor};
|
|
107
|
+
} */
|
|
108
|
+
|
|
109
|
+
div.mermaidTooltip {
|
|
110
|
+
position: absolute;
|
|
111
|
+
text-align: center;
|
|
112
|
+
max-width: 200px;
|
|
113
|
+
padding: 2px;
|
|
114
|
+
font-family: ${e.fontFamily};
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
background: ${e.tertiaryColor};
|
|
117
|
+
border: 1px solid ${e.border2};
|
|
118
|
+
border-radius: 2px;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
z-index: 100;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.flowchartTitleText {
|
|
124
|
+
text-anchor: middle;
|
|
125
|
+
font-size: 18px;
|
|
126
|
+
fill: ${e.textColor};
|
|
127
|
+
}
|
|
128
|
+
${ie.getIconStyles()}
|
|
129
|
+
`,"getStyles"),Me=ze,Pe=s.__name((e,t,a,i)=>{t.forEach(n=>{qe[n](e,a,i)})},"insertMarkers"),Fe=s.__name((e,t,a)=>{s.log.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),He=s.__name((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),We=s.__name((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Ye=s.__name((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Ke=s.__name((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Ue=s.__name((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Xe=s.__name((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Ve=s.__name((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),je=s.__name((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),qe={extension:Fe,composition:He,aggregation:We,dependency:Ye,lollipop:Ke,point:Ue,circle:Xe,cross:Ve,barb:je},Ze=Pe,Rt,At,R=((At=(Rt=s.getConfig2())==null?void 0:Rt.block)==null?void 0:At.padding)??8;function ft(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,i=Math.floor(t/e);return{px:a,py:i}}s.__name(ft,"calculateBlockPosition");var Ge=s.__name(e=>{let t=0,a=0;for(const i of e.children){const{width:n,height:c,x:r,y:l}=i.size??{width:0,height:0,x:0,y:0};if(s.log.debug("getMaxChildSize abc95 child:",i.id,"width:",n,"height:",c,"x:",r,"y:",l,i.type),i.type==="space")continue;const o=n/(i.widthInColumns??1);o>t&&(t=o),c>a&&(a=c)}return{width:t,height:a}},"getMaxChildSize");function it(e,t,a=0,i=0){var r,l,o,d,u,y,_,m,b,v,L;s.log.debug("setBlockSizes abc95 (start)",e.id,(r=e==null?void 0:e.size)==null?void 0:r.x,"block width =",e==null?void 0:e.size,"siblingWidth",a),(l=e==null?void 0:e.size)!=null&&l.width||(e.size={width:a,height:i,x:0,y:0});let n=0,c=0;if(((o=e.children)==null?void 0:o.length)>0){for(const S of e.children)it(S,t);const N=Ge(e);n=N.width,c=N.height,s.log.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",n,c);for(const S of e.children)S.size&&(s.log.debug(`abc95 Setting size of children of ${e.id} id=${S.id} ${n} ${c} ${JSON.stringify(S.size)}`),S.size.width=n*(S.widthInColumns??1)+R*((S.widthInColumns??1)-1),S.size.height=c,S.size.x=0,S.size.y=0,s.log.debug(`abc95 updating size of ${e.id} children child:${S.id} maxWidth:${n} maxHeight:${c}`));for(const S of e.children)it(S,t,n,c);const C=e.columns??-1;let D=0;for(const S of e.children)D+=S.widthInColumns??1;let x=e.children.length;C>0&&C<D&&(x=C);const f=Math.ceil(D/x);let p=x*(n+R)+R,w=f*(c+R)+R;if(p<a){s.log.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${i} width ${p}`),p=a,w=i;const S=(a-x*R-R)/x,h=(i-f*R-R)/f;s.log.debug("Size indata abc88",e.id,"childWidth",S,"maxWidth",n),s.log.debug("Size indata abc88",e.id,"childHeight",h,"maxHeight",c),s.log.debug("Size indata abc88 xSize",x,"padding",R);for(const E of e.children)E.size&&(E.size.width=S,E.size.height=h,E.size.x=0,E.size.y=0)}if(s.log.debug(`abc95 (finale calc) ${e.id} xSize ${x} ySize ${f} columns ${C}${e.children.length} width=${Math.max(p,((d=e.size)==null?void 0:d.width)||0)}`),p<(((u=e==null?void 0:e.size)==null?void 0:u.width)||0)){p=((y=e==null?void 0:e.size)==null?void 0:y.width)||0;const S=C>0?Math.min(e.children.length,C):e.children.length;if(S>0){const h=(p-S*R-R)/S;s.log.debug("abc95 (growing to fit) width",e.id,p,(_=e.size)==null?void 0:_.width,h);for(const E of e.children)E.size&&(E.size.width=h)}}e.size={width:p,height:w,x:0,y:0}}s.log.debug("setBlockSizes abc94 (done)",e.id,(m=e==null?void 0:e.size)==null?void 0:m.x,(b=e==null?void 0:e.size)==null?void 0:b.width,(v=e==null?void 0:e.size)==null?void 0:v.y,(L=e==null?void 0:e.size)==null?void 0:L.height)}s.__name(it,"setBlockSizes");function bt(e,t){var i,n,c,r,l,o,d,u,y,_,m,b,v,L,N,C,D;s.log.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(i=e==null?void 0:e.size)==null?void 0:i.x} y: ${(n=e==null?void 0:e.size)==null?void 0:n.y} width: ${(c=e==null?void 0:e.size)==null?void 0:c.width}`);const a=e.columns??-1;if(s.log.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const x=((l=(r=e==null?void 0:e.children[0])==null?void 0:r.size)==null?void 0:l.width)??0,f=e.children.length*x+(e.children.length-1)*R;s.log.debug("widthOfChildren 88",f,"posX");const p=new Map;{let g=0;for(const k of e.children){if(!k.size)continue;const{py:T}=ft(a,g),H=p.get(T)??0;k.size.height>H&&p.set(T,k.size.height);let z=(k==null?void 0:k.widthInColumns)??1;a>0&&(z=Math.min(z,a-g%a)),g+=z}}const w=new Map;{let g=0;const k=[...p.keys()].sort((T,H)=>T-H);for(const T of k)w.set(T,g),g+=(p.get(T)??0)+R}let S=0;s.log.debug("abc91 block?.size?.x",e.id,(o=e==null?void 0:e.size)==null?void 0:o.x);let h=(d=e==null?void 0:e.size)!=null&&d.x?((u=e==null?void 0:e.size)==null?void 0:u.x)+(-((y=e==null?void 0:e.size)==null?void 0:y.width)/2||0):-R,E=0;for(const g of e.children){const k=e;if(!g.size)continue;const{width:T,height:H}=g.size,{px:z,py:j}=ft(a,S);if(j!=E&&(E=j,h=(_=e==null?void 0:e.size)!=null&&_.x?((m=e==null?void 0:e.size)==null?void 0:m.x)+(-((b=e==null?void 0:e.size)==null?void 0:b.width)/2||0):-R,s.log.debug("New row in layout for block",e.id," and child ",g.id,E)),s.log.debug(`abc89 layout blocks (child) id: ${g.id} Pos: ${S} (px, py) ${z},${j} (${(v=k==null?void 0:k.size)==null?void 0:v.x},${(L=k==null?void 0:k.size)==null?void 0:L.y}) parent: ${k.id} width: ${T}${R}`),k.size){const P=T/2;g.size.x=h+R+P,s.log.debug(`abc91 layout blocks (calc) px, pyid:${g.id} startingPos=X${h} new startingPosX${g.size.x} ${P} padding=${R} width=${T} halfWidth=${P} => x:${g.size.x} y:${g.size.y} ${g.widthInColumns} (width * (child?.w || 1)) / 2 ${T*((g==null?void 0:g.widthInColumns)??1)/2}`),h=g.size.x+P;const J=w.get(j)??0,Q=p.get(j)??H;g.size.y=k.size.y-k.size.height/2+J+Q/2+R,s.log.debug(`abc88 layout blocks (calc) px, pyid:${g.id}startingPosX${h}${R}${P}=>x:${g.size.x}y:${g.size.y}${g.widthInColumns}(width * (child?.w || 1)) / 2${T*((g==null?void 0:g.widthInColumns)??1)/2}`)}g.children&&bt(g);let I=(g==null?void 0:g.widthInColumns)??1;a>0&&(I=Math.min(I,a-S%a)),S+=I,s.log.debug("abc88 columnsPos",g,S)}}s.log.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(N=e==null?void 0:e.size)==null?void 0:N.x} y: ${(C=e==null?void 0:e.size)==null?void 0:C.y} width: ${(D=e==null?void 0:e.size)==null?void 0:D.width}`)}s.__name(bt,"layoutBlocks");function wt(e,{minX:t,minY:a,maxX:i,maxY:n}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:c,y:r,width:l,height:o}=e.size;c-l/2<t&&(t=c-l/2),r-o/2<a&&(a=r-o/2),c+l/2>i&&(i=c+l/2),r+o/2>n&&(n=r+o/2)}if(e.children)for(const c of e.children)({minX:t,minY:a,maxX:i,maxY:n}=wt(c,{minX:t,minY:a,maxX:i,maxY:n}));return{minX:t,minY:a,maxX:i,maxY:n}}s.__name(wt,"findBounds");function Ut(e){const t=e.getBlock("root");if(!t)return;it(t,e,0,0),bt(t),s.log.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:i,maxX:n,maxY:c}=wt(t),r=c-i,l=n-a;return{x:a,y:i,width:l,height:r}}s.__name(Ut,"layout");var Je=s.__name(async(e,t,a,i=!1,n=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);const r=s.getConfig2(),l=s.getEffectiveHtmlLabels(r);return await s.createText(e,c,{style:a,isTitle:i,useHtmlLabels:l,markdown:!1,isNode:n,width:Number.POSITIVE_INFINITY},r)},"createLabel"),U=Je,Qe=s.__name((e,t,a,i,n)=>{t.arrowTypeStart&&Dt(e,"start",t.arrowTypeStart,a,i,n),t.arrowTypeEnd&&Dt(e,"end",t.arrowTypeEnd,a,i,n)},"addEdgeMarkers"),$e={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Dt=s.__name((e,t,a,i,n,c)=>{const r=$e[a];if(!r){s.log.warn(`Unknown arrow type: ${a}`);return}const l=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${n}_${c}-${r}${l})`)},"addEdgeMarker"),pt={},M={},tr=s.__name(async(e,t)=>{const a=s.getConfig2(),i=s.getEffectiveHtmlLabels(a),n=e.insert("g").attr("class","edgeLabel"),c=n.insert("g").attr("class","label"),r=t.labelType==="markdown",l=await s.createText(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},a);c.node().appendChild(l);let o=l.getBBox(),d=o;if(i){const y=l.children[0],_=s.select(l);o=y.getBoundingClientRect(),d=o,_.attr("width",o.width),_.attr("height",o.height)}else{const y=s.select(l).select("text").node();y&&typeof y.getBBox=="function"&&(d=y.getBBox())}c.attr("transform",s.computeLabelTransform(d,i)),pt[t.id]=n,t.width=o.width,t.height=o.height;let u;if(t.startLabelLeft){const y=e.insert("g").attr("class","edgeTerminals"),_=y.insert("g").attr("class","inner"),m=await U(_,t.startLabelLeft,t.labelStyle);u=m;let b=m.getBBox();if(i){const v=m.children[0],L=s.select(m);b=v.getBoundingClientRect(),L.attr("width",b.width),L.attr("height",b.height)}_.attr("transform",s.computeLabelTransform(b,i)),M[t.id]||(M[t.id]={}),M[t.id].startLeft=y,$(u,t.startLabelLeft)}if(t.startLabelRight){const y=e.insert("g").attr("class","edgeTerminals"),_=y.insert("g").attr("class","inner"),m=await U(_,t.startLabelRight,t.labelStyle);u=m;let b=m.getBBox();if(i){const v=m.children[0],L=s.select(m);b=v.getBoundingClientRect(),L.attr("width",b.width),L.attr("height",b.height)}_.attr("transform",s.computeLabelTransform(b,i)),M[t.id]||(M[t.id]={}),M[t.id].startRight=y,$(u,t.startLabelRight)}if(t.endLabelLeft){const y=e.insert("g").attr("class","edgeTerminals"),_=y.insert("g").attr("class","inner"),m=await U(y,t.endLabelLeft,t.labelStyle);u=m;let b=m.getBBox();if(i){const v=m.children[0],L=s.select(m);b=v.getBoundingClientRect(),L.attr("width",b.width),L.attr("height",b.height)}_.attr("transform",s.computeLabelTransform(b,i)),M[t.id]||(M[t.id]={}),M[t.id].endLeft=y,$(u,t.endLabelLeft)}if(t.endLabelRight){const y=e.insert("g").attr("class","edgeTerminals"),_=y.insert("g").attr("class","inner"),m=await U(y,t.endLabelRight,t.labelStyle);u=m;let b=m.getBBox();if(i){const v=m.children[0],L=s.select(m);b=v.getBoundingClientRect(),L.attr("width",b.width),L.attr("height",b.height)}_.attr("transform",s.computeLabelTransform(b,i)),M[t.id]||(M[t.id]={}),M[t.id].endRight=y,$(u,t.endLabelRight)}return l},"insertEdgeLabel");function $(e,t){s.getEffectiveHtmlLabels(s.getConfig2())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}s.__name($,"setTerminalWidth");var er=s.__name((e,t)=>{s.log.debug("Moving label abc88 ",e.id,e.label,pt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=s.getConfig2(),{subGraphTitleTotalMargin:n}=s.getSubGraphTitleMargins(i);if(e.label){const c=pt[e.id];let r=e.x,l=e.y;if(a){const o=s.utils_default.calcLabelPosition(a);s.log.debug("Moving label "+e.label+" from (",r,",",l,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(r=o.x,l=o.y)}c.attr("transform",`translate(${r}, ${l+n/2})`)}if(e.startLabelLeft){const c=M[e.id].startLeft;let r=e.x,l=e.y;if(a){const o=s.utils_default.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=o.x,l=o.y}c.attr("transform",`translate(${r}, ${l})`)}if(e.startLabelRight){const c=M[e.id].startRight;let r=e.x,l=e.y;if(a){const o=s.utils_default.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=o.x,l=o.y}c.attr("transform",`translate(${r}, ${l})`)}if(e.endLabelLeft){const c=M[e.id].endLeft;let r=e.x,l=e.y;if(a){const o=s.utils_default.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=o.x,l=o.y}c.attr("transform",`translate(${r}, ${l})`)}if(e.endLabelRight){const c=M[e.id].endRight;let r=e.x,l=e.y;if(a){const o=s.utils_default.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=o.x,l=o.y}c.attr("transform",`translate(${r}, ${l})`)}},"positionEdgeLabel"),rr=s.__name((e,t)=>{const a=e.x,i=e.y,n=Math.abs(t.x-a),c=Math.abs(t.y-i),r=e.width/2,l=e.height/2;return n>=r||c>=l},"outsideNode"),ar=s.__name((e,t,a)=>{s.log.debug(`intersection calc abc89:
|
|
130
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
131
|
+
insidePoint : ${JSON.stringify(a)}
|
|
132
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,n=e.y,c=Math.abs(i-a.x),r=e.width/2;let l=a.x<t.x?r-c:r+c;const o=e.height/2,d=Math.abs(t.y-a.y),u=Math.abs(t.x-a.x);if(Math.abs(n-t.y)*r>Math.abs(i-t.x)*o){let y=a.y<t.y?t.y-o-n:n-o-t.y;l=u*y/d;const _={x:a.x<t.x?a.x+l:a.x-u+l,y:a.y<t.y?a.y+d-y:a.y-d+y};return l===0&&(_.x=t.x,_.y=t.y),u===0&&(_.x=t.x),d===0&&(_.y=t.y),s.log.debug(`abc89 topp/bott calc, Q ${d}, q ${y}, R ${u}, r ${l}`,_),_}else{a.x<t.x?l=t.x-r-i:l=i-r-t.x;let y=d*l/u,_=a.x<t.x?a.x+u-l:a.x-u+l,m=a.y<t.y?a.y+y:a.y-y;return s.log.debug(`sides calc abc89, Q ${d}, q ${y}, R ${u}, r ${l}`,{_x:_,_y:m}),l===0&&(_=t.x,m=t.y),u===0&&(_=t.x),d===0&&(m=t.y),{x:_,y:m}}},"intersection"),Ct=s.__name((e,t)=>{s.log.debug("abc88 cutPathAtIntersect",e,t);let a=[],i=e[0],n=!1;return e.forEach(c=>{if(!rr(t,c)&&!n){const r=ar(t,i,c);let l=!1;a.forEach(o=>{l=l||o.x===r.x&&o.y===r.y}),a.some(o=>o.x===r.x&&o.y===r.y)||a.push(r),n=!0}else i=c,n||a.push(c)}),a},"cutPathAtIntersect"),sr=s.__name(function(e,t,a,i,n,c,r){let l=a.points;s.log.debug("abc88 InsertEdge: edge=",a,"e=",t);let o=!1;const d=c.node(t.v);var u=c.node(t.w);u!=null&&u.intersect&&(d!=null&&d.intersect)&&(l=l.slice(1,a.points.length-1),l.unshift(d.intersect(l[0])),l.push(u.intersect(l[l.length-1]))),a.toCluster&&(s.log.debug("to cluster abc88",i[a.toCluster]),l=Ct(a.points,i[a.toCluster].node),o=!0),a.fromCluster&&(s.log.debug("from cluster abc88",i[a.fromCluster]),l=Ct(l.reverse(),i[a.fromCluster].node).reverse(),o=!0);const y=l.filter(x=>!Number.isNaN(x.y));let _=s.curveBasis;a.curve&&(n==="graph"||n==="flowchart")&&(_=a.curve);const{x:m,y:b}=s.getLineFunctionsWithOffset(a),v=s.line().x(m).y(b).curve(_);let L;switch(a.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-thick";break;default:L=""}switch(a.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break}const N=e.append("path").attr("d",v(y)).attr("id",a.id).attr("class"," "+L+(a.classes?" "+a.classes:"")).attr("style",a.style);let C="";(s.getConfig2().flowchart.arrowMarkerAbsolute||s.getConfig2().state.arrowMarkerAbsolute)&&(C=s.getUrl(!0)),Qe(N,a,C,r,n);let D={};return o&&(D.updatedPath=l),D.originalPath=a.points,D},"insertEdge"),ir=s.__name(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),nr=s.__name((e,t,a,i)=>{const n=ir(e),c=2,r=t.height+2*a.padding,l=r/c,o=i??t.width+2*l+a.padding,d=a.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:l,y:0},{x:o/2,y:2*d},{x:o-l,y:0},{x:o,y:0},{x:o,y:-r/3},{x:o+2*d,y:-r/2},{x:o,y:-2*r/3},{x:o,y:-r},{x:o-l,y:-r},{x:o/2,y:-r-2*d},{x:l,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*d,y:-r/2},{x:0,y:-r/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:l,y:0},{x:o-l,y:0},{x:o,y:-r/2},{x:o-l,y:-r},{x:l,y:-r},{x:0,y:-r/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:l,y:-r},{x:o-l,y:-r},{x:o,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:o,y:-l},{x:o,y:-r+l},{x:0,y:-r}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:o,y:0},{x:0,y:-l},{x:0,y:-r+l},{x:o,y:-r}]:n.has("right")&&n.has("left")?[{x:l,y:0},{x:l,y:-d},{x:o-l,y:-d},{x:o-l,y:0},{x:o,y:-r/2},{x:o-l,y:-r},{x:o-l,y:-r+d},{x:l,y:-r+d},{x:l,y:-r},{x:0,y:-r/2}]:n.has("up")&&n.has("down")?[{x:o/2,y:0},{x:0,y:-d},{x:l,y:-d},{x:l,y:-r+d},{x:0,y:-r+d},{x:o/2,y:-r},{x:o,y:-r+d},{x:o-l,y:-r+d},{x:o-l,y:-d},{x:o,y:-d}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:o,y:-l},{x:0,y:-r}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-r}]:n.has("left")&&n.has("up")?[{x:o,y:0},{x:0,y:-l},{x:o,y:-r}]:n.has("left")&&n.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-r}]:n.has("right")?[{x:l,y:-d},{x:l,y:-d},{x:o-l,y:-d},{x:o-l,y:0},{x:o,y:-r/2},{x:o-l,y:-r},{x:o-l,y:-r+d},{x:l,y:-r+d},{x:l,y:-r+d}]:n.has("left")?[{x:l,y:0},{x:l,y:-d},{x:o-l,y:-d},{x:o-l,y:-r+d},{x:l,y:-r+d},{x:l,y:-r},{x:0,y:-r/2}]:n.has("up")?[{x:l,y:-d},{x:l,y:-r+d},{x:0,y:-r+d},{x:o/2,y:-r},{x:o,y:-r+d},{x:o-l,y:-r+d},{x:o-l,y:-d}]:n.has("down")?[{x:o/2,y:0},{x:0,y:-d},{x:l,y:-d},{x:l,y:-r+d},{x:o-l,y:-r+d},{x:o-l,y:-d},{x:o,y:-d}]:[{x:0,y:0}]},"getArrowPoints");function Xt(e,t){return e.intersect(t)}s.__name(Xt,"intersectNode");var lr=Xt;function Vt(e,t,a,i){var n=e.x,c=e.y,r=n-i.x,l=c-i.y,o=Math.sqrt(t*t*l*l+a*a*r*r),d=Math.abs(t*a*r/o);i.x<n&&(d=-d);var u=Math.abs(t*a*l/o);return i.y<c&&(u=-u),{x:n+d,y:c+u}}s.__name(Vt,"intersectEllipse");var jt=Vt;function qt(e,t,a){return jt(e,t,t,a)}s.__name(qt,"intersectCircle");var cr=qt;function Zt(e,t,a,i){var n,c,r,l,o,d,u,y,_,m,b,v,L,N,C;if(n=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,_=n*a.x+r*a.y+o,m=n*i.x+r*i.y+o,!(_!==0&&m!==0&&yt(_,m))&&(c=i.y-a.y,l=a.x-i.x,d=i.x*a.y-a.x*i.y,u=c*e.x+l*e.y+d,y=c*t.x+l*t.y+d,!(u!==0&&y!==0&&yt(u,y))&&(b=n*l-c*r,b!==0)))return v=Math.abs(b/2),L=r*d-l*o,N=L<0?(L-v)/b:(L+v)/b,L=c*o-n*d,C=L<0?(L-v)/b:(L+v)/b,{x:N,y:C}}s.__name(Zt,"intersectLine");function yt(e,t){return e*t>0}s.__name(yt,"sameSign");var or=Zt,hr=Gt;function Gt(e,t,a){var i=e.x,n=e.y,c=[],r=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(b){r=Math.min(r,b.x),l=Math.min(l,b.y)}):(r=Math.min(r,t.x),l=Math.min(l,t.y));for(var o=i-e.width/2-r,d=n-e.height/2-l,u=0;u<t.length;u++){var y=t[u],_=t[u<t.length-1?u+1:0],m=or(e,a,{x:o+y.x,y:d+y.y},{x:o+_.x,y:d+_.y});m&&c.push(m)}return c.length?(c.length>1&&c.sort(function(b,v){var L=b.x-a.x,N=b.y-a.y,C=Math.sqrt(L*L+N*N),D=v.x-a.x,x=v.y-a.y,f=Math.sqrt(D*D+x*x);return C<f?-1:C===f?0:1}),c[0]):e}s.__name(Gt,"intersectPolygon");var gr=s.__name((e,t)=>{var a=e.x,i=e.y,n=t.x-a,c=t.y-i,r=e.width/2,l=e.height/2,o,d;return Math.abs(c)*r>Math.abs(n)*l?(c<0&&(l=-l),o=c===0?0:l*n/c,d=l):(n<0&&(r=-r),o=r,d=n===0?0:r*c/n),{x:a+o,y:i+d}},"intersectRect"),ur=gr,B={node:lr,circle:cr,ellipse:jt,polygon:hr,rect:ur},A=s.__name(async(e,t,a,i)=>{const n=s.getConfig2();let c;const r=t.useHtmlLabels||s.getEffectiveHtmlLabels(n);a?c=a:c="node default";const l=e.insert("g").attr("class",c).attr("id",t.domId||t.id),o=l.insert("g").attr("class","label").attr("style",t.labelStyle);let d;t.labelText===void 0?d="":d=typeof t.labelText=="string"?t.labelText:t.labelText[0];let u;t.labelType==="markdown"?u=s.createText(o,s.sanitizeText(s.decodeEntities(d),n),{useHtmlLabels:r,width:t.width||n.flowchart.wrappingWidth,classes:"markdown-node-label"},n):u=await U(o,s.sanitizeText(s.decodeEntities(d),n),t.labelStyle,!1,i);let y=u.getBBox();const _=t.padding/2;if(s.getEffectiveHtmlLabels(n)){const m=u.children[0],b=s.select(u);await s.configureLabelImages(m,d),y=m.getBoundingClientRect(),b.attr("width",y.width),b.attr("height",y.height)}return r?o.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):o.attr("transform","translate(0, "+-y.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:l,bbox:y,halfPadding:_,label:o}},"labelHelper"),O=s.__name((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function V(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}s.__name(V,"insertPolygonShape");var dr=s.__name(async(e,t)=>{t.useHtmlLabels||s.getEffectiveHtmlLabels(s.getConfig2())||(t.centerLabel=!0);const{shapeSvg:i,bbox:n,halfPadding:c}=await A(e,t,"node "+t.classes,!0);s.log.info("Classes = ",t.classes);const r=i.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-n.width/2-c).attr("y",-n.height/2-c).attr("width",n.width+t.padding).attr("height",n.height+t.padding),O(t,r),t.intersect=function(l){return B.rect(t,l)},i},"note"),fr=dr,Nt=s.__name(e=>e?" "+e:"","formatClass"),Y=s.__name((e,t)=>`${t||"node default"}${Nt(e.classes)} ${Nt(e.class)}`,"getClassesFromNode"),It=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=n+c,l=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];s.log.info("Question main (Circle)");const o=V(a,r,r,l);return o.attr("style",t.style),O(t,o),t.intersect=function(d){return s.log.warn("Intersect called"),B.polygon(t,l,d)},a},"question"),pr=s.__name((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,n=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",n.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return B.circle(t,14,r)},a},"choice"),yr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=4,c=t.positioned?t.height:i.height+t.padding,r=c/n,l=t.positioned?t.width:i.width+2*r+t.padding,o=[{x:r,y:0},{x:l-r,y:0},{x:l,y:-c/2},{x:l-r,y:-c},{x:r,y:-c},{x:0,y:-c/2}],d=V(a,l,c,o);return d.attr("style",t.style),O(t,d),t.intersect=function(u){return B.polygon(t,o,u)},a},"hexagon"),xr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,void 0,!0),n=2,c=i.height+2*t.padding,r=c/n,l=i.width+2*r+t.padding,d=t.positioned&&(t.widthInColumns??1)>1&&t.width>l?t.width:l,u=nr(t.directions,i,t,d),y=V(a,d,c,u);return y.attr("style",t.style),O(t,y),t.intersect=function(_){return B.polygon(t,u,_)},a},"block_arrow"),mr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:-c/2,y:0},{x:n,y:0},{x:n,y:-c},{x:-c/2,y:-c},{x:0,y:-c/2}];return V(a,n,c,r).attr("style",t.style),t.width=n+c,t.height=c,t.intersect=function(o){return B.polygon(t,r,o)},a},"rect_left_inv_arrow"),_r=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:-2*c/6,y:0},{x:n-c/6,y:0},{x:n+2*c/6,y:-c},{x:c/6,y:-c}],l=V(a,n,c,r);return l.attr("style",t.style),O(t,l),t.intersect=function(o){return B.polygon(t,r,o)},a},"lean_right"),br=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:2*c/6,y:0},{x:n+c/6,y:0},{x:n-2*c/6,y:-c},{x:-c/6,y:-c}],l=V(a,n,c,r);return l.attr("style",t.style),O(t,l),t.intersect=function(o){return B.polygon(t,r,o)},a},"lean_left"),wr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:-2*c/6,y:0},{x:n+2*c/6,y:0},{x:n-c/6,y:-c},{x:c/6,y:-c}],l=V(a,n,c,r);return l.attr("style",t.style),O(t,l),t.intersect=function(o){return B.polygon(t,r,o)},a},"trapezoid"),Lr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:c/6,y:0},{x:n-c/6,y:0},{x:n+2*c/6,y:-c},{x:-2*c/6,y:-c}],l=V(a,n,c,r);return l.attr("style",t.style),O(t,l),t.intersect=function(o){return B.polygon(t,r,o)},a},"inv_trapezoid"),Sr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:0,y:0},{x:n+c/2,y:0},{x:n,y:-c/2},{x:n+c/2,y:-c},{x:0,y:-c}],l=V(a,n,c,r);return l.attr("style",t.style),O(t,l),t.intersect=function(o){return B.polygon(t,r,o)},a},"rect_right_inv_arrow"),vr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=n/2,r=c/(2.5+n/50),l=i.height+r+t.padding,o="M 0,"+r+" a "+c+","+r+" 0,0,0 "+n+" 0 a "+c+","+r+" 0,0,0 "+-n+" 0 l 0,"+l+" a "+c+","+r+" 0,0,0 "+n+" 0 l 0,"+-l,d=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-n/2+","+-(l/2+r)+")");return O(t,d),t.intersect=function(u){const y=B.rect(t,u),_=y.x-t.x;if(c!=0&&(Math.abs(_)<t.width/2||Math.abs(_)==t.width/2&&Math.abs(y.y-t.y)>t.height/2-r)){let m=r*r*(1-_*_/(c*c));m!=0&&(m=Math.sqrt(m)),m=r-m,u.y-t.y>0&&(m=-m),y.y+=m}return y},a},"cylinder"),Er=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:n}=await A(e,t,"node "+t.classes+" "+t.class,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,l=t.positioned?t.height:i.height+t.padding,o=t.positioned?-r/2:-i.width/2-n,d=t.positioned?-l/2:-i.height/2-n;if(c.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",d).attr("width",r).attr("height",l),t.props){const u=new Set(Object.keys(t.props));t.props.borders&&(nt(c,t.props.borders,r,l),u.delete("borders")),u.forEach(y=>{s.log.warn(`Unknown node property ${y}`)})}return O(t,c),t.intersect=function(u){return B.rect(t,u)},a},"rect"),kr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:n}=await A(e,t,"node "+t.classes,!0),c=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,l=t.positioned?t.height:i.height+t.padding,o=t.positioned?-r/2:-i.width/2-n,d=t.positioned?-l/2:-i.height/2-n;if(c.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",d).attr("width",r).attr("height",l),t.props){const u=new Set(Object.keys(t.props));t.props.borders&&(nt(c,t.props.borders,r,l),u.delete("borders")),u.forEach(y=>{s.log.warn(`Unknown node property ${y}`)})}return O(t,c),t.intersect=function(u){return B.rect(t,u)},a},"composite"),Tr=s.__name(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);s.log.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),n=0,c=0;if(i.attr("width",n).attr("height",c),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(nt(i,t.props.borders,n,c),r.delete("borders")),r.forEach(l=>{s.log.warn(`Unknown node property ${l}`)})}return O(t,i),t.intersect=function(r){return B.rect(t,r)},a},"labelRect");function nt(e,t,a,i){const n=[],c=s.__name(l=>{n.push(l,0)},"addBorder"),r=s.__name(l=>{n.push(0,l)},"skipBorder");t.includes("t")?(s.log.debug("add top border"),c(a)):r(a),t.includes("r")?(s.log.debug("add right border"),c(i)):r(i),t.includes("b")?(s.log.debug("add bottom border"),c(a)):r(a),t.includes("l")?(s.log.debug("add left border"),c(i)):r(i),e.attr("stroke-dasharray",n.join(" "))}s.__name(nt,"applyNodePropertyBorders");var Dr=s.__name(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),n=i.insert("rect",":first-child"),c=i.insert("line"),r=i.insert("g").attr("class","label"),l=t.labelText.flat?t.labelText.flat():t.labelText;let o="";typeof l=="object"?o=l[0]:o=l,s.log.info("Label text abc79",o,l,typeof l=="object");const d=await U(r,o,t.labelStyle,!0,!0);let u={width:0,height:0};if(s.getEffectiveHtmlLabels(s.getConfig2())){const v=d.children[0],L=s.select(d);u=v.getBoundingClientRect(),L.attr("width",u.width),L.attr("height",u.height)}s.log.info("Text 2",l);const y=l.slice(1,l.length);let _=d.getBBox();const m=await U(r,y.join?y.join("<br/>"):y,t.labelStyle,!0,!0);if(s.getEffectiveHtmlLabels(s.getConfig2())){const v=m.children[0],L=s.select(m);u=v.getBoundingClientRect(),L.attr("width",u.width),L.attr("height",u.height)}const b=t.padding/2;return s.select(m).attr("transform","translate( "+(u.width>_.width?0:(_.width-u.width)/2)+", "+(_.height+b+5)+")"),s.select(d).attr("transform","translate( "+(u.width<_.width?0:-(_.width-u.width)/2)+", 0)"),u=r.node().getBBox(),r.attr("transform","translate("+-u.width/2+", "+(-u.height/2-b+3)+")"),n.attr("class","outer title-state").attr("x",-u.width/2-b).attr("y",-u.height/2-b).attr("width",u.width+t.padding).attr("height",u.height+t.padding),c.attr("class","divider").attr("x1",-u.width/2-b).attr("x2",u.width/2+b).attr("y1",-u.height/2-b+_.height+b).attr("y2",-u.height/2-b+_.height+b),O(t,n),t.intersect=function(v){return B.rect(t,v)},i},"rectWithTitle"),Cr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.height+t.padding,c=i.width+n/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",n/2).attr("ry",n/2).attr("x",-c/2).attr("y",-n/2).attr("width",c).attr("height",n);return O(t,r),t.intersect=function(l){return B.rect(t,l)},a},"stadium"),Nr=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:n}=await A(e,t,Y(t,void 0),!0),c=a.insert("circle",":first-child");return c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+n).attr("width",i.width+t.padding).attr("height",i.height+t.padding),s.log.info("Circle main"),O(t,c),t.intersect=function(r){return s.log.info("Circle intersect",t,i.width/2+n,r),B.circle(t,i.width/2+n,r)},a},"circle"),Ir=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:n}=await A(e,t,Y(t,void 0),!0),c=5,r=a.insert("g",":first-child"),l=r.insert("circle"),o=r.insert("circle");return r.attr("class",t.class),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+n+c).attr("width",i.width+t.padding+c*2).attr("height",i.height+t.padding+c*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+n).attr("width",i.width+t.padding).attr("height",i.height+t.padding),s.log.info("DoubleCircle main"),O(t,l),t.intersect=function(d){return s.log.info("DoubleCircle intersect",t,i.width/2+n+c,d),B.circle(t,i.width/2+n+c,d)},a},"doublecircle"),Br=s.__name(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),n=i.width+t.padding,c=i.height+t.padding,r=[{x:0,y:0},{x:n,y:0},{x:n,y:-c},{x:0,y:-c},{x:0,y:0},{x:-8,y:0},{x:n+8,y:0},{x:n+8,y:-c},{x:-8,y:-c},{x:-8,y:0}],l=V(a,n,c,r);return l.attr("style",t.style),O(t,l),t.intersect=function(o){return B.polygon(t,r,o)},a},"subroutine"),Or=s.__name((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),O(t,i),t.intersect=function(n){return B.circle(t,7,n)},a},"start"),Bt=s.__name((e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let n=70,c=10;a==="LR"&&(n=10,c=70);const r=i.append("rect").attr("x",-1*n/2).attr("y",-1*c/2).attr("width",n).attr("height",c).attr("class","fork-join");return O(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(l){return B.rect(t,l)},i},"forkJoin"),Rr=s.__name((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),n=a.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),O(t,n),t.intersect=function(c){return B.circle(t,7,c)},a},"end"),Ar=s.__name(async(e,t)=>{var S;const a=t.padding/2,i=4,n=8;let c;t.classes?c="node "+t.classes:c="node default";const r=e.insert("g").attr("class",c).attr("id",t.domId||t.id),l=r.insert("rect",":first-child"),o=r.insert("line"),d=r.insert("line");let u=0,y=i;const _=r.insert("g").attr("class","label");let m=0;const b=(S=t.classData.annotations)==null?void 0:S[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",L=await U(_,v,t.labelStyle,!0,!0);let N=L.getBBox();if(s.getEffectiveHtmlLabels(s.getConfig2())){const h=L.children[0],E=s.select(L);N=h.getBoundingClientRect(),E.attr("width",N.width),E.attr("height",N.height)}t.classData.annotations[0]&&(y+=N.height+i,u+=N.width);let C=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(s.getEffectiveHtmlLabels(s.getConfig2())?C+="<"+t.classData.type+">":C+="<"+t.classData.type+">");const D=await U(_,C,t.labelStyle,!0,!0);s.select(D).attr("class","classTitle");let x=D.getBBox();if(s.getEffectiveHtmlLabels(s.getConfig2())){const h=D.children[0],E=s.select(D);x=h.getBoundingClientRect(),E.attr("width",x.width),E.attr("height",x.height)}y+=x.height+i,x.width>u&&(u=x.width);const f=[];t.classData.members.forEach(async h=>{const E=h.getDisplayDetails();let g=E.displayText;s.getEffectiveHtmlLabels(s.getConfig2())&&(g=g.replace(/</g,"<").replace(/>/g,">"));const k=await U(_,g,E.cssStyle?E.cssStyle:t.labelStyle,!0,!0);let T=k.getBBox();if(s.getEffectiveHtmlLabels(s.getConfig2())){const H=k.children[0],z=s.select(k);T=H.getBoundingClientRect(),z.attr("width",T.width),z.attr("height",T.height)}T.width>u&&(u=T.width),y+=T.height+i,f.push(k)}),y+=n;const p=[];if(t.classData.methods.forEach(async h=>{const E=h.getDisplayDetails();let g=E.displayText;s.getEffectiveHtmlLabels(s.getConfig2())&&(g=g.replace(/</g,"<").replace(/>/g,">"));const k=await U(_,g,E.cssStyle?E.cssStyle:t.labelStyle,!0,!0);let T=k.getBBox();if(s.getEffectiveHtmlLabels(s.getConfig2())){const H=k.children[0],z=s.select(k);T=H.getBoundingClientRect(),z.attr("width",T.width),z.attr("height",T.height)}T.width>u&&(u=T.width),y+=T.height+i,p.push(k)}),y+=n,b){let h=(u-N.width)/2;s.select(L).attr("transform","translate( "+(-1*u/2+h)+", "+-1*y/2+")"),m=N.height+i}let w=(u-x.width)/2;return s.select(D).attr("transform","translate( "+(-1*u/2+w)+", "+(-1*y/2+m)+")"),m+=x.height+i,o.attr("class","divider").attr("x1",-u/2-a).attr("x2",u/2+a).attr("y1",-y/2-a+n+m).attr("y2",-y/2-a+n+m),m+=n,f.forEach(h=>{s.select(h).attr("transform","translate( "+-u/2+", "+(-1*y/2+m+n/2)+")");const E=h==null?void 0:h.getBBox();m+=((E==null?void 0:E.height)??0)+i}),m+=n,d.attr("class","divider").attr("x1",-u/2-a).attr("x2",u/2+a).attr("y1",-y/2-a+n+m).attr("y2",-y/2-a+n+m),m+=n,p.forEach(h=>{s.select(h).attr("transform","translate( "+-u/2+", "+(-1*y/2+m)+")");const E=h==null?void 0:h.getBBox();m+=((E==null?void 0:E.height)??0)+i}),l.attr("style",t.style).attr("class","outer title-state").attr("x",-u/2-a).attr("y",-(y/2)-a).attr("width",u+t.padding).attr("height",y+t.padding),O(t,l),t.intersect=function(h){return B.rect(t,h)},r},"class_box"),Ot={rhombus:It,composite:kr,question:It,rect:Er,labelRect:Tr,rectWithTitle:Dr,choice:pr,circle:Nr,doublecircle:Ir,stadium:Cr,hexagon:yr,block_arrow:xr,rect_left_inv_arrow:mr,lean_right:_r,lean_left:br,trapezoid:wr,inv_trapezoid:Lr,rect_right_inv_arrow:Sr,cylinder:vr,start:Or,end:Rr,note:fr,subroutine:Br,fork:Bt,join:Bt,class_box:Ar},at={},Jt=s.__name(async(e,t,a)=>{let i,n;if(t.link){let c;s.getConfig2().securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c),n=await Ot[t.shape](i,t,a)}else n=await Ot[t.shape](e,t,a),i=n;return t.tooltip&&n.attr("title",t.tooltip),t.class&&n.attr("class","node default "+t.class),at[t.id]=i,t.haveCallback&&at[t.id].attr("class",at[t.id].attr("class")+" clickable"),i},"insertNode"),zr=s.__name(e=>{const t=at[e.id];s.log.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Lt(e,t,a=!1){var m,b,v;const i=e;let n="default";(((m=i==null?void 0:i.classes)==null?void 0:m.length)||0)>0&&(n=((i==null?void 0:i.classes)??[]).join(" ")),n=n+" flowchart-label";let c=0,r="",l;switch(i.type){case"round":c=5,r="rect";break;case"composite":c=0,r="composite",l=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const o=s.getStylesFromArray((i==null?void 0:i.styles)??[]),d=i.label,u=i.size??{width:0,height:0,x:0,y:0},y=t.getDiagramId();return{labelStyle:o.labelStyle,shape:r,labelText:d,rx:c,ry:c,class:n,style:o.style,id:i.id,domId:y?`${y}-${i.id}`:i.id,directions:i.directions,width:u.width,height:u.height,x:u.x,y:u.y,positioned:a,intersect:void 0,type:i.type,padding:l??((v=(b=s.getConfig())==null?void 0:b.block)==null?void 0:v.padding)??0,widthInColumns:i.widthInColumns??1}}s.__name(Lt,"getNodeFromBlock");async function Qt(e,t,a){const i=Lt(t,a,!1);if(i.type==="group")return;const n=s.getConfig(),c=await Jt(e,i,{config:n}),r=c.node().getBBox(),l=a.getBlock(i.id);l.size={width:r.width,height:r.height,x:0,y:0,node:c},a.setBlock(l),c.remove()}s.__name(Qt,"calculateBlockSize");async function $t(e,t,a){const i=Lt(t,a,!0);if(a.getBlock(i.id).type!=="space"){const c=s.getConfig();await Jt(e,i,{config:c}),t.intersect=i==null?void 0:i.intersect,zr(i)}}s.__name($t,"insertBlockPositioned");async function lt(e,t,a,i){for(const n of t)await i(e,n,a),n.children&&await lt(e,n.children,a,i)}s.__name(lt,"performOperations");async function te(e,t,a){await lt(e,t,a,Qt)}s.__name(te,"calculateBlockSizes");async function ee(e,t,a){await lt(e,t,a,$t)}s.__name(ee,"insertBlocks");async function re(e,t,a,i,n){const c=new ne.Graph({multigraph:!0,compound:!0});c.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&c.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const l=i.getBlock(r.start),o=i.getBlock(r.end);if(l!=null&&l.size&&(o!=null&&o.size)){const d=l.size,u=o.size,y=[{x:d.x,y:d.y},{x:d.x+(u.x-d.x)/2,y:d.y+(u.y-d.y)/2},{x:u.x,y:u.y}],_=n?`${n}-${r.id}`:r.id,m=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",b=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",v=`${m} ${b} flowchart-link LS-a1 LE-b1`;sr(e,{v:r.start,w:r.end,name:_},{...r,id:_,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:y,classes:v},void 0,"block",c,n),r.label&&(await tr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:y,classes:v}),er({...r,x:y[1].x,y:y[1].y},{originalPath:y}))}}}s.__name(re,"insertEdges");var Mr=s.__name(function(e,t){return t.db.getClasses()},"getClasses"),Pr=s.__name(async function(e,t,a,i){const{securityLevel:n,block:c}=s.getConfig(),r=i.db;r.setDiagramId(t);let l;n==="sandbox"&&(l=s.select("#i"+t));const o=n==="sandbox"?s.select(l.nodes()[0].contentDocument.body):s.select("body"),d=n==="sandbox"?o.select(`[id="${t}"]`):s.select(`[id="${t}"]`);Ze(d,["point","circle","cross"],i.type,t);const y=r.getBlocks(),_=r.getBlocksFlat(),m=r.getEdges(),b=d.insert("g").attr("class","block");await te(b,y,r);const v=Ut(r);if(await ee(b,y,r),await re(b,m,_,r,t),v){const L=v,N=Math.max(1,Math.round(.125*(L.width/L.height))),C=L.height+N+10,D=L.width+10,{useMaxWidth:x}=c;s.configureSvgSize(d,C,D,!!x),s.log.debug("Here Bounds",v,L),d.attr("viewBox",`${L.x-5} ${L.y-5} ${L.width+10} ${L.height+10}`)}},"draw"),Fr={draw:Pr,getClasses:Mr},Hr={parser:fe,db:Ae,renderer:Fr,styles:Me};exports.diagram=Hr;
|