dominds 1.12.2 → 1.13.2

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 (174) hide show
  1. package/dist/llm/client.d.ts +1 -0
  2. package/dist/llm/defaults.yaml +1 -0
  3. package/dist/llm/gen/anthropic.d.ts +2 -1
  4. package/dist/llm/gen/anthropic.js +4 -0
  5. package/dist/llm/gen/codex.d.ts +2 -1
  6. package/dist/llm/gen/codex.js +4 -0
  7. package/dist/llm/gen/failure-classifier.d.ts +3 -0
  8. package/dist/llm/gen/failure-classifier.js +156 -0
  9. package/dist/llm/gen/openai-compatible.d.ts +2 -1
  10. package/dist/llm/gen/openai-compatible.js +4 -0
  11. package/dist/llm/gen/openai.d.ts +2 -1
  12. package/dist/llm/gen/openai.js +4 -0
  13. package/dist/llm/gen.d.ts +10 -0
  14. package/dist/llm/kernel-driver/drive.js +22 -6
  15. package/dist/llm/kernel-driver/flow.js +15 -20
  16. package/dist/llm/kernel-driver/reply-guidance.d.ts +7 -1
  17. package/dist/llm/kernel-driver/reply-guidance.js +30 -4
  18. package/dist/llm/kernel-driver/runtime.d.ts +3 -0
  19. package/dist/llm/kernel-driver/runtime.js +103 -30
  20. package/dist/persistence.js +31 -6
  21. package/dist/runtime/inter-dialog-format.js +46 -16
  22. package/dist/runtime/reply-prompt-copy.d.ts +12 -2
  23. package/dist/runtime/reply-prompt-copy.js +74 -16
  24. package/dist/runtime/tellask-labels.d.ts +8 -0
  25. package/dist/runtime/tellask-labels.js +47 -0
  26. package/dist/shared/utils/fbr.js +8 -12
  27. package/dist/shared/utils/inter-dialog-format.js +4 -6
  28. package/dist/tools/pending-tellask-reminder.js +3 -19
  29. package/package.json +3 -3
  30. package/webapp/dist/assets/{_basePickBy-B1lGEusm.js → _basePickBy-CBOtd63g.js} +3 -3
  31. package/webapp/dist/assets/_basePickBy-CBOtd63g.js.map +1 -0
  32. package/webapp/dist/assets/{_baseUniq-SGAsMSaE.js → _baseUniq-mfoKz4Wm.js} +2 -2
  33. package/webapp/dist/assets/_baseUniq-mfoKz4Wm.js.map +1 -0
  34. package/webapp/dist/assets/{arc-B2joU0eL.js → arc-Dq0WZLyu.js} +2 -2
  35. package/webapp/dist/assets/arc-Dq0WZLyu.js.map +1 -0
  36. package/webapp/dist/assets/{architectureDiagram-2XIMDMQ5-CsuG-Xa3.js → architectureDiagram-VXUJARFQ-CNmygmp3.js} +8 -26
  37. package/webapp/dist/assets/architectureDiagram-VXUJARFQ-CNmygmp3.js.map +1 -0
  38. package/webapp/dist/assets/{blockDiagram-WCTKOSBZ-D8_SVEGn.js → blockDiagram-VD42YOAC-DvE0lybt.js} +170 -187
  39. package/webapp/dist/assets/blockDiagram-VD42YOAC-DvE0lybt.js.map +1 -0
  40. package/webapp/dist/assets/{c4Diagram-IC4MRINW-D_lhLw36.js → c4Diagram-YG6GDRKO-CR7zJ2_u.js} +4 -4
  41. package/webapp/dist/assets/c4Diagram-YG6GDRKO-CR7zJ2_u.js.map +1 -0
  42. package/webapp/dist/assets/{channel-BI76pqQS.js → channel-DrTrnYx4.js} +2 -2
  43. package/webapp/dist/assets/channel-DrTrnYx4.js.map +1 -0
  44. package/webapp/dist/assets/{chunk-4BX2VUAB-BVI27QNV.js → chunk-4BX2VUAB-CVuJEIeN.js} +2 -2
  45. package/webapp/dist/assets/chunk-4BX2VUAB-CVuJEIeN.js.map +1 -0
  46. package/webapp/dist/assets/{chunk-55IACEB6-D2ECkhpq.js → chunk-55IACEB6-BxUoXApB.js} +2 -2
  47. package/webapp/dist/assets/chunk-55IACEB6-BxUoXApB.js.map +1 -0
  48. package/webapp/dist/assets/{chunk-WL4C6EOR-Cd-rWL8V.js → chunk-B4BG7PRW-DpMa3-9L.js} +121 -171
  49. package/webapp/dist/assets/chunk-B4BG7PRW-DpMa3-9L.js.map +1 -0
  50. package/webapp/dist/assets/{chunk-NQ4KR5QH-CZmmNdX5.js → chunk-DI55MBZ5-SAhxUTqQ.js} +7 -9
  51. package/webapp/dist/assets/chunk-DI55MBZ5-SAhxUTqQ.js.map +1 -0
  52. package/webapp/dist/assets/{chunk-FMBD7UC4-BAtzNqV5.js → chunk-FMBD7UC4-TX-LVAaV.js} +2 -2
  53. package/webapp/dist/assets/chunk-FMBD7UC4-TX-LVAaV.js.map +1 -0
  54. package/webapp/dist/assets/{chunk-KX2RTZJC-Dt3XFfSl.js → chunk-QN33PNHL-D1uiKlOO.js} +2 -2
  55. package/webapp/dist/assets/chunk-QN33PNHL-D1uiKlOO.js.map +1 -0
  56. package/webapp/dist/assets/{chunk-QZHKN3VN-BI_lqvsU.js → chunk-QZHKN3VN-BxuV0Oba.js} +2 -2
  57. package/webapp/dist/assets/chunk-QZHKN3VN-BxuV0Oba.js.map +1 -0
  58. package/webapp/dist/assets/{chunk-JSJVCQXG-BYyIDBzB.js → chunk-TZMSLE5B-Cw689yRl.js} +6 -14
  59. package/webapp/dist/assets/chunk-TZMSLE5B-Cw689yRl.js.map +1 -0
  60. package/webapp/dist/assets/{classDiagram-VBA2DB6C-CGVpNFjf.js → classDiagram-2ON5EDUG-BTTGianr.js} +6 -7
  61. package/webapp/dist/assets/classDiagram-2ON5EDUG-BTTGianr.js.map +1 -0
  62. package/webapp/dist/assets/{classDiagram-v2-RAHNMMFH-CGVpNFjf.js → classDiagram-v2-WZHVMYZB-BTTGianr.js} +6 -7
  63. package/webapp/dist/assets/classDiagram-v2-WZHVMYZB-BTTGianr.js.map +1 -0
  64. package/webapp/dist/assets/{clone-BcAwA2lT.js → clone-Dk8cAI3I.js} +2 -2
  65. package/webapp/dist/assets/clone-Dk8cAI3I.js.map +1 -0
  66. package/webapp/dist/assets/{cose-bilkent-S5V4N54A-CfkPOIie.js → cose-bilkent-S5V4N54A-BjJnzB2N.js} +2 -2
  67. package/webapp/dist/assets/cose-bilkent-S5V4N54A-BjJnzB2N.js.map +1 -0
  68. package/webapp/dist/assets/cytoscape.esm-Bm8DJGmZ.js.map +1 -1
  69. package/webapp/dist/assets/{dagre-KLK3FWXG-ETpwT3pg.js → dagre-6UL2VRFP-VF-xGhAf.js} +7 -7
  70. package/webapp/dist/assets/dagre-6UL2VRFP-VF-xGhAf.js.map +1 -0
  71. package/webapp/dist/assets/defaultLocale-B2RvLBDe.js.map +1 -1
  72. package/webapp/dist/assets/{diagram-E7M64L7V-CAkt3_Wu.js → diagram-PSM6KHXK-Ba5U0oRY.js} +10 -10
  73. package/webapp/dist/assets/diagram-PSM6KHXK-Ba5U0oRY.js.map +1 -0
  74. package/webapp/dist/assets/{diagram-IFDJBPK2-BUoOrHGY.js → diagram-QEK2KX5R-DoYCnEw_.js} +8 -9
  75. package/webapp/dist/assets/diagram-QEK2KX5R-DoYCnEw_.js.map +1 -0
  76. package/webapp/dist/assets/{diagram-P4PSJMXO-CITRT5KI.js → diagram-S2PKOQOG-CkK4SRyE.js} +8 -8
  77. package/webapp/dist/assets/diagram-S2PKOQOG-CkK4SRyE.js.map +1 -0
  78. package/webapp/dist/assets/{erDiagram-INFDFZHY-Cjpy0ose.js → erDiagram-Q2GNP2WA-DkI5eYww.js} +75 -96
  79. package/webapp/dist/assets/erDiagram-Q2GNP2WA-DkI5eYww.js.map +1 -0
  80. package/webapp/dist/assets/{flowDiagram-PKNHOUZH-CBmrK8ST.js → flowDiagram-NV44I4VS-wOdPUQ7Y.js} +81 -98
  81. package/webapp/dist/assets/flowDiagram-NV44I4VS-wOdPUQ7Y.js.map +1 -0
  82. package/webapp/dist/assets/{ganttDiagram-A5KZAMGK-CLoJRKb7.js → ganttDiagram-JELNMOA3-BtRWgkUH.js} +3 -28
  83. package/webapp/dist/assets/ganttDiagram-JELNMOA3-BtRWgkUH.js.map +1 -0
  84. package/webapp/dist/assets/{gitGraphDiagram-K3NZZRJ6-DcAa_Q3i.js → gitGraphDiagram-V2S2FVAM-Bsz7u1vi.js} +46 -38
  85. package/webapp/dist/assets/gitGraphDiagram-V2S2FVAM-Bsz7u1vi.js.map +1 -0
  86. package/webapp/dist/assets/graph-DAMkuTbn.js +425 -0
  87. package/webapp/dist/assets/graph-DAMkuTbn.js.map +1 -0
  88. package/webapp/dist/assets/{index-B219Q97D.js → index-rYmIohM_.js} +1072 -1025
  89. package/webapp/dist/assets/{index-B219Q97D.js.map → index-rYmIohM_.js.map} +1 -1
  90. package/webapp/dist/assets/{index-YaxF76or.css → index-xvYYeHuy.css} +1 -1
  91. package/webapp/dist/assets/{infoDiagram-LFFYTUFH-CXY1BDG-.js → infoDiagram-HS3SLOUP-BMaxCvH5.js} +7 -7
  92. package/webapp/dist/assets/infoDiagram-HS3SLOUP-BMaxCvH5.js.map +1 -0
  93. package/webapp/dist/assets/init-ZxktEp_H.js.map +1 -1
  94. package/webapp/dist/assets/{journeyDiagram-4ABVD52K-jFEOb3_9.js → journeyDiagram-XKPGCS4Q-ejyerzmG.js} +5 -5
  95. package/webapp/dist/assets/journeyDiagram-XKPGCS4Q-ejyerzmG.js.map +1 -0
  96. package/webapp/dist/assets/{kanban-definition-K7BYSVSG-g9DIRWk3.js → kanban-definition-3W4ZIXB7-CYj35TEs.js} +3 -5
  97. package/webapp/dist/assets/kanban-definition-3W4ZIXB7-CYj35TEs.js.map +1 -0
  98. package/webapp/dist/assets/{layout-BvoIJLam.js → layout-7Ql4zmuL.js} +5 -5
  99. package/webapp/dist/assets/layout-7Ql4zmuL.js.map +1 -0
  100. package/webapp/dist/assets/{linear-WhxKIgP6.js → linear-CVmgVPuZ.js} +2 -2
  101. package/webapp/dist/assets/linear-CVmgVPuZ.js.map +1 -0
  102. package/webapp/dist/assets/{mindmap-definition-YRQLILUH-BXxTVKab.js → mindmap-definition-VGOIOE7T-DOpxjGVo.js} +5 -7
  103. package/webapp/dist/assets/mindmap-definition-VGOIOE7T-DOpxjGVo.js.map +1 -0
  104. package/webapp/dist/assets/ordinal-CxptdPJm.js.map +1 -1
  105. package/webapp/dist/assets/{pieDiagram-SKSYHLDU-BVfKuFkc.js → pieDiagram-ADFJNKIX-CLQjpmAG.js} +8 -8
  106. package/webapp/dist/assets/pieDiagram-ADFJNKIX-CLQjpmAG.js.map +1 -0
  107. package/webapp/dist/assets/{quadrantDiagram-337W2JSQ-DjOan1Ul.js → quadrantDiagram-AYHSOK5B-ClD_bz7z.js} +3 -3
  108. package/webapp/dist/assets/quadrantDiagram-AYHSOK5B-ClD_bz7z.js.map +1 -0
  109. package/webapp/dist/assets/{requirementDiagram-Z7DCOOCP-CdkkhNJu.js → requirementDiagram-UZGBJVZJ-DOpb-TWH.js} +6 -16
  110. package/webapp/dist/assets/requirementDiagram-UZGBJVZJ-DOpb-TWH.js.map +1 -0
  111. package/webapp/dist/assets/{sankeyDiagram-WA2Y5GQK-Cc7UCE1M.js → sankeyDiagram-TZEHDZUN-D8Hsj3yx.js} +2 -2
  112. package/webapp/dist/assets/sankeyDiagram-TZEHDZUN-D8Hsj3yx.js.map +1 -0
  113. package/webapp/dist/assets/{sequenceDiagram-2WXFIKYE-CAf-TzzV.js → sequenceDiagram-WL72ISMW-CFMNjBER.js} +201 -601
  114. package/webapp/dist/assets/sequenceDiagram-WL72ISMW-CFMNjBER.js.map +1 -0
  115. package/webapp/dist/assets/{stateDiagram-RAJIS63D-CjQh2yGU.js → stateDiagram-FKZM4ZOC-BQeDlw0P.js} +9 -9
  116. package/webapp/dist/assets/stateDiagram-FKZM4ZOC-BQeDlw0P.js.map +1 -0
  117. package/webapp/dist/assets/{stateDiagram-v2-FVOUBMTO-BINESHF-.js → stateDiagram-v2-4FDKWEC3-DscX61Rs.js} +5 -5
  118. package/webapp/dist/assets/stateDiagram-v2-4FDKWEC3-DscX61Rs.js.map +1 -0
  119. package/webapp/dist/assets/{timeline-definition-YZTLITO2-FCh1aV2p.js → timeline-definition-IT6M3QCI-BcXPSTiw.js} +3 -3
  120. package/webapp/dist/assets/timeline-definition-IT6M3QCI-BcXPSTiw.js.map +1 -0
  121. package/webapp/dist/assets/{treemap-KZPCXAKY-J-UTxKUf.js → treemap-GDKQZRPO-BBr4UV0Z.js} +24 -37
  122. package/webapp/dist/assets/treemap-GDKQZRPO-BBr4UV0Z.js.map +1 -0
  123. package/webapp/dist/assets/{xychartDiagram-JWTSCODW-KYLvRsLH.js → xychartDiagram-PRI3JC2R-CS5RAtQE.js} +4 -4
  124. package/webapp/dist/assets/xychartDiagram-PRI3JC2R-CS5RAtQE.js.map +1 -0
  125. package/webapp/dist/index.html +2 -2
  126. package/webapp/dist/assets/_basePickBy-B1lGEusm.js.map +0 -1
  127. package/webapp/dist/assets/_baseUniq-SGAsMSaE.js.map +0 -1
  128. package/webapp/dist/assets/arc-B2joU0eL.js.map +0 -1
  129. package/webapp/dist/assets/architectureDiagram-2XIMDMQ5-CsuG-Xa3.js.map +0 -1
  130. package/webapp/dist/assets/blockDiagram-WCTKOSBZ-D8_SVEGn.js.map +0 -1
  131. package/webapp/dist/assets/c4Diagram-IC4MRINW-D_lhLw36.js.map +0 -1
  132. package/webapp/dist/assets/channel-BI76pqQS.js.map +0 -1
  133. package/webapp/dist/assets/chunk-4BX2VUAB-BVI27QNV.js.map +0 -1
  134. package/webapp/dist/assets/chunk-55IACEB6-D2ECkhpq.js.map +0 -1
  135. package/webapp/dist/assets/chunk-FMBD7UC4-BAtzNqV5.js.map +0 -1
  136. package/webapp/dist/assets/chunk-JSJVCQXG-BYyIDBzB.js.map +0 -1
  137. package/webapp/dist/assets/chunk-KX2RTZJC-Dt3XFfSl.js.map +0 -1
  138. package/webapp/dist/assets/chunk-NQ4KR5QH-CZmmNdX5.js.map +0 -1
  139. package/webapp/dist/assets/chunk-QZHKN3VN-BI_lqvsU.js.map +0 -1
  140. package/webapp/dist/assets/chunk-WL4C6EOR-Cd-rWL8V.js.map +0 -1
  141. package/webapp/dist/assets/classDiagram-VBA2DB6C-CGVpNFjf.js.map +0 -1
  142. package/webapp/dist/assets/classDiagram-v2-RAHNMMFH-CGVpNFjf.js.map +0 -1
  143. package/webapp/dist/assets/clone-BcAwA2lT.js.map +0 -1
  144. package/webapp/dist/assets/cose-bilkent-S5V4N54A-CfkPOIie.js.map +0 -1
  145. package/webapp/dist/assets/dagre-KLK3FWXG-ETpwT3pg.js.map +0 -1
  146. package/webapp/dist/assets/diagram-E7M64L7V-CAkt3_Wu.js.map +0 -1
  147. package/webapp/dist/assets/diagram-IFDJBPK2-BUoOrHGY.js.map +0 -1
  148. package/webapp/dist/assets/diagram-P4PSJMXO-CITRT5KI.js.map +0 -1
  149. package/webapp/dist/assets/erDiagram-INFDFZHY-Cjpy0ose.js.map +0 -1
  150. package/webapp/dist/assets/flowDiagram-PKNHOUZH-CBmrK8ST.js.map +0 -1
  151. package/webapp/dist/assets/ganttDiagram-A5KZAMGK-CLoJRKb7.js.map +0 -1
  152. package/webapp/dist/assets/gitGraphDiagram-K3NZZRJ6-DcAa_Q3i.js.map +0 -1
  153. package/webapp/dist/assets/graph-CyYArI_M.js +0 -782
  154. package/webapp/dist/assets/graph-CyYArI_M.js.map +0 -1
  155. package/webapp/dist/assets/infoDiagram-LFFYTUFH-CXY1BDG-.js.map +0 -1
  156. package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-CCgHez0F.js +0 -966
  157. package/webapp/dist/assets/ishikawaDiagram-PHBUUO56-CCgHez0F.js.map +0 -1
  158. package/webapp/dist/assets/journeyDiagram-4ABVD52K-jFEOb3_9.js.map +0 -1
  159. package/webapp/dist/assets/kanban-definition-K7BYSVSG-g9DIRWk3.js.map +0 -1
  160. package/webapp/dist/assets/layout-BvoIJLam.js.map +0 -1
  161. package/webapp/dist/assets/linear-WhxKIgP6.js.map +0 -1
  162. package/webapp/dist/assets/mindmap-definition-YRQLILUH-BXxTVKab.js.map +0 -1
  163. package/webapp/dist/assets/pieDiagram-SKSYHLDU-BVfKuFkc.js.map +0 -1
  164. package/webapp/dist/assets/quadrantDiagram-337W2JSQ-DjOan1Ul.js.map +0 -1
  165. package/webapp/dist/assets/requirementDiagram-Z7DCOOCP-CdkkhNJu.js.map +0 -1
  166. package/webapp/dist/assets/sankeyDiagram-WA2Y5GQK-Cc7UCE1M.js.map +0 -1
  167. package/webapp/dist/assets/sequenceDiagram-2WXFIKYE-CAf-TzzV.js.map +0 -1
  168. package/webapp/dist/assets/stateDiagram-RAJIS63D-CjQh2yGU.js.map +0 -1
  169. package/webapp/dist/assets/stateDiagram-v2-FVOUBMTO-BINESHF-.js.map +0 -1
  170. package/webapp/dist/assets/timeline-definition-YZTLITO2-FCh1aV2p.js.map +0 -1
  171. package/webapp/dist/assets/treemap-KZPCXAKY-J-UTxKUf.js.map +0 -1
  172. package/webapp/dist/assets/vennDiagram-LZ73GAT5-T1yQlS2L.js +0 -2487
  173. package/webapp/dist/assets/vennDiagram-LZ73GAT5-T1yQlS2L.js.map +0 -1
  174. package/webapp/dist/assets/xychartDiagram-JWTSCODW-KYLvRsLH.js.map +0 -1
