@schmitech/chatbot-widget 0.5.3 → 0.6.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/_basePickBy-C3-QE0dl-5eQ6L29l.js +152 -0
- package/dist/_baseUniq-CstiM9Lp-AFR_Ns0a.js +615 -0
- package/dist/arc-W3NKKXLI-DHbDwLx0.js +84 -0
- package/dist/architecture-U656AL7Q-fn9wJZsH-BLoGjtkP.js +6 -0
- package/dist/architectureDiagram-VXUJARFQ-zzJsgPC6-C4OfUE0m.js +4667 -0
- package/dist/blockDiagram-VD42YOAC-D-In4h7h-BYXdRmeG.js +2266 -0
- package/dist/c4Diagram-YG6GDRKO-DBs8r9gh-BdLuHgPT.js +1582 -0
- package/dist/channel-RBWQyMSg-Cx0HUumY.js +6 -0
- package/dist/chatbot-widget.bundle.js +4473 -1556
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +12 -63659
- package/dist/chatbot-widget.umd.js +4472 -1555
- package/dist/chunk-4BX2VUAB-BqD7w0AR-CbA2613c.js +10 -0
- package/dist/chunk-55IACEB6-D8pvDVEJ-DrL4SJSR.js +9 -0
- package/dist/chunk-B4BG7PRW-Dwma1pSy-BWjG5dc6.js +1375 -0
- package/dist/chunk-DI55MBZ5-BY2XXvZz-DbAvz3Pq.js +1383 -0
- package/dist/chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js +20 -0
- package/dist/chunk-QN33PNHL-BkO3hOeq-DkU1EzGA.js +21 -0
- package/dist/chunk-QZHKN3VN-Cwlo2qTG-DMmeZmp5.js +16 -0
- package/dist/chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js +65 -0
- package/dist/classDiagram-2ON5EDUG-Crd6O69V-kCZrFOLN.js +17 -0
- package/dist/classDiagram-v2-WZHVMYZB-Crd6O69V-kCZrFOLN.js +17 -0
- package/dist/clone-CfLgyC8S-DsDOh4B4.js +9 -0
- package/dist/config/index.d.ts +4 -2
- package/dist/cose-bilkent-S5V4N54A-DKeVcPDK-de_7nZTY.js +2609 -0
- package/dist/cytoscape.esm-CjI2IsL8-Be2K4mI6.js +18723 -0
- package/dist/dagre-6UL2VRFP-BPf604Df-BhZs6zCq.js +448 -0
- package/dist/diagram-PSM6KHXK-DeLcpEV3-qb4rujeN.js +532 -0
- package/dist/diagram-QEK2KX5R-C_5RR1NJ-C5kZWmRl.js +222 -0
- package/dist/diagram-S2PKOQOG-DVx43aon-4nlw6iDz.js +144 -0
- package/dist/erDiagram-Q2GNP2WA-DgUeO5_h-DHc9Yphl.js +841 -0
- package/dist/flowDiagram-NV44I4VS-C5HQUzU9-DHjbmAtJ.js +1628 -0
- package/dist/ganttDiagram-JELNMOA3-DgSZ1ixF-C3hJs_k9.js +1936 -0
- package/dist/gitGraph-F6HP7TQM-UL7-Bx1s-Cog5rj3j.js +6 -0
- package/dist/gitGraphDiagram-NY62KEGX-DY5loT9K-CEcKQNrM.js +713 -0
- package/dist/graph-BfwqPHx6-DErF9dBN.js +248 -0
- package/dist/index-B5s_uaP2.js +124168 -0
- package/dist/index-BAOVR-xx-thst7Pu6.js +13251 -0
- package/dist/info-NVLQJR56-BsqQ0RXQ-BcYgZCCY.js +6 -0
- package/dist/infoDiagram-WHAUD3N6-DIqQ6vCk-BuiAAMSH.js +25 -0
- package/dist/journeyDiagram-XKPGCS4Q-DXjg3S3r-Byi_TGXs.js +835 -0
- package/dist/kanban-definition-3W4ZIXB7-Uxt7Am6n-jy96nA-g.js +721 -0
- package/dist/layout-CSfkE668-BjigbqJL.js +1333 -0
- package/dist/mermaid-parser.core-LjuO4CL3-BLqmPe8-.js +12891 -0
- package/dist/mindmap-definition-VGOIOE7T-DXwVuAPE-SK4e1Sse.js +787 -0
- package/dist/packet-BFZMPI3H-DJWkrKrV-BamBev9S.js +6 -0
- package/dist/pie-7BOR55EZ-DC8hTFwn-D1bcIQbR.js +6 -0
- package/dist/pieDiagram-ADFJNKIX-Cj0EHHtj-Dbr09c-S.js +161 -0
- package/dist/quadrantDiagram-AYHSOK5B-CnLDz007-Ci0DQl2T.js +1024 -0
- package/dist/radar-NHE76QYJ-Bijk-Fk9-9nAmDCMr.js +6 -0
- package/dist/requirementDiagram-UZGBJVZJ-rDaI-8Be-CSEc4S33.js +851 -0
- package/dist/sankeyDiagram-TZEHDZUN-A0YO8ixs-Zj8Z0j0n.js +810 -0
- package/dist/sequenceDiagram-WL72ISMW-BFF7TtP7-Dcofckjv.js +2519 -0
- package/dist/shared/styles.d.ts +1 -1
- package/dist/stateDiagram-FKZM4ZOC-ofFsB7HJ-BJBX12rE.js +264 -0
- package/dist/stateDiagram-v2-4FDKWEC3-CEZFbksU-BywmU88h.js +17 -0
- package/dist/timeline-definition-IT6M3QCI-5W361ZNm-MP_ufVe7.js +800 -0
- package/dist/treemap-KMMF4GRG-pGRoYcSn-BeZ7sXgP.js +6 -0
- package/dist/ui/Message.d.ts +1 -5
- package/dist/ui/MessagesList.d.ts +1 -5
- package/dist/utils/contentFiltering.d.ts +12 -0
- package/dist/xychartDiagram-PRI3JC2R-CSr0GxaP-DBgCtplP.js +1297 -0
- package/package.json +3 -3
- package/dist/ui/TypingEffect.d.ts +0 -18
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
import { d as ft, y as rt, g as gt, x as mt } from "./chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js";
|
|
2
|
+
import { l as xt } from "./chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js";
|
|
3
|
+
import { x as s, B as kt, h as bt, g as _t, u as wt, z as $t, w as vt, p as V, f as X, G as St, L as Mt } from "./index-B5s_uaP2.js";
|
|
4
|
+
import { h as tt } from "./arc-W3NKKXLI-DHbDwLx0.js";
|
|
5
|
+
typeof window < "u" && (window.global = window);
|
|
6
|
+
var U = function() {
|
|
7
|
+
var t = /* @__PURE__ */ s(function(y, i, a, u) {
|
|
8
|
+
for (a = a || {}, u = y.length; u--; a[y[u]] = i) ;
|
|
9
|
+
return a;
|
|
10
|
+
}, "o"), e = [6, 8, 10, 11, 12, 14, 16, 17, 18], r = [1, 9], l = [1, 10], n = [1, 11], c = [1, 12], d = [1, 13], h = [1, 14], f = {
|
|
11
|
+
trace: /* @__PURE__ */ s(function() {
|
|
12
|
+
}, "trace"),
|
|
13
|
+
yy: {},
|
|
14
|
+
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 },
|
|
15
|
+
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" },
|
|
16
|
+
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]],
|
|
17
|
+
performAction: /* @__PURE__ */ s(function(y, i, a, u, p, o, x) {
|
|
18
|
+
var k = o.length - 1;
|
|
19
|
+
switch (p) {
|
|
20
|
+
case 1:
|
|
21
|
+
return o[k - 1];
|
|
22
|
+
case 2:
|
|
23
|
+
this.$ = [];
|
|
24
|
+
break;
|
|
25
|
+
case 3:
|
|
26
|
+
o[k - 1].push(o[k]), this.$ = o[k - 1];
|
|
27
|
+
break;
|
|
28
|
+
case 4:
|
|
29
|
+
case 5:
|
|
30
|
+
this.$ = o[k];
|
|
31
|
+
break;
|
|
32
|
+
case 6:
|
|
33
|
+
case 7:
|
|
34
|
+
this.$ = [];
|
|
35
|
+
break;
|
|
36
|
+
case 8:
|
|
37
|
+
u.setDiagramTitle(o[k].substr(6)), this.$ = o[k].substr(6);
|
|
38
|
+
break;
|
|
39
|
+
case 9:
|
|
40
|
+
this.$ = o[k].trim(), u.setAccTitle(this.$);
|
|
41
|
+
break;
|
|
42
|
+
case 10:
|
|
43
|
+
case 11:
|
|
44
|
+
this.$ = o[k].trim(), u.setAccDescription(this.$);
|
|
45
|
+
break;
|
|
46
|
+
case 12:
|
|
47
|
+
u.addSection(o[k].substr(8)), this.$ = o[k].substr(8);
|
|
48
|
+
break;
|
|
49
|
+
case 13:
|
|
50
|
+
u.addTask(o[k - 1], o[k]), this.$ = "task";
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}, "anonymous"),
|
|
54
|
+
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: r, 12: l, 14: n, 16: c, 17: d, 18: h }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: r, 12: l, 14: n, 16: c, 17: d, 18: h }, 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])],
|
|
55
|
+
defaultActions: {},
|
|
56
|
+
parseError: /* @__PURE__ */ s(function(y, i) {
|
|
57
|
+
if (i.recoverable)
|
|
58
|
+
this.trace(y);
|
|
59
|
+
else {
|
|
60
|
+
var a = new Error(y);
|
|
61
|
+
throw a.hash = i, a;
|
|
62
|
+
}
|
|
63
|
+
}, "parseError"),
|
|
64
|
+
parse: /* @__PURE__ */ s(function(y) {
|
|
65
|
+
var i = this, a = [0], u = [], p = [null], o = [], x = this.table, k = "", T = 0, A = 0, ut = 2, J = 1, pt = o.slice.call(arguments, 1), b = Object.create(this.lexer), I = { yy: {} };
|
|
66
|
+
for (var z in this.yy)
|
|
67
|
+
Object.prototype.hasOwnProperty.call(this.yy, z) && (I.yy[z] = this.yy[z]);
|
|
68
|
+
b.setInput(y, I.yy), I.yy.lexer = b, I.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
|
|
69
|
+
var Y = b.yylloc;
|
|
70
|
+
o.push(Y);
|
|
71
|
+
var yt = b.options && b.options.ranges;
|
|
72
|
+
typeof I.yy.parseError == "function" ? this.parseError = I.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
73
|
+
function dt(w) {
|
|
74
|
+
a.length = a.length - 2 * w, p.length = p.length - w, o.length = o.length - w;
|
|
75
|
+
}
|
|
76
|
+
s(dt, "popStack");
|
|
77
|
+
function K() {
|
|
78
|
+
var w;
|
|
79
|
+
return w = u.pop() || b.lex() || J, typeof w != "number" && (w instanceof Array && (u = w, w = u.pop()), w = i.symbols_[w] || w), w;
|
|
80
|
+
}
|
|
81
|
+
s(K, "lex");
|
|
82
|
+
for (var _, P, $, G, j = {}, D, M, H, O; ; ) {
|
|
83
|
+
if (P = a[a.length - 1], this.defaultActions[P] ? $ = this.defaultActions[P] : ((_ === null || typeof _ > "u") && (_ = K()), $ = x[P] && x[P][_]), typeof $ > "u" || !$.length || !$[0]) {
|
|
84
|
+
var W = "";
|
|
85
|
+
O = [];
|
|
86
|
+
for (D in x[P])
|
|
87
|
+
this.terminals_[D] && D > ut && O.push("'" + this.terminals_[D] + "'");
|
|
88
|
+
b.showPosition ? W = "Parse error on line " + (T + 1) + `:
|
|
89
|
+
` + b.showPosition() + `
|
|
90
|
+
Expecting ` + O.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : W = "Parse error on line " + (T + 1) + ": Unexpected " + (_ == J ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(W, {
|
|
91
|
+
text: b.match,
|
|
92
|
+
token: this.terminals_[_] || _,
|
|
93
|
+
line: b.yylineno,
|
|
94
|
+
loc: Y,
|
|
95
|
+
expected: O
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if ($[0] instanceof Array && $.length > 1)
|
|
99
|
+
throw new Error("Parse Error: multiple actions possible at state: " + P + ", token: " + _);
|
|
100
|
+
switch ($[0]) {
|
|
101
|
+
case 1:
|
|
102
|
+
a.push(_), p.push(b.yytext), o.push(b.yylloc), a.push($[1]), _ = null, A = b.yyleng, k = b.yytext, T = b.yylineno, Y = b.yylloc;
|
|
103
|
+
break;
|
|
104
|
+
case 2:
|
|
105
|
+
if (M = this.productions_[$[1]][1], j.$ = p[p.length - M], j._$ = {
|
|
106
|
+
first_line: o[o.length - (M || 1)].first_line,
|
|
107
|
+
last_line: o[o.length - 1].last_line,
|
|
108
|
+
first_column: o[o.length - (M || 1)].first_column,
|
|
109
|
+
last_column: o[o.length - 1].last_column
|
|
110
|
+
}, yt && (j._$.range = [
|
|
111
|
+
o[o.length - (M || 1)].range[0],
|
|
112
|
+
o[o.length - 1].range[1]
|
|
113
|
+
]), G = this.performAction.apply(j, [
|
|
114
|
+
k,
|
|
115
|
+
A,
|
|
116
|
+
T,
|
|
117
|
+
I.yy,
|
|
118
|
+
$[1],
|
|
119
|
+
p,
|
|
120
|
+
o
|
|
121
|
+
].concat(pt)), typeof G < "u")
|
|
122
|
+
return G;
|
|
123
|
+
M && (a = a.slice(0, -1 * M * 2), p = p.slice(0, -1 * M), o = o.slice(0, -1 * M)), a.push(this.productions_[$[1]][0]), p.push(j.$), o.push(j._$), H = x[a[a.length - 2]][a[a.length - 1]], a.push(H);
|
|
124
|
+
break;
|
|
125
|
+
case 3:
|
|
126
|
+
return !0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return !0;
|
|
130
|
+
}, "parse")
|
|
131
|
+
}, m = /* @__PURE__ */ function() {
|
|
132
|
+
var y = {
|
|
133
|
+
EOF: 1,
|
|
134
|
+
parseError: /* @__PURE__ */ s(function(i, a) {
|
|
135
|
+
if (this.yy.parser)
|
|
136
|
+
this.yy.parser.parseError(i, a);
|
|
137
|
+
else
|
|
138
|
+
throw new Error(i);
|
|
139
|
+
}, "parseError"),
|
|
140
|
+
// resets the lexer, sets new input
|
|
141
|
+
setInput: /* @__PURE__ */ s(function(i, a) {
|
|
142
|
+
return this.yy = a || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
143
|
+
first_line: 1,
|
|
144
|
+
first_column: 0,
|
|
145
|
+
last_line: 1,
|
|
146
|
+
last_column: 0
|
|
147
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
148
|
+
}, "setInput"),
|
|
149
|
+
// consumes and returns one char from the input
|
|
150
|
+
input: /* @__PURE__ */ s(function() {
|
|
151
|
+
var i = this._input[0];
|
|
152
|
+
this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
|
|
153
|
+
var a = i.match(/(?:\r\n?|\n).*/g);
|
|
154
|
+
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), i;
|
|
155
|
+
}, "input"),
|
|
156
|
+
// unshifts one char (or a string) into the input
|
|
157
|
+
unput: /* @__PURE__ */ s(function(i) {
|
|
158
|
+
var a = i.length, u = i.split(/(?:\r\n?|\n)/g);
|
|
159
|
+
this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
|
|
160
|
+
var p = this.match.split(/(?:\r\n?|\n)/g);
|
|
161
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), u.length - 1 && (this.yylineno -= u.length - 1);
|
|
162
|
+
var o = this.yylloc.range;
|
|
163
|
+
return this.yylloc = {
|
|
164
|
+
first_line: this.yylloc.first_line,
|
|
165
|
+
last_line: this.yylineno + 1,
|
|
166
|
+
first_column: this.yylloc.first_column,
|
|
167
|
+
last_column: u ? (u.length === p.length ? this.yylloc.first_column : 0) + p[p.length - u.length].length - u[0].length : this.yylloc.first_column - a
|
|
168
|
+
}, this.options.ranges && (this.yylloc.range = [o[0], o[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
|
|
169
|
+
}, "unput"),
|
|
170
|
+
// When called from action, caches matched text and appends it on next action
|
|
171
|
+
more: /* @__PURE__ */ s(function() {
|
|
172
|
+
return this._more = !0, this;
|
|
173
|
+
}, "more"),
|
|
174
|
+
// 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.
|
|
175
|
+
reject: /* @__PURE__ */ s(function() {
|
|
176
|
+
if (this.options.backtrack_lexer)
|
|
177
|
+
this._backtrack = !0;
|
|
178
|
+
else
|
|
179
|
+
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).
|
|
180
|
+
` + this.showPosition(), {
|
|
181
|
+
text: "",
|
|
182
|
+
token: null,
|
|
183
|
+
line: this.yylineno
|
|
184
|
+
});
|
|
185
|
+
return this;
|
|
186
|
+
}, "reject"),
|
|
187
|
+
// retain first n characters of the match
|
|
188
|
+
less: /* @__PURE__ */ s(function(i) {
|
|
189
|
+
this.unput(this.match.slice(i));
|
|
190
|
+
}, "less"),
|
|
191
|
+
// displays already matched input, i.e. for error messages
|
|
192
|
+
pastInput: /* @__PURE__ */ s(function() {
|
|
193
|
+
var i = this.matched.substr(0, this.matched.length - this.match.length);
|
|
194
|
+
return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
|
|
195
|
+
}, "pastInput"),
|
|
196
|
+
// displays upcoming input, i.e. for error messages
|
|
197
|
+
upcomingInput: /* @__PURE__ */ s(function() {
|
|
198
|
+
var i = this.match;
|
|
199
|
+
return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
200
|
+
}, "upcomingInput"),
|
|
201
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
202
|
+
showPosition: /* @__PURE__ */ s(function() {
|
|
203
|
+
var i = this.pastInput(), a = new Array(i.length + 1).join("-");
|
|
204
|
+
return i + this.upcomingInput() + `
|
|
205
|
+
` + a + "^";
|
|
206
|
+
}, "showPosition"),
|
|
207
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
208
|
+
test_match: /* @__PURE__ */ s(function(i, a) {
|
|
209
|
+
var u, p, o;
|
|
210
|
+
if (this.options.backtrack_lexer && (o = {
|
|
211
|
+
yylineno: this.yylineno,
|
|
212
|
+
yylloc: {
|
|
213
|
+
first_line: this.yylloc.first_line,
|
|
214
|
+
last_line: this.last_line,
|
|
215
|
+
first_column: this.yylloc.first_column,
|
|
216
|
+
last_column: this.yylloc.last_column
|
|
217
|
+
},
|
|
218
|
+
yytext: this.yytext,
|
|
219
|
+
match: this.match,
|
|
220
|
+
matches: this.matches,
|
|
221
|
+
matched: this.matched,
|
|
222
|
+
yyleng: this.yyleng,
|
|
223
|
+
offset: this.offset,
|
|
224
|
+
_more: this._more,
|
|
225
|
+
_input: this._input,
|
|
226
|
+
yy: this.yy,
|
|
227
|
+
conditionStack: this.conditionStack.slice(0),
|
|
228
|
+
done: this.done
|
|
229
|
+
}, this.options.ranges && (o.yylloc.range = this.yylloc.range.slice(0))), p = i[0].match(/(?:\r\n?|\n).*/g), p && (this.yylineno += p.length), this.yylloc = {
|
|
230
|
+
first_line: this.yylloc.last_line,
|
|
231
|
+
last_line: this.yylineno + 1,
|
|
232
|
+
first_column: this.yylloc.last_column,
|
|
233
|
+
last_column: p ? p[p.length - 1].length - p[p.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
|
|
234
|
+
}, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], u = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), u)
|
|
235
|
+
return u;
|
|
236
|
+
if (this._backtrack) {
|
|
237
|
+
for (var x in o)
|
|
238
|
+
this[x] = o[x];
|
|
239
|
+
return !1;
|
|
240
|
+
}
|
|
241
|
+
return !1;
|
|
242
|
+
}, "test_match"),
|
|
243
|
+
// return next match in input
|
|
244
|
+
next: /* @__PURE__ */ s(function() {
|
|
245
|
+
if (this.done)
|
|
246
|
+
return this.EOF;
|
|
247
|
+
this._input || (this.done = !0);
|
|
248
|
+
var i, a, u, p;
|
|
249
|
+
this._more || (this.yytext = "", this.match = "");
|
|
250
|
+
for (var o = this._currentRules(), x = 0; x < o.length; x++)
|
|
251
|
+
if (u = this._input.match(this.rules[o[x]]), u && (!a || u[0].length > a[0].length)) {
|
|
252
|
+
if (a = u, p = x, this.options.backtrack_lexer) {
|
|
253
|
+
if (i = this.test_match(u, o[x]), i !== !1)
|
|
254
|
+
return i;
|
|
255
|
+
if (this._backtrack) {
|
|
256
|
+
a = !1;
|
|
257
|
+
continue;
|
|
258
|
+
} else
|
|
259
|
+
return !1;
|
|
260
|
+
} else if (!this.options.flex)
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
return a ? (i = this.test_match(a, o[p]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
264
|
+
` + this.showPosition(), {
|
|
265
|
+
text: "",
|
|
266
|
+
token: null,
|
|
267
|
+
line: this.yylineno
|
|
268
|
+
});
|
|
269
|
+
}, "next"),
|
|
270
|
+
// return next match that has a token
|
|
271
|
+
lex: /* @__PURE__ */ s(function() {
|
|
272
|
+
var i = this.next();
|
|
273
|
+
return i || this.lex();
|
|
274
|
+
}, "lex"),
|
|
275
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
276
|
+
begin: /* @__PURE__ */ s(function(i) {
|
|
277
|
+
this.conditionStack.push(i);
|
|
278
|
+
}, "begin"),
|
|
279
|
+
// pop the previously active lexer condition state off the condition stack
|
|
280
|
+
popState: /* @__PURE__ */ s(function() {
|
|
281
|
+
var i = this.conditionStack.length - 1;
|
|
282
|
+
return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
283
|
+
}, "popState"),
|
|
284
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
285
|
+
_currentRules: /* @__PURE__ */ s(function() {
|
|
286
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
287
|
+
}, "_currentRules"),
|
|
288
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
289
|
+
topState: /* @__PURE__ */ s(function(i) {
|
|
290
|
+
return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
|
|
291
|
+
}, "topState"),
|
|
292
|
+
// alias for begin(condition)
|
|
293
|
+
pushState: /* @__PURE__ */ s(function(i) {
|
|
294
|
+
this.begin(i);
|
|
295
|
+
}, "pushState"),
|
|
296
|
+
// return the number of states currently on the stack
|
|
297
|
+
stateStackSize: /* @__PURE__ */ s(function() {
|
|
298
|
+
return this.conditionStack.length;
|
|
299
|
+
}, "stateStackSize"),
|
|
300
|
+
options: { "case-insensitive": !0 },
|
|
301
|
+
performAction: /* @__PURE__ */ s(function(i, a, u, p) {
|
|
302
|
+
switch (u) {
|
|
303
|
+
case 0:
|
|
304
|
+
break;
|
|
305
|
+
case 1:
|
|
306
|
+
break;
|
|
307
|
+
case 2:
|
|
308
|
+
return 10;
|
|
309
|
+
case 3:
|
|
310
|
+
break;
|
|
311
|
+
case 4:
|
|
312
|
+
break;
|
|
313
|
+
case 5:
|
|
314
|
+
return 4;
|
|
315
|
+
case 6:
|
|
316
|
+
return 11;
|
|
317
|
+
case 7:
|
|
318
|
+
return this.begin("acc_title"), 12;
|
|
319
|
+
case 8:
|
|
320
|
+
return this.popState(), "acc_title_value";
|
|
321
|
+
case 9:
|
|
322
|
+
return this.begin("acc_descr"), 14;
|
|
323
|
+
case 10:
|
|
324
|
+
return this.popState(), "acc_descr_value";
|
|
325
|
+
case 11:
|
|
326
|
+
this.begin("acc_descr_multiline");
|
|
327
|
+
break;
|
|
328
|
+
case 12:
|
|
329
|
+
this.popState();
|
|
330
|
+
break;
|
|
331
|
+
case 13:
|
|
332
|
+
return "acc_descr_multiline_value";
|
|
333
|
+
case 14:
|
|
334
|
+
return 17;
|
|
335
|
+
case 15:
|
|
336
|
+
return 18;
|
|
337
|
+
case 16:
|
|
338
|
+
return 19;
|
|
339
|
+
case 17:
|
|
340
|
+
return ":";
|
|
341
|
+
case 18:
|
|
342
|
+
return 6;
|
|
343
|
+
case 19:
|
|
344
|
+
return "INVALID";
|
|
345
|
+
}
|
|
346
|
+
}, "anonymous"),
|
|
347
|
+
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],
|
|
348
|
+
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 } }
|
|
349
|
+
};
|
|
350
|
+
return y;
|
|
351
|
+
}();
|
|
352
|
+
f.lexer = m;
|
|
353
|
+
function g() {
|
|
354
|
+
this.yy = {};
|
|
355
|
+
}
|
|
356
|
+
return s(g, "Parser"), g.prototype = f, f.Parser = g, new g();
|
|
357
|
+
}();
|
|
358
|
+
U.parser = U;
|
|
359
|
+
var Ct = U, B = "", Q = [], L = [], R = [], Et = /* @__PURE__ */ s(function() {
|
|
360
|
+
Q.length = 0, L.length = 0, B = "", R.length = 0, Mt();
|
|
361
|
+
}, "clear"), Tt = /* @__PURE__ */ s(function(t) {
|
|
362
|
+
B = t, Q.push(t);
|
|
363
|
+
}, "addSection"), It = /* @__PURE__ */ s(function() {
|
|
364
|
+
return Q;
|
|
365
|
+
}, "getSections"), Pt = /* @__PURE__ */ s(function() {
|
|
366
|
+
let t = et();
|
|
367
|
+
const e = 100;
|
|
368
|
+
let r = 0;
|
|
369
|
+
for (; !t && r < e; )
|
|
370
|
+
t = et(), r++;
|
|
371
|
+
return L.push(...R), L;
|
|
372
|
+
}, "getTasks"), At = /* @__PURE__ */ s(function() {
|
|
373
|
+
const t = [];
|
|
374
|
+
return L.forEach((e) => {
|
|
375
|
+
e.people && t.push(...e.people);
|
|
376
|
+
}), [...new Set(t)].sort();
|
|
377
|
+
}, "updateActors"), jt = /* @__PURE__ */ s(function(t, e) {
|
|
378
|
+
const r = e.substr(1).split(":");
|
|
379
|
+
let l = 0, n = [];
|
|
380
|
+
r.length === 1 ? (l = Number(r[0]), n = []) : (l = Number(r[0]), n = r[1].split(","));
|
|
381
|
+
const c = n.map((h) => h.trim()), d = {
|
|
382
|
+
section: B,
|
|
383
|
+
type: B,
|
|
384
|
+
people: c,
|
|
385
|
+
task: t,
|
|
386
|
+
score: l
|
|
387
|
+
};
|
|
388
|
+
R.push(d);
|
|
389
|
+
}, "addTask"), Bt = /* @__PURE__ */ s(function(t) {
|
|
390
|
+
const e = {
|
|
391
|
+
section: B,
|
|
392
|
+
type: B,
|
|
393
|
+
description: t,
|
|
394
|
+
task: t,
|
|
395
|
+
classes: []
|
|
396
|
+
};
|
|
397
|
+
L.push(e);
|
|
398
|
+
}, "addTaskOrg"), et = /* @__PURE__ */ s(function() {
|
|
399
|
+
const t = /* @__PURE__ */ s(function(r) {
|
|
400
|
+
return R[r].processed;
|
|
401
|
+
}, "compileTask");
|
|
402
|
+
let e = !0;
|
|
403
|
+
for (const [r, l] of R.entries())
|
|
404
|
+
t(r), e = e && l.processed;
|
|
405
|
+
return e;
|
|
406
|
+
}, "compileTasks"), Vt = /* @__PURE__ */ s(function() {
|
|
407
|
+
return At();
|
|
408
|
+
}, "getActors"), it = {
|
|
409
|
+
getConfig: /* @__PURE__ */ s(() => V().journey, "getConfig"),
|
|
410
|
+
clear: Et,
|
|
411
|
+
setDiagramTitle: vt,
|
|
412
|
+
getDiagramTitle: $t,
|
|
413
|
+
setAccTitle: wt,
|
|
414
|
+
getAccTitle: _t,
|
|
415
|
+
setAccDescription: bt,
|
|
416
|
+
getAccDescription: kt,
|
|
417
|
+
addSection: Tt,
|
|
418
|
+
getSections: It,
|
|
419
|
+
getTasks: Pt,
|
|
420
|
+
addTask: jt,
|
|
421
|
+
addTaskOrg: Bt,
|
|
422
|
+
getActors: Vt
|
|
423
|
+
}, Lt = /* @__PURE__ */ s((t) => `.label {
|
|
424
|
+
font-family: ${t.fontFamily};
|
|
425
|
+
color: ${t.textColor};
|
|
426
|
+
}
|
|
427
|
+
.mouth {
|
|
428
|
+
stroke: #666;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
line {
|
|
432
|
+
stroke: ${t.textColor}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.legend {
|
|
436
|
+
fill: ${t.textColor};
|
|
437
|
+
font-family: ${t.fontFamily};
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.label text {
|
|
441
|
+
fill: #333;
|
|
442
|
+
}
|
|
443
|
+
.label {
|
|
444
|
+
color: ${t.textColor}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.face {
|
|
448
|
+
${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};
|
|
449
|
+
stroke: #999;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.node rect,
|
|
453
|
+
.node circle,
|
|
454
|
+
.node ellipse,
|
|
455
|
+
.node polygon,
|
|
456
|
+
.node path {
|
|
457
|
+
fill: ${t.mainBkg};
|
|
458
|
+
stroke: ${t.nodeBorder};
|
|
459
|
+
stroke-width: 1px;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.node .label {
|
|
463
|
+
text-align: center;
|
|
464
|
+
}
|
|
465
|
+
.node.clickable {
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.arrowheadPath {
|
|
470
|
+
fill: ${t.arrowheadColor};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.edgePath .path {
|
|
474
|
+
stroke: ${t.lineColor};
|
|
475
|
+
stroke-width: 1.5px;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.flowchart-link {
|
|
479
|
+
stroke: ${t.lineColor};
|
|
480
|
+
fill: none;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.edgeLabel {
|
|
484
|
+
background-color: ${t.edgeLabelBackground};
|
|
485
|
+
rect {
|
|
486
|
+
opacity: 0.5;
|
|
487
|
+
}
|
|
488
|
+
text-align: center;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.cluster rect {
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.cluster text {
|
|
495
|
+
fill: ${t.titleColor};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
div.mermaidTooltip {
|
|
499
|
+
position: absolute;
|
|
500
|
+
text-align: center;
|
|
501
|
+
max-width: 200px;
|
|
502
|
+
padding: 2px;
|
|
503
|
+
font-family: ${t.fontFamily};
|
|
504
|
+
font-size: 12px;
|
|
505
|
+
background: ${t.tertiaryColor};
|
|
506
|
+
border: 1px solid ${t.border2};
|
|
507
|
+
border-radius: 2px;
|
|
508
|
+
pointer-events: none;
|
|
509
|
+
z-index: 100;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.task-type-0, .section-type-0 {
|
|
513
|
+
${t.fillType0 ? `fill: ${t.fillType0}` : ""};
|
|
514
|
+
}
|
|
515
|
+
.task-type-1, .section-type-1 {
|
|
516
|
+
${t.fillType0 ? `fill: ${t.fillType1}` : ""};
|
|
517
|
+
}
|
|
518
|
+
.task-type-2, .section-type-2 {
|
|
519
|
+
${t.fillType0 ? `fill: ${t.fillType2}` : ""};
|
|
520
|
+
}
|
|
521
|
+
.task-type-3, .section-type-3 {
|
|
522
|
+
${t.fillType0 ? `fill: ${t.fillType3}` : ""};
|
|
523
|
+
}
|
|
524
|
+
.task-type-4, .section-type-4 {
|
|
525
|
+
${t.fillType0 ? `fill: ${t.fillType4}` : ""};
|
|
526
|
+
}
|
|
527
|
+
.task-type-5, .section-type-5 {
|
|
528
|
+
${t.fillType0 ? `fill: ${t.fillType5}` : ""};
|
|
529
|
+
}
|
|
530
|
+
.task-type-6, .section-type-6 {
|
|
531
|
+
${t.fillType0 ? `fill: ${t.fillType6}` : ""};
|
|
532
|
+
}
|
|
533
|
+
.task-type-7, .section-type-7 {
|
|
534
|
+
${t.fillType0 ? `fill: ${t.fillType7}` : ""};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.actor-0 {
|
|
538
|
+
${t.actor0 ? `fill: ${t.actor0}` : ""};
|
|
539
|
+
}
|
|
540
|
+
.actor-1 {
|
|
541
|
+
${t.actor1 ? `fill: ${t.actor1}` : ""};
|
|
542
|
+
}
|
|
543
|
+
.actor-2 {
|
|
544
|
+
${t.actor2 ? `fill: ${t.actor2}` : ""};
|
|
545
|
+
}
|
|
546
|
+
.actor-3 {
|
|
547
|
+
${t.actor3 ? `fill: ${t.actor3}` : ""};
|
|
548
|
+
}
|
|
549
|
+
.actor-4 {
|
|
550
|
+
${t.actor4 ? `fill: ${t.actor4}` : ""};
|
|
551
|
+
}
|
|
552
|
+
.actor-5 {
|
|
553
|
+
${t.actor5 ? `fill: ${t.actor5}` : ""};
|
|
554
|
+
}
|
|
555
|
+
${xt()}
|
|
556
|
+
`, "getStyles"), Rt = Lt, Z = /* @__PURE__ */ s(function(t, e) {
|
|
557
|
+
return mt(t, e);
|
|
558
|
+
}, "drawRect"), Ft = /* @__PURE__ */ s(function(t, e) {
|
|
559
|
+
const r = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), l = t.append("g");
|
|
560
|
+
l.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"), l.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");
|
|
561
|
+
function n(h) {
|
|
562
|
+
const f = tt().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
|
563
|
+
h.append("path").attr("class", "mouth").attr("d", f).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
|
|
564
|
+
}
|
|
565
|
+
s(n, "smile");
|
|
566
|
+
function c(h) {
|
|
567
|
+
const f = tt().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
|
|
568
|
+
h.append("path").attr("class", "mouth").attr("d", f).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
|
|
569
|
+
}
|
|
570
|
+
s(c, "sad");
|
|
571
|
+
function d(h) {
|
|
572
|
+
h.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");
|
|
573
|
+
}
|
|
574
|
+
return s(d, "ambivalent"), e.score > 3 ? n(l) : e.score < 3 ? c(l) : d(l), r;
|
|
575
|
+
}, "drawFace"), ot = /* @__PURE__ */ s(function(t, e) {
|
|
576
|
+
const r = t.append("circle");
|
|
577
|
+
return r.attr("cx", e.cx), r.attr("cy", e.cy), r.attr("class", "actor-" + e.pos), r.attr("fill", e.fill), r.attr("stroke", e.stroke), r.attr("r", e.r), r.class !== void 0 && r.attr("class", r.class), e.title !== void 0 && r.append("title").text(e.title), r;
|
|
578
|
+
}, "drawCircle"), lt = /* @__PURE__ */ s(function(t, e) {
|
|
579
|
+
return gt(t, e);
|
|
580
|
+
}, "drawText"), Dt = /* @__PURE__ */ s(function(t, e) {
|
|
581
|
+
function r(n, c, d, h, f) {
|
|
582
|
+
return n + "," + c + " " + (n + d) + "," + c + " " + (n + d) + "," + (c + h - f) + " " + (n + d - f * 1.2) + "," + (c + h) + " " + n + "," + (c + h);
|
|
583
|
+
}
|
|
584
|
+
s(r, "genPoints");
|
|
585
|
+
const l = t.append("polygon");
|
|
586
|
+
l.attr("points", r(e.x, e.y, 50, 20, 7)), l.attr("class", "labelBox"), e.y = e.y + e.labelMargin, e.x = e.x + 0.5 * e.labelMargin, lt(t, e);
|
|
587
|
+
}, "drawLabel"), Ot = /* @__PURE__ */ s(function(t, e, r) {
|
|
588
|
+
const l = t.append("g"), n = rt();
|
|
589
|
+
n.x = e.x, n.y = e.y, n.fill = e.fill, n.width = r.width * e.taskCount + // width of the tasks
|
|
590
|
+
r.diagramMarginX * (e.taskCount - 1), n.height = r.height, n.class = "journey-section section-type-" + e.num, n.rx = 3, n.ry = 3, Z(l, n), ct(r)(
|
|
591
|
+
e.text,
|
|
592
|
+
l,
|
|
593
|
+
n.x,
|
|
594
|
+
n.y,
|
|
595
|
+
n.width,
|
|
596
|
+
n.height,
|
|
597
|
+
{ class: "journey-section section-type-" + e.num },
|
|
598
|
+
r,
|
|
599
|
+
e.colour
|
|
600
|
+
);
|
|
601
|
+
}, "drawSection"), nt = -1, Nt = /* @__PURE__ */ s(function(t, e, r) {
|
|
602
|
+
const l = e.x + r.width / 2, n = t.append("g");
|
|
603
|
+
nt++, n.append("line").attr("id", "task" + nt).attr("x1", l).attr("y1", e.y).attr("x2", l).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Ft(n, {
|
|
604
|
+
cx: l,
|
|
605
|
+
cy: 300 + (5 - e.score) * 30,
|
|
606
|
+
score: e.score
|
|
607
|
+
});
|
|
608
|
+
const c = rt();
|
|
609
|
+
c.x = e.x, c.y = e.y, c.fill = e.fill, c.width = r.width, c.height = r.height, c.class = "task task-type-" + e.num, c.rx = 3, c.ry = 3, Z(n, c);
|
|
610
|
+
let d = e.x + 14;
|
|
611
|
+
e.people.forEach((h) => {
|
|
612
|
+
const f = e.actors[h].color, m = {
|
|
613
|
+
cx: d,
|
|
614
|
+
cy: e.y,
|
|
615
|
+
r: 7,
|
|
616
|
+
fill: f,
|
|
617
|
+
stroke: "#000",
|
|
618
|
+
title: h,
|
|
619
|
+
pos: e.actors[h].position
|
|
620
|
+
};
|
|
621
|
+
ot(n, m), d += 10;
|
|
622
|
+
}), ct(r)(
|
|
623
|
+
e.task,
|
|
624
|
+
n,
|
|
625
|
+
c.x,
|
|
626
|
+
c.y,
|
|
627
|
+
c.width,
|
|
628
|
+
c.height,
|
|
629
|
+
{ class: "task" },
|
|
630
|
+
r,
|
|
631
|
+
e.colour
|
|
632
|
+
);
|
|
633
|
+
}, "drawTask"), zt = /* @__PURE__ */ s(function(t, e) {
|
|
634
|
+
ft(t, e);
|
|
635
|
+
}, "drawBackgroundRect"), ct = /* @__PURE__ */ function() {
|
|
636
|
+
function t(n, c, d, h, f, m, g, y) {
|
|
637
|
+
const i = c.append("text").attr("x", d + f / 2).attr("y", h + m / 2 + 5).style("font-color", y).style("text-anchor", "middle").text(n);
|
|
638
|
+
l(i, g);
|
|
639
|
+
}
|
|
640
|
+
s(t, "byText");
|
|
641
|
+
function e(n, c, d, h, f, m, g, y, i) {
|
|
642
|
+
const { taskFontSize: a, taskFontFamily: u } = y, p = n.split(/<br\s*\/?>/gi);
|
|
643
|
+
for (let o = 0; o < p.length; o++) {
|
|
644
|
+
const x = o * a - a * (p.length - 1) / 2, k = c.append("text").attr("x", d + f / 2).attr("y", h).attr("fill", i).style("text-anchor", "middle").style("font-size", a).style("font-family", u);
|
|
645
|
+
k.append("tspan").attr("x", d + f / 2).attr("dy", x).text(p[o]), k.attr("y", h + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), l(k, g);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
s(e, "byTspan");
|
|
649
|
+
function r(n, c, d, h, f, m, g, y) {
|
|
650
|
+
const i = c.append("switch"), a = i.append("foreignObject").attr("x", d).attr("y", h).attr("width", f).attr("height", m).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
651
|
+
a.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(n), e(n, i, d, h, f, m, g, y), l(a, g);
|
|
652
|
+
}
|
|
653
|
+
s(r, "byFo");
|
|
654
|
+
function l(n, c) {
|
|
655
|
+
for (const d in c)
|
|
656
|
+
d in c && n.attr(d, c[d]);
|
|
657
|
+
}
|
|
658
|
+
return s(l, "_setTextAttrs"), function(n) {
|
|
659
|
+
return n.textPlacement === "fo" ? r : n.textPlacement === "old" ? t : e;
|
|
660
|
+
};
|
|
661
|
+
}(), Yt = /* @__PURE__ */ s(function(t) {
|
|
662
|
+
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");
|
|
663
|
+
}, "initGraphics"), F = {
|
|
664
|
+
drawRect: Z,
|
|
665
|
+
drawCircle: ot,
|
|
666
|
+
drawSection: Ot,
|
|
667
|
+
drawText: lt,
|
|
668
|
+
drawLabel: Dt,
|
|
669
|
+
drawTask: Nt,
|
|
670
|
+
drawBackgroundRect: zt,
|
|
671
|
+
initGraphics: Yt
|
|
672
|
+
}, Gt = /* @__PURE__ */ s(function(t) {
|
|
673
|
+
Object.keys(t).forEach(function(e) {
|
|
674
|
+
S[e] = t[e];
|
|
675
|
+
});
|
|
676
|
+
}, "setConf"), C = {}, N = 0;
|
|
677
|
+
function ht(t) {
|
|
678
|
+
const e = V().journey, r = e.maxLabelWidth;
|
|
679
|
+
N = 0;
|
|
680
|
+
let l = 60;
|
|
681
|
+
Object.keys(C).forEach((n) => {
|
|
682
|
+
const c = C[n].color, d = {
|
|
683
|
+
cx: 20,
|
|
684
|
+
cy: l,
|
|
685
|
+
r: 7,
|
|
686
|
+
fill: c,
|
|
687
|
+
stroke: "#000",
|
|
688
|
+
pos: C[n].position
|
|
689
|
+
};
|
|
690
|
+
F.drawCircle(t, d);
|
|
691
|
+
let h = t.append("text").attr("visibility", "hidden").text(n);
|
|
692
|
+
const f = h.node().getBoundingClientRect().width;
|
|
693
|
+
h.remove();
|
|
694
|
+
let m = [];
|
|
695
|
+
if (f <= r)
|
|
696
|
+
m = [n];
|
|
697
|
+
else {
|
|
698
|
+
const g = n.split(" ");
|
|
699
|
+
let y = "";
|
|
700
|
+
h = t.append("text").attr("visibility", "hidden"), g.forEach((i) => {
|
|
701
|
+
const a = y ? `${y} ${i}` : i;
|
|
702
|
+
if (h.text(a), h.node().getBoundingClientRect().width > r) {
|
|
703
|
+
if (y && m.push(y), y = i, h.text(i), h.node().getBoundingClientRect().width > r) {
|
|
704
|
+
let u = "";
|
|
705
|
+
for (const p of i)
|
|
706
|
+
u += p, h.text(u + "-"), h.node().getBoundingClientRect().width > r && (m.push(u.slice(0, -1) + "-"), u = p);
|
|
707
|
+
y = u;
|
|
708
|
+
}
|
|
709
|
+
} else
|
|
710
|
+
y = a;
|
|
711
|
+
}), y && m.push(y), h.remove();
|
|
712
|
+
}
|
|
713
|
+
m.forEach((g, y) => {
|
|
714
|
+
const i = {
|
|
715
|
+
x: 40,
|
|
716
|
+
y: l + 7 + y * 20,
|
|
717
|
+
fill: "#666",
|
|
718
|
+
text: g,
|
|
719
|
+
textMargin: e.boxTextMargin ?? 5
|
|
720
|
+
}, a = F.drawText(t, i).node().getBoundingClientRect().width;
|
|
721
|
+
a > N && a > e.leftMargin - a && (N = a);
|
|
722
|
+
}), l += Math.max(20, m.length * 20);
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
s(ht, "drawActorLegend");
|
|
726
|
+
var S = V().journey, E = 0, Wt = /* @__PURE__ */ s(function(t, e, r, l) {
|
|
727
|
+
const n = V(), c = n.journey.titleColor, d = n.journey.titleFontSize, h = n.journey.titleFontFamily, f = n.securityLevel;
|
|
728
|
+
let m;
|
|
729
|
+
f === "sandbox" && (m = X("#i" + e));
|
|
730
|
+
const g = f === "sandbox" ? X(m.nodes()[0].contentDocument.body) : X("body");
|
|
731
|
+
v.init();
|
|
732
|
+
const y = g.select("#" + e);
|
|
733
|
+
F.initGraphics(y);
|
|
734
|
+
const i = l.db.getTasks(), a = l.db.getDiagramTitle(), u = l.db.getActors();
|
|
735
|
+
for (const A in C)
|
|
736
|
+
delete C[A];
|
|
737
|
+
let p = 0;
|
|
738
|
+
u.forEach((A) => {
|
|
739
|
+
C[A] = {
|
|
740
|
+
color: S.actorColours[p % S.actorColours.length],
|
|
741
|
+
position: p
|
|
742
|
+
}, p++;
|
|
743
|
+
}), ht(y), E = S.leftMargin + N, v.insert(0, 0, E, Object.keys(C).length * 50), Xt(y, i, 0);
|
|
744
|
+
const o = v.getBounds();
|
|
745
|
+
a && y.append("text").text(a).attr("x", E).attr("font-size", d).attr("font-weight", "bold").attr("y", 25).attr("fill", c).attr("font-family", h);
|
|
746
|
+
const x = o.stopy - o.starty + 2 * S.diagramMarginY, k = E + o.stopx + 2 * S.diagramMarginX;
|
|
747
|
+
St(y, x, k, S.useMaxWidth), y.append("line").attr("x1", E).attr("y1", S.height * 4).attr("x2", k - E - 4).attr("y2", S.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
|
|
748
|
+
const T = a ? 70 : 0;
|
|
749
|
+
y.attr("viewBox", `${o.startx} -25 ${k} ${x + T}`), y.attr("preserveAspectRatio", "xMinYMin meet"), y.attr("height", x + T + 25);
|
|
750
|
+
}, "draw"), v = {
|
|
751
|
+
data: {
|
|
752
|
+
startx: void 0,
|
|
753
|
+
stopx: void 0,
|
|
754
|
+
starty: void 0,
|
|
755
|
+
stopy: void 0
|
|
756
|
+
},
|
|
757
|
+
verticalPos: 0,
|
|
758
|
+
sequenceItems: [],
|
|
759
|
+
init: /* @__PURE__ */ s(function() {
|
|
760
|
+
this.sequenceItems = [], this.data = {
|
|
761
|
+
startx: void 0,
|
|
762
|
+
stopx: void 0,
|
|
763
|
+
starty: void 0,
|
|
764
|
+
stopy: void 0
|
|
765
|
+
}, this.verticalPos = 0;
|
|
766
|
+
}, "init"),
|
|
767
|
+
updateVal: /* @__PURE__ */ s(function(t, e, r, l) {
|
|
768
|
+
t[e] === void 0 ? t[e] = r : t[e] = l(r, t[e]);
|
|
769
|
+
}, "updateVal"),
|
|
770
|
+
updateBounds: /* @__PURE__ */ s(function(t, e, r, l) {
|
|
771
|
+
const n = V().journey, c = this;
|
|
772
|
+
let d = 0;
|
|
773
|
+
function h(f) {
|
|
774
|
+
return /* @__PURE__ */ s(function(m) {
|
|
775
|
+
d++;
|
|
776
|
+
const g = c.sequenceItems.length - d + 1;
|
|
777
|
+
c.updateVal(m, "starty", e - g * n.boxMargin, Math.min), c.updateVal(m, "stopy", l + g * n.boxMargin, Math.max), c.updateVal(v.data, "startx", t - g * n.boxMargin, Math.min), c.updateVal(v.data, "stopx", r + g * n.boxMargin, Math.max), f !== "activation" && (c.updateVal(m, "startx", t - g * n.boxMargin, Math.min), c.updateVal(m, "stopx", r + g * n.boxMargin, Math.max), c.updateVal(v.data, "starty", e - g * n.boxMargin, Math.min), c.updateVal(v.data, "stopy", l + g * n.boxMargin, Math.max));
|
|
778
|
+
}, "updateItemBounds");
|
|
779
|
+
}
|
|
780
|
+
s(h, "updateFn"), this.sequenceItems.forEach(h());
|
|
781
|
+
}, "updateBounds"),
|
|
782
|
+
insert: /* @__PURE__ */ s(function(t, e, r, l) {
|
|
783
|
+
const n = Math.min(t, r), c = Math.max(t, r), d = Math.min(e, l), h = Math.max(e, l);
|
|
784
|
+
this.updateVal(v.data, "startx", n, Math.min), this.updateVal(v.data, "starty", d, Math.min), this.updateVal(v.data, "stopx", c, Math.max), this.updateVal(v.data, "stopy", h, Math.max), this.updateBounds(n, d, c, h);
|
|
785
|
+
}, "insert"),
|
|
786
|
+
bumpVerticalPos: /* @__PURE__ */ s(function(t) {
|
|
787
|
+
this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
|
|
788
|
+
}, "bumpVerticalPos"),
|
|
789
|
+
getVerticalPos: /* @__PURE__ */ s(function() {
|
|
790
|
+
return this.verticalPos;
|
|
791
|
+
}, "getVerticalPos"),
|
|
792
|
+
getBounds: /* @__PURE__ */ s(function() {
|
|
793
|
+
return this.data;
|
|
794
|
+
}, "getBounds")
|
|
795
|
+
}, q = S.sectionFills, st = S.sectionColours, Xt = /* @__PURE__ */ s(function(t, e, r) {
|
|
796
|
+
const l = V().journey;
|
|
797
|
+
let n = "";
|
|
798
|
+
const c = l.height * 2 + l.diagramMarginY, d = r + c;
|
|
799
|
+
let h = 0, f = "#CCC", m = "black", g = 0;
|
|
800
|
+
for (const [y, i] of e.entries()) {
|
|
801
|
+
if (n !== i.section) {
|
|
802
|
+
f = q[h % q.length], g = h % q.length, m = st[h % st.length];
|
|
803
|
+
let u = 0;
|
|
804
|
+
const p = i.section;
|
|
805
|
+
for (let x = y; x < e.length && e[x].section == p; x++)
|
|
806
|
+
u = u + 1;
|
|
807
|
+
const o = {
|
|
808
|
+
x: y * l.taskMargin + y * l.width + E,
|
|
809
|
+
y: 50,
|
|
810
|
+
text: i.section,
|
|
811
|
+
fill: f,
|
|
812
|
+
num: g,
|
|
813
|
+
colour: m,
|
|
814
|
+
taskCount: u
|
|
815
|
+
};
|
|
816
|
+
F.drawSection(t, o, l), n = i.section, h++;
|
|
817
|
+
}
|
|
818
|
+
const a = i.people.reduce((u, p) => (C[p] && (u[p] = C[p]), u), {});
|
|
819
|
+
i.x = y * l.taskMargin + y * l.width + E, i.y = d, i.width = l.diagramMarginX, i.height = l.diagramMarginY, i.colour = m, i.fill = f, i.num = g, i.actors = a, F.drawTask(t, i, l), v.insert(i.x, i.y, i.x + i.width + l.taskMargin, 450);
|
|
820
|
+
}
|
|
821
|
+
}, "drawTasks"), at = {
|
|
822
|
+
setConf: Gt,
|
|
823
|
+
draw: Wt
|
|
824
|
+
}, Jt = {
|
|
825
|
+
parser: Ct,
|
|
826
|
+
db: it,
|
|
827
|
+
renderer: at,
|
|
828
|
+
styles: Rt,
|
|
829
|
+
init: /* @__PURE__ */ s((t) => {
|
|
830
|
+
at.setConf(t.journey), it.clear();
|
|
831
|
+
}, "init")
|
|
832
|
+
};
|
|
833
|
+
export {
|
|
834
|
+
Jt as diagram
|
|
835
|
+
};
|