@fibery/custom-app-text-editor 1.2.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 (105) hide show
  1. package/LICENSE +214 -0
  2. package/README.md +33 -0
  3. package/lib/abnfDiagram-VRR7QNED-BgjOQqEh.js +89 -0
  4. package/lib/arc-Dp0rqagO.js +82 -0
  5. package/lib/architecture-TIHT7OUA-DDwCCw0y.js +3 -0
  6. package/lib/architectureDiagram-ZJ3FMSHR-BucIluTN.js +4129 -0
  7. package/lib/array-CApNbSU9.js +6 -0
  8. package/lib/blockDiagram-677ZJIJ3-CWYuHThP.js +3157 -0
  9. package/lib/c4Diagram-LMCZKHZV-Cr3_W-xe.js +2982 -0
  10. package/lib/channel-Bb7a6w5c.js +5 -0
  11. package/lib/chunk-2Q5K7J3B-CINvUK-A.js +15 -0
  12. package/lib/chunk-32BRIVSS-b-BvyGz0.js +61 -0
  13. package/lib/chunk-52WLFC77-Cf8zEoqs.js +593 -0
  14. package/lib/chunk-5VM5RSS4-Dnx15xMv.js +5 -0
  15. package/lib/chunk-7BUUIJ7U-B018BbRy.js +82 -0
  16. package/lib/chunk-C7G6YPKG-CmOuVFlJ.js +67 -0
  17. package/lib/chunk-EX3LRPZG-LynZw14I.js +2042 -0
  18. package/lib/chunk-HOUHSVGY-Br7ZSMKe.js +275 -0
  19. package/lib/chunk-ICXQ74PX-VqT5WUTt.js +1330 -0
  20. package/lib/chunk-JWPE2WC7-Ch0jmUXM.js +8 -0
  21. package/lib/chunk-KEIR6QF5-RwFi50en.js +21456 -0
  22. package/lib/chunk-MOJQB5TN-rQ4AfTd9.js +490 -0
  23. package/lib/chunk-OGEWGWER-BvF6eV9Q.js +32 -0
  24. package/lib/chunk-PUDLZKDR-BW7SZvCB.js +4135 -0
  25. package/lib/chunk-Q4XR5HBZ-CRgGP3ez.js +1635 -0
  26. package/lib/chunk-RYQCIY6F-CHlASUpG.js +241 -0
  27. package/lib/chunk-V7JOEXUC-OY39ml6X.js +3357 -0
  28. package/lib/chunk-VR4S4FIN-Bk7IFdYB.js +26 -0
  29. package/lib/chunk-WYO6CB5R-MV-yOaop.js +3769 -0
  30. package/lib/chunk-XXDRQBXY-Djd1ChwJ.js +9 -0
  31. package/lib/chunk-Y2CYZVJY-QdJ4V9rh.js +12 -0
  32. package/lib/chunk-ZGVPDNZ5-l81xl1BI.js +3738 -0
  33. package/lib/classDiagram-OUVF2IWQ--wRzSvLt.js +30 -0
  34. package/lib/classDiagram-v2-EOCWNBFH-ChMCdPO-.js +30 -0
  35. package/lib/cose-bilkent-JH36ORCC-CyVZn5M3.js +2254 -0
  36. package/lib/custom-app-text-editor.css +2 -0
  37. package/lib/custom-app-text-editor.js +81102 -0
  38. package/lib/cynefin-VYW2F7L2-CMgnLl46.js +3 -0
  39. package/lib/cynefinDiagram-TSTJHNR4-988Y73wV.js +355 -0
  40. package/lib/cytoscape.esm-DMXbtFI-.js +18145 -0
  41. package/lib/dagre-Dmarb1s8.js +1699 -0
  42. package/lib/dagre-VKFMJZFB-Bf-pz2Lx.js +328 -0
  43. package/lib/defaultLocale-A87O3snN.js +198 -0
  44. package/lib/diagram-FQU43EPY-BT8WeVzc.js +432 -0
  45. package/lib/diagram-G47NLZAW-vZ2XG37l.js +527 -0
  46. package/lib/diagram-NH7WQ7WH-CH0IfHB0.js +134 -0
  47. package/lib/diagram-OA4YK3LP-BgwQcJfp.js +300 -0
  48. package/lib/diagram-WEI45ONY-Cd3sVPil.js +214 -0
  49. package/lib/dist-PGS6ynRO.js +59 -0
  50. package/lib/ebnfDiagram-CCIWWBDH-CwBFb2Fm.js +100 -0
  51. package/lib/erDiagram-Q63AITRT-BshRACvj.js +1727 -0
  52. package/lib/eventmodeling-45OFAUF4-BDhzj03B.js +3 -0
  53. package/lib/flowDiagram-23GEKE2U-C3zDgFvZ.js +16 -0
  54. package/lib/ganttDiagram-NO4QXBWP-BD5PiE8x.js +3073 -0
  55. package/lib/gitGraph-TEB2WS4Q-DJA_hE4G.js +3 -0
  56. package/lib/gitGraphDiagram-IHSO6WYX-BAhccBh3.js +733 -0
  57. package/lib/graphlib-DglfpsVp.js +1267 -0
  58. package/lib/index.browser-Dv9K8IAp.js +26 -0
  59. package/lib/info-DKCQHKI2-BD_vOCz6.js +3 -0
  60. package/lib/infoDiagram-FWYZ7A6U-CGZnf03G.js +20 -0
  61. package/lib/init-sjaVZO3f.js +13 -0
  62. package/lib/ishikawaDiagram-FXEZZL3T-PFfVM0NO.js +719 -0
  63. package/lib/journeyDiagram-5HDEW3XC-CRGz7dcx.js +884 -0
  64. package/lib/kanban-definition-HUTT4EX6-BBH4Yn5e.js +974 -0
  65. package/lib/line-CJQicKfr.js +34 -0
  66. package/lib/linear-B9Cv96-J.js +288 -0
  67. package/lib/map-C7KALUOH.js +241 -0
  68. package/lib/mermaid-parser.core-BupC9XGF.js +638 -0
  69. package/lib/mermaid-renderer-Cp0xusfR.js +2425 -0
  70. package/lib/mindmap-definition-LN4V7U3C-CWL1sg0K.js +978 -0
  71. package/lib/ordinal-CNQzPcrr.js +65 -0
  72. package/lib/packet-7NZHBO7P-CgBlALV1.js +3 -0
  73. package/lib/path-DVvH25eQ.js +84 -0
  74. package/lib/pegDiagram-2B236MQR-BKv8dTtv.js +94 -0
  75. package/lib/pie-RZYD4A2V-CryPC-P_.js +3 -0
  76. package/lib/pieDiagram-ENE6RG2P-CXeFg_cL.js +203 -0
  77. package/lib/quadrantDiagram-ABIIQ3AL-v_u3aC8Y.js +2001 -0
  78. package/lib/radar-I7S5WNFK-DgzJDRy3.js +3 -0
  79. package/lib/railroad-3IZDKUUU-DFp3mbpB.js +3 -0
  80. package/lib/railroad-abnf-AHOZXSZD-BRjidKH0.js +3 -0
  81. package/lib/railroad-ebnf-EBAXGLYW-PgrDWact.js +3 -0
  82. package/lib/railroad-peg-LSFZ7HO6-CMKir81Y.js +3 -0
  83. package/lib/railroadDiagram-RFXS5EU6-mEC9tVS-.js +76 -0
  84. package/lib/requirementDiagram-TGXJPOKE-BAEzI7V4.js +2223 -0
  85. package/lib/rolldown-runtime-DArdT4gl.js +23 -0
  86. package/lib/rough.esm-B2w_aYoc.js +1361 -0
  87. package/lib/sankeyDiagram-HTMAVEWB-Dbu-sl2E.js +972 -0
  88. package/lib/sequenceDiagram-DBY2YBRQ-DCuWmWHX.js +4156 -0
  89. package/lib/sizeCapture-X5ZJPWSS-BEIM84He.js +46 -0
  90. package/lib/src-DQbL46sB.js +2139 -0
  91. package/lib/src-DuuHKEe6.js +704 -0
  92. package/lib/stateDiagram-2N3HPSRC-fs9QmDMR.js +220 -0
  93. package/lib/stateDiagram-v2-6OUMAXLB-wWxYbttN.js +30 -0
  94. package/lib/swimlanes-5IMT3BWC-QaXUd9db.js +5069 -0
  95. package/lib/swimlanesDiagram-G3AALYLV-BtGToCzH.js +30 -0
  96. package/lib/timeline-definition-FHXFAJF6-CAsyJrsw.js +1069 -0
  97. package/lib/treeView-QDETBFTQ-DVp4aTZQ.js +3 -0
  98. package/lib/treemap-6X3UGDF4-BbBnHMHJ.js +3 -0
  99. package/lib/types.d.ts +44 -0
  100. package/lib/v4-CZv9Hsqq.js +33 -0
  101. package/lib/vennDiagram-L72KCM5P-C87u0gjr.js +1880 -0
  102. package/lib/wardley-OPB4EBWU-B-RXhnoN.js +3 -0
  103. package/lib/wardleyDiagram-EHGQE667-BxviBDl_.js +645 -0
  104. package/lib/xychartDiagram-FW5EYKEG-BQQhanuH.js +2098 -0
  105. package/package.json +29 -0