@@ -1,966 +0,0 @@
1
- var _a;
2
- import { _ as __name, c as getConfig2, N as parseFontSize, I as selectSvgElement, as as at, z as clear, k as common_default, p as setDiagramTitle, a as getAccTitle, b as setAccTitle, g as getAccDescription, s as setAccDescription, q as getDiagramTitle, e as configureSvgSize } from "./index-B219Q97D.js";
3
- var parser = (function() {
4
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
5
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
6
- return o2;
7
- }, "o"), $V0 = [1, 4], $V1 = [1, 14], $V2 = [1, 12], $V3 = [1, 13], $V4 = [6, 7, 8], $V5 = [1, 20], $V6 = [1, 18], $V7 = [1, 19], $V8 = [6, 7, 11], $V9 = [1, 6, 13, 14], $Va = [1, 23], $Vb = [1, 24], $Vc = [1, 6, 7, 11, 13, 14];
8
- var parser2 = {
9
- trace: /* @__PURE__ */ __name(function trace() {
10
- }, "trace"),
11
- yy: {},
12
- 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 },
13
- terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "ISHIKAWA", 11: "EOF", 13: "SPACELIST", 14: "TEXT" },
14
- 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]],
15
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
16
- var $0 = $$.length - 1;
17
- switch (yystate) {
18
- case 6:
19
- case 7:
20
- return yy;
21
- case 15:
22
- yy.addNode($$[$0 - 1].length, $$[$0].trim());
23
- break;
24
- case 16:
25
- yy.addNode(0, $$[$0].trim());
26
- break;
27
- }
28
- }, "anonymous"),
29
- table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: $V3 }, o($V4, [2, 3]), { 1: [2, 2] }, o($V4, [2, 4]), o($V4, [2, 5]), { 1: [2, 6], 6: $V1, 12: 15, 13: $V2, 14: $V3 }, { 6: $V1, 9: 16, 12: 11, 13: $V2, 14: $V3 }, { 6: $V5, 7: $V6, 10: 17, 11: $V7 }, o($V8, [2, 18], { 14: [1, 21] }), o($V8, [2, 16]), o($V8, [2, 17]), { 6: $V5, 7: $V6, 10: 22, 11: $V7 }, { 1: [2, 7], 6: $V1, 12: 15, 13: $V2, 14: $V3 }, o($V9, [2, 14], { 7: $Va, 11: $Vb }), o($Vc, [2, 8]), o($Vc, [2, 9]), o($Vc, [2, 10]), o($V8, [2, 15]), o($V9, [2, 13], { 7: $Va, 11: $Vb }), o($Vc, [2, 11]), o($Vc, [2, 12])],
30
- defaultActions: { 2: [2, 1], 6: [2, 2] },
31
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
32
- if (hash.recoverable) {
33
- this.trace(str);
34
- } else {
35
- var error = new Error(str);
36
- error.hash = hash;
37
- throw error;
38
- }
39
- }, "parseError"),
40
- parse: /* @__PURE__ */ __name(function parse(input) {
41
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
42
- var args = lstack.slice.call(arguments, 1);
43
- var lexer2 = Object.create(this.lexer);
44
- var sharedState = { yy: {} };
45
- for (var k in this.yy) {
46
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
47
- sharedState.yy[k] = this.yy[k];
48
- }
49
- }
50
- lexer2.setInput(input, sharedState.yy);
51
- sharedState.yy.lexer = lexer2;
52
- sharedState.yy.parser = this;
53
- if (typeof lexer2.yylloc == "undefined") {
54
- lexer2.yylloc = {};
55
- }
56
- var yyloc = lexer2.yylloc;
57
- lstack.push(yyloc);
58
- var ranges = lexer2.options && lexer2.options.ranges;
59
- if (typeof sharedState.yy.parseError === "function") {
60
- this.parseError = sharedState.yy.parseError;
61
- } else {
62
- this.parseError = Object.getPrototypeOf(this).parseError;
63
- }
64
- function popStack(n) {
65
- stack.length = stack.length - 2 * n;
66
- vstack.length = vstack.length - n;
67
- lstack.length = lstack.length - n;
68
- }
69
- __name(popStack, "popStack");
70
- function lex() {
71
- var token;
72
- token = tstack.pop() || lexer2.lex() || EOF;
73
- if (typeof token !== "number") {
74
- if (token instanceof Array) {
75
- tstack = token;
76
- token = tstack.pop();
77
- }
78
- token = self.symbols_[token] || token;
79
- }
80
- return token;
81
- }
82
- __name(lex, "lex");
83
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
84
- while (true) {
85
- state = stack[stack.length - 1];
86
- if (this.defaultActions[state]) {
87
- action = this.defaultActions[state];
88
- } else {
89
- if (symbol === null || typeof symbol == "undefined") {
90
- symbol = lex();
91
- }
92
- action = table[state] && table[state][symbol];
93
- }
94
- if (typeof action === "undefined" || !action.length || !action[0]) {
95
- var errStr = "";
96
- expected = [];
97
- for (p in table[state]) {
98
- if (this.terminals_[p] && p > TERROR) {
99
- expected.push("'" + this.terminals_[p] + "'");
100
- }
101
- }
102
- if (lexer2.showPosition) {
103
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
104
- } else {
105
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
106
- }
107
- this.parseError(errStr, {
108
- text: lexer2.match,
109
- token: this.terminals_[symbol] || symbol,
110
- line: lexer2.yylineno,
111
- loc: yyloc,
112
- expected
113
- });
114
- }
115
- if (action[0] instanceof Array && action.length > 1) {
116
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
117
- }
118
- switch (action[0]) {
119
- case 1:
120
- stack.push(symbol);
121
- vstack.push(lexer2.yytext);
122
- lstack.push(lexer2.yylloc);
123
- stack.push(action[1]);
124
- symbol = null;
125
- {
126
- yyleng = lexer2.yyleng;
127
- yytext = lexer2.yytext;
128
- yylineno = lexer2.yylineno;
129
- yyloc = lexer2.yylloc;
130
- }
131
- break;
132
- case 2:
133
- len = this.productions_[action[1]][1];
134
- yyval.$ = vstack[vstack.length - len];
135
- yyval._$ = {
136
- first_line: lstack[lstack.length - (len || 1)].first_line,
137
- last_line: lstack[lstack.length - 1].last_line,
138
- first_column: lstack[lstack.length - (len || 1)].first_column,
139
- last_column: lstack[lstack.length - 1].last_column
140
- };
141
- if (ranges) {
142
- yyval._$.range = [
143
- lstack[lstack.length - (len || 1)].range[0],
144
- lstack[lstack.length - 1].range[1]
145
- ];
146
- }
147
- r = this.performAction.apply(yyval, [
148
- yytext,
149
- yyleng,
150
- yylineno,
151
- sharedState.yy,
152
- action[1],
153
- vstack,
154
- lstack
155
- ].concat(args));
156
- if (typeof r !== "undefined") {
157
- return r;
158
- }
159
- if (len) {
160
- stack = stack.slice(0, -1 * len * 2);
161
- vstack = vstack.slice(0, -1 * len);
162
- lstack = lstack.slice(0, -1 * len);
163
- }
164
- stack.push(this.productions_[action[1]][0]);
165
- vstack.push(yyval.$);
166
- lstack.push(yyval._$);
167
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
168
- stack.push(newState);
169
- break;
170
- case 3:
171
- return true;
172
- }
173
- }
174
- return true;
175
- }, "parse")
176
- };
177
- var lexer = /* @__PURE__ */ (function() {
178
- var lexer2 = {
179
- EOF: 1,
180
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
181
- if (this.yy.parser) {
182
- this.yy.parser.parseError(str, hash);
183
- } else {
184
- throw new Error(str);
185
- }
186
- }, "parseError"),
187
- // resets the lexer, sets new input
188
- setInput: /* @__PURE__ */ __name(function(input, yy) {
189
- this.yy = yy || this.yy || {};
190
- this._input = input;
191
- this._more = this._backtrack = this.done = false;
192
- this.yylineno = this.yyleng = 0;
193
- this.yytext = this.matched = this.match = "";
194
- this.conditionStack = ["INITIAL"];
195
- this.yylloc = {
196
- first_line: 1,
197
- first_column: 0,
198
- last_line: 1,
199
- last_column: 0
200
- };
201
- if (this.options.ranges) {
202
- this.yylloc.range = [0, 0];
203
- }
204
- this.offset = 0;
205
- return this;
206
- }, "setInput"),
207
- // consumes and returns one char from the input
208
- input: /* @__PURE__ */ __name(function() {
209
- var ch = this._input[0];
210
- this.yytext += ch;
211
- this.yyleng++;
212
- this.offset++;
213
- this.match += ch;
214
- this.matched += ch;
215
- var lines = ch.match(/(?:\r\n?|\n).*/g);
216
- if (lines) {
217
- this.yylineno++;
218
- this.yylloc.last_line++;
219
- } else {
220
- this.yylloc.last_column++;
221
- }
222
- if (this.options.ranges) {
223
- this.yylloc.range[1]++;
224
- }
225
- this._input = this._input.slice(1);
226
- return ch;
227
- }, "input"),
228
- // unshifts one char (or a string) into the input
229
- unput: /* @__PURE__ */ __name(function(ch) {
230
- var len = ch.length;
231
- var lines = ch.split(/(?:\r\n?|\n)/g);
232
- this._input = ch + this._input;
233
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
234
- this.offset -= len;
235
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
236
- this.match = this.match.substr(0, this.match.length - 1);
237
- this.matched = this.matched.substr(0, this.matched.length - 1);
238
- if (lines.length - 1) {
239
- this.yylineno -= lines.length - 1;
240
- }
241
- var r = this.yylloc.range;
242
- this.yylloc = {
243
- first_line: this.yylloc.first_line,
244
- last_line: this.yylineno + 1,
245
- first_column: this.yylloc.first_column,
246
- 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
247
- };
248
- if (this.options.ranges) {
249
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
250
- }
251
- this.yyleng = this.yytext.length;
252
- return this;
253
- }, "unput"),
254
- // When called from action, caches matched text and appends it on next action
255
- more: /* @__PURE__ */ __name(function() {
256
- this._more = true;
257
- return this;
258
- }, "more"),
259
- // 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.
260
- reject: /* @__PURE__ */ __name(function() {
261
- if (this.options.backtrack_lexer) {
262
- this._backtrack = true;
263
- } else {
264
- 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(), {
265
- text: "",
266
- token: null,
267
- line: this.yylineno
268
- });
269
- }
270
- return this;
271
- }, "reject"),
272
- // retain first n characters of the match
273
- less: /* @__PURE__ */ __name(function(n) {
274
- this.unput(this.match.slice(n));
275
- }, "less"),
276
- // displays already matched input, i.e. for error messages
277
- pastInput: /* @__PURE__ */ __name(function() {
278
- var past = this.matched.substr(0, this.matched.length - this.match.length);
279
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
280
- }, "pastInput"),
281
- // displays upcoming input, i.e. for error messages
282
- upcomingInput: /* @__PURE__ */ __name(function() {
283
- var next = this.match;
284
- if (next.length < 20) {
285
- next += this._input.substr(0, 20 - next.length);
286
- }
287
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
288
- }, "upcomingInput"),
289
- // displays the character position where the lexing error occurred, i.e. for error messages
290
- showPosition: /* @__PURE__ */ __name(function() {
291
- var pre = this.pastInput();
292
- var c = new Array(pre.length + 1).join("-");
293
- return pre + this.upcomingInput() + "\n" + c + "^";
294
- }, "showPosition"),
295
- // test the lexed token: return FALSE when not a match, otherwise return token
296
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
297
- var token, lines, backup;
298
- if (this.options.backtrack_lexer) {
299
- backup = {
300
- yylineno: this.yylineno,
301
- yylloc: {
302
- first_line: this.yylloc.first_line,
303
- last_line: this.last_line,
304
- first_column: this.yylloc.first_column,
305
- last_column: this.yylloc.last_column
306
- },
307
- yytext: this.yytext,
308
- match: this.match,
309
- matches: this.matches,
310
- matched: this.matched,
311
- yyleng: this.yyleng,
312
- offset: this.offset,
313
- _more: this._more,
314
- _input: this._input,
315
- yy: this.yy,
316
- conditionStack: this.conditionStack.slice(0),
317
- done: this.done
318
- };
319
- if (this.options.ranges) {
320
- backup.yylloc.range = this.yylloc.range.slice(0);
321
- }
322
- }
323
- lines = match[0].match(/(?:\r\n?|\n).*/g);
324
- if (lines) {
325
- this.yylineno += lines.length;
326
- }
327
- this.yylloc = {
328
- first_line: this.yylloc.last_line,
329
- last_line: this.yylineno + 1,
330
- first_column: this.yylloc.last_column,
331
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
332
- };
333
- this.yytext += match[0];
334
- this.match += match[0];
335
- this.matches = match;
336
- this.yyleng = this.yytext.length;
337
- if (this.options.ranges) {
338
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
339
- }
340
- this._more = false;
341
- this._backtrack = false;
342
- this._input = this._input.slice(match[0].length);
343
- this.matched += match[0];
344
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
345
- if (this.done && this._input) {
346
- this.done = false;
347
- }
348
- if (token) {
349
- return token;
350
- } else if (this._backtrack) {
351
- for (var k in backup) {
352
- this[k] = backup[k];
353
- }
354
- return false;
355
- }
356
- return false;
357
- }, "test_match"),
358
- // return next match in input
359
- next: /* @__PURE__ */ __name(function() {
360
- if (this.done) {
361
- return this.EOF;
362
- }
363
- if (!this._input) {
364
- this.done = true;
365
- }
366
- var token, match, tempMatch, index;
367
- if (!this._more) {
368
- this.yytext = "";
369
- this.match = "";
370
- }
371
- var rules = this._currentRules();
372
- for (var i = 0; i < rules.length; i++) {
373
- tempMatch = this._input.match(this.rules[rules[i]]);
374
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
375
- match = tempMatch;
376
- index = i;
377
- if (this.options.backtrack_lexer) {
378
- token = this.test_match(tempMatch, rules[i]);
379
- if (token !== false) {
380
- return token;
381
- } else if (this._backtrack) {
382
- match = false;
383
- continue;
384
- } else {
385
- return false;
386
- }
387
- } else if (!this.options.flex) {
388
- break;
389
- }
390
- }
391
- }
392
- if (match) {
393
- token = this.test_match(match, rules[index]);
394
- if (token !== false) {
395
- return token;
396
- }
397
- return false;
398
- }
399
- if (this._input === "") {
400
- return this.EOF;
401
- } else {
402
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
403
- text: "",
404
- token: null,
405
- line: this.yylineno
406
- });
407
- }
408
- }, "next"),
409
- // return next match that has a token
410
- lex: /* @__PURE__ */ __name(function lex() {
411
- var r = this.next();
412
- if (r) {
413
- return r;
414
- } else {
415
- return this.lex();
416
- }
417
- }, "lex"),
418
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
419
- begin: /* @__PURE__ */ __name(function begin(condition) {
420
- this.conditionStack.push(condition);
421
- }, "begin"),
422
- // pop the previously active lexer condition state off the condition stack
423
- popState: /* @__PURE__ */ __name(function popState() {
424
- var n = this.conditionStack.length - 1;
425
- if (n > 0) {
426
- return this.conditionStack.pop();
427
- } else {
428
- return this.conditionStack[0];
429
- }
430
- }, "popState"),
431
- // produce the lexer rule set which is active for the currently active lexer condition state
432
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
433
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
434
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
435
- } else {
436
- return this.conditions["INITIAL"].rules;
437
- }
438
- }, "_currentRules"),
439
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
440
- topState: /* @__PURE__ */ __name(function topState(n) {
441
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
442
- if (n >= 0) {
443
- return this.conditionStack[n];
444
- } else {
445
- return "INITIAL";
446
- }
447
- }, "topState"),
448
- // alias for begin(condition)
449
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
450
- this.begin(condition);
451
- }, "pushState"),
452
- // return the number of states currently on the stack
453
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
454
- return this.conditionStack.length;
455
- }, "stateStackSize"),
456
- options: { "case-insensitive": true },
457
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
458
- switch ($avoiding_name_collisions) {
459
- case 0:
460
- return 6;
461
- case 1:
462
- return 8;
463
- case 2:
464
- return 8;
465
- case 3:
466
- return 6;
467
- case 4:
468
- return 7;
469
- case 5:
470
- return 13;
471
- case 6:
472
- return 14;
473
- case 7:
474
- return 11;
475
- }
476
- }, "anonymous"),
477
- rules: [/^(?:\s*%%.*)/i, /^(?:ishikawa-beta\b)/i, /^(?:ishikawa\b)/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:[^\n]+)/i, /^(?:$)/i],
478
- conditions: { "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7], "inclusive": true } }
479
- };
480
- return lexer2;
481
- })();
482
- parser2.lexer = lexer;
483
- function Parser() {
484
- this.yy = {};
485
- }
486
- __name(Parser, "Parser");
487
- Parser.prototype = parser2;
488
- parser2.Parser = Parser;
489
- return new Parser();
490
- })();
491
- parser.parser = parser;
492
- var ishikawa_default = parser;
493
- var IshikawaDB = (_a = class {
494
- constructor() {
495
- this.stack = [];
496
- this.clear = this.clear.bind(this);
497
- this.addNode = this.addNode.bind(this);
498
- this.getRoot = this.getRoot.bind(this);
499
- }
500
- clear() {
501
- this.root = void 0;
502
- this.stack = [];
503
- this.baseLevel = void 0;
504
- clear();
505
- }
506
- getRoot() {
507
- return this.root;
508
- }
509
- addNode(rawLevel, text) {
510
- const label = common_default.sanitizeText(text, getConfig2());
511
- if (!this.root) {
512
- this.baseLevel = rawLevel;
513
- this.root = { text: label, children: [] };
514
- this.stack = [{ level: 0, node: this.root }];
515
- setDiagramTitle(label);
516
- return;
517
- }
518
- let level = rawLevel - (this.baseLevel ?? 0);
519
- if (level <= 0) {
520
- level = 1;
521
- }
522
- while (this.stack.length > 1 && this.stack[this.stack.length - 1].level >= level) {
523
- this.stack.pop();
524
- }
525
- const parent = this.stack[this.stack.length - 1].node;
526
- const node = { text: label, children: [] };
527
- parent.children.push(node);
528
- this.stack.push({ level, node });
529
- }
530
- getAccTitle() {
531
- return getAccTitle();
532
- }
533
- setAccTitle(title) {
534
- setAccTitle(title);
535
- }
536
- getAccDescription() {
537
- return getAccDescription();
538
- }
539
- setAccDescription(description) {
540
- setAccDescription(description);
541
- }
542
- getDiagramTitle() {
543
- return getDiagramTitle();
544
- }
545
- setDiagramTitle(title) {
546
- setDiagramTitle(title);
547
- }
548
- }, __name(_a, "IshikawaDB"), _a);
549
- var FONT_SIZE_DEFAULT = 14;
550
- var SPINE_BASE_LENGTH = 250;
551
- var BONE_STUB = 30;
552
- var BONE_BASE = 60;
553
- var BONE_PER_CHILD = 5;
554
- var ANGLE = 82 * Math.PI / 180;
555
- var COS_A = Math.cos(ANGLE);
556
- var SIN_A = Math.sin(ANGLE);
557
- var applyPaddedViewBox = /* @__PURE__ */ __name((svgEl, pad, maxW) => {
558
- const bbox = svgEl.node().getBBox();
559
- const w = bbox.width + pad * 2;
560
- const h = bbox.height + pad * 2;
561
- configureSvgSize(svgEl, h, w, maxW);
562
- svgEl.attr("viewBox", `${bbox.x - pad} ${bbox.y - pad} ${w} ${h}`);
563
- }, "applyPaddedViewBox");
564
- var draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {
565
- const db = diagram2.db;
566
- const root = db.getRoot();
567
- if (!root) {
568
- return;
569
- }
570
- const drawConfig = getConfig2();
571
- const { look, handDrawnSeed, themeVariables } = drawConfig;
572
- const fontSize = parseFontSize(drawConfig.fontSize)[0] ?? FONT_SIZE_DEFAULT;
573
- const isHandDrawn = look === "handDrawn";
574
- const causes = root.children ?? [];
575
- const padding = drawConfig.ishikawa?.diagramPadding ?? 20;
576
- const useMaxWidth = drawConfig.ishikawa?.useMaxWidth ?? false;
577
- const svg = selectSvgElement(id);
578
- const g = svg.append("g").attr("class", "ishikawa");
579
- const roughSvg = isHandDrawn ? at.svg(svg.node()) : void 0;
580
- const roughContext = roughSvg ? {
581
- roughSvg,
582
- seed: handDrawnSeed ?? 0,
583
- lineColor: themeVariables?.lineColor ?? "#333",
584
- fillColor: themeVariables?.mainBkg ?? "#fff"
585
- } : void 0;
586
- const markerId = `ishikawa-arrow-${id}`;
587
- if (!isHandDrawn) {
588
- 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");
589
- }
590
- let spineX = 0;
591
- let spineY = SPINE_BASE_LENGTH;
592
- const spineLine = isHandDrawn ? void 0 : drawLine(g, spineX, spineY, spineX, spineY, "ishikawa-spine");
593
- drawHead(g, spineX, spineY, root.text, fontSize, roughContext);
594
- if (!causes.length) {
595
- if (isHandDrawn) {
596
- drawLine(g, spineX, spineY, spineX, spineY, "ishikawa-spine", roughContext);
597
- }
598
- applyPaddedViewBox(svg, padding, useMaxWidth);
599
- return;
600
- }
601
- spineX -= 20;
602
- const upperCauses = causes.filter((_, i) => i % 2 === 0);
603
- const lowerCauses = causes.filter((_, i) => i % 2 === 1);
604
- const upperStats = sideStats(upperCauses);
605
- const lowerStats = sideStats(lowerCauses);
606
- const descendantTotal = upperStats.total + lowerStats.total;
607
- let upperLen = SPINE_BASE_LENGTH;
608
- let lowerLen = SPINE_BASE_LENGTH;
609
- if (descendantTotal > 0) {
610
- const pool = SPINE_BASE_LENGTH * 2;
611
- const minLen = SPINE_BASE_LENGTH * 0.3;
612
- upperLen = Math.max(minLen, pool * (upperStats.total / descendantTotal));
613
- lowerLen = Math.max(minLen, pool * (lowerStats.total / descendantTotal));
614
- }
615
- const minSpacing = fontSize * 2;
616
- upperLen = Math.max(upperLen, upperStats.max * minSpacing);
617
- lowerLen = Math.max(lowerLen, lowerStats.max * minSpacing);
618
- spineY = Math.max(upperLen, SPINE_BASE_LENGTH);
619
- if (spineLine) {
620
- spineLine.attr("y1", spineY).attr("y2", spineY);
621
- }
622
- g.select(".ishikawa-head-group").attr("transform", `translate(0,${spineY})`);
623
- const pairCount = Math.ceil(causes.length / 2);
624
- for (let p = 0; p < pairCount; p++) {
625
- const pg = g.append("g").attr("class", "ishikawa-pair");
626
- for (const [cause, dir, len] of [
627
- [causes[p * 2], -1, upperLen],
628
- [causes[p * 2 + 1], 1, lowerLen]
629
- ]) {
630
- if (cause) {
631
- drawBranch(pg, cause, spineX, spineY, dir, len, fontSize, roughContext);
632
- }
633
- }
634
- spineX = pg.selectAll("text").nodes().reduce((left, n) => Math.min(left, n.getBBox().x), Infinity);
635
- }
636
- if (isHandDrawn) {
637
- drawLine(g, spineX, spineY, 0, spineY, "ishikawa-spine", roughContext);
638
- } else {
639
- spineLine.attr("x1", spineX);
640
- const markerUrl = `url(#${markerId})`;
641
- g.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start", markerUrl);
642
- }
643
- applyPaddedViewBox(svg, padding, useMaxWidth);
644
- }, "draw");
645
- var sideStats = /* @__PURE__ */ __name((nodes) => {
646
- const countDescendants = /* @__PURE__ */ __name((node) => node.children.reduce((sum, child) => sum + 1 + countDescendants(child), 0), "countDescendants");
647
- return nodes.reduce(
648
- (stats, node) => {
649
- const descendants = countDescendants(node);
650
- stats.total += descendants;
651
- stats.max = Math.max(stats.max, descendants);
652
- return stats;
653
- },
654
- { total: 0, max: 0 }
655
- );
656
- }, "sideStats");
657
- var drawHead = /* @__PURE__ */ __name((svg, x, y, label, fontSize, roughContext) => {
658
- const maxChars = Math.max(6, Math.floor(110 / (fontSize * 0.6)));
659
- const headGroup = svg.append("g").attr("class", "ishikawa-head-group").attr("transform", `translate(${x},${y})`);
660
- const textEl = drawMultilineText(
661
- headGroup,
662
- wrapText(label, maxChars),
663
- 0,
664
- 0,
665
- "ishikawa-head-label",
666
- "start",
667
- fontSize
668
- );
669
- const tb = textEl.node().getBBox();
670
- const w = Math.max(60, tb.width + 6);
671
- const h = Math.max(40, tb.height * 2 + 40);
672
- const headPath = `M 0 ${-h / 2} L 0 ${h / 2} Q ${w * 2.4} 0 0 ${-h / 2} Z`;
673
- if (roughContext) {
674
- const roughNode = roughContext.roughSvg.path(headPath, {
675
- roughness: 1.5,
676
- seed: roughContext.seed,
677
- fill: roughContext.fillColor,
678
- fillStyle: "hachure",
679
- fillWeight: 2.5,
680
- hachureGap: 5,
681
- stroke: roughContext.lineColor,
682
- strokeWidth: 2
683
- });
684
- headGroup.insert(() => roughNode, ":first-child").attr("class", "ishikawa-head");
685
- } else {
686
- headGroup.insert("path", ":first-child").attr("class", "ishikawa-head").attr("d", headPath);
687
- }
688
- textEl.attr("transform", `translate(${(w - tb.width) / 2 - tb.x + 3},${-tb.y - tb.height / 2})`);
689
- }, "drawHead");
690
- var flattenTree = /* @__PURE__ */ __name((children, direction) => {
691
- const entries = [];
692
- const yOrder = [];
693
- const walk = /* @__PURE__ */ __name((nodes, pid, depth) => {
694
- const ordered = direction === -1 ? [...nodes].reverse() : nodes;
695
- for (const child of ordered) {
696
- const idx = entries.length;
697
- const gc = child.children ?? [];
698
- entries.push({
699
- depth,
700
- text: wrapText(child.text, 15),
701
- parentIndex: pid,
702
- childCount: gc.length
703
- });
704
- if (depth % 2 === 0) {
705
- yOrder.push(idx);
706
- if (gc.length) {
707
- walk(gc, idx, depth + 1);
708
- }
709
- } else {
710
- if (gc.length) {
711
- walk(gc, idx, depth + 1);
712
- }
713
- yOrder.push(idx);
714
- }
715
- }
716
- }, "walk");
717
- walk(children, -1, 2);
718
- return { entries, yOrder };
719
- }, "flattenTree");
720
- var drawCauseLabel = /* @__PURE__ */ __name((svg, text, x, y, direction, fontSize, roughContext) => {
721
- const lg = svg.append("g").attr("class", "ishikawa-label-group");
722
- const lt = drawMultilineText(
723
- lg,
724
- text,
725
- x,
726
- y + 11 * direction,
727
- "ishikawa-label cause",
728
- "middle",
729
- fontSize
730
- );
731
- const tb = lt.node().getBBox();
732
- if (roughContext) {
733
- const roughNode = roughContext.roughSvg.rectangle(
734
- tb.x - 20,
735
- tb.y - 2,
736
- tb.width + 40,
737
- tb.height + 4,
738
- {
739
- roughness: 1.5,
740
- seed: roughContext.seed,
741
- fill: roughContext.fillColor,
742
- fillStyle: "hachure",
743
- fillWeight: 2.5,
744
- hachureGap: 5,
745
- stroke: roughContext.lineColor,
746
- strokeWidth: 2
747
- }
748
- );
749
- lg.insert(() => roughNode, ":first-child").attr("class", "ishikawa-label-box");
750
- } else {
751
- 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);
752
- }
753
- }, "drawCauseLabel");
754
- var drawArrowMarker = /* @__PURE__ */ __name((g, x, y, dx, dy, roughContext) => {
755
- const len = Math.sqrt(dx * dx + dy * dy);
756
- if (len === 0) {
757
- return;
758
- }
759
- const ux = dx / len;
760
- const uy = dy / len;
761
- const s = 6;
762
- const px = -uy * s;
763
- const py = ux * s;
764
- const tipX = x;
765
- const tipY = y;
766
- 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`;
767
- const roughNode = roughContext.roughSvg.path(d, {
768
- roughness: 1,
769
- seed: roughContext.seed,
770
- fill: roughContext.lineColor,
771
- fillStyle: "solid",
772
- stroke: roughContext.lineColor,
773
- strokeWidth: 1
774
- });
775
- g.append(() => roughNode);
776
- }, "drawArrowMarker");
777
- var drawBranch = /* @__PURE__ */ __name((svg, node, startX, startY, direction, length, fontSize, roughContext) => {
778
- const children = node.children ?? [];
779
- const lineLen = length * (children.length ? 1 : 0.2);
780
- const dx = -COS_A * lineLen;
781
- const dy = SIN_A * lineLen * direction;
782
- const endX = startX + dx;
783
- const endY = startY + dy;
784
- drawLine(svg, startX, startY, endX, endY, "ishikawa-branch", roughContext);
785
- if (roughContext) {
786
- drawArrowMarker(svg, startX, startY, startX - endX, startY - endY, roughContext);
787
- }
788
- drawCauseLabel(svg, node.text, endX, endY, direction, fontSize, roughContext);
789
- if (!children.length) {
790
- return;
791
- }
792
- const { entries, yOrder } = flattenTree(children, direction);
793
- const entryCount = entries.length;
794
- const ys = new Array(entryCount);
795
- for (const [slot, entryIdx] of yOrder.entries()) {
796
- ys[entryIdx] = startY + dy * ((slot + 1) / (entryCount + 1));
797
- }
798
- const bones = /* @__PURE__ */ new Map();
799
- bones.set(-1, {
800
- x0: startX,
801
- y0: startY,
802
- x1: endX,
803
- y1: endY,
804
- childCount: children.length,
805
- childrenDrawn: 0
806
- });
807
- const diagonalX = -COS_A;
808
- const diagonalY = SIN_A * direction;
809
- const oddLabel = direction < 0 ? "ishikawa-label up" : "ishikawa-label down";
810
- for (const [i, e] of entries.entries()) {
811
- const y = ys[i];
812
- const par = bones.get(e.parentIndex);
813
- const grp = svg.append("g").attr("class", "ishikawa-sub-group");
814
- let bx0 = 0;
815
- let by0 = 0;
816
- let bx1 = 0;
817
- if (e.depth % 2 === 0) {
818
- const dyP = par.y1 - par.y0;
819
- bx0 = lerp(par.x0, par.x1, dyP ? (y - par.y0) / dyP : 0.5);
820
- by0 = y;
821
- bx1 = bx0 - (e.childCount > 0 ? BONE_BASE + e.childCount * BONE_PER_CHILD : BONE_STUB);
822
- drawLine(grp, bx0, y, bx1, y, "ishikawa-sub-branch", roughContext);
823
- if (roughContext) {
824
- drawArrowMarker(grp, bx0, y, 1, 0, roughContext);
825
- }
826
- drawMultilineText(grp, e.text, bx1, y, "ishikawa-label align", "end", fontSize);
827
- } else {
828
- const k = par.childrenDrawn++;
829
- bx0 = lerp(par.x0, par.x1, (par.childCount - k) / (par.childCount + 1));
830
- by0 = par.y0;
831
- bx1 = bx0 + diagonalX * ((y - by0) / diagonalY);
832
- drawLine(grp, bx0, by0, bx1, y, "ishikawa-sub-branch", roughContext);
833
- if (roughContext) {
834
- drawArrowMarker(grp, bx0, by0, bx0 - bx1, by0 - y, roughContext);
835
- }
836
- drawMultilineText(grp, e.text, bx1, y, oddLabel, "end", fontSize);
837
- }
838
- if (e.childCount > 0) {
839
- bones.set(i, {
840
- x0: bx0,
841
- y0: by0,
842
- x1: bx1,
843
- y1: y,
844
- childCount: e.childCount,
845
- childrenDrawn: 0
846
- });
847
- }
848
- }
849
- }, "drawBranch");
850
- var splitLines = /* @__PURE__ */ __name((text) => text.split(/<br\s*\/?>|\n/), "splitLines");
851
- var wrapText = /* @__PURE__ */ __name((text, maxChars) => {
852
- if (text.length <= maxChars) {
853
- return text;
854
- }
855
- const lines = [];
856
- for (const word of text.split(/\s+/)) {
857
- const last = lines.length - 1;
858
- if (last >= 0 && lines[last].length + 1 + word.length <= maxChars) {
859
- lines[last] += " " + word;
860
- } else {
861
- lines.push(word);
862
- }
863
- }
864
- return lines.join("\n");
865
- }, "wrapText");
866
- var drawMultilineText = /* @__PURE__ */ __name((g, text, x, y, cls, anchor, fontSize) => {
867
- const lines = splitLines(text);
868
- const lh = fontSize * 1.05;
869
- const el = g.append("text").attr("class", cls).attr("text-anchor", anchor).attr("x", x).attr("y", y - (lines.length - 1) * lh / 2);
870
- for (const [i, line] of lines.entries()) {
871
- el.append("tspan").attr("x", x).attr("dy", i === 0 ? 0 : lh).text(line);
872
- }
873
- return el;
874
- }, "drawMultilineText");
875
- var lerp = /* @__PURE__ */ __name((a, b, t) => a + (b - a) * t, "lerp");
876
- var drawLine = /* @__PURE__ */ __name((g, x1, y1, x2, y2, cls, roughContext) => {
877
- if (roughContext) {
878
- const roughNode = roughContext.roughSvg.line(x1, y1, x2, y2, {
879
- roughness: 1.5,
880
- seed: roughContext.seed,
881
- stroke: roughContext.lineColor,
882
- strokeWidth: 2
883
- });
884
- g.append(() => roughNode).attr("class", cls);
885
- return void 0;
886
- }
887
- return g.append("line").attr("class", cls).attr("x1", x1).attr("y1", y1).attr("x2", x2).attr("y2", y2);
888
- }, "drawLine");
889
- var renderer = { draw };
890
- var getStyles = /* @__PURE__ */ __name((options) => `
891
- .ishikawa .ishikawa-spine,
892
- .ishikawa .ishikawa-branch,
893
- .ishikawa .ishikawa-sub-branch {
894
- stroke: ${options.lineColor};
895
- stroke-width: 2;
896
- fill: none;
897
- }
898
-
899
- .ishikawa .ishikawa-sub-branch {
900
- stroke-width: 1;
901
- }
902
-
903
- .ishikawa .ishikawa-arrow {
904
- fill: ${options.lineColor};
905
- }
906
-
907
- .ishikawa .ishikawa-head {
908
- fill: ${options.mainBkg};
909
- stroke: ${options.lineColor};
910
- stroke-width: 2;
911
- }
912
-
913
- .ishikawa .ishikawa-label-box {
914
- fill: ${options.mainBkg};
915
- stroke: ${options.lineColor};
916
- stroke-width: 2;
917
- }
918
-
919
- .ishikawa text {
920
- font-family: ${options.fontFamily};
921
- font-size: ${options.fontSize};
922
- fill: ${options.textColor};
923
- }
924
-
925
- .ishikawa .ishikawa-head-label {
926
- font-weight: 600;
927
- text-anchor: middle;
928
- dominant-baseline: middle;
929
- font-size: 14px;
930
- }
931
-
932
- .ishikawa .ishikawa-label {
933
- text-anchor: end;
934
- }
935
-
936
- .ishikawa .ishikawa-label.cause {
937
- text-anchor: middle;
938
- dominant-baseline: middle;
939
- }
940
-
941
- .ishikawa .ishikawa-label.align {
942
- text-anchor: end;
943
- dominant-baseline: middle;
944
- }
945
-
946
- .ishikawa .ishikawa-label.up {
947
- dominant-baseline: baseline;
948
- }
949
-
950
- .ishikawa .ishikawa-label.down {
951
- dominant-baseline: hanging;
952
- }
953
- `, "getStyles");
954
- var ishikawaStyles_default = getStyles;
955
- var diagram = {
956
- parser: ishikawa_default,
957
- get db() {
958
- return new IshikawaDB();
959
- },
960
- renderer,
961
- styles: ishikawaStyles_default
962
- };
963
- export {
964
- diagram
965
- };
966
- //# sourceMappingURL=ishikawaDiagram-PHBUUO56-CCgHez0F.js.map