@sourcegraph/amp 0.0.1749585689-g82b91d → 0.0.1749600114-g5c00b8
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/amp.js +3 -3
- package/dist/architectureDiagram-RWNHDUBN-1v8WgxdD.js +4635 -0
- package/dist/blockDiagram-XZSR5OGQ-XFBYN-jB.js +2243 -0
- package/dist/c4Diagram-6R2MQUNL-B0L0pltn.js +1587 -0
- package/dist/chunk-COUQ6RZ3-qd4eG6tc.js +17852 -0
- package/dist/chunk-CRQPXCKQ-yjI467Bq.js +65 -0
- package/dist/chunk-EFPBJHX4-DdHmqd0M.js +1378 -0
- package/dist/chunk-EOAU2GW5-CpRNAcjo.js +253 -0
- package/dist/chunk-IHYUGLNO-DJcRQIf7.js +1365 -0
- package/dist/chunk-K2ZEYYM2-CbqHhUqy.js +9 -0
- package/dist/chunk-Q7VUVKE6-gBSSbdjU.js +24 -0
- package/dist/chunk-T2M37SMK-Br8mK30k.js +1411 -0
- package/dist/chunk-TGZYFRKZ-BYBLXoJz.js +1331 -0
- package/dist/chunk-YJGJQOYZ-BGiSkWF0.js +19 -0
- package/dist/classDiagram-LB37KKQG-DhFsEyDS.js +17 -0
- package/dist/classDiagram-v2-KFQJBC22-DhFsEyDS.js +17 -0
- package/dist/{client-C1WG2nEf.js → client-D-YAg8x6.js} +6 -6
- package/dist/{console-DK0gDzNQ.js → console-CoE5Qzyz.js} +41106 -22971
- package/dist/create_file.node-Co0Uh1F3.js +21 -0
- package/dist/dagre-CMTPJJKG-UDPzd9Iy.js +446 -0
- package/dist/diagram-BIPOGRU5-B7TV59-n.js +128 -0
- package/dist/diagram-YF4VECWA-LsAZsciQ.js +219 -0
- package/dist/{edit_file.node-BH524GkF.js → edit_file.node-CmTZeBc2.js} +11 -11
- package/dist/erDiagram-AK44R45H-BWpeEu7D.js +843 -0
- package/dist/{executable-5cBRGrsC.js → executable-BE7tfoX5.js} +1 -1
- package/dist/{files-CybxYgbE.js → files-DqpRf5q4.js} +10 -10
- package/dist/flowDiagram-XARHJDSH-DzpV02UB.js +1618 -0
- package/dist/ganttDiagram-H5QQZTZ5-C0BhJTzn.js +1605 -0
- package/dist/gitGraphDiagram-XHLTLO3W-0EiOmv44.js +701 -0
- package/dist/{glob.node-C6HbLuPt.js → glob.node-DNei8bFS.js} +11 -11
- package/dist/{index-C2wo7rRZ.js → index-BcjxaWOc.js} +31 -31
- package/dist/infoDiagram-TP2HPDHO-CQX5a0Fc.js +24 -0
- package/dist/journeyDiagram-VHRN44N3-C82dEe4G.js +809 -0
- package/dist/kanban-definition-K5J3OUUV-xilJcrom.js +718 -0
- package/dist/katex-5N2NCDMP-CAsrnb6_.js +11703 -0
- package/dist/{list_directory.node-ZQscizpi.js → list_directory.node-CMiNNbXP.js} +1 -1
- package/dist/{load-profile-BbmyxO_7.js → load-profile-Cg8XaTx6.js} +1 -1
- package/dist/{main-CiUaVPC2.js → main-Dy2VZM_S.js} +15 -15
- package/dist/mindmap-definition-TI5ONXTW-BNaRba4R.js +3221 -0
- package/dist/{node-DvmQAW7h.js → node-BtG1o_DD.js} +2 -2
- package/dist/{node-VrazB_nQ.js → node-BulbxvrV.js} +58 -58
- package/dist/{node-Cpbjmhrj.js → node-Cp3D7_hw.js} +71 -71
- package/dist/{node-GgocwWwI.js → node-CtoBdTQT.js} +3 -3
- package/dist/{node-CiFAW-F3.js → node-Ctw1i0nl.js} +12 -12
- package/dist/{node-CgVq0JJ9.js → node-D1zxOCuN.js} +1 -1
- package/dist/pieDiagram-FPR3CNQC-_30_tQz0.js +120 -0
- package/dist/quadrantDiagram-RLP5YTJ2-CTD43GTk.js +1028 -0
- package/dist/radar-MK3ICKWK-55CS4JTO-afihMdR4.js +14398 -0
- package/dist/{read_file.node-CIdAFiJ6.js → read_file.node-QZ0VCmB2.js} +1 -1
- package/dist/requirementDiagram-P5NVWGNK-Sd2_6g8e.js +853 -0
- package/dist/sankeyDiagram-C6NZRJHT-D1EcCYaw.js +864 -0
- package/dist/sequenceDiagram-6SLVIXKN-CghQTpGf.js +2283 -0
- package/dist/stateDiagram-WI5ZVJ5I-Bv21MlSK.js +272 -0
- package/dist/stateDiagram-v2-KVDSFUFK-BgP0D8xL.js +17 -0
- package/dist/{stdio-D9HyubOc.js → stdio-CCCGI3C7.js} +8 -8
- package/dist/storybook.js +7 -7
- package/dist/timeline-definition-65575674-BUqRZdJ-.js +800 -0
- package/dist/{undo_edit.node-VYuTxRwd.js → undo_edit.node-BkletvTZ.js} +5 -5
- package/dist/xychartDiagram-674MFTBU-DjBabATx.js +1291 -0
- package/package.json +1 -1
- package/dist/create_file.node-DtVTaHj5.js +0 -21
@@ -0,0 +1,809 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import { a as ft, g as at, f as gt, d as mt } from "./chunk-CRQPXCKQ-yjI467Bq.js";
|
3
|
+
import { _ as i, v as xt, u as kt, w as _t, x as vt, U as bt, T as wt, y as A, z as W, C as Tt, Z as St, ay as tt } from "./console-CoE5Qzyz.js";
|
4
|
+
var H = function() {
|
5
|
+
var t = /* @__PURE__ */ i(function(g, r, a, l) {
|
6
|
+
for (a = a || {}, l = g.length; l--; a[g[l]] = r) ;
|
7
|
+
return a;
|
8
|
+
}, "o"), e = [6, 8, 10, 11, 12, 14, 16, 17, 18], n = [1, 9], c = [1, 10], s = [1, 11], u = [1, 12], h = [1, 13], p = [1, 14], d = {
|
9
|
+
trace: /* @__PURE__ */ i(function() {
|
10
|
+
}, "trace"),
|
11
|
+
yy: {},
|
12
|
+
symbols_: { error: 2, start: 3, journey: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, title: 11, acc_title: 12, acc_title_value: 13, acc_descr: 14, acc_descr_value: 15, acc_descr_multiline_value: 16, section: 17, taskName: 18, taskData: 19, $accept: 0, $end: 1 },
|
13
|
+
terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" },
|
14
|
+
productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]],
|
15
|
+
performAction: /* @__PURE__ */ i(function(r, a, l, y, f, o, S) {
|
16
|
+
var _ = o.length - 1;
|
17
|
+
switch (f) {
|
18
|
+
case 1:
|
19
|
+
return o[_ - 1];
|
20
|
+
case 2:
|
21
|
+
this.$ = [];
|
22
|
+
break;
|
23
|
+
case 3:
|
24
|
+
o[_ - 1].push(o[_]), this.$ = o[_ - 1];
|
25
|
+
break;
|
26
|
+
case 4:
|
27
|
+
case 5:
|
28
|
+
this.$ = o[_];
|
29
|
+
break;
|
30
|
+
case 6:
|
31
|
+
case 7:
|
32
|
+
this.$ = [];
|
33
|
+
break;
|
34
|
+
case 8:
|
35
|
+
y.setDiagramTitle(o[_].substr(6)), this.$ = o[_].substr(6);
|
36
|
+
break;
|
37
|
+
case 9:
|
38
|
+
this.$ = o[_].trim(), y.setAccTitle(this.$);
|
39
|
+
break;
|
40
|
+
case 10:
|
41
|
+
case 11:
|
42
|
+
this.$ = o[_].trim(), y.setAccDescription(this.$);
|
43
|
+
break;
|
44
|
+
case 12:
|
45
|
+
y.addSection(o[_].substr(8)), this.$ = o[_].substr(8);
|
46
|
+
break;
|
47
|
+
case 13:
|
48
|
+
y.addTask(o[_ - 1], o[_]), this.$ = "task";
|
49
|
+
break;
|
50
|
+
}
|
51
|
+
}, "anonymous"),
|
52
|
+
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: n, 12: c, 14: s, 16: u, 17: h, 18: p }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: n, 12: c, 14: s, 16: u, 17: h, 18: p }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, t(e, [2, 11]), t(e, [2, 12]), { 19: [1, 18] }, t(e, [2, 4]), t(e, [2, 9]), t(e, [2, 10]), t(e, [2, 13])],
|
53
|
+
defaultActions: {},
|
54
|
+
parseError: /* @__PURE__ */ i(function(r, a) {
|
55
|
+
if (a.recoverable)
|
56
|
+
this.trace(r);
|
57
|
+
else {
|
58
|
+
var l = new Error(r);
|
59
|
+
throw l.hash = a, l;
|
60
|
+
}
|
61
|
+
}, "parseError"),
|
62
|
+
parse: /* @__PURE__ */ i(function(r) {
|
63
|
+
var a = this, l = [0], y = [], f = [null], o = [], S = this.table, _ = "", B = 0, J = 0, ut = 2, K = 1, yt = o.slice.call(arguments, 1), k = Object.create(this.lexer), E = { yy: {} };
|
64
|
+
for (var O in this.yy)
|
65
|
+
Object.prototype.hasOwnProperty.call(this.yy, O) && (E.yy[O] = this.yy[O]);
|
66
|
+
k.setInput(r, E.yy), E.yy.lexer = k, E.yy.parser = this, typeof k.yylloc > "u" && (k.yylloc = {});
|
67
|
+
var Y = k.yylloc;
|
68
|
+
o.push(Y);
|
69
|
+
var dt = k.options && k.options.ranges;
|
70
|
+
typeof E.yy.parseError == "function" ? this.parseError = E.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
71
|
+
function pt(b) {
|
72
|
+
l.length = l.length - 2 * b, f.length = f.length - b, o.length = o.length - b;
|
73
|
+
}
|
74
|
+
i(pt, "popStack");
|
75
|
+
function Q() {
|
76
|
+
var b;
|
77
|
+
return b = y.pop() || k.lex() || K, typeof b != "number" && (b instanceof Array && (y = b, b = y.pop()), b = a.symbols_[b] || b), b;
|
78
|
+
}
|
79
|
+
i(Q, "lex");
|
80
|
+
for (var v, P, w, q, C = {}, N, $, D, j; ; ) {
|
81
|
+
if (P = l[l.length - 1], this.defaultActions[P] ? w = this.defaultActions[P] : ((v === null || typeof v > "u") && (v = Q()), w = S[P] && S[P][v]), typeof w > "u" || !w.length || !w[0]) {
|
82
|
+
var G = "";
|
83
|
+
j = [];
|
84
|
+
for (N in S[P])
|
85
|
+
this.terminals_[N] && N > ut && j.push("'" + this.terminals_[N] + "'");
|
86
|
+
k.showPosition ? G = "Parse error on line " + (B + 1) + `:
|
87
|
+
` + k.showPosition() + `
|
88
|
+
Expecting ` + j.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : G = "Parse error on line " + (B + 1) + ": Unexpected " + (v == K ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(G, {
|
89
|
+
text: k.match,
|
90
|
+
token: this.terminals_[v] || v,
|
91
|
+
line: k.yylineno,
|
92
|
+
loc: Y,
|
93
|
+
expected: j
|
94
|
+
});
|
95
|
+
}
|
96
|
+
if (w[0] instanceof Array && w.length > 1)
|
97
|
+
throw new Error("Parse Error: multiple actions possible at state: " + P + ", token: " + v);
|
98
|
+
switch (w[0]) {
|
99
|
+
case 1:
|
100
|
+
l.push(v), f.push(k.yytext), o.push(k.yylloc), l.push(w[1]), v = null, J = k.yyleng, _ = k.yytext, B = k.yylineno, Y = k.yylloc;
|
101
|
+
break;
|
102
|
+
case 2:
|
103
|
+
if ($ = this.productions_[w[1]][1], C.$ = f[f.length - $], C._$ = {
|
104
|
+
first_line: o[o.length - ($ || 1)].first_line,
|
105
|
+
last_line: o[o.length - 1].last_line,
|
106
|
+
first_column: o[o.length - ($ || 1)].first_column,
|
107
|
+
last_column: o[o.length - 1].last_column
|
108
|
+
}, dt && (C._$.range = [
|
109
|
+
o[o.length - ($ || 1)].range[0],
|
110
|
+
o[o.length - 1].range[1]
|
111
|
+
]), q = this.performAction.apply(C, [
|
112
|
+
_,
|
113
|
+
J,
|
114
|
+
B,
|
115
|
+
E.yy,
|
116
|
+
w[1],
|
117
|
+
f,
|
118
|
+
o
|
119
|
+
].concat(yt)), typeof q < "u")
|
120
|
+
return q;
|
121
|
+
$ && (l = l.slice(0, -1 * $ * 2), f = f.slice(0, -1 * $), o = o.slice(0, -1 * $)), l.push(this.productions_[w[1]][0]), f.push(C.$), o.push(C._$), D = S[l[l.length - 2]][l[l.length - 1]], l.push(D);
|
122
|
+
break;
|
123
|
+
case 3:
|
124
|
+
return !0;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
return !0;
|
128
|
+
}, "parse")
|
129
|
+
}, x = /* @__PURE__ */ function() {
|
130
|
+
var g = {
|
131
|
+
EOF: 1,
|
132
|
+
parseError: /* @__PURE__ */ i(function(a, l) {
|
133
|
+
if (this.yy.parser)
|
134
|
+
this.yy.parser.parseError(a, l);
|
135
|
+
else
|
136
|
+
throw new Error(a);
|
137
|
+
}, "parseError"),
|
138
|
+
// resets the lexer, sets new input
|
139
|
+
setInput: /* @__PURE__ */ i(function(r, a) {
|
140
|
+
return this.yy = a || 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 = {
|
141
|
+
first_line: 1,
|
142
|
+
first_column: 0,
|
143
|
+
last_line: 1,
|
144
|
+
last_column: 0
|
145
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
146
|
+
}, "setInput"),
|
147
|
+
// consumes and returns one char from the input
|
148
|
+
input: /* @__PURE__ */ i(function() {
|
149
|
+
var r = this._input[0];
|
150
|
+
this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
|
151
|
+
var a = r.match(/(?:\r\n?|\n).*/g);
|
152
|
+
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), r;
|
153
|
+
}, "input"),
|
154
|
+
// unshifts one char (or a string) into the input
|
155
|
+
unput: /* @__PURE__ */ i(function(r) {
|
156
|
+
var a = r.length, l = r.split(/(?:\r\n?|\n)/g);
|
157
|
+
this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
|
158
|
+
var y = this.match.split(/(?:\r\n?|\n)/g);
|
159
|
+
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);
|
160
|
+
var f = this.yylloc.range;
|
161
|
+
return this.yylloc = {
|
162
|
+
first_line: this.yylloc.first_line,
|
163
|
+
last_line: this.yylineno + 1,
|
164
|
+
first_column: this.yylloc.first_column,
|
165
|
+
last_column: l ? (l.length === y.length ? this.yylloc.first_column : 0) + y[y.length - l.length].length - l[0].length : this.yylloc.first_column - a
|
166
|
+
}, this.options.ranges && (this.yylloc.range = [f[0], f[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
|
167
|
+
}, "unput"),
|
168
|
+
// When called from action, caches matched text and appends it on next action
|
169
|
+
more: /* @__PURE__ */ i(function() {
|
170
|
+
return this._more = !0, this;
|
171
|
+
}, "more"),
|
172
|
+
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
173
|
+
reject: /* @__PURE__ */ i(function() {
|
174
|
+
if (this.options.backtrack_lexer)
|
175
|
+
this._backtrack = !0;
|
176
|
+
else
|
177
|
+
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).
|
178
|
+
` + this.showPosition(), {
|
179
|
+
text: "",
|
180
|
+
token: null,
|
181
|
+
line: this.yylineno
|
182
|
+
});
|
183
|
+
return this;
|
184
|
+
}, "reject"),
|
185
|
+
// retain first n characters of the match
|
186
|
+
less: /* @__PURE__ */ i(function(r) {
|
187
|
+
this.unput(this.match.slice(r));
|
188
|
+
}, "less"),
|
189
|
+
// displays already matched input, i.e. for error messages
|
190
|
+
pastInput: /* @__PURE__ */ i(function() {
|
191
|
+
var r = this.matched.substr(0, this.matched.length - this.match.length);
|
192
|
+
return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
|
193
|
+
}, "pastInput"),
|
194
|
+
// displays upcoming input, i.e. for error messages
|
195
|
+
upcomingInput: /* @__PURE__ */ i(function() {
|
196
|
+
var r = this.match;
|
197
|
+
return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
|
198
|
+
}, "upcomingInput"),
|
199
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
200
|
+
showPosition: /* @__PURE__ */ i(function() {
|
201
|
+
var r = this.pastInput(), a = new Array(r.length + 1).join("-");
|
202
|
+
return r + this.upcomingInput() + `
|
203
|
+
` + a + "^";
|
204
|
+
}, "showPosition"),
|
205
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
206
|
+
test_match: /* @__PURE__ */ i(function(r, a) {
|
207
|
+
var l, y, f;
|
208
|
+
if (this.options.backtrack_lexer && (f = {
|
209
|
+
yylineno: this.yylineno,
|
210
|
+
yylloc: {
|
211
|
+
first_line: this.yylloc.first_line,
|
212
|
+
last_line: this.last_line,
|
213
|
+
first_column: this.yylloc.first_column,
|
214
|
+
last_column: this.yylloc.last_column
|
215
|
+
},
|
216
|
+
yytext: this.yytext,
|
217
|
+
match: this.match,
|
218
|
+
matches: this.matches,
|
219
|
+
matched: this.matched,
|
220
|
+
yyleng: this.yyleng,
|
221
|
+
offset: this.offset,
|
222
|
+
_more: this._more,
|
223
|
+
_input: this._input,
|
224
|
+
yy: this.yy,
|
225
|
+
conditionStack: this.conditionStack.slice(0),
|
226
|
+
done: this.done
|
227
|
+
}, this.options.ranges && (f.yylloc.range = this.yylloc.range.slice(0))), y = r[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
|
228
|
+
first_line: this.yylloc.last_line,
|
229
|
+
last_line: this.yylineno + 1,
|
230
|
+
first_column: this.yylloc.last_column,
|
231
|
+
last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
|
232
|
+
}, 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, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
|
233
|
+
return l;
|
234
|
+
if (this._backtrack) {
|
235
|
+
for (var o in f)
|
236
|
+
this[o] = f[o];
|
237
|
+
return !1;
|
238
|
+
}
|
239
|
+
return !1;
|
240
|
+
}, "test_match"),
|
241
|
+
// return next match in input
|
242
|
+
next: /* @__PURE__ */ i(function() {
|
243
|
+
if (this.done)
|
244
|
+
return this.EOF;
|
245
|
+
this._input || (this.done = !0);
|
246
|
+
var r, a, l, y;
|
247
|
+
this._more || (this.yytext = "", this.match = "");
|
248
|
+
for (var f = this._currentRules(), o = 0; o < f.length; o++)
|
249
|
+
if (l = this._input.match(this.rules[f[o]]), l && (!a || l[0].length > a[0].length)) {
|
250
|
+
if (a = l, y = o, this.options.backtrack_lexer) {
|
251
|
+
if (r = this.test_match(l, f[o]), r !== !1)
|
252
|
+
return r;
|
253
|
+
if (this._backtrack) {
|
254
|
+
a = !1;
|
255
|
+
continue;
|
256
|
+
} else
|
257
|
+
return !1;
|
258
|
+
} else if (!this.options.flex)
|
259
|
+
break;
|
260
|
+
}
|
261
|
+
return a ? (r = this.test_match(a, f[y]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
262
|
+
` + this.showPosition(), {
|
263
|
+
text: "",
|
264
|
+
token: null,
|
265
|
+
line: this.yylineno
|
266
|
+
});
|
267
|
+
}, "next"),
|
268
|
+
// return next match that has a token
|
269
|
+
lex: /* @__PURE__ */ i(function() {
|
270
|
+
var a = this.next();
|
271
|
+
return a || this.lex();
|
272
|
+
}, "lex"),
|
273
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
274
|
+
begin: /* @__PURE__ */ i(function(a) {
|
275
|
+
this.conditionStack.push(a);
|
276
|
+
}, "begin"),
|
277
|
+
// pop the previously active lexer condition state off the condition stack
|
278
|
+
popState: /* @__PURE__ */ i(function() {
|
279
|
+
var a = this.conditionStack.length - 1;
|
280
|
+
return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
281
|
+
}, "popState"),
|
282
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
283
|
+
_currentRules: /* @__PURE__ */ i(function() {
|
284
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
285
|
+
}, "_currentRules"),
|
286
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
287
|
+
topState: /* @__PURE__ */ i(function(a) {
|
288
|
+
return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
|
289
|
+
}, "topState"),
|
290
|
+
// alias for begin(condition)
|
291
|
+
pushState: /* @__PURE__ */ i(function(a) {
|
292
|
+
this.begin(a);
|
293
|
+
}, "pushState"),
|
294
|
+
// return the number of states currently on the stack
|
295
|
+
stateStackSize: /* @__PURE__ */ i(function() {
|
296
|
+
return this.conditionStack.length;
|
297
|
+
}, "stateStackSize"),
|
298
|
+
options: { "case-insensitive": !0 },
|
299
|
+
performAction: /* @__PURE__ */ i(function(a, l, y, f) {
|
300
|
+
switch (y) {
|
301
|
+
case 0:
|
302
|
+
break;
|
303
|
+
case 1:
|
304
|
+
break;
|
305
|
+
case 2:
|
306
|
+
return 10;
|
307
|
+
case 3:
|
308
|
+
break;
|
309
|
+
case 4:
|
310
|
+
break;
|
311
|
+
case 5:
|
312
|
+
return 4;
|
313
|
+
case 6:
|
314
|
+
return 11;
|
315
|
+
case 7:
|
316
|
+
return this.begin("acc_title"), 12;
|
317
|
+
case 8:
|
318
|
+
return this.popState(), "acc_title_value";
|
319
|
+
case 9:
|
320
|
+
return this.begin("acc_descr"), 14;
|
321
|
+
case 10:
|
322
|
+
return this.popState(), "acc_descr_value";
|
323
|
+
case 11:
|
324
|
+
this.begin("acc_descr_multiline");
|
325
|
+
break;
|
326
|
+
case 12:
|
327
|
+
this.popState();
|
328
|
+
break;
|
329
|
+
case 13:
|
330
|
+
return "acc_descr_multiline_value";
|
331
|
+
case 14:
|
332
|
+
return 17;
|
333
|
+
case 15:
|
334
|
+
return 18;
|
335
|
+
case 16:
|
336
|
+
return 19;
|
337
|
+
case 17:
|
338
|
+
return ":";
|
339
|
+
case 18:
|
340
|
+
return 6;
|
341
|
+
case 19:
|
342
|
+
return "INVALID";
|
343
|
+
}
|
344
|
+
}, "anonymous"),
|
345
|
+
rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i],
|
346
|
+
conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], inclusive: !0 } }
|
347
|
+
};
|
348
|
+
return g;
|
349
|
+
}();
|
350
|
+
d.lexer = x;
|
351
|
+
function m() {
|
352
|
+
this.yy = {};
|
353
|
+
}
|
354
|
+
return i(m, "Parser"), m.prototype = d, d.Parser = m, new m();
|
355
|
+
}();
|
356
|
+
H.parser = H;
|
357
|
+
var $t = H, V = "", U = [], F = [], R = [], Mt = /* @__PURE__ */ i(function() {
|
358
|
+
U.length = 0, F.length = 0, V = "", R.length = 0, St();
|
359
|
+
}, "clear"), Et = /* @__PURE__ */ i(function(t) {
|
360
|
+
V = t, U.push(t);
|
361
|
+
}, "addSection"), Pt = /* @__PURE__ */ i(function() {
|
362
|
+
return U;
|
363
|
+
}, "getSections"), It = /* @__PURE__ */ i(function() {
|
364
|
+
let t = et();
|
365
|
+
const e = 100;
|
366
|
+
let n = 0;
|
367
|
+
for (; !t && n < e; )
|
368
|
+
t = et(), n++;
|
369
|
+
return F.push(...R), F;
|
370
|
+
}, "getTasks"), At = /* @__PURE__ */ i(function() {
|
371
|
+
const t = [];
|
372
|
+
return F.forEach((n) => {
|
373
|
+
n.people && t.push(...n.people);
|
374
|
+
}), [...new Set(t)].sort();
|
375
|
+
}, "updateActors"), Ct = /* @__PURE__ */ i(function(t, e) {
|
376
|
+
const n = e.substr(1).split(":");
|
377
|
+
let c = 0, s = [];
|
378
|
+
n.length === 1 ? (c = Number(n[0]), s = []) : (c = Number(n[0]), s = n[1].split(","));
|
379
|
+
const u = s.map((p) => p.trim()), h = {
|
380
|
+
section: V,
|
381
|
+
type: V,
|
382
|
+
people: u,
|
383
|
+
task: t,
|
384
|
+
score: c
|
385
|
+
};
|
386
|
+
R.push(h);
|
387
|
+
}, "addTask"), Vt = /* @__PURE__ */ i(function(t) {
|
388
|
+
const e = {
|
389
|
+
section: V,
|
390
|
+
type: V,
|
391
|
+
description: t,
|
392
|
+
task: t,
|
393
|
+
classes: []
|
394
|
+
};
|
395
|
+
F.push(e);
|
396
|
+
}, "addTaskOrg"), et = /* @__PURE__ */ i(function() {
|
397
|
+
const t = /* @__PURE__ */ i(function(n) {
|
398
|
+
return R[n].processed;
|
399
|
+
}, "compileTask");
|
400
|
+
let e = !0;
|
401
|
+
for (const [n, c] of R.entries())
|
402
|
+
t(n), e = e && c.processed;
|
403
|
+
return e;
|
404
|
+
}, "compileTasks"), Ft = /* @__PURE__ */ i(function() {
|
405
|
+
return At();
|
406
|
+
}, "getActors"), rt = {
|
407
|
+
getConfig: /* @__PURE__ */ i(() => A().journey, "getConfig"),
|
408
|
+
clear: Mt,
|
409
|
+
setDiagramTitle: wt,
|
410
|
+
getDiagramTitle: bt,
|
411
|
+
setAccTitle: vt,
|
412
|
+
getAccTitle: _t,
|
413
|
+
setAccDescription: kt,
|
414
|
+
getAccDescription: xt,
|
415
|
+
addSection: Et,
|
416
|
+
getSections: Pt,
|
417
|
+
getTasks: It,
|
418
|
+
addTask: Ct,
|
419
|
+
addTaskOrg: Vt,
|
420
|
+
getActors: Ft
|
421
|
+
}, Rt = /* @__PURE__ */ i((t) => `.label {
|
422
|
+
font-family: ${t.fontFamily};
|
423
|
+
color: ${t.textColor};
|
424
|
+
}
|
425
|
+
.mouth {
|
426
|
+
stroke: #666;
|
427
|
+
}
|
428
|
+
|
429
|
+
line {
|
430
|
+
stroke: ${t.textColor}
|
431
|
+
}
|
432
|
+
|
433
|
+
.legend {
|
434
|
+
fill: ${t.textColor};
|
435
|
+
font-family: ${t.fontFamily};
|
436
|
+
}
|
437
|
+
|
438
|
+
.label text {
|
439
|
+
fill: #333;
|
440
|
+
}
|
441
|
+
.label {
|
442
|
+
color: ${t.textColor}
|
443
|
+
}
|
444
|
+
|
445
|
+
.face {
|
446
|
+
${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};
|
447
|
+
stroke: #999;
|
448
|
+
}
|
449
|
+
|
450
|
+
.node rect,
|
451
|
+
.node circle,
|
452
|
+
.node ellipse,
|
453
|
+
.node polygon,
|
454
|
+
.node path {
|
455
|
+
fill: ${t.mainBkg};
|
456
|
+
stroke: ${t.nodeBorder};
|
457
|
+
stroke-width: 1px;
|
458
|
+
}
|
459
|
+
|
460
|
+
.node .label {
|
461
|
+
text-align: center;
|
462
|
+
}
|
463
|
+
.node.clickable {
|
464
|
+
cursor: pointer;
|
465
|
+
}
|
466
|
+
|
467
|
+
.arrowheadPath {
|
468
|
+
fill: ${t.arrowheadColor};
|
469
|
+
}
|
470
|
+
|
471
|
+
.edgePath .path {
|
472
|
+
stroke: ${t.lineColor};
|
473
|
+
stroke-width: 1.5px;
|
474
|
+
}
|
475
|
+
|
476
|
+
.flowchart-link {
|
477
|
+
stroke: ${t.lineColor};
|
478
|
+
fill: none;
|
479
|
+
}
|
480
|
+
|
481
|
+
.edgeLabel {
|
482
|
+
background-color: ${t.edgeLabelBackground};
|
483
|
+
rect {
|
484
|
+
opacity: 0.5;
|
485
|
+
}
|
486
|
+
text-align: center;
|
487
|
+
}
|
488
|
+
|
489
|
+
.cluster rect {
|
490
|
+
}
|
491
|
+
|
492
|
+
.cluster text {
|
493
|
+
fill: ${t.titleColor};
|
494
|
+
}
|
495
|
+
|
496
|
+
div.mermaidTooltip {
|
497
|
+
position: absolute;
|
498
|
+
text-align: center;
|
499
|
+
max-width: 200px;
|
500
|
+
padding: 2px;
|
501
|
+
font-family: ${t.fontFamily};
|
502
|
+
font-size: 12px;
|
503
|
+
background: ${t.tertiaryColor};
|
504
|
+
border: 1px solid ${t.border2};
|
505
|
+
border-radius: 2px;
|
506
|
+
pointer-events: none;
|
507
|
+
z-index: 100;
|
508
|
+
}
|
509
|
+
|
510
|
+
.task-type-0, .section-type-0 {
|
511
|
+
${t.fillType0 ? `fill: ${t.fillType0}` : ""};
|
512
|
+
}
|
513
|
+
.task-type-1, .section-type-1 {
|
514
|
+
${t.fillType0 ? `fill: ${t.fillType1}` : ""};
|
515
|
+
}
|
516
|
+
.task-type-2, .section-type-2 {
|
517
|
+
${t.fillType0 ? `fill: ${t.fillType2}` : ""};
|
518
|
+
}
|
519
|
+
.task-type-3, .section-type-3 {
|
520
|
+
${t.fillType0 ? `fill: ${t.fillType3}` : ""};
|
521
|
+
}
|
522
|
+
.task-type-4, .section-type-4 {
|
523
|
+
${t.fillType0 ? `fill: ${t.fillType4}` : ""};
|
524
|
+
}
|
525
|
+
.task-type-5, .section-type-5 {
|
526
|
+
${t.fillType0 ? `fill: ${t.fillType5}` : ""};
|
527
|
+
}
|
528
|
+
.task-type-6, .section-type-6 {
|
529
|
+
${t.fillType0 ? `fill: ${t.fillType6}` : ""};
|
530
|
+
}
|
531
|
+
.task-type-7, .section-type-7 {
|
532
|
+
${t.fillType0 ? `fill: ${t.fillType7}` : ""};
|
533
|
+
}
|
534
|
+
|
535
|
+
.actor-0 {
|
536
|
+
${t.actor0 ? `fill: ${t.actor0}` : ""};
|
537
|
+
}
|
538
|
+
.actor-1 {
|
539
|
+
${t.actor1 ? `fill: ${t.actor1}` : ""};
|
540
|
+
}
|
541
|
+
.actor-2 {
|
542
|
+
${t.actor2 ? `fill: ${t.actor2}` : ""};
|
543
|
+
}
|
544
|
+
.actor-3 {
|
545
|
+
${t.actor3 ? `fill: ${t.actor3}` : ""};
|
546
|
+
}
|
547
|
+
.actor-4 {
|
548
|
+
${t.actor4 ? `fill: ${t.actor4}` : ""};
|
549
|
+
}
|
550
|
+
.actor-5 {
|
551
|
+
${t.actor5 ? `fill: ${t.actor5}` : ""};
|
552
|
+
}
|
553
|
+
`, "getStyles"), Lt = Rt, Z = /* @__PURE__ */ i(function(t, e) {
|
554
|
+
return mt(t, e);
|
555
|
+
}, "drawRect"), Bt = /* @__PURE__ */ i(function(t, e) {
|
556
|
+
const c = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), s = t.append("g");
|
557
|
+
s.append("circle").attr("cx", e.cx - 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), s.append("circle").attr("cx", e.cx + 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
|
558
|
+
function u(d) {
|
559
|
+
const x = tt().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
560
|
+
d.append("path").attr("class", "mouth").attr("d", x).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
|
561
|
+
}
|
562
|
+
i(u, "smile");
|
563
|
+
function h(d) {
|
564
|
+
const x = tt().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
565
|
+
d.append("path").attr("class", "mouth").attr("d", x).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
|
566
|
+
}
|
567
|
+
i(h, "sad");
|
568
|
+
function p(d) {
|
569
|
+
d.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", e.cx - 5).attr("y1", e.cy + 7).attr("x2", e.cx + 5).attr("y2", e.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
|
570
|
+
}
|
571
|
+
return i(p, "ambivalent"), e.score > 3 ? u(s) : e.score < 3 ? h(s) : p(s), c;
|
572
|
+
}, "drawFace"), lt = /* @__PURE__ */ i(function(t, e) {
|
573
|
+
const n = t.append("circle");
|
574
|
+
return n.attr("cx", e.cx), n.attr("cy", e.cy), n.attr("class", "actor-" + e.pos), n.attr("fill", e.fill), n.attr("stroke", e.stroke), n.attr("r", e.r), n.class !== void 0 && n.attr("class", n.class), e.title !== void 0 && n.append("title").text(e.title), n;
|
575
|
+
}, "drawCircle"), ot = /* @__PURE__ */ i(function(t, e) {
|
576
|
+
return gt(t, e);
|
577
|
+
}, "drawText"), Nt = /* @__PURE__ */ i(function(t, e) {
|
578
|
+
function n(s, u, h, p, d) {
|
579
|
+
return s + "," + u + " " + (s + h) + "," + u + " " + (s + h) + "," + (u + p - d) + " " + (s + h - d * 1.2) + "," + (u + p) + " " + s + "," + (u + p);
|
580
|
+
}
|
581
|
+
i(n, "genPoints");
|
582
|
+
const c = t.append("polygon");
|
583
|
+
c.attr("points", n(e.x, e.y, 50, 20, 7)), c.attr("class", "labelBox"), e.y = e.y + e.labelMargin, e.x = e.x + 0.5 * e.labelMargin, ot(t, e);
|
584
|
+
}, "drawLabel"), jt = /* @__PURE__ */ i(function(t, e, n) {
|
585
|
+
const c = t.append("g"), s = at();
|
586
|
+
s.x = e.x, s.y = e.y, s.fill = e.fill, s.width = n.width * e.taskCount + // width of the tasks
|
587
|
+
n.diagramMarginX * (e.taskCount - 1), s.height = n.height, s.class = "journey-section section-type-" + e.num, s.rx = 3, s.ry = 3, Z(c, s), ct(n)(
|
588
|
+
e.text,
|
589
|
+
c,
|
590
|
+
s.x,
|
591
|
+
s.y,
|
592
|
+
s.width,
|
593
|
+
s.height,
|
594
|
+
{ class: "journey-section section-type-" + e.num },
|
595
|
+
n,
|
596
|
+
e.colour
|
597
|
+
);
|
598
|
+
}, "drawSection"), st = -1, zt = /* @__PURE__ */ i(function(t, e, n) {
|
599
|
+
const c = e.x + n.width / 2, s = t.append("g");
|
600
|
+
st++;
|
601
|
+
const u = 300 + 5 * 30;
|
602
|
+
s.append("line").attr("id", "task" + st).attr("x1", c).attr("y1", e.y).attr("x2", c).attr("y2", u).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Bt(s, {
|
603
|
+
cx: c,
|
604
|
+
cy: 300 + (5 - e.score) * 30,
|
605
|
+
score: e.score
|
606
|
+
});
|
607
|
+
const h = at();
|
608
|
+
h.x = e.x, h.y = e.y, h.fill = e.fill, h.width = n.width, h.height = n.height, h.class = "task task-type-" + e.num, h.rx = 3, h.ry = 3, Z(s, h);
|
609
|
+
let p = e.x + 14;
|
610
|
+
e.people.forEach((d) => {
|
611
|
+
const x = e.actors[d].color, m = {
|
612
|
+
cx: p,
|
613
|
+
cy: e.y,
|
614
|
+
r: 7,
|
615
|
+
fill: x,
|
616
|
+
stroke: "#000",
|
617
|
+
title: d,
|
618
|
+
pos: e.actors[d].position
|
619
|
+
};
|
620
|
+
lt(s, m), p += 10;
|
621
|
+
}), ct(n)(
|
622
|
+
e.task,
|
623
|
+
s,
|
624
|
+
h.x,
|
625
|
+
h.y,
|
626
|
+
h.width,
|
627
|
+
h.height,
|
628
|
+
{ class: "task" },
|
629
|
+
n,
|
630
|
+
e.colour
|
631
|
+
);
|
632
|
+
}, "drawTask"), Ot = /* @__PURE__ */ i(function(t, e) {
|
633
|
+
ft(t, e);
|
634
|
+
}, "drawBackgroundRect"), ct = /* @__PURE__ */ function() {
|
635
|
+
function t(s, u, h, p, d, x, m, g) {
|
636
|
+
const r = u.append("text").attr("x", h + d / 2).attr("y", p + x / 2 + 5).style("font-color", g).style("text-anchor", "middle").text(s);
|
637
|
+
c(r, m);
|
638
|
+
}
|
639
|
+
i(t, "byText");
|
640
|
+
function e(s, u, h, p, d, x, m, g, r) {
|
641
|
+
const { taskFontSize: a, taskFontFamily: l } = g, y = s.split(/<br\s*\/?>/gi);
|
642
|
+
for (let f = 0; f < y.length; f++) {
|
643
|
+
const o = f * a - a * (y.length - 1) / 2, S = u.append("text").attr("x", h + d / 2).attr("y", p).attr("fill", r).style("text-anchor", "middle").style("font-size", a).style("font-family", l);
|
644
|
+
S.append("tspan").attr("x", h + d / 2).attr("dy", o).text(y[f]), S.attr("y", p + x / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), c(S, m);
|
645
|
+
}
|
646
|
+
}
|
647
|
+
i(e, "byTspan");
|
648
|
+
function n(s, u, h, p, d, x, m, g) {
|
649
|
+
const r = u.append("switch"), l = r.append("foreignObject").attr("x", h).attr("y", p).attr("width", d).attr("height", x).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
650
|
+
l.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(s), e(s, r, h, p, d, x, m, g), c(l, m);
|
651
|
+
}
|
652
|
+
i(n, "byFo");
|
653
|
+
function c(s, u) {
|
654
|
+
for (const h in u)
|
655
|
+
h in u && s.attr(h, u[h]);
|
656
|
+
}
|
657
|
+
return i(c, "_setTextAttrs"), function(s) {
|
658
|
+
return s.textPlacement === "fo" ? n : s.textPlacement === "old" ? t : e;
|
659
|
+
};
|
660
|
+
}(), Yt = /* @__PURE__ */ i(function(t) {
|
661
|
+
t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
|
662
|
+
}, "initGraphics"), L = {
|
663
|
+
drawRect: Z,
|
664
|
+
drawCircle: lt,
|
665
|
+
drawSection: jt,
|
666
|
+
drawText: ot,
|
667
|
+
drawLabel: Nt,
|
668
|
+
drawTask: zt,
|
669
|
+
drawBackgroundRect: Ot,
|
670
|
+
initGraphics: Yt
|
671
|
+
}, qt = /* @__PURE__ */ i(function(t) {
|
672
|
+
Object.keys(t).forEach(function(n) {
|
673
|
+
z[n] = t[n];
|
674
|
+
});
|
675
|
+
}, "setConf"), M = {};
|
676
|
+
function ht(t) {
|
677
|
+
const e = A().journey;
|
678
|
+
let n = 60;
|
679
|
+
Object.keys(M).forEach((c) => {
|
680
|
+
const s = M[c].color, u = {
|
681
|
+
cx: 20,
|
682
|
+
cy: n,
|
683
|
+
r: 7,
|
684
|
+
fill: s,
|
685
|
+
stroke: "#000",
|
686
|
+
pos: M[c].position
|
687
|
+
};
|
688
|
+
L.drawCircle(t, u);
|
689
|
+
const h = {
|
690
|
+
x: 40,
|
691
|
+
y: n + 7,
|
692
|
+
fill: "#666",
|
693
|
+
text: c,
|
694
|
+
textMargin: e.boxTextMargin | 5
|
695
|
+
};
|
696
|
+
L.drawText(t, h), n += 20;
|
697
|
+
});
|
698
|
+
}
|
699
|
+
i(ht, "drawActorLegend");
|
700
|
+
var z = A().journey, I = z.leftMargin, Gt = /* @__PURE__ */ i(function(t, e, n, c) {
|
701
|
+
const s = A().journey, u = A().securityLevel;
|
702
|
+
let h;
|
703
|
+
u === "sandbox" && (h = W("#i" + e));
|
704
|
+
const p = u === "sandbox" ? W(h.nodes()[0].contentDocument.body) : W("body");
|
705
|
+
T.init();
|
706
|
+
const d = p.select("#" + e);
|
707
|
+
L.initGraphics(d);
|
708
|
+
const x = c.db.getTasks(), m = c.db.getDiagramTitle(), g = c.db.getActors();
|
709
|
+
for (const o in M)
|
710
|
+
delete M[o];
|
711
|
+
let r = 0;
|
712
|
+
g.forEach((o) => {
|
713
|
+
M[o] = {
|
714
|
+
color: s.actorColours[r % s.actorColours.length],
|
715
|
+
position: r
|
716
|
+
}, r++;
|
717
|
+
}), ht(d), T.insert(0, 0, I, Object.keys(M).length * 50), Wt(d, x, 0);
|
718
|
+
const a = T.getBounds();
|
719
|
+
m && d.append("text").text(m).attr("x", I).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25);
|
720
|
+
const l = a.stopy - a.starty + 2 * s.diagramMarginY, y = I + a.stopx + 2 * s.diagramMarginX;
|
721
|
+
Tt(d, l, y, s.useMaxWidth), d.append("line").attr("x1", I).attr("y1", s.height * 4).attr("x2", y - I - 4).attr("y2", s.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
|
722
|
+
const f = m ? 70 : 0;
|
723
|
+
d.attr("viewBox", `${a.startx} -25 ${y} ${l + f}`), d.attr("preserveAspectRatio", "xMinYMin meet"), d.attr("height", l + f + 25);
|
724
|
+
}, "draw"), T = {
|
725
|
+
data: {
|
726
|
+
startx: void 0,
|
727
|
+
stopx: void 0,
|
728
|
+
starty: void 0,
|
729
|
+
stopy: void 0
|
730
|
+
},
|
731
|
+
verticalPos: 0,
|
732
|
+
sequenceItems: [],
|
733
|
+
init: /* @__PURE__ */ i(function() {
|
734
|
+
this.sequenceItems = [], this.data = {
|
735
|
+
startx: void 0,
|
736
|
+
stopx: void 0,
|
737
|
+
starty: void 0,
|
738
|
+
stopy: void 0
|
739
|
+
}, this.verticalPos = 0;
|
740
|
+
}, "init"),
|
741
|
+
updateVal: /* @__PURE__ */ i(function(t, e, n, c) {
|
742
|
+
t[e] === void 0 ? t[e] = n : t[e] = c(n, t[e]);
|
743
|
+
}, "updateVal"),
|
744
|
+
updateBounds: /* @__PURE__ */ i(function(t, e, n, c) {
|
745
|
+
const s = A().journey, u = this;
|
746
|
+
let h = 0;
|
747
|
+
function p(d) {
|
748
|
+
return /* @__PURE__ */ i(function(m) {
|
749
|
+
h++;
|
750
|
+
const g = u.sequenceItems.length - h + 1;
|
751
|
+
u.updateVal(m, "starty", e - g * s.boxMargin, Math.min), u.updateVal(m, "stopy", c + g * s.boxMargin, Math.max), u.updateVal(T.data, "startx", t - g * s.boxMargin, Math.min), u.updateVal(T.data, "stopx", n + g * s.boxMargin, Math.max), d !== "activation" && (u.updateVal(m, "startx", t - g * s.boxMargin, Math.min), u.updateVal(m, "stopx", n + g * s.boxMargin, Math.max), u.updateVal(T.data, "starty", e - g * s.boxMargin, Math.min), u.updateVal(T.data, "stopy", c + g * s.boxMargin, Math.max));
|
752
|
+
}, "updateItemBounds");
|
753
|
+
}
|
754
|
+
i(p, "updateFn"), this.sequenceItems.forEach(p());
|
755
|
+
}, "updateBounds"),
|
756
|
+
insert: /* @__PURE__ */ i(function(t, e, n, c) {
|
757
|
+
const s = Math.min(t, n), u = Math.max(t, n), h = Math.min(e, c), p = Math.max(e, c);
|
758
|
+
this.updateVal(T.data, "startx", s, Math.min), this.updateVal(T.data, "starty", h, Math.min), this.updateVal(T.data, "stopx", u, Math.max), this.updateVal(T.data, "stopy", p, Math.max), this.updateBounds(s, h, u, p);
|
759
|
+
}, "insert"),
|
760
|
+
bumpVerticalPos: /* @__PURE__ */ i(function(t) {
|
761
|
+
this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
|
762
|
+
}, "bumpVerticalPos"),
|
763
|
+
getVerticalPos: /* @__PURE__ */ i(function() {
|
764
|
+
return this.verticalPos;
|
765
|
+
}, "getVerticalPos"),
|
766
|
+
getBounds: /* @__PURE__ */ i(function() {
|
767
|
+
return this.data;
|
768
|
+
}, "getBounds")
|
769
|
+
}, X = z.sectionFills, it = z.sectionColours, Wt = /* @__PURE__ */ i(function(t, e, n) {
|
770
|
+
const c = A().journey;
|
771
|
+
let s = "";
|
772
|
+
const u = c.height * 2 + c.diagramMarginY, h = n + u;
|
773
|
+
let p = 0, d = "#CCC", x = "black", m = 0;
|
774
|
+
for (const [g, r] of e.entries()) {
|
775
|
+
if (s !== r.section) {
|
776
|
+
d = X[p % X.length], m = p % X.length, x = it[p % it.length];
|
777
|
+
let l = 0;
|
778
|
+
const y = r.section;
|
779
|
+
for (let o = g; o < e.length && e[o].section == y; o++)
|
780
|
+
l = l + 1;
|
781
|
+
const f = {
|
782
|
+
x: g * c.taskMargin + g * c.width + I,
|
783
|
+
y: 50,
|
784
|
+
text: r.section,
|
785
|
+
fill: d,
|
786
|
+
num: m,
|
787
|
+
colour: x,
|
788
|
+
taskCount: l
|
789
|
+
};
|
790
|
+
L.drawSection(t, f, c), s = r.section, p++;
|
791
|
+
}
|
792
|
+
const a = r.people.reduce((l, y) => (M[y] && (l[y] = M[y]), l), {});
|
793
|
+
r.x = g * c.taskMargin + g * c.width + I, r.y = h, r.width = c.diagramMarginX, r.height = c.diagramMarginY, r.colour = x, r.fill = d, r.num = m, r.actors = a, L.drawTask(t, r, c), T.insert(r.x, r.y, r.x + r.width + c.taskMargin, 300 + 5 * 30);
|
794
|
+
}
|
795
|
+
}, "drawTasks"), nt = {
|
796
|
+
setConf: qt,
|
797
|
+
draw: Gt
|
798
|
+
}, Ut = {
|
799
|
+
parser: $t,
|
800
|
+
db: rt,
|
801
|
+
renderer: nt,
|
802
|
+
styles: Lt,
|
803
|
+
init: /* @__PURE__ */ i((t) => {
|
804
|
+
nt.setConf(t.journey), rt.clear();
|
805
|
+
}, "init")
|
806
|
+
};
|
807
|
+
export {
|
808
|
+
Ut as diagram
|
809
|
+
};
|