@digipair/skill-web-chatbot 0.91.0-0 → 0.91.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/SAP-icons.cjs.js +2489 -0
  2. package/SAP-icons.cjs2.js +2489 -0
  3. package/SAP-icons.esm.js +2482 -0
  4. package/SAP-icons.esm2.js +2482 -0
  5. package/Tableau10-558cc280.cjs.js +9 -0
  6. package/Tableau10-558cc280.esm.js +7 -0
  7. package/arc-d1f6357e.cjs.js +88 -0
  8. package/arc-d1f6357e.esm.js +86 -0
  9. package/array-2ff2c7a6.cjs.js +7 -0
  10. package/array-2ff2c7a6.esm.js +5 -0
  11. package/blockDiagram-5dc23a45.cjs.js +2921 -0
  12. package/blockDiagram-5dc23a45.esm.js +2919 -0
  13. package/c4Diagram-1e775db3.cjs.js +4387 -0
  14. package/c4Diagram-1e775db3.esm.js +4385 -0
  15. package/channel-ebbc4130.cjs.js +9 -0
  16. package/channel-ebbc4130.esm.js +7 -0
  17. package/classDiagram-f52caa06.cjs.js +209 -0
  18. package/classDiagram-f52caa06.esm.js +207 -0
  19. package/classDiagram-v2-640c694e.cjs.js +401 -0
  20. package/classDiagram-v2-640c694e.esm.js +399 -0
  21. package/clone-afc2f047.cjs.js +10 -0
  22. package/clone-afc2f047.esm.js +8 -0
  23. package/createText-03b82060.cjs.js +2936 -0
  24. package/createText-03b82060.esm.js +2933 -0
  25. package/edges-16357fde.cjs.js +1998 -0
  26. package/edges-16357fde.esm.js +1981 -0
  27. package/erDiagram-c7ff1bec.cjs.js +1807 -0
  28. package/erDiagram-c7ff1bec.esm.js +1805 -0
  29. package/flowDb-9a89ea33.cjs.js +5542 -0
  30. package/flowDb-9a89ea33.esm.js +5538 -0
  31. package/flowDiagram-aadb13b0.cjs.js +1351 -0
  32. package/flowDiagram-aadb13b0.esm.js +1349 -0
  33. package/flowDiagram-v2-f2119625.cjs.js +31 -0
  34. package/flowDiagram-v2-f2119625.esm.js +29 -0
  35. package/flowchart-elk-definition-cf813a97.cjs.js +50257 -0
  36. package/flowchart-elk-definition-cf813a97.esm.js +50255 -0
  37. package/ganttDiagram-3c2fde2b.cjs.js +3710 -0
  38. package/ganttDiagram-3c2fde2b.esm.js +3708 -0
  39. package/gitGraphDiagram-c3a0619c.cjs.js +3820 -0
  40. package/gitGraphDiagram-c3a0619c.esm.js +3818 -0
  41. package/graph-0ee63739.cjs.js +961 -0
  42. package/graph-0ee63739.esm.js +938 -0
  43. package/index-bb6d8841.cjs.js +648 -0
  44. package/index-bb6d8841.esm.js +646 -0
  45. package/index.cjs.d.ts +1 -0
  46. package/index.cjs.js +17 -0
  47. package/index.cjs2.js +60723 -0
  48. package/index.esm.js +1 -0
  49. package/index.esm2.js +60574 -0
  50. package/infoDiagram-2f5c50c0.cjs.js +460 -0
  51. package/infoDiagram-2f5c50c0.esm.js +458 -0
  52. package/init-f9637058.cjs.js +17 -0
  53. package/init-f9637058.esm.js +15 -0
  54. package/journeyDiagram-14fe341a.cjs.js +1061 -0
  55. package/journeyDiagram-14fe341a.esm.js +1059 -0
  56. package/katex-d90b6d29.cjs.js +25690 -0
  57. package/katex-d90b6d29.esm.js +25688 -0
  58. package/layout-fd473db2.cjs.js +1626 -0
  59. package/layout-fd473db2.esm.js +1619 -0
  60. package/libs/engine/src/index.d.ts +2 -0
  61. package/libs/engine/src/lib/alias.interface.d.ts +9 -0
  62. package/libs/engine/src/lib/engine.d.ts +13 -0
  63. package/libs/engine/src/lib/pins-settings.interface.d.ts +15 -0
  64. package/libs/skill-web-chatbot/src/lib/chat.element.d.ts +28 -0
  65. package/libs/skill-web-chatbot/src/lib/common.data.d.ts +1 -0
  66. package/libs/skill-web-chatbot/src/lib/config.d.ts +9 -0
  67. package/libs/skill-web-chatbot/src/lib/digipair-full.data.d.ts +1 -0
  68. package/libs/skill-web-chatbot/src/lib/digipair-full.element.d.ts +36 -0
  69. package/libs/skill-web-chatbot/src/lib/digipair.data.d.ts +1 -0
  70. package/libs/skill-web-chatbot/src/lib/digipair.element.d.ts +44 -0
  71. package/libs/skill-web-chatbot/src/lib/inputs.element.d.ts +10 -0
  72. package/libs/skill-web-chatbot/src/lib/message.interface.d.ts +10 -0
  73. package/libs/skill-web-chatbot/src/lib/pins/chatbot.actions.d.ts +1 -0
  74. package/libs/skill-web-chatbot/src/lib/tools/css-selector.d.ts +1 -0
  75. package/line-24d93f1b.cjs.js +34 -0
  76. package/line-24d93f1b.esm.js +32 -0
  77. package/linear-9bcf74c4.cjs.js +537 -0
  78. package/linear-9bcf74c4.esm.js +531 -0
  79. package/mindmap-definition-9399c7e6.cjs.js +20489 -0
  80. package/mindmap-definition-9399c7e6.esm.js +20487 -0
  81. package/ordinal-5695958c.cjs.js +331 -0
  82. package/ordinal-5695958c.esm.js +329 -0
  83. package/package.json +7 -22
  84. package/path-428ebac9.cjs.js +317 -0
  85. package/path-428ebac9.esm.js +314 -0
  86. package/pieDiagram-828dae43.cjs.js +951 -0
  87. package/pieDiagram-828dae43.esm.js +949 -0
  88. package/quadrantDiagram-5fa00455.cjs.js +2410 -0
  89. package/quadrantDiagram-5fa00455.esm.js +2408 -0
  90. package/requirementDiagram-03163dc4.cjs.js +2267 -0
  91. package/requirementDiagram-03163dc4.esm.js +2265 -0
  92. package/sankeyDiagram-52ec8976.cjs.js +1848 -0
  93. package/sankeyDiagram-52ec8976.esm.js +1846 -0
  94. package/sequenceDiagram-b517d154.cjs.js +5949 -0
  95. package/sequenceDiagram-b517d154.esm.js +5947 -0
  96. package/stateDiagram-fca82b5b.cjs.js +283 -0
  97. package/stateDiagram-fca82b5b.esm.js +281 -0
  98. package/stateDiagram-v2-ed04200a.cjs.js +373 -0
  99. package/stateDiagram-v2-ed04200a.esm.js +371 -0
  100. package/styles-11e81fdd.cjs.js +3944 -0
  101. package/styles-11e81fdd.esm.js +3940 -0
  102. package/styles-cacbff60.cjs.js +2120 -0
  103. package/styles-cacbff60.esm.js +2111 -0
  104. package/styles-e75131e4.cjs.js +671 -0
  105. package/styles-e75131e4.esm.js +661 -0
  106. package/svgDrawCommon-ecc5f780.cjs.js +68 -0
  107. package/svgDrawCommon-ecc5f780.esm.js +60 -0
  108. package/timeline-definition-4ee9bff4.cjs.js +1161 -0
  109. package/timeline-definition-4ee9bff4.esm.js +1159 -0
  110. package/xychartDiagram-e5e6b652.cjs.js +3150 -0
  111. package/xychartDiagram-e5e6b652.esm.js +3148 -0
  112. package/.swcrc +0 -28
  113. package/README.md +0 -7
  114. package/eslint.config.mjs +0 -22
  115. package/rollup.config.cjs +0 -28
  116. package/src/digipair__engine.d.ts +0 -2
  117. package/src/handlebars.d.ts +0 -1
  118. package/src/index.html +0 -18
  119. package/src/lib/chat.element.ts +0 -603
  120. package/src/lib/common.data.ts +0 -1
  121. package/src/lib/config.ts +0 -30
  122. package/src/lib/digipair-full.data.ts +0 -101
  123. package/src/lib/digipair-full.element.ts +0 -358
  124. package/src/lib/digipair.data.ts +0 -103
  125. package/src/lib/digipair.element.ts +0 -446
  126. package/src/lib/inputs.element.ts +0 -46
  127. package/src/lib/mermaid.d.ts +0 -1
  128. package/src/lib/message.interface.ts +0 -10
  129. package/src/lib/pins/chatbot.actions.ts +0 -32
  130. package/src/lib/tools/css-selector.ts +0 -12
  131. package/tsconfig.json +0 -13
  132. package/tsconfig.lib.json +0 -19
  133. /package/{src/index.d.ts → index.d.ts} +0 -0
  134. /package/{src/index.ts → libs/skill-web-chatbot/src/index.d.ts} +0 -0
  135. /package/{src/schema.fr.json → schema.fr.json} +0 -0
  136. /package/{src/schema.json → schema.json} +0 -0
