@gobing-ai/spur 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/{spur-cli/config → config}/rules/boundary/sp-runtime-path.yaml +5 -0
- package/package.json +4 -3
- package/spur.js +30 -5
- package/web/_astro/BoardApp.Bcfvp2GH.js +1 -0
- package/web/_astro/BoardApp.DjpO2XHn.js +178 -0
- package/web/_astro/BoardApp.t7x-dYDo.css +1 -0
- package/web/_astro/TaskDetail.DilpuD7R.js +1 -0
- package/web/_astro/arc.KcqIior8.js +1 -0
- package/web/_astro/architectureDiagram-3BPJPVTR.BTFU70BY.js +36 -0
- package/web/_astro/blockDiagram-GPEHLZMM.apx49Oy9.js +132 -0
- package/web/_astro/c4Diagram-AAUBKEIU.BM-J4juX.js +10 -0
- package/web/_astro/channel.vSp82e1U.js +1 -0
- package/web/_astro/chunk-2J33WTMH.K6z7IYZU.js +1 -0
- package/web/_astro/chunk-4BX2VUAB.BDYhxKa0.js +1 -0
- package/web/_astro/chunk-55IACEB6.BnNOxqnI.js +1 -0
- package/web/_astro/chunk-727SXJPM.DNeg6N7v.js +206 -0
- package/web/_astro/chunk-AQP2D5EJ.BjILBkba.js +231 -0
- package/web/_astro/chunk-FMBD7UC4.DQ5UvvsV.js +15 -0
- package/web/_astro/chunk-ND2GUHAM.Yn1OvRJs.js +1 -0
- package/web/_astro/chunk-QZHKN3VN.UErqHgqw.js +1 -0
- package/web/_astro/classDiagram-4FO5ZUOK.BmjVF7iZ.js +1 -0
- package/web/_astro/classDiagram-v2-Q7XG4LA2.BmjVF7iZ.js +1 -0
- package/web/_astro/client.CdFpTatq.js +9 -0
- package/web/_astro/cose-bilkent-S5V4N54A.iKBxnkbb.js +1 -0
- package/web/_astro/cytoscape.esm.D3_iZ_3b.js +321 -0
- package/web/_astro/dagre-BM42HDAG.OwnCCrs6.js +4 -0
- package/web/_astro/defaultLocale.CrowFXzY.js +1 -0
- package/web/_astro/diagram-2AECGRRQ.DCdcffxE.js +43 -0
- package/web/_astro/diagram-5GNKFQAL.Ai-LvmVW.js +10 -0
- package/web/_astro/diagram-KO2AKTUF.B6e21QDN.js +3 -0
- package/web/_astro/diagram-LMA3HP47.oPfqy1fq.js +24 -0
- package/web/_astro/diagram-OG6HWLK6.Dh5QRDCE.js +24 -0
- package/web/_astro/erDiagram-TEJ5UH35.DpBiOcO3.js +85 -0
- package/web/_astro/flowDiagram-I6XJVG4X.NbMxFlVk.js +162 -0
- package/web/_astro/ganttDiagram-6RSMTGT7.JgZ3fDME.js +292 -0
- package/web/_astro/gitGraphDiagram-PVQCEYII.oMjFeZRt.js +106 -0
- package/web/_astro/graph.D2o_JWn5.js +1 -0
- package/web/_astro/index.A0eX93qW.js +1 -0
- package/web/_astro/index.CA3GTZM6.css +1 -0
- package/web/_astro/infoDiagram-5YYISTIA.kaio3YzK.js +2 -0
- package/web/_astro/init.Gi6I4Gst.js +1 -0
- package/web/_astro/ishikawaDiagram-YF4QCWOH.CXQfMyeF.js +70 -0
- package/web/_astro/journeyDiagram-JHISSGLW.AvNKMzx6.js +139 -0
- package/web/_astro/kanban-definition-UN3LZRKU.kv3cZGdE.js +89 -0
- package/web/_astro/katex.HP8lGamR.js +257 -0
- package/web/_astro/layout.DNLMvjEt.js +1 -0
- package/web/_astro/linear.CfLoHWjz.js +1 -0
- package/web/_astro/mermaid.core.BSV8pBn-.js +301 -0
- package/web/_astro/mindmap-definition-RKZ34NQL.CbL_3b32.js +96 -0
- package/web/_astro/ordinal.BYWQX77i.js +1 -0
- package/web/_astro/pieDiagram-4H26LBE5.5BXdOLRb.js +30 -0
- package/web/_astro/quadrantDiagram-W4KKPZXB.krXYbhlh.js +7 -0
- package/web/_astro/requirementDiagram-4Y6WPE33.COO4LapZ.js +84 -0
- package/web/_astro/sankeyDiagram-5OEKKPKP.BvL0Jbdx.js +40 -0
- package/web/_astro/sequenceDiagram-3UESZ5HK.Dk7Tu15E.js +162 -0
- package/web/_astro/stateDiagram-AJRCARHV.Cqh_KmEW.js +1 -0
- package/web/_astro/stateDiagram-v2-BHNVJYJU.WapPgDCy.js +1 -0
- package/web/_astro/timeline-definition-PNZ67QCA.CEVdiX0n.js +120 -0
- package/web/_astro/vennDiagram-CIIHVFJN.Cd9A63eF.js +34 -0
- package/web/_astro/wardley-L42UT6IY.DEiaHiIT.js +161 -0
- package/web/_astro/wardleyDiagram-YWT4CUSO.B7nGP61E.js +78 -0
- package/web/_astro/xychartDiagram-2RQKCTM6.Bq8CHmxC.js +7 -0
- package/web/favicon.svg +4 -0
- package/web/index.html +2 -0
- /package/{spur-cli/config → config}/config.example.yaml +0 -0
- /package/{spur-cli/config → config}/plugins/.gitkeep +0 -0
- /package/{spur-cli/config → config}/rules/README.md +0 -0
- /package/{spur-cli/config → config}/rules/boundary/config-loading-ownership.yaml +0 -0
- /package/{spur-cli/config → config}/rules/boundary/dao-boundary.yaml +0 -0
- /package/{spur-cli/config → config}/rules/boundary/planning-folder-hardcode.yaml +0 -0
- /package/{spur-cli/config → config}/rules/boundary/sp-no-vendor-refs.yaml +0 -0
- /package/{spur-cli/config → config}/rules/migration/rg-dialect.yaml +0 -0
- /package/{spur-cli/config → config}/rules/quality/coverage-gate.yaml +0 -0
- /package/{spur-cli/config → config}/rules/quality/tsdoc-exports.yaml +0 -0
- /package/{spur-cli/config → config}/rules/recommended-post-check.yaml +0 -0
- /package/{spur-cli/config → config}/rules/recommended-pre-check.yaml +0 -0
- /package/{spur-cli/config → config}/rules/rg-migration.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict/http-boundaries.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict/rule-files-structural.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict/runtime-boundaries.yaml +0 -0
- /package/{spur-cli/config → config}/rules/strict-check.yaml +0 -0
- /package/{spur-cli/config → config}/rules/structure/protected-files.yaml +0 -0
- /package/{spur-cli/config → config}/rules/structure/test-focus-skip.yaml +0 -0
- /package/{spur-cli/config → config}/rules/structure/test-location.yaml +0 -0
- /package/{spur-cli/config → config}/rules/surface/check-cli-surface.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/bun-tooling.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/guarded-happy-dom-register.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/happy-dom-teardown.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-biome-suppressions.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-debugger.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-leaky-module-mocks.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-module-scope-import-calls.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/no-unmocked-module-eval-side-effects.yaml +0 -0
- /package/{spur-cli/config → config}/rules/typescript/output-boundaries.yaml +0 -0
- /package/{spur-cli/config → config}/rules/ui/ui-import-boundary.yaml +0 -0
- /package/{spur-cli/config → config}/tasks/section-matrix.yaml +0 -0
- /package/{spur-cli/config → config}/templates/AGENTS.md +0 -0
- /package/{spur-cli/config → config}/templates/bdd/checklist.md +0 -0
- /package/{spur-cli/config → config}/templates/bdd/gherkin.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/00_ADR.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/01_PRD.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/02_ROADMAP.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/03_ARCHITECTURE.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/04_DESIGN.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/05_FEATURES.md +0 -0
- /package/{spur-cli/config → config}/templates/docs/99_PROJECT_CONSTITUTION.md +0 -0
- /package/{spur-cli/config → config}/templates/feature/default.md +0 -0
- /package/{spur-cli/config → config}/templates/task/brainstorm.md +0 -0
- /package/{spur-cli/config → config}/templates/task/feature-impl.md +0 -0
- /package/{spur-cli/config → config}/templates/task/issue.md +0 -0
- /package/{spur-cli/config → config}/templates/task/meta.md +0 -0
- /package/{spur-cli/config → config}/templates/task/review.md +0 -0
- /package/{spur-cli/config → config}/templates/task/standard.md +0 -0
- /package/{spur-cli/config → config}/workflows/basic.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/docs-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/feature-dev.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/feature-lifecycle.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/idea-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/planning-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/task-lifecycle.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/task-pipeline.yaml +0 -0
- /package/{spur-cli/config → config}/workflows/wrapup-pipeline.yaml +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as w,aF as F,w as Y,u as _,v as j,aD as r,a4 as H,bi as Q,b3 as V,an as U,ac as $,aQ as P,ak as q,al as z,aP as K,am as W}from"./mermaid.core.BSV8pBn-.js";import{Q as N,G as B}from"./graph.D2o_JWn5.js";import{b as Z,m as R,l as I}from"./layout.DNLMvjEt.js";var ee=4;function ne(e){return Z(e,ee)}function b(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:te(e),edges:se(e)};return N(e.graph())||(t.value=ne(e.graph())),t}function te(e){return R(e.nodes(),function(t){var n=e.node(t),a=e.parent(t),i={v:t};return N(n)||(i.value=n),N(a)||(i.parent=a),i})}function se(e){return R(e.edges(),function(t){var n=e.edge(t),a={v:t.v,w:t.w};return N(t.name)||(a.name=t.name),N(n)||(a.value=n),a})}var d=new Map,y=new Map,A=new Map,re=w(()=>{y.clear(),A.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return r.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),ie=w((e,t)=>{const n=y.get(t)||[];return r.info("Descendants of ",t," is ",n),r.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(r.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{r.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const i=t.children(e)||[];e!==a&&i.push(e),r.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);r.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(r.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(r.debug("Setting parent",o,e),n.setParent(o,e)):(r.info("In copy ",e,"root",a,"data",t.node(e),a),r.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);r.debug("Copying Edges",u),u.forEach(c=>{r.info("Edge",c);const m=t.edge(c.v,c.w,c.name);r.info("Edge data",m,a);try{ie(c,a)?(r.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),r.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):r.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(h){r.error(h)}})}r.debug("Removing node",o),t.removeNode(o)})},"copy"),J=w((e,t)=>{const n=t.children(e);let a=[...n];for(const i of n)A.set(i,e),a=[...a,...J(i,t)];return a},"extractDescendants"),oe=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),i=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=i.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(r.trace("Searching children of id ",e,a),a.length<1)return e;let i;for(const o of a){const l=C(o,t,n),u=oe(t,n,l);if(l)if(u.length>0)i=l;else return l}return i},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),ae=w((e,t)=>{if(!e||t>10){r.debug("Opting out, no graph ");return}else r.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(r.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,J(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),i=e.edges();a.length>0?(r.debug("Cluster identified",n,y),i.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(r.warn("Edge: ",o," leaves cluster ",n),r.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):r.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,i=e.parent(a);i!==n&&d.has(i)&&!d.get(i).externalConnections&&(d.get(n).id=i)}e.edges().forEach(function(n){const a=e.edge(n);r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),r.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,o=n.w;if(r.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(r.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),i=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const l=e.parent(i);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}r.warn("Fix Replacing with XXX",i,o,n.name),e.setEdge(i,o,a,n.name)}}),r.warn("Adjusted Graph",b(e)),T(e,0),r.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(r.warn("extractor - ",t,b(e),e.children("D")),t>10){r.error("Bailing out");return}let n=e.nodes(),a=!1;for(const i of n){const o=e.children(i);a=a||o.length>0}if(!a){r.debug("Done, no node has children",e.nodes());return}r.debug("Nodes = ",n,t);for(const i of n)if(r.debug("Extracting node",i,d,d.has(i)&&!d.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!d.has(i))r.debug("Not a cluster",i,t);else if(!d.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){r.warn("Cluster without external connections, without a parent and with children",i,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(i)?.clusterData?.dir&&(l=d.get(i).clusterData.dir,r.warn("Fixing dir",d.get(i).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});r.warn("Old graph before copy",b(e)),G(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:d.get(i).clusterData,label:d.get(i).label,graph:u}),r.warn("New graph after copy node: (",i,")",b(u)),r.debug("Old graph after copy",b(e))}else r.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!d.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),r.debug(d);n=e.nodes(),r.warn("New list of nodes",n);for(const i of n){const o=e.node(i);r.warn(" Now next level",i,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),L=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const i=e.children(a),o=L(e,i);n=[...n,...o]}),n},"sorter"),ce=w(e=>L(e,e.children()),"sortNodesByHierarchy"),M=w(async(e,t,n,a,i,o)=>{r.warn("Graph in recursive render:XAX",b(t),i);const l=t.graph().rankdir;r.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?r.info("Recursive render XXX",t.nodes()):r.info("No nodes found for",t),t.edges().length>0&&r.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),h=u.insert("g").attr("class","edgeLabels"),v=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(i!==void 0){const g=JSON.parse(JSON.stringify(i.clusterData));r.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,f,`
|
|
3
|
+
data=`,g.height,`
|
|
4
|
+
Parent cluster`,i.height),t.setNode(i.id,g),t.parent(f)||(r.trace("Setting parent",f,i.id),t.setParent(f,i.id,g))}if(r.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){r.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const p=await M(v,s.graph,n,a,t.node(f),o),x=p.elem;Q(s,x),s.diff=p.diff||0,r.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),V(x,s)}else t.children(f).length>0?(r.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),r.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(r.trace("Node - the non recursive path XAX",f,v,t.node(f),l),await U(v,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);r.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),r.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),r.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await W(h,g)});await Promise.all(f)},"processEdges")(),r.info("Graph before layout:",JSON.stringify(b(t))),r.info("############################################# XXX"),r.info("### Layout ### XXX"),r.info("############################################# XXX"),I(t),r.info("Graph after layout:",JSON.stringify(b(t)));let O=0,{subGraphTitleTotalMargin:S}=$(o);return await Promise.all(ce(t).map(async function(f){const s=t.node(f);if(r.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,r.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){r.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,p=E-g||0;r.debug("OffsetY",p,"labelHeight",E,"halfPadding",g),await q(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,r.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);r.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const p=z(m,s,d,n,g,E,a);K(s,p)}),t.nodes().forEach(function(f){const s=t.node(f);r.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),r.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ue=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");F(a,e.markers,e.type,e.diagramId),Y(),_(),j(),re(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),r.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const h=structuredClone(o),v=structuredClone(o),X=structuredClone(o);h.label="",h.arrowTypeEnd="none",h.endLabelLeft="",h.endLabelRight="",h.startLabelLeft="",h.id=l+"-cyclic-special-1",v.startLabelRight="",v.startLabelLeft="",v.endLabelLeft="",v.endLabelRight="",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-mid",X.label="",X.startLabelRight="",X.startLabelLeft="",X.arrowTypeStart="none",m.isGroup&&(h.fromCluster=l,X.toCluster=l),X.id=l+"-cyclic-special-2",X.arrowTypeStart="none",n.setEdge(l,u,h,l+"-cyclic-special-0"),n.setEdge(u,c,v,l+"-cyclic-special-1"),n.setEdge(c,l,X,l+"-cyc<lic-special-2")}else n.setEdge(o.start,o.end,{...o},o.id)}),r.warn("Graph at first:",JSON.stringify(b(n))),ae(n),r.warn("Graph after XAX:",JSON.stringify(b(n)));const i=H();await M(a,n,e.type,e.diagramId,void 0,i)},"render");export{ue as render};
|
|
@@ -0,0 +1 @@
|
|
|
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,$ as b,K as e,tn as f};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{a$ as k,a1 as R,a5 as E,b2 as I,a2 as _,b0 as D,b as l,a_ as F,t as z,s as y,a3 as C,S as G,aD as P,ae as W,E as B}from"./mermaid.core.BSV8pBn-.js";import{p as V}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{p as H}from"./wardley-L42UT6IY.DEiaHiIT.js";var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},b={axes:[],curves:[],options:h},x=structuredClone(b),j=G.radar,N=l(()=>y({...j,...C().radar}),"getConfig"),w=l(()=>x.axes,"getAxes"),U=l(()=>x.curves,"getCurves"),X=l(()=>x.options,"getOptions"),Y=l(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=l(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=w();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=l(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=l(()=>{z(),x=structuredClone(b)},"clear"),$={getAxes:w,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:D,getAccTitle:_,setDiagramTitle:I,getDiagramTitle:E,getAccDescription:R,setAccDescription:k},Q=l(a=>{V(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:l(async a=>{const t=await H("radar",a);P.debug(t),Q(t)},"parse")},et=l((a,t,e,r)=>{const s=r.db,o=s.getAxes(),i=s.getCurves(),n=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),p=F(t),u=at(p,c),g=n.max??Math.max(...i.map(f=>Math.max(...f.entries))),m=n.min,v=Math.min(c.width,c.height)/2;rt(u,o,v,n.ticks,n.graticule),st(u,o,v,c),M(u,o,i,m,g,n.graticule,c),T(u,i,n.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=l((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 B(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=l((a,t,e,r,s)=>{if(s==="circle")for(let o=0;o<r;o++){const i=e*(o+1)/r;a.append("circle").attr("r",i).attr("class","radarGraticule")}else if(s==="polygon"){const o=t.length;for(let i=0;i<r;i++){const n=e*(i+1)/r,c=t.map((d,p)=>{const u=2*p*Math.PI/o-Math.PI/2,g=n*Math.cos(u),m=n*Math.sin(u);return`${g},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),st=l((a,t,e,r)=>{const s=t.length;for(let o=0;o<s;o++){const i=t[o].label,n=2*o*Math.PI/s-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(n)).attr("y2",e*r.axisScaleFactor*Math.sin(n)).attr("class","radarAxisLine"),a.append("text").text(i).attr("x",e*r.axisLabelFactor*Math.cos(n)).attr("y",e*r.axisLabelFactor*Math.sin(n)).attr("class","radarAxisLabel")}},"drawAxes");function M(a,t,e,r,s,o,i){const n=t.length,c=Math.min(i.width,i.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=A(g,r,s,c),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});o==="circle"?a.append("path").attr("d",L(u,i.curveTension)).attr("class",`radarCurve-${p}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}l(M,"drawCurves");function A(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(A,"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 o=a[(s-1+e)%e],i=a[s],n=a[(s+1)%e],c=a[(s+2)%e],d={x:i.x+(n.x-o.x)*t,y:i.y+(n.y-o.y)*t},p={x:n.x-(c.x-i.x)*t,y:n.y-(c.y-i.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}l(L,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,i=20;t.forEach((n,c)=>{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*i})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}l(T,"drawLegend");var nt={draw:et},ot=l((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=l(a=>{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=l(({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
|
+
dominant-baseline: middle;
|
|
27
|
+
text-anchor: middle;
|
|
28
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
29
|
+
color: ${e.axisColor};
|
|
30
|
+
}
|
|
31
|
+
.radarGraticule {
|
|
32
|
+
fill: ${e.graticuleColor};
|
|
33
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
34
|
+
stroke: ${e.graticuleColor};
|
|
35
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
36
|
+
}
|
|
37
|
+
.radarLegendText {
|
|
38
|
+
text-anchor: start;
|
|
39
|
+
font-size: ${e.legendFontSize}px;
|
|
40
|
+
dominant-baseline: hanging;
|
|
41
|
+
}
|
|
42
|
+
${ot(t,e)}
|
|
43
|
+
`},"styles"),pt={parser:tt,db:$,renderer:nt,styles:lt};export{pt as diagram};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{b2 as x,b0 as f,a$ as C,a5 as B,a1 as T,a2 as y,b as s,s as u,aD as k,a_ as V,E as S,a3 as _,t as D,S as N}from"./mermaid.core.BSV8pBn-.js";import{p as $}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{I as A}from"./chunk-QZHKN3VN.UErqHgqw.js";import{p as I}from"./wardley-L42UT6IY.DEiaHiIT.js";var l=new A(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),X=s(()=>{l.reset(),D()},"clear"),z=s(()=>l.records.stack[0],"getRoot"),E=s(()=>l.records.cnt,"getCount"),H=N.treeView,L=s(()=>u(H,_().treeView),"getConfig"),R=s((e,t)=>{for(;e<=l.records.stack[l.records.stack.length-1].level;)l.records.stack.pop();const a={id:l.records.cnt++,level:e,name:t,children:[]};l.records.stack[l.records.stack.length-1].children.push(a),l.records.stack.push(a)},"addNode"),W={clear:X,addNode:R,getRoot:z,getCount:E,getConfig:L,getAccTitle:y,getAccDescription:T,getDiagramTitle:B,setAccDescription:C,setAccTitle:f,setDiagramTitle:x},b=W,M=s(e=>{$(e,b),e.nodes.map(t=>b.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),F={parse:s(async e=>{const t=await I("treeView",e);k.debug(t),M(t)},"parse")},Y=s((e,t,a,n,o)=>{const c=n.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:r}=c.node().getBBox(),d=g+o.paddingY*2,i=r+o.paddingX*2;c.attr("x",e+o.paddingX),c.attr("y",t+d/2),a.BBox={x:e,y:t,width:i,height:d}},"positionLabel"),m=s((e,t,a,n,o,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",n).attr("y2",o).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),j=s((e,t,a)=>{let n=0,o=0;const c=s((r,d,i,h)=>{const v=h*(i.rowIndent+i.paddingX);Y(v,n,d,r,i);const{height:p,width:w}=d.BBox;m(r,v-i.rowIndent,n+p/2,v,n+p/2,i.lineThickness),o=Math.max(o,v+w),n+=p},"drawNode"),g=s((r,d=0)=>{c(e,r,a,d),r.children.forEach(p=>{g(p,d+1)});const{x:i,y:h,height:v}=r.BBox;if(r.children.length){const{y:p,height:w}=r.children[r.children.length-1].BBox;m(e,i+a.paddingX,h+v,i+a.paddingX,p+w/2+a.lineThickness/2,a.lineThickness)}},"processNode");return g(t),{totalHeight:n,totalWidth:o}},"drawTree"),q=s((e,t,a,n)=>{k.debug(`Rendering treeView diagram
|
|
2
|
+
`+e);const o=n.db,c=o.getRoot(),g=o.getConfig(),r=V(t),d=r.append("g");d.attr("class","tree-view");const{totalHeight:i,totalWidth:h}=j(d,c,g);r.attr("viewBox",`-${g.lineThickness/2} 0 ${h} ${i}`),S(r,i,h,g.useMaxWidth)},"draw"),G={draw:q},J=G,K={labelFontSize:"16px",labelColor:"black",lineColor:"black"},O=s(({treeView:e})=>{const{labelFontSize:t,labelColor:a,lineColor:n}=u(K,e);return`
|
|
3
|
+
.treeView-node-label {
|
|
4
|
+
font-size: ${t};
|
|
5
|
+
fill: ${a};
|
|
6
|
+
}
|
|
7
|
+
.treeView-node-line {
|
|
8
|
+
stroke: ${n};
|
|
9
|
+
}
|
|
10
|
+
`},"styles"),P=O,te={db:b,renderer:J,parser:F,styles:P};export{te as diagram};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{p as re}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{a5 as oe,b2 as se,a$ as de,a1 as le,a2 as ce,b0 as me,b as o,aD as g,a4 as $,aZ as ue,b6 as xe,t as fe,s as ge,a3 as M,S as he,aY as y,bl as P,p as pe}from"./mermaid.core.BSV8pBn-.js";import{p as be,i as ve}from"./wardley-L42UT6IY.DEiaHiIT.js";var D="position frame",T="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:D,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:T,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 Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function j(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=Y(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(j,"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 Z(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(Z,"findBoxByLineIndex");function q(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=Z(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(q,"decidePositionRelation");function J(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(J,"evolveRelationPositioned");var Me={[D]:V,[S]:q},Be={[T]:j,[N]:J};function Q(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Q,"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=Q(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=$(),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 $e=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}=$(),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"),De={draw:$e},Te=o(e=>"","getStyles"),Ne=Te,We={parser:Ee,db:F,renderer:De,styles:Ne};export{We as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{b,s as u,a_ as $,E as B,aD as m,b0 as C,a2 as S,b2 as D,a5 as T,a1 as E,a$ as P,a3 as z,S as F,t as A}from"./mermaid.core.BSV8pBn-.js";import{p as W}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{p as _}from"./wardley-L42UT6IY.DEiaHiIT.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=C,this.getAccTitle=S,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=E,this.setAccDescription=P}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...z().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){A(),this.packet=[]}},L=1e4,M=b((t,e)=>{W(t,e);let r=-1,s=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.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,m.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&e.getPacket().length<L;){const[p,o]=Y({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(e.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}e.pushWord(s)},"populate"),Y=b((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,n=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))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.");m.debug(e),M(e,r)},"parse")},I=b((t,e,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=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),B(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,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"),O=b((t,e,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(s+l)+l;for(const o of e){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"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return`
|
|
2
|
+
.packetByte {
|
|
3
|
+
font-size: ${e.byteFontSize};
|
|
4
|
+
}
|
|
5
|
+
.packetByte.start {
|
|
6
|
+
fill: ${e.startByteColor};
|
|
7
|
+
}
|
|
8
|
+
.packetByte.end {
|
|
9
|
+
fill: ${e.endByteColor};
|
|
10
|
+
}
|
|
11
|
+
.packetLabel {
|
|
12
|
+
fill: ${e.labelColor};
|
|
13
|
+
font-size: ${e.labelFontSize};
|
|
14
|
+
}
|
|
15
|
+
.packetTitle {
|
|
16
|
+
fill: ${e.titleColor};
|
|
17
|
+
font-size: ${e.titleFontSize};
|
|
18
|
+
}
|
|
19
|
+
.packetBlock {
|
|
20
|
+
stroke: ${e.blockStrokeColor};
|
|
21
|
+
stroke-width: ${e.blockStrokeWidth};
|
|
22
|
+
fill: ${e.blockFillColor};
|
|
23
|
+
}
|
|
24
|
+
`},"styles"),X={parser:v,get db(){return new w},renderer:j,styles:H};export{X as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{b as w,ae as de,a3 as Q,s as J,a_ as he,E as ue,aD as K,ba as P,aZ as Y,b0 as pe,a2 as fe,b2 as me,a5 as ge,a1 as ye,a$ as Se,S as ve,av as xe,t as be}from"./mermaid.core.BSV8pBn-.js";import{s as we}from"./chunk-2J33WTMH.K6z7IYZU.js";import{p as Ce}from"./chunk-4BX2VUAB.BDYhxKa0.js";import{p as Te}from"./wardley-L42UT6IY.DEiaHiIT.js";import{f as I}from"./defaultLocale.CrowFXzY.js";import{o as U}from"./ordinal.BYWQX77i.js";function Le(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function $e(){return this.eachAfter(Le)}function Ae(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function Fe(e,a){for(var n=this,l=[n],r,o,d=-1;n=l.pop();)if(e.call(a,n,++d,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ne(e,a){for(var n=this,l=[n],r=[],o,d,h,m=-1;n=l.pop();)if(r.push(n),o=n.children)for(d=0,h=o.length;d<h;++d)l.push(o[d]);for(;n=r.pop();)e.call(a,n,++m,this);return this}function Me(e,a){let n=-1;for(const l of this)if(e.call(a,l,++n,this))return l}function Ve(e){return this.eachAfter(function(a){for(var n=+e(a.data)||0,l=a.children,r=l&&l.length;--r>=0;)n+=l[r].value;a.value=n})}function _e(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function ke(e){for(var a=this,n=ze(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function ze(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function De(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function Pe(){return Array.from(this)}function Be(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Ee(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Re(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r<o;++r)n.push(l[r]);while(n.length)}function ee(e,a){e instanceof Map?(e=[void 0,e],a===void 0&&(a=Ie)):a===void 0&&(a=He);for(var n=new j(e),l,r=[n],o,d,h,m;l=r.pop();)if((d=a(l.data))&&(m=(d=Array.from(d)).length))for(l.children=d,h=m-1;h>=0;--h)r.push(o=d[h]=new j(d[h])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ge)}function We(){return ee(this).eachBefore(Oe)}function He(e){return e.children}function Ie(e){return Array.isArray(e)?e[1]:null}function Oe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ge(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}j.prototype=ee.prototype={constructor:j,count:$e,each:Ae,eachAfter:Ne,eachBefore:Fe,find:Me,sum:Ve,sort:_e,path:ke,ancestors:De,descendants:Pe,leaves:Be,links:Ee,copy:We,[Symbol.iterator]:Re};function qe(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Xe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ye(e,a,n,l,r){for(var o=e.children,d,h=-1,m=o.length,c=e.value&&(l-a)/e.value;++h<m;)d=o[h],d.y0=n,d.y1=r,d.x0=a,d.x1=a+=d.value*c}function je(e,a,n,l,r){for(var o=e.children,d,h=-1,m=o.length,c=e.value&&(r-n)/e.value;++h<m;)d=o[h],d.x0=a,d.x1=l,d.y0=n,d.y1=n+=d.value*c}var Ze=(1+Math.sqrt(5))/2;function Ue(e,a,n,l,r,o){for(var d=[],h=a.children,m,c,u=0,b=0,s=h.length,x,S,v=a.value,p,g,M,N,z,E,V;u<s;){x=r-n,S=o-l;do p=h[b++].value;while(!p&&b<s);for(g=M=p,E=Math.max(S/x,x/S)/(v*e),V=p*p*E,z=Math.max(M/V,V/g);b<s;++b){if(p+=c=h[b].value,c<g&&(g=c),c>M&&(M=c),V=p*p*E,N=Math.max(M/V,V/g),N>z){p-=c;break}z=N}d.push(m={value:p,dice:x<S,children:h.slice(u,b)}),m.dice?Ye(m,n,l,r,v?l+=S*p/v:o):je(m,n,l,v?n+=x*p/v:r,o),v-=p,u=b}return d}const Je=(function e(a){function n(l,r,o,d,h){Ue(a,l,r,o,d,h)}return n.ratio=function(l){return e((l=+l)>1?l:1)},n})(Ze);function Ke(){var e=Je,a=!1,n=1,l=1,r=[0],o=O,d=O,h=O,m=O,c=O;function u(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Xe),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,p=s.x1-x,g=s.y1-x;p<S&&(S=p=(S+p)/2),g<v&&(v=g=(v+g)/2),s.x0=S,s.y0=v,s.x1=p,s.y1=g,s.children&&(x=r[s.depth+1]=o(s)/2,S+=c(s)-x,v+=d(s)-x,p-=h(s)-x,g-=m(s)-x,p<S&&(S=p=(S+p)/2),g<v&&(v=g=(v+g)/2),e(s,S,v,p,g))}return u.round=function(s){return arguments.length?(a=!!s,u):a},u.size=function(s){return arguments.length?(n=+s[0],l=+s[1],u):[n,l]},u.tile=function(s){return arguments.length?(e=qe(s),u):e},u.padding=function(s){return arguments.length?u.paddingInner(s).paddingOuter(s):u.paddingInner()},u.paddingInner=function(s){return arguments.length?(o=typeof s=="function"?s:G(+s),u):o},u.paddingOuter=function(s){return arguments.length?u.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):u.paddingTop()},u.paddingTop=function(s){return arguments.length?(d=typeof s=="function"?s:G(+s),u):d},u.paddingRight=function(s){return arguments.length?(h=typeof s=="function"?s:G(+s),u):h},u.paddingBottom=function(s){return arguments.length?(m=typeof s=="function"?s:G(+s),u):m},u.paddingLeft=function(s){return arguments.length?(c=typeof s=="function"?s:G(+s),u):c},u}var ae=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=pe,this.getAccTitle=fe,this.setDiagramTitle=me,this.getDiagramTitle=ge,this.getAccDescription=ye,this.setAccDescription=Se}static{w(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const e=ve,a=Q();return J({...e.treemap,...a.treemap??{}})}addNode(e,a){this.nodes.push(e),this.levels.set(e,a),a===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,a){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},l=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");l&&l.forEach(r=>{xe(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ne(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(ne,"buildHierarchy");var Qe=w((e,a)=>{Ce(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const d=o.item;if(!d)continue;const h=o.indent?parseInt(o.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};n.push(b)}const l=ne(n),r=w((o,d)=>{for(const h of o)a.addNode(h,d),h.children&&h.children.length>0&&r(h.children,d+1)},"addNodesRecursively");r(l,0)},"populate"),et=w(e=>e.name?String(e.name):"","getItemName"),le={parser:{yy:void 0},parse:w(async e=>{try{const n=await Te("treemap",e);K.debug("Treemap AST:",n);const l=le.parser?.yy;if(!(l instanceof ae))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.");Qe(n,l)}catch(a){throw K.error("Error parsing treemap:",a),a}},"parse")},tt=10,B=10,q=25,at=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),d=o.padding??tt,h=r.getDiagramTitle(),m=r.getRoot(),{themeVariables:c}=Q();if(!m)return;const u=h?30:0,b=he(a),s=o.nodeWidth?o.nodeWidth*B:960,x=o.nodeHeight?o.nodeHeight*B:500,S=s,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,o.useMaxWidth);let p;try{const t=o.valueFormat||",";if(t==="$0,0")p=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";p=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);p=w(f=>"$"+I(i||"")(f),"valueFormat")}else p=I(t)}catch(t){K.error("Error creating format function:",t),p=I(",")}const g=U().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]),M=U().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]),N=U().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]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const z=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=ee(m).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),te=Ke().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+B:0).paddingInner(d).paddingLeft(t=>t.children&&t.children.length>0?B:0).paddingRight(t=>t.children&&t.children.length>0?B:0).paddingBottom(t=>t.children&&t.children.length>0?B:0).round(!0)(E),re=te.descendants().filter(t=>t.children&&t.children.length>0),R=z.selectAll(".treemapSection").data(re).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);R.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),R.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),R.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>g(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>M(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=P({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=Y(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let $;o.showValues!==!1&&t.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),o.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?p(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+N(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const se=te.leaves(),X=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);X.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("style",t=>P({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?g(t.parent.data.name):g(t.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+N(t.data.name)+";",f=P({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=Y(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,k=6,W=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let H=Math.max(k,Math.min(F,Math.round(y*T))),Z=y+W+H;for(;Z>A&&y>_&&(y--,H=Math.max(k,Math.min(F,Math.round(y*T))),!(H<k&&y===_));)i.style("font-size",`${y}px`),Z=y+W+H;i.style("font-size",`${y}px`),(L.getComputedTextLength()>D||y<_||A<y)&&i.style("display","none")}),o.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+N(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const k=(i.y1-i.y0)/2+$/2+_;f.attr("y",k);const W=i.x1-i.x0,oe=i.y1-i.y0-4,ce=W-8;f.node().getComputedTextLength()>ce||k+F>oe||F<y?f.style("display","none"):f.style("display",null)});const ie=o.diagramPadding??8;we(b,ie,"flowchart",o?.useMaxWidth||!1)},"draw"),nt=w(function(e,a){return a.db.getClasses()},"getClasses"),lt={draw:at,getClasses:nt},rt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},st=w(({treemap:e}={})=>{const a=de(),n=Q(),l=J(a,n.themeVariables),r=J(rt,e),o=r.titleColor??l.titleColor,d=r.labelColor??l.textColor,h=r.valueColor??l.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${r.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${r.sectionStrokeWidth};
|
|
5
|
+
fill: ${r.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${r.leafStrokeColor};
|
|
9
|
+
stroke-width: ${r.leafStrokeWidth};
|
|
10
|
+
fill: ${r.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${d};
|
|
14
|
+
font-size: ${r.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${h};
|
|
18
|
+
font-size: ${r.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${o};
|
|
22
|
+
font-size: ${r.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),it=st,mt={parser:le,get db(){return new ae},renderer:lt,styles:it};export{mt as diagram};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import{g as Mt}from"./chunk-55IACEB6.BnNOxqnI.js";import{s as Bt}from"./chunk-2J33WTMH.K6z7IYZU.js";import{b as l,b0 as Ft,a2 as Yt,a$ as Pt,a1 as zt,b2 as Gt,a5 as Kt,a4 as it,aD as V,t as Ut,a6 as Zt,aX as jt,_ as Wt,aa as Xt,aU as Qt,aZ as Ht,bj as qt}from"./mermaid.core.BSV8pBn-.js";import{c as Jt}from"./channel.vSp82e1U.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],p=[1,24],m=[1,25],j=[1,26],W=[1,27],T=[1,19],X=[1,28],M=[1,29],D=[1,20],R=[1,18],S=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,70,71],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],bt=[1,84],kt=[1,83],mt=[1,81],Et=[1,82],Tt=[6,10,42,47],L=[6,10,13,41,42,47,48,49],H=[1,92],q=[1,91],J=[1,90],U=[19,58],St=[1,101],Ot=[1,100],ht=[19,58,60,62],ut={trace:l(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,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$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",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",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"},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],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,f,t,Z){var s=t.length-1;switch(f){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].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[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 67:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 79:case 80:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 66:case 69:this.$=t[s];break;case 68:t[s-2].push(t[s]),this.$=t[s-2];break;case 70:this.$=t[s].replace(/"/g,"");break;case 71:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:p,35:m,36:j,37:W,40:T,43:X,44:M,48:D,50:R,51:S,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:p,35:m,36:j,37:W,40:T,43:X,44:M,48:D,50:R,51:S,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:nt,66:at,67:ct,68:ot,69:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:T,48:D,50:R,51:S,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:T,48:D,50:R,51:S,52:C},{64:57,70:[1,58],71:[1,59]},e(Y,[2,72]),e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{63:35,12:72,17:[1,73],42:A,65:nt,66:at,67:ct,68:ot,69:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:nt,66:at,67:ct,68:ot,69:lt},e(gt,[2,77]),e(gt,[2,78]),{6:bt,10:kt,39:80,42:mt,47:Et},{40:[1,85],41:[1,86]},e(Tt,[2,43],{46:87,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:88,42:mt,47:Et},{14:89,40:H,50:q,72:J},{16:93,40:O,41:N},{11:94,40:T,48:D,50:R,51:S,52:C},{18:95,19:[1,96],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:97,57:98,59:99,61:St,62:Ot}),e([19,58,61,62],[2,66]),e(i,[2,22],{15:[1,103],17:[1,102]}),e([40,48,50,51,52],[2,71]),e(i,[2,36]),{13:P,41:z,45:104,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,79]),e(i,[2,80]),e(i,[2,81]),{13:[1,105],42:A},{13:[1,107],15:[1,106]},{19:[1,108]},e(i,[2,15]),e(U,[2,62],{57:109,60:[1,110],62:Ot}),e(U,[2,63]),e(ht,[2,67]),e(U,[2,70]),e(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:F},{16:113,40:O,41:N},e(Tt,[2,44],{46:87,13:P,41:z,48:G,49:K}),{14:114,40:H,50:q,72:J},{16:115,40:O,41:N},{14:116,40:H,50:q,72:J},e(i,[2,13]),e(U,[2,64]),{59:117,61:St},{19:[1,118]},e(i,[2,20]),e(i,[2,23],{17:[1,119],42:A}),e(i,[2,11]),{13:[1,120],42:A},e(i,[2,10]),e(ht,[2,68]),e(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:F},{14:123,40:H,50:q,72:J},{19:[1,124]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],f=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var ft=_.yylloc;t.push(ft);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,f.length=f.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,pt,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`:
|
|
2
|
+
`+_.showPosition()+`
|
|
3
|
+
Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:ft,expected:st})}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,Nt=_.yyleng,s=_.yytext,tt=_.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},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),pt=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],f,t].concat(Lt)),typeof pt<"u")return pt;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._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||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:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(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:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;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-c},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(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:l(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:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
+
`+c+"^"},"showPosition"),test_match:l(function(n,c){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,c,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:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,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&&(!c||o[0].length>c[0].length)){if(c=o,r=t,this.options.backtrack_lexer){if(n=this.test_match(o,f[t]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,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:l(function(){var c=this.next();return c||this.lex()},"lex"),begin:l(function(c){this.conditionStack.push(c)},"begin"),popState:l(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:l(function(c){this.begin(c)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(c,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 72;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 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return o.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return o.yytext[0];case 78: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,/^(?:[\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:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return I})();ut.lexer=vt;function $(){this.yy={}}return l($,"Parser"),$.prototype=ut,ut.Parser=$,new $})();_t.parser=_t;var $t=_t,te=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=Ft,this.getAccTitle=Yt,this.setAccDescription=Pt,this.getAccDescription=zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=l(()=>it().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)}static{l(this,"ErDB")}addEntity(e,i=""){return this.entities.has(e)?!this.entities.get(e)?.alias&&i&&(this.entities.get(e).alias=i,V.info(`Add alias '${i}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:i,shape:"erBox",look:it().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),V.info("Added new entity :",e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,i){const h=this.addEntity(e);let a;for(a=i.length-1;a>=0;a--)i[a].keys||(i[a].keys=[]),i[a].comment||(i[a].comment=""),h.attributes.push(i[a]),V.debug("Added attribute ",i[a].name)}addRelationship(e,i,h,a){const u=this.entities.get(e),d=this.entities.get(h);if(!u||!d)return;const y={entityA:u.id,roleA:i,entityB:d.id,relSpec:a};this.relationships.push(y),V.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let i=[];for(const h of e){const a=this.classes.get(h);a?.styles&&(i=[...i,...a.styles??[]].map(u=>u.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(u=>u.trim()))}return i}addCssStyles(e,i){for(const h of e){const a=this.entities.get(h);if(!i||!a)return;for(const u of i)a.cssStyles.push(u)}}addClass(e,i){e.forEach(h=>{let a=this.classes.get(h);a===void 0&&(a={id:h,styles:[],textStyles:[]},this.classes.set(h,a)),i&&i.forEach(function(u){if(/color/.exec(u)){const d=u.replace("fill","bgFill");a.textStyles.push(d)}a.styles.push(u)})})}setClass(e,i){for(const h of e){const a=this.entities.get(h);if(a)for(const u of i)a.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Ut()}getData(){const e=[],i=[],h=it();let a=0;for(const d of this.entities.keys()){const y=this.entities.get(d);y&&(y.cssCompiledStyles=this.getCompiledStyles(y.cssClasses.split(" ")),y.colorIndex=a++,e.push(y))}let u=0;for(const d of this.relationships){const y={id:Zt(d.entityA,d.entityB,{prefix:"id",counter:u++}),type:"normal",curve:"basis",start:d.entityA,end:d.entityB,label:d.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:d.relSpec.cardB.toLowerCase(),arrowTypeEnd:d.relSpec.cardA.toLowerCase(),pattern:d.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:h.look,labelType:"markdown"};i.push(y)}return{nodes:e,edges:i,other:{},config:h,direction:"TB"}}},xt={};Wt(xt,{draw:()=>ee});var ee=l(async function(e,i,h,a){V.info("REF0:"),V.info("Drawing er diagram (unified)",i);const{securityLevel:u,er:d,layout:y}=it(),p=a.db.getData(),m=Mt(i,u);p.type=a.type,p.layoutAlgorithm=Xt(y),p.config.flowchart.nodeSpacing=d?.nodeSpacing||140,p.config.flowchart.rankSpacing=d?.rankSpacing||80,p.direction=a.db.getDirection();const{config:j}=p,{look:W}=j;W==="neo"?p.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:p.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],p.diagramId=i,await Qt(p,m),p.layoutAlgorithm==="elk"&&m.select(".edges").lower();const T=m.selectAll('[id*="-background"]');Array.from(T).length>0&&T.each(function(){const M=Ht(this),R=M.attr("id").replace("-background",""),S=m.select(`#${CSS.escape(R)}`);if(!S.empty()){const C=S.attr("transform");M.attr("transform",C)}});const X=8;qt.insertTitle(m,"erDiagramTitleText",d?.titleTopMargin??25,a.db.getDiagramTitle()),Bt(m,X,"erDiagram",d?.useMaxWidth??!0)},"draw"),Ct=l((e,i)=>{const h=Jt,a=h(e,"r"),u=h(e,"g"),d=h(e,"b");return jt(a,u,d,i)},"fade"),rt=new Set(["redux-color","redux-dark-color"]),se=l(e=>{const{theme:i,look:h,bkgColorArray:a,borderColorArray:u}=e;if(!rt.has(i))return"";const d=a?.length>0;let y="";for(let p=0;p<e.THEME_COLOR_LIMIT;p++)y+=`
|
|
7
|
+
|
|
8
|
+
[data-look="${h}"][data-color-id="color-${p}"].node path {
|
|
9
|
+
stroke: ${u[p]};
|
|
10
|
+
${d?`fill: ${a[p]};`:""}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-look="${h}"][data-color-id="color-${p}"].node rect {
|
|
14
|
+
stroke: ${u[p]};
|
|
15
|
+
${d?`fill: ${a[p]};`:""}
|
|
16
|
+
}
|
|
17
|
+
`;return y},"genColor"),ie=l(e=>{const{look:i,theme:h,erEdgeLabelBackground:a,strokeWidth:u}=e;return`
|
|
18
|
+
${se(e)}
|
|
19
|
+
.entityBox {
|
|
20
|
+
fill: ${e.mainBkg};
|
|
21
|
+
stroke: ${e.nodeBorder};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.relationshipLabelBox {
|
|
25
|
+
fill: ${e.tertiaryColor};
|
|
26
|
+
opacity: 0.7;
|
|
27
|
+
background-color: ${e.tertiaryColor};
|
|
28
|
+
rect {
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.labelBkg {
|
|
34
|
+
background-color: ${rt.has(h)&&a?a:Ct(e.tertiaryColor,.5)};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.edgeLabel {
|
|
38
|
+
background-color: ${rt.has(h)&&a?a:e.edgeLabelBackground};
|
|
39
|
+
}
|
|
40
|
+
.edgeLabel .label rect {
|
|
41
|
+
fill: ${rt.has(h)&&a?a:e.edgeLabelBackground};
|
|
42
|
+
}
|
|
43
|
+
.edgeLabel .label text {
|
|
44
|
+
fill: ${e.textColor};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.edgeLabel .label {
|
|
48
|
+
fill: ${e.nodeBorder};
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.label {
|
|
53
|
+
font-family: ${e.fontFamily};
|
|
54
|
+
color: ${e.nodeTextColor||e.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: ${e.mainBkg};
|
|
67
|
+
stroke: ${e.nodeBorder};
|
|
68
|
+
stroke-width: ${i==="neo"?u:"1px"};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.relationshipLine {
|
|
72
|
+
stroke: ${e.lineColor};
|
|
73
|
+
stroke-width: ${i==="neo"?u:"1px"};
|
|
74
|
+
fill: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.marker {
|
|
78
|
+
fill: none !important;
|
|
79
|
+
stroke: ${e.lineColor} !important;
|
|
80
|
+
stroke-width: 1;
|
|
81
|
+
}
|
|
82
|
+
[data-look=neo].labelBkg {
|
|
83
|
+
background-color: ${Ct(e.tertiaryColor,.5)};
|
|
84
|
+
}
|
|
85
|
+
`},"getStyles"),re=ie,le={parser:$t,get db(){return new te},renderer:xt,styles:re};export{le as diagram};
|