@digipair/skill-web-chatbot 0.114.2 → 0.114.6

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 (48) hide show
  1. package/dist/index.cjs.js +2118 -8
  2. package/package.json +6 -2
  3. package/dist/SAP-icons.cjs.js +0 -2489
  4. package/dist/SAP-icons.cjs2.js +0 -2489
  5. package/dist/Tableau10-558cc280.cjs.js +0 -9
  6. package/dist/arc-d1f6357e.cjs.js +0 -88
  7. package/dist/array-2ff2c7a6.cjs.js +0 -11
  8. package/dist/blockDiagram-5dc23a45.cjs.js +0 -2916
  9. package/dist/c4Diagram-1e775db3.cjs.js +0 -4386
  10. package/dist/channel-ebbc4130.cjs.js +0 -9
  11. package/dist/classDiagram-f52caa06.cjs.js +0 -209
  12. package/dist/classDiagram-v2-640c694e.cjs.js +0 -401
  13. package/dist/clone-afc2f047.cjs.js +0 -10
  14. package/dist/createText-03b82060.cjs.js +0 -2940
  15. package/dist/edges-16357fde.cjs.js +0 -2002
  16. package/dist/erDiagram-c7ff1bec.cjs.js +0 -1807
  17. package/dist/flowDb-9a89ea33.cjs.js +0 -5542
  18. package/dist/flowDiagram-aadb13b0.cjs.js +0 -1351
  19. package/dist/flowDiagram-v2-f2119625.cjs.js +0 -31
  20. package/dist/flowchart-elk-definition-cf813a97.cjs.js +0 -50248
  21. package/dist/ganttDiagram-3c2fde2b.cjs.js +0 -3710
  22. package/dist/gitGraphDiagram-c3a0619c.cjs.js +0 -3815
  23. package/dist/graph-0ee63739.cjs.js +0 -954
  24. package/dist/index-bb6d8841.cjs.js +0 -648
  25. package/dist/index.cjs2.js +0 -76743
  26. package/dist/infoDiagram-2f5c50c0.cjs.js +0 -460
  27. package/dist/init-f9637058.cjs.js +0 -17
  28. package/dist/journeyDiagram-14fe341a.cjs.js +0 -1061
  29. package/dist/katex-d90b6d29.cjs.js +0 -25690
  30. package/dist/layout-fd473db2.cjs.js +0 -1613
  31. package/dist/line-24d93f1b.cjs.js +0 -34
  32. package/dist/linear-9bcf74c4.cjs.js +0 -537
  33. package/dist/mindmap-definition-9399c7e6.cjs.js +0 -20488
  34. package/dist/ordinal-5695958c.cjs.js +0 -330
  35. package/dist/path-428ebac9.cjs.js +0 -316
  36. package/dist/pieDiagram-828dae43.cjs.js +0 -949
  37. package/dist/quadrantDiagram-5fa00455.cjs.js +0 -2409
  38. package/dist/requirementDiagram-03163dc4.cjs.js +0 -2267
  39. package/dist/sankeyDiagram-52ec8976.cjs.js +0 -1848
  40. package/dist/sequenceDiagram-b517d154.cjs.js +0 -5948
  41. package/dist/stateDiagram-fca82b5b.cjs.js +0 -283
  42. package/dist/stateDiagram-v2-ed04200a.cjs.js +0 -373
  43. package/dist/styles-11e81fdd.cjs.js +0 -3943
  44. package/dist/styles-cacbff60.cjs.js +0 -2120
  45. package/dist/styles-e75131e4.cjs.js +0 -671
  46. package/dist/svgDrawCommon-ecc5f780.cjs.js +0 -68
  47. package/dist/timeline-definition-4ee9bff4.cjs.js +0 -1161
  48. package/dist/xychartDiagram-e5e6b652.cjs.js +0 -3150