@@ -0,0 +1,283 @@
1
+ 'use strict';
2
+
3
+ var stylesCacbff60 = require('./styles-cacbff60.cjs.js');
4
+ var index = require('./index.cjs2.js');
5
+ var graph0ee63739 = require('./graph-0ee63739.cjs.js');
6
+ var layoutFd473db2 = require('./layout-fd473db2.cjs.js');
7
+ var line24d93f1b = require('./line-24d93f1b.cjs.js');
8
+ require('./array-2ff2c7a6.cjs.js');
9
+ require('./path-428ebac9.cjs.js');
10
+
11
+ var j = function(e) {
12
+ return e.append("circle").attr("class", "start-state").attr("r", index.Vn().state.sizeUnit).attr("cx", index.Vn().state.padding + index.Vn().state.sizeUnit).attr("cy", index.Vn().state.padding + index.Vn().state.sizeUnit);
13
+ }, q = function(e) {
14
+ return e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", index.Vn().state.textHeight).attr("class", "divider").attr("x2", index.Vn().state.textHeight * 2).attr("y1", 0).attr("y2", 0);
15
+ }, Z = function(e, i) {
16
+ var o = e.append("text").attr("x", 2 * index.Vn().state.padding).attr("y", index.Vn().state.textHeight + 2 * index.Vn().state.padding).attr("font-size", index.Vn().state.fontSize).attr("class", "state-title").text(i.id), d = o.node().getBBox();
17
+ return e.insert("rect", ":first-child").attr("x", index.Vn().state.padding).attr("y", index.Vn().state.padding).attr("width", d.width + 2 * index.Vn().state.padding).attr("height", d.height + 2 * index.Vn().state.padding).attr("rx", index.Vn().state.radius), o;
18
+ }, K = function(e, i) {
19
+ var o = function o(l, m, w) {
20
+ var k = l.append("tspan").attr("x", 2 * index.Vn().state.padding).text(m);
21
+ w || k.attr("dy", index.Vn().state.textHeight);
22
+ }, s = e.append("text").attr("x", 2 * index.Vn().state.padding).attr("y", index.Vn().state.textHeight + 1.3 * index.Vn().state.padding).attr("font-size", index.Vn().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), g = s.height, p = e.append("text").attr("x", index.Vn().state.padding).attr("y", g + index.Vn().state.padding * 0.4 + index.Vn().state.dividerMargin + index.Vn().state.textHeight).attr("class", "state-description");
23
+ var a = !0, r = !0;
24
+ i.descriptions.forEach(function(l) {
25
+ a || (o(p, l, r), r = !1), a = !1;
26
+ });
27
+ var y = e.append("line").attr("x1", index.Vn().state.padding).attr("y1", index.Vn().state.padding + g + index.Vn().state.dividerMargin / 2).attr("y2", index.Vn().state.padding + g + index.Vn().state.dividerMargin / 2).attr("class", "descr-divider"), x = p.node().getBBox(), c = Math.max(x.width, s.width);
28
+ return y.attr("x2", c + 3 * index.Vn().state.padding), e.insert("rect", ":first-child").attr("x", index.Vn().state.padding).attr("y", index.Vn().state.padding).attr("width", c + 2 * index.Vn().state.padding).attr("height", x.height + g + 2 * index.Vn().state.padding).attr("rx", index.Vn().state.radius), e;
29
+ }, Q = function(e, i, o) {
30
+ var d = index.Vn().state.padding, s = 2 * index.Vn().state.padding, g = e.node().getBBox(), p = g.width, a = g.x, r = e.append("text").attr("x", 0).attr("y", index.Vn().state.titleShift).attr("font-size", index.Vn().state.fontSize).attr("class", "state-title").text(i.id), x = r.node().getBBox().width + s;
31
+ var c = Math.max(x, p);
32
+ c === p && (c = c + s);
33
+ var l;
34
+ var m = e.node().getBBox();
35
+ i.doc, l = a - d, x > p && (l = (p - c) / 2 + d), Math.abs(a - m.x) < d && x > p && (l = a - (x - p) / 2);
36
+ var w = 1 - index.Vn().state.textHeight;
37
+ return e.insert("rect", ":first-child").attr("x", l).attr("y", w).attr("class", o ? "alt-composit" : "composit").attr("width", c).attr("height", m.height + index.Vn().state.textHeight + index.Vn().state.titleShift + 1).attr("rx", "0"), r.attr("x", l + d), x <= p && r.attr("x", a + (c - s) / 2 - x / 2 + d), e.insert("rect", ":first-child").attr("x", l).attr("y", index.Vn().state.titleShift - index.Vn().state.textHeight - index.Vn().state.padding).attr("width", c).attr("height", index.Vn().state.textHeight * 3).attr("rx", index.Vn().state.radius), e.insert("rect", ":first-child").attr("x", l).attr("y", index.Vn().state.titleShift - index.Vn().state.textHeight - index.Vn().state.padding).attr("width", c).attr("height", m.height + 3 + 2 * index.Vn().state.textHeight).attr("rx", index.Vn().state.radius), e;
38
+ }, V = function(e) {
39
+ return e.append("circle").attr("class", "end-state-outer").attr("r", index.Vn().state.sizeUnit + index.Vn().state.miniPadding).attr("cx", index.Vn().state.padding + index.Vn().state.sizeUnit + index.Vn().state.miniPadding).attr("cy", index.Vn().state.padding + index.Vn().state.sizeUnit + index.Vn().state.miniPadding), e.append("circle").attr("class", "end-state-inner").attr("r", index.Vn().state.sizeUnit).attr("cx", index.Vn().state.padding + index.Vn().state.sizeUnit + 2).attr("cy", index.Vn().state.padding + index.Vn().state.sizeUnit + 2);
40
+ }, D = function(e, i) {
41
+ var o = index.Vn().state.forkWidth, d = index.Vn().state.forkHeight;
42
+ if (i.parentId) {
43
+ var s = o;
44
+ o = d, d = s;
45
+ }
46
+ return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", o).attr("height", d).attr("x", index.Vn().state.padding).attr("y", index.Vn().state.padding);
47
+ }, tt = function(e, i, o, d) {
48
+ var s = 0;
49
+ var g = d.append("text");
50
+ g.style("text-anchor", "start"), g.attr("class", "noteText");
51
+ var p = e.replace(/\r\n/g, "<br/>");
52
+ p = p.replace(/\n/g, "<br/>");
53
+ var a = p.split(index.$n.lineBreakRegex);
54
+ var r = 1.25 * index.Vn().state.noteMargin;
55
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
56
+ try {
57
+ for(var _iterator = a[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
58
+ var y = _step.value;
59
+ var x = y.trim();
60
+ if (x.length > 0) {
61
+ var c = g.append("tspan");
62
+ if (c.text(x), r === 0) {
63
+ var l = c.node().getBBox();
64
+ r += l.height;
65
+ }
66
+ s += r, c.attr("x", i + index.Vn().state.noteMargin), c.attr("y", o + s + 1.25 * index.Vn().state.noteMargin);
67
+ }
68
+ }
69
+ } catch (err) {
70
+ _didIteratorError = true;
71
+ _iteratorError = err;
72
+ } finally{
73
+ try {
74
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
75
+ _iterator.return();
76
+ }
77
+ } finally{
78
+ if (_didIteratorError) {
79
+ throw _iteratorError;
80
+ }
81
+ }
82
+ }
83
+ return {
84
+ textWidth: g.node().getBBox().width,
85
+ textHeight: s
86
+ };
87
+ }, et = function(e, i) {
88
+ i.attr("class", "state-note");
89
+ var o = i.append("rect").attr("x", 0).attr("y", index.Vn().state.padding), d = i.append("g"), _tt = tt(e, 0, 0, d), s = _tt.textWidth, g = _tt.textHeight;
90
+ return o.attr("height", g + 2 * index.Vn().state.noteMargin), o.attr("width", s + index.Vn().state.noteMargin * 2), o;
91
+ }, A = function A(e, i) {
92
+ var o = i.id, d = {
93
+ id: o,
94
+ label: i.id,
95
+ width: 0,
96
+ height: 0
97
+ }, s = e.append("g").attr("id", o).attr("class", "stateGroup");
98
+ i.type === "start" && j(s), i.type === "end" && V(s), (i.type === "fork" || i.type === "join") && D(s, i), i.type === "note" && et(i.note.text, s), i.type === "divider" && q(s), i.type === "default" && i.descriptions.length === 0 && Z(s, i), i.type === "default" && i.descriptions.length > 0 && K(s, i);
99
+ var g = s.node().getBBox();
100
+ return d.width = g.width + 2 * index.Vn().state.padding, d.height = g.height + 2 * index.Vn().state.padding, d;
101
+ };
102
+ var G = 0;
103
+ var at = function at(e, i, o) {
104
+ var d = function d(r) {
105
+ switch(r){
106
+ case stylesCacbff60.Ae.relationType.AGGREGATION:
107
+ return "aggregation";
108
+ case stylesCacbff60.Ae.relationType.EXTENSION:
109
+ return "extension";
110
+ case stylesCacbff60.Ae.relationType.COMPOSITION:
111
+ return "composition";
112
+ case stylesCacbff60.Ae.relationType.DEPENDENCY:
113
+ return "dependency";
114
+ }
115
+ };
116
+ i.points = i.points.filter(function(r) {
117
+ return !Number.isNaN(r.y);
118
+ });
119
+ var s = i.points, g = line24d93f1b.P().x(function(r) {
120
+ return r.x;
121
+ }).y(function(r) {
122
+ return r.y;
123
+ }).curve(index.Pf), p = e.append("path").attr("d", g(s)).attr("id", "edge" + G).attr("class", "transition");
124
+ var a = "";
125
+ if (index.Vn().state.arrowMarkerAbsolute && (a = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, a = a.replace(/\(/g, "\\("), a = a.replace(/\)/g, "\\)")), p.attr("marker-end", "url(" + a + "#" + d(stylesCacbff60.Ae.relationType.DEPENDENCY) + "End)"), o.title !== void 0) {
126
+ var r = e.append("g").attr("class", "stateLabel"), _F_calcLabelPosition = index.ei.calcLabelPosition(i.points), y = _F_calcLabelPosition.x, x = _F_calcLabelPosition.y, c = index.$n.getRows(o.title);
127
+ var l = 0;
128
+ var m = [];
129
+ var w = 0, k = 0;
130
+ for(var u = 0; u <= c.length; u++){
131
+ var h = r.append("text").attr("text-anchor", "middle").text(c[u]).attr("x", y).attr("y", x + l), f = h.node().getBBox();
132
+ w = Math.max(w, f.width), k = Math.min(k, f.x), index.L.info(f.x, y, x + l), l === 0 && (l = h.node().getBBox().height, index.L.info("Title height", l, x)), m.push(h);
133
+ }
134
+ var E = l * c.length;
135
+ if (c.length > 1) {
136
+ var u1 = (c.length - 1) * l * 0.5;
137
+ m.forEach(function(h, f) {
138
+ return h.attr("y", x + f * l - u1);
139
+ }), E = l * c.length;
140
+ }
141
+ var n = r.node().getBBox();
142
+ r.insert("rect", ":first-child").attr("class", "box").attr("x", y - w / 2 - index.Vn().state.padding / 2).attr("y", x - E / 2 - index.Vn().state.padding / 2 - 3.5).attr("width", w + index.Vn().state.padding).attr("height", E + index.Vn().state.padding), index.L.info(n);
143
+ }
144
+ G++;
145
+ };
146
+ var B;
147
+ var z = {}, it = function it() {}, nt = function nt(e) {
148
+ e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
149
+ }, st = function st(e, i, o, d) {
150
+ B = index.Vn().state;
151
+ var s = index.Vn().securityLevel;
152
+ var g;
153
+ s === "sandbox" && (g = index.bt("#i" + i));
154
+ var p = s === "sandbox" ? index.bt(g.nodes()[0].contentDocument.body) : index.bt("body"), a = s === "sandbox" ? g.nodes()[0].contentDocument : document;
155
+ index.L.debug("Rendering diagram " + e);
156
+ var r = p.select("[id='".concat(i, "']"));
157
+ nt(r);
158
+ var y = d.db.getRootDoc();
159
+ W(y, r, void 0, !1, p, a, d);
160
+ var x = B.padding, c = r.node().getBBox(), l = c.width + x * 2, m = c.height + x * 2, w = l * 1.75;
161
+ index.Ol(r, m, w, B.useMaxWidth), r.attr("viewBox", "".concat(c.x - B.padding, " ").concat(c.y - B.padding, " ") + l + " " + m);
162
+ }, rt = function(e) {
163
+ return e ? e.length * B.fontSizeFactor : 1;
164
+ }, W = function(e, i, o, d, s, g, p) {
165
+ var a = new graph0ee63739.Ze({
166
+ compound: !0,
167
+ multigraph: !0
168
+ });
169
+ var r, y = !0;
170
+ for(r = 0; r < e.length; r++)if (e[r].stmt === "relation") {
171
+ y = !1;
172
+ break;
173
+ }
174
+ o ? a.setGraph({
175
+ rankdir: "LR",
176
+ multigraph: !0,
177
+ compound: !0,
178
+ // acyclicer: 'greedy',
179
+ ranker: "tight-tree",
180
+ ranksep: y ? 1 : B.edgeLengthFactor,
181
+ nodeSep: y ? 1 : 50,
182
+ isMultiGraph: !0
183
+ }) : a.setGraph({
184
+ rankdir: "TB",
185
+ multigraph: !0,
186
+ compound: !0,
187
+ // isCompound: true,
188
+ // acyclicer: 'greedy',
189
+ // ranker: 'longest-path'
190
+ ranksep: y ? 1 : B.edgeLengthFactor,
191
+ nodeSep: y ? 1 : 50,
192
+ ranker: "tight-tree",
193
+ // ranker: 'network-simplex'
194
+ isMultiGraph: !0
195
+ }), a.setDefaultEdgeLabel(function() {
196
+ return {};
197
+ }), p.db.extract(e);
198
+ var x = p.db.getStates(), c = p.db.getRelations(), l = Object.keys(x);
199
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
200
+ try {
201
+ for(var _iterator = l[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
202
+ var n = _step.value;
203
+ var u = x[n];
204
+ o && (u.parentId = o);
205
+ var h = void 0;
206
+ if (u.doc) {
207
+ var f = i.append("g").attr("id", u.id).attr("class", "stateGroup");
208
+ h = W(u.doc, f, u.id, !d, s, g, p);
209
+ {
210
+ f = Q(f, u, d);
211
+ var S = f.node().getBBox();
212
+ h.width = S.width, h.height = S.height + B.padding / 2, z[u.id] = {
213
+ y: B.compositTitleSize
214
+ };
215
+ }
216
+ } else h = A(i, u);
217
+ if (u.note) {
218
+ var f1 = {
219
+ descriptions: [],
220
+ id: u.id + "-note",
221
+ note: u.note,
222
+ type: "note"
223
+ }, S1 = A(i, f1);
224
+ u.note.position === "left of" ? (a.setNode(h.id + "-note", S1), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", S1)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
225
+ } else a.setNode(h.id, h);
226
+ }
227
+ } catch (err) {
228
+ _didIteratorError = true;
229
+ _iteratorError = err;
230
+ } finally{
231
+ try {
232
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
233
+ _iterator.return();
234
+ }
235
+ } finally{
236
+ if (_didIteratorError) {
237
+ throw _iteratorError;
238
+ }
239
+ }
240
+ }
241
+ index.L.debug("Count=", a.nodeCount(), a);
242
+ var m = 0;
243
+ c.forEach(function(n) {
244
+ m++, index.L.debug("Setting edge", n), a.setEdge(n.id1, n.id2, {
245
+ relation: n,
246
+ width: rt(n.title),
247
+ height: B.labelHeight * index.$n.getRows(n.title).length,
248
+ labelpos: "c"
249
+ }, "id" + m);
250
+ }), layoutFd473db2.Yt(a), index.L.debug("Graph after layout", a.nodes());
251
+ var w = i.node();
252
+ a.nodes().forEach(function(n) {
253
+ n !== void 0 && a.node(n) !== void 0 ? (index.L.warn("Node " + n + ": " + JSON.stringify(a.node(n))), s.select("#" + w.id + " #" + n).attr("transform", "translate(" + (a.node(n).x - a.node(n).width / 2) + "," + (a.node(n).y + (z[n] ? z[n].y : 0) - a.node(n).height / 2) + " )"), s.select("#" + w.id + " #" + n).attr("data-x-shift", a.node(n).x - a.node(n).width / 2), g.querySelectorAll("#" + w.id + " #" + n + " .divider").forEach(function(h) {
254
+ var f = h.parentElement;
255
+ var S = 0, M = 0;
256
+ f && (f.parentElement && (S = f.parentElement.getBBox().width), M = parseInt(f.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", S - M - 8);
257
+ })) : index.L.debug("No Node " + n + ": " + JSON.stringify(a.node(n)));
258
+ });
259
+ var k = w.getBBox();
260
+ a.edges().forEach(function(n) {
261
+ n !== void 0 && a.edge(n) !== void 0 && (index.L.debug("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(a.edge(n))), at(i, a.edge(n), a.edge(n).relation));
262
+ }), k = w.getBBox();
263
+ var E = {
264
+ id: o || "root",
265
+ label: o || "root",
266
+ width: 0,
267
+ height: 0
268
+ };
269
+ return E.width = k.width + 2 * B.padding, E.height = k.height + 2 * B.padding, index.L.debug("Doc rendered", E, a), E;
270
+ }, ot = {
271
+ setConf: it,
272
+ draw: st
273
+ }, ut = {
274
+ parser: stylesCacbff60.De,
275
+ db: stylesCacbff60.Ae,
276
+ renderer: ot,
277
+ styles: stylesCacbff60.Le,
278
+ init: function(e) {
279
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute, stylesCacbff60.Ae.clear();
280
+ }
281
+ };
282
+
283
+ exports.diagram = ut;
@@ -0,0 +1,281 @@
1
+ import { D as De, A as Ae, L as Le } from './styles-cacbff60.esm.js';
2
+ import { V as Vn, b as bt, c as L, O as Ol, $ as $n, ao as Pf, i as ei } from './index.esm2.js';
3
+ import { Z as Ze } from './graph-0ee63739.esm.js';
4
+ import { Y as Yt } from './layout-fd473db2.esm.js';
5
+ import { P } from './line-24d93f1b.esm.js';
6
+ import './array-2ff2c7a6.esm.js';
7
+ import './path-428ebac9.esm.js';
8
+
9
+ var j = function(e) {
10
+ return e.append("circle").attr("class", "start-state").attr("r", Vn().state.sizeUnit).attr("cx", Vn().state.padding + Vn().state.sizeUnit).attr("cy", Vn().state.padding + Vn().state.sizeUnit);
11
+ }, q = function(e) {
12
+ return e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", Vn().state.textHeight).attr("class", "divider").attr("x2", Vn().state.textHeight * 2).attr("y1", 0).attr("y2", 0);
13
+ }, Z = function(e, i) {
14
+ var o = e.append("text").attr("x", 2 * Vn().state.padding).attr("y", Vn().state.textHeight + 2 * Vn().state.padding).attr("font-size", Vn().state.fontSize).attr("class", "state-title").text(i.id), d = o.node().getBBox();
15
+ return e.insert("rect", ":first-child").attr("x", Vn().state.padding).attr("y", Vn().state.padding).attr("width", d.width + 2 * Vn().state.padding).attr("height", d.height + 2 * Vn().state.padding).attr("rx", Vn().state.radius), o;
16
+ }, K = function(e, i) {
17
+ var o = function o(l, m, w) {
18
+ var k = l.append("tspan").attr("x", 2 * Vn().state.padding).text(m);
19
+ w || k.attr("dy", Vn().state.textHeight);
20
+ }, s = e.append("text").attr("x", 2 * Vn().state.padding).attr("y", Vn().state.textHeight + 1.3 * Vn().state.padding).attr("font-size", Vn().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), g = s.height, p = e.append("text").attr("x", Vn().state.padding).attr("y", g + Vn().state.padding * 0.4 + Vn().state.dividerMargin + Vn().state.textHeight).attr("class", "state-description");
21
+ var a = !0, r = !0;
22
+ i.descriptions.forEach(function(l) {
23
+ a || (o(p, l, r), r = !1), a = !1;
24
+ });
25
+ var y = e.append("line").attr("x1", Vn().state.padding).attr("y1", Vn().state.padding + g + Vn().state.dividerMargin / 2).attr("y2", Vn().state.padding + g + Vn().state.dividerMargin / 2).attr("class", "descr-divider"), x = p.node().getBBox(), c = Math.max(x.width, s.width);
26
+ return y.attr("x2", c + 3 * Vn().state.padding), e.insert("rect", ":first-child").attr("x", Vn().state.padding).attr("y", Vn().state.padding).attr("width", c + 2 * Vn().state.padding).attr("height", x.height + g + 2 * Vn().state.padding).attr("rx", Vn().state.radius), e;
27
+ }, Q = function(e, i, o) {
28
+ var d = Vn().state.padding, s = 2 * Vn().state.padding, g = e.node().getBBox(), p = g.width, a = g.x, r = e.append("text").attr("x", 0).attr("y", Vn().state.titleShift).attr("font-size", Vn().state.fontSize).attr("class", "state-title").text(i.id), x = r.node().getBBox().width + s;
29
+ var c = Math.max(x, p);
30
+ c === p && (c = c + s);
31
+ var l;
32
+ var m = e.node().getBBox();
33
+ i.doc, l = a - d, x > p && (l = (p - c) / 2 + d), Math.abs(a - m.x) < d && x > p && (l = a - (x - p) / 2);
34
+ var w = 1 - Vn().state.textHeight;
35
+ return e.insert("rect", ":first-child").attr("x", l).attr("y", w).attr("class", o ? "alt-composit" : "composit").attr("width", c).attr("height", m.height + Vn().state.textHeight + Vn().state.titleShift + 1).attr("rx", "0"), r.attr("x", l + d), x <= p && r.attr("x", a + (c - s) / 2 - x / 2 + d), e.insert("rect", ":first-child").attr("x", l).attr("y", Vn().state.titleShift - Vn().state.textHeight - Vn().state.padding).attr("width", c).attr("height", Vn().state.textHeight * 3).attr("rx", Vn().state.radius), e.insert("rect", ":first-child").attr("x", l).attr("y", Vn().state.titleShift - Vn().state.textHeight - Vn().state.padding).attr("width", c).attr("height", m.height + 3 + 2 * Vn().state.textHeight).attr("rx", Vn().state.radius), e;
36
+ }, V = function(e) {
37
+ return e.append("circle").attr("class", "end-state-outer").attr("r", Vn().state.sizeUnit + Vn().state.miniPadding).attr("cx", Vn().state.padding + Vn().state.sizeUnit + Vn().state.miniPadding).attr("cy", Vn().state.padding + Vn().state.sizeUnit + Vn().state.miniPadding), e.append("circle").attr("class", "end-state-inner").attr("r", Vn().state.sizeUnit).attr("cx", Vn().state.padding + Vn().state.sizeUnit + 2).attr("cy", Vn().state.padding + Vn().state.sizeUnit + 2);
38
+ }, D = function(e, i) {
39
+ var o = Vn().state.forkWidth, d = Vn().state.forkHeight;
40
+ if (i.parentId) {
41
+ var s = o;
42
+ o = d, d = s;
43
+ }
44
+ return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", o).attr("height", d).attr("x", Vn().state.padding).attr("y", Vn().state.padding);
45
+ }, tt = function(e, i, o, d) {
46
+ var s = 0;
47
+ var g = d.append("text");
48
+ g.style("text-anchor", "start"), g.attr("class", "noteText");
49
+ var p = e.replace(/\r\n/g, "<br/>");
50
+ p = p.replace(/\n/g, "<br/>");
51
+ var a = p.split($n.lineBreakRegex);
52
+ var r = 1.25 * Vn().state.noteMargin;
53
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
54
+ try {
55
+ for(var _iterator = a[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
56
+ var y = _step.value;
57
+ var x = y.trim();
58
+ if (x.length > 0) {
59
+ var c = g.append("tspan");
60
+ if (c.text(x), r === 0) {
61
+ var l = c.node().getBBox();
62
+ r += l.height;
63
+ }
64
+ s += r, c.attr("x", i + Vn().state.noteMargin), c.attr("y", o + s + 1.25 * Vn().state.noteMargin);
65
+ }
66
+ }
67
+ } catch (err) {
68
+ _didIteratorError = true;
69
+ _iteratorError = err;
70
+ } finally{
71
+ try {
72
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
73
+ _iterator.return();
74
+ }
75
+ } finally{
76
+ if (_didIteratorError) {
77
+ throw _iteratorError;
78
+ }
79
+ }
80
+ }
81
+ return {
82
+ textWidth: g.node().getBBox().width,
83
+ textHeight: s
84
+ };
85
+ }, et = function(e, i) {
86
+ i.attr("class", "state-note");
87
+ var o = i.append("rect").attr("x", 0).attr("y", Vn().state.padding), d = i.append("g"), _tt = tt(e, 0, 0, d), s = _tt.textWidth, g = _tt.textHeight;
88
+ return o.attr("height", g + 2 * Vn().state.noteMargin), o.attr("width", s + Vn().state.noteMargin * 2), o;
89
+ }, A = function A(e, i) {
90
+ var o = i.id, d = {
91
+ id: o,
92
+ label: i.id,
93
+ width: 0,
94
+ height: 0
95
+ }, s = e.append("g").attr("id", o).attr("class", "stateGroup");
96
+ i.type === "start" && j(s), i.type === "end" && V(s), (i.type === "fork" || i.type === "join") && D(s, i), i.type === "note" && et(i.note.text, s), i.type === "divider" && q(s), i.type === "default" && i.descriptions.length === 0 && Z(s, i), i.type === "default" && i.descriptions.length > 0 && K(s, i);
97
+ var g = s.node().getBBox();
98
+ return d.width = g.width + 2 * Vn().state.padding, d.height = g.height + 2 * Vn().state.padding, d;
99
+ };
100
+ var G = 0;
101
+ var at = function at(e, i, o) {
102
+ var d = function d(r) {
103
+ switch(r){
104
+ case Ae.relationType.AGGREGATION:
105
+ return "aggregation";
106
+ case Ae.relationType.EXTENSION:
107
+ return "extension";
108
+ case Ae.relationType.COMPOSITION:
109
+ return "composition";
110
+ case Ae.relationType.DEPENDENCY:
111
+ return "dependency";
112
+ }
113
+ };
114
+ i.points = i.points.filter(function(r) {
115
+ return !Number.isNaN(r.y);
116
+ });
117
+ var s = i.points, g = P().x(function(r) {
118
+ return r.x;
119
+ }).y(function(r) {
120
+ return r.y;
121
+ }).curve(Pf), p = e.append("path").attr("d", g(s)).attr("id", "edge" + G).attr("class", "transition");
122
+ var a = "";
123
+ if (Vn().state.arrowMarkerAbsolute && (a = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, a = a.replace(/\(/g, "\\("), a = a.replace(/\)/g, "\\)")), p.attr("marker-end", "url(" + a + "#" + d(Ae.relationType.DEPENDENCY) + "End)"), o.title !== void 0) {
124
+ var r = e.append("g").attr("class", "stateLabel"), _F_calcLabelPosition = ei.calcLabelPosition(i.points), y = _F_calcLabelPosition.x, x = _F_calcLabelPosition.y, c = $n.getRows(o.title);
125
+ var l = 0;
126
+ var m = [];
127
+ var w = 0, k = 0;
128
+ for(var u = 0; u <= c.length; u++){
129
+ var h = r.append("text").attr("text-anchor", "middle").text(c[u]).attr("x", y).attr("y", x + l), f = h.node().getBBox();
130
+ w = Math.max(w, f.width), k = Math.min(k, f.x), L.info(f.x, y, x + l), l === 0 && (l = h.node().getBBox().height, L.info("Title height", l, x)), m.push(h);
131
+ }
132
+ var E = l * c.length;
133
+ if (c.length > 1) {
134
+ var u1 = (c.length - 1) * l * 0.5;
135
+ m.forEach(function(h, f) {
136
+ return h.attr("y", x + f * l - u1);
137
+ }), E = l * c.length;
138
+ }
139
+ var n = r.node().getBBox();
140
+ r.insert("rect", ":first-child").attr("class", "box").attr("x", y - w / 2 - Vn().state.padding / 2).attr("y", x - E / 2 - Vn().state.padding / 2 - 3.5).attr("width", w + Vn().state.padding).attr("height", E + Vn().state.padding), L.info(n);
141
+ }
142
+ G++;
143
+ };
144
+ var B;
145
+ var z = {}, it = function it() {}, nt = function nt(e) {
146
+ e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
147
+ }, st = function st(e, i, o, d) {
148
+ B = Vn().state;
149
+ var s = Vn().securityLevel;
150
+ var g;
151
+ s === "sandbox" && (g = bt("#i" + i));
152
+ var p = s === "sandbox" ? bt(g.nodes()[0].contentDocument.body) : bt("body"), a = s === "sandbox" ? g.nodes()[0].contentDocument : document;
153
+ L.debug("Rendering diagram " + e);
154
+ var r = p.select("[id='".concat(i, "']"));
155
+ nt(r);
156
+ var y = d.db.getRootDoc();
157
+ W(y, r, void 0, !1, p, a, d);
158
+ var x = B.padding, c = r.node().getBBox(), l = c.width + x * 2, m = c.height + x * 2, w = l * 1.75;
159
+ Ol(r, m, w, B.useMaxWidth), r.attr("viewBox", "".concat(c.x - B.padding, " ").concat(c.y - B.padding, " ") + l + " " + m);
160
+ }, rt = function(e) {
161
+ return e ? e.length * B.fontSizeFactor : 1;
162
+ }, W = function(e, i, o, d, s, g, p) {
163
+ var a = new Ze({
164
+ compound: !0,
165
+ multigraph: !0
166
+ });
167
+ var r, y = !0;
168
+ for(r = 0; r < e.length; r++)if (e[r].stmt === "relation") {
169
+ y = !1;
170
+ break;
171
+ }
172
+ o ? a.setGraph({
173
+ rankdir: "LR",
174
+ multigraph: !0,
175
+ compound: !0,
176
+ // acyclicer: 'greedy',
177
+ ranker: "tight-tree",
178
+ ranksep: y ? 1 : B.edgeLengthFactor,
179
+ nodeSep: y ? 1 : 50,
180
+ isMultiGraph: !0
181
+ }) : a.setGraph({
182
+ rankdir: "TB",
183
+ multigraph: !0,
184
+ compound: !0,
185
+ // isCompound: true,
186
+ // acyclicer: 'greedy',
187
+ // ranker: 'longest-path'
188
+ ranksep: y ? 1 : B.edgeLengthFactor,
189
+ nodeSep: y ? 1 : 50,
190
+ ranker: "tight-tree",
191
+ // ranker: 'network-simplex'
192
+ isMultiGraph: !0
193
+ }), a.setDefaultEdgeLabel(function() {
194
+ return {};
195
+ }), p.db.extract(e);
196
+ var x = p.db.getStates(), c = p.db.getRelations(), l = Object.keys(x);
197
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
198
+ try {
199
+ for(var _iterator = l[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
200
+ var n = _step.value;
201
+ var u = x[n];
202
+ o && (u.parentId = o);
203
+ var h = void 0;
204
+ if (u.doc) {
205
+ var f = i.append("g").attr("id", u.id).attr("class", "stateGroup");
206
+ h = W(u.doc, f, u.id, !d, s, g, p);
207
+ {
208
+ f = Q(f, u, d);
209
+ var S = f.node().getBBox();
210
+ h.width = S.width, h.height = S.height + B.padding / 2, z[u.id] = {
211
+ y: B.compositTitleSize
212
+ };
213
+ }
214
+ } else h = A(i, u);
215
+ if (u.note) {
216
+ var f1 = {
217
+ descriptions: [],
218
+ id: u.id + "-note",
219
+ note: u.note,
220
+ type: "note"
221
+ }, S1 = A(i, f1);
222
+ u.note.position === "left of" ? (a.setNode(h.id + "-note", S1), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", S1)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
223
+ } else a.setNode(h.id, h);
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
+ L.debug("Count=", a.nodeCount(), a);
240
+ var m = 0;
241
+ c.forEach(function(n) {
242
+ m++, L.debug("Setting edge", n), a.setEdge(n.id1, n.id2, {
243
+ relation: n,
244
+ width: rt(n.title),
245
+ height: B.labelHeight * $n.getRows(n.title).length,
246
+ labelpos: "c"
247
+ }, "id" + m);
248
+ }), Yt(a), L.debug("Graph after layout", a.nodes());
249
+ var w = i.node();
250
+ a.nodes().forEach(function(n) {
251
+ n !== void 0 && a.node(n) !== void 0 ? (L.warn("Node " + n + ": " + JSON.stringify(a.node(n))), s.select("#" + w.id + " #" + n).attr("transform", "translate(" + (a.node(n).x - a.node(n).width / 2) + "," + (a.node(n).y + (z[n] ? z[n].y : 0) - a.node(n).height / 2) + " )"), s.select("#" + w.id + " #" + n).attr("data-x-shift", a.node(n).x - a.node(n).width / 2), g.querySelectorAll("#" + w.id + " #" + n + " .divider").forEach(function(h) {
252
+ var f = h.parentElement;
253
+ var S = 0, M = 0;
254
+ f && (f.parentElement && (S = f.parentElement.getBBox().width), M = parseInt(f.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", S - M - 8);
255
+ })) : L.debug("No Node " + n + ": " + JSON.stringify(a.node(n)));
256
+ });
257
+ var k = w.getBBox();
258
+ a.edges().forEach(function(n) {
259
+ n !== void 0 && a.edge(n) !== void 0 && (L.debug("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(a.edge(n))), at(i, a.edge(n), a.edge(n).relation));
260
+ }), k = w.getBBox();
261
+ var E = {
262
+ id: o || "root",
263
+ label: o || "root",
264
+ width: 0,
265
+ height: 0
266
+ };
267
+ return E.width = k.width + 2 * B.padding, E.height = k.height + 2 * B.padding, L.debug("Doc rendered", E, a), E;
268
+ }, ot = {
269
+ setConf: it,
270
+ draw: st
271
+ }, ut = {
272
+ parser: De,
273
+ db: Ae,
274
+ renderer: ot,
275
+ styles: Le,
276
+ init: function(e) {
277
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute, Ae.clear();
278
+ }
279
+ };
280
+
281
+ export { ut as diagram };