@dawipong/opcflow 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +17 -11
- package/README.md +16 -10
- package/dist/cli.mjs +4 -5
- package/package.json +8 -7
- package/web/dist/assets/abnfDiagram-VRR7QNED-DctuL32B.js +1 -0
- package/web/dist/assets/arc-DPoWLLje.js +1 -0
- package/web/dist/assets/architecture-TIHT7OUA-Bgyz4pDY.js +1 -0
- package/web/dist/assets/architectureDiagram-ZJ3FMSHR--07w7V0c.js +36 -0
- package/web/dist/assets/array-BifhSqXX.js +1 -0
- package/web/dist/assets/blockDiagram-677ZJIJ3-CUYUzMZC.js +132 -0
- package/web/dist/assets/c4Diagram-LMCZKHZV-DhT2uxnj.js +10 -0
- package/web/dist/assets/channel-vHKEEV51.js +1 -0
- package/web/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/web/dist/assets/chunk-32BRIVSS-CztnJRkA.js +1 -0
- package/web/dist/assets/{chunk-5VM5RSS4-BfNutGrI.js → chunk-5VM5RSS4-ZNzvKenW.js} +2 -2
- package/web/dist/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
- package/web/dist/assets/chunk-C7G6YPKG-jsbUGVSb.js +1 -0
- package/web/dist/assets/chunk-EX3LRPZG-DQGT_sG5.js +231 -0
- package/web/dist/assets/chunk-HOUHSVGY-DDAtZMtg.js +1 -0
- package/web/dist/assets/chunk-ICXQ74PX-C2h9d1ob.js +2 -0
- package/web/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/web/dist/assets/chunk-KEIR6QF5-BfrZ3jm6.js +161 -0
- package/web/dist/assets/chunk-MOJQB5TN-Y0jSjq4a.js +88 -0
- package/web/dist/assets/chunk-OGEWGWER-B5mrusUD.js +1 -0
- package/web/dist/assets/chunk-PUDLZKDR-pSIk3CZr.js +156 -0
- package/web/dist/assets/chunk-Q4XR5HBZ-Cfw3UWMb.js +70 -0
- package/web/dist/assets/chunk-RYQCIY6F-CCUojmgb.js +1 -0
- package/web/dist/assets/chunk-V7JOEXUC-D_2vwCJz.js +206 -0
- package/web/dist/assets/chunk-VR4S4FIN-CUMv178C.js +1 -0
- package/web/dist/assets/chunk-WYO6CB5R-BaRUDpDl.js +127 -0
- package/web/dist/assets/chunk-XXDRQBXY-tmq33VNh.js +1 -0
- package/web/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/web/dist/assets/chunk-ZGVPDNZ5-DK9a-Iwy.js +62 -0
- package/web/dist/assets/classDiagram-OUVF2IWQ-Ckf-YAkB.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-Ckf-YAkB.js +1 -0
- package/web/dist/assets/cose-bilkent-JH36ORCC-BV8ttTSE.js +1 -0
- package/web/dist/assets/cynefin-VYW2F7L2-BncvlU8s.js +1 -0
- package/web/dist/assets/cynefinDiagram-TSTJHNR4-CtVxnYLa.js +62 -0
- package/web/dist/assets/cytoscape.esm-B3I8pqwA.js +321 -0
- package/web/dist/assets/dagre-CXRCoUWR.js +1 -0
- package/web/dist/assets/dagre-VKFMJZFB-CbAaKbWe.js +4 -0
- package/web/dist/assets/defaultLocale-C8Fc0cco.js +1 -0
- package/web/dist/assets/diagram-FQU43EPY-DkeAFpQM.js +3 -0
- package/web/dist/assets/diagram-G47NLZAW-BdfPbsL1.js +24 -0
- package/web/dist/assets/diagram-NH7WQ7WH-wWIYA2VS.js +24 -0
- package/web/dist/assets/diagram-OA4YK3LP-Chx7_D6X.js +30 -0
- package/web/dist/assets/diagram-WEI45ONY-DxAoHRrP.js +41 -0
- package/web/dist/assets/dist-zlHGdC4Y.js +1 -0
- package/web/dist/assets/ebnfDiagram-CCIWWBDH-DcnWNqZc.js +1 -0
- package/web/dist/assets/erDiagram-Q63AITRT-BX0XqX5B.js +85 -0
- package/web/dist/assets/eventmodeling-45OFAUF4-CA5_fuzk.js +1 -0
- package/web/dist/assets/flowDiagram-23GEKE2U-DL5kTdXb.js +1 -0
- package/web/dist/assets/ganttDiagram-NO4QXBWP-CFmDEUpW.js +292 -0
- package/web/dist/assets/gitGraph-TEB2WS4Q-BiEBwxQy.js +1 -0
- package/web/dist/assets/gitGraphDiagram-IHSO6WYX--62v4OfD.js +106 -0
- package/web/dist/assets/graphlib-B8gBHxth.js +1 -0
- package/web/dist/assets/index-BUs4sN1r.css +1 -0
- package/web/dist/assets/index-DVXPy-Pj.js +414 -0
- package/web/dist/assets/info-DKCQHKI2-BLKxCcH7.js +1 -0
- package/web/dist/assets/infoDiagram-FWYZ7A6U-BnrcoE4X.js +2 -0
- package/web/dist/assets/init-D6jRqBbL.js +1 -0
- package/web/dist/assets/ishikawaDiagram-FXEZZL3T-BuUSROzL.js +70 -0
- package/web/dist/assets/journeyDiagram-5HDEW3XC-CsPvawEB.js +139 -0
- package/web/dist/assets/kanban-definition-HUTT4EX6-hCokh58u.js +89 -0
- package/web/dist/assets/katex-CddkPoXu.js +257 -0
- package/web/dist/assets/line-CE9BvxIa.js +1 -0
- package/web/dist/assets/linear-B8yeZliB.js +1 -0
- package/web/dist/assets/map-DsCK-0Cs.js +1 -0
- package/web/dist/assets/mermaid-parser.core-CAAH_OSq.js +7 -0
- package/web/dist/assets/mindmap-definition-LN4V7U3C-plfH1Ve5.js +96 -0
- package/web/dist/assets/ordinal-hYBb2elL.js +1 -0
- package/web/dist/assets/packet-7NZHBO7P-ap_XD9pB.js +1 -0
- package/web/dist/assets/path-BWPyau1x.js +1 -0
- package/web/dist/assets/pegDiagram-2B236MQR-DpbGacSD.js +1 -0
- package/web/dist/assets/pie-RZYD4A2V-C7RWGzoe.js +1 -0
- package/web/dist/assets/pieDiagram-ENE6RG2P-DsEjdRIW.js +39 -0
- package/web/dist/assets/quadrantDiagram-ABIIQ3AL-CotpR7ZY.js +7 -0
- package/web/dist/assets/radar-I7S5WNFK-D8ICPnt1.js +1 -0
- package/web/dist/assets/railroad-3IZDKUUU-B7ZJ3IRr.js +1 -0
- package/web/dist/assets/railroad-abnf-AHOZXSZD-uSXjMlP2.js +1 -0
- package/web/dist/assets/railroad-ebnf-EBAXGLYW-9im8bOEZ.js +1 -0
- package/web/dist/assets/railroad-peg-LSFZ7HO6-62Yk_rP2.js +1 -0
- package/web/dist/assets/railroadDiagram-RFXS5EU6-C9kLSHvN.js +1 -0
- package/web/dist/assets/requirementDiagram-TGXJPOKE-BslCStWL.js +84 -0
- package/web/dist/assets/rough.esm-CSKSodPl.js +1 -0
- package/web/dist/assets/sankeyDiagram-HTMAVEWB-9CV0aY5J.js +40 -0
- package/web/dist/assets/sequenceDiagram-DBY2YBRQ-Cg8Nc-TM.js +162 -0
- package/web/dist/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
- package/web/dist/assets/src-W4W9ly-y.js +1 -0
- package/web/dist/assets/stateDiagram-2N3HPSRC-DB4TsO7Z.js +1 -0
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-SUHVLdPI.js +1 -0
- package/web/dist/assets/swimlanes-5IMT3BWC-CgeBbl6U.js +2 -0
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BfFfe5gc.js +8 -0
- package/web/dist/assets/timeline-definition-FHXFAJF6-BRSnucVn.js +120 -0
- package/web/dist/assets/treeView-QDETBFTQ-lUySd_Pd.js +1 -0
- package/web/dist/assets/treemap-6X3UGDF4-BewRw9PG.js +1 -0
- package/web/dist/assets/vennDiagram-L72KCM5P-gearbXh2.js +34 -0
- package/web/dist/assets/wardley-OPB4EBWU-BCrrgDHP.js +1 -0
- package/web/dist/assets/wardleyDiagram-EHGQE667-DBWn9RRb.js +78 -0
- package/web/dist/assets/xychartDiagram-FW5EYKEG-CUL1Ijyf.js +7 -0
- package/web/dist/index.html +17 -2
- package/web/dist/assets/abnfDiagram-VRR7QNED-CM_SmMdS.js +0 -1
- package/web/dist/assets/arc-a2d6VGyS.js +0 -1
- package/web/dist/assets/architectureDiagram-ZJ3FMSHR-CKwso5u1.js +0 -36
- package/web/dist/assets/blockDiagram-677ZJIJ3-DOlRPtCE.js +0 -132
- package/web/dist/assets/c4Diagram-LMCZKHZV-BVWP4jKU.js +0 -10
- package/web/dist/assets/channel-Bv2v5Ka7.js +0 -1
- package/web/dist/assets/chunk-2Q5K7J3B-Dg1gXqD_.js +0 -1
- package/web/dist/assets/chunk-32BRIVSS-DMEBIyv0.js +0 -1
- package/web/dist/assets/chunk-EX3LRPZG-B0LUaNef.js +0 -231
- package/web/dist/assets/chunk-JWPE2WC7-RWpAfnwW.js +0 -1
- package/web/dist/assets/chunk-MOJQB5TN-CHzjH2SN.js +0 -88
- package/web/dist/assets/chunk-RYQCIY6F-CB84H40n.js +0 -1
- package/web/dist/assets/chunk-V7JOEXUC-hDfVeloC.js +0 -206
- package/web/dist/assets/chunk-VR4S4FIN-C-ISU9mB.js +0 -1
- package/web/dist/assets/chunk-XXDRQBXY-Q-1uA8_v.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-C5GMtsqN.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-C5GMtsqN.js +0 -1
- package/web/dist/assets/cose-bilkent-JH36ORCC-D4aRsqbg.js +0 -1
- package/web/dist/assets/cynefin-VYW2F7L2-Bb_blZYP.js +0 -166
- package/web/dist/assets/cynefinDiagram-TSTJHNR4-CRX9tSwx.js +0 -62
- package/web/dist/assets/cytoscape.esm-D3_iZ_3b.js +0 -321
- package/web/dist/assets/dagre-VKFMJZFB-BHcw1uwS.js +0 -4
- package/web/dist/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/web/dist/assets/diagram-FQU43EPY-BbFIcSGy.js +0 -3
- package/web/dist/assets/diagram-G47NLZAW-D6SEnl9Y.js +0 -24
- package/web/dist/assets/diagram-NH7WQ7WH-Dq4ObETB.js +0 -24
- package/web/dist/assets/diagram-OA4YK3LP-EF9zUKb4.js +0 -30
- package/web/dist/assets/diagram-WEI45ONY-9MSuI1lJ.js +0 -41
- package/web/dist/assets/ebnfDiagram-CCIWWBDH-BKTvNs-v.js +0 -1
- package/web/dist/assets/erDiagram-Q63AITRT-BRZ7eOih.js +0 -85
- package/web/dist/assets/flowDiagram-23GEKE2U-n6RjlBIU.js +0 -156
- package/web/dist/assets/ganttDiagram-NO4QXBWP-DJ8LFx2q.js +0 -292
- package/web/dist/assets/gitGraphDiagram-IHSO6WYX-PBNVnu__.js +0 -106
- package/web/dist/assets/graph-DOmOIIwC.js +0 -1
- package/web/dist/assets/index-BkpgTe8Q.js +0 -674
- package/web/dist/assets/index-CfSIxCYt.css +0 -1
- package/web/dist/assets/infoDiagram-FWYZ7A6U-DpF1ykim.js +0 -2
- package/web/dist/assets/init-Gi6I4Gst.js +0 -1
- package/web/dist/assets/ishikawaDiagram-FXEZZL3T-BcLaz8vn.js +0 -70
- package/web/dist/assets/journeyDiagram-5HDEW3XC-DhDa2tr6.js +0 -139
- package/web/dist/assets/kanban-definition-HUTT4EX6-Cj5MBccm.js +0 -89
- package/web/dist/assets/katex-HP8lGamR.js +0 -257
- package/web/dist/assets/layout-D-LzfAck.js +0 -1
- package/web/dist/assets/linear-D-RAQuF7.js +0 -1
- package/web/dist/assets/map-DxJ2ADlA.js +0 -1
- package/web/dist/assets/mindmap-definition-LN4V7U3C-CDHapI3O.js +0 -96
- package/web/dist/assets/ordinal-Cboi1Yqb.js +0 -1
- package/web/dist/assets/pegDiagram-2B236MQR-Cga1GKF6.js +0 -1
- package/web/dist/assets/pieDiagram-ENE6RG2P-BtzEbqHl.js +0 -39
- package/web/dist/assets/quadrantDiagram-ABIIQ3AL-CMHXJPd5.js +0 -7
- package/web/dist/assets/railroadDiagram-RFXS5EU6-C5dKOd7a.js +0 -1
- package/web/dist/assets/requirementDiagram-TGXJPOKE-Cjx6LPCa.js +0 -84
- package/web/dist/assets/sankeyDiagram-HTMAVEWB-C8kzAycX.js +0 -40
- package/web/dist/assets/sequenceDiagram-DBY2YBRQ-DwEDppgS.js +0 -162
- package/web/dist/assets/sizeCapture-X5ZJPWSS-CUgsJ-ry.js +0 -1
- package/web/dist/assets/stateDiagram-2N3HPSRC-B4fcb7Qa.js +0 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-IQXX7rVH.js +0 -1
- package/web/dist/assets/swimlanes-5IMT3BWC-Bw27O3PP.js +0 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-DRko3G58.js +0 -8
- package/web/dist/assets/timeline-definition-FHXFAJF6-Cra4Bj9n.js +0 -120
- package/web/dist/assets/vennDiagram-L72KCM5P-B_Nmy9aH.js +0 -34
- package/web/dist/assets/wardleyDiagram-EHGQE667-BE1omAzb.js +0 -78
- package/web/dist/assets/xychartDiagram-FW5EYKEG-CsNs1p2c.js +0 -7
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-CB84H40n.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ae as j,as as q,af as R,ad as F,at as z,au as K,av as G}from"./index-BkpgTe8Q.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,y,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==y&&r.add(i),n!==y&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,y=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(y,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",y=0,c={})=>{const r=s.x,f=s.y-y,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const y=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;y.has(h)||y.set(h,[]),y.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),y.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},m=Z(s,n,r,i.start,o),X=ee(n,m,t,p.width??0),S=te(n,X,m,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,y,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX
|
|
2
|
-
Node.id = `,d,`
|
|
3
|
-
data=`,u.height,`
|
|
4
|
-
Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,y,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,y);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),ae=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),y=t.select("g");v(y,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),m=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},m.originalEdge=i,m.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",m.label="",m.startLabelRight="",m.startLabelLeft="",m.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,m.toCluster=r),m.id=r+"-cyclic-special-2",m.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,m,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(y,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,ae as render};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function J(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function j(n,t){if(!isFinite(n)||n===0)return null;var e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"),i=n.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+n.slice(e+1)]}function K(n){return n=j(Math.abs(n)),n?n[1]:NaN}function Q(n,t){return function(e,i){for(var o=e.length,a=[],c=0,h=n[0],M=0;o>0&&h>0&&(M+h+1>i&&(h=Math.max(1,i-M)),a.push(e.substring(o-=h,o+h)),!((M+=h+1)>i));)h=n[c=(c+1)%n.length];return a.reverse().join(t)}}function V(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $(n){if(!(t=W.exec(n)))throw new Error("invalid format: "+n);var t;return new L({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$.prototype=L.prototype;function L(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}L.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _(n){n:for(var t=n.length,e=1,i=-1,o;e<t;++e)switch(n[e]){case".":i=o=e;break;case"0":i===0&&(i=e),o=e;break;default:if(!+n[e])break n;i>0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(o+1):n}var N;function v(n,t){var e=j(n,t);if(!e)return N=void 0,n.toPrecision(t);var i=e[0],o=e[1],a=o-(N=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,c=i.length;return a===c?i:a>c?i+new Array(a-c+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+j(n,Math.max(0,t+a-1))[0]}function X(n,t){var e=j(n,t);if(!e)return n+"";var i=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}const O={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:J,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>X(n*100,t),r:X,s:v,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function R(n){return n}var U=Array.prototype.map,Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nn(n){var t=n.grouping===void 0||n.thousands===void 0?R:Q(U.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",o=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?R:V(U.call(n.numerals,String)),c=n.percent===void 0?"%":n.percent+"",h=n.minus===void 0?"−":n.minus+"",M=n.nan===void 0?"NaN":n.nan+"";function T(f,g){f=$(f);var b=f.fill,p=f.align,m=f.sign,w=f.symbol,S=f.zero,E=f.width,F=f.comma,y=f.precision,C=f.trim,d=f.type;d==="n"?(F=!0,d="g"):O[d]||(y===void 0&&(y=12),C=!0,d="g"),(S||b==="0"&&p==="=")&&(S=!0,b="0",p="=");var q=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?e:w==="#"&&/[boxX]/.test(d)?"0"+d.toLowerCase():""),B=(w==="$"?i:/[%p]/.test(d)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),D=O[d],H=/[defgprs%]/.test(d);y=y===void 0?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function G(r){var l=q,u=B,x,I,k;if(d==="c")u=D(r)+u,r="";else{r=+r;var P=r<0||1/r<0;if(r=isNaN(r)?M:D(Math.abs(r),y),C&&(r=_(r)),P&&+r==0&&m!=="+"&&(P=!1),l=(P?m==="("?m:h:m==="-"||m==="("?"":m)+l,u=(d==="s"&&!isNaN(r)&&N!==void 0?Y[8+N/3]:"")+u+(P&&m==="("?")":""),H){for(x=-1,I=r.length;++x<I;)if(k=r.charCodeAt(x),48>k||k>57){u=(k===46?o+r.slice(x+1):r.slice(x))+u,r=r.slice(0,x);break}}}F&&!S&&(r=t(r,1/0));var z=l.length+r.length+u.length,s=z<E?new Array(E-z+1).join(b):"";switch(F&&S&&(r=t(s+r,s.length?E-u.length:1/0),s=""),p){case"<":r=l+r+u+s;break;case"=":r=l+s+r+u;break;case"^":r=s.slice(0,z=s.length>>1)+l+r+u+s.slice(z);break;default:r=s+l+r+u;break}return a(r)}return G.toString=function(){return f+""},G}function Z(f,g){var b=Math.max(-8,Math.min(8,Math.floor(K(g)/3)))*3,p=Math.pow(10,-b),m=T((f=$(f),f.type="f",f),{suffix:Y[8+b/3]});return function(w){return m(p*w)}}return{format:T,formatPrefix:Z}}var A,tn,rn;en({thousands:",",grouping:[3],currency:["$",""]});function en(n){return A=nn(n),tn=A.format,rn=A.formatPrefix,A}export{rn as a,tn as b,K as e,$ as f};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{p as re}from"./chunk-JWPE2WC7-RWpAfnwW.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./index-BkpgTe8Q.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-Bb_blZYP.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${P(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
|
-
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const w=f[p],R=f[p-1];w.y=R.y+R.height+s.swimlaneGap}return h}o(Y,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
|
|
3
|
-
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,We={parser:Ee,db:F,renderer:$e,styles:Ne};export{We as diagram};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{p as ge}from"./chunk-JWPE2WC7-RWpAfnwW.js";import{_ as w,E as ye,y as ae,A as ee,D as Se,e as ve,l as te,bg as B,d as U,b as xe,a as be,n as we,o as Ce,g as Te,s as Le,B as $e,bh as Ae,p as Fe}from"./index-BkpgTe8Q.js";import{s as Ne}from"./chunk-VR4S4FIN-C-ISU9mB.js";import{p as Me}from"./cynefin-VYW2F7L2-Bb_blZYP.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as Q}from"./ordinal-Cboi1Yqb.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],s,i,h=-1;l=n.pop();)if(t.call(a,l,++h,this),s=l.children)for(i=s.length-1;i>=0;--i)n.push(s[i]);return this}function De(t,a){for(var l=this,n=[l],s=[],i,h,d,g=-1;l=n.pop();)if(s.push(l),i=l.children)for(h=0,d=i.length;h<d;++h)n.push(i[h]);for(;l=s.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,s=n&&n.length;--s>=0;)l+=n[s].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var s=n.length;t!==l;)n.splice(s,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),s=null;for(t=l.pop(),a=n.pop();t===a;)s=t,t=l.pop(),a=n.pop();return s}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ge(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*qe(){var t=this,a,l=[t],n,s,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(s=0,i=n.length;s<i;++s)l.push(n[s]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=je)):a===void 0&&(a=Ye);for(var l=new Z(t),n,s=[l],i,h,d,g;n=s.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)s.push(i=h[d]=new Z(h[d])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ze)}function Xe(){return ne(this).eachBefore(Ue)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Ue(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ze(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Z(t){this.data=t,this.depth=this.height=0,this.parent=null}Z.prototype=ne.prototype={constructor:Z,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:Ge,copy:Xe,[Symbol.iterator]:qe};function Je(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qe(t,a,l,n,s){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(n-a)/t.value;++d<g;)h=i[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,s){for(var i=t.children,h,d=-1,g=i.length,c=t.value&&(s-l)/t.value;++d<g;)h=i[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,s,i){for(var h=[],d=a.children,g,c,p=0,b=0,r=d.length,x,S,v=a.value,u,y,N,$,V,W,M;p<r;){x=s-l,S=i-n;do u=d[b++].value;while(!u&&b<r);for(y=N=u,W=Math.max(S/x,x/S)/(v*t),M=u*u*W,V=Math.max(N/M,M/y);b<r;++b){if(u+=c=d[b].value,c<y&&(y=c),c>N&&(N=c),M=u*u*W,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Qe(g,l,n,s,v?n+=S*u/v:i):et(g,l,n,v?l+=x*u/v:s,i),v-=u,p=b}return h}const nt=(function t(a){function l(n,s,i,h,d){at(a,n,s,i,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(tt);function lt(){var t=nt,a=!1,l=1,n=1,s=[0],i=G,h=G,d=G,g=G,c=G;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(b),s=[0],a&&r.eachBefore(Ke),r}function b(r){var x=s[r.depth],S=r.x0+x,v=r.y0+x,u=r.x1-x,y=r.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),r.x0=S,r.y0=v,r.x1=u,r.y1=y,r.children&&(x=s[r.depth+1]=i(r)/2,S+=c(r)-x,v+=h(r)-x,u-=d(r)-x,y-=g(r)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(r,S,v,u,y))}return p.round=function(r){return arguments.length?(a=!!r,p):a},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(t=Je(r),p):t},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(i=typeof r=="function"?r:q(+r),p):i},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(h=typeof r=="function"?r:q(+r),p):h},p.paddingRight=function(r){return arguments.length?(d=typeof r=="function"?r:q(+r),p):d},p.paddingBottom=function(r){return arguments.length?(g=typeof r=="function"?r:q(+r),p):g},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:q(+r),p):c},p}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},s=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");s&&s.forEach(i=>{Ae(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const s={name:n.name,children:n.type==="Leaf"?void 0:[]};for(s.classSelector=n?.classSelector,n?.cssCompiledStyles&&(s.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(s.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(s);else{const i=l[l.length-1].node;i.children?i.children.push(s):i.children=[s]}n.type!=="Leaf"&&l.push({node:s,level:n.level})}),a}w(ce,"buildHierarchy");var st=w((t,a)=>{ge(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const h=i.item;if(!h)continue;const d=i.indent?parseInt(i.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),s=w((i,h)=>{for(const d of i)a.addNode(d,h),d.children&&d.children.length>0&&s(d.children,h+1)},"addNodesRecursively");s(n,0)},"populate"),rt=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{try{const l=await Me("treemap",t);te.debug("Treemap AST:",l);const n=he.parser?.yy;if(!(n instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");st(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const s=n.db,i=s.getConfig(),h=i.padding??it,d=s.getDiagramTitle(),g=s.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),r=i.nodeWidth?i.nodeWidth*E:960,x=i.nodeHeight?i.nodeHeight*E:500,S=r,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,i.useMaxWidth);let u;try{const e=i.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=Q().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=Q().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=Q().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([r,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=U(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=o.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text("..."),_.getComputedTextLength()>m&&o.text("");break}if(o.text(z+"..."),_.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const se=le.leaves(),A=se.length>20,pe=A?16:38,Y=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,re=A?8:10,K=A?1:2,j=V.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+$(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=U(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*J,P=C-2*J;if(T<re||P<re){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const _=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let F=Math.max(I,Math.min(Y,Math.round(m*_))),k=m+K+F;for(;k>P&&m>D&&(m--,F=Math.max(I,Math.min(Y,Math.round(m*_))),!(F<I&&m===D));)o.style("font-size",`${m}px`),k=m+K+F;o.style("font-size",`${m}px`),A?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),i.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+$(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=U(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=U(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(o.y1-o.y0)/2+T/2+K;f.attr("y",F);const k=o.x1-o.x0,ie=o.y1-o.y0-4,me=k-2*J;f.node().getComputedTextLength()>me||F+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=i.diagramPadding??8;Ne(b,ue,"flowchart",i?.useMaxWidth||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),s=ee(dt,t),i=s.titleColor??n.titleColor,h=s.labelColor??n.textColor,d=s.valueColor??n.textColor;return`
|
|
2
|
-
.treemapNode.section {
|
|
3
|
-
stroke: ${s.sectionStrokeColor};
|
|
4
|
-
stroke-width: ${s.sectionStrokeWidth};
|
|
5
|
-
fill: ${s.sectionFillColor};
|
|
6
|
-
}
|
|
7
|
-
.treemapNode.leaf {
|
|
8
|
-
stroke: ${s.leafStrokeColor};
|
|
9
|
-
stroke-width: ${s.leafStrokeWidth};
|
|
10
|
-
fill: ${s.leafFillColor};
|
|
11
|
-
}
|
|
12
|
-
.treemapLabel {
|
|
13
|
-
fill: ${h};
|
|
14
|
-
font-size: ${s.labelFontSize};
|
|
15
|
-
}
|
|
16
|
-
.treemapValue {
|
|
17
|
-
fill: ${d};
|
|
18
|
-
font-size: ${s.valueFontSize};
|
|
19
|
-
}
|
|
20
|
-
.treemapTitle {
|
|
21
|
-
fill: ${i};
|
|
22
|
-
font-size: ${s.titleFontSize};
|
|
23
|
-
}
|
|
24
|
-
`},"getStyles"),ut=pt,wt={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{wt as diagram};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{p as $}from"./chunk-JWPE2WC7-RWpAfnwW.js";import{_ as b,A as m,D as C,e as S,l as w,b as D,a as T,n as P,o as z,g as A,s as E,y as F,B as W,p as _}from"./index-BkpgTe8Q.js";import{p as N}from"./cynefin-VYW2F7L2-Bb_blZYP.js";var L=W.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=D,this.getAccTitle=T,this.setDiagramTitle=P,this.getDiagramTitle=z,this.getAccDescription=A,this.setAccDescription=E}getConfig(){const t=m({...L,...F().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){_(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{$(e,t);let r=-1,s=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&t.getPacket().length<M;){const[p,o]=I({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(t.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(s)},"populate"),I=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,n=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},O=b((e,t,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=C(t);f.attr("viewBox",`0 0 ${k} ${g}`),S(f,g,k,l.useMaxWidth);for(const[y,B]of p.entries())j(f,B,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=b((e,t,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(s+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),G={draw:O},H={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},K=b(({packet:e}={})=>{const t=m(H,e);return`
|
|
2
|
-
.packetByte {
|
|
3
|
-
font-size: ${t.byteFontSize};
|
|
4
|
-
}
|
|
5
|
-
.packetByte.start {
|
|
6
|
-
fill: ${t.startByteColor};
|
|
7
|
-
}
|
|
8
|
-
.packetByte.end {
|
|
9
|
-
fill: ${t.endByteColor};
|
|
10
|
-
}
|
|
11
|
-
.packetLabel {
|
|
12
|
-
fill: ${t.labelColor};
|
|
13
|
-
font-size: ${t.labelFontSize};
|
|
14
|
-
}
|
|
15
|
-
.packetTitle {
|
|
16
|
-
fill: ${t.titleColor};
|
|
17
|
-
font-size: ${t.titleFontSize};
|
|
18
|
-
}
|
|
19
|
-
.packetBlock {
|
|
20
|
-
stroke: ${t.blockStrokeColor};
|
|
21
|
-
stroke-width: ${t.blockStrokeWidth};
|
|
22
|
-
fill: ${t.blockFillColor};
|
|
23
|
-
}
|
|
24
|
-
`},"styles"),q={parser:x,get db(){return new v},renderer:G,styles:K};export{q as diagram};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{I as X}from"./chunk-2Q5K7J3B-Dg1gXqD_.js";import{p as O}from"./chunk-JWPE2WC7-RWpAfnwW.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./index-BkpgTe8Q.js";import{p as ne}from"./cynefin-VYW2F7L2-Bb_blZYP.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(`
|
|
2
|
-
`),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s<e.length;s++){const o=e[s];o.trim()===""||k.test(o)||$.test(o)||V.test(o)||i.push(o.replace(/\t/g," "))}if(!L(i))return{text:n,lineMap:t};const a=_(i),c=[];let l=0;for(let s=0;s<=r;s++)c.push(e[s]),l++,t.set(l,s+1);for(let s=r+1;s<e.length;s++){const o=e[s],h=o.trim(),p=s+1;if(h===""){c.push(o),l++,t.set(l,p);continue}if(k.test(o)){c.push(o),l++,t.set(l,p);continue}if($.test(o)){c.push(o),l++,t.set(l,p);continue}if(V.test(o))continue;const d=o.replace(/\t/g," "),w=S.exec(d);if(w?.index!==void 0){const g=w.index,m=Math.round(g/a)+1;let u=g+1;for(;u<d.length&&re.test(d[u]);)u++;for(;u<d.length&&d[u]===" ";)u++;const v=d.slice(u).trimEnd();if(!v)throw new Error(`Line ${p}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=ie.repeat(m);c.push(W+v),l++,t.set(l,p)}else{if(/^[\s─━│┃└┗├┣]+$/.test(d))continue;if(E.test(d))c.push(o),l++,t.set(l,p);else{if(/^\s+/.test(d))throw new Error(`Line ${p}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);c.push(o),l++,t.set(l,p)}}}return{text:c.join(`
|
|
3
|
-
`),lineMap:t}}f(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram
|
|
4
|
-
`+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return`
|
|
5
|
-
.treeView-node-label {
|
|
6
|
-
font-size: ${e};
|
|
7
|
-
fill: ${t};
|
|
8
|
-
white-space: pre;
|
|
9
|
-
}
|
|
10
|
-
.treeView-node-dir {
|
|
11
|
-
font-weight: bold;
|
|
12
|
-
}
|
|
13
|
-
.treeView-node-line {
|
|
14
|
-
stroke: ${r};
|
|
15
|
-
}
|
|
16
|
-
.treeView-node-icon {
|
|
17
|
-
color: ${i};
|
|
18
|
-
}
|
|
19
|
-
.treeView-node-description {
|
|
20
|
-
font-size: ${e};
|
|
21
|
-
fill: ${a};
|
|
22
|
-
font-style: italic;
|
|
23
|
-
white-space: pre;
|
|
24
|
-
}
|
|
25
|
-
.treeView-highlight-bg {
|
|
26
|
-
fill: ${c};
|
|
27
|
-
stroke: ${l};
|
|
28
|
-
stroke-width: 1;
|
|
29
|
-
}
|
|
30
|
-
`},"styles"),Be=ye,Ae={db:I,renderer:Ie,parser:fe,styles:Be};export{Ae as diagram};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{p as k}from"./chunk-JWPE2WC7-RWpAfnwW.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./index-BkpgTe8Q.js";import{p as H}from"./cynefin-VYW2F7L2-Bb_blZYP.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:h},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??h.showLegend,ticks:t.ticks?.value??h.ticks,max:t.max?.value??h.max,min:t.min?.value??h.min,graticule:t.graticule?.value??h.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),m=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,m,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),m=n*Math.sin(u);return`${g},${m}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,m)=>{const v=2*Math.PI*m/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
|
2
|
-
.radarCurve-${r} {
|
|
3
|
-
color: ${s};
|
|
4
|
-
fill: ${s};
|
|
5
|
-
fill-opacity: ${t.curveOpacity};
|
|
6
|
-
stroke: ${s};
|
|
7
|
-
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
-
}
|
|
9
|
-
.radarLegendBox-${r} {
|
|
10
|
-
fill: ${s};
|
|
11
|
-
fill-opacity: ${t.curveOpacity};
|
|
12
|
-
stroke: ${s};
|
|
13
|
-
}
|
|
14
|
-
`}return e},"genIndexStyles"),it=c(a=>{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return`
|
|
15
|
-
.radarTitle {
|
|
16
|
-
font-size: ${t.fontSize};
|
|
17
|
-
color: ${t.titleColor};
|
|
18
|
-
dominant-baseline: hanging;
|
|
19
|
-
text-anchor: middle;
|
|
20
|
-
}
|
|
21
|
-
.radarAxisLine {
|
|
22
|
-
stroke: ${e.axisColor};
|
|
23
|
-
stroke-width: ${e.axisStrokeWidth};
|
|
24
|
-
}
|
|
25
|
-
.radarAxisLabel {
|
|
26
|
-
font-size: ${e.axisLabelFontSize}px;
|
|
27
|
-
color: ${e.axisColor};
|
|
28
|
-
}
|
|
29
|
-
.radarGraticule {
|
|
30
|
-
fill: ${e.graticuleColor};
|
|
31
|
-
fill-opacity: ${e.graticuleOpacity};
|
|
32
|
-
stroke: ${e.graticuleColor};
|
|
33
|
-
stroke-width: ${e.graticuleStrokeWidth};
|
|
34
|
-
}
|
|
35
|
-
.radarLegendText {
|
|
36
|
-
text-anchor: start;
|
|
37
|
-
font-size: ${e.legendFontSize}px;
|
|
38
|
-
dominant-baseline: hanging;
|
|
39
|
-
}
|
|
40
|
-
${ot(t,e)}
|
|
41
|
-
`},"styles"),pt={parser:tt,db:$,renderer:nt,styles:lt};export{pt as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-CHzjH2SN.js";import{p}from"./chunk-JWPE2WC7-RWpAfnwW.js";import{_ as t,l as o}from"./index-BkpgTe8Q.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-Bb_blZYP.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import{g as Bt}from"./chunk-XXDRQBXY-Q-1uA8_v.js";import{s as Ft}from"./chunk-VR4S4FIN-C-ISU9mB.js";import{_ as d,b as Yt,a as Pt,s as zt,g as Gt,n as Kt,o as Ut,c as rt,l as V,p as Zt,q as jt,r as Wt,t as qt,u as Qt,v as Xt,d as Ht,x as Jt}from"./index-BkpgTe8Q.js";import{c as $t}from"./channel-Bv2v5Ka7.js";var gt=(function(){var s=d(function(I,n,a,o){for(a=a||{},o=I.length;o--;a[I[o]]=n);return a},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],c=[1,10],h=[1,11],l=[1,12],p=[1,13],y=[1,23],u=[1,24],m=[1,25],W=[1,26],q=[1,27],S=[1,19],Q=[1,28],B=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],at=[1,36],ct=[1,37],ot=[1,38],lt=[1,39],ht=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],Y=[1,55],P=[40,48,50,51,52,71,72],z=[1,66],G=[1,64],A=[1,61],K=[1,65],U=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],bt=[66,67,68,69,70],kt=[1,85],mt=[1,84],Et=[1,82],St=[1,83],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,93],J=[1,92],$=[1,91],Z=[19,58],Ot=[1,102],Nt=[1,101],ut=[19,58,61,63],dt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:d(function(n,a,o,r,f,t,j){var e=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 68:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 80:case 81:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 67:case 70:this.$=t[e];break;case 66:this.$=t[e-1]+t[e];break;case 69:t[e-2].push(t[e]),this.$=t[e-2];break;case 71:this.$=t[e].replace(/"/g,"");break;case 72:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:c,24:h,26:l,28:p,29:14,30:15,31:16,32:17,33:y,34:u,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:C},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:c,24:h,26:l,28:p,29:14,30:15,31:16,32:17,33:y,34:u,35:m,36:W,37:q,40:S,43:Q,44:B,48:D,50:R,51:T,52:C},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:at,67:ct,68:ot,69:lt,70:ht}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},s(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(P,[2,77]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:G,42:A,45:62,46:63,48:K,49:U},s(X,[2,37]),s(X,[2,38]),{16:68,40:O,41:N,42:A},{13:z,38:69,41:G,42:A,45:62,46:63,48:K,49:U},{13:[1,70],15:[1,71]},s(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:at,67:ct,68:ot,69:lt,70:ht}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:at,67:ct,68:ot,69:lt,70:ht},s(bt,[2,78]),s(bt,[2,79]),{6:kt,10:mt,39:81,42:Et,47:St},{40:[1,86],41:[1,87]},s(Tt,[2,43],{46:88,13:z,41:G,48:K,49:U}),s(L,[2,45]),s(L,[2,50]),s(L,[2,51]),s(L,[2,52]),s(L,[2,53]),s(i,[2,41],{42:A}),{6:kt,10:mt,39:89,42:Et,47:St},{14:90,40:H,50:J,73:$},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(Z,[2,61],{56:98,57:99,60:100,62:Ot,63:Nt}),s([19,58,62,63],[2,67]),{58:[2,66]},s(i,[2,22],{15:[1,104],17:[1,103]}),s([40,48,50,51,52],[2,72]),s(i,[2,36]),{13:z,41:G,45:105,46:63,48:K,49:U},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(X,[2,39]),s(X,[2,40]),s(L,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,80]),s(i,[2,81]),s(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},s(i,[2,15]),s(Z,[2,62],{57:110,61:[1,111],63:Nt}),s(Z,[2,63]),s(ut,[2,68]),s(Z,[2,71]),s(ut,[2,70]),{18:112,19:[1,113],53:53,54:54,58:Y},{16:114,40:O,41:N},s(Tt,[2,44],{46:88,13:z,41:G,48:K,49:U}),{14:115,40:H,50:J,73:$},{16:116,40:O,41:N},{14:117,40:H,50:J,73:$},s(i,[2,13]),s(Z,[2,64]),{60:118,62:Ot},{19:[1,119]},s(i,[2,20]),s(i,[2,23],{17:[1,120],42:A}),s(i,[2,11]),{13:[1,121],42:A},s(i,[2,10]),s(ut,[2,69]),s(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:Y},{14:124,40:H,50:J,73:$},{19:[1,125]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:d(function(n,a){if(a.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=a,o}},"parseError"),parse:d(function(n){var a=this,o=[0],r=[],f=[null],t=[],j=this.table,e="",et=0,At=0,Lt=2,It=1,wt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var pt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,pt)&&(x.yy[pt]=this.yy[pt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var Vt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(b){o.length=o.length-2*b,f.length=f.length-b,t.length=t.length-b}d(Mt,"popStack");function Rt(){var b;return b=r.pop()||_.lex()||It,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=a.symbols_[b]||b),b}d(Rt,"lex");for(var g,v,k,yt,w={},st,E,Ct,it;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=Rt()),k=j[v]&&j[v][g]),typeof k>"u"||!k.length||!k[0]){var _t="";it=[];for(st in j[v])this.terminals_[st]&&st>Lt&&it.push("'"+this.terminals_[st]+"'");_.showPosition?_t="Parse error on line "+(et+1)+`:
|
|
2
|
-
`+_.showPosition()+`
|
|
3
|
-
Expecting `+it.join(", ")+", got '"+(this.terminals_[g]||g)+"'":_t="Parse error on line "+(et+1)+": Unexpected "+(g==It?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(_t,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),f.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,At=_.yyleng,e=_.yytext,et=_.yylineno,ft=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=f[f.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},Vt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),yt=this.performAction.apply(w,[e,At,et,x.yy,k[1],f,t].concat(wt)),typeof yt<"u")return yt;E&&(o=o.slice(0,-1*E*2),f=f.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),f.push(w.$),t.push(w._$),Ct=j[o[o.length-2]][o[o.length-1]],o.push(Ct);break;case 3:return!0}}return!0},"parse")},Dt=(function(){var I={EOF:1,parseError:d(function(a,o){if(this.yy.parser)this.yy.parser.parseError(a,o);else throw new Error(a)},"parseError"),setInput:d(function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:d(function(n){var a=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(n){this.unput(this.match.slice(n))},"less"),pastInput:d(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
-
`+a+"^"},"showPosition"),test_match:d(function(n,a){var o,r,f;if(this.options.backtrack_lexer&&(f={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&&(f.yylloc.range=this.yylloc.range.slice(0))),r=n[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],o=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var t in f)this[t]=f[t];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,o,r;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),t=0;t<f.length;t++)if(o=this._input.match(this.rules[f[t]]),o&&(!a||o[0].length>a[0].length)){if(a=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,f[t]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,f[r]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var a=this.next();return a||this.lex()},"lex"),begin:d(function(a){this.conditionStack.push(a)},"begin"),popState:d(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:d(function(a){this.begin(a)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(a,o,r,f){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 73;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 62;case 25:return 58;case 26:return 58;case 27:this.begin("block_bq");break;case 28:return 58;case 29:this.popState();break;case 30:return 63;case 31:break;case 32:return this.popState(),19;case 33:return o.yytext[0];case 34:return 20;case 35:return 21;case 36:return this.begin("style"),44;case 37:return this.popState(),10;case 38:break;case 39:return 13;case 40:return 42;case 41:return 49;case 42:return this.begin("style"),37;case 43:return 43;case 44:return 66;case 45:return 68;case 46:return 68;case 47:return 68;case 48:return 66;case 49:return 66;case 50:return 67;case 51:return 67;case 52:return 67;case 53:return 67;case 54:return 67;case 55:return 68;case 56:return 67;case 57:return 68;case 58:return 69;case 59:return 69;case 60:return 51;case 61:return 69;case 62:return 69;case 63:return 69;case 64:return 52;case 65:return 48;case 66:return 69;case 67:return 66;case 68:return 67;case 69:return 68;case 70:return 70;case 71:return 71;case 72:return 72;case 73:return 72;case 74:return 71;case 75:return 71;case 76:return 71;case 77:return 41;case 78:return 47;case 79:return 40;case 80:return o.yytext[0];case 81:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[37,38,39,40,41,77,78],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[28,29],inclusive:!1},block:{rules:[23,24,25,26,27,30,31,32,33],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],inclusive:!0}}};return I})();dt.lexer=Dt;function tt(){this.yy={}}return d(tt,"Parser"),tt.prototype=dt,dt.Parser=tt,new tt})();gt.parser=gt;var te=gt,M,ee=(M=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Yt,this.getAccTitle=Pt,this.setAccDescription=zt,this.getAccDescription=Gt,this.setDiagramTitle=Kt,this.getDiagramTitle=Ut,this.getConfig=d(()=>rt().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,c=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&c&&(this.entities.get(i).alias=c,V.info(`Add alias '${c}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:c,shape:"erBox",look:rt().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,c){const h=this.addEntity(i);let l;for(l=c.length-1;l>=0;l--)c[l].keys||(c[l].keys=[]),c[l].comment||(c[l].comment=""),h.attributes.push(c[l]),V.debug("Added attribute ",c[l].name)}addRelationship(i,c,h,l){const p=this.entities.get(i),y=this.entities.get(h);if(!p||!y)return;const u={entityA:p.id,roleA:c,entityB:y.id,relSpec:l};this.relationships.push(u),V.debug("Added new relationship :",u)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let c=[];for(const h of i){const l=this.classes.get(h);l?.styles&&(c=[...c,...l.styles??[]].map(p=>p.trim())),l?.textStyles&&(c=[...c,...l.textStyles??[]].map(p=>p.trim()))}return c}addCssStyles(i,c){for(const h of i){const l=this.entities.get(h);if(!c||!l)return;for(const p of c)l.cssStyles.push(p)}}addClass(i,c){i.forEach(h=>{let l=this.classes.get(h);l===void 0&&(l={id:h,styles:[],textStyles:[]},this.classes.set(h,l)),c&&c.forEach(function(p){if(/color/.exec(p)){const y=p.replace("fill","bgFill");l.textStyles.push(y)}l.styles.push(p)})})}setClass(i,c){for(const h of i){const l=this.entities.get(h);if(l)for(const p of c)l.cssClasses+=" "+p}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Zt()}getData(){const i=[],c=[],h=rt();let l=0;for(const y of this.entities.keys()){const u=this.entities.get(y);u&&(u.cssCompiledStyles=this.getCompiledStyles(u.cssClasses.split(" ")),u.colorIndex=l++,i.push(u))}let p=0;for(const y of this.relationships){const u={id:jt(y.entityA,y.entityB,{prefix:"id",counter:p++}),type:"normal",curve:"basis",start:y.entityA,end:y.entityB,label:y.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:y.relSpec.cardB.toLowerCase(),arrowTypeEnd:y.relSpec.cardA.toLowerCase(),pattern:y.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};c.push(u)}return{nodes:i,edges:c,other:{},config:h,direction:"TB"}}},d(M,"ErDB"),M),vt={};qt(vt,{draw:()=>se});var se=d(async function(s,i,c,h){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:l,er:p,layout:y}=rt(),u=h.db.getData(),m=Bt(i,l);u.type=h.type,u.layoutAlgorithm=Qt(y),u.config.flowchart.nodeSpacing=p?.nodeSpacing||140,u.config.flowchart.rankSpacing=p?.rankSpacing||80,u.direction=h.db.getDirection();const{config:W}=u,{look:q}=W;q==="neo"?u.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:u.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],u.diagramId=i,await Xt(u,m),u.layoutAlgorithm==="elk"&&m.select(".edges").lower();const S=m.selectAll('[id*="-background"]');Array.from(S).length>0&&S.each(function(){const B=Ht(this),R=B.attr("id").replace("-background",""),T=m.select(`#${CSS.escape(R)}`);if(!T.empty()){const C=T.attr("transform");B.attr("transform",C)}});const Q=8;Jt.insertTitle(m,"erDiagramTitleText",p?.titleTopMargin??25,h.db.getDiagramTitle()),Ft(m,Q,"erDiagram",p?.useMaxWidth??!0)},"draw"),xt=d((s,i)=>{const c=$t,h=c(s,"r"),l=c(s,"g"),p=c(s,"b");return Wt(h,l,p,i)},"fade"),nt=new Set(["redux-color","redux-dark-color"]),ie=d(s=>{const{theme:i,look:c,bkgColorArray:h,borderColorArray:l}=s;if(!nt.has(i))return"";const p=h?.length>0;let y="";for(let u=0;u<s.THEME_COLOR_LIMIT;u++)y+=`
|
|
7
|
-
|
|
8
|
-
[data-look="${c}"][data-color-id="color-${u}"].node path {
|
|
9
|
-
stroke: ${l[u]};
|
|
10
|
-
${p?`fill: ${h[u]};`:""}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[data-look="${c}"][data-color-id="color-${u}"].node rect {
|
|
14
|
-
stroke: ${l[u]};
|
|
15
|
-
${p?`fill: ${h[u]};`:""}
|
|
16
|
-
}
|
|
17
|
-
`;return y},"genColor"),re=d(s=>{const{look:i,theme:c,erEdgeLabelBackground:h,strokeWidth:l}=s;return`
|
|
18
|
-
${ie(s)}
|
|
19
|
-
.entityBox {
|
|
20
|
-
fill: ${s.mainBkg};
|
|
21
|
-
stroke: ${s.nodeBorder};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.relationshipLabelBox {
|
|
25
|
-
fill: ${s.tertiaryColor};
|
|
26
|
-
opacity: 0.7;
|
|
27
|
-
background-color: ${s.tertiaryColor};
|
|
28
|
-
rect {
|
|
29
|
-
opacity: 0.5;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.labelBkg {
|
|
34
|
-
background-color: ${nt.has(c)&&h?h:xt(s.tertiaryColor,.5)};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.edgeLabel {
|
|
38
|
-
background-color: ${nt.has(c)&&h?h:s.edgeLabelBackground};
|
|
39
|
-
}
|
|
40
|
-
.edgeLabel .label rect {
|
|
41
|
-
fill: ${nt.has(c)&&h?h:s.edgeLabelBackground};
|
|
42
|
-
}
|
|
43
|
-
.edgeLabel .label text {
|
|
44
|
-
fill: ${s.textColor};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.edgeLabel .label {
|
|
48
|
-
fill: ${s.nodeBorder};
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.label {
|
|
53
|
-
font-family: ${s.fontFamily};
|
|
54
|
-
color: ${s.nodeTextColor||s.textColor};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.edge-pattern-dashed {
|
|
58
|
-
stroke-dasharray: 8,8;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.node rect,
|
|
62
|
-
.node circle,
|
|
63
|
-
.node ellipse,
|
|
64
|
-
.node polygon
|
|
65
|
-
{
|
|
66
|
-
fill: ${s.mainBkg};
|
|
67
|
-
stroke: ${s.nodeBorder};
|
|
68
|
-
stroke-width: ${i==="neo"?l:"1px"};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.relationshipLine {
|
|
72
|
-
stroke: ${s.lineColor};
|
|
73
|
-
stroke-width: ${i==="neo"?l:"1px"};
|
|
74
|
-
fill: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.marker {
|
|
78
|
-
fill: none !important;
|
|
79
|
-
stroke: ${s.lineColor} !important;
|
|
80
|
-
stroke-width: 1;
|
|
81
|
-
}
|
|
82
|
-
[data-look=neo].labelBkg {
|
|
83
|
-
background-color: ${xt(s.tertiaryColor,.5)};
|
|
84
|
-
}
|
|
85
|
-
`},"getStyles"),ne=re,he={parser:te,get db(){return new ee},renderer:vt,styles:ne};export{he as diagram};
|