smart-chat-asp 2.11.1

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.
Files changed (57) hide show
  1. package/README.md +364 -0
  2. package/README.zh.md +367 -0
  3. package/lib/Tableau10-2ff7471d.mjs +9 -0
  4. package/lib/arc-33fcfaff.mjs +86 -0
  5. package/lib/array-2ff2c7a6.mjs +6 -0
  6. package/lib/blockDiagram-38ab4fdb-3c912e88.mjs +1230 -0
  7. package/lib/c4Diagram-3d4e48cf-49908d37.mjs +1580 -0
  8. package/lib/channel-890a888a.mjs +5 -0
  9. package/lib/classDiagram-70f12bd4-ace7b178.mjs +221 -0
  10. package/lib/classDiagram-v2-f2320105-5848085d.mjs +207 -0
  11. package/lib/clone-59a3b16a.mjs +8 -0
  12. package/lib/createText-2e5e7dd3-898a4de3.mjs +2966 -0
  13. package/lib/edges-e0da2a9e-91b210e9.mjs +1083 -0
  14. package/lib/erDiagram-9861fffd-c13b7611.mjs +933 -0
  15. package/lib/favicon.ico +0 -0
  16. package/lib/favicon.svg +1 -0
  17. package/lib/flowDb-956e92f1-56fdcb20.mjs +1126 -0
  18. package/lib/flowDiagram-66a62f08-4023035a.mjs +798 -0
  19. package/lib/flowDiagram-v2-96b9c2cf-d28d8b17.mjs +26 -0
  20. package/lib/flowchart-elk-definition-4a651766-ab5b1391.mjs +48407 -0
  21. package/lib/ganttDiagram-c361ad54-ae59a5e3.mjs +2504 -0
  22. package/lib/gitGraphDiagram-72cf32ee-5bdf46bb.mjs +1265 -0
  23. package/lib/graph-9ea4e80a.mjs +512 -0
  24. package/lib/index-3862675e-b7177fa1.mjs +373 -0
  25. package/lib/index-958a220b.mjs +1470 -0
  26. package/lib/index-c42b0ff4.mjs +40 -0
  27. package/lib/index-f76d9453.mjs +28 -0
  28. package/lib/infoDiagram-f8f76790-5f3835f9.mjs +320 -0
  29. package/lib/init-f9637058.mjs +16 -0
  30. package/lib/journeyDiagram-49397b02-df06b21d.mjs +805 -0
  31. package/lib/layout-d3bc02b9.mjs +1495 -0
  32. package/lib/line-b044df13.mjs +34 -0
  33. package/lib/linear-e60140ad.mjs +447 -0
  34. package/lib/main-740da2e1.mjs +117801 -0
  35. package/lib/mindmap-definition-fc14e90a-3bfaf2a6.mjs +19384 -0
  36. package/lib/ordinal-980380c7.mjs +65 -0
  37. package/lib/path-428ebac9.mjs +91 -0
  38. package/lib/pieDiagram-8a3498a8-a8359c54.mjs +503 -0
  39. package/lib/pwa-192x192.png +0 -0
  40. package/lib/pwa-512x512.png +0 -0
  41. package/lib/quadrantDiagram-120e2f19-367eeae7.mjs +905 -0
  42. package/lib/requirementDiagram-deff3bca-27d1e96b.mjs +770 -0
  43. package/lib/sankeyDiagram-04a897e0-a9e993ee.mjs +818 -0
  44. package/lib/sequenceDiagram-704730f1-05f9d7b1.mjs +2235 -0
  45. package/lib/smart-chat.es.js +5 -0
  46. package/lib/smart-chat.umd.js +5444 -0
  47. package/lib/stateDiagram-587899a1-f3e4a81e.mjs +269 -0
  48. package/lib/stateDiagram-v2-d93cdb3a-763ad0ff.mjs +191 -0
  49. package/lib/style.css +1 -0
  50. package/lib/styles-6aaf32cf-e32ec570.mjs +960 -0
  51. package/lib/styles-9a916d00-18b5fd0d.mjs +1089 -0
  52. package/lib/styles-c10674c1-134300a0.mjs +433 -0
  53. package/lib/svgDrawCommon-08f97a94-f04d54dc.mjs +64 -0
  54. package/lib/timeline-definition-85554ec2-1989252c.mjs +796 -0
  55. package/lib/xychartDiagram-e933f94c-f7d5a550.mjs +1285 -0
  56. package/license +21 -0
  57. package/package.json +79 -0
