@umami/shiso 1.12.0 → 1.13.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 (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,971 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY.js";
2
+ import "./src.js";
3
+ import { H as setAccDescription, K as setDiagramTitle, U as setAccTitle, a as clear, c as configureSvgSize, s as common_default, v as getAccDescription, w as getDiagramTitle, x as getConfig2, y as getAccTitle } from "./chunk-DU6HZSFF.js";
4
+ import { p as parseFontSize } from "./chunk-75Z2AOVW.js";
5
+ import { t as at } from "./rough.esm.js";
6
+ import { f as selectSvgElement } from "./mermaid.core.js";
7
+
8
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-5VMMS53U.mjs
9
+ var parser = (function() {
10
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
11
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
12
+ return o2;
13
+ }, "o"), $V0 = [1, 4], $V1 = [1, 14], $V2 = [1, 12], $V3 = [1, 13], $V4 = [
14
+ 6,
15
+ 7,
16
+ 8
17
+ ], $V5 = [1, 20], $V6 = [1, 18], $V7 = [1, 19], $V8 = [
18
+ 6,
19
+ 7,
20
+ 11
21
+ ], $V9 = [
22
+ 1,
23
+ 6,
24
+ 13,
25
+ 14
26
+ ], $Va = [1, 23], $Vb = [1, 24], $Vc = [
27
+ 1,
28
+ 6,
29
+ 7,
30
+ 11,
31
+ 13,
32
+ 14
33
+ ];
34
+ var parser2 = {
35
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
36
+ yy: {},
37
+ symbols_: {
38
+ "error": 2,
39
+ "start": 3,
40
+ "ishikawa": 4,
41
+ "spaceLines": 5,
42
+ "SPACELINE": 6,
43
+ "NL": 7,
44
+ "ISHIKAWA": 8,
45
+ "document": 9,
46
+ "stop": 10,
47
+ "EOF": 11,
48
+ "statement": 12,
49
+ "SPACELIST": 13,
50
+ "TEXT": 14,
51
+ "$accept": 0,
52
+ "$end": 1
53
+ },
54
+ terminals_: {
55
+ 2: "error",
56
+ 6: "SPACELINE",
57
+ 7: "NL",
58
+ 8: "ISHIKAWA",
59
+ 11: "EOF",
60
+ 13: "SPACELIST",
61
+ 14: "TEXT"
62
+ },
63
+ productions_: [
64
+ 0,
65
+ [3, 1],
66
+ [3, 2],
67
+ [5, 1],
68
+ [5, 2],
69
+ [5, 2],
70
+ [4, 2],
71
+ [4, 3],
72
+ [10, 1],
73
+ [10, 1],
74
+ [10, 1],
75
+ [10, 2],
76
+ [10, 2],
77
+ [9, 3],
78
+ [9, 2],
79
+ [12, 2],
80
+ [12, 1],
81
+ [12, 1],
82
+ [12, 1]
83
+ ],
84
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
85
+ var $0 = $$.length - 1;
86
+ switch (yystate) {
87
+ case 6:
88
+ case 7: return yy;
89
+ case 15:
90
+ yy.addNode($$[$0 - 1].length, $$[$0].trim());
91
+ break;
92
+ case 16: yy.addNode(0, $$[$0].trim());
93
+ }
94
+ }, "anonymous"),
95
+ table: [
96
+ {
97
+ 3: 1,
98
+ 4: 2,
99
+ 5: 3,
100
+ 6: [1, 5],
101
+ 8: $V0
102
+ },
103
+ { 1: [3] },
104
+ { 1: [2, 1] },
105
+ {
106
+ 4: 6,
107
+ 6: [1, 7],
108
+ 7: [1, 8],
109
+ 8: $V0
110
+ },
111
+ {
112
+ 6: $V1,
113
+ 7: [1, 10],
114
+ 9: 9,
115
+ 12: 11,
116
+ 13: $V2,
117
+ 14: $V3
118
+ },
119
+ o($V4, [2, 3]),
120
+ { 1: [2, 2] },
121
+ o($V4, [2, 4]),
122
+ o($V4, [2, 5]),
123
+ {
124
+ 1: [2, 6],
125
+ 6: $V1,
126
+ 12: 15,
127
+ 13: $V2,
128
+ 14: $V3
129
+ },
130
+ {
131
+ 6: $V1,
132
+ 9: 16,
133
+ 12: 11,
134
+ 13: $V2,
135
+ 14: $V3
136
+ },
137
+ {
138
+ 6: $V5,
139
+ 7: $V6,
140
+ 10: 17,
141
+ 11: $V7
142
+ },
143
+ o($V8, [2, 18], { 14: [1, 21] }),
144
+ o($V8, [2, 16]),
145
+ o($V8, [2, 17]),
146
+ {
147
+ 6: $V5,
148
+ 7: $V6,
149
+ 10: 22,
150
+ 11: $V7
151
+ },
152
+ {
153
+ 1: [2, 7],
154
+ 6: $V1,
155
+ 12: 15,
156
+ 13: $V2,
157
+ 14: $V3
158
+ },
159
+ o($V9, [2, 14], {
160
+ 7: $Va,
161
+ 11: $Vb
162
+ }),
163
+ o($Vc, [2, 8]),
164
+ o($Vc, [2, 9]),
165
+ o($Vc, [2, 10]),
166
+ o($V8, [2, 15]),
167
+ o($V9, [2, 13], {
168
+ 7: $Va,
169
+ 11: $Vb
170
+ }),
171
+ o($Vc, [2, 11]),
172
+ o($Vc, [2, 12])
173
+ ],
174
+ defaultActions: {
175
+ 2: [2, 1],
176
+ 6: [2, 2]
177
+ },
178
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
179
+ if (hash.recoverable) this.trace(str);
180
+ else {
181
+ var error = new Error(str);
182
+ error.hash = hash;
183
+ throw error;
184
+ }
185
+ }, "parseError"),
186
+ parse: /* @__PURE__ */ __name(function parse(input) {
187
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
188
+ var args = lstack.slice.call(arguments, 1);
189
+ var lexer2 = Object.create(this.lexer);
190
+ var sharedState = { yy: {} };
191
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
192
+ lexer2.setInput(input, sharedState.yy);
193
+ sharedState.yy.lexer = lexer2;
194
+ sharedState.yy.parser = this;
195
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
196
+ var yyloc = lexer2.yylloc;
197
+ lstack.push(yyloc);
198
+ var ranges = lexer2.options && lexer2.options.ranges;
199
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
200
+ else this.parseError = Object.getPrototypeOf(this).parseError;
201
+ function popStack(n) {
202
+ stack.length = stack.length - 2 * n;
203
+ vstack.length = vstack.length - n;
204
+ lstack.length = lstack.length - n;
205
+ }
206
+ __name(popStack, "popStack");
207
+ function lex() {
208
+ var token = tstack.pop() || lexer2.lex() || EOF;
209
+ if (typeof token !== "number") {
210
+ if (token instanceof Array) {
211
+ tstack = token;
212
+ token = tstack.pop();
213
+ }
214
+ token = self.symbols_[token] || token;
215
+ }
216
+ return token;
217
+ }
218
+ __name(lex, "lex");
219
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
220
+ while (true) {
221
+ state = stack[stack.length - 1];
222
+ if (this.defaultActions[state]) action = this.defaultActions[state];
223
+ else {
224
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
225
+ action = table[state] && table[state][symbol];
226
+ }
227
+ if (typeof action === "undefined" || !action.length || !action[0]) {
228
+ var errStr = "";
229
+ expected = [];
230
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
231
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
232
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
233
+ this.parseError(errStr, {
234
+ text: lexer2.match,
235
+ token: this.terminals_[symbol] || symbol,
236
+ line: lexer2.yylineno,
237
+ loc: yyloc,
238
+ expected
239
+ });
240
+ }
241
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
242
+ switch (action[0]) {
243
+ case 1:
244
+ stack.push(symbol);
245
+ vstack.push(lexer2.yytext);
246
+ lstack.push(lexer2.yylloc);
247
+ stack.push(action[1]);
248
+ symbol = null;
249
+ if (!preErrorSymbol) {
250
+ yyleng = lexer2.yyleng;
251
+ yytext = lexer2.yytext;
252
+ yylineno = lexer2.yylineno;
253
+ yyloc = lexer2.yylloc;
254
+ if (recovering > 0) recovering--;
255
+ } else {
256
+ symbol = preErrorSymbol;
257
+ preErrorSymbol = null;
258
+ }
259
+ break;
260
+ case 2:
261
+ len = this.productions_[action[1]][1];
262
+ yyval.$ = vstack[vstack.length - len];
263
+ yyval._$ = {
264
+ first_line: lstack[lstack.length - (len || 1)].first_line,
265
+ last_line: lstack[lstack.length - 1].last_line,
266
+ first_column: lstack[lstack.length - (len || 1)].first_column,
267
+ last_column: lstack[lstack.length - 1].last_column
268
+ };
269
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
270
+ r = this.performAction.apply(yyval, [
271
+ yytext,
272
+ yyleng,
273
+ yylineno,
274
+ sharedState.yy,
275
+ action[1],
276
+ vstack,
277
+ lstack
278
+ ].concat(args));
279
+ if (typeof r !== "undefined") return r;
280
+ if (len) {
281
+ stack = stack.slice(0, -1 * len * 2);
282
+ vstack = vstack.slice(0, -1 * len);
283
+ lstack = lstack.slice(0, -1 * len);
284
+ }
285
+ stack.push(this.productions_[action[1]][0]);
286
+ vstack.push(yyval.$);
287
+ lstack.push(yyval._$);
288
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
289
+ stack.push(newState);
290
+ break;
291
+ case 3: return true;
292
+ }
293
+ }
294
+ return true;
295
+ }, "parse")
296
+ };
297
+ parser2.lexer = /* @__PURE__ */ (function() {
298
+ return {
299
+ EOF: 1,
300
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
301
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
302
+ else throw new Error(str);
303
+ }, "parseError"),
304
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
305
+ this.yy = yy || this.yy || {};
306
+ this._input = input;
307
+ this._more = this._backtrack = this.done = false;
308
+ this.yylineno = this.yyleng = 0;
309
+ this.yytext = this.matched = this.match = "";
310
+ this.conditionStack = ["INITIAL"];
311
+ this.yylloc = {
312
+ first_line: 1,
313
+ first_column: 0,
314
+ last_line: 1,
315
+ last_column: 0
316
+ };
317
+ if (this.options.ranges) this.yylloc.range = [0, 0];
318
+ this.offset = 0;
319
+ return this;
320
+ }, "setInput"),
321
+ input: /* @__PURE__ */ __name(function() {
322
+ var ch = this._input[0];
323
+ this.yytext += ch;
324
+ this.yyleng++;
325
+ this.offset++;
326
+ this.match += ch;
327
+ this.matched += ch;
328
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
329
+ this.yylineno++;
330
+ this.yylloc.last_line++;
331
+ } else this.yylloc.last_column++;
332
+ if (this.options.ranges) this.yylloc.range[1]++;
333
+ this._input = this._input.slice(1);
334
+ return ch;
335
+ }, "input"),
336
+ unput: /* @__PURE__ */ __name(function(ch) {
337
+ var len = ch.length;
338
+ var lines = ch.split(/(?:\r\n?|\n)/g);
339
+ this._input = ch + this._input;
340
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
341
+ this.offset -= len;
342
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
343
+ this.match = this.match.substr(0, this.match.length - 1);
344
+ this.matched = this.matched.substr(0, this.matched.length - 1);
345
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
346
+ var r = this.yylloc.range;
347
+ this.yylloc = {
348
+ first_line: this.yylloc.first_line,
349
+ last_line: this.yylineno + 1,
350
+ first_column: this.yylloc.first_column,
351
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
352
+ };
353
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
354
+ this.yyleng = this.yytext.length;
355
+ return this;
356
+ }, "unput"),
357
+ more: /* @__PURE__ */ __name(function() {
358
+ this._more = true;
359
+ return this;
360
+ }, "more"),
361
+ reject: /* @__PURE__ */ __name(function() {
362
+ if (this.options.backtrack_lexer) this._backtrack = true;
363
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
364
+ text: "",
365
+ token: null,
366
+ line: this.yylineno
367
+ });
368
+ return this;
369
+ }, "reject"),
370
+ less: /* @__PURE__ */ __name(function(n) {
371
+ this.unput(this.match.slice(n));
372
+ }, "less"),
373
+ pastInput: /* @__PURE__ */ __name(function() {
374
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
375
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
376
+ }, "pastInput"),
377
+ upcomingInput: /* @__PURE__ */ __name(function() {
378
+ var next = this.match;
379
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
380
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
381
+ }, "upcomingInput"),
382
+ showPosition: /* @__PURE__ */ __name(function() {
383
+ var pre = this.pastInput();
384
+ var c = new Array(pre.length + 1).join("-");
385
+ return pre + this.upcomingInput() + "\n" + c + "^";
386
+ }, "showPosition"),
387
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
388
+ var token, lines, backup;
389
+ if (this.options.backtrack_lexer) {
390
+ backup = {
391
+ yylineno: this.yylineno,
392
+ yylloc: {
393
+ first_line: this.yylloc.first_line,
394
+ last_line: this.last_line,
395
+ first_column: this.yylloc.first_column,
396
+ last_column: this.yylloc.last_column
397
+ },
398
+ yytext: this.yytext,
399
+ match: this.match,
400
+ matches: this.matches,
401
+ matched: this.matched,
402
+ yyleng: this.yyleng,
403
+ offset: this.offset,
404
+ _more: this._more,
405
+ _input: this._input,
406
+ yy: this.yy,
407
+ conditionStack: this.conditionStack.slice(0),
408
+ done: this.done
409
+ };
410
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
411
+ }
412
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
413
+ if (lines) this.yylineno += lines.length;
414
+ this.yylloc = {
415
+ first_line: this.yylloc.last_line,
416
+ last_line: this.yylineno + 1,
417
+ first_column: this.yylloc.last_column,
418
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
419
+ };
420
+ this.yytext += match[0];
421
+ this.match += match[0];
422
+ this.matches = match;
423
+ this.yyleng = this.yytext.length;
424
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
425
+ this._more = false;
426
+ this._backtrack = false;
427
+ this._input = this._input.slice(match[0].length);
428
+ this.matched += match[0];
429
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
430
+ if (this.done && this._input) this.done = false;
431
+ if (token) return token;
432
+ else if (this._backtrack) {
433
+ for (var k in backup) this[k] = backup[k];
434
+ return false;
435
+ }
436
+ return false;
437
+ }, "test_match"),
438
+ next: /* @__PURE__ */ __name(function() {
439
+ if (this.done) return this.EOF;
440
+ if (!this._input) this.done = true;
441
+ var token, match, tempMatch, index;
442
+ if (!this._more) {
443
+ this.yytext = "";
444
+ this.match = "";
445
+ }
446
+ var rules = this._currentRules();
447
+ for (var i = 0; i < rules.length; i++) {
448
+ tempMatch = this._input.match(this.rules[rules[i]]);
449
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
450
+ match = tempMatch;
451
+ index = i;
452
+ if (this.options.backtrack_lexer) {
453
+ token = this.test_match(tempMatch, rules[i]);
454
+ if (token !== false) return token;
455
+ else if (this._backtrack) {
456
+ match = false;
457
+ continue;
458
+ } else return false;
459
+ } else if (!this.options.flex) break;
460
+ }
461
+ }
462
+ if (match) {
463
+ token = this.test_match(match, rules[index]);
464
+ if (token !== false) return token;
465
+ return false;
466
+ }
467
+ if (this._input === "") return this.EOF;
468
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
469
+ text: "",
470
+ token: null,
471
+ line: this.yylineno
472
+ });
473
+ }, "next"),
474
+ lex: /* @__PURE__ */ __name(function lex() {
475
+ var r = this.next();
476
+ if (r) return r;
477
+ else return this.lex();
478
+ }, "lex"),
479
+ begin: /* @__PURE__ */ __name(function begin(condition) {
480
+ this.conditionStack.push(condition);
481
+ }, "begin"),
482
+ popState: /* @__PURE__ */ __name(function popState() {
483
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
484
+ else return this.conditionStack[0];
485
+ }, "popState"),
486
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
487
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
488
+ else return this.conditions["INITIAL"].rules;
489
+ }, "_currentRules"),
490
+ topState: /* @__PURE__ */ __name(function topState(n) {
491
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
492
+ if (n >= 0) return this.conditionStack[n];
493
+ else return "INITIAL";
494
+ }, "topState"),
495
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
496
+ this.begin(condition);
497
+ }, "pushState"),
498
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
499
+ return this.conditionStack.length;
500
+ }, "stateStackSize"),
501
+ options: { "case-insensitive": true },
502
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
503
+ switch ($avoiding_name_collisions) {
504
+ case 0: return 6;
505
+ case 1: return 8;
506
+ case 2: return 8;
507
+ case 3: return 6;
508
+ case 4: return 7;
509
+ case 5: return 13;
510
+ case 6: return 14;
511
+ case 7: return 11;
512
+ }
513
+ }, "anonymous"),
514
+ rules: [
515
+ /^(?:\s*%%.*)/i,
516
+ /^(?:ishikawa-beta\b)/i,
517
+ /^(?:ishikawa\b)/i,
518
+ /^(?:[\s]+[\n])/i,
519
+ /^(?:[\n]+)/i,
520
+ /^(?:[\s]+)/i,
521
+ /^(?:[^\n]+)/i,
522
+ /^(?:$)/i
523
+ ],
524
+ conditions: { "INITIAL": {
525
+ "rules": [
526
+ 0,
527
+ 1,
528
+ 2,
529
+ 3,
530
+ 4,
531
+ 5,
532
+ 6,
533
+ 7
534
+ ],
535
+ "inclusive": true
536
+ } }
537
+ };
538
+ })();
539
+ function Parser() {
540
+ this.yy = {};
541
+ }
542
+ __name(Parser, "Parser");
543
+ Parser.prototype = parser2;
544
+ parser2.Parser = Parser;
545
+ return new Parser();
546
+ })();
547
+ parser.parser = parser;
548
+ var ishikawa_default = parser;
549
+ var IshikawaDB = class {
550
+ constructor() {
551
+ this.stack = [];
552
+ this.clear = this.clear.bind(this);
553
+ this.addNode = this.addNode.bind(this);
554
+ this.getRoot = this.getRoot.bind(this);
555
+ }
556
+ static {
557
+ __name(this, "IshikawaDB");
558
+ }
559
+ clear() {
560
+ this.root = void 0;
561
+ this.stack = [];
562
+ this.baseLevel = void 0;
563
+ clear();
564
+ }
565
+ getRoot() {
566
+ return this.root;
567
+ }
568
+ addNode(rawLevel, text) {
569
+ const label = common_default.sanitizeText(text, getConfig2());
570
+ if (!this.root) {
571
+ this.root = {
572
+ text: label,
573
+ children: []
574
+ };
575
+ this.stack = [{
576
+ level: 0,
577
+ node: this.root
578
+ }];
579
+ setDiagramTitle(label);
580
+ return;
581
+ }
582
+ this.baseLevel ??= rawLevel;
583
+ let level = rawLevel - this.baseLevel + 1;
584
+ if (level <= 0) level = 1;
585
+ while (this.stack.length > 1 && this.stack[this.stack.length - 1].level >= level) this.stack.pop();
586
+ const parent = this.stack[this.stack.length - 1].node;
587
+ const node = {
588
+ text: label,
589
+ children: []
590
+ };
591
+ parent.children.push(node);
592
+ this.stack.push({
593
+ level,
594
+ node
595
+ });
596
+ }
597
+ getAccTitle() {
598
+ return getAccTitle();
599
+ }
600
+ setAccTitle(title) {
601
+ setAccTitle(title);
602
+ }
603
+ getAccDescription() {
604
+ return getAccDescription();
605
+ }
606
+ setAccDescription(description) {
607
+ setAccDescription(description);
608
+ }
609
+ getDiagramTitle() {
610
+ return getDiagramTitle();
611
+ }
612
+ setDiagramTitle(title) {
613
+ setDiagramTitle(title);
614
+ }
615
+ };
616
+ var FONT_SIZE_DEFAULT = 14;
617
+ var SPINE_BASE_LENGTH = 250;
618
+ var BONE_STUB = 30;
619
+ var BONE_BASE = 60;
620
+ var BONE_PER_CHILD = 5;
621
+ var ANGLE = 82 * Math.PI / 180;
622
+ var COS_A = Math.cos(ANGLE);
623
+ var SIN_A = Math.sin(ANGLE);
624
+ var applyPaddedViewBox = /* @__PURE__ */ __name((svgEl, pad, maxW) => {
625
+ const bbox = svgEl.node().getBBox();
626
+ const w = bbox.width + pad * 2;
627
+ const h = bbox.height + pad * 2;
628
+ configureSvgSize(svgEl, h, w, maxW);
629
+ svgEl.attr("viewBox", `${bbox.x - pad} ${bbox.y - pad} ${w} ${h}`);
630
+ }, "applyPaddedViewBox");
631
+ var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
632
+ const root = diagram2.db.getRoot();
633
+ if (!root) return;
634
+ const drawConfig = getConfig2();
635
+ const { look, handDrawnSeed, themeVariables } = drawConfig;
636
+ const fontSize = parseFontSize(drawConfig.fontSize)[0] ?? FONT_SIZE_DEFAULT;
637
+ const isHandDrawn = look === "handDrawn";
638
+ const causes = root.children ?? [];
639
+ const padding = drawConfig.ishikawa?.diagramPadding ?? 20;
640
+ const useMaxWidth = drawConfig.ishikawa?.useMaxWidth ?? false;
641
+ const svg = selectSvgElement(id);
642
+ const g = svg.append("g").attr("class", "ishikawa");
643
+ const roughSvg = isHandDrawn ? at.svg(svg.node()) : void 0;
644
+ const roughContext = roughSvg ? {
645
+ roughSvg,
646
+ seed: handDrawnSeed ?? 0,
647
+ lineColor: themeVariables?.lineColor ?? "#333",
648
+ fillColor: themeVariables?.mainBkg ?? "#fff"
649
+ } : void 0;
650
+ const markerId = `ishikawa-arrow-${id}`;
651
+ if (!isHandDrawn) g.append("defs").append("marker").attr("id", markerId).attr("viewBox", "0 0 10 10").attr("refX", 0).attr("refY", 5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 Z").attr("class", "ishikawa-arrow");
652
+ let spineX = 0;
653
+ let spineY = SPINE_BASE_LENGTH;
654
+ const spineLine = isHandDrawn ? void 0 : drawLine(g, spineX, spineY, spineX, spineY, "ishikawa-spine");
655
+ drawHead(g, spineX, spineY, root.text, fontSize, roughContext);
656
+ if (!causes.length) {
657
+ if (isHandDrawn) drawLine(g, spineX, spineY, spineX, spineY, "ishikawa-spine", roughContext);
658
+ applyPaddedViewBox(svg, padding, useMaxWidth);
659
+ return;
660
+ }
661
+ spineX -= 20;
662
+ const upperCauses = causes.filter((_, i) => i % 2 === 0);
663
+ const lowerCauses = causes.filter((_, i) => i % 2 === 1);
664
+ const upperStats = sideStats(upperCauses);
665
+ const lowerStats = sideStats(lowerCauses);
666
+ const descendantTotal = upperStats.total + lowerStats.total;
667
+ let upperLen = SPINE_BASE_LENGTH;
668
+ let lowerLen = SPINE_BASE_LENGTH;
669
+ if (descendantTotal > 0) {
670
+ const pool = SPINE_BASE_LENGTH * 2;
671
+ const minLen = SPINE_BASE_LENGTH * .3;
672
+ upperLen = Math.max(minLen, pool * (upperStats.total / descendantTotal));
673
+ lowerLen = Math.max(minLen, pool * (lowerStats.total / descendantTotal));
674
+ }
675
+ const minSpacing = fontSize * 2;
676
+ upperLen = Math.max(upperLen, upperStats.max * minSpacing);
677
+ lowerLen = Math.max(lowerLen, lowerStats.max * minSpacing);
678
+ spineY = Math.max(upperLen, SPINE_BASE_LENGTH);
679
+ if (spineLine) spineLine.attr("y1", spineY).attr("y2", spineY);
680
+ g.select(".ishikawa-head-group").attr("transform", `translate(0,${spineY})`);
681
+ const pairCount = Math.ceil(causes.length / 2);
682
+ for (let p = 0; p < pairCount; p++) {
683
+ const pg = g.append("g").attr("class", "ishikawa-pair");
684
+ for (const [cause, dir, len] of [[
685
+ causes[p * 2],
686
+ -1,
687
+ upperLen
688
+ ], [
689
+ causes[p * 2 + 1],
690
+ 1,
691
+ lowerLen
692
+ ]]) if (cause) drawBranch(pg, cause, spineX, spineY, dir, len, fontSize, roughContext);
693
+ spineX = pg.selectAll("text").nodes().reduce((left, n) => Math.min(left, n.getBBox().x), Infinity);
694
+ }
695
+ if (isHandDrawn) drawLine(g, spineX, spineY, 0, spineY, "ishikawa-spine", roughContext);
696
+ else {
697
+ spineLine.attr("x1", spineX);
698
+ const markerUrl = `url(#${markerId})`;
699
+ g.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start", markerUrl);
700
+ }
701
+ applyPaddedViewBox(svg, padding, useMaxWidth);
702
+ }, "draw");
703
+ var sideStats = /* @__PURE__ */ __name((nodes) => {
704
+ const countDescendants = /* @__PURE__ */ __name((node) => node.children.reduce((sum, child) => sum + 1 + countDescendants(child), 0), "countDescendants");
705
+ return nodes.reduce((stats, node) => {
706
+ const descendants = countDescendants(node);
707
+ stats.total += descendants;
708
+ stats.max = Math.max(stats.max, descendants);
709
+ return stats;
710
+ }, {
711
+ total: 0,
712
+ max: 0
713
+ });
714
+ }, "sideStats");
715
+ var drawHead = /* @__PURE__ */ __name((svg, x, y, label, fontSize, roughContext) => {
716
+ const maxChars = Math.max(6, Math.floor(110 / (fontSize * .6)));
717
+ const headGroup = svg.append("g").attr("class", "ishikawa-head-group").attr("transform", `translate(${x},${y})`);
718
+ const textEl = drawMultilineText(headGroup, wrapText(label, maxChars), 0, 0, "ishikawa-head-label", "start", fontSize);
719
+ const tb = textEl.node().getBBox();
720
+ const w = Math.max(60, tb.width + 6);
721
+ const h = Math.max(40, tb.height * 2 + 40);
722
+ const headPath = `M 0 ${-h / 2} L 0 ${h / 2} Q ${w * 2.4} 0 0 ${-h / 2} Z`;
723
+ if (roughContext) {
724
+ const roughNode = roughContext.roughSvg.path(headPath, {
725
+ roughness: 1.5,
726
+ seed: roughContext.seed,
727
+ fill: roughContext.fillColor,
728
+ fillStyle: "hachure",
729
+ fillWeight: 2.5,
730
+ hachureGap: 5,
731
+ stroke: roughContext.lineColor,
732
+ strokeWidth: 2
733
+ });
734
+ headGroup.insert(() => roughNode, ":first-child").attr("class", "ishikawa-head");
735
+ } else headGroup.insert("path", ":first-child").attr("class", "ishikawa-head").attr("d", headPath);
736
+ textEl.attr("transform", `translate(${(w - tb.width) / 2 - tb.x + 3},${-tb.y - tb.height / 2})`);
737
+ }, "drawHead");
738
+ var flattenTree = /* @__PURE__ */ __name((children, direction) => {
739
+ const entries = [];
740
+ const yOrder = [];
741
+ const walk = /* @__PURE__ */ __name((nodes, pid, depth) => {
742
+ const ordered = direction === -1 ? [...nodes].reverse() : nodes;
743
+ for (const child of ordered) {
744
+ const idx = entries.length;
745
+ const gc = child.children ?? [];
746
+ entries.push({
747
+ depth,
748
+ text: wrapText(child.text, 15),
749
+ parentIndex: pid,
750
+ childCount: gc.length
751
+ });
752
+ if (depth % 2 === 0) {
753
+ yOrder.push(idx);
754
+ if (gc.length) walk(gc, idx, depth + 1);
755
+ } else {
756
+ if (gc.length) walk(gc, idx, depth + 1);
757
+ yOrder.push(idx);
758
+ }
759
+ }
760
+ }, "walk");
761
+ walk(children, -1, 2);
762
+ return {
763
+ entries,
764
+ yOrder
765
+ };
766
+ }, "flattenTree");
767
+ var drawCauseLabel = /* @__PURE__ */ __name((svg, text, x, y, direction, fontSize, roughContext) => {
768
+ const lg = svg.append("g").attr("class", "ishikawa-label-group");
769
+ const tb = drawMultilineText(lg, text, x, y + 11 * direction, "ishikawa-label cause", "middle", fontSize).node().getBBox();
770
+ if (roughContext) {
771
+ const roughNode = roughContext.roughSvg.rectangle(tb.x - 20, tb.y - 2, tb.width + 40, tb.height + 4, {
772
+ roughness: 1.5,
773
+ seed: roughContext.seed,
774
+ fill: roughContext.fillColor,
775
+ fillStyle: "hachure",
776
+ fillWeight: 2.5,
777
+ hachureGap: 5,
778
+ stroke: roughContext.lineColor,
779
+ strokeWidth: 2
780
+ });
781
+ lg.insert(() => roughNode, ":first-child").attr("class", "ishikawa-label-box");
782
+ } else lg.insert("rect", ":first-child").attr("class", "ishikawa-label-box").attr("x", tb.x - 20).attr("y", tb.y - 2).attr("width", tb.width + 40).attr("height", tb.height + 4);
783
+ }, "drawCauseLabel");
784
+ var drawArrowMarker = /* @__PURE__ */ __name((g, x, y, dx, dy, roughContext) => {
785
+ const len = Math.sqrt(dx * dx + dy * dy);
786
+ if (len === 0) return;
787
+ const ux = dx / len;
788
+ const uy = dy / len;
789
+ const s = 6;
790
+ const px = -uy * s;
791
+ const py = ux * s;
792
+ const tipX = x;
793
+ const tipY = y;
794
+ const d = `M ${tipX} ${tipY} L ${tipX - ux * s * 2 + px} ${tipY - uy * s * 2 + py} L ${tipX - ux * s * 2 - px} ${tipY - uy * s * 2 - py} Z`;
795
+ const roughNode = roughContext.roughSvg.path(d, {
796
+ roughness: 1,
797
+ seed: roughContext.seed,
798
+ fill: roughContext.lineColor,
799
+ fillStyle: "solid",
800
+ stroke: roughContext.lineColor,
801
+ strokeWidth: 1
802
+ });
803
+ g.append(() => roughNode);
804
+ }, "drawArrowMarker");
805
+ var drawBranch = /* @__PURE__ */ __name((svg, node, startX, startY, direction, length, fontSize, roughContext) => {
806
+ const children = node.children ?? [];
807
+ const lineLen = length * (children.length ? 1 : .2);
808
+ const dx = -COS_A * lineLen;
809
+ const dy = SIN_A * lineLen * direction;
810
+ const endX = startX + dx;
811
+ const endY = startY + dy;
812
+ drawLine(svg, startX, startY, endX, endY, "ishikawa-branch", roughContext);
813
+ if (roughContext) drawArrowMarker(svg, startX, startY, startX - endX, startY - endY, roughContext);
814
+ drawCauseLabel(svg, node.text, endX, endY, direction, fontSize, roughContext);
815
+ if (!children.length) return;
816
+ const { entries, yOrder } = flattenTree(children, direction);
817
+ const entryCount = entries.length;
818
+ const ys = new Array(entryCount);
819
+ for (const [slot, entryIdx] of yOrder.entries()) ys[entryIdx] = startY + dy * ((slot + 1) / (entryCount + 1));
820
+ const bones = /* @__PURE__ */ new Map();
821
+ bones.set(-1, {
822
+ x0: startX,
823
+ y0: startY,
824
+ x1: endX,
825
+ y1: endY,
826
+ childCount: children.length,
827
+ childrenDrawn: 0
828
+ });
829
+ const diagonalX = -COS_A;
830
+ const diagonalY = SIN_A * direction;
831
+ const oddLabel = direction < 0 ? "ishikawa-label up" : "ishikawa-label down";
832
+ for (const [i, e] of entries.entries()) {
833
+ const y = ys[i];
834
+ const par = bones.get(e.parentIndex);
835
+ const grp = svg.append("g").attr("class", "ishikawa-sub-group");
836
+ let bx0 = 0;
837
+ let by0 = 0;
838
+ let bx1 = 0;
839
+ if (e.depth % 2 === 0) {
840
+ const dyP = par.y1 - par.y0;
841
+ bx0 = lerp(par.x0, par.x1, dyP ? (y - par.y0) / dyP : .5);
842
+ by0 = y;
843
+ bx1 = bx0 - (e.childCount > 0 ? BONE_BASE + e.childCount * BONE_PER_CHILD : BONE_STUB);
844
+ drawLine(grp, bx0, y, bx1, y, "ishikawa-sub-branch", roughContext);
845
+ if (roughContext) drawArrowMarker(grp, bx0, y, 1, 0, roughContext);
846
+ drawMultilineText(grp, e.text, bx1, y, "ishikawa-label align", "end", fontSize);
847
+ } else {
848
+ const k = par.childrenDrawn++;
849
+ bx0 = lerp(par.x0, par.x1, (par.childCount - k) / (par.childCount + 1));
850
+ by0 = par.y0;
851
+ bx1 = bx0 + diagonalX * ((y - by0) / diagonalY);
852
+ drawLine(grp, bx0, by0, bx1, y, "ishikawa-sub-branch", roughContext);
853
+ if (roughContext) drawArrowMarker(grp, bx0, by0, bx0 - bx1, by0 - y, roughContext);
854
+ drawMultilineText(grp, e.text, bx1, y, oddLabel, "end", fontSize);
855
+ }
856
+ if (e.childCount > 0) bones.set(i, {
857
+ x0: bx0,
858
+ y0: by0,
859
+ x1: bx1,
860
+ y1: y,
861
+ childCount: e.childCount,
862
+ childrenDrawn: 0
863
+ });
864
+ }
865
+ }, "drawBranch");
866
+ var splitLines = /* @__PURE__ */ __name((text) => text.split(/<br\s*\/?>|\n/), "splitLines");
867
+ var wrapText = /* @__PURE__ */ __name((text, maxChars) => {
868
+ if (text.length <= maxChars) return text;
869
+ const lines = [];
870
+ for (const word of text.split(/\s+/)) {
871
+ const last = lines.length - 1;
872
+ if (last >= 0 && lines[last].length + 1 + word.length <= maxChars) lines[last] += " " + word;
873
+ else lines.push(word);
874
+ }
875
+ return lines.join("\n");
876
+ }, "wrapText");
877
+ var drawMultilineText = /* @__PURE__ */ __name((g, text, x, y, cls, anchor, fontSize) => {
878
+ const lines = splitLines(text);
879
+ const lh = fontSize * 1.05;
880
+ const el = g.append("text").attr("class", cls).attr("text-anchor", anchor).attr("x", x).attr("y", y - (lines.length - 1) * lh / 2);
881
+ for (const [i, line] of lines.entries()) el.append("tspan").attr("x", x).attr("dy", i === 0 ? 0 : lh).text(line);
882
+ return el;
883
+ }, "drawMultilineText");
884
+ var lerp = /* @__PURE__ */ __name((a, b, t) => a + (b - a) * t, "lerp");
885
+ var drawLine = /* @__PURE__ */ __name((g, x1, y1, x2, y2, cls, roughContext) => {
886
+ if (roughContext) {
887
+ const roughNode = roughContext.roughSvg.line(x1, y1, x2, y2, {
888
+ roughness: 1.5,
889
+ seed: roughContext.seed,
890
+ stroke: roughContext.lineColor,
891
+ strokeWidth: 2
892
+ });
893
+ g.append(() => roughNode).attr("class", cls);
894
+ return;
895
+ }
896
+ return g.append("line").attr("class", cls).attr("x1", x1).attr("y1", y1).attr("x2", x2).attr("y2", y2);
897
+ }, "drawLine");
898
+ var diagram = {
899
+ parser: ishikawa_default,
900
+ get db() {
901
+ return new IshikawaDB();
902
+ },
903
+ renderer: { draw },
904
+ styles: /* @__PURE__ */ __name((options) => `
905
+ .ishikawa .ishikawa-spine,
906
+ .ishikawa .ishikawa-branch,
907
+ .ishikawa .ishikawa-sub-branch {
908
+ stroke: ${options.lineColor};
909
+ stroke-width: 2;
910
+ fill: none;
911
+ }
912
+
913
+ .ishikawa .ishikawa-sub-branch {
914
+ stroke-width: 1;
915
+ }
916
+
917
+ .ishikawa .ishikawa-arrow {
918
+ fill: ${options.lineColor};
919
+ }
920
+
921
+ .ishikawa .ishikawa-head {
922
+ fill: ${options.mainBkg};
923
+ stroke: ${options.lineColor};
924
+ stroke-width: 2;
925
+ }
926
+
927
+ .ishikawa .ishikawa-label-box {
928
+ fill: ${options.mainBkg};
929
+ stroke: ${options.lineColor};
930
+ stroke-width: 2;
931
+ }
932
+
933
+ .ishikawa text {
934
+ font-family: ${options.fontFamily};
935
+ font-size: ${options.fontSize};
936
+ fill: ${options.textColor};
937
+ }
938
+
939
+ .ishikawa .ishikawa-head-label {
940
+ font-weight: 600;
941
+ text-anchor: middle;
942
+ dominant-baseline: middle;
943
+ font-size: 14px;
944
+ }
945
+
946
+ .ishikawa .ishikawa-label {
947
+ text-anchor: end;
948
+ }
949
+
950
+ .ishikawa .ishikawa-label.cause {
951
+ text-anchor: middle;
952
+ dominant-baseline: middle;
953
+ }
954
+
955
+ .ishikawa .ishikawa-label.align {
956
+ text-anchor: end;
957
+ dominant-baseline: middle;
958
+ }
959
+
960
+ .ishikawa .ishikawa-label.up {
961
+ dominant-baseline: baseline;
962
+ }
963
+
964
+ .ishikawa .ishikawa-label.down {
965
+ dominant-baseline: hanging;
966
+ }
967
+ `, "getStyles")
968
+ };
969
+
970
+ //#endregion
971
+ export { diagram };