@readme/markdown 7.6.7 → 7.7.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 (81) hide show
  1. package/components/Code/index.tsx +4 -0
  2. package/components/Code/style.scss +6 -0
  3. package/components/CodeTabs/index.tsx +25 -2
  4. package/components/Image/style.scss +1 -4
  5. package/dist/10.js +22718 -0
  6. package/dist/10.node.js +22721 -0
  7. package/dist/11.js +1440 -0
  8. package/dist/11.node.js +1443 -0
  9. package/dist/120.js +19 -0
  10. package/dist/120.node.js +22 -0
  11. package/dist/134.js +19 -0
  12. package/dist/134.node.js +22 -0
  13. package/dist/150.js +1888 -0
  14. package/dist/150.node.js +1891 -0
  15. package/dist/17.js +1373 -0
  16. package/dist/17.node.js +1376 -0
  17. package/dist/246.js +1929 -0
  18. package/dist/246.node.js +1932 -0
  19. package/dist/351.js +2400 -0
  20. package/dist/351.node.js +2403 -0
  21. package/dist/366.js +1181 -0
  22. package/dist/366.node.js +1184 -0
  23. package/dist/403.js +2192 -0
  24. package/dist/403.node.js +2195 -0
  25. package/dist/429.js +11130 -0
  26. package/dist/429.node.js +11133 -0
  27. package/dist/485.js +514 -0
  28. package/dist/485.node.js +517 -0
  29. package/dist/488.js +55 -0
  30. package/dist/488.node.js +58 -0
  31. package/dist/489.js +18472 -0
  32. package/dist/489.node.js +18475 -0
  33. package/dist/510.js +246 -0
  34. package/dist/510.node.js +249 -0
  35. package/dist/52.js +808 -0
  36. package/dist/52.node.js +811 -0
  37. package/dist/550.node.js +1456 -0
  38. package/dist/551.js +2722 -0
  39. package/dist/551.node.js +2725 -0
  40. package/dist/617.js +19 -0
  41. package/dist/617.node.js +22 -0
  42. package/dist/687.js +3671 -0
  43. package/dist/687.node.js +3674 -0
  44. package/dist/745.js +7504 -0
  45. package/dist/745.node.js +7507 -0
  46. package/dist/775.js +1900 -0
  47. package/dist/775.node.js +1903 -0
  48. package/dist/786.js +31378 -0
  49. package/dist/786.node.js +31381 -0
  50. package/dist/788.js +1021 -0
  51. package/dist/788.node.js +1024 -0
  52. package/dist/81.js +382 -0
  53. package/dist/81.node.js +385 -0
  54. package/dist/849.js +2586 -0
  55. package/dist/849.node.js +2589 -0
  56. package/dist/863.js +19 -0
  57. package/dist/863.node.js +22 -0
  58. package/dist/867.js +1414 -0
  59. package/dist/867.node.js +1417 -0
  60. package/dist/871.js +1533 -0
  61. package/dist/881.js +1276 -0
  62. package/dist/881.node.js +1279 -0
  63. package/dist/885.js +48 -0
  64. package/dist/885.node.js +51 -0
  65. package/dist/896.js +1613 -0
  66. package/dist/896.node.js +1616 -0
  67. package/dist/906.js +1815 -0
  68. package/dist/906.node.js +1818 -0
  69. package/dist/91.js +19 -0
  70. package/dist/91.node.js +22 -0
  71. package/dist/940.js +3359 -0
  72. package/dist/940.node.js +3362 -0
  73. package/dist/952.js +243 -0
  74. package/dist/952.node.js +246 -0
  75. package/dist/995.js +5734 -0
  76. package/dist/995.node.js +5737 -0
  77. package/dist/components/Code/index.d.ts +1 -1
  78. package/dist/main.css +1 -1
  79. package/dist/main.js +94897 -73869
  80. package/dist/main.node.js +103618 -82699
  81. package/package.json +3 -3
