@sme.up/ketchup2 2.0.0-SNAPSHOT-20250905083046 → 2.0.0-SNAPSHOT-20250905085901
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_basePickBy-CnrWHKZp.js +151 -0
- package/dist/_basePickBy-DGKSP0gv.cjs +1 -0
- package/dist/_baseUniq-CfaAVYmv.cjs +1 -0
- package/dist/_baseUniq-rrVUjaHq.js +614 -0
- package/dist/arc-Cvsmptc6.js +83 -0
- package/dist/arc-DXWJO88c.cjs +1 -0
- package/dist/architecture-O4VJ6CD3-Bg5u-0vt.js +5 -0
- package/dist/architecture-O4VJ6CD3-DaYZgGoD.cjs +1 -0
- package/dist/architectureDiagram-KFL7JDKH-Cc3SNGmS.cjs +36 -0
- package/dist/architectureDiagram-KFL7JDKH-D30vYX4H.js +4660 -0
- package/dist/blockDiagram-ZYB65J3Q-XNfNJO0n.cjs +122 -0
- package/dist/blockDiagram-ZYB65J3Q-sf1yE8If.js +2261 -0
- package/dist/c4Diagram-AAMF2YG6-BNCxdxyW.js +1580 -0
- package/dist/c4Diagram-AAMF2YG6-BTBu0vwj.cjs +10 -0
- package/dist/channel-BlMDdAyt.js +5 -0
- package/dist/channel-DeQCp9ft.cjs +1 -0
- package/dist/chunk-ANTBXLJU-B62KbLiF.js +8 -0
- package/dist/chunk-ANTBXLJU-BjQOW3U7.cjs +1 -0
- package/dist/chunk-FHKO5MBM-DWB4p0-W.js +15 -0
- package/dist/chunk-FHKO5MBM-DzOslnSz.cjs +1 -0
- package/dist/chunk-GLLZNHP4-DDFtxbSr.js +19 -0
- package/dist/chunk-GLLZNHP4-DDZwz-lX.cjs +15 -0
- package/dist/chunk-JBRWN2VN-BLY_1jNQ.cjs +165 -0
- package/dist/chunk-JBRWN2VN-D7vb9zR6.js +1375 -0
- package/dist/chunk-LXBSTHXV-BmkvPzxs.cjs +220 -0
- package/dist/chunk-LXBSTHXV-Brv31JUq.js +1370 -0
- package/dist/chunk-NRVI72HA-Bltdz_dQ.js +19 -0
- package/dist/chunk-NRVI72HA-ClkSCOVn.cjs +1 -0
- package/dist/chunk-OMD6QJNC--UN3JI3w.cjs +1 -0
- package/dist/chunk-OMD6QJNC-D64ATN0N.js +64 -0
- package/dist/chunk-WVR4S24B-0YswEo26.cjs +1 -0
- package/dist/chunk-WVR4S24B-DiP_ArIP.js +8 -0
- package/dist/classDiagram-3BZAVTQC-DWqAc0qT.cjs +1 -0
- package/dist/classDiagram-3BZAVTQC-f7jl_VZA.js +16 -0
- package/dist/classDiagram-v2-QTMF73CY-DWqAc0qT.cjs +1 -0
- package/dist/classDiagram-v2-QTMF73CY-f7jl_VZA.js +16 -0
- package/dist/clone-BWcBp581.cjs +1 -0
- package/dist/clone-BnZevyiW.js +8 -0
- package/dist/cytoscape.esm-CamnA8MN.js +18735 -0
- package/dist/cytoscape.esm-uM8noIeE.cjs +331 -0
- package/dist/dagre-2BBEFEWP-CUPOuCtr.js +444 -0
- package/dist/dagre-2BBEFEWP-DbhCjIet.cjs +4 -0
- package/dist/defaultLocale-D7EN2tov.js +171 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs +1 -0
- package/dist/diagram-4IRLE6MV-CQJ20yhM.cjs +24 -0
- package/dist/diagram-4IRLE6MV-DFeMx_Rq.js +532 -0
- package/dist/diagram-GUPCWM2R-CLKZFWXo.js +142 -0
- package/dist/diagram-GUPCWM2R-DQ8Z1dVv.cjs +24 -0
- package/dist/diagram-RP2FKANI-CPEWV2Fk.js +217 -0
- package/dist/diagram-RP2FKANI-DUPB9s-y.cjs +43 -0
- package/dist/erDiagram-HZWUO2LU-C0Gk1Swz.cjs +60 -0
- package/dist/erDiagram-HZWUO2LU-CyY2HjMf.js +841 -0
- package/dist/flowDiagram-THRYKUMA-gJkHOeSL.cjs +162 -0
- package/dist/flowDiagram-THRYKUMA-w-8EX9wZ.js +1620 -0
- package/dist/ganttDiagram-WV7ZQ7D5-CmPXBktC.js +2504 -0
- package/dist/ganttDiagram-WV7ZQ7D5-DATuP_Ex.cjs +267 -0
- package/dist/gitGraph-ZV4HHKMB-BXu_2mfy.js +5 -0
- package/dist/gitGraph-ZV4HHKMB-e_eUYuE2.cjs +1 -0
- package/dist/gitGraphDiagram-OJR772UL-D7Q38-er.js +699 -0
- package/dist/gitGraphDiagram-OJR772UL-vqgYdo84.cjs +65 -0
- package/dist/graph-D2z8dVgI.cjs +1 -0
- package/dist/graph-fWVDVASg.js +247 -0
- package/dist/index-CBHQ10D6.js +23234 -0
- package/dist/index-CH3q61Aa.cjs +266 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/info-63CPKGFF-B6aHvvSX.js +5 -0
- package/dist/info-63CPKGFF-B7Bgcqhg.cjs +1 -0
- package/dist/infoDiagram-DDUCL6P7-Bb42gyGF.cjs +2 -0
- package/dist/infoDiagram-DDUCL6P7-G8W4Cyzb.js +24 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/journeyDiagram-FFXJYRFH-Bck7isLB.js +836 -0
- package/dist/journeyDiagram-FFXJYRFH-DFTMezSW.cjs +139 -0
- package/dist/kanban-definition-KOZQBZVT-Bf4fYslI.cjs +89 -0
- package/dist/kanban-definition-KOZQBZVT-hP_ZGt4S.js +719 -0
- package/dist/katex-C2g-EhzP.cjs +261 -0
- package/dist/katex-CUSbq6rG.js +11692 -0
- package/dist/ketchup2.cjs.js +1 -50
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +23 -8127
- package/dist/layout-B-lXVQQa.cjs +1 -0
- package/dist/layout-CSXO9mhe.js +1324 -0
- package/dist/linear-BZgyGW2T.cjs +1 -0
- package/dist/linear-Cx2KaZOo.js +259 -0
- package/dist/mermaid-parser.core-COPhuhoR.js +12966 -0
- package/dist/mermaid-parser.core-DgsyN-z8.cjs +128 -0
- package/dist/mindmap-definition-LNHGMQRG-DJsQpf8y.cjs +95 -0
- package/dist/mindmap-definition-LNHGMQRG-DQUm__JP.js +3230 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/packet-HUATNLJX-C2VUbl0T.js +5 -0
- package/dist/packet-HUATNLJX-G8eR5ynJ.cjs +1 -0
- package/dist/pie-WTHONI2E-CfCIU8Tr.cjs +1 -0
- package/dist/pie-WTHONI2E-D4qp2Ay_.js +5 -0
- package/dist/pieDiagram-DBDJKBY4-DqPdbFqw.cjs +30 -0
- package/dist/pieDiagram-DBDJKBY4-nGyOC7-l.js +161 -0
- package/dist/quadrantDiagram-YPSRARAO-DF8AYAxY.cjs +7 -0
- package/dist/quadrantDiagram-YPSRARAO-hyzkVUsQ.js +1022 -0
- package/dist/radar-NJJJXTRR-BpgvgEoJ.cjs +1 -0
- package/dist/radar-NJJJXTRR-DJxmCfQM.js +5 -0
- package/dist/requirementDiagram-EGVEC5DT-DOtzLvFO.cjs +64 -0
- package/dist/requirementDiagram-EGVEC5DT-RXOLhPE3.js +850 -0
- package/dist/sankeyDiagram-HRAUVNP4-CUoOlfVB.cjs +10 -0
- package/dist/sankeyDiagram-HRAUVNP4-DGFS1jVK.js +810 -0
- package/dist/sequenceDiagram-4MX5Z3NR-Cx06uio3.js +2281 -0
- package/dist/sequenceDiagram-4MX5Z3NR-DoW8n1Xr.cjs +122 -0
- package/dist/stateDiagram-UUKSUZ4H-Burg3mSA.cjs +1 -0
- package/dist/stateDiagram-UUKSUZ4H-C2OsUgT8.js +263 -0
- package/dist/stateDiagram-v2-EYPG3UTE-CVHvpjP1.cjs +1 -0
- package/dist/stateDiagram-v2-EYPG3UTE-DL1ew380.js +16 -0
- package/dist/timeline-definition-3HZDQTIS-B66f0uxR.cjs +61 -0
- package/dist/timeline-definition-3HZDQTIS-Bos8RJ8U.js +797 -0
- package/dist/treemap-75Q7IDZK-DyG1W8W-.cjs +1 -0
- package/dist/treemap-75Q7IDZK-Dynfjwww.js +5 -0
- package/dist/xychartDiagram-FDP5SA34-BzWuQtxg.js +1340 -0
- package/dist/xychartDiagram-FDP5SA34-CvgmaqN1.cjs +7 -0
- package/package.json +3 -3
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { p as B } from "./chunk-ANTBXLJU-B62KbLiF.js";
|
|
2
|
+
import { _ as b, D as m, H as C, e as S, l as w, b as D, a as T, p as E, q as F, g as P, s as z, E as A, F as W, y as _ } from "./index-CBHQ10D6.js";
|
|
3
|
+
import { p as N } from "./mermaid-parser.core-COPhuhoR.js";
|
|
4
|
+
var L = W.packet, u, v = (u = class {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.packet = [], this.setAccTitle = D, this.getAccTitle = T, this.setDiagramTitle = E, this.getDiagramTitle = F, this.getAccDescription = P, this.setAccDescription = z;
|
|
7
|
+
}
|
|
8
|
+
getConfig() {
|
|
9
|
+
const t = m({
|
|
10
|
+
...L,
|
|
11
|
+
...A().packet
|
|
12
|
+
});
|
|
13
|
+
return t.showBits && (t.paddingY += 10), t;
|
|
14
|
+
}
|
|
15
|
+
getPacket() {
|
|
16
|
+
return this.packet;
|
|
17
|
+
}
|
|
18
|
+
pushWord(t) {
|
|
19
|
+
t.length > 0 && this.packet.push(t);
|
|
20
|
+
}
|
|
21
|
+
clear() {
|
|
22
|
+
_(), this.packet = [];
|
|
23
|
+
}
|
|
24
|
+
}, b(u, "PacketDB"), u), M = 1e4, Y = /* @__PURE__ */ b((e, t) => {
|
|
25
|
+
B(e, t);
|
|
26
|
+
let r = -1, s = [], n = 1;
|
|
27
|
+
const { bitsPerRow: l } = t.getConfig();
|
|
28
|
+
for (let { start: a, end: i, bits: d, label: c } of e.blocks) {
|
|
29
|
+
if (a !== void 0 && i !== void 0 && i < a)
|
|
30
|
+
throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);
|
|
31
|
+
if (a ??= r + 1, a !== r + 1)
|
|
32
|
+
throw new Error(
|
|
33
|
+
`Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${r + 1}.`
|
|
34
|
+
);
|
|
35
|
+
if (d === 0)
|
|
36
|
+
throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
|
|
37
|
+
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; ) {
|
|
38
|
+
const [p, o] = H({ start: a, end: i, bits: d, label: c }, n, l);
|
|
39
|
+
if (s.push(p), p.end + 1 === n * l && (t.pushWord(s), s = [], n++), !o)
|
|
40
|
+
break;
|
|
41
|
+
({ start: a, end: i, bits: d, label: c } = o);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
t.pushWord(s);
|
|
45
|
+
}, "populate"), H = /* @__PURE__ */ b((e, t, r) => {
|
|
46
|
+
if (e.start === void 0)
|
|
47
|
+
throw new Error("start should have been set during first phase");
|
|
48
|
+
if (e.end === void 0)
|
|
49
|
+
throw new Error("end should have been set during first phase");
|
|
50
|
+
if (e.start > e.end)
|
|
51
|
+
throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
|
|
52
|
+
if (e.end + 1 <= t * r)
|
|
53
|
+
return [e, void 0];
|
|
54
|
+
const s = t * r - 1, n = t * r;
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
start: e.start,
|
|
58
|
+
end: s,
|
|
59
|
+
label: e.label,
|
|
60
|
+
bits: s - e.start
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
start: n,
|
|
64
|
+
end: e.end,
|
|
65
|
+
label: e.label,
|
|
66
|
+
bits: e.end - n
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
}, "getNextFittingBlock"), x = {
|
|
70
|
+
// @ts-expect-error - PacketDB is not assignable to DiagramDB
|
|
71
|
+
parser: { yy: void 0 },
|
|
72
|
+
parse: /* @__PURE__ */ b(async (e) => {
|
|
73
|
+
const t = await N("packet", e), r = x.parser?.yy;
|
|
74
|
+
if (!(r instanceof v))
|
|
75
|
+
throw new Error(
|
|
76
|
+
"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."
|
|
77
|
+
);
|
|
78
|
+
w.debug(t), Y(t, r);
|
|
79
|
+
}, "parse")
|
|
80
|
+
}, I = /* @__PURE__ */ b((e, t, r, s) => {
|
|
81
|
+
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);
|
|
82
|
+
f.attr("viewbox", `0 0 ${k} ${g}`), S(f, g, k, l.useMaxWidth);
|
|
83
|
+
for (const [y, $] of p.entries())
|
|
84
|
+
O(f, $, y, l);
|
|
85
|
+
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");
|
|
86
|
+
}, "draw"), O = /* @__PURE__ */ b((e, t, r, { rowHeight: s, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
|
|
87
|
+
const c = e.append("g"), p = r * (s + l) + l;
|
|
88
|
+
for (const o of t) {
|
|
89
|
+
const h = o.start % i * a + 1, g = (o.end - o.start + 1) * a - n;
|
|
90
|
+
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)
|
|
91
|
+
continue;
|
|
92
|
+
const k = o.end === o.start, f = p - 2;
|
|
93
|
+
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);
|
|
94
|
+
}
|
|
95
|
+
}, "drawWord"), j = { draw: I }, q = {
|
|
96
|
+
byteFontSize: "10px",
|
|
97
|
+
startByteColor: "black",
|
|
98
|
+
endByteColor: "black",
|
|
99
|
+
labelColor: "black",
|
|
100
|
+
labelFontSize: "12px",
|
|
101
|
+
titleColor: "black",
|
|
102
|
+
titleFontSize: "14px",
|
|
103
|
+
blockStrokeColor: "black",
|
|
104
|
+
blockStrokeWidth: "1",
|
|
105
|
+
blockFillColor: "#efefef"
|
|
106
|
+
}, G = /* @__PURE__ */ b(({ packet: e } = {}) => {
|
|
107
|
+
const t = m(q, e);
|
|
108
|
+
return `
|
|
109
|
+
.packetByte {
|
|
110
|
+
font-size: ${t.byteFontSize};
|
|
111
|
+
}
|
|
112
|
+
.packetByte.start {
|
|
113
|
+
fill: ${t.startByteColor};
|
|
114
|
+
}
|
|
115
|
+
.packetByte.end {
|
|
116
|
+
fill: ${t.endByteColor};
|
|
117
|
+
}
|
|
118
|
+
.packetLabel {
|
|
119
|
+
fill: ${t.labelColor};
|
|
120
|
+
font-size: ${t.labelFontSize};
|
|
121
|
+
}
|
|
122
|
+
.packetTitle {
|
|
123
|
+
fill: ${t.titleColor};
|
|
124
|
+
font-size: ${t.titleFontSize};
|
|
125
|
+
}
|
|
126
|
+
.packetBlock {
|
|
127
|
+
stroke: ${t.blockStrokeColor};
|
|
128
|
+
stroke-width: ${t.blockStrokeWidth};
|
|
129
|
+
fill: ${t.blockFillColor};
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
}, "styles"), X = {
|
|
133
|
+
parser: x,
|
|
134
|
+
get db() {
|
|
135
|
+
return new v();
|
|
136
|
+
},
|
|
137
|
+
renderer: j,
|
|
138
|
+
styles: G
|
|
139
|
+
};
|
|
140
|
+
export {
|
|
141
|
+
X as diagram
|
|
142
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./chunk-ANTBXLJU-BjQOW3U7.cjs"),a=require("./index-CH3q61Aa.cjs"),$=require("./mermaid-parser.core-DgsyN-z8.cjs");var B=a.defaultConfig_default.packet,b,m=(b=class{constructor(){this.packet=[],this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getAccDescription=a.getAccDescription,this.setAccDescription=a.setAccDescription}getConfig(){const t=a.cleanAndMerge({...B,...a.getConfig().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){a.clear(),this.packet=[]}},a.__name(b,"PacketDB"),b),C=1e4,_=a.__name((e,t)=>{y.populateCommonDb(e,t);let o=-1,i=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:n,bits:p,label:d}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??=o+1,r!==o+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${o+1}.`);if(p===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??=r+(p??1)-1,p??=n-r+1,o=n,a.log.debug(`Packet block ${r} - ${o} with label ${d}`);i.length<=c+1&&t.getPacket().length<C;){const[g,s]=S({start:r,end:n,bits:p,label:d},l,c);if(i.push(g),g.end+1===l*c&&(t.pushWord(i),i=[],l++),!s)break;({start:r,end:n,bits:p,label:d}=s)}}t.pushWord(i)},"populate"),S=a.__name((e,t,o)=>{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*o)return[e,void 0];const i=t*o-1,l=t*o;return[{start:e.start,end:i,label:e.label,bits:i-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),w={parser:{yy:void 0},parse:a.__name(async e=>{const t=await $.parse("packet",e),o=w.parser?.yy;if(!(o instanceof m))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.");a.log.debug(t),_(t,o)},"parse")},T=a.__name((e,t,o,i)=>{const l=i.db,c=l.getConfig(),{rowHeight:r,paddingY:n,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),s=l.getDiagramTitle(),k=r+n,h=k*(g.length+1)-(s?0:r),f=p*d+2,u=a.selectSvgElement(t);u.attr("viewbox",`0 0 ${f} ${h}`),a.configureSvgSize(u,h,f,c.useMaxWidth);for(const[v,x]of g.entries())P(u,x,v,c);u.append("text").text(s).attr("x",f/2).attr("y",h-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),P=a.__name((e,t,o,{rowHeight:i,paddingX:l,paddingY:c,bitWidth:r,bitsPerRow:n,showBits:p})=>{const d=e.append("g"),g=o*(i+c)+c;for(const s of t){const k=s.start%n*r+1,h=(s.end-s.start+1)*r-l;if(d.append("rect").attr("x",k).attr("y",g).attr("width",h).attr("height",i).attr("class","packetBlock"),d.append("text").attr("x",k+h/2).attr("y",g+i/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!p)continue;const f=s.end===s.start,u=g-2;d.append("text").attr("x",k+(f?h/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||d.append("text").attr("x",k+h).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),D={draw:T},A={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(A,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"),E={parser:w,get db(){return new m},renderer:D,styles:z};exports.diagram=E;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { p as k } from "./chunk-ANTBXLJU-B62KbLiF.js";
|
|
2
|
+
import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./index-CBHQ10D6.js";
|
|
3
|
+
import { p as W } from "./mermaid-parser.core-COPhuhoR.js";
|
|
4
|
+
var x = {
|
|
5
|
+
showLegend: !0,
|
|
6
|
+
ticks: 5,
|
|
7
|
+
max: null,
|
|
8
|
+
min: 0,
|
|
9
|
+
graticule: "circle"
|
|
10
|
+
}, w = {
|
|
11
|
+
axes: [],
|
|
12
|
+
curves: [],
|
|
13
|
+
options: x
|
|
14
|
+
}, h = structuredClone(w), B = z.radar, j = /* @__PURE__ */ l(() => f({
|
|
15
|
+
...B,
|
|
16
|
+
...C().radar
|
|
17
|
+
}), "getConfig"), b = /* @__PURE__ */ l(() => h.axes, "getAxes"), q = /* @__PURE__ */ l(() => h.curves, "getCurves"), K = /* @__PURE__ */ l(() => h.options, "getOptions"), N = /* @__PURE__ */ l((a) => {
|
|
18
|
+
h.axes = a.map((t) => ({
|
|
19
|
+
name: t.name,
|
|
20
|
+
label: t.label ?? t.name
|
|
21
|
+
}));
|
|
22
|
+
}, "setAxes"), U = /* @__PURE__ */ l((a) => {
|
|
23
|
+
h.curves = a.map((t) => ({
|
|
24
|
+
name: t.name,
|
|
25
|
+
label: t.label ?? t.name,
|
|
26
|
+
entries: X(t.entries)
|
|
27
|
+
}));
|
|
28
|
+
}, "setCurves"), X = /* @__PURE__ */ l((a) => {
|
|
29
|
+
if (a[0].axis == null)
|
|
30
|
+
return a.map((e) => e.value);
|
|
31
|
+
const t = b();
|
|
32
|
+
if (t.length === 0)
|
|
33
|
+
throw new Error("Axes must be populated before curves for reference entries");
|
|
34
|
+
return t.map((e) => {
|
|
35
|
+
const r = a.find((s) => s.axis?.$refText === e.name);
|
|
36
|
+
if (r === void 0)
|
|
37
|
+
throw new Error("Missing entry for axis " + e.label);
|
|
38
|
+
return r.value;
|
|
39
|
+
});
|
|
40
|
+
}, "computeCurveEntries"), Y = /* @__PURE__ */ l((a) => {
|
|
41
|
+
const t = a.reduce(
|
|
42
|
+
(e, r) => (e[r.name] = r, e),
|
|
43
|
+
{}
|
|
44
|
+
);
|
|
45
|
+
h.options = {
|
|
46
|
+
showLegend: t.showLegend?.value ?? x.showLegend,
|
|
47
|
+
ticks: t.ticks?.value ?? x.ticks,
|
|
48
|
+
max: t.max?.value ?? x.max,
|
|
49
|
+
min: t.min?.value ?? x.min,
|
|
50
|
+
graticule: t.graticule?.value ?? x.graticule
|
|
51
|
+
};
|
|
52
|
+
}, "setOptions"), Z = /* @__PURE__ */ l(() => {
|
|
53
|
+
P(), h = structuredClone(w);
|
|
54
|
+
}, "clear"), $ = {
|
|
55
|
+
getAxes: b,
|
|
56
|
+
getCurves: q,
|
|
57
|
+
getOptions: K,
|
|
58
|
+
setAxes: N,
|
|
59
|
+
setCurves: U,
|
|
60
|
+
setOptions: Y,
|
|
61
|
+
getConfig: j,
|
|
62
|
+
clear: Z,
|
|
63
|
+
setAccTitle: D,
|
|
64
|
+
getAccTitle: _,
|
|
65
|
+
setDiagramTitle: I,
|
|
66
|
+
getDiagramTitle: F,
|
|
67
|
+
getAccDescription: E,
|
|
68
|
+
setAccDescription: R
|
|
69
|
+
}, J = /* @__PURE__ */ l((a) => {
|
|
70
|
+
k(a, $);
|
|
71
|
+
const { axes: t, curves: e, options: r } = a;
|
|
72
|
+
$.setAxes(t), $.setCurves(e), $.setOptions(r);
|
|
73
|
+
}, "populate"), Q = {
|
|
74
|
+
parse: /* @__PURE__ */ l(async (a) => {
|
|
75
|
+
const t = await W("radar", a);
|
|
76
|
+
H.debug(t), J(t);
|
|
77
|
+
}, "parse")
|
|
78
|
+
}, tt = /* @__PURE__ */ l((a, t, e, r) => {
|
|
79
|
+
const s = r.db, o = s.getAxes(), i = s.getCurves(), n = s.getOptions(), c = s.getConfig(), d = s.getDiagramTitle(), p = G(t), u = et(p, c), g = n.max ?? Math.max(...i.map((y) => Math.max(...y.entries))), m = n.min, v = Math.min(c.width, c.height) / 2;
|
|
80
|
+
at(u, o, v, n.ticks, n.graticule), rt(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);
|
|
81
|
+
}, "draw"), et = /* @__PURE__ */ l((a, t) => {
|
|
82
|
+
const e = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, s = {
|
|
83
|
+
x: t.marginLeft + t.width / 2,
|
|
84
|
+
y: t.marginTop + t.height / 2
|
|
85
|
+
};
|
|
86
|
+
return a.attr("viewbox", `0 0 ${e} ${r}`).attr("width", e).attr("height", r), a.append("g").attr("transform", `translate(${s.x}, ${s.y})`);
|
|
87
|
+
}, "drawFrame"), at = /* @__PURE__ */ l((a, t, e, r, s) => {
|
|
88
|
+
if (s === "circle")
|
|
89
|
+
for (let o = 0; o < r; o++) {
|
|
90
|
+
const i = e * (o + 1) / r;
|
|
91
|
+
a.append("circle").attr("r", i).attr("class", "radarGraticule");
|
|
92
|
+
}
|
|
93
|
+
else if (s === "polygon") {
|
|
94
|
+
const o = t.length;
|
|
95
|
+
for (let i = 0; i < r; i++) {
|
|
96
|
+
const n = e * (i + 1) / r, c = t.map((d, p) => {
|
|
97
|
+
const u = 2 * p * Math.PI / o - Math.PI / 2, g = n * Math.cos(u), m = n * Math.sin(u);
|
|
98
|
+
return `${g},${m}`;
|
|
99
|
+
}).join(" ");
|
|
100
|
+
a.append("polygon").attr("points", c).attr("class", "radarGraticule");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, "drawGraticule"), rt = /* @__PURE__ */ l((a, t, e, r) => {
|
|
104
|
+
const s = t.length;
|
|
105
|
+
for (let o = 0; o < s; o++) {
|
|
106
|
+
const i = t[o].label, n = 2 * o * Math.PI / s - Math.PI / 2;
|
|
107
|
+
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");
|
|
108
|
+
}
|
|
109
|
+
}, "drawAxes");
|
|
110
|
+
function M(a, t, e, r, s, o, i) {
|
|
111
|
+
const n = t.length, c = Math.min(i.width, i.height) / 2;
|
|
112
|
+
e.forEach((d, p) => {
|
|
113
|
+
if (d.entries.length !== n)
|
|
114
|
+
return;
|
|
115
|
+
const u = d.entries.map((g, m) => {
|
|
116
|
+
const v = 2 * Math.PI * m / n - Math.PI / 2, y = A(g, r, s, c), O = y * Math.cos(v), S = y * Math.sin(v);
|
|
117
|
+
return { x: O, y: S };
|
|
118
|
+
});
|
|
119
|
+
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}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
l(M, "drawCurves");
|
|
123
|
+
function A(a, t, e, r) {
|
|
124
|
+
const s = Math.min(Math.max(a, t), e);
|
|
125
|
+
return r * (s - t) / (e - t);
|
|
126
|
+
}
|
|
127
|
+
l(A, "relativeRadius");
|
|
128
|
+
function L(a, t) {
|
|
129
|
+
const e = a.length;
|
|
130
|
+
let r = `M${a[0].x},${a[0].y}`;
|
|
131
|
+
for (let s = 0; s < e; s++) {
|
|
132
|
+
const o = a[(s - 1 + e) % e], i = a[s], n = a[(s + 1) % e], c = a[(s + 2) % e], d = {
|
|
133
|
+
x: i.x + (n.x - o.x) * t,
|
|
134
|
+
y: i.y + (n.y - o.y) * t
|
|
135
|
+
}, p = {
|
|
136
|
+
x: n.x - (c.x - i.x) * t,
|
|
137
|
+
y: n.y - (c.y - i.y) * t
|
|
138
|
+
};
|
|
139
|
+
r += ` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`;
|
|
140
|
+
}
|
|
141
|
+
return `${r} Z`;
|
|
142
|
+
}
|
|
143
|
+
l(L, "closedRoundCurve");
|
|
144
|
+
function T(a, t, e, r) {
|
|
145
|
+
if (!e)
|
|
146
|
+
return;
|
|
147
|
+
const s = (r.width / 2 + r.marginRight) * 3 / 4, o = -(r.height / 2 + r.marginTop) * 3 / 4, i = 20;
|
|
148
|
+
t.forEach((n, c) => {
|
|
149
|
+
const d = a.append("g").attr("transform", `translate(${s}, ${o + c * i})`);
|
|
150
|
+
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);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
l(T, "drawLegend");
|
|
154
|
+
var st = { draw: tt }, nt = /* @__PURE__ */ l((a, t) => {
|
|
155
|
+
let e = "";
|
|
156
|
+
for (let r = 0; r < a.THEME_COLOR_LIMIT; r++) {
|
|
157
|
+
const s = a[`cScale${r}`];
|
|
158
|
+
e += `
|
|
159
|
+
.radarCurve-${r} {
|
|
160
|
+
color: ${s};
|
|
161
|
+
fill: ${s};
|
|
162
|
+
fill-opacity: ${t.curveOpacity};
|
|
163
|
+
stroke: ${s};
|
|
164
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
165
|
+
}
|
|
166
|
+
.radarLegendBox-${r} {
|
|
167
|
+
fill: ${s};
|
|
168
|
+
fill-opacity: ${t.curveOpacity};
|
|
169
|
+
stroke: ${s};
|
|
170
|
+
}
|
|
171
|
+
`;
|
|
172
|
+
}
|
|
173
|
+
return e;
|
|
174
|
+
}, "genIndexStyles"), ot = /* @__PURE__ */ l((a) => {
|
|
175
|
+
const t = V(), e = C(), r = f(t, e.themeVariables), s = f(r.radar, a);
|
|
176
|
+
return { themeVariables: r, radarOptions: s };
|
|
177
|
+
}, "buildRadarStyleOptions"), it = /* @__PURE__ */ l(({ radar: a } = {}) => {
|
|
178
|
+
const { themeVariables: t, radarOptions: e } = ot(a);
|
|
179
|
+
return `
|
|
180
|
+
.radarTitle {
|
|
181
|
+
font-size: ${t.fontSize};
|
|
182
|
+
color: ${t.titleColor};
|
|
183
|
+
dominant-baseline: hanging;
|
|
184
|
+
text-anchor: middle;
|
|
185
|
+
}
|
|
186
|
+
.radarAxisLine {
|
|
187
|
+
stroke: ${e.axisColor};
|
|
188
|
+
stroke-width: ${e.axisStrokeWidth};
|
|
189
|
+
}
|
|
190
|
+
.radarAxisLabel {
|
|
191
|
+
dominant-baseline: middle;
|
|
192
|
+
text-anchor: middle;
|
|
193
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
194
|
+
color: ${e.axisColor};
|
|
195
|
+
}
|
|
196
|
+
.radarGraticule {
|
|
197
|
+
fill: ${e.graticuleColor};
|
|
198
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
199
|
+
stroke: ${e.graticuleColor};
|
|
200
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
201
|
+
}
|
|
202
|
+
.radarLegendText {
|
|
203
|
+
text-anchor: start;
|
|
204
|
+
font-size: ${e.legendFontSize}px;
|
|
205
|
+
dominant-baseline: hanging;
|
|
206
|
+
}
|
|
207
|
+
${nt(t, e)}
|
|
208
|
+
`;
|
|
209
|
+
}, "styles"), ut = {
|
|
210
|
+
parser: Q,
|
|
211
|
+
db: $,
|
|
212
|
+
renderer: st,
|
|
213
|
+
styles: it
|
|
214
|
+
};
|
|
215
|
+
export {
|
|
216
|
+
ut as diagram
|
|
217
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./chunk-ANTBXLJU-BjQOW3U7.cjs"),n=require("./index-CH3q61Aa.cjs"),O=require("./mermaid-parser.core-DgsyN-z8.cjs");var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y={axes:[],curves:[],options:h},p=structuredClone(y),S=n.defaultConfig_default.radar,k=n.__name(()=>n.cleanAndMerge({...S,...n.getConfig().radar}),"getConfig"),f=n.__name(()=>p.axes,"getAxes"),D=n.__name(()=>p.curves,"getCurves"),R=n.__name(()=>p.options,"getOptions"),I=n.__name(a=>{p.axes=a.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),E=n.__name(a=>{p.curves=a.map(e=>({name:e.name,label:e.label??e.name,entries:F(e.entries)}))},"setCurves"),F=n.__name(a=>{if(a[0].axis==null)return a.map(t=>t.value);const e=f();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(t=>{const r=a.find(s=>s.axis?.$refText===t.name);if(r===void 0)throw new Error("Missing entry for axis "+t.label);return r.value})},"computeCurveEntries"),P=n.__name(a=>{const e=a.reduce((t,r)=>(t[r.name]=r,t),{});p.options={showLegend:e.showLegend?.value??h.showLegend,ticks:e.ticks?.value??h.ticks,max:e.max?.value??h.max,min:e.min?.value??h.min,graticule:e.graticule?.value??h.graticule}},"setOptions"),G=n.__name(()=>{n.clear(),p=structuredClone(y)},"clear"),_={getAxes:f,getCurves:D,getOptions:R,setAxes:I,setCurves:E,setOptions:P,getConfig:k,clear:G,setAccTitle:n.setAccTitle,getAccTitle:n.getAccTitle,setDiagramTitle:n.setDiagramTitle,getDiagramTitle:n.getDiagramTitle,getAccDescription:n.getAccDescription,setAccDescription:n.setAccDescription},z=n.__name(a=>{L.populateCommonDb(a,_);const{axes:e,curves:t,options:r}=a;_.setAxes(e),_.setCurves(t),_.setOptions(r)},"populate"),B={parse:n.__name(async a=>{const e=await O.parse("radar",a);n.log.debug(e),z(e)},"parse")},V=n.__name((a,e,t,r)=>{const s=r.db,o=s.getAxes(),l=s.getCurves(),i=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),m=n.selectSvgElement(e),u=W(m,c),g=i.max??Math.max(...l.map($=>Math.max(...$.entries))),x=i.min,v=Math.min(c.width,c.height)/2;j(u,o,v,i.ticks,i.graticule),q(u,o,v,c),C(u,o,l,x,g,i.graticule,c),A(u,l,i.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),W=n.__name((a,e)=>{const t=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,s={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return a.attr("viewbox",`0 0 ${t} ${r}`).attr("width",t).attr("height",r),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),j=n.__name((a,e,t,r,s)=>{if(s==="circle")for(let o=0;o<r;o++){const l=t*(o+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const o=e.length;for(let l=0;l<r;l++){const i=t*(l+1)/r,c=e.map((d,m)=>{const u=2*m*Math.PI/o-Math.PI/2,g=i*Math.cos(u),x=i*Math.sin(u);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),q=n.__name((a,e,t,r)=>{const s=e.length;for(let o=0;o<s;o++){const l=e[o].label,i=2*o*Math.PI/s-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",t*r.axisScaleFactor*Math.cos(i)).attr("y2",t*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",t*r.axisLabelFactor*Math.cos(i)).attr("y",t*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,e,t,r,s,o,l){const i=e.length,c=Math.min(l.width,l.height)/2;t.forEach((d,m)=>{if(d.entries.length!==i)return;const u=d.entries.map((g,x)=>{const v=2*Math.PI*x/i-Math.PI/2,$=w(g,r,s,c),M=$*Math.cos(v),T=$*Math.sin(v);return{x:M,y:T}});o==="circle"?a.append("path").attr("d",b(u,l.curveTension)).attr("class",`radarCurve-${m}`):o==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${m}`)})}n.__name(C,"drawCurves");function w(a,e,t,r){const s=Math.min(Math.max(a,e),t);return r*(s-e)/(t-e)}n.__name(w,"relativeRadius");function b(a,e){const t=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<t;s++){const o=a[(s-1+t)%t],l=a[s],i=a[(s+1)%t],c=a[(s+2)%t],d={x:l.x+(i.x-o.x)*e,y:l.y+(i.y-o.y)*e},m={x:i.x-(c.x-l.x)*e,y:i.y-(c.y-l.y)*e};r+=` C${d.x},${d.y} ${m.x},${m.y} ${i.x},${i.y}`}return`${r} Z`}n.__name(b,"closedRoundCurve");function A(a,e,t,r){if(!t)return;const s=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,l=20;e.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${s}, ${o+c*l})`);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(i.label)})}n.__name(A,"drawLegend");var H={draw:V},N=n.__name((a,e)=>{let t="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];t+=`
|
|
2
|
+
.radarCurve-${r} {
|
|
3
|
+
color: ${s};
|
|
4
|
+
fill: ${s};
|
|
5
|
+
fill-opacity: ${e.curveOpacity};
|
|
6
|
+
stroke: ${s};
|
|
7
|
+
stroke-width: ${e.curveStrokeWidth};
|
|
8
|
+
}
|
|
9
|
+
.radarLegendBox-${r} {
|
|
10
|
+
fill: ${s};
|
|
11
|
+
fill-opacity: ${e.curveOpacity};
|
|
12
|
+
stroke: ${s};
|
|
13
|
+
}
|
|
14
|
+
`}return t},"genIndexStyles"),U=n.__name(a=>{const e=n.getThemeVariables3(),t=n.getConfig(),r=n.cleanAndMerge(e,t.themeVariables),s=n.cleanAndMerge(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),X=n.__name(({radar:a}={})=>{const{themeVariables:e,radarOptions:t}=U(a);return`
|
|
15
|
+
.radarTitle {
|
|
16
|
+
font-size: ${e.fontSize};
|
|
17
|
+
color: ${e.titleColor};
|
|
18
|
+
dominant-baseline: hanging;
|
|
19
|
+
text-anchor: middle;
|
|
20
|
+
}
|
|
21
|
+
.radarAxisLine {
|
|
22
|
+
stroke: ${t.axisColor};
|
|
23
|
+
stroke-width: ${t.axisStrokeWidth};
|
|
24
|
+
}
|
|
25
|
+
.radarAxisLabel {
|
|
26
|
+
dominant-baseline: middle;
|
|
27
|
+
text-anchor: middle;
|
|
28
|
+
font-size: ${t.axisLabelFontSize}px;
|
|
29
|
+
color: ${t.axisColor};
|
|
30
|
+
}
|
|
31
|
+
.radarGraticule {
|
|
32
|
+
fill: ${t.graticuleColor};
|
|
33
|
+
fill-opacity: ${t.graticuleOpacity};
|
|
34
|
+
stroke: ${t.graticuleColor};
|
|
35
|
+
stroke-width: ${t.graticuleStrokeWidth};
|
|
36
|
+
}
|
|
37
|
+
.radarLegendText {
|
|
38
|
+
text-anchor: start;
|
|
39
|
+
font-size: ${t.legendFontSize}px;
|
|
40
|
+
dominant-baseline: hanging;
|
|
41
|
+
}
|
|
42
|
+
${N(e,t)}
|
|
43
|
+
`},"styles"),J={parser:B,db:_,renderer:H,styles:X};exports.diagram=J;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xt=require("./chunk-WVR4S24B-0YswEo26.cjs"),vt=require("./chunk-NRVI72HA-ClkSCOVn.cjs"),a=require("./index-CH3q61Aa.cjs"),Dt=require("./channel-DeQCp9ft.cjs");var ht=function(){var s=a.__name(function(R,r,c,l){for(c=c||{},l=R.length;l--;c[R[l]]=r);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],o=[1,10],d=[1,11],h=[1,12],u=[1,13],f=[1,20],y=[1,21],k=[1,22],w=[1,23],K=[1,24],S=[1,19],$=[1,25],Z=[1,26],T=[1,18],V=[1,33],tt=[1,34],et=[1,35],st=[1,36],it=[1,37],ut=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],O=[1,42],A=[1,43],L=[1,52],M=[40,50,68,69],B=[1,63],F=[1,61],N=[1,58],Y=[1,62],P=[1,64],U=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],dt=[63,64,65,66,67],_t=[1,81],pt=[1,80],ft=[1,78],yt=[1,79],gt=[6,10,42,47],x=[6,10,13,41,42,47,48,49],j=[1,89],W=[1,88],q=[1,87],z=[19,56],mt=[1,98],bt=[1,97],nt=[19,56,58,60],rt={trace:a.__name(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,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$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",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"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],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:a.__name(function(r,c,l,n,_,t,G){var e=t.length-1;switch(_){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:n.addEntity(t[e-4]),n.addEntity(t[e-2]),n.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:n.addEntity(t[e-8]),n.addEntity(t[e-4]),n.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),n.setClass([t[e-8]],t[e-6]),n.setClass([t[e-4]],t[e-2]);break;case 10:n.addEntity(t[e-6]),n.addEntity(t[e-2]),n.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),n.setClass([t[e-6]],t[e-4]);break;case 11:n.addEntity(t[e-6]),n.addEntity(t[e-4]),n.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),n.setClass([t[e-4]],t[e-2]);break;case 12:n.addEntity(t[e-3]),n.addAttributes(t[e-3],t[e-1]);break;case 13:n.addEntity(t[e-5]),n.addAttributes(t[e-5],t[e-1]),n.setClass([t[e-5]],t[e-3]);break;case 14:n.addEntity(t[e-2]);break;case 15:n.addEntity(t[e-4]),n.setClass([t[e-4]],t[e-2]);break;case 16:n.addEntity(t[e]);break;case 17:n.addEntity(t[e-2]),n.setClass([t[e-2]],t[e]);break;case 18:n.addEntity(t[e-6],t[e-4]),n.addAttributes(t[e-6],t[e-1]);break;case 19:n.addEntity(t[e-8],t[e-6]),n.addAttributes(t[e-8],t[e-1]),n.setClass([t[e-8]],t[e-3]);break;case 20:n.addEntity(t[e-5],t[e-3]);break;case 21:n.addEntity(t[e-7],t[e-5]),n.setClass([t[e-7]],t[e-2]);break;case 22:n.addEntity(t[e-3],t[e-1]);break;case 23:n.addEntity(t[e-5],t[e-3]),n.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=t[e-3],n.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 56:case 64:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],n.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],n.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 76:case 77:this.$=t[e].replace(/"/g,"");break;case 55:case 78:this.$=t[e];break;case 57:t[e].push(t[e-1]),this.$=t[e];break;case 58:this.$={type:t[e-1],name:t[e]};break;case 59:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 60:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 61:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 62:case 63:case 66:this.$=t[e];break;case 65:t[e-2].push(t[e]),this.$=t[e-2];break;case 67:this.$=t[e].replace(/"/g,"");break;case 68:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.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:o,24:d,26:h,28:u,29:14,30:15,31:16,32:17,33:f,34:y,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:27,11:9,22:o,24:d,26:h,28:u,29:14,30:15,31:16,32:17,33:f,34:y,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:V,64:tt,65:et,66:st,67:it}),{23:[1,38]},{25:[1,39]},{27:[1,40]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(ut,[2,54]),s(ut,[2,55]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:41,40:O,41:A},{16:44,40:O,41:A},{16:45,40:O,41:A},s(i,[2,4]),{11:46,40:S,50:T},{16:47,40:O,41:A},{18:48,19:[1,49],51:50,52:51,56:L},{11:53,40:S,50:T},{62:54,68:[1,55],69:[1,56]},s(M,[2,69]),s(M,[2,70]),s(M,[2,71]),s(M,[2,72]),s(M,[2,73]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:B,38:57,41:F,42:N,45:59,46:60,48:Y,49:P},s(U,[2,37]),s(U,[2,38]),{16:65,40:O,41:A,42:N},{13:B,38:66,41:F,42:N,45:59,46:60,48:Y,49:P},{13:[1,67],15:[1,68]},s(i,[2,17],{61:32,12:69,17:[1,70],42:N,63:V,64:tt,65:et,66:st,67:it}),{19:[1,71]},s(i,[2,14]),{18:72,19:[2,56],51:50,52:51,56:L},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:V,64:tt,65:et,66:st,67:it},s(dt,[2,74]),s(dt,[2,75]),{6:_t,10:pt,39:77,42:ft,47:yt},{40:[1,82],41:[1,83]},s(gt,[2,43],{46:84,13:B,41:F,48:Y,49:P}),s(x,[2,45]),s(x,[2,50]),s(x,[2,51]),s(x,[2,52]),s(x,[2,53]),s(i,[2,41],{42:N}),{6:_t,10:pt,39:85,42:ft,47:yt},{14:86,40:j,50:W,70:q},{16:90,40:O,41:A},{11:91,40:S,50:T},{18:92,19:[1,93],51:50,52:51,56:L},s(i,[2,12]),{19:[2,57]},s(z,[2,58],{54:94,55:95,57:96,59:mt,60:bt}),s([19,56,59,60],[2,63]),s(i,[2,22],{15:[1,100],17:[1,99]}),s([40,50],[2,68]),s(i,[2,36]),{13:B,41:F,45:101,46:60,48:Y,49:P},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(U,[2,39]),s(U,[2,40]),s(x,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,76]),s(i,[2,77]),s(i,[2,78]),{13:[1,102],42:N},{13:[1,104],15:[1,103]},{19:[1,105]},s(i,[2,15]),s(z,[2,59],{55:106,58:[1,107],60:bt}),s(z,[2,60]),s(nt,[2,64]),s(z,[2,67]),s(nt,[2,66]),{18:108,19:[1,109],51:50,52:51,56:L},{16:110,40:O,41:A},s(gt,[2,44],{46:84,13:B,41:F,48:Y,49:P}),{14:111,40:j,50:W,70:q},{16:112,40:O,41:A},{14:113,40:j,50:W,70:q},s(i,[2,13]),s(z,[2,61]),{57:114,59:mt},{19:[1,115]},s(i,[2,20]),s(i,[2,23],{17:[1,116],42:N}),s(i,[2,11]),{13:[1,117],42:N},s(i,[2,10]),s(nt,[2,65]),s(i,[2,18]),{18:118,19:[1,119],51:50,52:51,56:L},{14:120,40:j,50:W,70:q},{19:[1,121]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:a.__name(function(r,c){if(c.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=c,l}},"parseError"),parse:a.__name(function(r){var c=this,l=[0],n=[],_=[null],t=[],G=this.table,e="",X=0,kt=0,Nt=2,Et=1,Rt=t.slice.call(arguments,1),p=Object.create(this.lexer),I={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&(I.yy[at]=this.yy[at]);p.setInput(r,I.yy),I.yy.lexer=p,I.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var ct=p.yylloc;t.push(ct);var It=p.options&&p.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ct(m){l.length=l.length-2*m,_.length=_.length-m,t.length=t.length-m}a.__name(Ct,"popStack");function St(){var m;return m=n.pop()||p.lex()||Et,typeof m!="number"&&(m instanceof Array&&(n=m,m=n.pop()),m=c.symbols_[m]||m),m}a.__name(St,"lex");for(var g,C,b,lt,v={},H,E,Tt,J;;){if(C=l[l.length-1],this.defaultActions[C]?b=this.defaultActions[C]:((g===null||typeof g>"u")&&(g=St()),b=G[C]&&G[C][g]),typeof b>"u"||!b.length||!b[0]){var ot="";J=[];for(H in G[C])this.terminals_[H]&&H>Nt&&J.push("'"+this.terminals_[H]+"'");p.showPosition?ot="Parse error on line "+(X+1)+`:
|
|
2
|
+
`+p.showPosition()+`
|
|
3
|
+
Expecting `+J.join(", ")+", got '"+(this.terminals_[g]||g)+"'":ot="Parse error on line "+(X+1)+": Unexpected "+(g==Et?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(ot,{text:p.match,token:this.terminals_[g]||g,line:p.yylineno,loc:ct,expected:J})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+g);switch(b[0]){case 1:l.push(g),_.push(p.yytext),t.push(p.yylloc),l.push(b[1]),g=null,kt=p.yyleng,e=p.yytext,X=p.yylineno,ct=p.yylloc;break;case 2:if(E=this.productions_[b[1]][1],v.$=_[_.length-E],v._$={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},It&&(v._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(v,[e,kt,X,I.yy,b[1],_,t].concat(Rt)),typeof lt<"u")return lt;E&&(l=l.slice(0,-1*E*2),_=_.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[b[1]][0]),_.push(v.$),t.push(v._$),Tt=G[l[l.length-2]][l[l.length-1]],l.push(Tt);break;case 3:return!0}}return!0},"parse")},At=function(){var R={EOF:1,parseError:a.__name(function(c,l){if(this.yy.parser)this.yy.parser.parseError(c,l);else throw new Error(c)},"parseError"),setInput:a.__name(function(r,c){return this.yy=c||this.yy||{},this._input=r,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:a.__name(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var c=r.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),r},"input"),unput:a.__name(function(r){var c=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var n=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),l.length-1&&(this.yylineno-=l.length-1);var _=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:l?(l.length===n.length?this.yylloc.first_column:0)+n[n.length-l.length].length-l[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a.__name(function(){return this._more=!0,this},"more"),reject:a.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a.__name(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a.__name(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a.__name(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a.__name(function(){var r=this.pastInput(),c=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+c+"^"},"showPosition"),test_match:a.__name(function(r,c){var l,n,_;if(this.options.backtrack_lexer&&(_={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&&(_.yylloc.range=this.yylloc.range.slice(0))),n=r[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var t in _)this[t]=_[t];return!1}return!1},"test_match"),next:a.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,c,l,n;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),t=0;t<_.length;t++)if(l=this._input.match(this.rules[_[t]]),l&&(!c||l[0].length>c[0].length)){if(c=l,n=t,this.options.backtrack_lexer){if(r=this.test_match(l,_[t]),r!==!1)return r;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(r=this.test_match(c,_[n]),r!==!1?r:!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:a.__name(function(){var c=this.next();return c||this.lex()},"lex"),begin:a.__name(function(c){this.conditionStack.push(c)},"begin"),popState:a.__name(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a.__name(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:a.__name(function(c){this.begin(c)},"pushState"),stateStackSize:a.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a.__name(function(c,l,n,_){switch(n){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 70;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 59;case 25:return 56;case 26:return 56;case 27:return 60;case 28:break;case 29:return this.popState(),19;case 30:return l.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 63;case 42:return 65;case 43:return 65;case 44:return 65;case 45:return 63;case 46:return 63;case 47:return 64;case 48:return 64;case 49:return 64;case 50:return 64;case 51:return 64;case 52:return 65;case 53:return 64;case 54:return 65;case 55:return 66;case 56:return 66;case 57:return 66;case 58:return 66;case 59:return 63;case 60:return 64;case 61:return 65;case 62:return 67;case 63:return 68;case 64:return 69;case 65:return 69;case 66:return 68;case 67:return 68;case 68:return 68;case 69:return 41;case 70:return 47;case 71:return 40;case 72:return 48;case 73:return l.yytext[0];case 74: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,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],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,71,72,73,74],inclusive:!0}}};return R}();rt.lexer=At;function Q(){this.yy={}}return a.__name(Q,"Parser"),Q.prototype=rt,rt.Parser=Q,new Q}();ht.parser=ht;var wt=ht,D,Vt=(D=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=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setAccDescription=a.setAccDescription,this.getAccDescription=a.getAccDescription,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getConfig=a.__name(()=>a.getConfig2().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,o=""){return this.entities.has(i)?!this.entities.get(i)?.alias&&o&&(this.entities.get(i).alias=o,a.log.info(`Add alias '${o}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:o,shape:"erBox",look:a.getConfig2().look??"default",cssClasses:"default",cssStyles:[]}),a.log.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,o){const d=this.addEntity(i);let h;for(h=o.length-1;h>=0;h--)o[h].keys||(o[h].keys=[]),o[h].comment||(o[h].comment=""),d.attributes.push(o[h]),a.log.debug("Added attribute ",o[h].name)}addRelationship(i,o,d,h){const u=this.entities.get(i),f=this.entities.get(d);if(!u||!f)return;const y={entityA:u.id,roleA:o,entityB:f.id,relSpec:h};this.relationships.push(y),a.log.debug("Added new relationship :",y)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let o=[];for(const d of i){const h=this.classes.get(d);h?.styles&&(o=[...o,...h.styles??[]].map(u=>u.trim())),h?.textStyles&&(o=[...o,...h.textStyles??[]].map(u=>u.trim()))}return o}addCssStyles(i,o){for(const d of i){const h=this.entities.get(d);if(!o||!h)return;for(const u of o)h.cssStyles.push(u)}}addClass(i,o){i.forEach(d=>{let h=this.classes.get(d);h===void 0&&(h={id:d,styles:[],textStyles:[]},this.classes.set(d,h)),o&&o.forEach(function(u){if(/color/.exec(u)){const f=u.replace("fill","bgFill");h.textStyles.push(f)}h.styles.push(u)})})}setClass(i,o){for(const d of i){const h=this.entities.get(d);if(h)for(const u of o)h.cssClasses+=" "+u}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],a.clear()}getData(){const i=[],o=[],d=a.getConfig2();for(const u of this.entities.keys()){const f=this.entities.get(u);f&&(f.cssCompiledStyles=this.getCompiledStyles(f.cssClasses.split(" ")),i.push(f))}let h=0;for(const u of this.relationships){const f={id:a.getEdgeId(u.entityA,u.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:u.entityA,end:u.entityB,label:u.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:u.relSpec.cardB.toLowerCase(),arrowTypeEnd:u.relSpec.cardA.toLowerCase(),pattern:u.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:d.look};o.push(f)}return{nodes:i,edges:o,other:{},config:d,direction:"TB"}}},a.__name(D,"ErDB"),D),Ot={};a.__export(Ot,{draw:()=>Lt});var Lt=a.__name(async function(s,i,o,d){a.log.info("REF0:"),a.log.info("Drawing er diagram (unified)",i);const{securityLevel:h,er:u,layout:f}=a.getConfig2(),y=d.db.getData(),k=xt.getDiagramElement(i,h);y.type=d.type,y.layoutAlgorithm=a.getRegisteredLayoutAlgorithm(f),y.config.flowchart.nodeSpacing=u?.nodeSpacing||140,y.config.flowchart.rankSpacing=u?.rankSpacing||80,y.direction=d.db.getDirection(),y.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],y.diagramId=i,await a.render(y,k),y.layoutAlgorithm==="elk"&&k.select(".edges").lower();const w=k.selectAll('[id*="-background"]');Array.from(w).length>0&&w.each(function(){const S=a.select(this),Z=S.attr("id").replace("-background",""),T=k.select(`#${CSS.escape(Z)}`);if(!T.empty()){const V=T.attr("transform");S.attr("transform",V)}});const K=8;a.utils_default.insertTitle(k,"erDiagramTitleText",u?.titleTopMargin??25,d.db.getDiagramTitle()),vt.setupViewPortForSVG(k,K,"erDiagram",u?.useMaxWidth??!0)},"draw"),Mt=a.__name((s,i)=>{const o=Dt.channel,d=o(s,"r"),h=o(s,"g"),u=o(s,"b");return a.rgba(d,h,u,i)},"fade"),Bt=a.__name(s=>`
|
|
7
|
+
.entityBox {
|
|
8
|
+
fill: ${s.mainBkg};
|
|
9
|
+
stroke: ${s.nodeBorder};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.relationshipLabelBox {
|
|
13
|
+
fill: ${s.tertiaryColor};
|
|
14
|
+
opacity: 0.7;
|
|
15
|
+
background-color: ${s.tertiaryColor};
|
|
16
|
+
rect {
|
|
17
|
+
opacity: 0.5;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.labelBkg {
|
|
22
|
+
background-color: ${Mt(s.tertiaryColor,.5)};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.edgeLabel .label {
|
|
26
|
+
fill: ${s.nodeBorder};
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.label {
|
|
31
|
+
font-family: ${s.fontFamily};
|
|
32
|
+
color: ${s.nodeTextColor||s.textColor};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.edge-pattern-dashed {
|
|
36
|
+
stroke-dasharray: 8,8;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.node rect,
|
|
40
|
+
.node circle,
|
|
41
|
+
.node ellipse,
|
|
42
|
+
.node polygon
|
|
43
|
+
{
|
|
44
|
+
fill: ${s.mainBkg};
|
|
45
|
+
stroke: ${s.nodeBorder};
|
|
46
|
+
stroke-width: 1px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.relationshipLine {
|
|
50
|
+
stroke: ${s.lineColor};
|
|
51
|
+
stroke-width: 1;
|
|
52
|
+
fill: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.marker {
|
|
56
|
+
fill: none !important;
|
|
57
|
+
stroke: ${s.lineColor} !important;
|
|
58
|
+
stroke-width: 1;
|
|
59
|
+
}
|
|
60
|
+
`,"getStyles"),Ft=Bt,Yt={parser:wt,get db(){return new Vt},renderer:Ot,styles:Ft};exports.diagram=Yt;
|