@@ -1,2002 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index.cjs2.js');
4
- var createText03b82060 = require('./createText-03b82060.cjs.js');
5
- var line24d93f1b = require('./line-24d93f1b.cjs.js');
6
-
7
- function _array_like_to_array(arr, len) {
8
- if (len == null || len > arr.length) len = arr.length;
9
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10
- return arr2;
11
- }
12
- function _array_without_holes(arr) {
13
- if (Array.isArray(arr)) return _array_like_to_array(arr);
14
- }
15
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
16
- try {
17
- var info = gen[key](arg);
18
- var value = info.value;
19
- } catch (error) {
20
- reject(error);
21
- return;
22
- }
23
- if (info.done) {
24
- resolve(value);
25
- } else {
26
- Promise.resolve(value).then(_next, _throw);
27
- }
28
- }
29
- function _async_to_generator(fn) {
30
- return function() {
31
- var self = this, args = arguments;
32
- return new Promise(function(resolve, reject) {
33
- var gen = fn.apply(self, args);
34
- function _next(value) {
35
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
36
- }
37
- function _throw(err) {
38
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
39
- }
40
- _next(undefined);
41
- });
42
- };
43
- }
44
- function _iterable_to_array(iter) {
45
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
46
- }
47
- function _non_iterable_spread() {
48
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
49
- }
50
- function _to_consumable_array(arr) {
51
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
52
- }
53
- function _type_of(obj) {
54
- "@swc/helpers - typeof";
55
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
56
- }
57
- function _unsupported_iterable_to_array(o, minLen) {
58
- if (!o) return;
59
- if (typeof o === "string") return _array_like_to_array(o, minLen);
60
- var n = Object.prototype.toString.call(o).slice(8, -1);
61
- if (n === "Object" && o.constructor) n = o.constructor.name;
62
- if (n === "Map" || n === "Set") return Array.from(n);
63
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
64
- }
65
- function _ts_generator(thisArg, body) {
66
- var f, y, t, g, _ = {
67
- label: 0,
68
- sent: function() {
69
- if (t[0] & 1) throw t[1];
70
- return t[1];
71
- },
72
- trys: [],
73
- ops: []
74
- };
75
- return g = {
76
- next: verb(0),
77
- "throw": verb(1),
78
- "return": verb(2)
79
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
80
- return this;
81
- }), g;
82
- function verb(n) {
83
- return function(v) {
84
- return step([
85
- n,
86
- v
87
- ]);
88
- };
89
- }
90
- function step(op) {
91
- if (f) throw new TypeError("Generator is already executing.");
92
- while(_)try {
93
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
94
- if (y = 0, t) op = [
95
- op[0] & 2,
96
- t.value
97
- ];
98
- switch(op[0]){
99
- case 0:
100
- case 1:
101
- t = op;
102
- break;
103
- case 4:
104
- _.label++;
105
- return {
106
- value: op[1],
107
- done: false
108
- };
109
- case 5:
110
- _.label++;
111
- y = op[1];
112
- op = [
113
- 0
114
- ];
115
- continue;
116
- case 7:
117
- op = _.ops.pop();
118
- _.trys.pop();
119
- continue;
120
- default:
121
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
122
- _ = 0;
123
- continue;
124
- }
125
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
126
- _.label = op[1];
127
- break;
128
- }
129
- if (op[0] === 6 && _.label < t[1]) {
130
- _.label = t[1];
131
- t = op;
132
- break;
133
- }
134
- if (t && _.label < t[2]) {
135
- _.label = t[2];
136
- _.ops.push(op);
137
- break;
138
- }
139
- if (t[2]) _.ops.pop();
140
- _.trys.pop();
141
- continue;
142
- }
143
- op = body.call(thisArg, _);
144
- } catch (e) {
145
- op = [
146
- 6,
147
- e
148
- ];
149
- y = 0;
150
- } finally{
151
- f = t = 0;
152
- }
153
- if (op[0] & 5) throw op[1];
154
- return {
155
- value: op[0] ? op[1] : void 0,
156
- done: true
157
- };
158
- }
159
- }
160
- var ht = function(e, t, a, i) {
161
- t.forEach(function(l) {
162
- wt[l](e, a, i);
163
- });
164
- }, ot = function(e, t, a) {
165
- index.L.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
166
- }, yt = function(e, t, a) {
167
- e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
168
- }, ft = function(e, t, a) {
169
- e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
170
- }, pt = function(e, t, a) {
171
- e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
172
- }, dt = function(e, t, a) {
173
- e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
174
- }, xt = function(e, t, a) {
175
- e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
176
- }, gt = function(e, t, a) {
177
- e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
178
- }, ut = function(e, t, a) {
179
- e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
180
- }, bt = function(e, t, a) {
181
- e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
182
- }, wt = {
183
- extension: ot,
184
- composition: yt,
185
- aggregation: ft,
186
- dependency: pt,
187
- lollipop: dt,
188
- point: xt,
189
- circle: gt,
190
- cross: ut,
191
- barb: bt
192
- }, hr = ht;
193
- function mt(e, t) {
194
- t && e.attr("style", t);
195
- }
196
- function kt(e) {
197
- var t = index.bt(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), a = t.append("xhtml:div"), i = e.label, l = e.isNode ? "nodeLabel" : "edgeLabel";
198
- return a.html('<span class="' + l + '" ' + (e.labelStyle ? 'style="' + e.labelStyle + '"' : "") + ">" + i + "</span>"), mt(a, e.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap"), a.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node();
199
- }
200
- var vt = function(e, t, a, i) {
201
- var l = e || "";
202
- if ((typeof l === "undefined" ? "undefined" : _type_of(l)) == "object" && (l = l[0]), index.La(index.Vn().flowchart.htmlLabels)) {
203
- l = l.replace(/\\n|\n/g, "<br />"), index.L.debug("vertexText" + l);
204
- var r = {
205
- isNode: i,
206
- label: index.q0(l).replace(/fa[blrs]?:fa-[\w-]+/g, // cspell: disable-line
207
- function(n) {
208
- return "<i class='".concat(n.replace(":", " "), "'></i>");
209
- }),
210
- labelStyle: t.replace("fill:", "color:")
211
- };
212
- return kt(r);
213
- } else {
214
- var r1 = document.createElementNS("http://www.w3.org/2000/svg", "text");
215
- r1.setAttribute("style", t.replace("color:", "fill:"));
216
- var s = [];
217
- typeof l == "string" ? s = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? s = l : s = [];
218
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
219
- try {
220
- for(var _iterator = s[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
221
- var n = _step.value;
222
- var c = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
223
- c.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), c.setAttribute("dy", "1em"), c.setAttribute("x", "0"), a ? c.setAttribute("class", "title-row") : c.setAttribute("class", "row"), c.textContent = n.trim(), r1.appendChild(c);
224
- }
225
- } catch (err) {
226
- _didIteratorError = true;
227
- _iteratorError = err;
228
- } finally{
229
- try {
230
- if (!_iteratorNormalCompletion && _iterator.return != null) {
231
- _iterator.return();
232
- }
233
- } finally{
234
- if (_didIteratorError) {
235
- throw _iteratorError;
236
- }
237
- }
238
- }
239
- return r1;
240
- }
241
- }, R = vt, M = function() {
242
- var _ref = _async_to_generator(function(e, t, a, i) {
243
- var l, r, s, n, c, o, h, y, p, f, x, k, d;
244
- return _ts_generator(this, function(_state) {
245
- switch(_state.label){
246
- case 0:
247
- r = t.useHtmlLabels || index.La(index.Vn().flowchart.htmlLabels);
248
- a ? l = a : l = "node default";
249
- s = e.insert("g").attr("class", l).attr("id", t.domId || t.id), n = s.insert("g").attr("class", "label").attr("style", t.labelStyle);
250
- t.labelText === void 0 ? c = "" : c = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
251
- o = n.node();
252
- t.labelType === "markdown" ? h = createText03b82060.Ur(n, index.ai(index.q0(c), index.Vn()), {
253
- useHtmlLabels: r,
254
- width: t.width || index.Vn().flowchart.wrappingWidth,
255
- classes: "markdown-node-label"
256
- }) : h = o.appendChild(R(index.ai(index.q0(c), index.Vn()), t.labelStyle, false, i));
257
- y = h.getBBox();
258
- p = t.padding / 2;
259
- if (!index.La(index.Vn().flowchart.htmlLabels)) return [
260
- 3,
261
- 3
262
- ];
263
- f = h.children[0], x = index.bt(h), k = f.getElementsByTagName("img");
264
- if (!k) return [
265
- 3,
266
- 2
267
- ];
268
- d = c.replace(/<img[^>]*>/g, "").trim() === "";
269
- return [
270
- 4,
271
- Promise.all(_to_consumable_array(k).map(function(u) {
272
- return new Promise(function(S) {
273
- var E = function E() {
274
- if (u.style.display = "flex", u.style.flexDirection = "column", d) {
275
- var C = index.Vn().fontSize ? index.Vn().fontSize : window.getComputedStyle(document.body).fontSize, W = 5, A = parseInt(C, 10) * W + "px";
276
- u.style.minWidth = A, u.style.maxWidth = A;
277
- } else u.style.width = "100%";
278
- S(u);
279
- };
280
- setTimeout(function() {
281
- u.complete && E();
282
- }), u.addEventListener("error", E), u.addEventListener("load", E);
283
- });
284
- }))
285
- ];
286
- case 1:
287
- _state.sent();
288
- _state.label = 2;
289
- case 2:
290
- y = f.getBoundingClientRect(), x.attr("width", y.width), x.attr("height", y.height);
291
- _state.label = 3;
292
- case 3:
293
- return [
294
- 2,
295
- (r ? n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : n.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), n.insert("rect", ":first-child"), {
296
- shapeSvg: s,
297
- bbox: y,
298
- halfPadding: p,
299
- label: n
300
- })
301
- ];
302
- }
303
- });
304
- });
305
- return function M(e, t, a, i) {
306
- return _ref.apply(this, arguments);
307
- };
308
- }(), m = function(e, t) {
309
- var a = t.node().getBBox();
310
- e.width = a.width, e.height = a.height;
311
- };
312
- function I(e, t, a, i) {
313
- return e.insert("polygon", ":first-child").attr("points", i.map(function(l) {
314
- return l.x + "," + l.y;
315
- }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
316
- }
317
- function Lt(e, t) {
318
- return e.intersect(t);
319
- }
320
- function it(e, t, a, i) {
321
- var l = e.x, r = e.y, s = l - i.x, n = r - i.y, c = Math.sqrt(t * t * n * n + a * a * s * s), o = Math.abs(t * a * s / c);
322
- i.x < l && (o = -o);
323
- var h = Math.abs(t * a * n / c);
324
- return i.y < r && (h = -h), {
325
- x: l + o,
326
- y: r + h
327
- };
328
- }
329
- function St(e, t, a) {
330
- return it(e, t, t, a);
331
- }
332
- function Mt(e, t, a, i) {
333
- var l, r, s, n, c, o, h, y, p, f, x, k, d, u, S;
334
- if (l = t.y - e.y, s = e.x - t.x, c = t.x * e.y - e.x * t.y, p = l * a.x + s * a.y + c, f = l * i.x + s * i.y + c, !(p !== 0 && f !== 0 && J(p, f)) && (r = i.y - a.y, n = a.x - i.x, o = i.x * a.y - a.x * i.y, h = r * e.x + n * e.y + o, y = r * t.x + n * t.y + o, !(h !== 0 && y !== 0 && J(h, y)) && (x = l * n - r * s, x !== 0))) return k = Math.abs(x / 2), d = s * o - n * c, u = d < 0 ? (d - k) / x : (d + k) / x, d = r * c - l * o, S = d < 0 ? (d - k) / x : (d + k) / x, {
335
- x: u,
336
- y: S
337
- };
338
- }
339
- function J(e, t) {
340
- return e * t > 0;
341
- }
342
- function Tt(e, t, a) {
343
- var i = e.x, l = e.y, r = [], s = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
344
- typeof t.forEach == "function" ? t.forEach(function(x) {
345
- s = Math.min(s, x.x), n = Math.min(n, x.y);
346
- }) : (s = Math.min(s, t.x), n = Math.min(n, t.y));
347
- for(var c = i - e.width / 2 - s, o = l - e.height / 2 - n, h = 0; h < t.length; h++){
348
- var y = t[h], p = t[h < t.length - 1 ? h + 1 : 0], f = Mt(e, a, {
349
- x: c + y.x,
350
- y: o + y.y
351
- }, {
352
- x: c + p.x,
353
- y: o + p.y
354
- });
355
- f && r.push(f);
356
- }
357
- return r.length ? (r.length > 1 && r.sort(function(x, k) {
358
- var d = x.x - a.x, u = x.y - a.y, S = Math.sqrt(d * d + u * u), E = k.x - a.x, C = k.y - a.y, W = Math.sqrt(E * E + C * C);
359
- return S < W ? -1 : S === W ? 0 : 1;
360
- }), r[0]) : e;
361
- }
362
- var Et = function(e, t) {
363
- var a = e.x, i = e.y, l = t.x - a, r = t.y - i, s = e.width / 2, n = e.height / 2, c, o;
364
- return Math.abs(r) * s > Math.abs(l) * n ? (r < 0 && (n = -n), c = r === 0 ? 0 : n * l / r, o = n) : (l < 0 && (s = -s), c = s, o = l === 0 ? 0 : s * r / l), {
365
- x: a + c,
366
- y: i + o
367
- };
368
- }, Bt = Et, w = {
369
- node: Lt,
370
- circle: St,
371
- ellipse: it,
372
- polygon: Tt,
373
- rect: Bt
374
- }, Ct = function() {
375
- var _ref = _async_to_generator(function(e, t) {
376
- var _ref, i, l, r, s;
377
- return _ts_generator(this, function(_state) {
378
- switch(_state.label){
379
- case 0:
380
- t.useHtmlLabels || index.Vn().flowchart.htmlLabels || (t.centerLabel = true);
381
- return [
382
- 4,
383
- M(e, t, "node " + t.classes, true)
384
- ];
385
- case 1:
386
- _ref = _state.sent(), i = _ref.shapeSvg, l = _ref.bbox, r = _ref.halfPadding;
387
- index.L.info("Classes = ", t.classes);
388
- s = i.insert("rect", ":first-child");
389
- return [
390
- 2,
391
- (s.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - r).attr("y", -l.height / 2 - r).attr("width", l.width + t.padding).attr("height", l.height + t.padding), m(t, s), t.intersect = function(n) {
392
- return w.rect(t, n);
393
- }, i)
394
- ];
395
- }
396
- });
397
- });
398
- return function Ct(e, t) {
399
- return _ref.apply(this, arguments);
400
- };
401
- }(), $t = Ct, _t = function(e) {
402
- var t = /* @__PURE__ */ new Set();
403
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
404
- try {
405
- for(var _iterator = e[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
406
- var a = _step.value;
407
- switch(a){
408
- case "x":
409
- t.add("right"), t.add("left");
410
- break;
411
- case "y":
412
- t.add("up"), t.add("down");
413
- break;
414
- default:
415
- t.add(a);
416
- break;
417
- }
418
- }
419
- } catch (err) {
420
- _didIteratorError = true;
421
- _iteratorError = err;
422
- } finally{
423
- try {
424
- if (!_iteratorNormalCompletion && _iterator.return != null) {
425
- _iterator.return();
426
- }
427
- } finally{
428
- if (_didIteratorError) {
429
- throw _iteratorError;
430
- }
431
- }
432
- }
433
- return t;
434
- }, Rt = function(e, t, a) {
435
- var i = _t(e), l = 2, r = t.height + 2 * a.padding, s = r / l, n = t.width + 2 * s + a.padding, c = a.padding / 2;
436
- return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
437
- // Bottom
438
- {
439
- x: 0,
440
- y: 0
441
- },
442
- {
443
- x: s,
444
- y: 0
445
- },
446
- {
447
- x: n / 2,
448
- y: 2 * c
449
- },
450
- {
451
- x: n - s,
452
- y: 0
453
- },
454
- {
455
- x: n,
456
- y: 0
457
- },
458
- // Right
459
- {
460
- x: n,
461
- y: -r / 3
462
- },
463
- {
464
- x: n + 2 * c,
465
- y: -r / 2
466
- },
467
- {
468
- x: n,
469
- y: -2 * r / 3
470
- },
471
- {
472
- x: n,
473
- y: -r
474
- },
475
- // Top
476
- {
477
- x: n - s,
478
- y: -r
479
- },
480
- {
481
- x: n / 2,
482
- y: -r - 2 * c
483
- },
484
- {
485
- x: s,
486
- y: -r
487
- },
488
- // Left
489
- {
490
- x: 0,
491
- y: -r
492
- },
493
- {
494
- x: 0,
495
- y: -2 * r / 3
496
- },
497
- {
498
- x: -2 * c,
499
- y: -r / 2
500
- },
501
- {
502
- x: 0,
503
- y: -r / 3
504
- }
505
- ] : i.has("right") && i.has("left") && i.has("up") ? [
506
- {
507
- x: s,
508
- y: 0
509
- },
510
- {
511
- x: n - s,
512
- y: 0
513
- },
514
- {
515
- x: n,
516
- y: -r / 2
517
- },
518
- {
519
- x: n - s,
520
- y: -r
521
- },
522
- {
523
- x: s,
524
- y: -r
525
- },
526
- {
527
- x: 0,
528
- y: -r / 2
529
- }
530
- ] : i.has("right") && i.has("left") && i.has("down") ? [
531
- {
532
- x: 0,
533
- y: 0
534
- },
535
- {
536
- x: s,
537
- y: -r
538
- },
539
- {
540
- x: n - s,
541
- y: -r
542
- },
543
- {
544
- x: n,
545
- y: 0
546
- }
547
- ] : i.has("right") && i.has("up") && i.has("down") ? [
548
- {
549
- x: 0,
550
- y: 0
551
- },
552
- {
553
- x: n,
554
- y: -s
555
- },
556
- {
557
- x: n,
558
- y: -r + s
559
- },
560
- {
561
- x: 0,
562
- y: -r
563
- }
564
- ] : i.has("left") && i.has("up") && i.has("down") ? [
565
- {
566
- x: n,
567
- y: 0
568
- },
569
- {
570
- x: 0,
571
- y: -s
572
- },
573
- {
574
- x: 0,
575
- y: -r + s
576
- },
577
- {
578
- x: n,
579
- y: -r
580
- }
581
- ] : i.has("right") && i.has("left") ? [
582
- {
583
- x: s,
584
- y: 0
585
- },
586
- {
587
- x: s,
588
- y: -c
589
- },
590
- {
591
- x: n - s,
592
- y: -c
593
- },
594
- {
595
- x: n - s,
596
- y: 0
597
- },
598
- {
599
- x: n,
600
- y: -r / 2
601
- },
602
- {
603
- x: n - s,
604
- y: -r
605
- },
606
- {
607
- x: n - s,
608
- y: -r + c
609
- },
610
- {
611
- x: s,
612
- y: -r + c
613
- },
614
- {
615
- x: s,
616
- y: -r
617
- },
618
- {
619
- x: 0,
620
- y: -r / 2
621
- }
622
- ] : i.has("up") && i.has("down") ? [
623
- // Bottom center
624
- {
625
- x: n / 2,
626
- y: 0
627
- },
628
- // Left pont of bottom arrow
629
- {
630
- x: 0,
631
- y: -c
632
- },
633
- {
634
- x: s,
635
- y: -c
636
- },
637
- // Left top over vertical section
638
- {
639
- x: s,
640
- y: -r + c
641
- },
642
- {
643
- x: 0,
644
- y: -r + c
645
- },
646
- // Top of arrow
647
- {
648
- x: n / 2,
649
- y: -r
650
- },
651
- {
652
- x: n,
653
- y: -r + c
654
- },
655
- // Top of right vertical bar
656
- {
657
- x: n - s,
658
- y: -r + c
659
- },
660
- {
661
- x: n - s,
662
- y: -c
663
- },
664
- {
665
- x: n,
666
- y: -c
667
- }
668
- ] : i.has("right") && i.has("up") ? [
669
- {
670
- x: 0,
671
- y: 0
672
- },
673
- {
674
- x: n,
675
- y: -s
676
- },
677
- {
678
- x: 0,
679
- y: -r
680
- }
681
- ] : i.has("right") && i.has("down") ? [
682
- {
683
- x: 0,
684
- y: 0
685
- },
686
- {
687
- x: n,
688
- y: 0
689
- },
690
- {
691
- x: 0,
692
- y: -r
693
- }
694
- ] : i.has("left") && i.has("up") ? [
695
- {
696
- x: n,
697
- y: 0
698
- },
699
- {
700
- x: 0,
701
- y: -s
702
- },
703
- {
704
- x: n,
705
- y: -r
706
- }
707
- ] : i.has("left") && i.has("down") ? [
708
- {
709
- x: n,
710
- y: 0
711
- },
712
- {
713
- x: 0,
714
- y: 0
715
- },
716
- {
717
- x: n,
718
- y: -r
719
- }
720
- ] : i.has("right") ? [
721
- {
722
- x: s,
723
- y: -c
724
- },
725
- {
726
- x: s,
727
- y: -c
728
- },
729
- {
730
- x: n - s,
731
- y: -c
732
- },
733
- {
734
- x: n - s,
735
- y: 0
736
- },
737
- {
738
- x: n,
739
- y: -r / 2
740
- },
741
- {
742
- x: n - s,
743
- y: -r
744
- },
745
- {
746
- x: n - s,
747
- y: -r + c
748
- },
749
- // top left corner of arrow
750
- {
751
- x: s,
752
- y: -r + c
753
- },
754
- {
755
- x: s,
756
- y: -r + c
757
- }
758
- ] : i.has("left") ? [
759
- {
760
- x: s,
761
- y: 0
762
- },
763
- {
764
- x: s,
765
- y: -c
766
- },
767
- // Two points, the right corners
768
- {
769
- x: n - s,
770
- y: -c
771
- },
772
- {
773
- x: n - s,
774
- y: -r + c
775
- },
776
- {
777
- x: s,
778
- y: -r + c
779
- },
780
- {
781
- x: s,
782
- y: -r
783
- },
784
- {
785
- x: 0,
786
- y: -r / 2
787
- }
788
- ] : i.has("up") ? [
789
- // Bottom center
790
- {
791
- x: s,
792
- y: -c
793
- },
794
- // Left top over vertical section
795
- {
796
- x: s,
797
- y: -r + c
798
- },
799
- {
800
- x: 0,
801
- y: -r + c
802
- },
803
- // Top of arrow
804
- {
805
- x: n / 2,
806
- y: -r
807
- },
808
- {
809
- x: n,
810
- y: -r + c
811
- },
812
- // Top of right vertical bar
813
- {
814
- x: n - s,
815
- y: -r + c
816
- },
817
- {
818
- x: n - s,
819
- y: -c
820
- }
821
- ] : i.has("down") ? [
822
- // Bottom center
823
- {
824
- x: n / 2,
825
- y: 0
826
- },
827
- // Left pont of bottom arrow
828
- {
829
- x: 0,
830
- y: -c
831
- },
832
- {
833
- x: s,
834
- y: -c
835
- },
836
- // Left top over vertical section
837
- {
838
- x: s,
839
- y: -r + c
840
- },
841
- {
842
- x: n - s,
843
- y: -r + c
844
- },
845
- {
846
- x: n - s,
847
- y: -c
848
- },
849
- {
850
- x: n,
851
- y: -c
852
- }
853
- ] : [
854
- {
855
- x: 0,
856
- y: 0
857
- }
858
- ];
859
- }, K = function(e) {
860
- return e ? " " + e : "";
861
- }, _ = function(e, t) {
862
- return "".concat("node default").concat(K(e.classes), " ").concat(K(e.class));
863
- }, P = function() {
864
- var _ref = _async_to_generator(function(e, t) {
865
- var _ref, a, i, l, r, s, n, c;
866
- return _ts_generator(this, function(_state) {
867
- switch(_state.label){
868
- case 0:
869
- return [
870
- 4,
871
- M(e, t, _(t), true)
872
- ];
873
- case 1:
874
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = l + r, n = [
875
- {
876
- x: s / 2,
877
- y: 0
878
- },
879
- {
880
- x: s,
881
- y: -s / 2
882
- },
883
- {
884
- x: s / 2,
885
- y: -s
886
- },
887
- {
888
- x: 0,
889
- y: -s / 2
890
- }
891
- ];
892
- index.L.info("Question main (Circle)");
893
- c = I(a, s, s, n);
894
- return [
895
- 2,
896
- (c.attr("style", t.style), m(t, c), t.intersect = function(o) {
897
- return index.L.warn("Intersect called"), w.polygon(t, n, o);
898
- }, a)
899
- ];
900
- }
901
- });
902
- });
903
- return function P(e, t) {
904
- return _ref.apply(this, arguments);
905
- };
906
- }(), Ht = function(e, t) {
907
- var a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
908
- {
909
- x: 0,
910
- y: i / 2
911
- },
912
- {
913
- x: i / 2,
914
- y: 0
915
- },
916
- {
917
- x: 0,
918
- y: -i / 2
919
- },
920
- {
921
- x: -i / 2,
922
- y: 0
923
- }
924
- ];
925
- return a.insert("polygon", ":first-child").attr("points", l.map(function(s) {
926
- return s.x + "," + s.y;
927
- }).join(" ")).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function Ht(s) {
928
- return w.circle(t, 14, s);
929
- }, a;
930
- }, It = function() {
931
- var _ref = _async_to_generator(function(e, t) {
932
- var _ref, a, i, l, r, s, n, c, o;
933
- return _ts_generator(this, function(_state) {
934
- switch(_state.label){
935
- case 0:
936
- return [
937
- 4,
938
- M(e, t, _(t), true)
939
- ];
940
- case 1:
941
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = 4, r = i.height + t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = [
942
- {
943
- x: s,
944
- y: 0
945
- },
946
- {
947
- x: n - s,
948
- y: 0
949
- },
950
- {
951
- x: n,
952
- y: -r / 2
953
- },
954
- {
955
- x: n - s,
956
- y: -r
957
- },
958
- {
959
- x: s,
960
- y: -r
961
- },
962
- {
963
- x: 0,
964
- y: -r / 2
965
- }
966
- ], o = I(a, n, r, c);
967
- return [
968
- 2,
969
- (o.attr("style", t.style), m(t, o), t.intersect = function(h) {
970
- return w.polygon(t, c, h);
971
- }, a)
972
- ];
973
- }
974
- });
975
- });
976
- return function It(e, t) {
977
- return _ref.apply(this, arguments);
978
- };
979
- }(), Nt = function() {
980
- var _ref = _async_to_generator(function(e, t) {
981
- var _ref, a, i, l, r, s, n, c, o;
982
- return _ts_generator(this, function(_state) {
983
- switch(_state.label){
984
- case 0:
985
- return [
986
- 4,
987
- M(e, t, void 0, true)
988
- ];
989
- case 1:
990
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = 2, r = i.height + 2 * t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = Rt(t.directions, i, t), o = I(a, n, r, c);
991
- return [
992
- 2,
993
- (o.attr("style", t.style), m(t, o), t.intersect = function(h) {
994
- return w.polygon(t, c, h);
995
- }, a)
996
- ];
997
- }
998
- });
999
- });
1000
- return function Nt(e, t) {
1001
- return _ref.apply(this, arguments);
1002
- };
1003
- }(), Ot = function() {
1004
- var _ref = _async_to_generator(function(e, t) {
1005
- var _ref, a, i, l, r, s;
1006
- return _ts_generator(this, function(_state) {
1007
- switch(_state.label){
1008
- case 0:
1009
- return [
1010
- 4,
1011
- M(e, t, _(t), true)
1012
- ];
1013
- case 1:
1014
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1015
- {
1016
- x: -r / 2,
1017
- y: 0
1018
- },
1019
- {
1020
- x: l,
1021
- y: 0
1022
- },
1023
- {
1024
- x: l,
1025
- y: -r
1026
- },
1027
- {
1028
- x: -r / 2,
1029
- y: -r
1030
- },
1031
- {
1032
- x: 0,
1033
- y: -r / 2
1034
- }
1035
- ];
1036
- return [
1037
- 2,
1038
- (I(a, l, r, s).attr("style", t.style), t.width = l + r, t.height = r, t.intersect = function(c) {
1039
- return w.polygon(t, s, c);
1040
- }, a)
1041
- ];
1042
- }
1043
- });
1044
- });
1045
- return function Ot(e, t) {
1046
- return _ref.apply(this, arguments);
1047
- };
1048
- }(), Wt = function() {
1049
- var _ref = _async_to_generator(function(e, t) {
1050
- var _ref, a, i, l, r, s, n;
1051
- return _ts_generator(this, function(_state) {
1052
- switch(_state.label){
1053
- case 0:
1054
- return [
1055
- 4,
1056
- M(e, t, _(t), true)
1057
- ];
1058
- case 1:
1059
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1060
- {
1061
- x: -2 * r / 6,
1062
- y: 0
1063
- },
1064
- {
1065
- x: l - r / 6,
1066
- y: 0
1067
- },
1068
- {
1069
- x: l + 2 * r / 6,
1070
- y: -r
1071
- },
1072
- {
1073
- x: r / 6,
1074
- y: -r
1075
- }
1076
- ], n = I(a, l, r, s);
1077
- return [
1078
- 2,
1079
- (n.attr("style", t.style), m(t, n), t.intersect = function(c) {
1080
- return w.polygon(t, s, c);
1081
- }, a)
1082
- ];
1083
- }
1084
- });
1085
- });
1086
- return function Wt(e, t) {
1087
- return _ref.apply(this, arguments);
1088
- };
1089
- }(), Xt = function() {
1090
- var _ref = _async_to_generator(function(e, t) {
1091
- var _ref, a, i, l, r, s, n;
1092
- return _ts_generator(this, function(_state) {
1093
- switch(_state.label){
1094
- case 0:
1095
- return [
1096
- 4,
1097
- M(e, t, _(t), true)
1098
- ];
1099
- case 1:
1100
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1101
- {
1102
- x: 2 * r / 6,
1103
- y: 0
1104
- },
1105
- {
1106
- x: l + r / 6,
1107
- y: 0
1108
- },
1109
- {
1110
- x: l - 2 * r / 6,
1111
- y: -r
1112
- },
1113
- {
1114
- x: -r / 6,
1115
- y: -r
1116
- }
1117
- ], n = I(a, l, r, s);
1118
- return [
1119
- 2,
1120
- (n.attr("style", t.style), m(t, n), t.intersect = function(c) {
1121
- return w.polygon(t, s, c);
1122
- }, a)
1123
- ];
1124
- }
1125
- });
1126
- });
1127
- return function Xt(e, t) {
1128
- return _ref.apply(this, arguments);
1129
- };
1130
- }(), Yt = function() {
1131
- var _ref = _async_to_generator(function(e, t) {
1132
- var _ref, a, i, l, r, s, n;
1133
- return _ts_generator(this, function(_state) {
1134
- switch(_state.label){
1135
- case 0:
1136
- return [
1137
- 4,
1138
- M(e, t, _(t), true)
1139
- ];
1140
- case 1:
1141
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1142
- {
1143
- x: -2 * r / 6,
1144
- y: 0
1145
- },
1146
- {
1147
- x: l + 2 * r / 6,
1148
- y: 0
1149
- },
1150
- {
1151
- x: l - r / 6,
1152
- y: -r
1153
- },
1154
- {
1155
- x: r / 6,
1156
- y: -r
1157
- }
1158
- ], n = I(a, l, r, s);
1159
- return [
1160
- 2,
1161
- (n.attr("style", t.style), m(t, n), t.intersect = function(c) {
1162
- return w.polygon(t, s, c);
1163
- }, a)
1164
- ];
1165
- }
1166
- });
1167
- });
1168
- return function Yt(e, t) {
1169
- return _ref.apply(this, arguments);
1170
- };
1171
- }(), At = function() {
1172
- var _ref = _async_to_generator(function(e, t) {
1173
- var _ref, a, i, l, r, s, n;
1174
- return _ts_generator(this, function(_state) {
1175
- switch(_state.label){
1176
- case 0:
1177
- return [
1178
- 4,
1179
- M(e, t, _(t), true)
1180
- ];
1181
- case 1:
1182
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1183
- {
1184
- x: r / 6,
1185
- y: 0
1186
- },
1187
- {
1188
- x: l - r / 6,
1189
- y: 0
1190
- },
1191
- {
1192
- x: l + 2 * r / 6,
1193
- y: -r
1194
- },
1195
- {
1196
- x: -2 * r / 6,
1197
- y: -r
1198
- }
1199
- ], n = I(a, l, r, s);
1200
- return [
1201
- 2,
1202
- (n.attr("style", t.style), m(t, n), t.intersect = function(c) {
1203
- return w.polygon(t, s, c);
1204
- }, a)
1205
- ];
1206
- }
1207
- });
1208
- });
1209
- return function At(e, t) {
1210
- return _ref.apply(this, arguments);
1211
- };
1212
- }(), Dt = function() {
1213
- var _ref = _async_to_generator(function(e, t) {
1214
- var _ref, a, i, l, r, s, n;
1215
- return _ts_generator(this, function(_state) {
1216
- switch(_state.label){
1217
- case 0:
1218
- return [
1219
- 4,
1220
- M(e, t, _(t), true)
1221
- ];
1222
- case 1:
1223
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1224
- {
1225
- x: 0,
1226
- y: 0
1227
- },
1228
- {
1229
- x: l + r / 2,
1230
- y: 0
1231
- },
1232
- {
1233
- x: l,
1234
- y: -r / 2
1235
- },
1236
- {
1237
- x: l + r / 2,
1238
- y: -r
1239
- },
1240
- {
1241
- x: 0,
1242
- y: -r
1243
- }
1244
- ], n = I(a, l, r, s);
1245
- return [
1246
- 2,
1247
- (n.attr("style", t.style), m(t, n), t.intersect = function(c) {
1248
- return w.polygon(t, s, c);
1249
- }, a)
1250
- ];
1251
- }
1252
- });
1253
- });
1254
- return function Dt(e, t) {
1255
- return _ref.apply(this, arguments);
1256
- };
1257
- }(), jt = function() {
1258
- var _ref = _async_to_generator(function(e, t) {
1259
- var _ref, a, i, l, r, s, n, c, o;
1260
- return _ts_generator(this, function(_state) {
1261
- switch(_state.label){
1262
- case 0:
1263
- return [
1264
- 4,
1265
- M(e, t, _(t), true)
1266
- ];
1267
- case 1:
1268
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = l / 2, s = r / (2.5 + l / 50), n = i.height + s + t.padding, c = "M 0," + s + " a " + r + "," + s + " 0,0,0 " + l + " 0 a " + r + "," + s + " 0,0,0 " + -l + " 0 l 0," + n + " a " + r + "," + s + " 0,0,0 " + l + " 0 l 0," + -n, o = a.attr("label-offset-y", s).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + s) + ")");
1269
- return [
1270
- 2,
1271
- (m(t, o), t.intersect = function(h) {
1272
- var y = w.rect(t, h), p = y.x - t.x;
1273
- if (r != 0 && (Math.abs(p) < t.width / 2 || Math.abs(p) == t.width / 2 && Math.abs(y.y - t.y) > t.height / 2 - s)) {
1274
- var f = s * s * (1 - p * p / (r * r));
1275
- f != 0 && (f = Math.sqrt(f)), f = s - f, h.y - t.y > 0 && (f = -f), y.y += f;
1276
- }
1277
- return y;
1278
- }, a)
1279
- ];
1280
- }
1281
- });
1282
- });
1283
- return function jt(e, t) {
1284
- return _ref.apply(this, arguments);
1285
- };
1286
- }(), Ut = function() {
1287
- var _ref = _async_to_generator(function(e, t) {
1288
- var _ref, a, i, l, r, s, n, c, o, h;
1289
- return _ts_generator(this, function(_state) {
1290
- switch(_state.label){
1291
- case 0:
1292
- return [
1293
- 4,
1294
- M(e, t, "node " + t.classes + " " + t.class, true)
1295
- ];
1296
- case 1:
1297
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = _ref.halfPadding, r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, o = t.positioned ? -n / 2 : -i.height / 2 - l;
1298
- if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) {
1299
- h = new Set(Object.keys(t.props));
1300
- t.props.borders && (V(r, t.props.borders, s, n), h.delete("borders")), h.forEach(function(y) {
1301
- index.L.warn("Unknown node property ".concat(y));
1302
- });
1303
- }
1304
- return [
1305
- 2,
1306
- (m(t, r), t.intersect = function(h) {
1307
- return w.rect(t, h);
1308
- }, a)
1309
- ];
1310
- }
1311
- });
1312
- });
1313
- return function Ut(e, t) {
1314
- return _ref.apply(this, arguments);
1315
- };
1316
- }(), zt = function() {
1317
- var _ref = _async_to_generator(function(e, t) {
1318
- var _ref, a, i, l, r, s, n, c, o, h;
1319
- return _ts_generator(this, function(_state) {
1320
- switch(_state.label){
1321
- case 0:
1322
- return [
1323
- 4,
1324
- M(e, t, "node " + t.classes, true)
1325
- ];
1326
- case 1:
1327
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = _ref.halfPadding, r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, o = t.positioned ? -n / 2 : -i.height / 2 - l;
1328
- if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) {
1329
- h = new Set(Object.keys(t.props));
1330
- t.props.borders && (V(r, t.props.borders, s, n), h.delete("borders")), h.forEach(function(y) {
1331
- index.L.warn("Unknown node property ".concat(y));
1332
- });
1333
- }
1334
- return [
1335
- 2,
1336
- (m(t, r), t.intersect = function(h) {
1337
- return w.rect(t, h);
1338
- }, a)
1339
- ];
1340
- }
1341
- });
1342
- });
1343
- return function zt(e, t) {
1344
- return _ref.apply(this, arguments);
1345
- };
1346
- }(), Zt = function() {
1347
- var _ref = _async_to_generator(function(e, t) {
1348
- var _ref, a, i, l, r, s;
1349
- return _ts_generator(this, function(_state) {
1350
- switch(_state.label){
1351
- case 0:
1352
- return [
1353
- 4,
1354
- M(e, t, "label", true)
1355
- ];
1356
- case 1:
1357
- _ref = _state.sent(), a = _ref.shapeSvg;
1358
- index.L.trace("Classes = ", t.class);
1359
- i = a.insert("rect", ":first-child"), l = 0, r = 0;
1360
- if (i.attr("width", l).attr("height", r), a.attr("class", "label edgeLabel"), t.props) {
1361
- s = new Set(Object.keys(t.props));
1362
- t.props.borders && (V(i, t.props.borders, l, r), s.delete("borders")), s.forEach(function(n) {
1363
- index.L.warn("Unknown node property ".concat(n));
1364
- });
1365
- }
1366
- return [
1367
- 2,
1368
- (m(t, i), t.intersect = function(s) {
1369
- return w.rect(t, s);
1370
- }, a)
1371
- ];
1372
- }
1373
- });
1374
- });
1375
- return function Zt(e, t) {
1376
- return _ref.apply(this, arguments);
1377
- };
1378
- }();
1379
- function V(e, t, a, i) {
1380
- var l = [], r = function(n) {
1381
- l.push(n, 0);
1382
- }, s = function(n) {
1383
- l.push(0, n);
1384
- };
1385
- t.includes("t") ? (index.L.debug("add top border"), r(a)) : s(a), t.includes("r") ? (index.L.debug("add right border"), r(i)) : s(i), t.includes("b") ? (index.L.debug("add bottom border"), r(a)) : s(a), t.includes("l") ? (index.L.debug("add left border"), r(i)) : s(i), e.attr("stroke-dasharray", l.join(" "));
1386
- }
1387
- var Gt = function(e, t) {
1388
- var a;
1389
- t.classes ? a = "node " + t.classes : a = "node default";
1390
- var i = e.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), r = i.insert("line"), s = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1391
- var c = "";
1392
- (typeof n === "undefined" ? "undefined" : _type_of(n)) == "object" ? c = n[0] : c = n, index.L.info("Label text abc79", c, n, (typeof n === "undefined" ? "undefined" : _type_of(n)) == "object");
1393
- var o = s.node().appendChild(R(c, t.labelStyle, true, true));
1394
- var h = {
1395
- width: 0,
1396
- height: 0
1397
- };
1398
- if (index.La(index.Vn().flowchart.htmlLabels)) {
1399
- var k = o.children[0], d = index.bt(o);
1400
- h = k.getBoundingClientRect(), d.attr("width", h.width), d.attr("height", h.height);
1401
- }
1402
- index.L.info("Text 2", n);
1403
- var y = n.slice(1, n.length);
1404
- var p = o.getBBox();
1405
- var f = s.node().appendChild(R(y.join ? y.join("<br/>") : y, t.labelStyle, true, true));
1406
- if (index.La(index.Vn().flowchart.htmlLabels)) {
1407
- var k1 = f.children[0], d1 = index.bt(f);
1408
- h = k1.getBoundingClientRect(), d1.attr("width", h.width), d1.attr("height", h.height);
1409
- }
1410
- var x = t.padding / 2;
1411
- return index.bt(f).attr("transform", "translate( " + // (titleBox.width - bbox.width) / 2 +
1412
- (h.width > p.width ? 0 : (p.width - h.width) / 2) + ", " + (p.height + x + 5) + ")"), index.bt(o).attr("transform", "translate( " + // (titleBox.width - bbox.width) / 2 +
1413
- (h.width < p.width ? 0 : -(p.width - h.width) / 2) + ", 0)"), h = s.node().getBBox(), s.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - x + 3) + ")"), l.attr("class", "outer title-state").attr("x", -h.width / 2 - x).attr("y", -h.height / 2 - x).attr("width", h.width + t.padding).attr("height", h.height + t.padding), r.attr("class", "divider").attr("x1", -h.width / 2 - x).attr("x2", h.width / 2 + x).attr("y1", -h.height / 2 - x + p.height + x).attr("y2", -h.height / 2 - x + p.height + x), m(t, l), t.intersect = function Gt(k) {
1414
- return w.rect(t, k);
1415
- }, i;
1416
- }, Ft = function() {
1417
- var _ref = _async_to_generator(function(e, t) {
1418
- var _ref, a, i, l, r, s;
1419
- return _ts_generator(this, function(_state) {
1420
- switch(_state.label){
1421
- case 0:
1422
- return [
1423
- 4,
1424
- M(e, t, _(t), true)
1425
- ];
1426
- case 1:
1427
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.height + t.padding, r = i.width + l / 4 + t.padding, s = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -r / 2).attr("y", -l / 2).attr("width", r).attr("height", l);
1428
- return [
1429
- 2,
1430
- (m(t, s), t.intersect = function(n) {
1431
- return w.rect(t, n);
1432
- }, a)
1433
- ];
1434
- }
1435
- });
1436
- });
1437
- return function Ft(e, t) {
1438
- return _ref.apply(this, arguments);
1439
- };
1440
- }(), Qt = function() {
1441
- var _ref = _async_to_generator(function(e, t) {
1442
- var _ref, a, i, l, r;
1443
- return _ts_generator(this, function(_state) {
1444
- switch(_state.label){
1445
- case 0:
1446
- return [
1447
- 4,
1448
- M(e, t, _(t), true)
1449
- ];
1450
- case 1:
1451
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = _ref.halfPadding, r = a.insert("circle", ":first-child");
1452
- return [
1453
- 2,
1454
- (r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), index.L.info("Circle main"), m(t, r), t.intersect = function(s) {
1455
- return index.L.info("Circle intersect", t, i.width / 2 + l, s), w.circle(t, i.width / 2 + l, s);
1456
- }, a)
1457
- ];
1458
- }
1459
- });
1460
- });
1461
- return function Qt(e, t) {
1462
- return _ref.apply(this, arguments);
1463
- };
1464
- }(), Vt = function() {
1465
- var _ref = _async_to_generator(function(e, t) {
1466
- var _ref, a, i, l, r, s, n, c;
1467
- return _ts_generator(this, function(_state) {
1468
- switch(_state.label){
1469
- case 0:
1470
- return [
1471
- 4,
1472
- M(e, t, _(t), true)
1473
- ];
1474
- case 1:
1475
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = _ref.halfPadding, r = 5, s = a.insert("g", ":first-child"), n = s.insert("circle"), c = s.insert("circle");
1476
- return [
1477
- 2,
1478
- (s.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + r).attr("width", i.width + t.padding + r * 2).attr("height", i.height + t.padding + r * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), index.L.info("DoubleCircle main"), m(t, n), t.intersect = function(o) {
1479
- return index.L.info("DoubleCircle intersect", t, i.width / 2 + l + r, o), w.circle(t, i.width / 2 + l + r, o);
1480
- }, a)
1481
- ];
1482
- }
1483
- });
1484
- });
1485
- return function Vt(e, t) {
1486
- return _ref.apply(this, arguments);
1487
- };
1488
- }(), qt = function() {
1489
- var _ref = _async_to_generator(function(e, t) {
1490
- var _ref, a, i, l, r, s, n;
1491
- return _ts_generator(this, function(_state) {
1492
- switch(_state.label){
1493
- case 0:
1494
- return [
1495
- 4,
1496
- M(e, t, _(t), true)
1497
- ];
1498
- case 1:
1499
- _ref = _state.sent(), a = _ref.shapeSvg, i = _ref.bbox, l = i.width + t.padding, r = i.height + t.padding, s = [
1500
- {
1501
- x: 0,
1502
- y: 0
1503
- },
1504
- {
1505
- x: l,
1506
- y: 0
1507
- },
1508
- {
1509
- x: l,
1510
- y: -r
1511
- },
1512
- {
1513
- x: 0,
1514
- y: -r
1515
- },
1516
- {
1517
- x: 0,
1518
- y: 0
1519
- },
1520
- {
1521
- x: -8,
1522
- y: 0
1523
- },
1524
- {
1525
- x: l + 8,
1526
- y: 0
1527
- },
1528
- {
1529
- x: l + 8,
1530
- y: -r
1531
- },
1532
- {
1533
- x: -8,
1534
- y: -r
1535
- },
1536
- {
1537
- x: -8,
1538
- y: 0
1539
- }
1540
- ], n = I(a, l, r, s);
1541
- return [
1542
- 2,
1543
- (n.attr("style", t.style), m(t, n), t.intersect = function(c) {
1544
- return w.polygon(t, s, c);
1545
- }, a)
1546
- ];
1547
- }
1548
- });
1549
- });
1550
- return function qt(e, t) {
1551
- return _ref.apply(this, arguments);
1552
- };
1553
- }(), Jt = function(e, t) {
1554
- var a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child");
1555
- return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), m(t, i), t.intersect = function Jt(l) {
1556
- return w.circle(t, 7, l);
1557
- }, a;
1558
- }, tt = function(e, t, a) {
1559
- var i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
1560
- var l = 70, r = 10;
1561
- a === "LR" && (l = 10, r = 70);
1562
- var s = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * r / 2).attr("width", l).attr("height", r).attr("class", "fork-join");
1563
- return m(t, s), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function tt(n) {
1564
- return w.rect(t, n);
1565
- }, i;
1566
- }, Kt = function(e, t) {
1567
- var a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child"), l = a.insert("circle", ":first-child");
1568
- return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), m(t, l), t.intersect = function Kt(r) {
1569
- return w.circle(t, 7, r);
1570
- }, a;
1571
- }, Pt = function(e, t) {
1572
- var a = t.padding / 2, i = 4, l = 8;
1573
- var r;
1574
- t.classes ? r = "node " + t.classes : r = "node default";
1575
- var s = e.insert("g").attr("class", r).attr("id", t.domId || t.id), n = s.insert("rect", ":first-child"), c = s.insert("line"), o = s.insert("line");
1576
- var h = 0, y = i;
1577
- var p = s.insert("g").attr("class", "label");
1578
- var f = 0;
1579
- var x = t.classData.annotations && t.classData.annotations[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", d = p.node().appendChild(R(k, t.labelStyle, true, true));
1580
- var u = d.getBBox();
1581
- if (index.La(index.Vn().flowchart.htmlLabels)) {
1582
- var v = d.children[0], L = index.bt(d);
1583
- u = v.getBoundingClientRect(), L.attr("width", u.width), L.attr("height", u.height);
1584
- }
1585
- t.classData.annotations[0] && (y += u.height + i, h += u.width);
1586
- var S = t.classData.label;
1587
- t.classData.type !== void 0 && t.classData.type !== "" && (index.Vn().flowchart.htmlLabels ? S += "&lt;" + t.classData.type + "&gt;" : S += "<" + t.classData.type + ">");
1588
- var E = p.node().appendChild(R(S, t.labelStyle, true, true));
1589
- index.bt(E).attr("class", "classTitle");
1590
- var C = E.getBBox();
1591
- if (index.La(index.Vn().flowchart.htmlLabels)) {
1592
- var v1 = E.children[0], L1 = index.bt(E);
1593
- C = v1.getBoundingClientRect(), L1.attr("width", C.width), L1.attr("height", C.height);
1594
- }
1595
- y += C.height + i, C.width > h && (h = C.width);
1596
- var W = [];
1597
- t.classData.members.forEach(function(v) {
1598
- var L = v.getDisplayDetails();
1599
- var X = L.displayText;
1600
- index.Vn().flowchart.htmlLabels && (X = X.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1601
- var N = p.node().appendChild(R(X, L.cssStyle ? L.cssStyle : t.labelStyle, true, true));
1602
- var $ = N.getBBox();
1603
- if (index.La(index.Vn().flowchart.htmlLabels)) {
1604
- var F = N.children[0], D = index.bt(N);
1605
- $ = F.getBoundingClientRect(), D.attr("width", $.width), D.attr("height", $.height);
1606
- }
1607
- $.width > h && (h = $.width), y += $.height + i, W.push(N);
1608
- }), y += l;
1609
- var A = [];
1610
- if (t.classData.methods.forEach(function(v) {
1611
- var L = v.getDisplayDetails();
1612
- var X = L.displayText;
1613
- index.Vn().flowchart.htmlLabels && (X = X.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1614
- var N = p.node().appendChild(R(X, L.cssStyle ? L.cssStyle : t.labelStyle, true, true));
1615
- var $ = N.getBBox();
1616
- if (index.La(index.Vn().flowchart.htmlLabels)) {
1617
- var F = N.children[0], D = index.bt(N);
1618
- $ = F.getBoundingClientRect(), D.attr("width", $.width), D.attr("height", $.height);
1619
- }
1620
- $.width > h && (h = $.width), y += $.height + i, A.push(N);
1621
- }), y += l, x) {
1622
- var v2 = (h - u.width) / 2;
1623
- index.bt(d).attr("transform", "translate( " + (-1 * h / 2 + v2) + ", " + -1 * y / 2 + ")"), f = u.height + i;
1624
- }
1625
- var nt = (h - C.width) / 2;
1626
- return index.bt(E).attr("transform", "translate( " + (-1 * h / 2 + nt) + ", " + (-1 * y / 2 + f) + ")"), f += C.height + i, c.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + f).attr("y2", -y / 2 - a + l + f), f += l, W.forEach(function(v) {
1627
- index.bt(v).attr("transform", "translate( " + -h / 2 + ", " + (-1 * y / 2 + f + l / 2) + ")");
1628
- var L = v == null ? void 0 : v.getBBox();
1629
- var _ref;
1630
- f += ((_ref = L == null ? void 0 : L.height) !== null && _ref !== void 0 ? _ref : 0) + i;
1631
- }), f += l, o.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + f).attr("y2", -y / 2 - a + l + f), f += l, A.forEach(function(v) {
1632
- index.bt(v).attr("transform", "translate( " + -h / 2 + ", " + (-1 * y / 2 + f) + ")");
1633
- var L = v == null ? void 0 : v.getBBox();
1634
- var _ref;
1635
- f += ((_ref = L == null ? void 0 : L.height) !== null && _ref !== void 0 ? _ref : 0) + i;
1636
- }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - a).attr("y", -(y / 2) - a).attr("width", h + t.padding).attr("height", y + t.padding), m(t, n), t.intersect = function Pt(v) {
1637
- return w.rect(t, v);
1638
- }, s;
1639
- }, rt = {
1640
- rhombus: P,
1641
- composite: zt,
1642
- question: P,
1643
- rect: Ut,
1644
- labelRect: Zt,
1645
- rectWithTitle: Gt,
1646
- choice: Ht,
1647
- circle: Qt,
1648
- doublecircle: Vt,
1649
- stadium: Ft,
1650
- hexagon: It,
1651
- block_arrow: Nt,
1652
- rect_left_inv_arrow: Ot,
1653
- lean_right: Wt,
1654
- lean_left: Xt,
1655
- trapezoid: Yt,
1656
- inv_trapezoid: At,
1657
- rect_right_inv_arrow: Dt,
1658
- cylinder: jt,
1659
- start: Jt,
1660
- end: Kt,
1661
- note: $t,
1662
- subroutine: qt,
1663
- fork: tt,
1664
- join: tt,
1665
- class_box: Pt
1666
- };
1667
- var Y = {};
1668
- var or = function() {
1669
- var _ref = _async_to_generator(function(e, t, a) {
1670
- var i, l, r;
1671
- return _ts_generator(this, function(_state) {
1672
- switch(_state.label){
1673
- case 0:
1674
- if (!t.link) return [
1675
- 3,
1676
- 2
1677
- ];
1678
- index.Vn().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", r);
1679
- return [
1680
- 4,
1681
- rt[t.shape](i, t, a)
1682
- ];
1683
- case 1:
1684
- l = _state.sent();
1685
- return [
1686
- 3,
1687
- 4
1688
- ];
1689
- case 2:
1690
- return [
1691
- 4,
1692
- rt[t.shape](e, t, a)
1693
- ];
1694
- case 3:
1695
- l = _state.sent(), i = l;
1696
- _state.label = 4;
1697
- case 4:
1698
- return [
1699
- 2,
1700
- (t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), i.attr("data-node", "true"), i.attr("data-id", t.id), Y[t.id] = i, t.haveCallback && Y[t.id].attr("class", Y[t.id].attr("class") + " clickable"), i)
1701
- ];
1702
- }
1703
- });
1704
- });
1705
- return function or(e, t, a) {
1706
- return _ref.apply(this, arguments);
1707
- };
1708
- }(), yr = function(e, t) {
1709
- Y[t.id] = e;
1710
- }, fr = function() {
1711
- Y = {};
1712
- }, pr = function(e) {
1713
- var t = Y[e.id];
1714
- index.L.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
1715
- var a = 8, i = e.diff || 0;
1716
- return e.clusterNode ? t.attr("transform", "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")") : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i;
1717
- }, tr = function(param) {
1718
- var e = param.flowchart;
1719
- var l, r;
1720
- var _ref, _ref1;
1721
- var t = (_ref = (l = e == null ? void 0 : e.subGraphTitleMargin) == null ? void 0 : l.top) !== null && _ref !== void 0 ? _ref : 0, a = (_ref1 = (r = e == null ? void 0 : e.subGraphTitleMargin) == null ? void 0 : r.bottom) !== null && _ref1 !== void 0 ? _ref1 : 0, i = t + a;
1722
- return {
1723
- subGraphTitleTopMargin: t,
1724
- subGraphTitleBottomMargin: a,
1725
- subGraphTitleTotalMargin: i
1726
- };
1727
- }, O = {
1728
- aggregation: 18,
1729
- extension: 18,
1730
- composition: 18,
1731
- dependency: 6,
1732
- lollipop: 13.5,
1733
- arrow_point: 5.3
1734
- };
1735
- function U(e, t) {
1736
- if (e === void 0 || t === void 0) return {
1737
- angle: 0,
1738
- deltaX: 0,
1739
- deltaY: 0
1740
- };
1741
- e = Z(e), t = Z(t);
1742
- var _ref = [
1743
- e.x,
1744
- e.y
1745
- ], a = _ref[0], i = _ref[1], _ref1 = [
1746
- t.x,
1747
- t.y
1748
- ], l = _ref1[0], r = _ref1[1], s = l - a, n = r - i;
1749
- return {
1750
- angle: Math.atan(n / s),
1751
- deltaX: s,
1752
- deltaY: n
1753
- };
1754
- }
1755
- var Z = function(e) {
1756
- return Array.isArray(e) ? {
1757
- x: e[0],
1758
- y: e[1]
1759
- } : e;
1760
- }, rr = function(e) {
1761
- return {
1762
- x: function x(t, a, i) {
1763
- var l = 0;
1764
- if (a === 0 && Object.hasOwn(O, e.arrowTypeStart)) {
1765
- var _U = U(i[0], i[1]), r = _U.angle, s = _U.deltaX;
1766
- l = O[e.arrowTypeStart] * Math.cos(r) * (s >= 0 ? 1 : -1);
1767
- } else if (a === i.length - 1 && Object.hasOwn(O, e.arrowTypeEnd)) {
1768
- var _U1 = U(i[i.length - 1], i[i.length - 2]), r1 = _U1.angle, s1 = _U1.deltaX;
1769
- l = O[e.arrowTypeEnd] * Math.cos(r1) * (s1 >= 0 ? 1 : -1);
1770
- }
1771
- return Z(t).x + l;
1772
- },
1773
- y: function y(t, a, i) {
1774
- var l = 0;
1775
- if (a === 0 && Object.hasOwn(O, e.arrowTypeStart)) {
1776
- var _U = U(i[0], i[1]), r = _U.angle, s = _U.deltaY;
1777
- l = O[e.arrowTypeStart] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1);
1778
- } else if (a === i.length - 1 && Object.hasOwn(O, e.arrowTypeEnd)) {
1779
- var _U1 = U(i[i.length - 1], i[i.length - 2]), r1 = _U1.angle, s1 = _U1.deltaY;
1780
- l = O[e.arrowTypeEnd] * Math.abs(Math.sin(r1)) * (s1 >= 0 ? 1 : -1);
1781
- }
1782
- return Z(t).y + l;
1783
- }
1784
- };
1785
- }, ar = function(e, t, a, i, l) {
1786
- t.arrowTypeStart && at(e, "start", t.arrowTypeStart, a, i, l), t.arrowTypeEnd && at(e, "end", t.arrowTypeEnd, a, i, l);
1787
- }, er = {
1788
- arrow_cross: "cross",
1789
- arrow_point: "point",
1790
- arrow_barb: "barb",
1791
- arrow_circle: "circle",
1792
- aggregation: "aggregation",
1793
- extension: "extension",
1794
- composition: "composition",
1795
- dependency: "dependency",
1796
- lollipop: "lollipop"
1797
- }, at = function(e, t, a, i, l, r) {
1798
- var s = er[a];
1799
- if (!s) {
1800
- index.L.warn("Unknown arrow type: ".concat(a));
1801
- return;
1802
- }
1803
- var n = t === "start" ? "Start" : "End";
1804
- e.attr("marker-".concat(t), "url(".concat(i, "#").concat(l, "_").concat(r, "-").concat(s).concat(n, ")"));
1805
- };
1806
- var G = {}, T = {};
1807
- var dr = function() {
1808
- G = {}, T = {};
1809
- }, xr = function(e, t) {
1810
- var a = index.La(index.Vn().flowchart.htmlLabels), i = t.labelType === "markdown" ? createText03b82060.Ur(e, t.label, {
1811
- style: t.labelStyle,
1812
- useHtmlLabels: a,
1813
- addSvgBackground: true
1814
- }) : R(t.label, t.labelStyle), l = e.insert("g").attr("class", "edgeLabel"), r = l.insert("g").attr("class", "label");
1815
- r.node().appendChild(i);
1816
- var s = i.getBBox();
1817
- if (a) {
1818
- var c = i.children[0], o = index.bt(i);
1819
- s = c.getBoundingClientRect(), o.attr("width", s.width), o.attr("height", s.height);
1820
- }
1821
- r.attr("transform", "translate(" + -s.width / 2 + ", " + -s.height / 2 + ")"), G[t.id] = l, t.width = s.width, t.height = s.height;
1822
- var n;
1823
- if (t.startLabelLeft) {
1824
- var c1 = R(t.startLabelLeft, t.labelStyle), o1 = e.insert("g").attr("class", "edgeTerminals"), h = o1.insert("g").attr("class", "inner");
1825
- n = h.node().appendChild(c1);
1826
- var y = c1.getBBox();
1827
- h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startLeft = o1, z(n, t.startLabelLeft);
1828
- }
1829
- if (t.startLabelRight) {
1830
- var c2 = R(t.startLabelRight, t.labelStyle), o2 = e.insert("g").attr("class", "edgeTerminals"), h1 = o2.insert("g").attr("class", "inner");
1831
- n = o2.node().appendChild(c2), h1.node().appendChild(c2);
1832
- var y1 = c2.getBBox();
1833
- h1.attr("transform", "translate(" + -y1.width / 2 + ", " + -y1.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startRight = o2, z(n, t.startLabelRight);
1834
- }
1835
- if (t.endLabelLeft) {
1836
- var c3 = R(t.endLabelLeft, t.labelStyle), o3 = e.insert("g").attr("class", "edgeTerminals"), h2 = o3.insert("g").attr("class", "inner");
1837
- n = h2.node().appendChild(c3);
1838
- var y2 = c3.getBBox();
1839
- h2.attr("transform", "translate(" + -y2.width / 2 + ", " + -y2.height / 2 + ")"), o3.node().appendChild(c3), T[t.id] || (T[t.id] = {}), T[t.id].endLeft = o3, z(n, t.endLabelLeft);
1840
- }
1841
- if (t.endLabelRight) {
1842
- var c4 = R(t.endLabelRight, t.labelStyle), o4 = e.insert("g").attr("class", "edgeTerminals"), h3 = o4.insert("g").attr("class", "inner");
1843
- n = h3.node().appendChild(c4);
1844
- var y3 = c4.getBBox();
1845
- h3.attr("transform", "translate(" + -y3.width / 2 + ", " + -y3.height / 2 + ")"), o4.node().appendChild(c4), T[t.id] || (T[t.id] = {}), T[t.id].endRight = o4, z(n, t.endLabelRight);
1846
- }
1847
- return i;
1848
- };
1849
- function z(e, t) {
1850
- index.Vn().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1851
- }
1852
- var gr = function(e, t) {
1853
- index.L.debug("Moving label abc88 ", e.id, e.label, G[e.id], t);
1854
- var a = t.updatedPath ? t.updatedPath : t.originalPath;
1855
- var i = index.Vn(), _tr = tr(i), l = _tr.subGraphTitleTotalMargin;
1856
- if (e.label) {
1857
- var r = G[e.id];
1858
- var s = e.x, n = e.y;
1859
- if (a) {
1860
- var c = index.ei.calcLabelPosition(a);
1861
- index.L.debug("Moving label " + e.label + " from (", s, ",", n, ") to (", c.x, ",", c.y, ") abc88"), t.updatedPath && (s = c.x, n = c.y);
1862
- }
1863
- r.attr("transform", "translate(".concat(s, ", ").concat(n + l / 2, ")"));
1864
- }
1865
- if (e.startLabelLeft) {
1866
- var r1 = T[e.id].startLeft;
1867
- var s1 = e.x, n1 = e.y;
1868
- if (a) {
1869
- var c1 = index.ei.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1870
- s1 = c1.x, n1 = c1.y;
1871
- }
1872
- r1.attr("transform", "translate(".concat(s1, ", ").concat(n1, ")"));
1873
- }
1874
- if (e.startLabelRight) {
1875
- var r2 = T[e.id].startRight;
1876
- var s2 = e.x, n2 = e.y;
1877
- if (a) {
1878
- var c2 = index.ei.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right", a);
1879
- s2 = c2.x, n2 = c2.y;
1880
- }
1881
- r2.attr("transform", "translate(".concat(s2, ", ").concat(n2, ")"));
1882
- }
1883
- if (e.endLabelLeft) {
1884
- var r3 = T[e.id].endLeft;
1885
- var s3 = e.x, n3 = e.y;
1886
- if (a) {
1887
- var c3 = index.ei.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1888
- s3 = c3.x, n3 = c3.y;
1889
- }
1890
- r3.attr("transform", "translate(".concat(s3, ", ").concat(n3, ")"));
1891
- }
1892
- if (e.endLabelRight) {
1893
- var r4 = T[e.id].endRight;
1894
- var s4 = e.x, n4 = e.y;
1895
- if (a) {
1896
- var c4 = index.ei.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1897
- s4 = c4.x, n4 = c4.y;
1898
- }
1899
- r4.attr("transform", "translate(".concat(s4, ", ").concat(n4, ")"));
1900
- }
1901
- }, sr = function(e, t) {
1902
- var a = e.x, i = e.y, l = Math.abs(t.x - a), r = Math.abs(t.y - i), s = e.width / 2, n = e.height / 2;
1903
- return l >= s || r >= n;
1904
- }, ir = function(e, t, a) {
1905
- index.L.debug("intersection calc abc89:\n outsidePoint: ".concat(JSON.stringify(t), "\n insidePoint : ").concat(JSON.stringify(a), "\n node : x:").concat(e.x, " y:").concat(e.y, " w:").concat(e.width, " h:").concat(e.height));
1906
- var i = e.x, l = e.y, r = Math.abs(i - a.x), s = e.width / 2;
1907
- var n = a.x < t.x ? s - r : s + r;
1908
- var c = e.height / 2, o = Math.abs(t.y - a.y), h = Math.abs(t.x - a.x);
1909
- if (Math.abs(l - t.y) * s > Math.abs(i - t.x) * c) {
1910
- var y = a.y < t.y ? t.y - c - l : l - c - t.y;
1911
- n = h * y / o;
1912
- var p = {
1913
- x: a.x < t.x ? a.x + n : a.x - h + n,
1914
- y: a.y < t.y ? a.y + o - y : a.y - o + y
1915
- };
1916
- return n === 0 && (p.x = t.x, p.y = t.y), h === 0 && (p.x = t.x), o === 0 && (p.y = t.y), index.L.debug("abc89 topp/bott calc, Q ".concat(o, ", q ").concat(y, ", R ").concat(h, ", r ").concat(n), p), p;
1917
- } else {
1918
- a.x < t.x ? n = t.x - s - i : n = i - s - t.x;
1919
- var y1 = o * n / h, p1 = a.x < t.x ? a.x + h - n : a.x - h + n, f = a.y < t.y ? a.y + y1 : a.y - y1;
1920
- return index.L.debug("sides calc abc89, Q ".concat(o, ", q ").concat(y1, ", R ").concat(h, ", r ").concat(n), {
1921
- _x: p1,
1922
- _y: f
1923
- }), n === 0 && (p1 = t.x, f = t.y), h === 0 && (p1 = t.x), o === 0 && (f = t.y), {
1924
- x: p1,
1925
- y: f
1926
- };
1927
- }
1928
- }, et = function(e, t) {
1929
- index.L.debug("abc88 cutPathAtIntersect", e, t);
1930
- var a = [], i = e[0], l = false;
1931
- return e.forEach(function(r) {
1932
- if (!sr(t, r) && !l) {
1933
- var s = ir(t, i, r);
1934
- var n = false;
1935
- a.forEach(function(c) {
1936
- n = n || c.x === s.x && c.y === s.y;
1937
- }), a.some(function(c) {
1938
- return c.x === s.x && c.y === s.y;
1939
- }) || a.push(s), l = true;
1940
- } else i = r, l || a.push(r);
1941
- }), a;
1942
- }, ur = function ur(e, t, a, i, l, r, s) {
1943
- var n = a.points;
1944
- index.L.debug("abc88 InsertEdge: edge=", a, "e=", t);
1945
- var c = false;
1946
- var o = r.node(t.v);
1947
- var h = r.node(t.w);
1948
- h != null && h.intersect && o != null && o.intersect && (n = n.slice(1, a.points.length - 1), n.unshift(o.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), a.toCluster && (index.L.debug("to cluster abc88", i[a.toCluster]), n = et(a.points, i[a.toCluster].node), c = true), a.fromCluster && (index.L.debug("from cluster abc88", i[a.fromCluster]), n = et(n.reverse(), i[a.fromCluster].node).reverse(), c = true);
1949
- var y = n.filter(function(C) {
1950
- return !Number.isNaN(C.y);
1951
- });
1952
- var p = index.Pf;
1953
- a.curve && (l === "graph" || l === "flowchart") && (p = a.curve);
1954
- var _rr = rr(a), f = _rr.x, x = _rr.y, k = line24d93f1b.P().x(f).y(x).curve(p);
1955
- var d;
1956
- switch(a.thickness){
1957
- case "normal":
1958
- d = "edge-thickness-normal";
1959
- break;
1960
- case "thick":
1961
- d = "edge-thickness-thick";
1962
- break;
1963
- case "invisible":
1964
- d = "edge-thickness-thick";
1965
- break;
1966
- default:
1967
- d = "";
1968
- }
1969
- switch(a.pattern){
1970
- case "solid":
1971
- d += " edge-pattern-solid";
1972
- break;
1973
- case "dotted":
1974
- d += " edge-pattern-dotted";
1975
- break;
1976
- case "dashed":
1977
- d += " edge-pattern-dashed";
1978
- break;
1979
- }
1980
- var u = e.append("path").attr("d", k(y)).attr("id", a.id).attr("class", " " + d + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1981
- var S = "";
1982
- (index.Vn().flowchart.arrowMarkerAbsolute || index.Vn().state.arrowMarkerAbsolute) && (S = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, S = S.replace(/\(/g, "\\("), S = S.replace(/\)/g, "\\)")), ar(u, a, S, s, l);
1983
- var E = {};
1984
- return c && (E.updatedPath = n), E.originalPath = a.points, E;
1985
- };
1986
-
1987
- exports.Bt = Bt;
1988
- exports.M = M;
1989
- exports.R = R;
1990
- exports.ar = ar;
1991
- exports.dr = dr;
1992
- exports.fr = fr;
1993
- exports.gr = gr;
1994
- exports.hr = hr;
1995
- exports.m = m;
1996
- exports.or = or;
1997
- exports.pr = pr;
1998
- exports.rr = rr;
1999
- exports.tr = tr;
2000
- exports.ur = ur;
2001
- exports.xr = xr;
2002
- exports.yr = yr;