package/dist/485.js ADDED
@@ -0,0 +1,514 @@
1
+ "use strict";
2
+ (self["webpackChunk_readme_markdown"] = self["webpackChunk_readme_markdown"] || []).push([[485],{
3
+
4
+ /***/ 9866:
5
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
+
7
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8
+ /* harmony export */ diagram: () => (/* binding */ diagram)
9
+ /* harmony export */ });
10
+ /* harmony import */ var _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3246);
11
+ /* harmony import */ var _chunk_4LC2V6XN_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4265);
12
+ /* harmony import */ var _chunk_U2OMI7UW_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2385);
13
+ /* harmony import */ var _chunk_O5FTX4FK_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1285);
14
+ /* harmony import */ var _chunk_CTJGIJSU_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4875);
15
+ /* harmony import */ var _chunk_I3FGKTZ5_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6971);
16
+ /* harmony import */ var _chunk_U7L4IQIU_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5449);
17
+ /* harmony import */ var _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2843);
18
+ /* harmony import */ var _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(6322);
19
+ /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8066);
20
+ /* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(995);
21
+ /* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4416);
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+ // src/diagrams/state/stateRenderer.js
33
+
34
+
35
+
36
+
37
+ // src/diagrams/state/shapes.js
38
+
39
+
40
+ // src/diagrams/state/id-cache.js
41
+ var idCache = {};
42
+ var set = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((key, val) => {
43
+ idCache[key] = val;
44
+ }, "set");
45
+ var get = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((k) => idCache[k], "get");
46
+ var keys = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(() => Object.keys(idCache), "keys");
47
+ var size = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(() => keys().length, "size");
48
+ var id_cache_default = {
49
+ get,
50
+ set,
51
+ keys,
52
+ size
53
+ };
54
+
55
+ // src/diagrams/state/shapes.js
56
+ var drawStartState = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g) => g.append("circle").attr("class", "start-state").attr("r", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit).attr("cx", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit).attr("cy", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit), "drawStartState");
57
+ var drawDivider = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g) => g.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight).attr("class", "divider").attr("x2", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider");
58
+ var drawSimpleState = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g, stateDef) => {
59
+ const state = g.append("text").attr("x", 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("font-size", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.fontSize).attr("class", "state-title").text(stateDef.id);
60
+ const classBox = state.node().getBBox();
61
+ g.insert("rect", ":first-child").attr("x", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("width", classBox.width + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("height", classBox.height + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("rx", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.radius);
62
+ return state;
63
+ }, "drawSimpleState");
64
+ var drawDescrState = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g, stateDef) => {
65
+ const addTspan = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function(textEl, txt, isFirst2) {
66
+ const tSpan = textEl.append("tspan").attr("x", 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).text(txt);
67
+ if (!isFirst2) {
68
+ tSpan.attr("dy", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight);
69
+ }
70
+ }, "addTspan");
71
+ const title = g.append("text").attr("x", 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight + 1.3 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("font-size", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.fontSize).attr("class", "state-title").text(stateDef.descriptions[0]);
72
+ const titleBox = title.node().getBBox();
73
+ const titleHeight = titleBox.height;
74
+ const description = g.append("text").attr("x", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr(
75
+ "y",
76
+ titleHeight + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding * 0.4 + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.dividerMargin + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight
77
+ ).attr("class", "state-description");
78
+ let isFirst = true;
79
+ let isSecond = true;
80
+ stateDef.descriptions.forEach(function(descr) {
81
+ if (!isFirst) {
82
+ addTspan(description, descr, isSecond);
83
+ isSecond = false;
84
+ }
85
+ isFirst = false;
86
+ });
87
+ const descrLine = g.append("line").attr("x1", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("y1", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + titleHeight + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.dividerMargin / 2).attr("y2", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + titleHeight + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.dividerMargin / 2).attr("class", "descr-divider");
88
+ const descrBox = description.node().getBBox();
89
+ const width = Math.max(descrBox.width, titleBox.width);
90
+ descrLine.attr("x2", width + 3 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding);
91
+ g.insert("rect", ":first-child").attr("x", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("width", width + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("height", descrBox.height + titleHeight + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("rx", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.radius);
92
+ return g;
93
+ }, "drawDescrState");
94
+ var addTitleAndBox = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g, stateDef, altBkg) => {
95
+ const pad = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding;
96
+ const dblPad = 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding;
97
+ const orgBox = g.node().getBBox();
98
+ const orgWidth = orgBox.width;
99
+ const orgX = orgBox.x;
100
+ const title = g.append("text").attr("x", 0).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.titleShift).attr("font-size", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.fontSize).attr("class", "state-title").text(stateDef.id);
101
+ const titleBox = title.node().getBBox();
102
+ const titleWidth = titleBox.width + dblPad;
103
+ let width = Math.max(titleWidth, orgWidth);
104
+ if (width === orgWidth) {
105
+ width = width + dblPad;
106
+ }
107
+ let startX;
108
+ const graphBox = g.node().getBBox();
109
+ if (stateDef.doc) {
110
+ }
111
+ startX = orgX - pad;
112
+ if (titleWidth > orgWidth) {
113
+ startX = (orgWidth - width) / 2 + pad;
114
+ }
115
+ if (Math.abs(orgX - graphBox.x) < pad && titleWidth > orgWidth) {
116
+ startX = orgX - (titleWidth - orgWidth) / 2;
117
+ }
118
+ const lineY = 1 - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight;
119
+ g.insert("rect", ":first-child").attr("x", startX).attr("y", lineY).attr("class", altBkg ? "alt-composit" : "composit").attr("width", width).attr(
120
+ "height",
121
+ graphBox.height + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.titleShift + 1
122
+ ).attr("rx", "0");
123
+ title.attr("x", startX + pad);
124
+ if (titleWidth <= orgWidth) {
125
+ title.attr("x", orgX + (width - dblPad) / 2 - titleWidth / 2 + pad);
126
+ }
127
+ g.insert("rect", ":first-child").attr("x", startX).attr(
128
+ "y",
129
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.titleShift - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding
130
+ ).attr("width", width).attr("height", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight * 3).attr("rx", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.radius);
131
+ g.insert("rect", ":first-child").attr("x", startX).attr(
132
+ "y",
133
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.titleShift - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding
134
+ ).attr("width", width).attr("height", graphBox.height + 3 + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.textHeight).attr("rx", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.radius);
135
+ return g;
136
+ }, "addTitleAndBox");
137
+ var drawEndState = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g) => {
138
+ g.append("circle").attr("class", "end-state-outer").attr("r", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.miniPadding).attr(
139
+ "cx",
140
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.miniPadding
141
+ ).attr(
142
+ "cy",
143
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.miniPadding
144
+ );
145
+ return g.append("circle").attr("class", "end-state-inner").attr("r", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit).attr("cx", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit + 2).attr("cy", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.sizeUnit + 2);
146
+ }, "drawEndState");
147
+ var drawForkJoinState = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((g, stateDef) => {
148
+ let width = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.forkWidth;
149
+ let height = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.forkHeight;
150
+ if (stateDef.parentId) {
151
+ let tmp = width;
152
+ width = height;
153
+ height = tmp;
154
+ }
155
+ return g.append("rect").style("stroke", "black").style("fill", "black").attr("width", width).attr("height", height).attr("x", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding);
156
+ }, "drawForkJoinState");
157
+ var _drawLongText = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((_text, x, y, g) => {
158
+ let textHeight = 0;
159
+ const textElem = g.append("text");
160
+ textElem.style("text-anchor", "start");
161
+ textElem.attr("class", "noteText");
162
+ let text = _text.replace(/\r\n/g, "<br/>");
163
+ text = text.replace(/\n/g, "<br/>");
164
+ const lines = text.split(_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .common_default */ .Y2.lineBreakRegex);
165
+ let tHeight = 1.25 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.noteMargin;
166
+ for (const line2 of lines) {
167
+ const txt = line2.trim();
168
+ if (txt.length > 0) {
169
+ const span = textElem.append("tspan");
170
+ span.text(txt);
171
+ if (tHeight === 0) {
172
+ const textBounds = span.node().getBBox();
173
+ tHeight += textBounds.height;
174
+ }
175
+ textHeight += tHeight;
176
+ span.attr("x", x + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.noteMargin);
177
+ span.attr("y", y + textHeight + 1.25 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.noteMargin);
178
+ }
179
+ }
180
+ return { textWidth: textElem.node().getBBox().width, textHeight };
181
+ }, "_drawLongText");
182
+ var drawNote = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((text, g) => {
183
+ g.attr("class", "state-note");
184
+ const note = g.append("rect").attr("x", 0).attr("y", (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding);
185
+ const rectElem = g.append("g");
186
+ const { textWidth, textHeight } = _drawLongText(text, 0, 0, rectElem);
187
+ note.attr("height", textHeight + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.noteMargin);
188
+ note.attr("width", textWidth + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.noteMargin * 2);
189
+ return note;
190
+ }, "drawNote");
191
+ var drawState = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function(elem, stateDef) {
192
+ const id = stateDef.id;
193
+ const stateInfo = {
194
+ id,
195
+ label: stateDef.id,
196
+ width: 0,
197
+ height: 0
198
+ };
199
+ const g = elem.append("g").attr("id", id).attr("class", "stateGroup");
200
+ if (stateDef.type === "start") {
201
+ drawStartState(g);
202
+ }
203
+ if (stateDef.type === "end") {
204
+ drawEndState(g);
205
+ }
206
+ if (stateDef.type === "fork" || stateDef.type === "join") {
207
+ drawForkJoinState(g, stateDef);
208
+ }
209
+ if (stateDef.type === "note") {
210
+ drawNote(stateDef.note.text, g);
211
+ }
212
+ if (stateDef.type === "divider") {
213
+ drawDivider(g);
214
+ }
215
+ if (stateDef.type === "default" && stateDef.descriptions.length === 0) {
216
+ drawSimpleState(g, stateDef);
217
+ }
218
+ if (stateDef.type === "default" && stateDef.descriptions.length > 0) {
219
+ drawDescrState(g, stateDef);
220
+ }
221
+ const stateBox = g.node().getBBox();
222
+ stateInfo.width = stateBox.width + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding;
223
+ stateInfo.height = stateBox.height + 2 * (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding;
224
+ id_cache_default.set(id, stateInfo);
225
+ return stateInfo;
226
+ }, "drawState");
227
+ var edgeCount = 0;
228
+ var drawEdge = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function(elem, path, relation) {
229
+ const getRelationType = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function(type) {
230
+ switch (type) {
231
+ case _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP.relationType.AGGREGATION:
232
+ return "aggregation";
233
+ case _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP.relationType.EXTENSION:
234
+ return "extension";
235
+ case _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP.relationType.COMPOSITION:
236
+ return "composition";
237
+ case _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP.relationType.DEPENDENCY:
238
+ return "dependency";
239
+ }
240
+ }, "getRelationType");
241
+ path.points = path.points.filter((p) => !Number.isNaN(p.y));
242
+ const lineData = path.points;
243
+ const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_9__/* .line */ .n8j)().x(function(d) {
244
+ return d.x;
245
+ }).y(function(d) {
246
+ return d.y;
247
+ }).curve(d3__WEBPACK_IMPORTED_MODULE_9__/* .curveBasis */ .qrM);
248
+ const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "transition");
249
+ let url = "";
250
+ if ((0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.arrowMarkerAbsolute) {
251
+ url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search;
252
+ url = url.replace(/\(/g, "\\(");
253
+ url = url.replace(/\)/g, "\\)");
254
+ }
255
+ svgPath.attr(
256
+ "marker-end",
257
+ "url(" + url + "#" + getRelationType(_chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP.relationType.DEPENDENCY) + "End)"
258
+ );
259
+ if (relation.title !== void 0) {
260
+ const label = elem.append("g").attr("class", "stateLabel");
261
+ const { x, y } = _chunk_TLUHKHBO_mjs__WEBPACK_IMPORTED_MODULE_7__/* .utils_default */ ._K.calcLabelPosition(path.points);
262
+ const rows = _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .common_default */ .Y2.getRows(relation.title);
263
+ let titleHeight = 0;
264
+ const titleRows = [];
265
+ let maxWidth = 0;
266
+ let minX = 0;
267
+ for (let i = 0; i <= rows.length; i++) {
268
+ const title = label.append("text").attr("text-anchor", "middle").text(rows[i]).attr("x", x).attr("y", y + titleHeight);
269
+ const boundsTmp = title.node().getBBox();
270
+ maxWidth = Math.max(maxWidth, boundsTmp.width);
271
+ minX = Math.min(minX, boundsTmp.x);
272
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.info(boundsTmp.x, x, y + titleHeight);
273
+ if (titleHeight === 0) {
274
+ const titleBox = title.node().getBBox();
275
+ titleHeight = titleBox.height;
276
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.info("Title height", titleHeight, y);
277
+ }
278
+ titleRows.push(title);
279
+ }
280
+ let boxHeight = titleHeight * rows.length;
281
+ if (rows.length > 1) {
282
+ const heightAdj = (rows.length - 1) * titleHeight * 0.5;
283
+ titleRows.forEach((title, i) => title.attr("y", y + i * titleHeight - heightAdj));
284
+ boxHeight = titleHeight * rows.length;
285
+ }
286
+ const bounds = label.node().getBBox();
287
+ label.insert("rect", ":first-child").attr("class", "box").attr("x", x - maxWidth / 2 - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding / 2).attr("y", y - boxHeight / 2 - (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding / 2 - 3.5).attr("width", maxWidth + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding).attr("height", boxHeight + (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state.padding);
288
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.info(bounds);
289
+ }
290
+ edgeCount++;
291
+ }, "drawEdge");
292
+
293
+ // src/diagrams/state/stateRenderer.js
294
+ var conf;
295
+ var transformationLog = {};
296
+ var setConf = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function() {
297
+ }, "setConf");
298
+ var insertMarkers = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function(elem) {
299
+ elem.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");
300
+ }, "insertMarkers");
301
+ var draw = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)(function(text, id, _version, diagObj) {
302
+ conf = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().state;
303
+ const securityLevel = (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .getConfig2 */ .D7)().securityLevel;
304
+ let sandboxElement;
305
+ if (securityLevel === "sandbox") {
306
+ sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_9__/* .select */ .Ltv)("#i" + id);
307
+ }
308
+ const root = securityLevel === "sandbox" ? (0,d3__WEBPACK_IMPORTED_MODULE_9__/* .select */ .Ltv)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_9__/* .select */ .Ltv)("body");
309
+ const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
310
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("Rendering diagram " + text);
311
+ const diagram2 = root.select(`[id='${id}']`);
312
+ insertMarkers(diagram2);
313
+ const rootDoc = diagObj.db.getRootDoc();
314
+ renderDoc(rootDoc, diagram2, void 0, false, root, doc, diagObj);
315
+ const padding = conf.padding;
316
+ const bounds = diagram2.node().getBBox();
317
+ const width = bounds.width + padding * 2;
318
+ const height = bounds.height + padding * 2;
319
+ const svgWidth = width * 1.75;
320
+ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .configureSvgSize */ .a$)(diagram2, height, svgWidth, conf.useMaxWidth);
321
+ diagram2.attr(
322
+ "viewBox",
323
+ `${bounds.x - conf.padding} ${bounds.y - conf.padding} ` + width + " " + height
324
+ );
325
+ }, "draw");
326
+ var getLabelWidth = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((text) => {
327
+ return text ? text.length * conf.fontSizeFactor : 1;
328
+ }, "getLabelWidth");
329
+ var renderDoc = /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((doc, diagram2, parentId, altBkg, root, domDocument, diagObj) => {
330
+ const graph = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_11__/* .Graph */ .T({
331
+ compound: true,
332
+ multigraph: true
333
+ });
334
+ let i;
335
+ let edgeFreeDoc = true;
336
+ for (i = 0; i < doc.length; i++) {
337
+ if (doc[i].stmt === "relation") {
338
+ edgeFreeDoc = false;
339
+ break;
340
+ }
341
+ }
342
+ if (parentId) {
343
+ graph.setGraph({
344
+ rankdir: "LR",
345
+ multigraph: true,
346
+ compound: true,
347
+ // acyclicer: 'greedy',
348
+ ranker: "tight-tree",
349
+ ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
350
+ nodeSep: edgeFreeDoc ? 1 : 50,
351
+ isMultiGraph: true
352
+ // ranksep: 5,
353
+ // nodesep: 1
354
+ });
355
+ } else {
356
+ graph.setGraph({
357
+ rankdir: "TB",
358
+ multigraph: true,
359
+ compound: true,
360
+ // isCompound: true,
361
+ // acyclicer: 'greedy',
362
+ // ranker: 'longest-path'
363
+ ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
364
+ nodeSep: edgeFreeDoc ? 1 : 50,
365
+ ranker: "tight-tree",
366
+ // ranker: 'network-simplex'
367
+ isMultiGraph: true
368
+ });
369
+ }
370
+ graph.setDefaultEdgeLabel(function() {
371
+ return {};
372
+ });
373
+ diagObj.db.extract(doc);
374
+ const states = diagObj.db.getStates();
375
+ const relations = diagObj.db.getRelations();
376
+ const keys2 = Object.keys(states);
377
+ let first = true;
378
+ for (const key of keys2) {
379
+ const stateDef = states[key];
380
+ if (parentId) {
381
+ stateDef.parentId = parentId;
382
+ }
383
+ let node;
384
+ if (stateDef.doc) {
385
+ let sub = diagram2.append("g").attr("id", stateDef.id).attr("class", "stateGroup");
386
+ node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg, root, domDocument, diagObj);
387
+ if (first) {
388
+ sub = addTitleAndBox(sub, stateDef, altBkg);
389
+ let boxBounds = sub.node().getBBox();
390
+ node.width = boxBounds.width;
391
+ node.height = boxBounds.height + conf.padding / 2;
392
+ transformationLog[stateDef.id] = { y: conf.compositTitleSize };
393
+ } else {
394
+ let boxBounds = sub.node().getBBox();
395
+ node.width = boxBounds.width;
396
+ node.height = boxBounds.height;
397
+ }
398
+ } else {
399
+ node = drawState(diagram2, stateDef, graph);
400
+ }
401
+ if (stateDef.note) {
402
+ const noteDef = {
403
+ descriptions: [],
404
+ id: stateDef.id + "-note",
405
+ note: stateDef.note,
406
+ type: "note"
407
+ };
408
+ const note = drawState(diagram2, noteDef, graph);
409
+ if (stateDef.note.position === "left of") {
410
+ graph.setNode(node.id + "-note", note);
411
+ graph.setNode(node.id, node);
412
+ } else {
413
+ graph.setNode(node.id, node);
414
+ graph.setNode(node.id + "-note", note);
415
+ }
416
+ graph.setParent(node.id, node.id + "-group");
417
+ graph.setParent(node.id + "-note", node.id + "-group");
418
+ } else {
419
+ graph.setNode(node.id, node);
420
+ }
421
+ }
422
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("Count=", graph.nodeCount(), graph);
423
+ let cnt = 0;
424
+ relations.forEach(function(relation) {
425
+ cnt++;
426
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("Setting edge", relation);
427
+ graph.setEdge(
428
+ relation.id1,
429
+ relation.id2,
430
+ {
431
+ relation,
432
+ width: getLabelWidth(relation.title),
433
+ height: conf.labelHeight * _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .common_default */ .Y2.getRows(relation.title).length,
434
+ labelpos: "c"
435
+ },
436
+ "id" + cnt
437
+ );
438
+ });
439
+ (0,dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_10__/* .layout */ .Zp)(graph);
440
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("Graph after layout", graph.nodes());
441
+ const svgElem = diagram2.node();
442
+ graph.nodes().forEach(function(v) {
443
+ if (v !== void 0 && graph.node(v) !== void 0) {
444
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.warn("Node " + v + ": " + JSON.stringify(graph.node(v)));
445
+ root.select("#" + svgElem.id + " #" + v).attr(
446
+ "transform",
447
+ "translate(" + (graph.node(v).x - graph.node(v).width / 2) + "," + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + " )"
448
+ );
449
+ root.select("#" + svgElem.id + " #" + v).attr("data-x-shift", graph.node(v).x - graph.node(v).width / 2);
450
+ const dividers = domDocument.querySelectorAll("#" + svgElem.id + " #" + v + " .divider");
451
+ dividers.forEach((divider) => {
452
+ const parent = divider.parentElement;
453
+ let pWidth = 0;
454
+ let pShift = 0;
455
+ if (parent) {
456
+ if (parent.parentElement) {
457
+ pWidth = parent.parentElement.getBBox().width;
458
+ }
459
+ pShift = parseInt(parent.getAttribute("data-x-shift"), 10);
460
+ if (Number.isNaN(pShift)) {
461
+ pShift = 0;
462
+ }
463
+ }
464
+ divider.setAttribute("x1", 0 - pShift + 8);
465
+ divider.setAttribute("x2", pWidth - pShift - 8);
466
+ });
467
+ } else {
468
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("No Node " + v + ": " + JSON.stringify(graph.node(v)));
469
+ }
470
+ });
471
+ let stateBox = svgElem.getBBox();
472
+ graph.edges().forEach(function(e) {
473
+ if (e !== void 0 && graph.edge(e) !== void 0) {
474
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(graph.edge(e)));
475
+ drawEdge(diagram2, graph.edge(e), graph.edge(e).relation);
476
+ }
477
+ });
478
+ stateBox = svgElem.getBBox();
479
+ const stateInfo = {
480
+ id: parentId ? parentId : "root",
481
+ label: parentId ? parentId : "root",
482
+ width: 0,
483
+ height: 0
484
+ };
485
+ stateInfo.width = stateBox.width + 2 * conf.padding;
486
+ stateInfo.height = stateBox.height + 2 * conf.padding;
487
+ _chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .log */ .Rm.debug("Doc rendered", stateInfo, graph);
488
+ return stateInfo;
489
+ }, "renderDoc");
490
+ var stateRenderer_default = {
491
+ setConf,
492
+ draw
493
+ };
494
+
495
+ // src/diagrams/state/stateDiagram.ts
496
+ var diagram = {
497
+ parser: _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDiagram_default */ .Zk,
498
+ db: _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP,
499
+ renderer: stateRenderer_default,
500
+ styles: _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .styles_default */ .tM,
501
+ init: /* @__PURE__ */ (0,_chunk_S24QXQKS_mjs__WEBPACK_IMPORTED_MODULE_8__/* .__name */ .K2)((cnf) => {
502
+ if (!cnf.state) {
503
+ cnf.state = {};
504
+ }
505
+ cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
506
+ _chunk_5RIWM3LS_mjs__WEBPACK_IMPORTED_MODULE_0__/* .stateDb_default */ .iP.clear();
507
+ }, "init")
508
+ };
509
+
510
+
511
+
512
+ /***/ })
513
+
514
+ }]);