@@ -0,0 +1,719 @@
1
+ import { n as e } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
2
+ import "./src-DQbL46sB.js";
3
+ import { H as t, K as n, U as r, a as i, c as a, s as o, v as s, w as c, x as l, y as u } from "./chunk-WYO6CB5R-MV-yOaop.js";
4
+ import { p as d } from "./chunk-ICXQ74PX-VqT5WUTt.js";
5
+ import { t as f } from "./rough.esm-B2w_aYoc.js";
6
+ import { a as p } from "./mermaid-renderer-Cp0xusfR.js";
7
+ //#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-FXEZZL3T.mjs
8
+ var m = (function() {
9
+ var t = /* @__PURE__ */ e(function(e, t, n, r) {
10
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
11
+ return n;
12
+ }, "o"), n = [1, 4], r = [1, 14], i = [1, 12], a = [1, 13], o = [
13
+ 6,
14
+ 7,
15
+ 8
16
+ ], s = [1, 20], c = [1, 18], l = [1, 19], u = [
17
+ 6,
18
+ 7,
19
+ 11
20
+ ], d = [
21
+ 1,
22
+ 6,
23
+ 13,
24
+ 14
25
+ ], f = [1, 23], p = [1, 24], m = [
26
+ 1,
27
+ 6,
28
+ 7,
29
+ 11,
30
+ 13,
31
+ 14
32
+ ], h = {
33
+ trace: /* @__PURE__ */ e(function() {}, "trace"),
34
+ yy: {},
35
+ symbols_: {
36
+ error: 2,
37
+ start: 3,
38
+ ishikawa: 4,
39
+ spaceLines: 5,
40
+ SPACELINE: 6,
41
+ NL: 7,
42
+ ISHIKAWA: 8,
43
+ document: 9,
44
+ stop: 10,
45
+ EOF: 11,
46
+ statement: 12,
47
+ SPACELIST: 13,
48
+ TEXT: 14,
49
+ $accept: 0,
50
+ $end: 1
51
+ },
52
+ terminals_: {
53
+ 2: "error",
54
+ 6: "SPACELINE",
55
+ 7: "NL",
56
+ 8: "ISHIKAWA",
57
+ 11: "EOF",
58
+ 13: "SPACELIST",
59
+ 14: "TEXT"
60
+ },
61
+ productions_: [
62
+ 0,
63
+ [3, 1],
64
+ [3, 2],
65
+ [5, 1],
66
+ [5, 2],
67
+ [5, 2],
68
+ [4, 2],
69
+ [4, 3],
70
+ [10, 1],
71
+ [10, 1],
72
+ [10, 1],
73
+ [10, 2],
74
+ [10, 2],
75
+ [9, 3],
76
+ [9, 2],
77
+ [12, 2],
78
+ [12, 1],
79
+ [12, 1],
80
+ [12, 1]
81
+ ],
82
+ performAction: /* @__PURE__ */ e(function(e, t, n, r, i, a, o) {
83
+ var s = a.length - 1;
84
+ switch (i) {
85
+ case 6:
86
+ case 7: return r;
87
+ case 15:
88
+ r.addNode(a[s - 1].length, a[s].trim());
89
+ break;
90
+ case 16: r.addNode(0, a[s].trim());
91
+ }
92
+ }, "anonymous"),
93
+ table: [
94
+ {
95
+ 3: 1,
96
+ 4: 2,
97
+ 5: 3,
98
+ 6: [1, 5],
99
+ 8: n
100
+ },
101
+ { 1: [3] },
102
+ { 1: [2, 1] },
103
+ {
104
+ 4: 6,
105
+ 6: [1, 7],
106
+ 7: [1, 8],
107
+ 8: n
108
+ },
109
+ {
110
+ 6: r,
111
+ 7: [1, 10],
112
+ 9: 9,
113
+ 12: 11,
114
+ 13: i,
115
+ 14: a
116
+ },
117
+ t(o, [2, 3]),
118
+ { 1: [2, 2] },
119
+ t(o, [2, 4]),
120
+ t(o, [2, 5]),
121
+ {
122
+ 1: [2, 6],
123
+ 6: r,
124
+ 12: 15,
125
+ 13: i,
126
+ 14: a
127
+ },
128
+ {
129
+ 6: r,
130
+ 9: 16,
131
+ 12: 11,
132
+ 13: i,
133
+ 14: a
134
+ },
135
+ {
136
+ 6: s,
137
+ 7: c,
138
+ 10: 17,
139
+ 11: l
140
+ },
141
+ t(u, [2, 18], { 14: [1, 21] }),
142
+ t(u, [2, 16]),
143
+ t(u, [2, 17]),
144
+ {
145
+ 6: s,
146
+ 7: c,
147
+ 10: 22,
148
+ 11: l
149
+ },
150
+ {
151
+ 1: [2, 7],
152
+ 6: r,
153
+ 12: 15,
154
+ 13: i,
155
+ 14: a
156
+ },
157
+ t(d, [2, 14], {
158
+ 7: f,
159
+ 11: p
160
+ }),
161
+ t(m, [2, 8]),
162
+ t(m, [2, 9]),
163
+ t(m, [2, 10]),
164
+ t(u, [2, 15]),
165
+ t(d, [2, 13], {
166
+ 7: f,
167
+ 11: p
168
+ }),
169
+ t(m, [2, 11]),
170
+ t(m, [2, 12])
171
+ ],
172
+ defaultActions: {
173
+ 2: [2, 1],
174
+ 6: [2, 2]
175
+ },
176
+ parseError: /* @__PURE__ */ e(function(e, t) {
177
+ if (t.recoverable) this.trace(e);
178
+ else {
179
+ var n = Error(e);
180
+ throw n.hash = t, n;
181
+ }
182
+ }, "parseError"),
183
+ parse: /* @__PURE__ */ e(function(t) {
184
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
185
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
186
+ h.setInput(t, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
187
+ var v = h.yylloc;
188
+ o.push(v);
189
+ var y = h.options && h.options.ranges;
190
+ this.parseError = typeof g.yy.parseError == "function" ? g.yy.parseError : Object.getPrototypeOf(this).parseError;
191
+ function b(e) {
192
+ r.length -= 2 * e, a.length -= e, o.length -= e;
193
+ }
194
+ e(b, "popStack");
195
+ function x() {
196
+ var e = i.pop() || h.lex() || p;
197
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
198
+ }
199
+ e(x, "lex");
200
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
201
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
202
+ var M = "";
203
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
204
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
205
+ text: h.match,
206
+ token: this.terminals_[S] || S,
207
+ line: h.yylineno,
208
+ loc: v,
209
+ expected: j
210
+ });
211
+ }
212
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
213
+ switch (T[0]) {
214
+ case 1:
215
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
216
+ break;
217
+ case 2:
218
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
219
+ first_line: o[o.length - (k || 1)].first_line,
220
+ last_line: o[o.length - 1].last_line,
221
+ first_column: o[o.length - (k || 1)].first_column,
222
+ last_column: o[o.length - 1].last_column
223
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
224
+ c,
225
+ u,
226
+ l,
227
+ g.yy,
228
+ T[1],
229
+ a,
230
+ o
231
+ ].concat(m)), E !== void 0) return E;
232
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
233
+ break;
234
+ case 3: return !0;
235
+ }
236
+ }
237
+ return !0;
238
+ }, "parse")
239
+ };
240
+ h.lexer = /* @__PURE__ */ (function() {
241
+ return {
242
+ EOF: 1,
243
+ parseError: /* @__PURE__ */ e(function(e, t) {
244
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
245
+ else throw Error(e);
246
+ }, "parseError"),
247
+ setInput: /* @__PURE__ */ e(function(e, t) {
248
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
249
+ first_line: 1,
250
+ first_column: 0,
251
+ last_line: 1,
252
+ last_column: 0
253
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
254
+ }, "setInput"),
255
+ input: /* @__PURE__ */ e(function() {
256
+ var e = this._input[0];
257
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
258
+ }, "input"),
259
+ unput: /* @__PURE__ */ e(function(e) {
260
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
261
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
262
+ var r = this.match.split(/(?:\r\n?|\n)/g);
263
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
264
+ var i = this.yylloc.range;
265
+ return this.yylloc = {
266
+ first_line: this.yylloc.first_line,
267
+ last_line: this.yylineno + 1,
268
+ first_column: this.yylloc.first_column,
269
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
270
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
271
+ }, "unput"),
272
+ more: /* @__PURE__ */ e(function() {
273
+ return this._more = !0, this;
274
+ }, "more"),
275
+ reject: /* @__PURE__ */ e(function() {
276
+ if (this.options.backtrack_lexer) this._backtrack = !0;
277
+ 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(), {
278
+ text: "",
279
+ token: null,
280
+ line: this.yylineno
281
+ });
282
+ return this;
283
+ }, "reject"),
284
+ less: /* @__PURE__ */ e(function(e) {
285
+ this.unput(this.match.slice(e));
286
+ }, "less"),
287
+ pastInput: /* @__PURE__ */ e(function() {
288
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
289
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
290
+ }, "pastInput"),
291
+ upcomingInput: /* @__PURE__ */ e(function() {
292
+ var e = this.match;
293
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
294
+ }, "upcomingInput"),
295
+ showPosition: /* @__PURE__ */ e(function() {
296
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
297
+ return e + this.upcomingInput() + "\n" + t + "^";
298
+ }, "showPosition"),
299
+ test_match: /* @__PURE__ */ e(function(e, t) {
300
+ var n, r, i;
301
+ if (this.options.backtrack_lexer && (i = {
302
+ yylineno: this.yylineno,
303
+ yylloc: {
304
+ first_line: this.yylloc.first_line,
305
+ last_line: this.last_line,
306
+ first_column: this.yylloc.first_column,
307
+ last_column: this.yylloc.last_column
308
+ },
309
+ yytext: this.yytext,
310
+ match: this.match,
311
+ matches: this.matches,
312
+ matched: this.matched,
313
+ yyleng: this.yyleng,
314
+ offset: this.offset,
315
+ _more: this._more,
316
+ _input: this._input,
317
+ yy: this.yy,
318
+ conditionStack: this.conditionStack.slice(0),
319
+ done: this.done
320
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
321
+ first_line: this.yylloc.last_line,
322
+ last_line: this.yylineno + 1,
323
+ first_column: this.yylloc.last_column,
324
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
325
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
326
+ if (this._backtrack) {
327
+ for (var a in i) this[a] = i[a];
328
+ return !1;
329
+ }
330
+ return !1;
331
+ }, "test_match"),
332
+ next: /* @__PURE__ */ e(function() {
333
+ if (this.done) return this.EOF;
334
+ this._input || (this.done = !0);
335
+ var e, t, n, r;
336
+ this._more || (this.yytext = "", this.match = "");
337
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
338
+ if (t = n, r = a, this.options.backtrack_lexer) {
339
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
340
+ if (this._backtrack) {
341
+ t = !1;
342
+ continue;
343
+ }
344
+ return !1;
345
+ }
346
+ if (!this.options.flex) break;
347
+ }
348
+ return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
349
+ text: "",
350
+ token: null,
351
+ line: this.yylineno
352
+ });
353
+ }, "next"),
354
+ lex: /* @__PURE__ */ e(function() {
355
+ return this.next() || this.lex();
356
+ }, "lex"),
357
+ begin: /* @__PURE__ */ e(function(e) {
358
+ this.conditionStack.push(e);
359
+ }, "begin"),
360
+ popState: /* @__PURE__ */ e(function() {
361
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
362
+ }, "popState"),
363
+ _currentRules: /* @__PURE__ */ e(function() {
364
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
365
+ }, "_currentRules"),
366
+ topState: /* @__PURE__ */ e(function(e) {
367
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
368
+ }, "topState"),
369
+ pushState: /* @__PURE__ */ e(function(e) {
370
+ this.begin(e);
371
+ }, "pushState"),
372
+ stateStackSize: /* @__PURE__ */ e(function() {
373
+ return this.conditionStack.length;
374
+ }, "stateStackSize"),
375
+ options: { "case-insensitive": !0 },
376
+ performAction: /* @__PURE__ */ e(function(e, t, n, r) {
377
+ switch (n) {
378
+ case 0: return 6;
379
+ case 1: return 8;
380
+ case 2: return 8;
381
+ case 3: return 6;
382
+ case 4: return 7;
383
+ case 5: return 13;
384
+ case 6: return 14;
385
+ case 7: return 11;
386
+ }
387
+ }, "anonymous"),
388
+ rules: [
389
+ /^(?:\s*%%.*)/i,
390
+ /^(?:ishikawa-beta\b)/i,
391
+ /^(?:ishikawa\b)/i,
392
+ /^(?:[\s]+[\n])/i,
393
+ /^(?:[\n]+)/i,
394
+ /^(?:[\s]+)/i,
395
+ /^(?:[^\n]+)/i,
396
+ /^(?:$)/i
397
+ ],
398
+ conditions: { INITIAL: {
399
+ rules: [
400
+ 0,
401
+ 1,
402
+ 2,
403
+ 3,
404
+ 4,
405
+ 5,
406
+ 6,
407
+ 7
408
+ ],
409
+ inclusive: !0
410
+ } }
411
+ };
412
+ })();
413
+ function g() {
414
+ this.yy = {};
415
+ }
416
+ return e(g, "Parser"), g.prototype = h, h.Parser = g, new g();
417
+ })();
418
+ m.parser = m;
419
+ var h = m, g = class {
420
+ constructor() {
421
+ this.stack = [], this.clear = this.clear.bind(this), this.addNode = this.addNode.bind(this), this.getRoot = this.getRoot.bind(this);
422
+ }
423
+ static {
424
+ e(this, "IshikawaDB");
425
+ }
426
+ clear() {
427
+ this.root = void 0, this.stack = [], this.baseLevel = void 0, i();
428
+ }
429
+ getRoot() {
430
+ return this.root;
431
+ }
432
+ addNode(e, t) {
433
+ let r = o.sanitizeText(t, l());
434
+ if (!this.root) {
435
+ this.root = {
436
+ text: r,
437
+ children: []
438
+ }, this.stack = [{
439
+ level: 0,
440
+ node: this.root
441
+ }], n(r);
442
+ return;
443
+ }
444
+ this.baseLevel ??= e;
445
+ let i = e - this.baseLevel + 1;
446
+ for (i <= 0 && (i = 1); this.stack.length > 1 && this.stack[this.stack.length - 1].level >= i;) this.stack.pop();
447
+ let a = this.stack[this.stack.length - 1].node, s = {
448
+ text: r,
449
+ children: []
450
+ };
451
+ a.children.push(s), this.stack.push({
452
+ level: i,
453
+ node: s
454
+ });
455
+ }
456
+ getAccTitle() {
457
+ return u();
458
+ }
459
+ setAccTitle(e) {
460
+ r(e);
461
+ }
462
+ getAccDescription() {
463
+ return s();
464
+ }
465
+ setAccDescription(e) {
466
+ t(e);
467
+ }
468
+ getDiagramTitle() {
469
+ return c();
470
+ }
471
+ setDiagramTitle(e) {
472
+ n(e);
473
+ }
474
+ }, _ = 14, v = 250, y = 30, b = 60, x = 5, S = 82 * Math.PI / 180, C = Math.cos(S), w = Math.sin(S), T = /* @__PURE__ */ e((e, t, n) => {
475
+ let r = e.node().getBBox(), i = r.width + t * 2, o = r.height + t * 2;
476
+ a(e, o, i, n), e.attr("viewBox", `${r.x - t} ${r.y - t} ${i} ${o}`);
477
+ }, "applyPaddedViewBox"), E = /* @__PURE__ */ e((e, t, n, r) => {
478
+ let i = r.db.getRoot();
479
+ if (!i) return;
480
+ let a = l(), { look: o, handDrawnSeed: s, themeVariables: c } = a, u = d(a.fontSize)[0] ?? _, m = o === "handDrawn", h = i.children ?? [], g = a.ishikawa?.diagramPadding ?? 20, y = a.ishikawa?.useMaxWidth ?? !1, b = p(t), x = b.append("g").attr("class", "ishikawa"), S = m ? f.svg(b.node()) : void 0, C = S ? {
481
+ roughSvg: S,
482
+ seed: s ?? 0,
483
+ lineColor: c?.lineColor ?? "#333",
484
+ fillColor: c?.mainBkg ?? "#fff"
485
+ } : void 0, w = `ishikawa-arrow-${t}`;
486
+ m || x.append("defs").append("marker").attr("id", w).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");
487
+ let E = 0, k = v, A = m ? void 0 : L(x, E, k, E, k, "ishikawa-spine");
488
+ if (O(x, E, k, i.text, u, C), !h.length) {
489
+ m && L(x, E, k, E, k, "ishikawa-spine", C), T(b, g, y);
490
+ return;
491
+ }
492
+ E -= 20;
493
+ let j = h.filter((e, t) => t % 2 == 0), N = h.filter((e, t) => t % 2 == 1), P = D(j), F = D(N), I = P.total + F.total, R = v, z = v;
494
+ if (I > 0) {
495
+ let e = v * 2, t = v * .3;
496
+ R = Math.max(t, e * (P.total / I)), z = Math.max(t, e * (F.total / I));
497
+ }
498
+ let B = u * 2;
499
+ R = Math.max(R, P.max * B), z = Math.max(z, F.max * B), k = Math.max(R, v), A && A.attr("y1", k).attr("y2", k), x.select(".ishikawa-head-group").attr("transform", `translate(0,${k})`);
500
+ let V = Math.ceil(h.length / 2);
501
+ for (let e = 0; e < V; e++) {
502
+ let t = x.append("g").attr("class", "ishikawa-pair");
503
+ for (let [n, r, i] of [[
504
+ h[e * 2],
505
+ -1,
506
+ R
507
+ ], [
508
+ h[e * 2 + 1],
509
+ 1,
510
+ z
511
+ ]]) n && M(t, n, E, k, r, i, u, C);
512
+ E = t.selectAll("text").nodes().reduce((e, t) => Math.min(e, t.getBBox().x), Infinity);
513
+ }
514
+ if (m) L(x, E, k, 0, k, "ishikawa-spine", C);
515
+ else {
516
+ A.attr("x1", E);
517
+ let e = `url(#${w})`;
518
+ x.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start", e);
519
+ }
520
+ T(b, g, y);
521
+ }, "draw"), D = /* @__PURE__ */ e((t) => {
522
+ let n = /* @__PURE__ */ e((e) => e.children.reduce((e, t) => e + 1 + n(t), 0), "countDescendants");
523
+ return t.reduce((e, t) => {
524
+ let r = n(t);
525
+ return e.total += r, e.max = Math.max(e.max, r), e;
526
+ }, {
527
+ total: 0,
528
+ max: 0
529
+ });
530
+ }, "sideStats"), O = /* @__PURE__ */ e((e, t, n, r, i, a) => {
531
+ let o = Math.max(6, Math.floor(110 / (i * .6))), s = e.append("g").attr("class", "ishikawa-head-group").attr("transform", `translate(${t},${n})`), c = F(s, P(r, o), 0, 0, "ishikawa-head-label", "start", i), l = c.node().getBBox(), u = Math.max(60, l.width + 6), d = Math.max(40, l.height * 2 + 40), f = `M 0 ${-d / 2} L 0 ${d / 2} Q ${u * 2.4} 0 0 ${-d / 2} Z`;
532
+ if (a) {
533
+ let e = a.roughSvg.path(f, {
534
+ roughness: 1.5,
535
+ seed: a.seed,
536
+ fill: a.fillColor,
537
+ fillStyle: "hachure",
538
+ fillWeight: 2.5,
539
+ hachureGap: 5,
540
+ stroke: a.lineColor,
541
+ strokeWidth: 2
542
+ });
543
+ s.insert(() => e, ":first-child").attr("class", "ishikawa-head");
544
+ } else s.insert("path", ":first-child").attr("class", "ishikawa-head").attr("d", f);
545
+ c.attr("transform", `translate(${(u - l.width) / 2 - l.x + 3},${-l.y - l.height / 2})`);
546
+ }, "drawHead"), k = /* @__PURE__ */ e((t, n) => {
547
+ let r = [], i = [], a = /* @__PURE__ */ e((e, t, o) => {
548
+ let s = n === -1 ? [...e].reverse() : e;
549
+ for (let e of s) {
550
+ let n = r.length, s = e.children ?? [];
551
+ r.push({
552
+ depth: o,
553
+ text: P(e.text, 15),
554
+ parentIndex: t,
555
+ childCount: s.length
556
+ }), o % 2 == 0 ? (i.push(n), s.length && a(s, n, o + 1)) : (s.length && a(s, n, o + 1), i.push(n));
557
+ }
558
+ }, "walk");
559
+ return a(t, -1, 2), {
560
+ entries: r,
561
+ yOrder: i
562
+ };
563
+ }, "flattenTree"), A = /* @__PURE__ */ e((e, t, n, r, i, a, o) => {
564
+ let s = e.append("g").attr("class", "ishikawa-label-group"), c = F(s, t, n, r + 11 * i, "ishikawa-label cause", "middle", a).node().getBBox();
565
+ if (o) {
566
+ let e = o.roughSvg.rectangle(c.x - 20, c.y - 2, c.width + 40, c.height + 4, {
567
+ roughness: 1.5,
568
+ seed: o.seed,
569
+ fill: o.fillColor,
570
+ fillStyle: "hachure",
571
+ fillWeight: 2.5,
572
+ hachureGap: 5,
573
+ stroke: o.lineColor,
574
+ strokeWidth: 2
575
+ });
576
+ s.insert(() => e, ":first-child").attr("class", "ishikawa-label-box");
577
+ } else s.insert("rect", ":first-child").attr("class", "ishikawa-label-box").attr("x", c.x - 20).attr("y", c.y - 2).attr("width", c.width + 40).attr("height", c.height + 4);
578
+ }, "drawCauseLabel"), j = /* @__PURE__ */ e((e, t, n, r, i, a) => {
579
+ let o = Math.sqrt(r * r + i * i);
580
+ if (o === 0) return;
581
+ let s = r / o, c = i / o, l = -c * 6, u = s * 6, d = t, f = n, p = `M ${d} ${f} L ${d - s * 6 * 2 + l} ${f - c * 6 * 2 + u} L ${d - s * 6 * 2 - l} ${f - c * 6 * 2 - u} Z`, m = a.roughSvg.path(p, {
582
+ roughness: 1,
583
+ seed: a.seed,
584
+ fill: a.lineColor,
585
+ fillStyle: "solid",
586
+ stroke: a.lineColor,
587
+ strokeWidth: 1
588
+ });
589
+ e.append(() => m);
590
+ }, "drawArrowMarker"), M = /* @__PURE__ */ e((e, t, n, r, i, a, o, s) => {
591
+ let c = t.children ?? [], l = a * (c.length ? 1 : .2), u = -C * l, d = w * l * i, f = n + u, p = r + d;
592
+ if (L(e, n, r, f, p, "ishikawa-branch", s), s && j(e, n, r, n - f, r - p, s), A(e, t.text, f, p, i, o, s), !c.length) return;
593
+ let { entries: m, yOrder: h } = k(c, i), g = m.length, _ = Array(g);
594
+ for (let [e, t] of h.entries()) _[t] = r + d * ((e + 1) / (g + 1));
595
+ let v = /* @__PURE__ */ new Map();
596
+ v.set(-1, {
597
+ x0: n,
598
+ y0: r,
599
+ x1: f,
600
+ y1: p,
601
+ childCount: c.length,
602
+ childrenDrawn: 0
603
+ });
604
+ let S = -C, T = w * i, E = i < 0 ? "ishikawa-label up" : "ishikawa-label down";
605
+ for (let [t, n] of m.entries()) {
606
+ let r = _[t], i = v.get(n.parentIndex), a = e.append("g").attr("class", "ishikawa-sub-group"), c = 0, l = 0, u = 0;
607
+ if (n.depth % 2 == 0) {
608
+ let e = i.y1 - i.y0;
609
+ c = I(i.x0, i.x1, e ? (r - i.y0) / e : .5), l = r, u = c - (n.childCount > 0 ? b + n.childCount * x : y), L(a, c, r, u, r, "ishikawa-sub-branch", s), s && j(a, c, r, 1, 0, s), F(a, n.text, u, r, "ishikawa-label align", "end", o);
610
+ } else {
611
+ let e = i.childrenDrawn++;
612
+ c = I(i.x0, i.x1, (i.childCount - e) / (i.childCount + 1)), l = i.y0, u = c + S * ((r - l) / T), L(a, c, l, u, r, "ishikawa-sub-branch", s), s && j(a, c, l, c - u, l - r, s), F(a, n.text, u, r, E, "end", o);
613
+ }
614
+ n.childCount > 0 && v.set(t, {
615
+ x0: c,
616
+ y0: l,
617
+ x1: u,
618
+ y1: r,
619
+ childCount: n.childCount,
620
+ childrenDrawn: 0
621
+ });
622
+ }
623
+ }, "drawBranch"), N = /* @__PURE__ */ e((e) => e.split(/<br\s*\/?>|\n/), "splitLines"), P = /* @__PURE__ */ e((e, t) => {
624
+ if (e.length <= t) return e;
625
+ let n = [];
626
+ for (let r of e.split(/\s+/)) {
627
+ let e = n.length - 1;
628
+ e >= 0 && n[e].length + 1 + r.length <= t ? n[e] += " " + r : n.push(r);
629
+ }
630
+ return n.join("\n");
631
+ }, "wrapText"), F = /* @__PURE__ */ e((e, t, n, r, i, a, o) => {
632
+ let s = N(t), c = o * 1.05, l = e.append("text").attr("class", i).attr("text-anchor", a).attr("x", n).attr("y", r - (s.length - 1) * c / 2);
633
+ for (let [e, t] of s.entries()) l.append("tspan").attr("x", n).attr("dy", e === 0 ? 0 : c).text(t);
634
+ return l;
635
+ }, "drawMultilineText"), I = /* @__PURE__ */ e((e, t, n) => e + (t - e) * n, "lerp"), L = /* @__PURE__ */ e((e, t, n, r, i, a, o) => {
636
+ if (o) {
637
+ let s = o.roughSvg.line(t, n, r, i, {
638
+ roughness: 1.5,
639
+ seed: o.seed,
640
+ stroke: o.lineColor,
641
+ strokeWidth: 2
642
+ });
643
+ e.append(() => s).attr("class", a);
644
+ return;
645
+ }
646
+ return e.append("line").attr("class", a).attr("x1", t).attr("y1", n).attr("x2", r).attr("y2", i);
647
+ }, "drawLine"), R = {
648
+ parser: h,
649
+ get db() {
650
+ return new g();
651
+ },
652
+ renderer: { draw: E },
653
+ styles: /* @__PURE__ */ e((e) => `
654
+ .ishikawa .ishikawa-spine,
655
+ .ishikawa .ishikawa-branch,
656
+ .ishikawa .ishikawa-sub-branch {
657
+ stroke: ${e.lineColor};
658
+ stroke-width: 2;
659
+ fill: none;
660
+ }
661
+
662
+ .ishikawa .ishikawa-sub-branch {
663
+ stroke-width: 1;
664
+ }
665
+
666
+ .ishikawa .ishikawa-arrow {
667
+ fill: ${e.lineColor};
668
+ }
669
+
670
+ .ishikawa .ishikawa-head {
671
+ fill: ${e.mainBkg};
672
+ stroke: ${e.lineColor};
673
+ stroke-width: 2;
674
+ }
675
+
676
+ .ishikawa .ishikawa-label-box {
677
+ fill: ${e.mainBkg};
678
+ stroke: ${e.lineColor};
679
+ stroke-width: 2;
680
+ }
681
+
682
+ .ishikawa text {
683
+ font-family: ${e.fontFamily};
684
+ font-size: ${e.fontSize};
685
+ fill: ${e.textColor};
686
+ }
687
+
688
+ .ishikawa .ishikawa-head-label {
689
+ font-weight: 600;
690
+ text-anchor: middle;
691
+ dominant-baseline: middle;
692
+ font-size: 14px;
693
+ }
694
+
695
+ .ishikawa .ishikawa-label {
696
+ text-anchor: end;
697
+ }
698
+
699
+ .ishikawa .ishikawa-label.cause {
700
+ text-anchor: middle;
701
+ dominant-baseline: middle;
702
+ }
703
+
704
+ .ishikawa .ishikawa-label.align {
705
+ text-anchor: end;
706
+ dominant-baseline: middle;
707
+ }
708
+
709
+ .ishikawa .ishikawa-label.up {
710
+ dominant-baseline: baseline;
711
+ }
712
+
713
+ .ishikawa .ishikawa-label.down {
714
+ dominant-baseline: hanging;
715
+ }
716
+ `, "getStyles")
717
+ };
718
+ //#endregion
719
+ export { R as diagram };