@layers-app/editor 0.3.11 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.js +6 -6
- package/dist/layers.-WGsbPEO.js +14 -0
- package/dist/layers.-wDyU9sN.js +118 -0
- package/dist/layers.0FtwCmdk.js +52 -0
- package/dist/layers.0RkUYii1.js +282 -0
- package/dist/layers.1EHoXd8e.js +8 -0
- package/dist/layers.2cerO4OS.js +139 -0
- package/dist/layers.3Ekf-o8F.js +39 -0
- package/dist/layers.52famHy6.js +1 -0
- package/dist/layers.5Sr9IY96.js +9 -0
- package/dist/layers.78ekkCq0.js +116 -0
- package/dist/layers.7JqFgE4-.js +15 -0
- package/dist/layers.9QK1wiQj.js +1 -0
- package/dist/layers.9jdDI2yV.js +36 -0
- package/dist/layers.9pNaFvaX.js +1 -0
- package/dist/layers.AEy2G-Gv.js +40 -0
- package/dist/layers.AIQle8wy.js +1 -0
- package/dist/layers.A_NuFq0j.js +2235 -0
- package/dist/layers.B0lp7rOz.js +9 -0
- package/dist/layers.B19hGmey.js +1 -0
- package/dist/layers.B1VZZIP7.js +21763 -0
- package/dist/layers.B2AGu32C.js +11692 -0
- package/dist/layers.B3CuqfYy.js +37 -0
- package/dist/layers.B3D4g2HH.js +1 -0
- package/dist/layers.B3xfUipV.js +2966 -0
- package/dist/layers.B4n4WelM.js +1 -0
- package/dist/layers.B4qkzU1u.js +41 -0
- package/dist/layers.B5bQ8hRv.js +70 -0
- package/dist/layers.B6YfcxJD.js +1 -0
- package/dist/layers.B7O9Ykf9.js +6 -0
- package/dist/layers.BAtv1CM7.js +1 -0
- package/dist/layers.BBXYbcFN.js +10 -0
- package/dist/layers.BBZL6QaK.js +8 -0
- package/dist/layers.BCbGsxxm.js +7 -0
- package/dist/layers.BE_DKuuD.js +790 -0
- package/dist/layers.BFlWA9Iz.js +373 -0
- package/dist/layers.BFxRJ3Li.js +1 -0
- package/dist/layers.BIeVwYKL.js +1 -0
- package/dist/layers.BLQfYqXT.js +39 -0
- package/dist/layers.BM0ksLnS.js +5 -0
- package/dist/layers.BNUbfOwd.js +42 -0
- package/dist/layers.BP3xLRrX.js +33 -0
- package/dist/layers.BQFScIff.js +9 -0
- package/dist/layers.BRu1ZkhL.js +6 -0
- package/dist/layers.BS1BSw0O.js +257 -0
- package/dist/layers.BSTBZrFn.js +1 -0
- package/dist/layers.BU5FG1HP.js +84 -0
- package/dist/layers.BUuBI6QS.js +41 -0
- package/dist/layers.BVrcjbG3.js +8 -0
- package/dist/layers.BW99L8Fl.js +39 -0
- package/dist/layers.BWj5iNQV.js +34 -0
- package/dist/layers.BYRpGhl3.js +11 -0
- package/dist/layers.BZ217a7U.js +40 -0
- package/dist/layers.Bb0NXUFw.js +39 -0
- package/dist/layers.BbCfEXyj.js +55 -0
- package/dist/layers.BblO5S7z.js +5 -0
- package/dist/layers.BbpcdAWy.js +1 -0
- package/dist/layers.Bfw0Gunv.js +9148 -0
- package/dist/layers.BgOa2ZQq.js +7 -0
- package/dist/layers.Bh0aB-u7.js +59 -0
- package/dist/layers.BiCOjicn.js +32 -0
- package/dist/layers.BiJ8hfRt.js +1510 -0
- package/dist/layers.BirPY36J.js +268 -0
- package/dist/layers.Bit9KYIY.js +32 -0
- package/dist/layers.BjFHkSyo.js +37 -0
- package/dist/{layers.DPccTctI.js → layers.BkQdsQ8U.js} +17 -17
- package/dist/layers.BkrI3eMq.js +1089 -0
- package/dist/layers.BlPVzVNM.js +6 -0
- package/dist/layers.Bn7Yja2i.js +3 -0
- package/dist/layers.Bnu-owJj.js +61 -0
- package/dist/{layers.C125HTat.js → layers.BoIttUlh.js} +1 -1
- package/dist/layers.Bp_lUbdE.js +41 -0
- package/dist/layers.BpilXLfW.js +6 -0
- package/dist/layers.Bs7-WFjs.js +1283 -0
- package/dist/layers.BzRvQtZ0.js +11 -0
- package/dist/layers.C00LPdpd.js +437 -0
- package/dist/layers.C0q8oCjN.js +1034 -0
- package/dist/layers.C1iEaL9k.js +37 -0
- package/dist/layers.C1w3XBPW.js +230 -0
- package/dist/layers.C4ROEdAW.js +84 -0
- package/dist/layers.C4qaO0MD.js +10 -0
- package/dist/layers.C7lIplJU.js +247 -0
- package/dist/layers.C8_lu5UH.js +23 -0
- package/dist/layers.C996Xek1.js +2479 -0
- package/dist/layers.CAcpgnDk.js +9 -0
- package/dist/layers.CAwBq0yQ.js +10 -0
- package/dist/layers.CEmVEjbM.js +7 -0
- package/dist/layers.CFa6SgS0.js +38 -0
- package/dist/layers.CHZsXQcr.js +1 -0
- package/dist/layers.CHuQjPi1.js +32 -0
- package/dist/layers.CJBYVYBK.js +8 -0
- package/dist/layers.CLOKCltZ.js +35 -0
- package/dist/layers.COAF7f8g.js +1 -0
- package/dist/layers.COaiyaHl.js +1580 -0
- package/dist/layers.COhnMbFE.js +220 -0
- package/dist/layers.CQqtbI-S.js +122 -0
- package/dist/layers.CRWsKrSv.js +40 -0
- package/dist/layers.CSW2aYxs.js +1 -0
- package/dist/layers.CSfCebqe.js +207 -0
- package/dist/layers.CTzpQJrz.js +501 -0
- package/dist/layers.CX9eMlzX.js +6 -0
- package/dist/layers.CXUGZO8g.js +40 -0
- package/dist/layers.CYHkquLL.js +1 -0
- package/dist/layers.CYJyjqCg.js +7 -0
- package/dist/layers.C_0uL0lu.js +42 -0
- package/dist/layers.CbseH42B.js +5 -0
- package/dist/layers.CdvbuuVd.js +2 -0
- package/dist/layers.CeU6SAcT.js +8 -0
- package/dist/layers.Cef-VRJs.js +37 -0
- package/dist/layers.Cg3zhLTz.js +1 -0
- package/dist/layers.CldWERA-.js +1 -0
- package/dist/layers.Cle37JNX.js +1 -0
- package/dist/layers.CmLupkS6.js +186 -0
- package/dist/layers.Cn2QpKZw.js +51 -0
- package/dist/layers.CoVavTdv.js +1126 -0
- package/dist/layers.CoZpR7_r.js +40 -0
- package/dist/layers.CqVTtuYm.js +6 -0
- package/dist/layers.CrZ6TV4m.js +1 -0
- package/dist/layers.CrpDpBIW.js +904 -0
- package/dist/layers.Cs24L6er.js +261 -0
- package/dist/layers.CsmOgd93.js +38 -0
- package/dist/layers.Ct-zQnmI.js +32 -0
- package/dist/layers.CuAZJoX1.js +42 -0
- package/dist/{layers.BnjxHNDK.js → layers.CylfN5iO.js} +85 -85
- package/dist/layers.CyxAbBDV.js +7 -0
- package/dist/layers.Czj3PJzZ.js +10 -0
- package/dist/layers.D-1CXIBI.js +19 -0
- package/dist/layers.D-EQ5B97.js +7 -0
- package/dist/layers.D-uwIUCE.js +139 -0
- package/dist/layers.D-xK8h4X.js +8 -0
- package/dist/layers.D0rE1hbF.js +10 -0
- package/dist/layers.D0zn4_Mx.js +1 -0
- package/dist/layers.D2Jbdqtj.js +7 -0
- package/dist/layers.D3Qwcfa_.js +1619 -0
- package/dist/layers.D3sICpwv.js +8 -0
- package/dist/layers.D4DB55K_.js +2 -0
- package/dist/layers.D4RhFsg6.js +10 -0
- package/dist/layers.D4fGb2cV.js +1272 -0
- package/dist/layers.D4v0XyUf.js +1 -0
- package/dist/layers.D6SbX5Az.js +423 -0
- package/dist/layers.D6dwFhht.js +9 -0
- package/dist/layers.D7jGxypv.js +8 -0
- package/dist/layers.D87gRG-J.js +1088 -0
- package/dist/layers.D8fb1iDb.js +10 -0
- package/dist/layers.D9JK3npg.js +41 -0
- package/dist/layers.DAvEslJc.js +33 -0
- package/dist/layers.DBOFmWi_.js +1359 -0
- package/dist/layers.DCAo6G5D.js +40 -0
- package/dist/layers.DGWfd9sT.js +5 -0
- package/dist/layers.DIc9Pn5-.js +96 -0
- package/dist/layers.DJVg69Yo.js +803 -0
- package/dist/layers.DLBD3WBx.js +11 -0
- package/dist/layers.DLwuMfdd.js +84 -0
- package/dist/layers.DMkBISW1.js +1 -0
- package/dist/layers.DN9HoVxI.js +18 -0
- package/dist/layers.DOrgOHBr.js +1 -0
- package/dist/layers.DPhgksD-.js +41 -0
- package/dist/layers.DPnpGXQm.js +2 -0
- package/dist/layers.DQ8aCG7v.js +769 -0
- package/dist/layers.DR14S1m9.js +161 -0
- package/dist/layers.DRFq8PR7.js +39 -0
- package/dist/layers.DRYGpdtc.js +48146 -0
- package/dist/layers.DSd23vw_.js +1 -0
- package/dist/layers.DSl3dgu7.js +7 -0
- package/dist/layers.DUYA7tE_.js +10 -0
- package/dist/layers.DVgohoWC.js +11 -0
- package/dist/layers.D_3fuwmS.js +1 -0
- package/dist/layers.D_ILz54C.js +41 -0
- package/dist/layers.DbaKVP5e.js +1 -0
- package/dist/layers.Dd-Mdjt8.js +40 -0
- package/dist/layers.Dd9WE-Kq.js +1265 -0
- package/dist/layers.DdjaY7yq.js +9 -0
- package/dist/layers.DgJemaOm.js +65 -0
- package/dist/layers.Dgm8-XFN.js +960 -0
- package/dist/layers.DgwJ1eL7.js +13 -0
- package/dist/layers.DhZsCIrr.js +425 -0
- package/dist/layers.DipbuRcs.js +36 -0
- package/dist/layers.DjUOC4st.js +16 -0
- package/dist/layers.DjZdvQQY.js +1 -0
- package/dist/layers.DkyFv1Ys.js +35 -0
- package/dist/layers.Dmf-FkA-.js +4 -0
- package/dist/layers.DmgkuDwj.js +9 -0
- package/dist/layers.Dmrtdk6A.js +1 -0
- package/dist/layers.Dn02LanZ.js +931 -0
- package/dist/layers.Do3LJDis.js +202 -0
- package/dist/layers.DoI-3ssc.js +802 -0
- package/dist/layers.DobBKdZ6.js +32 -0
- package/dist/layers.DpzPbocR.js +39 -0
- package/dist/layers.Dq0wRjbC.js +35 -0
- package/dist/layers.Dqsk7GNe.js +10 -0
- package/dist/layers.DrTVlGxj.js +1 -0
- package/dist/layers.DukBaqf8.js +1 -0
- package/dist/layers.DvxaikrZ.js +10 -0
- package/dist/layers.DxA6ocdw.js +70 -0
- package/dist/layers.Dy1naDTQ.js +14 -0
- package/dist/layers.DygycO7X.js +39 -0
- package/dist/{layers.VK3NB7Nd.js → layers.DzUJmmvD.js} +1 -1
- package/dist/layers.FoT1zSFE.js +42 -0
- package/dist/layers.HsplLW7l.js +4 -0
- package/dist/{layers.YZkXZvVS.js → layers.HstOwREP.js} +11432 -10897
- package/dist/layers.IKdQaUN6.js +11 -0
- package/dist/layers.JWCLFILJ.js +1 -0
- package/dist/layers.K3yYYJdK.js +40 -0
- package/dist/layers.L1UaldnR.js +36 -0
- package/dist/layers.Lz059Um8.js +41 -0
- package/dist/layers.M6o7NygO.js +6 -0
- package/dist/layers.MLq12lxF.js +32 -0
- package/dist/layers.MczyPMMk.js +6 -0
- package/dist/layers.OGhIzIND.js +36 -0
- package/dist/layers.OH8pkzdf.js +1 -0
- package/dist/layers.OUHm0dZY.js +40 -0
- package/dist/layers.OeuRpLZr.js +41 -0
- package/dist/layers.PsWF_Poj.js +8 -0
- package/dist/layers.R7Qt9hQa.js +1 -0
- package/dist/layers.SwZPMavM.js +7 -0
- package/dist/layers.UHZ7LEG5.js +44 -0
- package/dist/layers.VAQxBGRz.js +42 -0
- package/dist/layers.WPo01EJ5.js +4 -0
- package/dist/layers.XJChT8Le.js +9 -0
- package/dist/layers.XMeRR-JR.js +39 -0
- package/dist/layers.b0h5ZBmD.js +61 -0
- package/dist/layers.bSw_jQ5U.js +40 -0
- package/dist/layers.bn1dbtN4.js +160 -0
- package/dist/layers.cdGjFrMq.js +9 -0
- package/dist/layers.cu7eSI3X.js +4 -0
- package/dist/layers.iBT5g_cH.js +320 -0
- package/dist/layers.igIdIxGe.js +9 -0
- package/dist/layers.j1hLqMc8.js +38 -0
- package/dist/layers.jrSryxFl.js +39 -0
- package/dist/layers.lCpg7dOn.js +21 -0
- package/dist/layers.oQqeIYLp.js +21938 -0
- package/dist/layers.raic7pCl.js +793 -0
- package/dist/layers.srlypw1l.js +8 -0
- package/dist/layers.tqtFgs0l.js +1 -0
- package/dist/layers.uwhbxtz3.js +8 -0
- package/dist/layers.weZ4wJXB.js +5 -0
- package/dist/layers.wf8u33re.js +1 -0
- package/package.json +22 -15
- package/dist/layers.Cjs5EBWM.js +0 -343
- package/dist/layers.DZ8DrrVn.js +0 -53491
- package/dist/layers.QVaGPbs3.js +0 -161
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { s as J, d as B, p as Q, D as X, a as H, b as Z, S as F, c as I } from "./layers.Dgm8-XFN.js";
|
|
2
|
+
import { G as tt } from "./layers.C7lIplJU.js";
|
|
3
|
+
import { l as E, g, d as x, u as et, e as ot, j as w } from "./layers.Bfw0Gunv.js";
|
|
4
|
+
import { r as st } from "./layers.BFlWA9Iz.js";
|
|
5
|
+
import "./layers.B1VZZIP7.js";
|
|
6
|
+
import "lodash-es";
|
|
7
|
+
import "./layers.D4fGb2cV.js";
|
|
8
|
+
const h = "rect", C = "rectWithTitle", nt = "start", ct = "end", it = "divider", rt = "roundedWithTitle", lt = "note", at = "noteGroup", _ = "statediagram", dt = "state", Et = `${_}-${dt}`, U = "transition", St = "note", Tt = "note-edge", pt = `${U} ${Tt}`, _t = `${_}-${St}`, ut = "cluster", Dt = `${_}-${ut}`, bt = "cluster-alt", ft = `${_}-${bt}`, V = "parent", Y = "note", At = "state", N = "----", ht = `${N}${Y}`, M = `${N}${V}`, W = "fill:none", z = "fill: #333", j = "c", q = "text", K = "normal";
|
|
9
|
+
let y = {}, d = 0;
|
|
10
|
+
const yt = function(t) {
|
|
11
|
+
const n = Object.keys(t);
|
|
12
|
+
for (const e of n)
|
|
13
|
+
t[e];
|
|
14
|
+
}, gt = function(t, n) {
|
|
15
|
+
return n.db.extract(n.db.getRootDocV2()), n.db.getClasses();
|
|
16
|
+
};
|
|
17
|
+
function $t(t) {
|
|
18
|
+
return t == null ? "" : t.classes ? t.classes.join(" ") : "";
|
|
19
|
+
}
|
|
20
|
+
function R(t = "", n = 0, e = "", c = N) {
|
|
21
|
+
const i = e !== null && e.length > 0 ? `${c}${e}` : "";
|
|
22
|
+
return `${At}-${t}${i}-${n}`;
|
|
23
|
+
}
|
|
24
|
+
const A = (t, n, e, c, i, r) => {
|
|
25
|
+
const o = e.id, u = $t(c[o]);
|
|
26
|
+
if (o !== "root") {
|
|
27
|
+
let T = h;
|
|
28
|
+
e.start === !0 && (T = nt), e.start === !1 && (T = ct), e.type !== H && (T = e.type), y[o] || (y[o] = {
|
|
29
|
+
id: o,
|
|
30
|
+
shape: T,
|
|
31
|
+
description: w.sanitizeText(o, g()),
|
|
32
|
+
classes: `${u} ${Et}`
|
|
33
|
+
});
|
|
34
|
+
const s = y[o];
|
|
35
|
+
e.description && (Array.isArray(s.description) ? (s.shape = C, s.description.push(e.description)) : s.description.length > 0 ? (s.shape = C, s.description === o ? s.description = [e.description] : s.description = [s.description, e.description]) : (s.shape = h, s.description = e.description), s.description = w.sanitizeTextOrArray(s.description, g())), s.description.length === 1 && s.shape === C && (s.shape = h), !s.type && e.doc && (E.info("Setting cluster for ", o, G(e)), s.type = "group", s.dir = G(e), s.shape = e.type === Z ? it : rt, s.classes = s.classes + " " + Dt + " " + (r ? ft : ""));
|
|
36
|
+
const p = {
|
|
37
|
+
labelStyle: "",
|
|
38
|
+
shape: s.shape,
|
|
39
|
+
labelText: s.description,
|
|
40
|
+
// typeof newNode.description === 'object'
|
|
41
|
+
// ? newNode.description[0]
|
|
42
|
+
// : newNode.description,
|
|
43
|
+
classes: s.classes,
|
|
44
|
+
style: "",
|
|
45
|
+
//styles.style,
|
|
46
|
+
id: o,
|
|
47
|
+
dir: s.dir,
|
|
48
|
+
domId: R(o, d),
|
|
49
|
+
type: s.type,
|
|
50
|
+
padding: 15
|
|
51
|
+
//getConfig().flowchart.padding
|
|
52
|
+
};
|
|
53
|
+
if (p.centerLabel = !0, e.note) {
|
|
54
|
+
const l = {
|
|
55
|
+
labelStyle: "",
|
|
56
|
+
shape: lt,
|
|
57
|
+
labelText: e.note.text,
|
|
58
|
+
classes: _t,
|
|
59
|
+
// useHtmlLabels: false,
|
|
60
|
+
style: "",
|
|
61
|
+
// styles.style,
|
|
62
|
+
id: o + ht + "-" + d,
|
|
63
|
+
domId: R(o, d, Y),
|
|
64
|
+
type: s.type,
|
|
65
|
+
padding: 15
|
|
66
|
+
//getConfig().flowchart.padding
|
|
67
|
+
}, a = {
|
|
68
|
+
labelStyle: "",
|
|
69
|
+
shape: at,
|
|
70
|
+
labelText: e.note.text,
|
|
71
|
+
classes: s.classes,
|
|
72
|
+
style: "",
|
|
73
|
+
// styles.style,
|
|
74
|
+
id: o + M,
|
|
75
|
+
domId: R(o, d, V),
|
|
76
|
+
type: "group",
|
|
77
|
+
padding: 0
|
|
78
|
+
//getConfig().flowchart.padding
|
|
79
|
+
};
|
|
80
|
+
d++;
|
|
81
|
+
const D = o + M;
|
|
82
|
+
t.setNode(D, a), t.setNode(l.id, l), t.setNode(o, p), t.setParent(o, D), t.setParent(l.id, D);
|
|
83
|
+
let S = o, b = l.id;
|
|
84
|
+
e.note.position === "left of" && (S = l.id, b = o), t.setEdge(S, b, {
|
|
85
|
+
arrowhead: "none",
|
|
86
|
+
arrowType: "",
|
|
87
|
+
style: W,
|
|
88
|
+
labelStyle: "",
|
|
89
|
+
classes: pt,
|
|
90
|
+
arrowheadStyle: z,
|
|
91
|
+
labelpos: j,
|
|
92
|
+
labelType: q,
|
|
93
|
+
thickness: K
|
|
94
|
+
});
|
|
95
|
+
} else
|
|
96
|
+
t.setNode(o, p);
|
|
97
|
+
}
|
|
98
|
+
n && n.id !== "root" && (E.trace("Setting node ", o, " to be child of its parent ", n.id), t.setParent(o, n.id)), e.doc && (E.trace("Adding nodes children "), xt(t, e, e.doc, c, i, !r));
|
|
99
|
+
}, xt = (t, n, e, c, i, r) => {
|
|
100
|
+
E.trace("items", e), e.forEach((o) => {
|
|
101
|
+
switch (o.stmt) {
|
|
102
|
+
case I:
|
|
103
|
+
A(t, n, o, c, i, r);
|
|
104
|
+
break;
|
|
105
|
+
case H:
|
|
106
|
+
A(t, n, o, c, i, r);
|
|
107
|
+
break;
|
|
108
|
+
case F:
|
|
109
|
+
{
|
|
110
|
+
A(t, n, o.state1, c, i, r), A(t, n, o.state2, c, i, r);
|
|
111
|
+
const u = {
|
|
112
|
+
id: "edge" + d,
|
|
113
|
+
arrowhead: "normal",
|
|
114
|
+
arrowTypeEnd: "arrow_barb",
|
|
115
|
+
style: W,
|
|
116
|
+
labelStyle: "",
|
|
117
|
+
label: w.sanitizeText(o.description, g()),
|
|
118
|
+
arrowheadStyle: z,
|
|
119
|
+
labelpos: j,
|
|
120
|
+
labelType: q,
|
|
121
|
+
thickness: K,
|
|
122
|
+
classes: U
|
|
123
|
+
};
|
|
124
|
+
t.setEdge(o.state1.id, o.state2.id, u, d), d++;
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}, G = (t, n = X) => {
|
|
130
|
+
let e = n;
|
|
131
|
+
if (t.doc)
|
|
132
|
+
for (let c = 0; c < t.doc.length; c++) {
|
|
133
|
+
const i = t.doc[c];
|
|
134
|
+
i.stmt === "dir" && (e = i.value);
|
|
135
|
+
}
|
|
136
|
+
return e;
|
|
137
|
+
}, Ct = async function(t, n, e, c) {
|
|
138
|
+
E.info("Drawing state diagram (v2)", n), y = {}, c.db.getDirection();
|
|
139
|
+
const { securityLevel: i, state: r } = g(), o = r.nodeSpacing || 50, u = r.rankSpacing || 50;
|
|
140
|
+
E.info(c.db.getRootDocV2()), c.db.extract(c.db.getRootDocV2()), E.info(c.db.getRootDocV2());
|
|
141
|
+
const T = c.db.getStates(), s = new tt({
|
|
142
|
+
multigraph: !0,
|
|
143
|
+
compound: !0
|
|
144
|
+
}).setGraph({
|
|
145
|
+
rankdir: G(c.db.getRootDocV2()),
|
|
146
|
+
nodesep: o,
|
|
147
|
+
ranksep: u,
|
|
148
|
+
marginx: 8,
|
|
149
|
+
marginy: 8
|
|
150
|
+
}).setDefaultEdgeLabel(function() {
|
|
151
|
+
return {};
|
|
152
|
+
});
|
|
153
|
+
A(s, void 0, c.db.getRootDocV2(), T, c.db, !0);
|
|
154
|
+
let p;
|
|
155
|
+
i === "sandbox" && (p = x("#i" + n));
|
|
156
|
+
const l = i === "sandbox" ? x(p.nodes()[0].contentDocument.body) : x("body"), a = l.select(`[id="${n}"]`), D = l.select("#" + n + " g");
|
|
157
|
+
await st(D, s, ["barb"], _, n);
|
|
158
|
+
const S = 8;
|
|
159
|
+
et.insertTitle(a, "statediagramTitleText", r.titleTopMargin, c.db.getDiagramTitle());
|
|
160
|
+
const b = a.node().getBBox(), L = b.width + S * 2, P = b.height + S * 2;
|
|
161
|
+
a.attr("class", _);
|
|
162
|
+
const O = a.node().getBBox();
|
|
163
|
+
ot(a, P, L, r.useMaxWidth);
|
|
164
|
+
const k = `${O.x - S} ${O.y - S} ${L} ${P}`;
|
|
165
|
+
E.debug(`viewBox ${k}`), a.attr("viewBox", k);
|
|
166
|
+
const m = document.querySelectorAll('[id="' + n + '"] .edgeLabel .label');
|
|
167
|
+
for (const $ of m) {
|
|
168
|
+
const v = $.getBBox(), f = document.createElementNS("http://www.w3.org/2000/svg", h);
|
|
169
|
+
f.setAttribute("rx", 0), f.setAttribute("ry", 0), f.setAttribute("width", v.width), f.setAttribute("height", v.height), $.insertBefore(f, $.firstChild);
|
|
170
|
+
}
|
|
171
|
+
}, Rt = {
|
|
172
|
+
setConf: yt,
|
|
173
|
+
getClasses: gt,
|
|
174
|
+
draw: Ct
|
|
175
|
+
}, vt = {
|
|
176
|
+
parser: Q,
|
|
177
|
+
db: B,
|
|
178
|
+
renderer: Rt,
|
|
179
|
+
styles: J,
|
|
180
|
+
init: (t) => {
|
|
181
|
+
t.state || (t.state = {}), t.state.arrowMarkerAbsolute = t.arrowMarkerAbsolute, B.clear();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
export {
|
|
185
|
+
vt as diagram
|
|
186
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./layers.DIc9Pn5-.js"),pt=require("./layers.9QK1wiQj.js");require("lodash-es");const _t=require("./layers.COAF7f8g.js");require("./layers.C1w3XBPW.js");const gt=require("./layers.D_3fuwmS.js"),Et=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function mt(t){return typeof t=="string"&&Et.test(t)}const M=[];for(let t=0;t<256;++t)M.push((t+256).toString(16).slice(1));function kt(t,e=0){return M[t[e+0]]+M[t[e+1]]+M[t[e+2]]+M[t[e+3]]+"-"+M[t[e+4]]+M[t[e+5]]+"-"+M[t[e+6]]+M[t[e+7]]+"-"+M[t[e+8]]+M[t[e+9]]+"-"+M[t[e+10]]+M[t[e+11]]+M[t[e+12]]+M[t[e+13]]+M[t[e+14]]+M[t[e+15]]}function xt(t){if(!mt(t))throw TypeError("Invalid UUID");let e;const r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}function Ot(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}const Rt="6ba7b810-9dad-11d1-80b4-00c04fd430c8",bt="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Nt(t,e,r){function u(c,p,f,o){var h;if(typeof c=="string"&&(c=Ot(c)),typeof p=="string"&&(p=xt(p)),((h=p)===null||h===void 0?void 0:h.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let _=new Uint8Array(16+c.length);if(_.set(p),_.set(c,p.length),_=r(_),_[6]=_[6]&15|e,_[8]=_[8]&63|128,f){o=o||0;for(let m=0;m<16;++m)f[o+m]=_[m];return f}return kt(_)}try{u.name=t}catch{}return u.DNS=Rt,u.URL=bt,u}function Tt(t,e,r,u){switch(t){case 0:return e&r^~e&u;case 1:return e^r^u;case 2:return e&r^e&u^r&u;case 3:return e^r^u}}function et(t,e){return t<<e|t>>>32-e}function At(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){const f=unescape(encodeURIComponent(t));t=[];for(let o=0;o<f.length;++o)t.push(f.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const u=t.length/4+2,c=Math.ceil(u/16),p=new Array(c);for(let f=0;f<c;++f){const o=new Uint32Array(16);for(let h=0;h<16;++h)o[h]=t[f*64+h*4]<<24|t[f*64+h*4+1]<<16|t[f*64+h*4+2]<<8|t[f*64+h*4+3];p[f]=o}p[c-1][14]=(t.length-1)*8/Math.pow(2,32),p[c-1][14]=Math.floor(p[c-1][14]),p[c-1][15]=(t.length-1)*8&4294967295;for(let f=0;f<c;++f){const o=new Uint32Array(80);for(let y=0;y<16;++y)o[y]=p[f][y];for(let y=16;y<80;++y)o[y]=et(o[y-3]^o[y-8]^o[y-14]^o[y-16],1);let h=r[0],_=r[1],m=r[2],k=r[3],O=r[4];for(let y=0;y<80;++y){const T=Math.floor(y/20),D=et(h,5)+Tt(T,_,m,k)+O+e[T]+o[y]>>>0;O=k,k=m,m=et(_,30)>>>0,_=h,h=D}r[0]=r[0]+h>>>0,r[1]=r[1]+_>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+k>>>0,r[4]=r[4]+O>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}const Mt=Nt("v5",80,At);var rt=(function(){var t=function(w,n,a,l){for(a=a||{},l=w.length;l--;a[w[l]]=n);return a},e=[6,8,10,20,22,24,26,27,28],r=[1,10],u=[1,11],c=[1,12],p=[1,13],f=[1,14],o=[1,15],h=[1,21],_=[1,22],m=[1,23],k=[1,24],O=[1,25],y=[6,8,10,13,15,18,19,20,22,24,26,27,28,41,42,43,44,45],T=[1,34],D=[27,28,46,47],F=[41,42,43,44,45],W=[17,34],P=[1,54],A=[1,53],S=[17,34,36,38],R={trace:function(){},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,":":13,role:14,BLOCK_START:15,attributes:16,BLOCK_STOP:17,SQS:18,SQE:19,title:20,title_value:21,acc_title:22,acc_title_value:23,acc_descr:24,acc_descr_value:25,acc_descr_multiline_value:26,ALPHANUM:27,ENTITY_NAME:28,attribute:29,attributeType:30,attributeName:31,attributeKeyTypeList:32,attributeComment:33,ATTRIBUTE_WORD:34,attributeKeyType:35,COMMA:36,ATTRIBUTE_KEY:37,COMMENT:38,cardinality:39,relType:40,ZERO_OR_ONE:41,ZERO_OR_MORE:42,ONE_OR_MORE:43,ONLY_ONE:44,MD_PARENT:45,NON_IDENTIFYING:46,IDENTIFYING:47,WORD:48,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:":",15:"BLOCK_START",17:"BLOCK_STOP",18:"SQS",19:"SQE",20:"title",21:"title_value",22:"acc_title",23:"acc_title_value",24:"acc_descr",25:"acc_descr_value",26:"acc_descr_multiline_value",27:"ALPHANUM",28:"ENTITY_NAME",34:"ATTRIBUTE_WORD",36:"COMMA",37:"ATTRIBUTE_KEY",38:"COMMENT",41:"ZERO_OR_ONE",42:"ZERO_OR_MORE",43:"ONE_OR_MORE",44:"ONLY_ONE",45:"MD_PARENT",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,4],[9,3],[9,1],[9,7],[9,6],[9,4],[9,2],[9,2],[9,2],[9,1],[11,1],[11,1],[16,1],[16,2],[29,2],[29,3],[29,3],[29,4],[30,1],[31,1],[32,1],[32,3],[35,1],[33,1],[12,3],[39,1],[39,1],[39,1],[39,1],[39,1],[40,1],[40,1],[14,1],[14,1],[14,1]],performAction:function(n,a,l,d,g,i,V){var s=i.length-1;switch(g){case 1:break;case 2:this.$=[];break;case 3:i[s-1].push(i[s]),this.$=i[s-1];break;case 4:case 5:this.$=i[s];break;case 6:case 7:this.$=[];break;case 8:d.addEntity(i[s-4]),d.addEntity(i[s-2]),d.addRelationship(i[s-4],i[s],i[s-2],i[s-3]);break;case 9:d.addEntity(i[s-3]),d.addAttributes(i[s-3],i[s-1]);break;case 10:d.addEntity(i[s-2]);break;case 11:d.addEntity(i[s]);break;case 12:d.addEntity(i[s-6],i[s-4]),d.addAttributes(i[s-6],i[s-1]);break;case 13:d.addEntity(i[s-5],i[s-3]);break;case 14:d.addEntity(i[s-3],i[s-1]);break;case 15:case 16:this.$=i[s].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=i[s].trim(),d.setAccDescription(this.$);break;case 19:case 43:this.$=i[s];break;case 20:case 41:case 42:this.$=i[s].replace(/"/g,"");break;case 21:case 29:this.$=[i[s]];break;case 22:i[s].push(i[s-1]),this.$=i[s];break;case 23:this.$={attributeType:i[s-1],attributeName:i[s]};break;case 24:this.$={attributeType:i[s-2],attributeName:i[s-1],attributeKeyTypeList:i[s]};break;case 25:this.$={attributeType:i[s-2],attributeName:i[s-1],attributeComment:i[s]};break;case 26:this.$={attributeType:i[s-3],attributeName:i[s-2],attributeKeyTypeList:i[s-1],attributeComment:i[s]};break;case 27:case 28:case 31:this.$=i[s];break;case 30:i[s-2].push(i[s]),this.$=i[s-2];break;case 32:this.$=i[s].replace(/"/g,"");break;case 33:this.$={cardA:i[s],relType:i[s-1],cardB:i[s-2]};break;case 34:this.$=d.Cardinality.ZERO_OR_ONE;break;case 35:this.$=d.Cardinality.ZERO_OR_MORE;break;case 36:this.$=d.Cardinality.ONE_OR_MORE;break;case 37:this.$=d.Cardinality.ONLY_ONE;break;case 38:this.$=d.Cardinality.MD_PARENT;break;case 39:this.$=d.Identification.NON_IDENTIFYING;break;case 40:this.$=d.Identification.IDENTIFYING;break}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,20:r,22:u,24:c,26:p,27:f,28:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:16,11:9,20:r,22:u,24:c,26:p,27:f,28:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,11],{12:17,39:20,15:[1,18],18:[1,19],41:h,42:_,43:m,44:k,45:O}),{21:[1,26]},{23:[1,27]},{25:[1,28]},t(e,[2,18]),t(y,[2,19]),t(y,[2,20]),t(e,[2,4]),{11:29,27:f,28:o},{16:30,17:[1,31],29:32,30:33,34:T},{11:35,27:f,28:o},{40:36,46:[1,37],47:[1,38]},t(D,[2,34]),t(D,[2,35]),t(D,[2,36]),t(D,[2,37]),t(D,[2,38]),t(e,[2,15]),t(e,[2,16]),t(e,[2,17]),{13:[1,39]},{17:[1,40]},t(e,[2,10]),{16:41,17:[2,21],29:32,30:33,34:T},{31:42,34:[1,43]},{34:[2,27]},{19:[1,44]},{39:45,41:h,42:_,43:m,44:k,45:O},t(F,[2,39]),t(F,[2,40]),{14:46,27:[1,49],28:[1,48],48:[1,47]},t(e,[2,9]),{17:[2,22]},t(W,[2,23],{32:50,33:51,35:52,37:P,38:A}),t([17,34,37,38],[2,28]),t(e,[2,14],{15:[1,55]}),t([27,28],[2,33]),t(e,[2,8]),t(e,[2,41]),t(e,[2,42]),t(e,[2,43]),t(W,[2,24],{33:56,36:[1,57],38:A}),t(W,[2,25]),t(S,[2,29]),t(W,[2,32]),t(S,[2,31]),{16:58,17:[1,59],29:32,30:33,34:T},t(W,[2,26]),{35:60,37:P},{17:[1,61]},t(e,[2,13]),t(S,[2,30]),t(e,[2,12])],defaultActions:{34:[2,27],41:[2,22]},parseError:function(n,a){if(a.recoverable)this.trace(n);else{var l=new Error(n);throw l.hash=a,l}},parse:function(n){var a=this,l=[0],d=[],g=[null],i=[],V=this.table,s="",X=0,nt=0,dt=2,at=1,ut=i.slice.call(arguments,1),N=Object.create(this.lexer),H={yy:{}};for(var j in this.yy)Object.prototype.hasOwnProperty.call(this.yy,j)&&(H.yy[j]=this.yy[j]);N.setInput(n,H.yy),H.yy.lexer=N,H.yy.parser=this,typeof N.yylloc>"u"&&(N.yylloc={});var J=N.yylloc;i.push(J);var ft=N.options&&N.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(){var Z;return Z=d.pop()||N.lex()||at,typeof Z!="number"&&(Z instanceof Array&&(d=Z,Z=d.pop()),Z=a.symbols_[Z]||Z),Z}for(var I,z,v,$,K={},Q,Y,st,q;;){if(z=l[l.length-1],this.defaultActions[z]?v=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=yt()),v=V[z]&&V[z][I]),typeof v>"u"||!v.length||!v[0]){var tt="";q=[];for(Q in V[z])this.terminals_[Q]&&Q>dt&&q.push("'"+this.terminals_[Q]+"'");N.showPosition?tt="Parse error on line "+(X+1)+`:
|
|
2
|
+
`+N.showPosition()+`
|
|
3
|
+
Expecting `+q.join(", ")+", got '"+(this.terminals_[I]||I)+"'":tt="Parse error on line "+(X+1)+": Unexpected "+(I==at?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(tt,{text:N.match,token:this.terminals_[I]||I,line:N.yylineno,loc:J,expected:q})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+I);switch(v[0]){case 1:l.push(I),g.push(N.yytext),i.push(N.yylloc),l.push(v[1]),I=null,nt=N.yyleng,s=N.yytext,X=N.yylineno,J=N.yylloc;break;case 2:if(Y=this.productions_[v[1]][1],K.$=g[g.length-Y],K._$={first_line:i[i.length-(Y||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(Y||1)].first_column,last_column:i[i.length-1].last_column},ft&&(K._$.range=[i[i.length-(Y||1)].range[0],i[i.length-1].range[1]]),$=this.performAction.apply(K,[s,nt,X,H.yy,v[1],g,i].concat(ut)),typeof $<"u")return $;Y&&(l=l.slice(0,-1*Y*2),g=g.slice(0,-1*Y),i=i.slice(0,-1*Y)),l.push(this.productions_[v[1]][0]),g.push(K.$),i.push(K._$),st=V[l[l.length-2]][l[l.length-1]],l.push(st);break;case 3:return!0}}return!0}},b=(function(){var w={EOF:1,parseError:function(a,l){if(this.yy.parser)this.yy.parser.parseError(a,l);else throw new Error(a)},setInput:function(n,a){return this.yy=a||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var a=n.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var a=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var d=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 g=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===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput: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,"")},showPosition:function(){var n=this.pastInput(),a=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
+
`+a+"^"},test_match:function(n,a){var l,d,g;if(this.options.backtrack_lexer&&(g={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&&(g.yylloc.range=this.yylloc.range.slice(0))),d=n[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.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],l=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var i in g)this[i]=g[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,a,l,d;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),i=0;i<g.length;i++)if(l=this._input.match(this.rules[g[i]]),l&&(!a||l[0].length>a[0].length)){if(a=l,d=i,this.options.backtrack_lexer){if(n=this.test_match(l,g[i]),n!==!1)return n;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(n=this.test_match(a,g[d]),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})},lex:function(){var a=this.next();return a||this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(a,l,d,g){switch(d){case 0:return this.begin("acc_title"),22;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),24;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 10;case 8:break;case 9:return 8;case 10:return 28;case 11:return 48;case 12:return 4;case 13:return this.begin("block"),15;case 14:return 36;case 15:break;case 16:return 37;case 17:return 34;case 18:return 34;case 19:return 38;case 20:break;case 21:return this.popState(),17;case 22:return l.yytext[0];case 23:return 18;case 24:return 19;case 25:return 41;case 26:return 43;case 27:return 43;case 28:return 43;case 29:return 41;case 30:return 41;case 31:return 42;case 32:return 42;case 33:return 42;case 34:return 42;case 35:return 42;case 36:return 43;case 37:return 42;case 38:return 43;case 39:return 44;case 40:return 44;case 41:return 44;case 42:return 44;case 43:return 41;case 44:return 42;case 45:return 43;case 46:return 45;case 47:return 46;case 48:return 47;case 49:return 47;case 50:return 46;case 51:return 46;case 52:return 46;case 53:return 27;case 54:return l.yytext[0];case 55:return 6}},rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:,)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:(.*?)[~](.*?)*[~])/i,/^(?:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/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,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[14,15,16,17,18,19,20,21,22],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55],inclusive:!0}}};return w})();R.lexer=b;function L(){this.yy={}}return L.prototype=R,R.Parser=L,new L})();rt.parser=rt;const St=rt;let U={},it=[];const wt={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"},It={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},lt=function(t,e=void 0){return U[t]===void 0?(U[t]={attributes:[],alias:e},E.log$1.info("Added new entity :",t)):U[t]&&!U[t].alias&&e&&(U[t].alias=e,E.log$1.info(`Add alias '${e}' to entity '${t}'`)),U[t]},Dt=()=>U,vt=function(t,e){let r=lt(t),u;for(u=e.length-1;u>=0;u--)r.attributes.push(e[u]),E.log$1.debug("Added attribute ",e[u].attributeName)},Lt=function(t,e,r,u){let c={entityA:t,roleA:e,entityB:r,relSpec:u};it.push(c),E.log$1.debug("Added new relationship :",c)},Bt=()=>it,Ct=function(){U={},it=[],E.clear()},Pt={Cardinality:wt,Identification:It,getConfig:()=>E.getConfig().er,addEntity:lt,addAttributes:vt,getEntities:Dt,addRelationship:Lt,getRelationships:Bt,clear:Ct,setAccTitle:E.setAccTitle,getAccTitle:E.getAccTitle,setAccDescription:E.setAccDescription,getAccDescription:E.getAccDescription,setDiagramTitle:E.setDiagramTitle,getDiagramTitle:E.getDiagramTitle},B={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END",MD_PARENT_END:"MD_PARENT_END",MD_PARENT_START:"MD_PARENT_START"},Yt=function(t,e){let r;t.append("defs").append("marker").attr("id",B.MD_PARENT_START).attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",B.MD_PARENT_END).attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",B.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",B.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",B.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",B.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),r=t.append("defs").append("marker").attr("id",B.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto"),r.append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),r.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},C={ERMarkers:B,insertMarkers:Yt},Zt=/[^\dA-Za-z](\W)*/g;let x={},G=new Map;const Ft=function(t){const e=Object.keys(t);for(const r of e)x[r]=t[r]},Wt=(t,e,r)=>{const u=x.entityPadding/3,c=x.entityPadding/3,p=x.fontSize*.85,f=e.node().getBBox(),o=[];let h=!1,_=!1,m=0,k=0,O=0,y=0,T=f.height+u*2,D=1;r.forEach(A=>{A.attributeKeyTypeList!==void 0&&A.attributeKeyTypeList.length>0&&(h=!0),A.attributeComment!==void 0&&(_=!0)}),r.forEach(A=>{const S=`${e.node().id}-attr-${D}`;let R=0;const b=E.parseGenericTypes(A.attributeType),L=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-type`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(b),w=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-name`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(A.attributeName),n={};n.tn=L,n.nn=w;const a=L.node().getBBox(),l=w.node().getBBox();if(m=Math.max(m,a.width),k=Math.max(k,l.width),R=Math.max(a.height,l.height),h){const d=A.attributeKeyTypeList!==void 0?A.attributeKeyTypeList.join(","):"",g=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-key`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(d);n.kn=g;const i=g.node().getBBox();O=Math.max(O,i.width),R=Math.max(R,i.height)}if(_){const d=t.append("text").classed("er entityLabel",!0).attr("id",`${S}-comment`).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","left").style("font-family",E.getConfig().fontFamily).style("font-size",p+"px").text(A.attributeComment||"");n.cn=d;const g=d.node().getBBox();y=Math.max(y,g.width),R=Math.max(R,g.height)}n.height=R,o.push(n),T+=R+u*2,D+=1});let F=4;h&&(F+=2),_&&(F+=2);const W=m+k+O+y,P={width:Math.max(x.minEntityWidth,Math.max(f.width+x.entityPadding*2,W+c*F)),height:r.length>0?T:Math.max(x.minEntityHeight,f.height+x.entityPadding*2)};if(r.length>0){const A=Math.max(0,(P.width-W-c*F)/(F/2));e.attr("transform","translate("+P.width/2+","+(u+f.height/2)+")");let S=f.height+u*2,R="attributeBoxOdd";o.forEach(b=>{const L=S+u+b.height/2;b.tn.attr("transform","translate("+c+","+L+")");const w=t.insert("rect","#"+b.tn.node().id).classed(`er ${R}`,!0).attr("x",0).attr("y",S).attr("width",m+c*2+A).attr("height",b.height+u*2),n=parseFloat(w.attr("x"))+parseFloat(w.attr("width"));b.nn.attr("transform","translate("+(n+c)+","+L+")");const a=t.insert("rect","#"+b.nn.node().id).classed(`er ${R}`,!0).attr("x",n).attr("y",S).attr("width",k+c*2+A).attr("height",b.height+u*2);let l=parseFloat(a.attr("x"))+parseFloat(a.attr("width"));if(h){b.kn.attr("transform","translate("+(l+c)+","+L+")");const d=t.insert("rect","#"+b.kn.node().id).classed(`er ${R}`,!0).attr("x",l).attr("y",S).attr("width",O+c*2+A).attr("height",b.height+u*2);l=parseFloat(d.attr("x"))+parseFloat(d.attr("width"))}_&&(b.cn.attr("transform","translate("+(l+c)+","+L+")"),t.insert("rect","#"+b.cn.node().id).classed(`er ${R}`,"true").attr("x",l).attr("y",S).attr("width",y+c*2+A).attr("height",b.height+u*2)),S+=b.height+u*2,R=R==="attributeBoxOdd"?"attributeBoxEven":"attributeBoxOdd"})}else P.height=Math.max(x.minEntityHeight,T),e.attr("transform","translate("+P.width/2+","+P.height/2+")");return P},Ut=function(t,e,r){const u=Object.keys(e);let c;return u.forEach(function(p){const f=Xt(p,"entity");G.set(p,f);const o=t.append("g").attr("id",f);c=c===void 0?f:c;const h="text-"+f,_=o.append("text").classed("er entityLabel",!0).attr("id",h).attr("x",0).attr("y",0).style("dominant-baseline","middle").style("text-anchor","middle").style("font-family",E.getConfig().fontFamily).style("font-size",x.fontSize+"px").text(e[p].alias??p),{width:m,height:k}=Wt(o,_,e[p].attributes),y=o.insert("rect","#"+h).classed("er entityBox",!0).attr("x",0).attr("y",0).attr("width",m).attr("height",k).node().getBBox();r.setNode(f,{width:y.width,height:y.height,shape:"rect",id:f})}),c},Ht=function(t,e){e.nodes().forEach(function(r){r!==void 0&&e.node(r)!==void 0&&t.select("#"+r).attr("transform","translate("+(e.node(r).x-e.node(r).width/2)+","+(e.node(r).y-e.node(r).height/2)+" )")})},ht=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")},zt=function(t,e){return t.forEach(function(r){e.setEdge(G.get(r.entityA),G.get(r.entityB),{relationship:r},ht(r))}),t};let ot=0;const Kt=function(t,e,r,u,c){ot++;const p=r.edge(G.get(e.entityA),G.get(e.entityB),ht(e)),f=gt.line().x(function(T){return T.x}).y(function(T){return T.y}).curve(E.curveBasis),o=t.insert("path","#"+u).classed("er relationshipLine",!0).attr("d",f(p.points)).style("stroke",x.stroke).style("fill","none");e.relSpec.relType===c.db.Identification.NON_IDENTIFYING&&o.attr("stroke-dasharray","8,8");let h="";switch(x.arrowMarkerAbsolute&&(h=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)")),e.relSpec.cardA){case c.db.Cardinality.ZERO_OR_ONE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ZERO_OR_ONE_END+")");break;case c.db.Cardinality.ZERO_OR_MORE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ZERO_OR_MORE_END+")");break;case c.db.Cardinality.ONE_OR_MORE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ONE_OR_MORE_END+")");break;case c.db.Cardinality.ONLY_ONE:o.attr("marker-end","url("+h+"#"+C.ERMarkers.ONLY_ONE_END+")");break;case c.db.Cardinality.MD_PARENT:o.attr("marker-end","url("+h+"#"+C.ERMarkers.MD_PARENT_END+")");break}switch(e.relSpec.cardB){case c.db.Cardinality.ZERO_OR_ONE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ZERO_OR_ONE_START+")");break;case c.db.Cardinality.ZERO_OR_MORE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ZERO_OR_MORE_START+")");break;case c.db.Cardinality.ONE_OR_MORE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ONE_OR_MORE_START+")");break;case c.db.Cardinality.ONLY_ONE:o.attr("marker-start","url("+h+"#"+C.ERMarkers.ONLY_ONE_START+")");break;case c.db.Cardinality.MD_PARENT:o.attr("marker-start","url("+h+"#"+C.ERMarkers.MD_PARENT_START+")");break}const _=o.node().getTotalLength(),m=o.node().getPointAtLength(_*.5),k="rel"+ot,y=t.append("text").classed("er relationshipLabel",!0).attr("id",k).attr("x",m.x).attr("y",m.y).style("text-anchor","middle").style("dominant-baseline","middle").style("font-family",E.getConfig().fontFamily).style("font-size",x.fontSize+"px").text(e.roleA).node().getBBox();t.insert("rect","#"+k).classed("er relationshipLabelBox",!0).attr("x",m.x-y.width/2).attr("y",m.y-y.height/2).attr("width",y.width).attr("height",y.height)},Vt=function(t,e,r,u){x=E.getConfig().er,E.log$1.info("Drawing ER diagram");const c=E.getConfig().securityLevel;let p;c==="sandbox"&&(p=E.select("#i"+e));const o=(c==="sandbox"?E.select(p.nodes()[0].contentDocument.body):E.select("body")).select(`[id='${e}']`);C.insertMarkers(o,x);let h;h=new pt.Graph({multigraph:!0,directed:!0,compound:!1}).setGraph({rankdir:x.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel(function(){return{}});const _=Ut(o,u.db.getEntities(),h),m=zt(u.db.getRelationships(),h);_t.layout(h),Ht(o,h),m.forEach(function(D){Kt(o,D,h,_,u)});const k=x.diagramPadding;E.utils.insertTitle(o,"entityTitleText",x.titleTopMargin,u.db.getDiagramTitle());const O=o.node().getBBox(),y=O.width+k*2,T=O.height+k*2;E.configureSvgSize(o,T,y,x.useMaxWidth),o.attr("viewBox",`${O.x-k} ${O.y-k} ${y} ${T}`)},Gt="28e9f9db-3c8d-5aa5-9faf-44286ae5937c";function Xt(t="",e=""){const r=t.replace(Zt,"");return`${ct(e)}${ct(r)}${Mt(t,Gt)}`}function ct(t=""){return t.length>0?`${t}-`:""}const Qt={setConf:Ft,draw:Vt},qt=t=>`
|
|
7
|
+
.entityBox {
|
|
8
|
+
fill: ${t.mainBkg};
|
|
9
|
+
stroke: ${t.nodeBorder};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.attributeBoxOdd {
|
|
13
|
+
fill: ${t.attributeBackgroundColorOdd};
|
|
14
|
+
stroke: ${t.nodeBorder};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.attributeBoxEven {
|
|
18
|
+
fill: ${t.attributeBackgroundColorEven};
|
|
19
|
+
stroke: ${t.nodeBorder};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.relationshipLabelBox {
|
|
23
|
+
fill: ${t.tertiaryColor};
|
|
24
|
+
opacity: 0.7;
|
|
25
|
+
background-color: ${t.tertiaryColor};
|
|
26
|
+
rect {
|
|
27
|
+
opacity: 0.5;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.relationshipLine {
|
|
32
|
+
stroke: ${t.lineColor};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.entityTitleText {
|
|
36
|
+
text-anchor: middle;
|
|
37
|
+
font-size: 18px;
|
|
38
|
+
fill: ${t.textColor};
|
|
39
|
+
}
|
|
40
|
+
#MD_PARENT_START {
|
|
41
|
+
fill: #f5f5f5 !important;
|
|
42
|
+
stroke: ${t.lineColor} !important;
|
|
43
|
+
stroke-width: 1;
|
|
44
|
+
}
|
|
45
|
+
#MD_PARENT_END {
|
|
46
|
+
fill: #f5f5f5 !important;
|
|
47
|
+
stroke: ${t.lineColor} !important;
|
|
48
|
+
stroke-width: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
`,jt=qt,Jt={parser:St,db:Pt,renderer:Qt,styles:jt};exports.diagram=Jt;
|