@@ -0,0 +1,805 @@
1
+ import { Y as I, am as yt, an as ft, T as dt, U as pt, X as gt, W as mt, ao as xt, a1 as W, a3 as kt } from "./main-740da2e1.mjs";
2
+ import { d as _t, f as bt, a as vt, g as it } from "./svgDrawCommon-08f97a94-f04d54dc.mjs";
3
+ import { a as Q } from "./arc-33fcfaff.mjs";
4
+ import "vue";
5
+ import "./path-428ebac9.mjs";
6
+ var G = function() {
7
+ var t = function(p, s, r, a) {
8
+ for (r = r || {}, a = p.length; a--; r[p[a]] = s)
9
+ ;
10
+ return r;
11
+ }, e = [6, 8, 10, 11, 12, 14, 16, 17, 18], i = [1, 9], l = [1, 10], n = [1, 11], h = [1, 12], c = [1, 13], f = [1, 14], y = {
12
+ trace: function() {
13
+ },
14
+ yy: {},
15
+ 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 },
16
+ 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" },
17
+ 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]],
18
+ performAction: function(s, r, a, u, d, o, w) {
19
+ var k = o.length - 1;
20
+ switch (d) {
21
+ case 1:
22
+ return o[k - 1];
23
+ case 2:
24
+ this.$ = [];
25
+ break;
26
+ case 3:
27
+ o[k - 1].push(o[k]), this.$ = o[k - 1];
28
+ break;
29
+ case 4:
30
+ case 5:
31
+ this.$ = o[k];
32
+ break;
33
+ case 6:
34
+ case 7:
35
+ this.$ = [];
36
+ break;
37
+ case 8:
38
+ u.setDiagramTitle(o[k].substr(6)), this.$ = o[k].substr(6);
39
+ break;
40
+ case 9:
41
+ this.$ = o[k].trim(), u.setAccTitle(this.$);
42
+ break;
43
+ case 10:
44
+ case 11:
45
+ this.$ = o[k].trim(), u.setAccDescription(this.$);
46
+ break;
47
+ case 12:
48
+ u.addSection(o[k].substr(8)), this.$ = o[k].substr(8);
49
+ break;
50
+ case 13:
51
+ u.addTask(o[k - 1], o[k]), this.$ = "task";
52
+ break;
53
+ }
54
+ },
55
+ 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: i, 12: l, 14: n, 16: h, 17: c, 18: f }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: i, 12: l, 14: n, 16: h, 17: c, 18: f }, 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])],
56
+ defaultActions: {},
57
+ parseError: function(s, r) {
58
+ if (r.recoverable)
59
+ this.trace(s);
60
+ else {
61
+ var a = new Error(s);
62
+ throw a.hash = r, a;
63
+ }
64
+ },
65
+ parse: function(s) {
66
+ var r = this, a = [0], u = [], d = [null], o = [], w = this.table, k = "", R = 0, Z = 0, lt = 2, J = 1, ct = o.slice.call(arguments, 1), x = Object.create(this.lexer), S = { yy: {} };
67
+ for (var z in this.yy)
68
+ Object.prototype.hasOwnProperty.call(this.yy, z) && (S.yy[z] = this.yy[z]);
69
+ x.setInput(s, S.yy), S.yy.lexer = x, S.yy.parser = this, typeof x.yylloc > "u" && (x.yylloc = {});
70
+ var Y = x.yylloc;
71
+ o.push(Y);
72
+ var ht = x.options && x.options.ranges;
73
+ typeof S.yy.parseError == "function" ? this.parseError = S.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
74
+ function ut() {
75
+ var $;
76
+ return $ = u.pop() || x.lex() || J, typeof $ != "number" && ($ instanceof Array && (u = $, $ = u.pop()), $ = r.symbols_[$] || $), $;
77
+ }
78
+ for (var _, E, b, O, A = {}, N, T, K, B; ; ) {
79
+ if (E = a[a.length - 1], this.defaultActions[E] ? b = this.defaultActions[E] : ((_ === null || typeof _ > "u") && (_ = ut()), b = w[E] && w[E][_]), typeof b > "u" || !b.length || !b[0]) {
80
+ var q = "";
81
+ B = [];
82
+ for (N in w[E])
83
+ this.terminals_[N] && N > lt && B.push("'" + this.terminals_[N] + "'");
84
+ x.showPosition ? q = "Parse error on line " + (R + 1) + `:
85
+ ` + x.showPosition() + `
86
+ Expecting ` + B.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : q = "Parse error on line " + (R + 1) + ": Unexpected " + (_ == J ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(q, {
87
+ text: x.match,
88
+ token: this.terminals_[_] || _,
89
+ line: x.yylineno,
90
+ loc: Y,
91
+ expected: B
92
+ });
93
+ }
94
+ if (b[0] instanceof Array && b.length > 1)
95
+ throw new Error("Parse Error: multiple actions possible at state: " + E + ", token: " + _);
96
+ switch (b[0]) {
97
+ case 1:
98
+ a.push(_), d.push(x.yytext), o.push(x.yylloc), a.push(b[1]), _ = null, Z = x.yyleng, k = x.yytext, R = x.yylineno, Y = x.yylloc;
99
+ break;
100
+ case 2:
101
+ if (T = this.productions_[b[1]][1], A.$ = d[d.length - T], A._$ = {
102
+ first_line: o[o.length - (T || 1)].first_line,
103
+ last_line: o[o.length - 1].last_line,
104
+ first_column: o[o.length - (T || 1)].first_column,
105
+ last_column: o[o.length - 1].last_column
106
+ }, ht && (A._$.range = [
107
+ o[o.length - (T || 1)].range[0],
108
+ o[o.length - 1].range[1]
109
+ ]), O = this.performAction.apply(A, [
110
+ k,
111
+ Z,
112
+ R,
113
+ S.yy,
114
+ b[1],
115
+ d,
116
+ o
117
+ ].concat(ct)), typeof O < "u")
118
+ return O;
119
+ T && (a = a.slice(0, -1 * T * 2), d = d.slice(0, -1 * T), o = o.slice(0, -1 * T)), a.push(this.productions_[b[1]][0]), d.push(A.$), o.push(A._$), K = w[a[a.length - 2]][a[a.length - 1]], a.push(K);
120
+ break;
121
+ case 3:
122
+ return !0;
123
+ }
124
+ }
125
+ return !0;
126
+ }
127
+ }, m = function() {
128
+ var p = {
129
+ EOF: 1,
130
+ parseError: function(r, a) {
131
+ if (this.yy.parser)
132
+ this.yy.parser.parseError(r, a);
133
+ else
134
+ throw new Error(r);
135
+ },
136
+ // resets the lexer, sets new input
137
+ setInput: function(s, r) {
138
+ return this.yy = r || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
139
+ first_line: 1,
140
+ first_column: 0,
141
+ last_line: 1,
142
+ last_column: 0
143
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
144
+ },
145
+ // consumes and returns one char from the input
146
+ input: function() {
147
+ var s = this._input[0];
148
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
149
+ var r = s.match(/(?:\r\n?|\n).*/g);
150
+ return r ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
151
+ },
152
+ // unshifts one char (or a string) into the input
153
+ unput: function(s) {
154
+ var r = s.length, a = s.split(/(?:\r\n?|\n)/g);
155
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - r), this.offset -= r;
156
+ var u = this.match.split(/(?:\r\n?|\n)/g);
157
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), a.length - 1 && (this.yylineno -= a.length - 1);
158
+ var d = this.yylloc.range;
159
+ return this.yylloc = {
160
+ first_line: this.yylloc.first_line,
161
+ last_line: this.yylineno + 1,
162
+ first_column: this.yylloc.first_column,
163
+ last_column: a ? (a.length === u.length ? this.yylloc.first_column : 0) + u[u.length - a.length].length - a[0].length : this.yylloc.first_column - r
164
+ }, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - r]), this.yyleng = this.yytext.length, this;
165
+ },
166
+ // When called from action, caches matched text and appends it on next action
167
+ more: function() {
168
+ return this._more = !0, this;
169
+ },
170
+ // 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.
171
+ reject: function() {
172
+ if (this.options.backtrack_lexer)
173
+ this._backtrack = !0;
174
+ else
175
+ 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).
176
+ ` + this.showPosition(), {
177
+ text: "",
178
+ token: null,
179
+ line: this.yylineno
180
+ });
181
+ return this;
182
+ },
183
+ // retain first n characters of the match
184
+ less: function(s) {
185
+ this.unput(this.match.slice(s));
186
+ },
187
+ // displays already matched input, i.e. for error messages
188
+ pastInput: function() {
189
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
190
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
191
+ },
192
+ // displays upcoming input, i.e. for error messages
193
+ upcomingInput: function() {
194
+ var s = this.match;
195
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
196
+ },
197
+ // displays the character position where the lexing error occurred, i.e. for error messages
198
+ showPosition: function() {
199
+ var s = this.pastInput(), r = new Array(s.length + 1).join("-");
200
+ return s + this.upcomingInput() + `
201
+ ` + r + "^";
202
+ },
203
+ // test the lexed token: return FALSE when not a match, otherwise return token
204
+ test_match: function(s, r) {
205
+ var a, u, d;
206
+ if (this.options.backtrack_lexer && (d = {
207
+ yylineno: this.yylineno,
208
+ yylloc: {
209
+ first_line: this.yylloc.first_line,
210
+ last_line: this.last_line,
211
+ first_column: this.yylloc.first_column,
212
+ last_column: this.yylloc.last_column
213
+ },
214
+ yytext: this.yytext,
215
+ match: this.match,
216
+ matches: this.matches,
217
+ matched: this.matched,
218
+ yyleng: this.yyleng,
219
+ offset: this.offset,
220
+ _more: this._more,
221
+ _input: this._input,
222
+ yy: this.yy,
223
+ conditionStack: this.conditionStack.slice(0),
224
+ done: this.done
225
+ }, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), u = s[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
226
+ first_line: this.yylloc.last_line,
227
+ last_line: this.yylineno + 1,
228
+ first_column: this.yylloc.last_column,
229
+ last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
230
+ }, this.yytext += s[0], this.match += s[0], this.matches = s, 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(s[0].length), this.matched += s[0], a = this.performAction.call(this, this.yy, this, r, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), a)
231
+ return a;
232
+ if (this._backtrack) {
233
+ for (var o in d)
234
+ this[o] = d[o];
235
+ return !1;
236
+ }
237
+ return !1;
238
+ },
239
+ // return next match in input
240
+ next: function() {
241
+ if (this.done)
242
+ return this.EOF;
243
+ this._input || (this.done = !0);
244
+ var s, r, a, u;
245
+ this._more || (this.yytext = "", this.match = "");
246
+ for (var d = this._currentRules(), o = 0; o < d.length; o++)
247
+ if (a = this._input.match(this.rules[d[o]]), a && (!r || a[0].length > r[0].length)) {
248
+ if (r = a, u = o, this.options.backtrack_lexer) {
249
+ if (s = this.test_match(a, d[o]), s !== !1)
250
+ return s;
251
+ if (this._backtrack) {
252
+ r = !1;
253
+ continue;
254
+ } else
255
+ return !1;
256
+ } else if (!this.options.flex)
257
+ break;
258
+ }
259
+ return r ? (s = this.test_match(r, d[u]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
260
+ ` + this.showPosition(), {
261
+ text: "",
262
+ token: null,
263
+ line: this.yylineno
264
+ });
265
+ },
266
+ // return next match that has a token
267
+ lex: function() {
268
+ var r = this.next();
269
+ return r || this.lex();
270
+ },
271
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
272
+ begin: function(r) {
273
+ this.conditionStack.push(r);
274
+ },
275
+ // pop the previously active lexer condition state off the condition stack
276
+ popState: function() {
277
+ var r = this.conditionStack.length - 1;
278
+ return r > 0 ? this.conditionStack.pop() : this.conditionStack[0];
279
+ },
280
+ // produce the lexer rule set which is active for the currently active lexer condition state
281
+ _currentRules: function() {
282
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
283
+ },
284
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
285
+ topState: function(r) {
286
+ return r = this.conditionStack.length - 1 - Math.abs(r || 0), r >= 0 ? this.conditionStack[r] : "INITIAL";
287
+ },
288
+ // alias for begin(condition)
289
+ pushState: function(r) {
290
+ this.begin(r);
291
+ },
292
+ // return the number of states currently on the stack
293
+ stateStackSize: function() {
294
+ return this.conditionStack.length;
295
+ },
296
+ options: { "case-insensitive": !0 },
297
+ performAction: function(r, a, u, d) {
298
+ switch (u) {
299
+ case 0:
300
+ break;
301
+ case 1:
302
+ break;
303
+ case 2:
304
+ return 10;
305
+ case 3:
306
+ break;
307
+ case 4:
308
+ break;
309
+ case 5:
310
+ return 4;
311
+ case 6:
312
+ return 11;
313
+ case 7:
314
+ return this.begin("acc_title"), 12;
315
+ case 8:
316
+ return this.popState(), "acc_title_value";
317
+ case 9:
318
+ return this.begin("acc_descr"), 14;
319
+ case 10:
320
+ return this.popState(), "acc_descr_value";
321
+ case 11:
322
+ this.begin("acc_descr_multiline");
323
+ break;
324
+ case 12:
325
+ this.popState();
326
+ break;
327
+ case 13:
328
+ return "acc_descr_multiline_value";
329
+ case 14:
330
+ return 17;
331
+ case 15:
332
+ return 18;
333
+ case 16:
334
+ return 19;
335
+ case 17:
336
+ return ":";
337
+ case 18:
338
+ return 6;
339
+ case 19:
340
+ return "INVALID";
341
+ }
342
+ },
343
+ 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],
344
+ 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 } }
345
+ };
346
+ return p;
347
+ }();
348
+ y.lexer = m;
349
+ function g() {
350
+ this.yy = {};
351
+ }
352
+ return g.prototype = y, y.Parser = g, new g();
353
+ }();
354
+ G.parser = G;
355
+ const wt = G;
356
+ let C = "";
357
+ const H = [], V = [], F = [], Tt = function() {
358
+ H.length = 0, V.length = 0, C = "", F.length = 0, xt();
359
+ }, $t = function(t) {
360
+ C = t, H.push(t);
361
+ }, Mt = function() {
362
+ return H;
363
+ }, St = function() {
364
+ let t = D();
365
+ const e = 100;
366
+ let i = 0;
367
+ for (; !t && i < e; )
368
+ t = D(), i++;
369
+ return V.push(...F), V;
370
+ }, Et = function() {
371
+ const t = [];
372
+ return V.forEach((i) => {
373
+ i.people && t.push(...i.people);
374
+ }), [...new Set(t)].sort();
375
+ }, Pt = function(t, e) {
376
+ const i = e.substr(1).split(":");
377
+ let l = 0, n = [];
378
+ i.length === 1 ? (l = Number(i[0]), n = []) : (l = Number(i[0]), n = i[1].split(","));
379
+ const h = n.map((f) => f.trim()), c = {
380
+ section: C,
381
+ type: C,
382
+ people: h,
383
+ task: t,
384
+ score: l
385
+ };
386
+ F.push(c);
387
+ }, It = function(t) {
388
+ const e = {
389
+ section: C,
390
+ type: C,
391
+ description: t,
392
+ task: t,
393
+ classes: []
394
+ };
395
+ V.push(e);
396
+ }, D = function() {
397
+ const t = function(i) {
398
+ return F[i].processed;
399
+ };
400
+ let e = !0;
401
+ for (const [i, l] of F.entries())
402
+ t(i), e = e && l.processed;
403
+ return e;
404
+ }, At = function() {
405
+ return Et();
406
+ }, tt = {
407
+ getConfig: () => I().journey,
408
+ clear: Tt,
409
+ setDiagramTitle: yt,
410
+ getDiagramTitle: ft,
411
+ setAccTitle: dt,
412
+ getAccTitle: pt,
413
+ setAccDescription: gt,
414
+ getAccDescription: mt,
415
+ addSection: $t,
416
+ getSections: Mt,
417
+ getTasks: St,
418
+ addTask: Pt,
419
+ addTaskOrg: It,
420
+ getActors: At
421
+ }, Ct = (t) => `.label {
422
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
423
+ font-family: var(--mermaid-font-family);
424
+ color: ${t.textColor};
425
+ }
426
+ .mouth {
427
+ stroke: #666;
428
+ }
429
+
430
+ line {
431
+ stroke: ${t.textColor}
432
+ }
433
+
434
+ .legend {
435
+ fill: ${t.textColor};
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: 'trebuchet ms', verdana, arial, sans-serif;
502
+ font-family: var(--mermaid-font-family);
503
+ font-size: 12px;
504
+ background: ${t.tertiaryColor};
505
+ border: 1px solid ${t.border2};
506
+ border-radius: 2px;
507
+ pointer-events: none;
508
+ z-index: 100;
509
+ }
510
+
511
+ .task-type-0, .section-type-0 {
512
+ ${t.fillType0 ? `fill: ${t.fillType0}` : ""};
513
+ }
514
+ .task-type-1, .section-type-1 {
515
+ ${t.fillType0 ? `fill: ${t.fillType1}` : ""};
516
+ }
517
+ .task-type-2, .section-type-2 {
518
+ ${t.fillType0 ? `fill: ${t.fillType2}` : ""};
519
+ }
520
+ .task-type-3, .section-type-3 {
521
+ ${t.fillType0 ? `fill: ${t.fillType3}` : ""};
522
+ }
523
+ .task-type-4, .section-type-4 {
524
+ ${t.fillType0 ? `fill: ${t.fillType4}` : ""};
525
+ }
526
+ .task-type-5, .section-type-5 {
527
+ ${t.fillType0 ? `fill: ${t.fillType5}` : ""};
528
+ }
529
+ .task-type-6, .section-type-6 {
530
+ ${t.fillType0 ? `fill: ${t.fillType6}` : ""};
531
+ }
532
+ .task-type-7, .section-type-7 {
533
+ ${t.fillType0 ? `fill: ${t.fillType7}` : ""};
534
+ }
535
+
536
+ .actor-0 {
537
+ ${t.actor0 ? `fill: ${t.actor0}` : ""};
538
+ }
539
+ .actor-1 {
540
+ ${t.actor1 ? `fill: ${t.actor1}` : ""};
541
+ }
542
+ .actor-2 {
543
+ ${t.actor2 ? `fill: ${t.actor2}` : ""};
544
+ }
545
+ .actor-3 {
546
+ ${t.actor3 ? `fill: ${t.actor3}` : ""};
547
+ }
548
+ .actor-4 {
549
+ ${t.actor4 ? `fill: ${t.actor4}` : ""};
550
+ }
551
+ .actor-5 {
552
+ ${t.actor5 ? `fill: ${t.actor5}` : ""};
553
+ }
554
+ `, Vt = Ct, U = function(t, e) {
555
+ return _t(t, e);
556
+ }, Ft = function(t, e) {
557
+ const l = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), n = t.append("g");
558
+ n.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"), n.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");
559
+ function h(y) {
560
+ const m = Q().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
561
+ y.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
562
+ }
563
+ function c(y) {
564
+ const m = Q().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
565
+ y.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
566
+ }
567
+ function f(y) {
568
+ y.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");
569
+ }
570
+ return e.score > 3 ? h(n) : e.score < 3 ? c(n) : f(n), l;
571
+ }, rt = function(t, e) {
572
+ const i = t.append("circle");
573
+ return i.attr("cx", e.cx), i.attr("cy", e.cy), i.attr("class", "actor-" + e.pos), i.attr("fill", e.fill), i.attr("stroke", e.stroke), i.attr("r", e.r), i.class !== void 0 && i.attr("class", i.class), e.title !== void 0 && i.append("title").text(e.title), i;
574
+ }, at = function(t, e) {
575
+ return bt(t, e);
576
+ }, Lt = function(t, e) {
577
+ function i(n, h, c, f, y) {
578
+ return n + "," + h + " " + (n + c) + "," + h + " " + (n + c) + "," + (h + f - y) + " " + (n + c - y * 1.2) + "," + (h + f) + " " + n + "," + (h + f);
579
+ }
580
+ const l = t.append("polygon");
581
+ l.attr("points", i(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, at(t, e);
582
+ }, Rt = function(t, e, i) {
583
+ const l = t.append("g"), n = it();
584
+ n.x = e.x, n.y = e.y, n.fill = e.fill, n.width = i.width * e.taskCount + // width of the tasks
585
+ i.diagramMarginX * (e.taskCount - 1), n.height = i.height, n.class = "journey-section section-type-" + e.num, n.rx = 3, n.ry = 3, U(l, n), ot(i)(
586
+ e.text,
587
+ l,
588
+ n.x,
589
+ n.y,
590
+ n.width,
591
+ n.height,
592
+ { class: "journey-section section-type-" + e.num },
593
+ i,
594
+ e.colour
595
+ );
596
+ };
597
+ let et = -1;
598
+ const Nt = function(t, e, i) {
599
+ const l = e.x + i.width / 2, n = t.append("g");
600
+ et++;
601
+ const h = 300 + 5 * 30;
602
+ n.append("line").attr("id", "task" + et).attr("x1", l).attr("y1", e.y).attr("x2", l).attr("y2", h).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Ft(n, {
603
+ cx: l,
604
+ cy: 300 + (5 - e.score) * 30,
605
+ score: e.score
606
+ });
607
+ const c = it();
608
+ c.x = e.x, c.y = e.y, c.fill = e.fill, c.width = i.width, c.height = i.height, c.class = "task task-type-" + e.num, c.rx = 3, c.ry = 3, U(n, c);
609
+ let f = e.x + 14;
610
+ e.people.forEach((y) => {
611
+ const m = e.actors[y].color, g = {
612
+ cx: f,
613
+ cy: e.y,
614
+ r: 7,
615
+ fill: m,
616
+ stroke: "#000",
617
+ title: y,
618
+ pos: e.actors[y].position
619
+ };
620
+ rt(n, g), f += 10;
621
+ }), ot(i)(
622
+ e.task,
623
+ n,
624
+ c.x,
625
+ c.y,
626
+ c.width,
627
+ c.height,
628
+ { class: "task" },
629
+ i,
630
+ e.colour
631
+ );
632
+ }, Bt = function(t, e) {
633
+ vt(t, e);
634
+ }, ot = function() {
635
+ function t(n, h, c, f, y, m, g, p) {
636
+ const s = h.append("text").attr("x", c + y / 2).attr("y", f + m / 2 + 5).style("font-color", p).style("text-anchor", "middle").text(n);
637
+ l(s, g);
638
+ }
639
+ function e(n, h, c, f, y, m, g, p, s) {
640
+ const { taskFontSize: r, taskFontFamily: a } = p, u = n.split(/<br\s*\/?>/gi);
641
+ for (let d = 0; d < u.length; d++) {
642
+ const o = d * r - r * (u.length - 1) / 2, w = h.append("text").attr("x", c + y / 2).attr("y", f).attr("fill", s).style("text-anchor", "middle").style("font-size", r).style("font-family", a);
643
+ w.append("tspan").attr("x", c + y / 2).attr("dy", o).text(u[d]), w.attr("y", f + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), l(w, g);
644
+ }
645
+ }
646
+ function i(n, h, c, f, y, m, g, p) {
647
+ const s = h.append("switch"), a = s.append("foreignObject").attr("x", c).attr("y", f).attr("width", y).attr("height", m).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
648
+ a.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(n), e(n, s, c, f, y, m, g, p), l(a, g);
649
+ }
650
+ function l(n, h) {
651
+ for (const c in h)
652
+ c in h && n.attr(c, h[c]);
653
+ }
654
+ return function(n) {
655
+ return n.textPlacement === "fo" ? i : n.textPlacement === "old" ? t : e;
656
+ };
657
+ }(), jt = function(t) {
658
+ 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");
659
+ }, L = {
660
+ drawRect: U,
661
+ drawCircle: rt,
662
+ drawSection: Rt,
663
+ drawText: at,
664
+ drawLabel: Lt,
665
+ drawTask: Nt,
666
+ drawBackgroundRect: Bt,
667
+ initGraphics: jt
668
+ }, zt = function(t) {
669
+ Object.keys(t).forEach(function(i) {
670
+ j[i] = t[i];
671
+ });
672
+ }, M = {};
673
+ function Yt(t) {
674
+ const e = I().journey;
675
+ let i = 60;
676
+ Object.keys(M).forEach((l) => {
677
+ const n = M[l].color, h = {
678
+ cx: 20,
679
+ cy: i,
680
+ r: 7,
681
+ fill: n,
682
+ stroke: "#000",
683
+ pos: M[l].position
684
+ };
685
+ L.drawCircle(t, h);
686
+ const c = {
687
+ x: 40,
688
+ y: i + 7,
689
+ fill: "#666",
690
+ text: l,
691
+ textMargin: e.boxTextMargin | 5
692
+ };
693
+ L.drawText(t, c), i += 20;
694
+ });
695
+ }
696
+ const j = I().journey, P = j.leftMargin, Ot = function(t, e, i, l) {
697
+ const n = I().journey, h = I().securityLevel;
698
+ let c;
699
+ h === "sandbox" && (c = W("#i" + e));
700
+ const f = h === "sandbox" ? W(c.nodes()[0].contentDocument.body) : W("body");
701
+ v.init();
702
+ const y = f.select("#" + e);
703
+ L.initGraphics(y);
704
+ const m = l.db.getTasks(), g = l.db.getDiagramTitle(), p = l.db.getActors();
705
+ for (const o in M)
706
+ delete M[o];
707
+ let s = 0;
708
+ p.forEach((o) => {
709
+ M[o] = {
710
+ color: n.actorColours[s % n.actorColours.length],
711
+ position: s
712
+ }, s++;
713
+ }), Yt(y), v.insert(0, 0, P, Object.keys(M).length * 50), qt(y, m, 0);
714
+ const r = v.getBounds();
715
+ g && y.append("text").text(g).attr("x", P).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25);
716
+ const a = r.stopy - r.starty + 2 * n.diagramMarginY, u = P + r.stopx + 2 * n.diagramMarginX;
717
+ kt(y, a, u, n.useMaxWidth), y.append("line").attr("x1", P).attr("y1", n.height * 4).attr("x2", u - P - 4).attr("y2", n.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
718
+ const d = g ? 70 : 0;
719
+ y.attr("viewBox", `${r.startx} -25 ${u} ${a + d}`), y.attr("preserveAspectRatio", "xMinYMin meet"), y.attr("height", a + d + 25);
720
+ }, v = {
721
+ data: {
722
+ startx: void 0,
723
+ stopx: void 0,
724
+ starty: void 0,
725
+ stopy: void 0
726
+ },
727
+ verticalPos: 0,
728
+ sequenceItems: [],
729
+ init: function() {
730
+ this.sequenceItems = [], this.data = {
731
+ startx: void 0,
732
+ stopx: void 0,
733
+ starty: void 0,
734
+ stopy: void 0
735
+ }, this.verticalPos = 0;
736
+ },
737
+ updateVal: function(t, e, i, l) {
738
+ t[e] === void 0 ? t[e] = i : t[e] = l(i, t[e]);
739
+ },
740
+ updateBounds: function(t, e, i, l) {
741
+ const n = I().journey, h = this;
742
+ let c = 0;
743
+ function f(y) {
744
+ return function(g) {
745
+ c++;
746
+ const p = h.sequenceItems.length - c + 1;
747
+ h.updateVal(g, "starty", e - p * n.boxMargin, Math.min), h.updateVal(g, "stopy", l + p * n.boxMargin, Math.max), h.updateVal(v.data, "startx", t - p * n.boxMargin, Math.min), h.updateVal(v.data, "stopx", i + p * n.boxMargin, Math.max), y !== "activation" && (h.updateVal(g, "startx", t - p * n.boxMargin, Math.min), h.updateVal(g, "stopx", i + p * n.boxMargin, Math.max), h.updateVal(v.data, "starty", e - p * n.boxMargin, Math.min), h.updateVal(v.data, "stopy", l + p * n.boxMargin, Math.max));
748
+ };
749
+ }
750
+ this.sequenceItems.forEach(f());
751
+ },
752
+ insert: function(t, e, i, l) {
753
+ const n = Math.min(t, i), h = Math.max(t, i), c = Math.min(e, l), f = Math.max(e, l);
754
+ this.updateVal(v.data, "startx", n, Math.min), this.updateVal(v.data, "starty", c, Math.min), this.updateVal(v.data, "stopx", h, Math.max), this.updateVal(v.data, "stopy", f, Math.max), this.updateBounds(n, c, h, f);
755
+ },
756
+ bumpVerticalPos: function(t) {
757
+ this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
758
+ },
759
+ getVerticalPos: function() {
760
+ return this.verticalPos;
761
+ },
762
+ getBounds: function() {
763
+ return this.data;
764
+ }
765
+ }, X = j.sectionFills, st = j.sectionColours, qt = function(t, e, i) {
766
+ const l = I().journey;
767
+ let n = "";
768
+ const h = l.height * 2 + l.diagramMarginY, c = i + h;
769
+ let f = 0, y = "#CCC", m = "black", g = 0;
770
+ for (const [p, s] of e.entries()) {
771
+ if (n !== s.section) {
772
+ y = X[f % X.length], g = f % X.length, m = st[f % st.length];
773
+ let a = 0;
774
+ const u = s.section;
775
+ for (let o = p; o < e.length && e[o].section == u; o++)
776
+ a = a + 1;
777
+ const d = {
778
+ x: p * l.taskMargin + p * l.width + P,
779
+ y: 50,
780
+ text: s.section,
781
+ fill: y,
782
+ num: g,
783
+ colour: m,
784
+ taskCount: a
785
+ };
786
+ L.drawSection(t, d, l), n = s.section, f++;
787
+ }
788
+ const r = s.people.reduce((a, u) => (M[u] && (a[u] = M[u]), a), {});
789
+ s.x = p * l.taskMargin + p * l.width + P, s.y = c, s.width = l.diagramMarginX, s.height = l.diagramMarginY, s.colour = m, s.fill = y, s.num = g, s.actors = r, L.drawTask(t, s, l), v.insert(s.x, s.y, s.x + s.width + l.taskMargin, 300 + 5 * 30);
790
+ }
791
+ }, nt = {
792
+ setConf: zt,
793
+ draw: Ot
794
+ }, Zt = {
795
+ parser: wt,
796
+ db: tt,
797
+ renderer: nt,
798
+ styles: Vt,
799
+ init: (t) => {
800
+ nt.setConf(t.journey), tt.clear();
801
+ }
802
+ };
803
+ export {
804
+ Zt as diagram
805
+ };