hexagon-editor 0.1.0-alpha.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 (308) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/THIRD_PARTY_NOTICES.md +29 -0
  4. package/dist/MarkdownEditor.vue.d.ts +926 -0
  5. package/dist/MarkdownEditor.vue.d.ts.map +1 -0
  6. package/dist/MarkdownEditorLinkForm-mq-BVYM_.js +338 -0
  7. package/dist/MarkdownEditorLinkForm.css +1 -0
  8. package/dist/abnfDiagram-N423BO3Z-DCf6sPky.js +87 -0
  9. package/dist/arc-y6UeoJpJ.js +83 -0
  10. package/dist/architectureDiagram-T3A2C74G-Cc3_3-cI.js +4778 -0
  11. package/dist/base-Bnv2-Te4.js +13338 -0
  12. package/dist/base.css +1 -0
  13. package/dist/blockDiagram-VBNYF7ZC-DWVLZwXY.js +2419 -0
  14. package/dist/c4Diagram-5PPSVZJV-CaIN7qay.js +1577 -0
  15. package/dist/channel-BwXGcavV.js +5 -0
  16. package/dist/chunk-2GRJ4B5K-O75udjPr.js +68 -0
  17. package/dist/chunk-2Q5K7J3B-CySL0lOA.js +15 -0
  18. package/dist/chunk-5RXB4S5H-BKPnLCOJ.js +1408 -0
  19. package/dist/chunk-5VM5RSS4--it1VJIv.js +19 -0
  20. package/dist/chunk-6Q2QTUOP-DNiML-50.js +664 -0
  21. package/dist/chunk-GF5L2VYU-z7A-k0-V.js +1533 -0
  22. package/dist/chunk-JWPE2WC7-DAjx3Kjr.js +8 -0
  23. package/dist/chunk-KBJHAD2P-D4R1VW0r.js +19 -0
  24. package/dist/chunk-RYQCIY6F-DmJAYxq8.js +313 -0
  25. package/dist/chunk-XXDRQBXY-CK913N-t.js +8 -0
  26. package/dist/classDiagram-JCYQIIEL-Djipq_HJ.js +16 -0
  27. package/dist/classDiagram-v2-OCEON4UE-Djipq_HJ.js +16 -0
  28. package/dist/classname.d.ts +13 -0
  29. package/dist/classname.d.ts.map +1 -0
  30. package/dist/classname.js +17 -0
  31. package/dist/components/MarkdownEditorFloatingMenus.vue.d.ts +48 -0
  32. package/dist/components/MarkdownEditorFloatingMenus.vue.d.ts.map +1 -0
  33. package/dist/components/MarkdownEditorImageActions.vue.d.ts +20 -0
  34. package/dist/components/MarkdownEditorImageActions.vue.d.ts.map +1 -0
  35. package/dist/components/MarkdownEditorToolbar.vue.d.ts +62 -0
  36. package/dist/components/MarkdownEditorToolbar.vue.d.ts.map +1 -0
  37. package/dist/components/MarkdownEditorToolbarIcon.vue.d.ts +26 -0
  38. package/dist/components/MarkdownEditorToolbarIcon.vue.d.ts.map +1 -0
  39. package/dist/composables/useFloatingPanel.d.ts +13 -0
  40. package/dist/composables/useFloatingPanel.d.ts.map +1 -0
  41. package/dist/composables/useMarkdownEditorValue.d.ts +19 -0
  42. package/dist/composables/useMarkdownEditorValue.d.ts.map +1 -0
  43. package/dist/configure.d.ts +15 -0
  44. package/dist/configure.d.ts.map +1 -0
  45. package/dist/configure.js +19 -0
  46. package/dist/core/actions.d.ts +16 -0
  47. package/dist/core/actions.d.ts.map +1 -0
  48. package/dist/core/basic-editor-atomic-source.d.ts +9 -0
  49. package/dist/core/basic-editor-atomic-source.d.ts.map +1 -0
  50. package/dist/core/basic-editor-command-helpers.d.ts +11 -0
  51. package/dist/core/basic-editor-command-helpers.d.ts.map +1 -0
  52. package/dist/core/basic-editor-markdown.d.ts +7 -0
  53. package/dist/core/basic-editor-markdown.d.ts.map +1 -0
  54. package/dist/core/basic-editor-renderers.d.ts +6 -0
  55. package/dist/core/basic-editor-renderers.d.ts.map +1 -0
  56. package/dist/core/basic-editor-runtime-plugins.d.ts +7 -0
  57. package/dist/core/basic-editor-runtime-plugins.d.ts.map +1 -0
  58. package/dist/core/basic-editor-selection.d.ts +6 -0
  59. package/dist/core/basic-editor-selection.d.ts.map +1 -0
  60. package/dist/core/basic-editor-table-controls.d.ts +3 -0
  61. package/dist/core/basic-editor-table-controls.d.ts.map +1 -0
  62. package/dist/core/basic-editor-table-popover.d.ts +5 -0
  63. package/dist/core/basic-editor-table-popover.d.ts.map +1 -0
  64. package/dist/core/basic-editor-types.d.ts +96 -0
  65. package/dist/core/basic-editor-types.d.ts.map +1 -0
  66. package/dist/core/basic-editor.d.ts +14 -0
  67. package/dist/core/basic-editor.d.ts.map +1 -0
  68. package/dist/core/content-handler.d.ts +21 -0
  69. package/dist/core/content-handler.d.ts.map +1 -0
  70. package/dist/core/editor-instance.d.ts +38 -0
  71. package/dist/core/editor-instance.d.ts.map +1 -0
  72. package/dist/core/events.d.ts +22 -0
  73. package/dist/core/events.d.ts.map +1 -0
  74. package/dist/core/extension-builder.d.ts +86 -0
  75. package/dist/core/extension-builder.d.ts.map +1 -0
  76. package/dist/core/extensions-manager.d.ts +36 -0
  77. package/dist/core/extensions-manager.d.ts.map +1 -0
  78. package/dist/core/index.d.ts +30 -0
  79. package/dist/core/index.d.ts.map +1 -0
  80. package/dist/core/lists.d.ts +18 -0
  81. package/dist/core/lists.d.ts.map +1 -0
  82. package/dist/core/logger.d.ts +46 -0
  83. package/dist/core/logger.d.ts.map +1 -0
  84. package/dist/core/markdown-parser.d.ts +60 -0
  85. package/dist/core/markdown-parser.d.ts.map +1 -0
  86. package/dist/core/markdown.d.ts +23 -0
  87. package/dist/core/markdown.d.ts.map +1 -0
  88. package/dist/core/markup-editor.d.ts +22 -0
  89. package/dist/core/markup-editor.d.ts.map +1 -0
  90. package/dist/core/optional-renderers.d.ts +9 -0
  91. package/dist/core/optional-renderers.d.ts.map +1 -0
  92. package/dist/core/registries.d.ts +50 -0
  93. package/dist/core/registries.d.ts.map +1 -0
  94. package/dist/core/schema-dynamic-modifier.d.ts +13 -0
  95. package/dist/core/schema-dynamic-modifier.d.ts.map +1 -0
  96. package/dist/core/vue-renderer.d.ts +40 -0
  97. package/dist/core/vue-renderer.d.ts.map +1 -0
  98. package/dist/core.js +46 -0
  99. package/dist/cose-bilkent-JH36ORCC-CXuKFbXy.js +2608 -0
  100. package/dist/cynefin-VYW2F7L2-Bkk-F_Js.js +23766 -0
  101. package/dist/cynefinDiagram-MW4NZA55-DwOK40hm.js +299 -0
  102. package/dist/cytoscape.esm-3W4EOjxC.js +18756 -0
  103. package/dist/dagre-VZM6K2ZE-0VsGm8Ag.js +340 -0
  104. package/dist/defaultLocale-BgPVtth8.js +171 -0
  105. package/dist/diagram-7IWD3JNH-BrApu1hz.js +350 -0
  106. package/dist/diagram-B4RE2ZJO-CVXoBg2r.js +461 -0
  107. package/dist/diagram-LBJQPF4R-Dp0eSz2L.js +142 -0
  108. package/dist/diagram-Q27KOJAE-DWIltqIH.js +528 -0
  109. package/dist/diagram-UB23O5K3-B7z2Lj3K.js +219 -0
  110. package/dist/directives.d.ts +10 -0
  111. package/dist/directives.d.ts.map +1 -0
  112. package/dist/ebnfDiagram-BXEA7PRR-CYgE6z_2.js +109 -0
  113. package/dist/erDiagram-JOGREHBK-D3QWrPo-.js +910 -0
  114. package/dist/extensions/additional/folding-heading.d.ts +11 -0
  115. package/dist/extensions/additional/folding-heading.d.ts.map +1 -0
  116. package/dist/extensions/additional/math.d.ts +36 -0
  117. package/dist/extensions/additional/math.d.ts.map +1 -0
  118. package/dist/extensions/additional/mermaid.d.ts +21 -0
  119. package/dist/extensions/additional/mermaid.d.ts.map +1 -0
  120. package/dist/extensions/additional/quote-link.d.ts +19 -0
  121. package/dist/extensions/additional/quote-link.d.ts.map +1 -0
  122. package/dist/extensions/additional/yfm-html-block.d.ts +21 -0
  123. package/dist/extensions/additional/yfm-html-block.d.ts.map +1 -0
  124. package/dist/extensions/base.d.ts +9 -0
  125. package/dist/extensions/base.d.ts.map +1 -0
  126. package/dist/extensions/behavior/clicks-on-edges.d.ts +12 -0
  127. package/dist/extensions/behavior/clicks-on-edges.d.ts.map +1 -0
  128. package/dist/extensions/behavior/clipboard.d.ts +6 -0
  129. package/dist/extensions/behavior/clipboard.d.ts.map +1 -0
  130. package/dist/extensions/behavior/cursor.d.ts +29 -0
  131. package/dist/extensions/behavior/cursor.d.ts.map +1 -0
  132. package/dist/extensions/behavior/editor-mode-keymap.d.ts +8 -0
  133. package/dist/extensions/behavior/editor-mode-keymap.d.ts.map +1 -0
  134. package/dist/extensions/behavior/history.d.ts +21 -0
  135. package/dist/extensions/behavior/history.d.ts.map +1 -0
  136. package/dist/extensions/behavior/placeholder.d.ts +11 -0
  137. package/dist/extensions/behavior/placeholder.d.ts.map +1 -0
  138. package/dist/extensions/behavior/resizable.d.ts +4 -0
  139. package/dist/extensions/behavior/resizable.d.ts.map +1 -0
  140. package/dist/extensions/behavior/selection-commands.d.ts +24 -0
  141. package/dist/extensions/behavior/selection-commands.d.ts.map +1 -0
  142. package/dist/extensions/behavior/selection-context.d.ts +9 -0
  143. package/dist/extensions/behavior/selection-context.d.ts.map +1 -0
  144. package/dist/extensions/behavior/selection.d.ts +12 -0
  145. package/dist/extensions/behavior/selection.d.ts.map +1 -0
  146. package/dist/extensions/index.d.ts +34 -0
  147. package/dist/extensions/index.d.ts.map +1 -0
  148. package/dist/extensions/markdown/blockquote-specs.d.ts +15 -0
  149. package/dist/extensions/markdown/blockquote-specs.d.ts.map +1 -0
  150. package/dist/extensions/markdown/blockquote.d.ts +14 -0
  151. package/dist/extensions/markdown/blockquote.d.ts.map +1 -0
  152. package/dist/extensions/markdown/bold-specs.d.ts +12 -0
  153. package/dist/extensions/markdown/bold-specs.d.ts.map +1 -0
  154. package/dist/extensions/markdown/bold.d.ts +17 -0
  155. package/dist/extensions/markdown/bold.d.ts.map +1 -0
  156. package/dist/extensions/markdown/breaks-specs.d.ts +22 -0
  157. package/dist/extensions/markdown/breaks-specs.d.ts.map +1 -0
  158. package/dist/extensions/markdown/breaks.d.ts +11 -0
  159. package/dist/extensions/markdown/breaks.d.ts.map +1 -0
  160. package/dist/extensions/markdown/code-block-specs.d.ts +14 -0
  161. package/dist/extensions/markdown/code-block-specs.d.ts.map +1 -0
  162. package/dist/extensions/markdown/code-block.d.ts +14 -0
  163. package/dist/extensions/markdown/code-block.d.ts.map +1 -0
  164. package/dist/extensions/markdown/code-specs.d.ts +9 -0
  165. package/dist/extensions/markdown/code-specs.d.ts.map +1 -0
  166. package/dist/extensions/markdown/code.d.ts +11 -0
  167. package/dist/extensions/markdown/code.d.ts.map +1 -0
  168. package/dist/extensions/markdown/deflist-specs.d.ts +16 -0
  169. package/dist/extensions/markdown/deflist-specs.d.ts.map +1 -0
  170. package/dist/extensions/markdown/deflist.d.ts +14 -0
  171. package/dist/extensions/markdown/deflist.d.ts.map +1 -0
  172. package/dist/extensions/markdown/heading-specs.d.ts +11 -0
  173. package/dist/extensions/markdown/heading-specs.d.ts.map +1 -0
  174. package/dist/extensions/markdown/heading.d.ts +17 -0
  175. package/dist/extensions/markdown/heading.d.ts.map +1 -0
  176. package/dist/extensions/markdown/horizontal-rule-specs.d.ts +10 -0
  177. package/dist/extensions/markdown/horizontal-rule-specs.d.ts.map +1 -0
  178. package/dist/extensions/markdown/horizontal-rule.d.ts +8 -0
  179. package/dist/extensions/markdown/horizontal-rule.d.ts.map +1 -0
  180. package/dist/extensions/markdown/html.d.ts +15 -0
  181. package/dist/extensions/markdown/html.d.ts.map +1 -0
  182. package/dist/extensions/markdown/image.d.ts +39 -0
  183. package/dist/extensions/markdown/image.d.ts.map +1 -0
  184. package/dist/extensions/markdown/italic-specs.d.ts +12 -0
  185. package/dist/extensions/markdown/italic-specs.d.ts.map +1 -0
  186. package/dist/extensions/markdown/italic.d.ts +11 -0
  187. package/dist/extensions/markdown/italic.d.ts.map +1 -0
  188. package/dist/extensions/markdown/link-specs.d.ts +19 -0
  189. package/dist/extensions/markdown/link-specs.d.ts.map +1 -0
  190. package/dist/extensions/markdown/link.d.ts +21 -0
  191. package/dist/extensions/markdown/link.d.ts.map +1 -0
  192. package/dist/extensions/markdown/list-specs.d.ts +6 -0
  193. package/dist/extensions/markdown/list-specs.d.ts.map +1 -0
  194. package/dist/extensions/markdown/lists.d.ts +18 -0
  195. package/dist/extensions/markdown/lists.d.ts.map +1 -0
  196. package/dist/extensions/markdown/mark.d.ts +12 -0
  197. package/dist/extensions/markdown/mark.d.ts.map +1 -0
  198. package/dist/extensions/markdown/strike.d.ts +12 -0
  199. package/dist/extensions/markdown/strike.d.ts.map +1 -0
  200. package/dist/extensions/markdown/subscript.d.ts +12 -0
  201. package/dist/extensions/markdown/subscript.d.ts.map +1 -0
  202. package/dist/extensions/markdown/table-actions.d.ts +14 -0
  203. package/dist/extensions/markdown/table-actions.d.ts.map +1 -0
  204. package/dist/extensions/markdown/table-specs.d.ts +25 -0
  205. package/dist/extensions/markdown/table-specs.d.ts.map +1 -0
  206. package/dist/extensions/markdown/table.d.ts +6 -0
  207. package/dist/extensions/markdown/table.d.ts.map +1 -0
  208. package/dist/extensions/markdown/underline.d.ts +12 -0
  209. package/dist/extensions/markdown/underline.d.ts.map +1 -0
  210. package/dist/extensions/specs.d.ts +13 -0
  211. package/dist/extensions/specs.d.ts.map +1 -0
  212. package/dist/extensions.js +247 -0
  213. package/dist/flowDiagram-UKHOOZJN-CfjPcHNW.js +1638 -0
  214. package/dist/forms/MarkdownEditorForm.vue.d.ts +37 -0
  215. package/dist/forms/MarkdownEditorForm.vue.d.ts.map +1 -0
  216. package/dist/forms/MarkdownEditorImageForm.vue.d.ts +131 -0
  217. package/dist/forms/MarkdownEditorImageForm.vue.d.ts.map +1 -0
  218. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts +119 -0
  219. package/dist/forms/MarkdownEditorLinkForm.vue.d.ts.map +1 -0
  220. package/dist/forms/MarkdownEditorTextInput.vue.d.ts +39 -0
  221. package/dist/forms/MarkdownEditorTextInput.vue.d.ts.map +1 -0
  222. package/dist/forms/index.d.ts +7 -0
  223. package/dist/forms/index.d.ts.map +1 -0
  224. package/dist/forms.js +7 -0
  225. package/dist/full-C-o2lPBX.js +16 -0
  226. package/dist/full-specs-Cl-ODShc.js +10 -0
  227. package/dist/ganttDiagram-PKOTCBZU-ECmaWI-9.js +2711 -0
  228. package/dist/gitGraphDiagram-DS77QQ5N-DgG1RGJ8.js +815 -0
  229. package/dist/graph-DAHC4kPm.js +1545 -0
  230. package/dist/heading-specs-D7Bj4aIM.js +489 -0
  231. package/dist/i18n/index.d.ts +70 -0
  232. package/dist/i18n/index.d.ts.map +1 -0
  233. package/dist/i18n.js +132 -0
  234. package/dist/index-CqpK5VVw.js +149 -0
  235. package/dist/index-uerphigI.js +82 -0
  236. package/dist/index.css +1 -0
  237. package/dist/index.d.ts +87 -0
  238. package/dist/index.d.ts.map +1 -0
  239. package/dist/index.js +1293 -0
  240. package/dist/infoDiagram-6WML65LV-B1Yl3nZV.js +24 -0
  241. package/dist/init-DjUOC4st.js +16 -0
  242. package/dist/ishikawaDiagram-WSZJBQD7-4sngaB5o.js +621 -0
  243. package/dist/journeyDiagram-NVQOT4AX-B_6AmR_j.js +834 -0
  244. package/dist/kanban-definition-27J2QSJJ-B8BO9o8J.js +724 -0
  245. package/dist/katex-ByXcxnHy.js +14436 -0
  246. package/dist/katex-DoRnZ_sp.js +11682 -0
  247. package/dist/layout-DBbo_M5I.js +1519 -0
  248. package/dist/linear-BEdRfKba.js +259 -0
  249. package/dist/map-DRdzG8Ho.js +224 -0
  250. package/dist/mermaid.core-CR0bA2Wa.js +16496 -0
  251. package/dist/mindmap-definition-FAOFIHXS-DnPz807N.js +827 -0
  252. package/dist/optional-renderers-BalvqqvY.js +11 -0
  253. package/dist/ordinal-B6-f3MAq.js +61 -0
  254. package/dist/pegDiagram-VL7TDLO6-csGWlzs8.js +95 -0
  255. package/dist/pieDiagram-7S7Q4E2Y-Bqs8j5FX.js +207 -0
  256. package/dist/presets/commonmark-specs.d.ts +9 -0
  257. package/dist/presets/commonmark-specs.d.ts.map +1 -0
  258. package/dist/presets/commonmark.d.ts +26 -0
  259. package/dist/presets/commonmark.d.ts.map +1 -0
  260. package/dist/presets/default.d.ts +6 -0
  261. package/dist/presets/default.d.ts.map +1 -0
  262. package/dist/presets/full-specs.d.ts +6 -0
  263. package/dist/presets/full-specs.d.ts.map +1 -0
  264. package/dist/presets/full.d.ts +17 -0
  265. package/dist/presets/full.d.ts.map +1 -0
  266. package/dist/presets/index.d.ts +13 -0
  267. package/dist/presets/index.d.ts.map +1 -0
  268. package/dist/presets/zero.d.ts +8 -0
  269. package/dist/presets/zero.d.ts.map +1 -0
  270. package/dist/presets.js +10 -0
  271. package/dist/public-types.d.ts +96 -0
  272. package/dist/public-types.d.ts.map +1 -0
  273. package/dist/quadrantDiagram-CIZ2JOQS-jzP4lRrY.js +1023 -0
  274. package/dist/railroadDiagram-AXF67PYL-BSCyR24u.js +77 -0
  275. package/dist/renderer/MarkdownRenderer.vue.d.ts +10 -0
  276. package/dist/renderer/MarkdownRenderer.vue.d.ts.map +1 -0
  277. package/dist/renderer/index.d.ts +3 -0
  278. package/dist/renderer/index.d.ts.map +1 -0
  279. package/dist/renderer/markdown.d.ts +2 -0
  280. package/dist/renderer/markdown.d.ts.map +1 -0
  281. package/dist/renderer/mermaid-runtime.d.ts +4 -0
  282. package/dist/renderer/mermaid-runtime.d.ts.map +1 -0
  283. package/dist/renderer.js +258 -0
  284. package/dist/requirementDiagram-LRYGKXZP-DmEkLYqX.js +882 -0
  285. package/dist/sankeyDiagram-W5VNT64P-CYvRYMTh.js +847 -0
  286. package/dist/schema-dynamic-modifier-Dhf0m6tE.js +21514 -0
  287. package/dist/schema-dynamic-modifier.css +1 -0
  288. package/dist/sequenceDiagram-SI44F4Z6-CyWbDtPA.js +2888 -0
  289. package/dist/sizeCapture-X5ZJPWSS-xKhYCY84.js +46 -0
  290. package/dist/specs.js +127 -0
  291. package/dist/stateDiagram-OKZ733FA-DP44R2Dd.js +263 -0
  292. package/dist/stateDiagram-v2-UEYNNEHI-BvlOisND.js +16 -0
  293. package/dist/swimlanes-SLNWSIFB-BKFp8twH.js +5332 -0
  294. package/dist/swimlanesDiagram-ULZ7WXOC-CTvIFuHq.js +13 -0
  295. package/dist/timeline-definition-Z64GVDOM-B4137uIl.js +1055 -0
  296. package/dist/toolbar/config.d.ts +45 -0
  297. package/dist/toolbar/config.d.ts.map +1 -0
  298. package/dist/toolbar/index.d.ts +3 -0
  299. package/dist/toolbar/index.d.ts.map +1 -0
  300. package/dist/toolbar.js +100 -0
  301. package/dist/use-markdown-editor.d.ts +14 -0
  302. package/dist/use-markdown-editor.d.ts.map +1 -0
  303. package/dist/vennDiagram-T6HMQDX7-CPs8gXjx.js +1578 -0
  304. package/dist/version.d.ts +3 -0
  305. package/dist/version.d.ts.map +1 -0
  306. package/dist/wardleyDiagram-T6FBY63Y-BYp13hbI.js +675 -0
  307. package/dist/xychartDiagram-ELKLHX3M-DTT37K2u.js +1388 -0
  308. package/package.json +110 -0
