@digipair/skill-web-chatbot 0.90.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,283 +0,0 @@
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;
@@ -1,281 +0,0 @@
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 };