@digipair/skill-web-chatbot 0.89.0 → 0.91.0-0

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