crewx 0.8.7-rc.2 → 0.8.7-rc.21
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/assets/MarketPage-aY16UW1_.js +51 -0
- package/dist/assets/{PromptTab-DPxKgALd.js → PromptTab-C3aTJS6u.js} +7 -7
- package/dist/assets/_baseUniq-DxEFlwNt.js +1 -0
- package/dist/assets/{arc-Wd7DG8CX.js → arc-BCQAokB1.js} +1 -1
- package/dist/assets/architectureDiagram-UYN6MBPD-Bc87ujv2.js +36 -0
- package/dist/assets/blockDiagram-ZHA2E4KO-wC9uH8Lb.js +121 -0
- package/dist/assets/{c4Diagram-6F5ED5ID-CcfPHYky.js → c4Diagram-6F5ED5ID-CqB7lqni.js} +1 -1
- package/dist/assets/channel-DNLHkiNp.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-TGnRph8o.js → chunk-5HRBRIJM-Cc1L17Eh.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-D24Jb5U0.js → chunk-7U56Z5CX-Df3nu_7G.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-zBk7x36Z.js → chunk-ASOPGD6M-DIXslLG-.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-U1tpWuJd.js → chunk-KFBOBJHC-FytVljyP.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-P78s0i18.js → chunk-T2TOU4HS-CU5z-cXq.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-_9HBqU-T.js → chunk-TMUBEWPD-CWo1AFyn.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-B430Onym.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-B430Onym.js +1 -0
- package/dist/assets/clone-B9O3E3P1.js +1 -0
- package/dist/assets/dagre-4EVJKHTY-CgZW5tg4.js +4 -0
- package/dist/assets/diagram-QW4FP2JN-CJAng8RC.js +24 -0
- package/dist/assets/{erDiagram-6RL3IURR-CR3kiDSu.js → erDiagram-6RL3IURR-C1uHztHX.js} +2 -2
- package/dist/assets/{flowDiagram-7ASYPVHJ-B0gVEfBk.js → flowDiagram-7ASYPVHJ-Yiu2odO-.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-CIEk1X3_.js → ganttDiagram-NTVNEXSI-tutc0dJP.js} +3 -3
- package/dist/assets/gitGraph-YCYPL57B-C3jM6T4G.js +133 -0
- package/dist/assets/gitGraphDiagram-NRZ2UAAF-0aqHEKzz.js +65 -0
- package/dist/assets/graph-DC224ILV.js +1 -0
- package/dist/assets/infoDiagram-A4XQUW5V-Do7Mpzkx.js +2 -0
- package/dist/assets/{journeyDiagram-G5WM74LC-U9w5k3my.js → journeyDiagram-G5WM74LC-DAruEJc7.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-CO8Lwd1_.js → kanban-definition-QRCXZQQD-DB63vLR0.js} +1 -1
- package/dist/assets/layout-BiYH5x6Q.js +1 -0
- package/dist/assets/{linear-CHGWcXFV.js → linear-CLyGW2s0.js} +1 -1
- package/dist/assets/main-CEKkUqZb.js +1094 -0
- package/dist/assets/main-D3YeRndF.css +10 -0
- package/dist/assets/min-ChJMFU2N.js +1 -0
- package/dist/assets/{mindmap-definition-GWI6TPTV-FRHfidFi.js → mindmap-definition-GWI6TPTV-CtADqQgd.js} +1 -1
- package/dist/assets/pieDiagram-YF2LJOPJ-BSOfzo3O.js +30 -0
- package/dist/assets/{quadrantDiagram-OS5C2QUG-N0MJL1hU.js → quadrantDiagram-OS5C2QUG-BLBQNFVb.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-n0yYIEdg.js → requirementDiagram-MIRIMTAZ-DqorvuS6.js} +2 -2
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-DzRt1UUn.js → sankeyDiagram-Y46BX6SQ-4NDcrLkB.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-Bw73EL9L.js → sequenceDiagram-G6AWOVSC-yha6BxK2.js} +1 -1
- package/dist/assets/stateDiagram-MAYHULR4-XJ_I41ez.js +1 -0
- package/dist/assets/stateDiagram-v2-4JROLMXI-CxcyPJO2.js +1 -0
- package/dist/assets/{timeline-definition-U7ZMHBDA-BEgtmEeC.js → timeline-definition-U7ZMHBDA-DCNrmvE7.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-bWuCFYmh.js → xychartDiagram-6QU3TZC5-9N-Ohhdp.js} +2 -2
- package/dist/index.html +2 -2
- package/dist-server/app.module.js +6 -0
- package/dist-server/common/analytics.client.js +180 -0
- package/dist-server/common/analytics.module.js +21 -0
- package/dist-server/common/device-id.js +33 -0
- package/dist-server/domain/cli/cli.service.js +66 -4
- package/dist-server/domain/document/document.service.js +6 -3
- package/dist-server/domain/goal/dto/goal.dto.js +49 -0
- package/dist-server/domain/goal/goal.controller.js +86 -0
- package/dist-server/domain/goal/goal.module.js +22 -0
- package/dist-server/domain/goal/goal.service.js +197 -0
- package/dist-server/domain/goal/parser/goal-md-parser.js +166 -0
- package/dist-server/domain/goal/parser/goal-md-serializer.js +110 -0
- package/dist-server/domain/market/market.controller.js +25 -1
- package/dist-server/domain/market/market.service.js +414 -18
- package/dist-server/domain/planner/dto/planner.dto.js +7 -44
- package/dist-server/domain/planner/planner.controller.js +2 -2
- package/dist-server/domain/planner/planner.service.js +24 -0
- package/dist-server/domain/settings/settings.controller.js +52 -0
- package/dist-server/domain/settings/settings.module.js +22 -0
- package/dist-server/domain/settings/settings.service.js +105 -0
- package/dist-server/domain/task/task.service.js +20 -0
- package/dist-server/domain/thread/thread.controller.js +28 -0
- package/dist-server/domain/thread/thread.service.js +20 -0
- package/dist-server/main.js +1 -0
- package/dist-server/repository/task.repository.js +4 -0
- package/dist-server/repository/thread.repository.js +22 -0
- package/package.json +13 -8
- package/packages/cli/dist/builtin.js +1 -0
- package/packages/cli/dist/commands/init.js +251 -8
- package/packages/cli/package.json +2 -1
- package/server.js +6 -3
- package/dist/assets/MarketPage-CjJYSssq.js +0 -56
- package/dist/assets/architectureDiagram-UYN6MBPD-CMavUkL9.js +0 -36
- package/dist/assets/blockDiagram-ZHA2E4KO-D1rNF19s.js +0 -121
- package/dist/assets/channel-CyMi7jVG.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-DVWuJ-Df.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-DVWuJ-Df.js +0 -1
- package/dist/assets/dagre-4EVJKHTY-CcSwRLTq.js +0 -4
- package/dist/assets/diagram-QW4FP2JN-N887K_Ef.js +0 -24
- package/dist/assets/gitGraph-YCYPL57B-Zl60oDrh.js +0 -133
- package/dist/assets/gitGraphDiagram-NRZ2UAAF-CmIpkGbx.js +0 -65
- package/dist/assets/graph-BlwPajkw.js +0 -1
- package/dist/assets/infoDiagram-A4XQUW5V-D3UxyUCV.js +0 -2
- package/dist/assets/layout-Bvwu4dCi.js +0 -1
- package/dist/assets/main-Dnmo7KzM.js +0 -1064
- package/dist/assets/main-Fz5tpoGZ.css +0 -10
- package/dist/assets/pieDiagram-YF2LJOPJ-Eo_N9Dkd.js +0 -30
- package/dist/assets/stateDiagram-MAYHULR4-hqIdsHFt.js +0 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-BoqygJ0s.js +0 -1
- /package/dist/assets/{gemini-logo.svg → google-logo.svg} +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import{bq as Ce,br as Ie,bs as Be,bt as $t,bu as Jt,bv as At,bw as Ae,bx as Oe,by as Qt,bz as _t,bA as te,bB as ht,bC as Re,bD as ze,bE as Me,bF as je,bG as Fe,bH as Pe,bI as We,_ as g,E as st,d as R,e as Ye,l as S,v as Ke,A as He,bJ as Ue,K as Xe,Q as Ve,c as z,bK as q,ax as ee,aq as Ge,u as et,k as Ze,bL as qe,bM as wt,bN as $e,i as Ot}from"./main-Dnmo7KzM.js";import{G as Je}from"./graph-BlwPajkw.js";import{c as Qe}from"./channel-CyMi7jVG.js";function tr(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}function re(e){return Ce(e)?Ie(e):Be(e)}function er(e,t){return e&&$t(t,re(t),e)}function rr(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}function ar(){return[]}var sr=Object.prototype,ir=sr.propertyIsEnumerable,Rt=Object.getOwnPropertySymbols,ae=Rt?function(e){return e==null?[]:(e=Object(e),rr(Rt(e),function(t){return ir.call(e,t)}))}:ar;function nr(e,t){return $t(e,ae(e),t)}function lr(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function cr(e,t,r){var n=t(e);return Jt(e)?n:lr(n,r(e))}function or(e){return cr(e,re,ae)}var hr=Object.prototype,gr=hr.hasOwnProperty;function ur(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&gr.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function dr(e,t){var r=e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var pr=/\w*$/;function fr(e){var t=new e.constructor(e.source,pr.exec(e));return t.lastIndex=e.lastIndex,t}var zt=At?At.prototype:void 0,Mt=zt?zt.valueOf:void 0;function yr(e){return Mt?Object(Mt.call(e)):{}}var xr="[object Boolean]",br="[object Date]",wr="[object Map]",mr="[object Number]",Lr="[object RegExp]",Sr="[object Set]",vr="[object String]",Er="[object Symbol]",_r="[object ArrayBuffer]",kr="[object DataView]",Tr="[object Float32Array]",Dr="[object Float64Array]",Nr="[object Int8Array]",Cr="[object Int16Array]",Ir="[object Int32Array]",Br="[object Uint8Array]",Ar="[object Uint8ClampedArray]",Or="[object Uint16Array]",Rr="[object Uint32Array]";function zr(e,t,r){var n=e.constructor;switch(t){case _r:return Oe(e);case xr:case br:return new n(+e);case kr:return dr(e);case Tr:case Dr:case Nr:case Cr:case Ir:case Br:case Ar:case Or:case Rr:return Ae(e,r);case wr:return new n;case mr:case vr:return new n(e);case Lr:return fr(e);case Sr:return new n;case Er:return yr(e)}}var Mr="[object Map]";function jr(e){return Qt(e)&&_t(e)==Mr}var jt=ht&&ht.isMap,Fr=jt?te(jt):jr,Pr="[object Set]";function Wr(e){return Qt(e)&&_t(e)==Pr}var Ft=ht&&ht.isSet,Yr=Ft?te(Ft):Wr,Kr=1,se="[object Arguments]",Hr="[object Array]",Ur="[object Boolean]",Xr="[object Date]",Vr="[object Error]",ie="[object Function]",Gr="[object GeneratorFunction]",Zr="[object Map]",qr="[object Number]",ne="[object Object]",$r="[object RegExp]",Jr="[object Set]",Qr="[object String]",ta="[object Symbol]",ea="[object WeakMap]",ra="[object ArrayBuffer]",aa="[object DataView]",sa="[object Float32Array]",ia="[object Float64Array]",na="[object Int8Array]",la="[object Int16Array]",ca="[object Int32Array]",oa="[object Uint8Array]",ha="[object Uint8ClampedArray]",ga="[object Uint16Array]",ua="[object Uint32Array]",C={};C[se]=C[Hr]=C[ra]=C[aa]=C[Ur]=C[Xr]=C[sa]=C[ia]=C[na]=C[la]=C[ca]=C[Zr]=C[qr]=C[ne]=C[$r]=C[Jr]=C[Qr]=C[ta]=C[oa]=C[ha]=C[ga]=C[ua]=!0;C[Vr]=C[ie]=C[ea]=!1;function ct(e,t,r,n,i,s){var a,l=t&Kr;if(a!==void 0)return a;if(!Re(e))return e;var c=Jt(e);if(c)return a=ur(e),ze(e,a);var f=_t(e),h=f==ie||f==Gr;if(Me(e))return je(e,l);if(f==ne||f==se||h&&!i)return a=h?{}:Fe(e),nr(e,er(a,e));if(!C[f])return i?e:{};a=zr(e,f,l),s||(s=new Pe);var x=s.get(e);if(x)return x;s.set(e,a),Yr(e)?e.forEach(function(L){a.add(ct(L,t,r,L,e,s))}):Fr(e)&&e.forEach(function(L,T){a.set(T,ct(L,t,r,T,e,s))});var b=or,m=c?void 0:b(e);return tr(m||e,function(L,T){m&&(T=L,L=e[T]),We(a,T,ct(L,t,r,T,e,s))}),a}var da=4;function pa(e){return ct(e,da)}var mt=function(){var e=g(function(D,y,u,d){for(u=u||{},d=D.length;d--;u[D[d]]=y);return u},"o"),t=[1,7],r=[1,13],n=[1,14],i=[1,15],s=[1,19],a=[1,16],l=[1,17],c=[1,18],f=[8,30],h=[8,21,28,29,30,31,32,40,44,47],x=[1,23],b=[1,24],m=[8,15,16,21,28,29,30,31,32,40,44,47],L=[8,15,16,21,27,28,29,30,31,32,40,44,47],T=[1,49],E={trace:g(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,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList: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:49,$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:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"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],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(y,u,d,w,v,o,_){var p=o.length-1;switch(v){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: ",o[p-1]),w.setHierarchy(o[p-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: ",o[p]),typeof o[p].length=="number"?this.$=o[p]:this.$=[o[p]];break;case 13:w.getLogger().debug("Rule: statement #2: ",o[p-1]),this.$=[o[p-1]].concat(o[p]);break;case 14:w.getLogger().debug("Rule: link: ",o[p],y),this.$={edgeTypeStr:o[p],label:""};break;case 15:w.getLogger().debug("Rule: LABEL link: ",o[p-3],o[p-1],o[p]),this.$={edgeTypeStr:o[p],label:o[p-1]};break;case 18:const M=parseInt(o[p]),O=w.generateId();this.$={id:O,type:"space",label:"",width:M,children:[]};break;case 23:w.getLogger().debug("Rule: (nodeStatement link node) ",o[p-2],o[p-1],o[p]," typestr: ",o[p-1].edgeTypeStr);const U=w.edgeStrToEdgeData(o[p-1].edgeTypeStr);this.$=[{id:o[p-2].id,label:o[p-2].label,type:o[p-2].type,directions:o[p-2].directions},{id:o[p-2].id+"-"+o[p].id,start:o[p-2].id,end:o[p].id,label:o[p-1].label,type:"edge",directions:o[p].directions,arrowTypeEnd:U,arrowTypeStart:"arrow_open"},{id:o[p].id,label:o[p].label,type:w.typeStr2Type(o[p].typeStr),directions:o[p].directions}];break;case 24:w.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[p-1],o[p]),this.$={id:o[p-1].id,label:o[p-1].label,type:w.typeStr2Type(o[p-1].typeStr),directions:o[p-1].directions,widthInColumns:parseInt(o[p],10)};break;case 25:w.getLogger().debug("Rule: nodeStatement (node) ",o[p]),this.$={id:o[p].id,label:o[p].label,type:w.typeStr2Type(o[p].typeStr),directions:o[p].directions,widthInColumns:1};break;case 26:w.getLogger().debug("APA123",this?this:"na"),w.getLogger().debug("COLUMNS: ",o[p]),this.$={type:"column-setting",columns:o[p]==="auto"?-1:parseInt(o[p])};break;case 27:w.getLogger().debug("Rule: id-block statement : ",o[p-2],o[p-1]),w.generateId(),this.$={...o[p-2],type:"composite",children:o[p-1]};break;case 28:w.getLogger().debug("Rule: blockStatement : ",o[p-2],o[p-1],o[p]);const P=w.generateId();this.$={id:P,type:"composite",label:"",children:o[p-1]};break;case 29:w.getLogger().debug("Rule: node (NODE_ID separator): ",o[p]),this.$={id:o[p]};break;case 30:w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[p-1],o[p]),this.$={id:o[p-1],label:o[p].label,typeStr:o[p].typeStr,directions:o[p].directions};break;case 31:w.getLogger().debug("Rule: dirList: ",o[p]),this.$=[o[p]];break;case 32:w.getLogger().debug("Rule: dirList: ",o[p-1],o[p]),this.$=[o[p-1]].concat(o[p]);break;case 33:w.getLogger().debug("Rule: nodeShapeNLabel: ",o[p-2],o[p-1],o[p]),this.$={typeStr:o[p-2]+o[p],label:o[p-1]};break;case 34:w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[p-3],o[p-2]," #3:",o[p-1],o[p]),this.$={typeStr:o[p-3]+o[p],label:o[p-2],directions:o[p-1]};break;case 35:case 36:this.$={type:"classDef",id:o[p-1].trim(),css:o[p].trim()};break;case 37:this.$={type:"applyClass",id:o[p-1].trim(),styleClass:o[p].trim()};break;case 38:this.$={type:"applyStyles",id:o[p-1].trim(),stylesStr:o[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:s,40:a,44:l,47:c},{8:[1,20]},e(f,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:t,28:r,29:n,31:i,32:s,40:a,44:l,47:c}),e(h,[2,16],{14:22,15:x,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(m,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,32:s},{11:27,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:s,40:a,44:l,47:c},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(L,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(f,[2,13]),{26:35,32:s},{32:[2,14]},{17:[1,36]},e(m,[2,24]),{11:37,13:4,14:22,15:x,16:b,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:r,29:n,31:i,32:s,40:a,44:l,47:c},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(L,[2,30]),{18:[1,43]},{18:[1,44]},e(m,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{37:[1,47]},{34:48,35:T},{15:[1,50]},e(h,[2,27]),e(L,[2,33]),{39:[1,51]},{34:52,35:T,39:[2,31]},{32:[2,15]},e(L,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(y,u){if(u.recoverable)this.trace(y);else{var d=new Error(y);throw d.hash=u,d}},"parseError"),parse:g(function(y){var u=this,d=[0],w=[],v=[null],o=[],_=this.table,p="",M=0,O=0,U=2,P=1,Te=o.slice.call(arguments,1),j=Object.create(this.lexer),J={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&(J.yy[ft]=this.yy[ft]);j.setInput(y,J.yy),J.yy.lexer=j,J.yy.parser=this,typeof j.yylloc>"u"&&(j.yylloc={});var yt=j.yylloc;o.push(yt);var De=j.options&&j.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ne(K){d.length=d.length-2*K,v.length=v.length-K,o.length=o.length-K}g(Ne,"popStack");function It(){var K;return K=w.pop()||j.lex()||P,typeof K!="number"&&(K instanceof Array&&(w=K,K=w.pop()),K=u.symbols_[K]||K),K}g(It,"lex");for(var Y,Q,X,xt,tt={},it,$,Bt,nt;;){if(Q=d[d.length-1],this.defaultActions[Q]?X=this.defaultActions[Q]:((Y===null||typeof Y>"u")&&(Y=It()),X=_[Q]&&_[Q][Y]),typeof X>"u"||!X.length||!X[0]){var bt="";nt=[];for(it in _[Q])this.terminals_[it]&&it>U&&nt.push("'"+this.terminals_[it]+"'");j.showPosition?bt="Parse error on line "+(M+1)+`:
|
|
2
|
-
`+j.showPosition()+`
|
|
3
|
-
Expecting `+nt.join(", ")+", got '"+(this.terminals_[Y]||Y)+"'":bt="Parse error on line "+(M+1)+": Unexpected "+(Y==P?"end of input":"'"+(this.terminals_[Y]||Y)+"'"),this.parseError(bt,{text:j.match,token:this.terminals_[Y]||Y,line:j.yylineno,loc:yt,expected:nt})}if(X[0]instanceof Array&&X.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+Y);switch(X[0]){case 1:d.push(Y),v.push(j.yytext),o.push(j.yylloc),d.push(X[1]),Y=null,O=j.yyleng,p=j.yytext,M=j.yylineno,yt=j.yylloc;break;case 2:if($=this.productions_[X[1]][1],tt.$=v[v.length-$],tt._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},De&&(tt._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),xt=this.performAction.apply(tt,[p,O,M,J.yy,X[1],v,o].concat(Te)),typeof xt<"u")return xt;$&&(d=d.slice(0,-1*$*2),v=v.slice(0,-1*$),o=o.slice(0,-1*$)),d.push(this.productions_[X[1]][0]),v.push(tt.$),o.push(tt._$),Bt=_[d[d.length-2]][d[d.length-1]],d.push(Bt);break;case 3:return!0}}return!0},"parse")},N=function(){var D={EOF:1,parseError:g(function(u,d){if(this.yy.parser)this.yy.parser.parseError(u,d);else throw new Error(u)},"parseError"),setInput:g(function(y,u){return this.yy=u||this.yy||{},this._input=y,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:g(function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var u=y.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},"input"),unput:g(function(y){var u=y.length,d=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;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),d.length-1&&(this.yylineno-=d.length-1);var v=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:d?(d.length===w.length?this.yylloc.first_column:0)+w[w.length-d.length].length-d[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(y){this.unput(this.match.slice(y))},"less"),pastInput:g(function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var y=this.pastInput(),u=new Array(y.length+1).join("-");return y+this.upcomingInput()+`
|
|
5
|
-
`+u+"^"},"showPosition"),test_match:g(function(y,u){var d,w,v;if(this.options.backtrack_lexer&&(v={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&&(v.yylloc.range=this.yylloc.range.slice(0))),w=y[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+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,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(y[0].length),this.matched+=y[0],d=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var o in v)this[o]=v[o];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,u,d,w;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),o=0;o<v.length;o++)if(d=this._input.match(this.rules[v[o]]),d&&(!u||d[0].length>u[0].length)){if(u=d,w=o,this.options.backtrack_lexer){if(y=this.test_match(d,v[o]),y!==!1)return y;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(y=this.test_match(u,v[w]),y!==!1?y:!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:g(function(){var u=this.next();return u||this.lex()},"lex"),begin:g(function(u){this.conditionStack.push(u)},"begin"),popState:g(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:g(function(u){this.begin(u)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(u,d,w,v){switch(w){case 0:return 10;case 1:return u.getLogger().debug("Found space-block"),31;case 2:return u.getLogger().debug("Found nl-block"),31;case 3:return u.getLogger().debug("Found space-block"),29;case 4:u.getLogger().debug(".",d.yytext);break;case 5:u.getLogger().debug("_",d.yytext);break;case 6:return 5;case 7:return d.yytext=-1,28;case 8:return d.yytext=d.yytext.replace(/columns\s+/,""),u.getLogger().debug("COLUMNS (LEX)",d.yytext),28;case 9:this.pushState("md_string");break;case 10:return"MD_STR";case 11:this.popState();break;case 12:this.pushState("string");break;case 13:u.getLogger().debug("LEX: POPPING STR:",d.yytext),this.popState();break;case 14:return u.getLogger().debug("LEX: STR end:",d.yytext),"STR";case 15:return d.yytext=d.yytext.replace(/space\:/,""),u.getLogger().debug("SPACE NUM (LEX)",d.yytext),21;case 16:return d.yytext="1",u.getLogger().debug("COLUMNS (LEX)",d.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 35:this.popState();break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),u.getLogger().debug("Lex: ))"),"NODE_DEND";case 41:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 43:return this.popState(),u.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),u.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),u.getLogger().debug("Lex: (("),"NODE_DEND";case 46:return this.popState(),u.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),u.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),u.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),u.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),u.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),u.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),u.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),u.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return u.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return u.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return u.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return u.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 60:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 61:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 62:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 63:return u.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return u.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 65:return u.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 66:return this.pushState("NODE"),36;case 67:return this.pushState("NODE"),36;case 68:return this.pushState("NODE"),36;case 69:return this.pushState("NODE"),36;case 70:return this.pushState("NODE"),36;case 71:return this.pushState("NODE"),36;case 72:return this.pushState("NODE"),36;case 73:return u.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),u.getLogger().debug("LEX ARR START"),38;case 75:return u.getLogger().debug("Lex: NODE_ID",d.yytext),32;case 76:return u.getLogger().debug("Lex: EOF",d.yytext),8;case 77:this.pushState("md_string");break;case 78:this.pushState("md_string");break;case 79:return"NODE_DESCR";case 80:this.popState();break;case 81:u.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:u.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return u.getLogger().debug("LEX: NODE_DESCR:",d.yytext),"NODE_DESCR";case 84:u.getLogger().debug("LEX POPPING"),this.popState();break;case 85:u.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return d.yytext=d.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (right): dir:",d.yytext),"DIR";case 87:return d.yytext=d.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (left):",d.yytext),"DIR";case 88:return d.yytext=d.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (x):",d.yytext),"DIR";case 89:return d.yytext=d.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (y):",d.yytext),"DIR";case 90:return d.yytext=d.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (up):",d.yytext),"DIR";case 91:return d.yytext=d.yytext.replace(/^,\s*/,""),u.getLogger().debug("Lex (down):",d.yytext),"DIR";case 92:return d.yytext="]>",u.getLogger().debug("Lex (ARROW_DIR end):",d.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return u.getLogger().debug("Lex: LINK","#"+d.yytext+"#"),15;case 94:return u.getLogger().debug("Lex: LINK",d.yytext),15;case 95:return u.getLogger().debug("Lex: LINK",d.yytext),15;case 96:return u.getLogger().debug("Lex: LINK",d.yytext),15;case 97:return u.getLogger().debug("Lex: START_LINK",d.yytext),this.pushState("LLABEL"),16;case 98:return u.getLogger().debug("Lex: START_LINK",d.yytext),this.pushState("LLABEL"),16;case 99:return u.getLogger().debug("Lex: START_LINK",d.yytext),this.pushState("LLABEL"),16;case 100:this.pushState("md_string");break;case 101:return u.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),u.getLogger().debug("Lex: LINK","#"+d.yytext+"#"),15;case 103:return this.popState(),u.getLogger().debug("Lex: LINK",d.yytext),15;case 104:return this.popState(),u.getLogger().debug("Lex: LINK",d.yytext),15;case 105:return u.getLogger().debug("Lex: COLON",d.yytext),d.yytext=d.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\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:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return D}();E.lexer=N;function k(){this.yy={}}return g(k,"Parser"),k.prototype=E,E.Parser=k,new k}();mt.parser=mt;var fa=mt,G=new Map,kt=[],Lt=new Map,Pt="color",Wt="fill",ya="bgFill",le=",",xa=z(),gt=new Map,ba=g(e=>Ze.sanitizeText(e,xa),"sanitizeText"),wa=g(function(e,t=""){let r=gt.get(e);r||(r={id:e,styles:[],textStyles:[]},gt.set(e,r)),t!=null&&t.split(le).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Pt).exec(n)){const a=i.replace(Wt,ya).replace(Pt,Wt);r.textStyles.push(a)}r.styles.push(i)})},"addStyleClass"),ma=g(function(e,t=""){const r=G.get(e);t!=null&&(r.styles=t.split(le))},"addStyle2Node"),La=g(function(e,t){e.split(",").forEach(function(r){let n=G.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},G.set(i,n)}n.classes||(n.classes=[]),n.classes.push(t)})},"setCssClass"),ce=g((e,t)=>{const r=e.flat(),n=[];for(const i of r){if(i.label&&(i.label=ba(i.label)),i.type==="classDef"){wa(i.id,i.css);continue}if(i.type==="applyClass"){La(i.id,(i==null?void 0:i.styleClass)??"");continue}if(i.type==="applyStyles"){i!=null&&i.stylesStr&&ma(i.id,i==null?void 0:i.stylesStr);continue}if(i.type==="column-setting")t.columns=i.columns??-1;else if(i.type==="edge"){const s=(Lt.get(i.id)??0)+1;Lt.set(i.id,s),i.id=s+"-"+i.id,kt.push(i)}else{i.label||(i.type==="composite"?i.label="":i.label=i.id);const s=G.get(i.id);if(s===void 0?G.set(i.id,i):(i.type!=="na"&&(s.type=i.type),i.label!==i.id&&(s.label=i.label)),i.children&&ce(i.children,i),i.type==="space"){const a=i.width??1;for(let l=0;l<a;l++){const c=pa(i);c.id=c.id+"-"+l,G.set(c.id,c),n.push(c)}}else s===void 0&&n.push(i)}}t.children=n},"populateBlockDatabase"),Tt=[],at={id:"root",type:"composite",children:[],columns:-1},Sa=g(()=>{S.debug("Clear called"),Ke(),at={id:"root",type:"composite",children:[],columns:-1},G=new Map([["root",at]]),Tt=[],gt=new Map,kt=[],Lt=new Map},"clear");function oe(e){switch(S.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return S.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"}}g(oe,"typeStr2Type");function he(e){switch(S.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}g(he,"edgeTypeStr2Type");function ge(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}g(ge,"edgeStrToEdgeData");var Yt=0,va=g(()=>(Yt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Yt),"generateId"),Ea=g(e=>{at.children=e,ce(e,at),Tt=at.children},"setHierarchy"),_a=g(e=>{const t=G.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ka=g(()=>[...G.values()],"getBlocksFlat"),Ta=g(()=>Tt||[],"getBlocks"),Da=g(()=>kt,"getEdges"),Na=g(e=>G.get(e),"getBlock"),Ca=g(e=>{G.set(e.id,e)},"setBlock"),Ia=g(()=>console,"getLogger"),Ba=g(function(){return gt},"getClasses"),Aa={getConfig:g(()=>st().block,"getConfig"),typeStr2Type:oe,edgeTypeStr2Type:he,edgeStrToEdgeData:ge,getLogger:Ia,getBlocksFlat:ka,getBlocks:Ta,getEdges:Da,setHierarchy:Ea,getBlock:Na,setBlock:Ca,getColumns:_a,getClasses:Ba,clear:Sa,generateId:va},Oa=Aa,lt=g((e,t)=>{const r=Qe,n=r(e,"r"),i=r(e,"g"),s=r(e,"b");return He(n,i,s,t)},"fade"),Ra=g(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
|
-
rect {
|
|
67
|
-
opacity: 0.5;
|
|
68
|
-
background-color: ${e.edgeLabelBackground};
|
|
69
|
-
fill: ${e.edgeLabelBackground};
|
|
70
|
-
}
|
|
71
|
-
text-align: center;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* For html labels only */
|
|
75
|
-
.labelBkg {
|
|
76
|
-
background-color: ${lt(e.edgeLabelBackground,.5)};
|
|
77
|
-
// background-color:
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.node .cluster {
|
|
81
|
-
// fill: ${lt(e.mainBkg,.5)};
|
|
82
|
-
fill: ${lt(e.clusterBkg,.5)};
|
|
83
|
-
stroke: ${lt(e.clusterBorder,.2)};
|
|
84
|
-
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
85
|
-
stroke-width: 1px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.cluster text {
|
|
89
|
-
fill: ${e.titleColor};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.cluster span,p {
|
|
93
|
-
color: ${e.titleColor};
|
|
94
|
-
}
|
|
95
|
-
/* .cluster div {
|
|
96
|
-
color: ${e.titleColor};
|
|
97
|
-
} */
|
|
98
|
-
|
|
99
|
-
div.mermaidTooltip {
|
|
100
|
-
position: absolute;
|
|
101
|
-
text-align: center;
|
|
102
|
-
max-width: 200px;
|
|
103
|
-
padding: 2px;
|
|
104
|
-
font-family: ${e.fontFamily};
|
|
105
|
-
font-size: 12px;
|
|
106
|
-
background: ${e.tertiaryColor};
|
|
107
|
-
border: 1px solid ${e.border2};
|
|
108
|
-
border-radius: 2px;
|
|
109
|
-
pointer-events: none;
|
|
110
|
-
z-index: 100;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.flowchartTitleText {
|
|
114
|
-
text-anchor: middle;
|
|
115
|
-
font-size: 18px;
|
|
116
|
-
fill: ${e.textColor};
|
|
117
|
-
}
|
|
118
|
-
`,"getStyles"),za=Ra,Ma=g((e,t,r,n)=>{t.forEach(i=>{Va[i](e,r,n)})},"insertMarkers"),ja=g((e,t,r)=>{S.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),Fa=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),Pa=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),Wa=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),Ya=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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",r+"_"+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"),Ka=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+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",r+"_"+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"),Ha=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+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",r+"_"+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"),Ua=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+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",r+"_"+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"),Xa=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+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"),Va={extension:ja,composition:Fa,aggregation:Pa,dependency:Wa,lollipop:Ya,point:Ka,circle:Ha,cross:Ua,barb:Xa},Ga=Ma,Zt,qt,A=((qt=(Zt=z())==null?void 0:Zt.block)==null?void 0:qt.padding)??8;function ue(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 r=t%e,n=Math.floor(t/e);return{px:r,py:n}}g(ue,"calculateBlockPosition");var Za=g(e=>{let t=0,r=0;for(const n of e.children){const{width:i,height:s,x:a,y:l}=n.size??{width:0,height:0,x:0,y:0};S.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",s,"x:",a,"y:",l,n.type),n.type!=="space"&&(i>t&&(t=i/(e.widthInColumns??1)),s>r&&(r=s))}return{width:t,height:r}},"getMaxChildSize");function ut(e,t,r=0,n=0){var a,l,c,f,h,x,b,m,L,T,E;S.debug("setBlockSizes abc95 (start)",e.id,(a=e==null?void 0:e.size)==null?void 0:a.x,"block width =",e==null?void 0:e.size,"sieblingWidth",r),(l=e==null?void 0:e.size)!=null&&l.width||(e.size={width:r,height:n,x:0,y:0});let i=0,s=0;if(((c=e.children)==null?void 0:c.length)>0){for(const v of e.children)ut(v,t);const N=Za(e);i=N.width,s=N.height,S.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,s);for(const v of e.children)v.size&&(S.debug(`abc95 Setting size of children of ${e.id} id=${v.id} ${i} ${s} ${JSON.stringify(v.size)}`),v.size.width=i*(v.widthInColumns??1)+A*((v.widthInColumns??1)-1),v.size.height=s,v.size.x=0,v.size.y=0,S.debug(`abc95 updating size of ${e.id} children child:${v.id} maxWidth:${i} maxHeight:${s}`));for(const v of e.children)ut(v,t,i,s);const k=e.columns??-1;let D=0;for(const v of e.children)D+=v.widthInColumns??1;let y=e.children.length;k>0&&k<D&&(y=k);const u=Math.ceil(D/y);let d=y*(i+A)+A,w=u*(s+A)+A;if(d<r){S.debug(`Detected to small siebling: abc95 ${e.id} sieblingWidth ${r} sieblingHeight ${n} width ${d}`),d=r,w=n;const v=(r-y*A-A)/y,o=(n-u*A-A)/u;S.debug("Size indata abc88",e.id,"childWidth",v,"maxWidth",i),S.debug("Size indata abc88",e.id,"childHeight",o,"maxHeight",s),S.debug("Size indata abc88 xSize",y,"padding",A);for(const _ of e.children)_.size&&(_.size.width=v,_.size.height=o,_.size.x=0,_.size.y=0)}if(S.debug(`abc95 (finale calc) ${e.id} xSize ${y} ySize ${u} columns ${k}${e.children.length} width=${Math.max(d,((f=e.size)==null?void 0:f.width)||0)}`),d<(((h=e==null?void 0:e.size)==null?void 0:h.width)||0)){d=((x=e==null?void 0:e.size)==null?void 0:x.width)||0;const v=k>0?Math.min(e.children.length,k):e.children.length;if(v>0){const o=(d-v*A-A)/v;S.debug("abc95 (growing to fit) width",e.id,d,(b=e.size)==null?void 0:b.width,o);for(const _ of e.children)_.size&&(_.size.width=o)}}e.size={width:d,height:w,x:0,y:0}}S.debug("setBlockSizes abc94 (done)",e.id,(m=e==null?void 0:e.size)==null?void 0:m.x,(L=e==null?void 0:e.size)==null?void 0:L.width,(T=e==null?void 0:e.size)==null?void 0:T.y,(E=e==null?void 0:e.size)==null?void 0:E.height)}g(ut,"setBlockSizes");function Dt(e,t){var n,i,s,a,l,c,f,h,x,b,m,L,T,E,N,k,D;S.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(n=e==null?void 0:e.size)==null?void 0:n.x} y: ${(i=e==null?void 0:e.size)==null?void 0:i.y} width: ${(s=e==null?void 0:e.size)==null?void 0:s.width}`);const r=e.columns??-1;if(S.debug("layoutBlocks columns abc95",e.id,"=>",r,e),e.children&&e.children.length>0){const y=((l=(a=e==null?void 0:e.children[0])==null?void 0:a.size)==null?void 0:l.width)??0,u=e.children.length*y+(e.children.length-1)*A;S.debug("widthOfChildren 88",u,"posX");let d=0;S.debug("abc91 block?.size?.x",e.id,(c=e==null?void 0:e.size)==null?void 0:c.x);let w=(f=e==null?void 0:e.size)!=null&&f.x?((h=e==null?void 0:e.size)==null?void 0:h.x)+(-((x=e==null?void 0:e.size)==null?void 0:x.width)/2||0):-A,v=0;for(const o of e.children){const _=e;if(!o.size)continue;const{width:p,height:M}=o.size,{px:O,py:U}=ue(r,d);if(U!=v&&(v=U,w=(b=e==null?void 0:e.size)!=null&&b.x?((m=e==null?void 0:e.size)==null?void 0:m.x)+(-((L=e==null?void 0:e.size)==null?void 0:L.width)/2||0):-A,S.debug("New row in layout for block",e.id," and child ",o.id,v)),S.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${d} (px, py) ${O},${U} (${(T=_==null?void 0:_.size)==null?void 0:T.x},${(E=_==null?void 0:_.size)==null?void 0:E.y}) parent: ${_.id} width: ${p}${A}`),_.size){const P=p/2;o.size.x=w+A+P,S.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${w} new startingPosX${o.size.x} ${P} padding=${A} width=${p} halfWidth=${P} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${p*((o==null?void 0:o.widthInColumns)??1)/2}`),w=o.size.x+P,o.size.y=_.size.y-_.size.height/2+U*(M+A)+M/2+A,S.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${w}${A}${P}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${p*((o==null?void 0:o.widthInColumns)??1)/2}`)}o.children&&Dt(o),d+=(o==null?void 0:o.widthInColumns)??1,S.debug("abc88 columnsPos",o,d)}}S.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(N=e==null?void 0:e.size)==null?void 0:N.x} y: ${(k=e==null?void 0:e.size)==null?void 0:k.y} width: ${(D=e==null?void 0:e.size)==null?void 0:D.width}`)}g(Dt,"layoutBlocks");function Nt(e,{minX:t,minY:r,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:s,y:a,width:l,height:c}=e.size;s-l/2<t&&(t=s-l/2),a-c/2<r&&(r=a-c/2),s+l/2>n&&(n=s+l/2),a+c/2>i&&(i=a+c/2)}if(e.children)for(const s of e.children)({minX:t,minY:r,maxX:n,maxY:i}=Nt(s,{minX:t,minY:r,maxX:n,maxY:i}));return{minX:t,minY:r,maxX:n,maxY:i}}g(Nt,"findBounds");function de(e){const t=e.getBlock("root");if(!t)return;ut(t,e,0,0),Dt(t),S.debug("getBlocks",JSON.stringify(t,null,2));const{minX:r,minY:n,maxX:i,maxY:s}=Nt(t),a=s-n,l=i-r;return{x:r,y:n,width:l,height:a}}g(de,"layout");function St(e,t){t&&e.attr("style",t)}g(St,"applyStyle");function pe(e){const t=R(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),n=e.label,i=e.isNode?"nodeLabel":"edgeLabel",s=r.append("span");return s.html(n),St(s,e.labelStyle),s.attr("class",i),St(r,e.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}g(pe,"addHtmlLabel");var qa=g((e,t,r,n)=>{let i=e||"";if(typeof i=="object"&&(i=i[0]),q(z().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),S.debug("vertexText"+i);const s={isNode:n,label:qe(wt(i)),labelStyle:t.replace("fill:","color:")};return pe(s)}else{const s=document.createElementNS("http://www.w3.org/2000/svg","text");s.setAttribute("style",t.replace("color:","fill:"));let a=[];typeof i=="string"?a=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?a=i:a=[];for(const l of a){const c=document.createElementNS("http://www.w3.org/2000/svg","tspan");c.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),c.setAttribute("dy","1em"),c.setAttribute("x","0"),r?c.setAttribute("class","title-row"):c.setAttribute("class","row"),c.textContent=l.trim(),s.appendChild(c)}return s}},"createLabel"),V=qa,$a=g((e,t,r,n,i)=>{t.arrowTypeStart&&Kt(e,"start",t.arrowTypeStart,r,n,i),t.arrowTypeEnd&&Kt(e,"end",t.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),Ja={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Kt=g((e,t,r,n,i,s)=>{const a=Ja[r];if(!a){S.warn(`Unknown arrow type: ${r}`);return}const l=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${n}#${i}_${s}-${a}${l})`)},"addEdgeMarker"),vt={},W={},Qa=g((e,t)=>{const r=z(),n=q(r.flowchart.htmlLabels),i=t.labelType==="markdown"?ee(e,t.label,{style:t.labelStyle,useHtmlLabels:n,addSvgBackground:!0},r):V(t.label,t.labelStyle),s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label");a.node().appendChild(i);let l=i.getBBox();if(n){const f=i.children[0],h=R(i);l=f.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}a.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),vt[t.id]=s,t.width=l.width,t.height=l.height;let c;if(t.startLabelLeft){const f=V(t.startLabelLeft,t.labelStyle),h=e.insert("g").attr("class","edgeTerminals"),x=h.insert("g").attr("class","inner");c=x.node().appendChild(f);const b=f.getBBox();x.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"),W[t.id]||(W[t.id]={}),W[t.id].startLeft=h,rt(c,t.startLabelLeft)}if(t.startLabelRight){const f=V(t.startLabelRight,t.labelStyle),h=e.insert("g").attr("class","edgeTerminals"),x=h.insert("g").attr("class","inner");c=h.node().appendChild(f),x.node().appendChild(f);const b=f.getBBox();x.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"),W[t.id]||(W[t.id]={}),W[t.id].startRight=h,rt(c,t.startLabelRight)}if(t.endLabelLeft){const f=V(t.endLabelLeft,t.labelStyle),h=e.insert("g").attr("class","edgeTerminals"),x=h.insert("g").attr("class","inner");c=x.node().appendChild(f);const b=f.getBBox();x.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"),h.node().appendChild(f),W[t.id]||(W[t.id]={}),W[t.id].endLeft=h,rt(c,t.endLabelLeft)}if(t.endLabelRight){const f=V(t.endLabelRight,t.labelStyle),h=e.insert("g").attr("class","edgeTerminals"),x=h.insert("g").attr("class","inner");c=x.node().appendChild(f);const b=f.getBBox();x.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"),h.node().appendChild(f),W[t.id]||(W[t.id]={}),W[t.id].endRight=h,rt(c,t.endLabelRight)}return i},"insertEdgeLabel");function rt(e,t){z().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(rt,"setTerminalWidth");var ts=g((e,t)=>{S.debug("Moving label abc88 ",e.id,e.label,vt[e.id],t);let r=t.updatedPath?t.updatedPath:t.originalPath;const n=z(),{subGraphTitleTotalMargin:i}=Ge(n);if(e.label){const s=vt[e.id];let a=e.x,l=e.y;if(r){const c=et.calcLabelPosition(r);S.debug("Moving label "+e.label+" from (",a,",",l,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(a=c.x,l=c.y)}s.attr("transform",`translate(${a}, ${l+i/2})`)}if(e.startLabelLeft){const s=W[e.id].startLeft;let a=e.x,l=e.y;if(r){const c=et.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=c.x,l=c.y}s.attr("transform",`translate(${a}, ${l})`)}if(e.startLabelRight){const s=W[e.id].startRight;let a=e.x,l=e.y;if(r){const c=et.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=c.x,l=c.y}s.attr("transform",`translate(${a}, ${l})`)}if(e.endLabelLeft){const s=W[e.id].endLeft;let a=e.x,l=e.y;if(r){const c=et.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=c.x,l=c.y}s.attr("transform",`translate(${a}, ${l})`)}if(e.endLabelRight){const s=W[e.id].endRight;let a=e.x,l=e.y;if(r){const c=et.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=c.x,l=c.y}s.attr("transform",`translate(${a}, ${l})`)}},"positionEdgeLabel"),es=g((e,t)=>{const r=e.x,n=e.y,i=Math.abs(t.x-r),s=Math.abs(t.y-n),a=e.width/2,l=e.height/2;return i>=a||s>=l},"outsideNode"),rs=g((e,t,r)=>{S.debug(`intersection calc abc89:
|
|
119
|
-
outsidePoint: ${JSON.stringify(t)}
|
|
120
|
-
insidePoint : ${JSON.stringify(r)}
|
|
121
|
-
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const n=e.x,i=e.y,s=Math.abs(n-r.x),a=e.width/2;let l=r.x<t.x?a-s:a+s;const c=e.height/2,f=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(i-t.y)*a>Math.abs(n-t.x)*c){let x=r.y<t.y?t.y-c-i:i-c-t.y;l=h*x/f;const b={x:r.x<t.x?r.x+l:r.x-h+l,y:r.y<t.y?r.y+f-x:r.y-f+x};return l===0&&(b.x=t.x,b.y=t.y),h===0&&(b.x=t.x),f===0&&(b.y=t.y),S.debug(`abc89 topp/bott calc, Q ${f}, q ${x}, R ${h}, r ${l}`,b),b}else{r.x<t.x?l=t.x-a-n:l=n-a-t.x;let x=f*l/h,b=r.x<t.x?r.x+h-l:r.x-h+l,m=r.y<t.y?r.y+x:r.y-x;return S.debug(`sides calc abc89, Q ${f}, q ${x}, R ${h}, r ${l}`,{_x:b,_y:m}),l===0&&(b=t.x,m=t.y),h===0&&(b=t.x),f===0&&(m=t.y),{x:b,y:m}}},"intersection"),Ht=g((e,t)=>{S.debug("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(s=>{if(!es(t,s)&&!i){const a=rs(t,n,s);let l=!1;r.forEach(c=>{l=l||c.x===a.x&&c.y===a.y}),r.some(c=>c.x===a.x&&c.y===a.y)||r.push(a),i=!0}else n=s,i||r.push(s)}),r},"cutPathAtIntersect"),as=g(function(e,t,r,n,i,s,a){let l=r.points;S.debug("abc88 InsertEdge: edge=",r,"e=",t);let c=!1;const f=s.node(t.v);var h=s.node(t.w);h!=null&&h.intersect&&(f!=null&&f.intersect)&&(l=l.slice(1,r.points.length-1),l.unshift(f.intersect(l[0])),l.push(h.intersect(l[l.length-1]))),r.toCluster&&(S.debug("to cluster abc88",n[r.toCluster]),l=Ht(r.points,n[r.toCluster].node),c=!0),r.fromCluster&&(S.debug("from cluster abc88",n[r.fromCluster]),l=Ht(l.reverse(),n[r.fromCluster].node).reverse(),c=!0);const x=l.filter(y=>!Number.isNaN(y.y));let b=Ve;r.curve&&(i==="graph"||i==="flowchart")&&(b=r.curve);const{x:m,y:L}=Ue(r),T=Xe().x(m).y(L).curve(b);let E;switch(r.thickness){case"normal":E="edge-thickness-normal";break;case"thick":E="edge-thickness-thick";break;case"invisible":E="edge-thickness-thick";break;default:E=""}switch(r.pattern){case"solid":E+=" edge-pattern-solid";break;case"dotted":E+=" edge-pattern-dotted";break;case"dashed":E+=" edge-pattern-dashed";break}const N=e.append("path").attr("d",T(x)).attr("id",r.id).attr("class"," "+E+(r.classes?" "+r.classes:"")).attr("style",r.style);let k="";(z().flowchart.arrowMarkerAbsolute||z().state.arrowMarkerAbsolute)&&(k=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,k=k.replace(/\(/g,"\\("),k=k.replace(/\)/g,"\\)")),$a(N,r,k,a,i);let D={};return c&&(D.updatedPath=l),D.originalPath=r.points,D},"insertEdge"),ss=g(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),is=g((e,t,r)=>{const n=ss(e),i=2,s=t.height+2*r.padding,a=s/i,l=t.width+2*a+r.padding,c=r.padding/2;return n.has("right")&&n.has("left")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:a,y:0},{x:l/2,y:2*c},{x:l-a,y:0},{x:l,y:0},{x:l,y:-s/3},{x:l+2*c,y:-s/2},{x:l,y:-2*s/3},{x:l,y:-s},{x:l-a,y:-s},{x:l/2,y:-s-2*c},{x:a,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*c,y:-s/2},{x:0,y:-s/3}]:n.has("right")&&n.has("left")&&n.has("up")?[{x:a,y:0},{x:l-a,y:0},{x:l,y:-s/2},{x:l-a,y:-s},{x:a,y:-s},{x:0,y:-s/2}]:n.has("right")&&n.has("left")&&n.has("down")?[{x:0,y:0},{x:a,y:-s},{x:l-a,y:-s},{x:l,y:0}]:n.has("right")&&n.has("up")&&n.has("down")?[{x:0,y:0},{x:l,y:-a},{x:l,y:-s+a},{x:0,y:-s}]:n.has("left")&&n.has("up")&&n.has("down")?[{x:l,y:0},{x:0,y:-a},{x:0,y:-s+a},{x:l,y:-s}]:n.has("right")&&n.has("left")?[{x:a,y:0},{x:a,y:-c},{x:l-a,y:-c},{x:l-a,y:0},{x:l,y:-s/2},{x:l-a,y:-s},{x:l-a,y:-s+c},{x:a,y:-s+c},{x:a,y:-s},{x:0,y:-s/2}]:n.has("up")&&n.has("down")?[{x:l/2,y:0},{x:0,y:-c},{x:a,y:-c},{x:a,y:-s+c},{x:0,y:-s+c},{x:l/2,y:-s},{x:l,y:-s+c},{x:l-a,y:-s+c},{x:l-a,y:-c},{x:l,y:-c}]:n.has("right")&&n.has("up")?[{x:0,y:0},{x:l,y:-a},{x:0,y:-s}]:n.has("right")&&n.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-s}]:n.has("left")&&n.has("up")?[{x:l,y:0},{x:0,y:-a},{x:l,y:-s}]:n.has("left")&&n.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-s}]:n.has("right")?[{x:a,y:-c},{x:a,y:-c},{x:l-a,y:-c},{x:l-a,y:0},{x:l,y:-s/2},{x:l-a,y:-s},{x:l-a,y:-s+c},{x:a,y:-s+c},{x:a,y:-s+c}]:n.has("left")?[{x:a,y:0},{x:a,y:-c},{x:l-a,y:-c},{x:l-a,y:-s+c},{x:a,y:-s+c},{x:a,y:-s},{x:0,y:-s/2}]:n.has("up")?[{x:a,y:-c},{x:a,y:-s+c},{x:0,y:-s+c},{x:l/2,y:-s},{x:l,y:-s+c},{x:l-a,y:-s+c},{x:l-a,y:-c}]:n.has("down")?[{x:l/2,y:0},{x:0,y:-c},{x:a,y:-c},{x:a,y:-s+c},{x:l-a,y:-s+c},{x:l-a,y:-c},{x:l,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function fe(e,t){return e.intersect(t)}g(fe,"intersectNode");var ns=fe;function ye(e,t,r,n){var i=e.x,s=e.y,a=i-n.x,l=s-n.y,c=Math.sqrt(t*t*l*l+r*r*a*a),f=Math.abs(t*r*a/c);n.x<i&&(f=-f);var h=Math.abs(t*r*l/c);return n.y<s&&(h=-h),{x:i+f,y:s+h}}g(ye,"intersectEllipse");var xe=ye;function be(e,t,r){return xe(e,t,t,r)}g(be,"intersectCircle");var ls=be;function we(e,t,r,n){var i,s,a,l,c,f,h,x,b,m,L,T,E,N,k;if(i=t.y-e.y,a=e.x-t.x,c=t.x*e.y-e.x*t.y,b=i*r.x+a*r.y+c,m=i*n.x+a*n.y+c,!(b!==0&&m!==0&&Et(b,m))&&(s=n.y-r.y,l=r.x-n.x,f=n.x*r.y-r.x*n.y,h=s*e.x+l*e.y+f,x=s*t.x+l*t.y+f,!(h!==0&&x!==0&&Et(h,x))&&(L=i*l-s*a,L!==0)))return T=Math.abs(L/2),E=a*f-l*c,N=E<0?(E-T)/L:(E+T)/L,E=s*c-i*f,k=E<0?(E-T)/L:(E+T)/L,{x:N,y:k}}g(we,"intersectLine");function Et(e,t){return e*t>0}g(Et,"sameSign");var cs=we,os=me;function me(e,t,r){var n=e.x,i=e.y,s=[],a=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(L){a=Math.min(a,L.x),l=Math.min(l,L.y)}):(a=Math.min(a,t.x),l=Math.min(l,t.y));for(var c=n-e.width/2-a,f=i-e.height/2-l,h=0;h<t.length;h++){var x=t[h],b=t[h<t.length-1?h+1:0],m=cs(e,r,{x:c+x.x,y:f+x.y},{x:c+b.x,y:f+b.y});m&&s.push(m)}return s.length?(s.length>1&&s.sort(function(L,T){var E=L.x-r.x,N=L.y-r.y,k=Math.sqrt(E*E+N*N),D=T.x-r.x,y=T.y-r.y,u=Math.sqrt(D*D+y*y);return k<u?-1:k===u?0:1}),s[0]):e}g(me,"intersectPolygon");var hs=g((e,t)=>{var r=e.x,n=e.y,i=t.x-r,s=t.y-n,a=e.width/2,l=e.height/2,c,f;return Math.abs(s)*a>Math.abs(i)*l?(s<0&&(l=-l),c=s===0?0:l*i/s,f=l):(i<0&&(a=-a),c=a,f=i===0?0:a*s/i),{x:r+c,y:n+f}},"intersectRect"),gs=hs,I={node:ns,circle:ls,ellipse:xe,polygon:os,rect:gs},F=g(async(e,t,r,n)=>{const i=z();let s;const a=t.useHtmlLabels||q(i.flowchart.htmlLabels);r?s=r:s="node default";const l=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=l.insert("g").attr("class","label").attr("style",t.labelStyle);let f;t.labelText===void 0?f="":f=typeof t.labelText=="string"?t.labelText:t.labelText[0];const h=c.node();let x;t.labelType==="markdown"?x=ee(c,Ot(wt(f),i),{useHtmlLabels:a,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):x=h.appendChild(V(Ot(wt(f),i),t.labelStyle,!1,n));let b=x.getBBox();const m=t.padding/2;if(q(i.flowchart.htmlLabels)){const L=x.children[0],T=R(x),E=L.getElementsByTagName("img");if(E){const N=f.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...E].map(k=>new Promise(D=>{function y(){if(k.style.display="flex",k.style.flexDirection="column",N){const u=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,w=parseInt(u,10)*5+"px";k.style.minWidth=w,k.style.maxWidth=w}else k.style.width="100%";D(k)}g(y,"setupImage"),setTimeout(()=>{k.complete&&y()}),k.addEventListener("error",y),k.addEventListener("load",y)})))}b=L.getBoundingClientRect(),T.attr("width",b.width),T.attr("height",b.height)}return a?c.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"):c.attr("transform","translate(0, "+-b.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-b.width/2+", "+-b.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:l,bbox:b,halfPadding:m,label:c}},"labelHelper"),B=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds");function Z(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(Z,"insertPolygonShape");var us=g(async(e,t)=>{t.useHtmlLabels||z().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:s}=await F(e,t,"node "+t.classes,!0);S.info("Classes = ",t.classes);const a=n.insert("rect",":first-child");return a.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-s).attr("y",-i.height/2-s).attr("width",i.width+t.padding).attr("height",i.height+t.padding),B(t,a),t.intersect=function(l){return I.rect(t,l)},n},"note"),ds=us,Ut=g(e=>e?" "+e:"","formatClass"),H=g((e,t)=>`${t||"node default"}${Ut(e.classes)} ${Ut(e.class)}`,"getClassesFromNode"),Xt=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=i+s,l=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];S.info("Question main (Circle)");const c=Z(r,a,a,l);return c.attr("style",t.style),B(t,c),t.intersect=function(f){return S.warn("Intersect called"),I.polygon(t,l,f)},r},"question"),ps=g((e,t)=>{const r=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),n=28,i=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}];return r.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(a){return I.circle(t,14,a)},r},"choice"),fs=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=4,s=n.height+t.padding,a=s/i,l=n.width+2*a+t.padding,c=[{x:a,y:0},{x:l-a,y:0},{x:l,y:-s/2},{x:l-a,y:-s},{x:a,y:-s},{x:0,y:-s/2}],f=Z(r,l,s,c);return f.attr("style",t.style),B(t,f),t.intersect=function(h){return I.polygon(t,c,h)},r},"hexagon"),ys=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,void 0,!0),i=2,s=n.height+2*t.padding,a=s/i,l=n.width+2*a+t.padding,c=is(t.directions,n,t),f=Z(r,l,s,c);return f.attr("style",t.style),B(t,f),t.intersect=function(h){return I.polygon(t,c,h)},r},"block_arrow"),xs=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:-s/2,y:0},{x:i,y:0},{x:i,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return Z(r,i,s,a).attr("style",t.style),t.width=i+s,t.height=s,t.intersect=function(c){return I.polygon(t,a,c)},r},"rect_left_inv_arrow"),bs=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:-2*s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:s/6,y:-s}],l=Z(r,i,s,a);return l.attr("style",t.style),B(t,l),t.intersect=function(c){return I.polygon(t,a,c)},r},"lean_right"),ws=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:2*s/6,y:0},{x:i+s/6,y:0},{x:i-2*s/6,y:-s},{x:-s/6,y:-s}],l=Z(r,i,s,a);return l.attr("style",t.style),B(t,l),t.intersect=function(c){return I.polygon(t,a,c)},r},"lean_left"),ms=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:-2*s/6,y:0},{x:i+2*s/6,y:0},{x:i-s/6,y:-s},{x:s/6,y:-s}],l=Z(r,i,s,a);return l.attr("style",t.style),B(t,l),t.intersect=function(c){return I.polygon(t,a,c)},r},"trapezoid"),Ls=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:s/6,y:0},{x:i-s/6,y:0},{x:i+2*s/6,y:-s},{x:-2*s/6,y:-s}],l=Z(r,i,s,a);return l.attr("style",t.style),B(t,l),t.intersect=function(c){return I.polygon(t,a,c)},r},"inv_trapezoid"),Ss=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:0,y:0},{x:i+s/2,y:0},{x:i,y:-s/2},{x:i+s/2,y:-s},{x:0,y:-s}],l=Z(r,i,s,a);return l.attr("style",t.style),B(t,l),t.intersect=function(c){return I.polygon(t,a,c)},r},"rect_right_inv_arrow"),vs=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=i/2,a=s/(2.5+i/50),l=n.height+a+t.padding,c="M 0,"+a+" a "+s+","+a+" 0,0,0 "+i+" 0 a "+s+","+a+" 0,0,0 "+-i+" 0 l 0,"+l+" a "+s+","+a+" 0,0,0 "+i+" 0 l 0,"+-l,f=r.attr("label-offset-y",a).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-i/2+","+-(l/2+a)+")");return B(t,f),t.intersect=function(h){const x=I.rect(t,h),b=x.x-t.x;if(s!=0&&(Math.abs(b)<t.width/2||Math.abs(b)==t.width/2&&Math.abs(x.y-t.y)>t.height/2-a)){let m=a*a*(1-b*b/(s*s));m!=0&&(m=Math.sqrt(m)),m=a-m,h.y-t.y>0&&(m=-m),x.y+=m}return x},r},"cylinder"),Es=g(async(e,t)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await F(e,t,"node "+t.classes+" "+t.class,!0),s=r.insert("rect",":first-child"),a=t.positioned?t.width:n.width+t.padding,l=t.positioned?t.height:n.height+t.padding,c=t.positioned?-a/2:-n.width/2-i,f=t.positioned?-l/2:-n.height/2-i;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",f).attr("width",a).attr("height",l),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(dt(s,t.props.borders,a,l),h.delete("borders")),h.forEach(x=>{S.warn(`Unknown node property ${x}`)})}return B(t,s),t.intersect=function(h){return I.rect(t,h)},r},"rect"),_s=g(async(e,t)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await F(e,t,"node "+t.classes,!0),s=r.insert("rect",":first-child"),a=t.positioned?t.width:n.width+t.padding,l=t.positioned?t.height:n.height+t.padding,c=t.positioned?-a/2:-n.width/2-i,f=t.positioned?-l/2:-n.height/2-i;if(s.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",f).attr("width",a).attr("height",l),t.props){const h=new Set(Object.keys(t.props));t.props.borders&&(dt(s,t.props.borders,a,l),h.delete("borders")),h.forEach(x=>{S.warn(`Unknown node property ${x}`)})}return B(t,s),t.intersect=function(h){return I.rect(t,h)},r},"composite"),ks=g(async(e,t)=>{const{shapeSvg:r}=await F(e,t,"label",!0);S.trace("Classes = ",t.class);const n=r.insert("rect",":first-child"),i=0,s=0;if(n.attr("width",i).attr("height",s),r.attr("class","label edgeLabel"),t.props){const a=new Set(Object.keys(t.props));t.props.borders&&(dt(n,t.props.borders,i,s),a.delete("borders")),a.forEach(l=>{S.warn(`Unknown node property ${l}`)})}return B(t,n),t.intersect=function(a){return I.rect(t,a)},r},"labelRect");function dt(e,t,r,n){const i=[],s=g(l=>{i.push(l,0)},"addBorder"),a=g(l=>{i.push(0,l)},"skipBorder");t.includes("t")?(S.debug("add top border"),s(r)):a(r),t.includes("r")?(S.debug("add right border"),s(n)):a(n),t.includes("b")?(S.debug("add bottom border"),s(r)):a(r),t.includes("l")?(S.debug("add left border"),s(n)):a(n),e.attr("stroke-dasharray",i.join(" "))}g(dt,"applyNodePropertyBorders");var Ts=g((e,t)=>{let r;t.classes?r="node "+t.classes:r="node default";const n=e.insert("g").attr("class",r).attr("id",t.domId||t.id),i=n.insert("rect",":first-child"),s=n.insert("line"),a=n.insert("g").attr("class","label"),l=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof l=="object"?c=l[0]:c=l,S.info("Label text abc79",c,l,typeof l=="object");const f=a.node().appendChild(V(c,t.labelStyle,!0,!0));let h={width:0,height:0};if(q(z().flowchart.htmlLabels)){const T=f.children[0],E=R(f);h=T.getBoundingClientRect(),E.attr("width",h.width),E.attr("height",h.height)}S.info("Text 2",l);const x=l.slice(1,l.length);let b=f.getBBox();const m=a.node().appendChild(V(x.join?x.join("<br/>"):x,t.labelStyle,!0,!0));if(q(z().flowchart.htmlLabels)){const T=m.children[0],E=R(m);h=T.getBoundingClientRect(),E.attr("width",h.width),E.attr("height",h.height)}const L=t.padding/2;return R(m).attr("transform","translate( "+(h.width>b.width?0:(b.width-h.width)/2)+", "+(b.height+L+5)+")"),R(f).attr("transform","translate( "+(h.width<b.width?0:-(b.width-h.width)/2)+", 0)"),h=a.node().getBBox(),a.attr("transform","translate("+-h.width/2+", "+(-h.height/2-L+3)+")"),i.attr("class","outer title-state").attr("x",-h.width/2-L).attr("y",-h.height/2-L).attr("width",h.width+t.padding).attr("height",h.height+t.padding),s.attr("class","divider").attr("x1",-h.width/2-L).attr("x2",h.width/2+L).attr("y1",-h.height/2-L+b.height+L).attr("y2",-h.height/2-L+b.height+L),B(t,i),t.intersect=function(T){return I.rect(t,T)},n},"rectWithTitle"),Ds=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.height+t.padding,s=n.width+i/4+t.padding,a=r.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-s/2).attr("y",-i/2).attr("width",s).attr("height",i);return B(t,a),t.intersect=function(l){return I.rect(t,l)},r},"stadium"),Ns=g(async(e,t)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await F(e,t,H(t,void 0),!0),s=r.insert("circle",":first-child");return s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+i).attr("width",n.width+t.padding).attr("height",n.height+t.padding),S.info("Circle main"),B(t,s),t.intersect=function(a){return S.info("Circle intersect",t,n.width/2+i,a),I.circle(t,n.width/2+i,a)},r},"circle"),Cs=g(async(e,t)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await F(e,t,H(t,void 0),!0),s=5,a=r.insert("g",":first-child"),l=a.insert("circle"),c=a.insert("circle");return a.attr("class",t.class),l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+i+s).attr("width",n.width+t.padding+s*2).attr("height",n.height+t.padding+s*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+i).attr("width",n.width+t.padding).attr("height",n.height+t.padding),S.info("DoubleCircle main"),B(t,l),t.intersect=function(f){return S.info("DoubleCircle intersect",t,n.width/2+i+s,f),I.circle(t,n.width/2+i+s,f)},r},"doublecircle"),Is=g(async(e,t)=>{const{shapeSvg:r,bbox:n}=await F(e,t,H(t,void 0),!0),i=n.width+t.padding,s=n.height+t.padding,a=[{x:0,y:0},{x:i,y:0},{x:i,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],l=Z(r,i,s,a);return l.attr("style",t.style),B(t,l),t.intersect=function(c){return I.polygon(t,a,c)},r},"subroutine"),Bs=g((e,t)=>{const r=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),n=r.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),B(t,n),t.intersect=function(i){return I.circle(t,7,i)},r},"start"),Vt=g((e,t,r)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,s=10;r==="LR"&&(i=10,s=70);const a=n.append("rect").attr("x",-1*i/2).attr("y",-1*s/2).attr("width",i).attr("height",s).attr("class","fork-join");return B(t,a),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(l){return I.rect(t,l)},n},"forkJoin"),As=g((e,t)=>{const r=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),n=r.insert("circle",":first-child"),i=r.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),n.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),B(t,i),t.intersect=function(s){return I.circle(t,7,s)},r},"end"),Os=g((e,t)=>{var v;const r=t.padding/2,n=4,i=8;let s;t.classes?s="node "+t.classes:s="node default";const a=e.insert("g").attr("class",s).attr("id",t.domId||t.id),l=a.insert("rect",":first-child"),c=a.insert("line"),f=a.insert("line");let h=0,x=n;const b=a.insert("g").attr("class","label");let m=0;const L=(v=t.classData.annotations)==null?void 0:v[0],T=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",E=b.node().appendChild(V(T,t.labelStyle,!0,!0));let N=E.getBBox();if(q(z().flowchart.htmlLabels)){const o=E.children[0],_=R(E);N=o.getBoundingClientRect(),_.attr("width",N.width),_.attr("height",N.height)}t.classData.annotations[0]&&(x+=N.height+n,h+=N.width);let k=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(z().flowchart.htmlLabels?k+="<"+t.classData.type+">":k+="<"+t.classData.type+">");const D=b.node().appendChild(V(k,t.labelStyle,!0,!0));R(D).attr("class","classTitle");let y=D.getBBox();if(q(z().flowchart.htmlLabels)){const o=D.children[0],_=R(D);y=o.getBoundingClientRect(),_.attr("width",y.width),_.attr("height",y.height)}x+=y.height+n,y.width>h&&(h=y.width);const u=[];t.classData.members.forEach(o=>{const _=o.getDisplayDetails();let p=_.displayText;z().flowchart.htmlLabels&&(p=p.replace(/</g,"<").replace(/>/g,">"));const M=b.node().appendChild(V(p,_.cssStyle?_.cssStyle:t.labelStyle,!0,!0));let O=M.getBBox();if(q(z().flowchart.htmlLabels)){const U=M.children[0],P=R(M);O=U.getBoundingClientRect(),P.attr("width",O.width),P.attr("height",O.height)}O.width>h&&(h=O.width),x+=O.height+n,u.push(M)}),x+=i;const d=[];if(t.classData.methods.forEach(o=>{const _=o.getDisplayDetails();let p=_.displayText;z().flowchart.htmlLabels&&(p=p.replace(/</g,"<").replace(/>/g,">"));const M=b.node().appendChild(V(p,_.cssStyle?_.cssStyle:t.labelStyle,!0,!0));let O=M.getBBox();if(q(z().flowchart.htmlLabels)){const U=M.children[0],P=R(M);O=U.getBoundingClientRect(),P.attr("width",O.width),P.attr("height",O.height)}O.width>h&&(h=O.width),x+=O.height+n,d.push(M)}),x+=i,L){let o=(h-N.width)/2;R(E).attr("transform","translate( "+(-1*h/2+o)+", "+-1*x/2+")"),m=N.height+n}let w=(h-y.width)/2;return R(D).attr("transform","translate( "+(-1*h/2+w)+", "+(-1*x/2+m)+")"),m+=y.height+n,c.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-x/2-r+i+m).attr("y2",-x/2-r+i+m),m+=i,u.forEach(o=>{R(o).attr("transform","translate( "+-h/2+", "+(-1*x/2+m+i/2)+")");const _=o==null?void 0:o.getBBox();m+=((_==null?void 0:_.height)??0)+n}),m+=i,f.attr("class","divider").attr("x1",-h/2-r).attr("x2",h/2+r).attr("y1",-x/2-r+i+m).attr("y2",-x/2-r+i+m),m+=i,d.forEach(o=>{R(o).attr("transform","translate( "+-h/2+", "+(-1*x/2+m)+")");const _=o==null?void 0:o.getBBox();m+=((_==null?void 0:_.height)??0)+n}),l.attr("style",t.style).attr("class","outer title-state").attr("x",-h/2-r).attr("y",-(x/2)-r).attr("width",h+t.padding).attr("height",x+t.padding),B(t,l),t.intersect=function(o){return I.rect(t,o)},a},"class_box"),Gt={rhombus:Xt,composite:_s,question:Xt,rect:Es,labelRect:ks,rectWithTitle:Ts,choice:ps,circle:Ns,doublecircle:Cs,stadium:Ds,hexagon:fs,block_arrow:ys,rect_left_inv_arrow:xs,lean_right:bs,lean_left:ws,trapezoid:ms,inv_trapezoid:Ls,rect_right_inv_arrow:Ss,cylinder:vs,start:Bs,end:As,note:ds,subroutine:Is,fork:Vt,join:Vt,class_box:Os},ot={},Le=g(async(e,t,r)=>{let n,i;if(t.link){let s;z().securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s),i=await Gt[t.shape](n,t,r)}else i=await Gt[t.shape](e,t,r),n=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),ot[t.id]=n,t.haveCallback&&ot[t.id].attr("class",ot[t.id].attr("class")+" clickable"),n},"insertNode"),Rs=g(e=>{const t=ot[e.id];S.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode");function Ct(e,t,r=!1){var b,m,L;const n=e;let i="default";(((b=n==null?void 0:n.classes)==null?void 0:b.length)||0)>0&&(i=((n==null?void 0:n.classes)??[]).join(" ")),i=i+" flowchart-label";let s=0,a="",l;switch(n.type){case"round":s=5,a="rect";break;case"composite":s=0,a="composite",l=0;break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"block_arrow":a="block_arrow";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"rect_left_inv_arrow":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}const c=$e((n==null?void 0:n.styles)??[]),f=n.label,h=n.size??{width:0,height:0,x:0,y:0};return{labelStyle:c.labelStyle,shape:a,labelText:f,rx:s,ry:s,class:i,style:c.style,id:n.id,directions:n.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:r,intersect:void 0,type:n.type,padding:l??((L=(m=st())==null?void 0:m.block)==null?void 0:L.padding)??0}}g(Ct,"getNodeFromBlock");async function Se(e,t,r){const n=Ct(t,r,!1);if(n.type==="group")return;const i=st(),s=await Le(e,n,{config:i}),a=s.node().getBBox(),l=r.getBlock(n.id);l.size={width:a.width,height:a.height,x:0,y:0,node:s},r.setBlock(l),s.remove()}g(Se,"calculateBlockSize");async function ve(e,t,r){const n=Ct(t,r,!0);if(r.getBlock(n.id).type!=="space"){const s=st();await Le(e,n,{config:s}),t.intersect=n==null?void 0:n.intersect,Rs(n)}}g(ve,"insertBlockPositioned");async function pt(e,t,r,n){for(const i of t)await n(e,i,r),i.children&&await pt(e,i.children,r,n)}g(pt,"performOperations");async function Ee(e,t,r){await pt(e,t,r,Se)}g(Ee,"calculateBlockSizes");async function _e(e,t,r){await pt(e,t,r,ve)}g(_e,"insertBlocks");async function ke(e,t,r,n,i){const s=new Je({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of r)a.size&&s.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(const a of t)if(a.start&&a.end){const l=n.getBlock(a.start),c=n.getBlock(a.end);if(l!=null&&l.size&&(c!=null&&c.size)){const f=l.size,h=c.size,x=[{x:f.x,y:f.y},{x:f.x+(h.x-f.x)/2,y:f.y+(h.y-f.y)/2},{x:h.x,y:h.y}];as(e,{v:a.start,w:a.end,name:a.id},{...a,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",s,i),a.label&&(await Qa(e,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),ts({...a,x:x[1].x,y:x[1].y},{originalPath:x}))}}}g(ke,"insertEdges");var zs=g(function(e,t){return t.db.getClasses()},"getClasses"),Ms=g(async function(e,t,r,n){const{securityLevel:i,block:s}=st(),a=n.db;let l;i==="sandbox"&&(l=R("#i"+t));const c=i==="sandbox"?R(l.nodes()[0].contentDocument.body):R("body"),f=i==="sandbox"?c.select(`[id="${t}"]`):R(`[id="${t}"]`);Ga(f,["point","circle","cross"],n.type,t);const x=a.getBlocks(),b=a.getBlocksFlat(),m=a.getEdges(),L=f.insert("g").attr("class","block");await Ee(L,x,a);const T=de(a);if(await _e(L,x,a),await ke(L,m,b,a,t),T){const E=T,N=Math.max(1,Math.round(.125*(E.width/E.height))),k=E.height+N+10,D=E.width+10,{useMaxWidth:y}=s;Ye(f,k,D,!!y),S.debug("Here Bounds",T,E),f.attr("viewBox",`${E.x-5} ${E.y-5} ${E.width+10} ${E.height+10}`)}},"draw"),js={draw:Ms,getClasses:zs},Ys={parser:fa,db:Oa,renderer:js,styles:za};export{Ys as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ah as o,ai as n}from"./main-Dnmo7KzM.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s,c as e,a as r,b as l}from"./chunk-T2TOU4HS-P78s0i18.js";import{_ as t}from"./main-Dnmo7KzM.js";import"./chunk-5HRBRIJM-TGnRph8o.js";var _={parser:l,db:r,renderer:e,styles:s,init:t(a=>{a.class||(a.class={}),a.class.arrowMarkerAbsolute=a.arrowMarkerAbsolute,r.clear()},"init")};export{_ as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s,c as e,a as r,b as l}from"./chunk-T2TOU4HS-P78s0i18.js";import{_ as t}from"./main-Dnmo7KzM.js";import"./chunk-5HRBRIJM-TGnRph8o.js";var _={parser:l,db:r,renderer:e,styles:s,init:t(a=>{a.class||(a.class={}),a.class.arrowMarkerAbsolute=a.arrowMarkerAbsolute,r.clear()},"init")};export{_ as diagram};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{_ as X,ak as F,al as Y,am as j,an as H,l as i,c as V,ao as q,ap as U,af as $,aq as z,ag as P,ae as K,ar as Q,as as W,at as Z}from"./main-Dnmo7KzM.js";import{i as x,G as B}from"./graph-BlwPajkw.js";import{b as L,m as A,l as I}from"./layout-Bvwu4dCi.js";var ee=4;function ne(e){return L(e,ee)}function N(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:te(e),edges:se(e)};return x(e.graph())||(t.value=ne(e.graph())),t}function te(e){return A(e.nodes(),function(t){var n=e.node(t),o=e.parent(t),c={v:t};return x(n)||(c.value=n),x(o)||(c.parent=o),c})}function se(e){return A(e.edges(),function(t){var n=e.edge(t),o={v:t.v,w:t.w};return x(t.name)||(o.name=t.name),x(n)||(o.value=n),o})}var f=new Map,p=new Map,G=new Map,ie=X(()=>{p.clear(),G.clear(),f.clear()},"clear"),O=X((e,t)=>{const n=p.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),re=X((e,t)=>{const n=p.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),J=X((e,t,n,o)=>{i.warn("Copying children of ",e,"root",o,"data",t.node(e),o);const c=t.children(e)||[];e!==o&&c.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",c),c.forEach(a=>{if(t.children(a).length>0)J(a,t,n,o);else{const r=t.node(a);i.info("cp ",a," to ",o," with parent ",e),n.setNode(a,r),o!==t.parent(a)&&(i.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==o&&a!==e?(i.debug("Setting parent",a,e),n.setParent(a,e)):(i.info("In copy ",e,"root",o,"data",t.node(e),o),i.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==o,"node!==clusterId",a!==e));const u=t.edges(a);i.debug("Copying Edges",u),u.forEach(l=>{i.info("Edge",l);const h=t.edge(l.v,l.w,l.name);i.info("Edge data",h,o);try{re(l,o)?(i.info("Copying as ",l.v,l.w,h,l.name),n.setEdge(l.v,l.w,h,l.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",o," clusterId:",e)}catch(C){i.error(C)}})}i.debug("Removing node",a),t.removeNode(a)})},"copy"),R=X((e,t)=>{const n=t.children(e);let o=[...n];for(const c of n)G.set(c,e),o=[...o,...R(c,t)];return o},"extractDescendants"),oe=X((e,t,n)=>{const o=e.edges().filter(l=>l.v===t||l.w===t),c=e.edges().filter(l=>l.v===n||l.w===n),a=o.map(l=>({v:l.v===t?n:l.v,w:l.w===t?t:l.w})),r=c.map(l=>({v:l.v,w:l.w}));return a.filter(l=>r.some(h=>l.v===h.v&&l.w===h.w))},"findCommonEdges"),D=X((e,t,n)=>{const o=t.children(e);if(i.trace("Searching children of id ",e,o),o.length<1)return e;let c;for(const a of o){const r=D(a,t,n),u=oe(t,n,r);if(r)if(u.length>0)c=r;else return r}return c},"findNonClusterChild"),k=X(e=>!f.has(e)||!f.get(e).externalConnections?e:f.has(e)?f.get(e).id:e,"getAnchorId"),ae=X((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),p.set(n,R(n,e)),f.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const o=e.children(n),c=e.edges();o.length>0?(i.debug("Cluster identified",n,p),c.forEach(a=>{const r=O(a.v,n),u=O(a.w,n);r^u&&(i.warn("Edge: ",a," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",p.get(n)),f.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,p)});for(let n of f.keys()){const o=f.get(n).id,c=e.parent(o);c!==n&&f.has(c)&&!f.get(c).externalConnections&&(f.get(n).id=c)}e.edges().forEach(function(n){const o=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let c=n.v,a=n.w;if(i.warn("Fix XXX",f,"ids:",n.v,n.w,"Translating: ",f.get(n.v)," --- ",f.get(n.w)),f.get(n.v)||f.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),c=k(n.v),a=k(n.w),e.removeEdge(n.v,n.w,n.name),c!==n.v){const r=e.parent(c);f.get(r).externalConnections=!0,o.fromCluster=n.v}if(a!==n.w){const r=e.parent(a);f.get(r).externalConnections=!0,o.toCluster=n.w}i.warn("Fix Replacing with XXX",c,a,n.name),e.setEdge(c,a,o,n.name)}}),i.warn("Adjusted Graph",N(e)),T(e,0),i.trace(f)},"adjustClustersAndEdges"),T=X((e,t)=>{var c,a;if(i.warn("extractor - ",t,N(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),o=!1;for(const r of n){const u=e.children(r);o=o||u.length>0}if(!o){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,f,f.has(r)&&!f.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!f.has(r))i.debug("Not a cluster",r,t);else if(!f.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";(a=(c=f.get(r))==null?void 0:c.clusterData)!=null&&a.dir&&(l=f.get(r).clusterData.dir,i.warn("Fixing dir",f.get(r).clusterData.dir,l));const h=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",N(e)),J(r,e,h,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:f.get(r).clusterData,label:f.get(r).label,graph:h}),i.warn("New graph after copy node: (",r,")",N(h)),i.debug("Old graph after copy",N(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!f.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(f);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const u=e.node(r);i.warn(" Now next level",r,u),u!=null&&u.clusterNode&&T(u.graph,t+1)}},"extractor"),M=X((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(o=>{const c=e.children(o),a=M(e,c);n=[...n,...a]}),n},"sorter"),ce=X(e=>M(e,e.children()),"sortNodesByHierarchy"),_=X(async(e,t,n,o,c,a)=>{i.warn("Graph in recursive render:XAX",N(t),c);const r=t.graph().rankdir;i.trace("Dir in recursive render - dir:",r);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const l=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),C=u.insert("g").attr("class","edgeLabels"),g=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(d){const s=t.node(d);if(c!==void 0){const m=JSON.parse(JSON.stringify(c.clusterData));i.trace(`Setting data for parent cluster XXX
|
|
2
|
-
Node.id = `,d,`
|
|
3
|
-
data=`,m.height,`
|
|
4
|
-
Parent cluster`,c.height),t.setNode(c.id,m),t.parent(d)||(i.trace("Setting parent",d,c.id),t.setParent(d,c.id,m))}if(i.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),s!=null&&s.clusterNode){i.info("Cluster identified XBX",d,s.width,t.node(d));const{ranksep:m,nodesep:v}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:m+25,nodesep:v});const b=await _(g,s.graph,n,o,t.node(d),a),S=b.elem;q(s,S),s.diff=b.diff||0,i.info("New compound node after recursive render XAX",d,"width",s.width,"height",s.height),U(S,s)}else t.children(d).length>0?(i.trace("Cluster - the non recursive path XBX",d,s.id,s,s.width,"Graph:",t),i.trace(D(s.id,t)),f.set(s.id,{id:D(s.id,t),node:s})):(i.trace("Node - the non recursive path XAX",d,g,t.node(d),r),await $(g,t.node(d),{config:a,dir:r}))})),await X(async()=>{const d=t.edges().map(async function(s){const m=t.edge(s.v,s.w,s.name);i.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),i.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),i.info("Fix",f,"ids:",s.v,s.w,"Translating: ",f.get(s.v),f.get(s.w)),await Z(C,m)});await Promise.all(d)},"processEdges")(),i.info("Graph before layout:",JSON.stringify(N(t))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),I(t),i.info("Graph after layout:",JSON.stringify(N(t)));let y=0,{subGraphTitleTotalMargin:E}=z(a);return await Promise.all(ce(t).map(async function(d){var m;const s=t.node(d);if(i.info("Position XBX => "+d+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s!=null&&s.clusterNode)s.y+=E,i.info("A tainted cluster node XBX1",d,s.id,s.width,s.height,s.x,s.y,t.parent(d)),f.get(s.id).node=s,P(s);else if(t.children(d).length>0){i.info("A pure cluster node XBX1",d,s.id,s.x,s.y,s.width,s.height,t.parent(d)),s.height+=E,t.node(s.parentId);const v=(s==null?void 0:s.padding)/2||0,b=((m=s==null?void 0:s.labelBBox)==null?void 0:m.height)||0,S=b-v||0;i.debug("OffsetY",S,"labelHeight",b,"halfPadding",v),await K(l,s),f.get(s.id).node=s}else{const v=t.node(s.parentId);s.y+=E/2,i.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",v,v==null?void 0:v.offsetY,s),P(s)}})),t.edges().forEach(function(d){const s=t.edge(d);i.info("Edge "+d.v+" -> "+d.w+": "+JSON.stringify(s),s),s.points.forEach(S=>S.y+=E/2);const m=t.node(d.v);var v=t.node(d.w);const b=Q(h,s,f,n,m,v,o);W(s,b)}),t.nodes().forEach(function(d){const s=t.node(d);i.info(d,s.type,s.diff),s.isGroup&&(y=s.diff)}),i.warn("Returning from recursive render XAX",u,y),{elem:u,diff:y}},"recursiveRender"),ue=X(async(e,t)=>{var a,r,u,l,h,C;const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((a=e.config)==null?void 0:a.nodeSpacing)||((u=(r=e.config)==null?void 0:r.flowchart)==null?void 0:u.nodeSpacing)||e.nodeSpacing,ranksep:((l=e.config)==null?void 0:l.rankSpacing)||((C=(h=e.config)==null?void 0:h.flowchart)==null?void 0:C.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),o=t.select("g");F(o,e.markers,e.type,e.diagramId),Y(),j(),H(),ie(),e.nodes.forEach(g=>{n.setNode(g.id,{...g}),g.parentId&&n.setParent(g.id,g.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(g=>{if(g.start===g.end){const w=g.start,y=w+"---"+w+"---1",E=w+"---"+w+"---2",d=n.node(w);n.setNode(y,{domId:y,id:y,parentId:d.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(y,d.parentId),n.setNode(E,{domId:E,id:E,parentId:d.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(E,d.parentId);const s=structuredClone(g),m=structuredClone(g),v=structuredClone(g);s.label="",s.arrowTypeEnd="none",s.id=w+"-cyclic-special-1",m.arrowTypeEnd="none",m.id=w+"-cyclic-special-mid",v.label="",d.isGroup&&(s.fromCluster=w,v.toCluster=w),v.id=w+"-cyclic-special-2",n.setEdge(w,y,s,w+"-cyclic-special-0"),n.setEdge(y,E,m,w+"-cyclic-special-1"),n.setEdge(E,w,v,w+"-cyc<lic-special-2")}else n.setEdge(g.start,g.end,{...g},g.id)}),i.warn("Graph at first:",JSON.stringify(N(n))),ae(n),i.warn("Graph after XAX:",JSON.stringify(N(n)));const c=V();await _(o,n,e.type,e.diagramId,void 0,c)},"render");export{ue as render};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{p as w}from"./chunk-TMUBEWPD-_9HBqU-T.js";import{s as B,g as S,n as F,o as z,a as P,b as W,_ as n,C as x,G as D,e as T,v as E,D as _,E as A,l as m}from"./main-Dnmo7KzM.js";import{p as N}from"./gitGraph-YCYPL57B-Zl60oDrh.js";var C={packet:[]},v=structuredClone(C),L=_.packet,Y=n(()=>{const t=x({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t},"getConfig"),G=n(()=>v.packet,"getPacket"),I=n(t=>{t.length>0&&v.packet.push(t)},"pushWord"),M=n(()=>{E(),v=structuredClone(C)},"clear"),h={pushWord:I,getPacket:G,getConfig:Y,clear:M,setAccTitle:W,getAccTitle:P,setDiagramTitle:z,getDiagramTitle:F,getAccDescription:S,setAccDescription:B},O=1e4,H=n(t=>{w(t,h);let e=-1,o=[],s=1;const{bitsPerRow:i}=h.getConfig();for(let{start:a,end:r,label:p}of t.blocks){if(r&&r<a)throw new Error(`Packet block ${a} - ${r} is invalid. End must be greater than start.`);if(a!==e+1)throw new Error(`Packet block ${a} - ${r??a} is not contiguous. It should start from ${e+1}.`);for(e=r??a,m.debug(`Packet block ${a} - ${e} with label ${p}`);o.length<=i+1&&h.getPacket().length<O;){const[b,c]=K({start:a,end:r,label:p},s,i);if(o.push(b),b.end+1===s*i&&(h.pushWord(o),o=[],s++),!c)break;({start:a,end:r,label:p}=c)}}h.pushWord(o)},"populate"),K=n((t,e,o)=>{if(t.end===void 0&&(t.end=t.start),t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);return t.end+1<=e*o?[t,void 0]:[{start:t.start,end:e*o-1,label:t.label},{start:e*o,end:t.end,label:t.label}]},"getNextFittingBlock"),R={parse:n(async t=>{const e=await N("packet",t);m.debug(e),H(e)},"parse")},U=n((t,e,o,s)=>{const i=s.db,a=i.getConfig(),{rowHeight:r,paddingY:p,bitWidth:b,bitsPerRow:c}=a,u=i.getPacket(),l=i.getDiagramTitle(),g=r+p,d=g*(u.length+1)-(l?0:r),k=b*c+2,f=D(e);f.attr("viewbox",`0 0 ${k} ${d}`),T(f,d,k,a.useMaxWidth);for(const[$,y]of u.entries())X(f,y,$,a);f.append("text").text(l).attr("x",k/2).attr("y",d-g/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),X=n((t,e,o,{rowHeight:s,paddingX:i,paddingY:a,bitWidth:r,bitsPerRow:p,showBits:b})=>{const c=t.append("g"),u=o*(s+a)+a;for(const l of e){const g=l.start%p*r+1,d=(l.end-l.start+1)*r-i;if(c.append("rect").attr("x",g).attr("y",u).attr("width",d).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",g+d/2).attr("y",u+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(l.label),!b)continue;const k=l.end===l.start,f=u-2;c.append("text").attr("x",g+(k?d/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(l.start),k||c.append("text").attr("x",g+d).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(l.end)}},"drawWord"),j={draw:U},q={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},J=n(({packet:t}={})=>{const e=x(q,t);return`
|
|
2
|
-
.packetByte {
|
|
3
|
-
font-size: ${e.byteFontSize};
|
|
4
|
-
}
|
|
5
|
-
.packetByte.start {
|
|
6
|
-
fill: ${e.startByteColor};
|
|
7
|
-
}
|
|
8
|
-
.packetByte.end {
|
|
9
|
-
fill: ${e.endByteColor};
|
|
10
|
-
}
|
|
11
|
-
.packetLabel {
|
|
12
|
-
fill: ${e.labelColor};
|
|
13
|
-
font-size: ${e.labelFontSize};
|
|
14
|
-
}
|
|
15
|
-
.packetTitle {
|
|
16
|
-
fill: ${e.titleColor};
|
|
17
|
-
font-size: ${e.titleFontSize};
|
|
18
|
-
}
|
|
19
|
-
.packetBlock {
|
|
20
|
-
stroke: ${e.blockStrokeColor};
|
|
21
|
-
stroke-width: ${e.blockStrokeWidth};
|
|
22
|
-
fill: ${e.blockFillColor};
|
|
23
|
-
}
|
|
24
|
-
`},"styles"),tt={parser:R,db:h,renderer:j,styles:J};export{tt as diagram};
|