@@ -0,0 +1,24 @@
1
+ import { _ as a, l as s, D as o, e as i } from "./mermaid.core-CR0bA2Wa.js";
2
+ import { p as g } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
3
+ var p = {
4
+ parse: /* @__PURE__ */ a(async (r) => {
5
+ const e = await g("info", r);
6
+ s.debug(e);
7
+ }, "parse")
8
+ }, v = {
9
+ version: "11.16.1"
10
+ }, d = /* @__PURE__ */ a(() => v.version, "getVersion"), m = {
11
+ getVersion: d
12
+ }, c = /* @__PURE__ */ a((r, e, n) => {
13
+ s.debug(`rendering info diagram
14
+ ` + r);
15
+ const t = o(e);
16
+ i(t, 100, 400, !0), t.append("g").append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${n}`);
17
+ }, "draw"), l = { draw: c }, _ = {
18
+ parser: p,
19
+ db: m,
20
+ renderer: l
21
+ };
22
+ export {
23
+ _ as diagram
24
+ };
@@ -0,0 +1,16 @@
1
+ function t(e, a) {
2
+ switch (arguments.length) {
3
+ case 0:
4
+ break;
5
+ case 1:
6
+ this.range(e);
7
+ break;
8
+ default:
9
+ this.range(a).domain(e);
10
+ break;
11
+ }
12
+ return this;
13
+ }
14
+ export {
15
+ t as i
16
+ };
@@ -0,0 +1,621 @@
1
+ import { _ as o, c as ot, K as ut, D as dt, al as yt, p as ft, k as pt, n as it, a as gt, b as kt, g as mt, s as wt, o as _t, e as bt } from "./mermaid.core-CR0bA2Wa.js";
2
+ var J = (function() {
3
+ var e = /* @__PURE__ */ o(function(T, t, s, i) {
4
+ for (s = s || {}, i = T.length; i--; s[T[i]] = t) ;
5
+ return s;
6
+ }, "o"), h = [1, 4], r = [1, 14], a = [1, 12], l = [1, 13], y = [6, 7, 8], f = [1, 20], d = [1, 18], m = [1, 19], u = [6, 7, 11], k = [1, 6, 13, 14], g = [1, 23], _ = [1, 24], x = [1, 6, 7, 11, 13, 14], D = {
7
+ trace: /* @__PURE__ */ o(function() {
8
+ }, "trace"),
9
+ yy: {},
10
+ symbols_: { error: 2, start: 3, ishikawa: 4, spaceLines: 5, SPACELINE: 6, NL: 7, ISHIKAWA: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, TEXT: 14, $accept: 0, $end: 1 },
11
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "ISHIKAWA", 11: "EOF", 13: "SPACELIST", 14: "TEXT" },
12
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 1], [12, 1], [12, 1]],
13
+ performAction: /* @__PURE__ */ o(function(t, s, i, c, p, n, v) {
14
+ var w = n.length - 1;
15
+ switch (p) {
16
+ case 6:
17
+ case 7:
18
+ return c;
19
+ case 15:
20
+ c.addNode(n[w - 1].length, n[w].trim());
21
+ break;
22
+ case 16:
23
+ c.addNode(0, n[w].trim());
24
+ break;
25
+ }
26
+ }, "anonymous"),
27
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: h }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: h }, { 6: r, 7: [1, 10], 9: 9, 12: 11, 13: a, 14: l }, e(y, [2, 3]), { 1: [2, 2] }, e(y, [2, 4]), e(y, [2, 5]), { 1: [2, 6], 6: r, 12: 15, 13: a, 14: l }, { 6: r, 9: 16, 12: 11, 13: a, 14: l }, { 6: f, 7: d, 10: 17, 11: m }, e(u, [2, 18], { 14: [1, 21] }), e(u, [2, 16]), e(u, [2, 17]), { 6: f, 7: d, 10: 22, 11: m }, { 1: [2, 7], 6: r, 12: 15, 13: a, 14: l }, e(k, [2, 14], { 7: g, 11: _ }), e(x, [2, 8]), e(x, [2, 9]), e(x, [2, 10]), e(u, [2, 15]), e(k, [2, 13], { 7: g, 11: _ }), e(x, [2, 11]), e(x, [2, 12])],
28
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
29
+ parseError: /* @__PURE__ */ o(function(t, s) {
30
+ if (s.recoverable)
31
+ this.trace(t);
32
+ else {
33
+ var i = new Error(t);
34
+ throw i.hash = s, i;
35
+ }
36
+ }, "parseError"),
37
+ parse: /* @__PURE__ */ o(function(t) {
38
+ var s = this, i = [0], c = [], p = [null], n = [], v = this.table, w = "", I = 0, $ = 0, L = 2, A = 1, C = n.slice.call(arguments, 1), b = Object.create(this.lexer), S = { yy: {} };
39
+ for (var P in this.yy)
40
+ Object.prototype.hasOwnProperty.call(this.yy, P) && (S.yy[P] = this.yy[P]);
41
+ b.setInput(t, S.yy), S.yy.lexer = b, S.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
42
+ var R = b.yylloc;
43
+ n.push(R);
44
+ var G = b.options && b.options.ranges;
45
+ typeof S.yy.parseError == "function" ? this.parseError = S.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
46
+ function X(B) {
47
+ i.length = i.length - 2 * B, p.length = p.length - B, n.length = n.length - B;
48
+ }
49
+ o(X, "popStack");
50
+ function tt() {
51
+ var B;
52
+ return B = c.pop() || b.lex() || A, typeof B != "number" && (B instanceof Array && (c = B, B = c.pop()), B = s.symbols_[B] || B), B;
53
+ }
54
+ o(tt, "lex");
55
+ for (var M, W, N, Y, F = {}, U, V, et, Z; ; ) {
56
+ if (W = i[i.length - 1], this.defaultActions[W] ? N = this.defaultActions[W] : ((M === null || typeof M > "u") && (M = tt()), N = v[W] && v[W][M]), typeof N > "u" || !N.length || !N[0]) {
57
+ var q = "";
58
+ Z = [];
59
+ for (U in v[W])
60
+ this.terminals_[U] && U > L && Z.push("'" + this.terminals_[U] + "'");
61
+ b.showPosition ? q = "Parse error on line " + (I + 1) + `:
62
+ ` + b.showPosition() + `
63
+ Expecting ` + Z.join(", ") + ", got '" + (this.terminals_[M] || M) + "'" : q = "Parse error on line " + (I + 1) + ": Unexpected " + (M == A ? "end of input" : "'" + (this.terminals_[M] || M) + "'"), this.parseError(q, {
64
+ text: b.match,
65
+ token: this.terminals_[M] || M,
66
+ line: b.yylineno,
67
+ loc: R,
68
+ expected: Z
69
+ });
70
+ }
71
+ if (N[0] instanceof Array && N.length > 1)
72
+ throw new Error("Parse Error: multiple actions possible at state: " + W + ", token: " + M);
73
+ switch (N[0]) {
74
+ case 1:
75
+ i.push(M), p.push(b.yytext), n.push(b.yylloc), i.push(N[1]), M = null, $ = b.yyleng, w = b.yytext, I = b.yylineno, R = b.yylloc;
76
+ break;
77
+ case 2:
78
+ if (V = this.productions_[N[1]][1], F.$ = p[p.length - V], F._$ = {
79
+ first_line: n[n.length - (V || 1)].first_line,
80
+ last_line: n[n.length - 1].last_line,
81
+ first_column: n[n.length - (V || 1)].first_column,
82
+ last_column: n[n.length - 1].last_column
83
+ }, G && (F._$.range = [
84
+ n[n.length - (V || 1)].range[0],
85
+ n[n.length - 1].range[1]
86
+ ]), Y = this.performAction.apply(F, [
87
+ w,
88
+ $,
89
+ I,
90
+ S.yy,
91
+ N[1],
92
+ p,
93
+ n
94
+ ].concat(C)), typeof Y < "u")
95
+ return Y;
96
+ V && (i = i.slice(0, -1 * V * 2), p = p.slice(0, -1 * V), n = n.slice(0, -1 * V)), i.push(this.productions_[N[1]][0]), p.push(F.$), n.push(F._$), et = v[i[i.length - 2]][i[i.length - 1]], i.push(et);
97
+ break;
98
+ case 3:
99
+ return !0;
100
+ }
101
+ }
102
+ return !0;
103
+ }, "parse")
104
+ }, O = /* @__PURE__ */ (function() {
105
+ var T = {
106
+ EOF: 1,
107
+ parseError: /* @__PURE__ */ o(function(s, i) {
108
+ if (this.yy.parser)
109
+ this.yy.parser.parseError(s, i);
110
+ else
111
+ throw new Error(s);
112
+ }, "parseError"),
113
+ // resets the lexer, sets new input
114
+ setInput: /* @__PURE__ */ o(function(t, s) {
115
+ return this.yy = s || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
116
+ first_line: 1,
117
+ first_column: 0,
118
+ last_line: 1,
119
+ last_column: 0
120
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
121
+ }, "setInput"),
122
+ // consumes and returns one char from the input
123
+ input: /* @__PURE__ */ o(function() {
124
+ var t = this._input[0];
125
+ this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t;
126
+ var s = t.match(/(?:\r\n?|\n).*/g);
127
+ return s ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t;
128
+ }, "input"),
129
+ // unshifts one char (or a string) into the input
130
+ unput: /* @__PURE__ */ o(function(t) {
131
+ var s = t.length, i = t.split(/(?:\r\n?|\n)/g);
132
+ this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - s), this.offset -= s;
133
+ var c = this.match.split(/(?:\r\n?|\n)/g);
134
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), i.length - 1 && (this.yylineno -= i.length - 1);
135
+ var p = this.yylloc.range;
136
+ return this.yylloc = {
137
+ first_line: this.yylloc.first_line,
138
+ last_line: this.yylineno + 1,
139
+ first_column: this.yylloc.first_column,
140
+ last_column: i ? (i.length === c.length ? this.yylloc.first_column : 0) + c[c.length - i.length].length - i[0].length : this.yylloc.first_column - s
141
+ }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - s]), this.yyleng = this.yytext.length, this;
142
+ }, "unput"),
143
+ // When called from action, caches matched text and appends it on next action
144
+ more: /* @__PURE__ */ o(function() {
145
+ return this._more = !0, this;
146
+ }, "more"),
147
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
148
+ reject: /* @__PURE__ */ o(function() {
149
+ if (this.options.backtrack_lexer)
150
+ this._backtrack = !0;
151
+ else
152
+ 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).
153
+ ` + this.showPosition(), {
154
+ text: "",
155
+ token: null,
156
+ line: this.yylineno
157
+ });
158
+ return this;
159
+ }, "reject"),
160
+ // retain first n characters of the match
161
+ less: /* @__PURE__ */ o(function(t) {
162
+ this.unput(this.match.slice(t));
163
+ }, "less"),
164
+ // displays already matched input, i.e. for error messages
165
+ pastInput: /* @__PURE__ */ o(function() {
166
+ var t = this.matched.substr(0, this.matched.length - this.match.length);
167
+ return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "");
168
+ }, "pastInput"),
169
+ // displays upcoming input, i.e. for error messages
170
+ upcomingInput: /* @__PURE__ */ o(function() {
171
+ var t = this.match;
172
+ return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "");
173
+ }, "upcomingInput"),
174
+ // displays the character position where the lexing error occurred, i.e. for error messages
175
+ showPosition: /* @__PURE__ */ o(function() {
176
+ var t = this.pastInput(), s = new Array(t.length + 1).join("-");
177
+ return t + this.upcomingInput() + `
178
+ ` + s + "^";
179
+ }, "showPosition"),
180
+ // test the lexed token: return FALSE when not a match, otherwise return token
181
+ test_match: /* @__PURE__ */ o(function(t, s) {
182
+ var i, c, p;
183
+ if (this.options.backtrack_lexer && (p = {
184
+ yylineno: this.yylineno,
185
+ yylloc: {
186
+ first_line: this.yylloc.first_line,
187
+ last_line: this.last_line,
188
+ first_column: this.yylloc.first_column,
189
+ last_column: this.yylloc.last_column
190
+ },
191
+ yytext: this.yytext,
192
+ match: this.match,
193
+ matches: this.matches,
194
+ matched: this.matched,
195
+ yyleng: this.yyleng,
196
+ offset: this.offset,
197
+ _more: this._more,
198
+ _input: this._input,
199
+ yy: this.yy,
200
+ conditionStack: this.conditionStack.slice(0),
201
+ done: this.done
202
+ }, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), c = t[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
203
+ first_line: this.yylloc.last_line,
204
+ last_line: this.yylineno + 1,
205
+ first_column: this.yylloc.last_column,
206
+ last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
207
+ }, this.yytext += t[0], this.match += t[0], this.matches = t, 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(t[0].length), this.matched += t[0], i = this.performAction.call(this, this.yy, this, s, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), i)
208
+ return i;
209
+ if (this._backtrack) {
210
+ for (var n in p)
211
+ this[n] = p[n];
212
+ return !1;
213
+ }
214
+ return !1;
215
+ }, "test_match"),
216
+ // return next match in input
217
+ next: /* @__PURE__ */ o(function() {
218
+ if (this.done)
219
+ return this.EOF;
220
+ this._input || (this.done = !0);
221
+ var t, s, i, c;
222
+ this._more || (this.yytext = "", this.match = "");
223
+ for (var p = this._currentRules(), n = 0; n < p.length; n++)
224
+ if (i = this._input.match(this.rules[p[n]]), i && (!s || i[0].length > s[0].length)) {
225
+ if (s = i, c = n, this.options.backtrack_lexer) {
226
+ if (t = this.test_match(i, p[n]), t !== !1)
227
+ return t;
228
+ if (this._backtrack) {
229
+ s = !1;
230
+ continue;
231
+ } else
232
+ return !1;
233
+ } else if (!this.options.flex)
234
+ break;
235
+ }
236
+ return s ? (t = this.test_match(s, p[c]), t !== !1 ? t : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
237
+ ` + this.showPosition(), {
238
+ text: "",
239
+ token: null,
240
+ line: this.yylineno
241
+ });
242
+ }, "next"),
243
+ // return next match that has a token
244
+ lex: /* @__PURE__ */ o(function() {
245
+ var s = this.next();
246
+ return s || this.lex();
247
+ }, "lex"),
248
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
249
+ begin: /* @__PURE__ */ o(function(s) {
250
+ this.conditionStack.push(s);
251
+ }, "begin"),
252
+ // pop the previously active lexer condition state off the condition stack
253
+ popState: /* @__PURE__ */ o(function() {
254
+ var s = this.conditionStack.length - 1;
255
+ return s > 0 ? this.conditionStack.pop() : this.conditionStack[0];
256
+ }, "popState"),
257
+ // produce the lexer rule set which is active for the currently active lexer condition state
258
+ _currentRules: /* @__PURE__ */ o(function() {
259
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
260
+ }, "_currentRules"),
261
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
262
+ topState: /* @__PURE__ */ o(function(s) {
263
+ return s = this.conditionStack.length - 1 - Math.abs(s || 0), s >= 0 ? this.conditionStack[s] : "INITIAL";
264
+ }, "topState"),
265
+ // alias for begin(condition)
266
+ pushState: /* @__PURE__ */ o(function(s) {
267
+ this.begin(s);
268
+ }, "pushState"),
269
+ // return the number of states currently on the stack
270
+ stateStackSize: /* @__PURE__ */ o(function() {
271
+ return this.conditionStack.length;
272
+ }, "stateStackSize"),
273
+ options: { "case-insensitive": !0 },
274
+ performAction: /* @__PURE__ */ o(function(s, i, c, p) {
275
+ switch (c) {
276
+ case 0:
277
+ return 6;
278
+ case 1:
279
+ return 8;
280
+ case 2:
281
+ return 8;
282
+ case 3:
283
+ return 6;
284
+ case 4:
285
+ return 7;
286
+ case 5:
287
+ return 13;
288
+ case 6:
289
+ return 14;
290
+ case 7:
291
+ return 11;
292
+ }
293
+ }, "anonymous"),
294
+ rules: [/^(?:\s*%%.*)/i, /^(?:ishikawa-beta\b)/i, /^(?:ishikawa\b)/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:[^\n]+)/i, /^(?:$)/i],
295
+ conditions: { INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 } }
296
+ };
297
+ return T;
298
+ })();
299
+ D.lexer = O;
300
+ function E() {
301
+ this.yy = {};
302
+ }
303
+ return o(E, "Parser"), E.prototype = D, D.Parser = E, new E();
304
+ })();
305
+ J.parser = J;
306
+ var xt = J, H, vt = (H = class {
307
+ constructor() {
308
+ this.stack = [], this.clear = this.clear.bind(this), this.addNode = this.addNode.bind(this), this.getRoot = this.getRoot.bind(this);
309
+ }
310
+ clear() {
311
+ this.root = void 0, this.stack = [], this.baseLevel = void 0, ft();
312
+ }
313
+ getRoot() {
314
+ return this.root;
315
+ }
316
+ addNode(h, r) {
317
+ const a = pt.sanitizeText(r, ot());
318
+ if (!this.root) {
319
+ this.root = { text: a, children: [] }, this.stack = [{ level: 0, node: this.root }], it(a);
320
+ return;
321
+ }
322
+ this.baseLevel ??= h;
323
+ let l = h - this.baseLevel + 1;
324
+ for (l <= 0 && (l = 1); this.stack.length > 1 && this.stack[this.stack.length - 1].level >= l; )
325
+ this.stack.pop();
326
+ const y = this.stack[this.stack.length - 1].node, f = { text: a, children: [] };
327
+ y.children.push(f), this.stack.push({ level: l, node: f });
328
+ }
329
+ getAccTitle() {
330
+ return gt();
331
+ }
332
+ setAccTitle(h) {
333
+ kt(h);
334
+ }
335
+ getAccDescription() {
336
+ return mt();
337
+ }
338
+ setAccDescription(h) {
339
+ wt(h);
340
+ }
341
+ getDiagramTitle() {
342
+ return _t();
343
+ }
344
+ setDiagramTitle(h) {
345
+ it(h);
346
+ }
347
+ }, o(H, "IshikawaDB"), H), St = 14, j = 250, $t = 30, Et = 60, At = 5, ht = 82 * Math.PI / 180, st = Math.cos(ht), nt = Math.sin(ht), at = /* @__PURE__ */ o((e, h, r) => {
348
+ const a = e.node().getBBox(), l = a.width + h * 2, y = a.height + h * 2;
349
+ bt(e, y, l, r), e.attr("viewBox", `${a.x - h} ${a.y - h} ${l} ${y}`);
350
+ }, "applyPaddedViewBox"), It = /* @__PURE__ */ o((e, h, r, a) => {
351
+ const y = a.db.getRoot();
352
+ if (!y)
353
+ return;
354
+ const f = ot(), { look: d, handDrawnSeed: m, themeVariables: u } = f, k = ut(f.fontSize)[0] ?? St, g = d === "handDrawn", _ = y.children ?? [], x = f.ishikawa?.diagramPadding ?? 20, D = f.ishikawa?.useMaxWidth ?? !1, O = dt(h), E = O.append("g").attr("class", "ishikawa"), T = g ? yt.svg(O.node()) : void 0, t = T ? {
355
+ roughSvg: T,
356
+ seed: m ?? 0,
357
+ lineColor: u?.lineColor ?? "#333",
358
+ fillColor: u?.mainBkg ?? "#fff"
359
+ } : void 0, s = `ishikawa-arrow-${h}`;
360
+ g || E.append("defs").append("marker").attr("id", s).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");
361
+ let i = 0, c = j;
362
+ const p = g ? void 0 : z(E, i, c, i, c, "ishikawa-spine");
363
+ if (Lt(E, i, c, y.text, k, t), !_.length) {
364
+ g && z(E, i, c, i, c, "ishikawa-spine", t), at(O, x, D);
365
+ return;
366
+ }
367
+ i -= 20;
368
+ const n = _.filter((S, P) => P % 2 === 0), v = _.filter((S, P) => P % 2 === 1), w = rt(n), I = rt(v), $ = w.total + I.total;
369
+ let L = j, A = j;
370
+ if ($ > 0) {
371
+ const S = j * 2, P = j * 0.3;
372
+ L = Math.max(P, S * (w.total / $)), A = Math.max(P, S * (I.total / $));
373
+ }
374
+ const C = k * 2;
375
+ L = Math.max(L, w.max * C), A = Math.max(A, I.max * C), c = Math.max(L, j), p && p.attr("y1", c).attr("y2", c), E.select(".ishikawa-head-group").attr("transform", `translate(0,${c})`);
376
+ const b = Math.ceil(_.length / 2);
377
+ for (let S = 0; S < b; S++) {
378
+ const P = E.append("g").attr("class", "ishikawa-pair");
379
+ for (const [R, G, X] of [
380
+ [_[S * 2], -1, L],
381
+ [_[S * 2 + 1], 1, A]
382
+ ])
383
+ R && Pt(P, R, i, c, G, X, k, t);
384
+ i = P.selectAll("text").nodes().reduce((R, G) => Math.min(R, G.getBBox().x), 1 / 0);
385
+ }
386
+ if (g)
387
+ z(E, i, c, 0, c, "ishikawa-spine", t);
388
+ else {
389
+ p.attr("x1", i);
390
+ const S = `url(#${s})`;
391
+ E.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start", S);
392
+ }
393
+ at(O, x, D);
394
+ }, "draw"), rt = /* @__PURE__ */ o((e) => {
395
+ const h = /* @__PURE__ */ o((r) => r.children.reduce((a, l) => a + 1 + h(l), 0), "countDescendants");
396
+ return e.reduce(
397
+ (r, a) => {
398
+ const l = h(a);
399
+ return r.total += l, r.max = Math.max(r.max, l), r;
400
+ },
401
+ { total: 0, max: 0 }
402
+ );
403
+ }, "sideStats"), Lt = /* @__PURE__ */ o((e, h, r, a, l, y) => {
404
+ const f = Math.max(6, Math.floor(110 / (l * 0.6))), d = e.append("g").attr("class", "ishikawa-head-group").attr("transform", `translate(${h},${r})`), m = K(
405
+ d,
406
+ ct(a, f),
407
+ 0,
408
+ 0,
409
+ "ishikawa-head-label",
410
+ "start",
411
+ l
412
+ ), u = m.node().getBBox(), k = Math.max(60, u.width + 6), g = Math.max(40, u.height * 2 + 40), _ = `M 0 ${-g / 2} L 0 ${g / 2} Q ${k * 2.4} 0 0 ${-g / 2} Z`;
413
+ if (y) {
414
+ const x = y.roughSvg.path(_, {
415
+ roughness: 1.5,
416
+ seed: y.seed,
417
+ fill: y.fillColor,
418
+ fillStyle: "hachure",
419
+ fillWeight: 2.5,
420
+ hachureGap: 5,
421
+ stroke: y.lineColor,
422
+ strokeWidth: 2
423
+ });
424
+ d.insert(() => x, ":first-child").attr("class", "ishikawa-head");
425
+ } else
426
+ d.insert("path", ":first-child").attr("class", "ishikawa-head").attr("d", _);
427
+ m.attr("transform", `translate(${(k - u.width) / 2 - u.x + 3},${-u.y - u.height / 2})`);
428
+ }, "drawHead"), Tt = /* @__PURE__ */ o((e, h) => {
429
+ const r = [], a = [], l = /* @__PURE__ */ o((y, f, d) => {
430
+ const m = h === -1 ? [...y].reverse() : y;
431
+ for (const u of m) {
432
+ const k = r.length, g = u.children ?? [];
433
+ r.push({
434
+ depth: d,
435
+ text: ct(u.text, 15),
436
+ parentIndex: f,
437
+ childCount: g.length
438
+ }), d % 2 === 0 ? (a.push(k), g.length && l(g, k, d + 1)) : (g.length && l(g, k, d + 1), a.push(k));
439
+ }
440
+ }, "walk");
441
+ return l(e, -1, 2), { entries: r, yOrder: a };
442
+ }, "flattenTree"), Mt = /* @__PURE__ */ o((e, h, r, a, l, y, f) => {
443
+ const d = e.append("g").attr("class", "ishikawa-label-group"), u = K(
444
+ d,
445
+ h,
446
+ r,
447
+ a + 11 * l,
448
+ "ishikawa-label cause",
449
+ "middle",
450
+ y
451
+ ).node().getBBox();
452
+ if (f) {
453
+ const k = f.roughSvg.rectangle(
454
+ u.x - 20,
455
+ u.y - 2,
456
+ u.width + 40,
457
+ u.height + 4,
458
+ {
459
+ roughness: 1.5,
460
+ seed: f.seed,
461
+ fill: f.fillColor,
462
+ fillStyle: "hachure",
463
+ fillWeight: 2.5,
464
+ hachureGap: 5,
465
+ stroke: f.lineColor,
466
+ strokeWidth: 2
467
+ }
468
+ );
469
+ d.insert(() => k, ":first-child").attr("class", "ishikawa-label-box");
470
+ } else
471
+ d.insert("rect", ":first-child").attr("class", "ishikawa-label-box").attr("x", u.x - 20).attr("y", u.y - 2).attr("width", u.width + 40).attr("height", u.height + 4);
472
+ }, "drawCauseLabel"), Q = /* @__PURE__ */ o((e, h, r, a, l, y) => {
473
+ const f = Math.sqrt(a * a + l * l);
474
+ if (f === 0)
475
+ return;
476
+ const d = a / f, m = l / f, u = 6, k = -m * u, g = d * u, _ = h, x = r, D = `M ${_} ${x} L ${_ - d * u * 2 + k} ${x - m * u * 2 + g} L ${_ - d * u * 2 - k} ${x - m * u * 2 - g} Z`, O = y.roughSvg.path(D, {
477
+ roughness: 1,
478
+ seed: y.seed,
479
+ fill: y.lineColor,
480
+ fillStyle: "solid",
481
+ stroke: y.lineColor,
482
+ strokeWidth: 1
483
+ });
484
+ e.append(() => O);
485
+ }, "drawArrowMarker"), Pt = /* @__PURE__ */ o((e, h, r, a, l, y, f, d) => {
486
+ const m = h.children ?? [], u = y * (m.length ? 1 : 0.2), k = -st * u, g = nt * u * l, _ = r + k, x = a + g;
487
+ if (z(e, r, a, _, x, "ishikawa-branch", d), d && Q(e, r, a, r - _, a - x, d), Mt(e, h.text, _, x, l, f, d), !m.length)
488
+ return;
489
+ const { entries: D, yOrder: O } = Tt(m, l), E = D.length, T = new Array(E);
490
+ for (const [p, n] of O.entries())
491
+ T[n] = a + g * ((p + 1) / (E + 1));
492
+ const t = /* @__PURE__ */ new Map();
493
+ t.set(-1, {
494
+ x0: r,
495
+ y0: a,
496
+ x1: _,
497
+ y1: x,
498
+ childCount: m.length,
499
+ childrenDrawn: 0
500
+ });
501
+ const s = -st, i = nt * l, c = l < 0 ? "ishikawa-label up" : "ishikawa-label down";
502
+ for (const [p, n] of D.entries()) {
503
+ const v = T[p], w = t.get(n.parentIndex), I = e.append("g").attr("class", "ishikawa-sub-group");
504
+ let $ = 0, L = 0, A = 0;
505
+ if (n.depth % 2 === 0) {
506
+ const C = w.y1 - w.y0;
507
+ $ = lt(w.x0, w.x1, C ? (v - w.y0) / C : 0.5), L = v, A = $ - (n.childCount > 0 ? Et + n.childCount * At : $t), z(I, $, v, A, v, "ishikawa-sub-branch", d), d && Q(I, $, v, 1, 0, d), K(I, n.text, A, v, "ishikawa-label align", "end", f);
508
+ } else {
509
+ const C = w.childrenDrawn++;
510
+ $ = lt(w.x0, w.x1, (w.childCount - C) / (w.childCount + 1)), L = w.y0, A = $ + s * ((v - L) / i), z(I, $, L, A, v, "ishikawa-sub-branch", d), d && Q(I, $, L, $ - A, L - v, d), K(I, n.text, A, v, c, "end", f);
511
+ }
512
+ n.childCount > 0 && t.set(p, {
513
+ x0: $,
514
+ y0: L,
515
+ x1: A,
516
+ y1: v,
517
+ childCount: n.childCount,
518
+ childrenDrawn: 0
519
+ });
520
+ }
521
+ }, "drawBranch"), Bt = /* @__PURE__ */ o((e) => e.split(/<br\s*\/?>|\n/), "splitLines"), ct = /* @__PURE__ */ o((e, h) => {
522
+ if (e.length <= h)
523
+ return e;
524
+ const r = [];
525
+ for (const a of e.split(/\s+/)) {
526
+ const l = r.length - 1;
527
+ l >= 0 && r[l].length + 1 + a.length <= h ? r[l] += " " + a : r.push(a);
528
+ }
529
+ return r.join(`
530
+ `);
531
+ }, "wrapText"), K = /* @__PURE__ */ o((e, h, r, a, l, y, f) => {
532
+ const d = Bt(h), m = f * 1.05, u = e.append("text").attr("class", l).attr("text-anchor", y).attr("x", r).attr("y", a - (d.length - 1) * m / 2);
533
+ for (const [k, g] of d.entries())
534
+ u.append("tspan").attr("x", r).attr("dy", k === 0 ? 0 : m).text(g);
535
+ return u;
536
+ }, "drawMultilineText"), lt = /* @__PURE__ */ o((e, h, r) => e + (h - e) * r, "lerp"), z = /* @__PURE__ */ o((e, h, r, a, l, y, f) => {
537
+ if (f) {
538
+ const d = f.roughSvg.line(h, r, a, l, {
539
+ roughness: 1.5,
540
+ seed: f.seed,
541
+ stroke: f.lineColor,
542
+ strokeWidth: 2
543
+ });
544
+ e.append(() => d).attr("class", y);
545
+ return;
546
+ }
547
+ return e.append("line").attr("class", y).attr("x1", h).attr("y1", r).attr("x2", a).attr("y2", l);
548
+ }, "drawLine"), Nt = { draw: It }, Dt = /* @__PURE__ */ o((e) => `
549
+ .ishikawa .ishikawa-spine,
550
+ .ishikawa .ishikawa-branch,
551
+ .ishikawa .ishikawa-sub-branch {
552
+ stroke: ${e.lineColor};
553
+ stroke-width: 2;
554
+ fill: none;
555
+ }
556
+
557
+ .ishikawa .ishikawa-sub-branch {
558
+ stroke-width: 1;
559
+ }
560
+
561
+ .ishikawa .ishikawa-arrow {
562
+ fill: ${e.lineColor};
563
+ }
564
+
565
+ .ishikawa .ishikawa-head {
566
+ fill: ${e.mainBkg};
567
+ stroke: ${e.lineColor};
568
+ stroke-width: 2;
569
+ }
570
+
571
+ .ishikawa .ishikawa-label-box {
572
+ fill: ${e.mainBkg};
573
+ stroke: ${e.lineColor};
574
+ stroke-width: 2;
575
+ }
576
+
577
+ .ishikawa text {
578
+ font-family: ${e.fontFamily};
579
+ font-size: ${e.fontSize};
580
+ fill: ${e.textColor};
581
+ }
582
+
583
+ .ishikawa .ishikawa-head-label {
584
+ font-weight: 600;
585
+ text-anchor: middle;
586
+ dominant-baseline: middle;
587
+ font-size: 14px;
588
+ }
589
+
590
+ .ishikawa .ishikawa-label {
591
+ text-anchor: end;
592
+ }
593
+
594
+ .ishikawa .ishikawa-label.cause {
595
+ text-anchor: middle;
596
+ dominant-baseline: middle;
597
+ }
598
+
599
+ .ishikawa .ishikawa-label.align {
600
+ text-anchor: end;
601
+ dominant-baseline: middle;
602
+ }
603
+
604
+ .ishikawa .ishikawa-label.up {
605
+ dominant-baseline: baseline;
606
+ }
607
+
608
+ .ishikawa .ishikawa-label.down {
609
+ dominant-baseline: hanging;
610
+ }
611
+ `, "getStyles"), Ot = Dt, Vt = {
612
+ parser: xt,
613
+ get db() {
614
+ return new vt();
615
+ },
616
+ renderer: Nt,
617
+ styles: Ot
618
+ };
619
+ export {
620
+ Vt as diagram
621
+ };