@yorz/cli 0.1.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 (143) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +119 -0
  3. package/dist/_commonjsHelpers-DyI1JsEH.js +34 -0
  4. package/dist/abnfDiagram-VRR7QNED-UQS77aUi.js +119 -0
  5. package/dist/api-DrYc_Ds_.js +129852 -0
  6. package/dist/arc-B1cAL3U1.js +132 -0
  7. package/dist/architectureDiagram-ZJ3FMSHR-CfWOhs-q.js +8816 -0
  8. package/dist/blockDiagram-677ZJIJ3-CLOAAFZa.js +3796 -0
  9. package/dist/c4Diagram-LMCZKHZV-BGdELGkb.js +2483 -0
  10. package/dist/certs-BeimSwB3.js +14071 -0
  11. package/dist/certs-C4t5lAmJ.js +14071 -0
  12. package/dist/certs-CLLngjpY.js +14071 -0
  13. package/dist/certs-D3fTB-0_.js +14071 -0
  14. package/dist/channel-_gQD3mZ8.js +8 -0
  15. package/dist/chunk-2Q5K7J3B-DIJkMPWD.js +20 -0
  16. package/dist/chunk-32BRIVSS-CIQb7-9I.js +117 -0
  17. package/dist/chunk-5VM5RSS4-DmlAsh6o.js +20 -0
  18. package/dist/chunk-EX3LRPZG-BEXyn5R-.js +1989 -0
  19. package/dist/chunk-JWPE2WC7-XiIefccF.js +17 -0
  20. package/dist/chunk-MOJQB5TN-CC5OBDWw.js +861 -0
  21. package/dist/chunk-RYQCIY6F-DQacsGpB.js +475 -0
  22. package/dist/chunk-V7JOEXUC-TLRsIUvf.js +2027 -0
  23. package/dist/chunk-VR4S4FIN-9AfN7RDF.js +25 -0
  24. package/dist/chunk-XXDRQBXY-DhWucSRr.js +14 -0
  25. package/dist/classDiagram-OUVF2IWQ-CN55rRkB.js +20 -0
  26. package/dist/classDiagram-v2-EOCWNBFH-CN55rRkB.js +20 -0
  27. package/dist/cli/index.js +5430 -0
  28. package/dist/cose-bilkent-JH36ORCC-8uGYe6_d.js +4944 -0
  29. package/dist/cynefin-VYW2F7L2-BwTeE-TI.js +32061 -0
  30. package/dist/cynefinDiagram-TSTJHNR4-DM7ixE-v.js +454 -0
  31. package/dist/cytoscape.esm-BTopYfIb.js +30347 -0
  32. package/dist/dagre-VKFMJZFB-blEDoYen.js +522 -0
  33. package/dist/defaultLocale-wHUL1xE2.js +207 -0
  34. package/dist/diagram-FQU43EPY-MEZlmmdi.js +633 -0
  35. package/dist/diagram-G47NLZAW-DZOZvHqp.js +857 -0
  36. package/dist/diagram-NH7WQ7WH-ChpmPbZz.js +213 -0
  37. package/dist/diagram-OA4YK3LP-oy4yvrnL.js +489 -0
  38. package/dist/diagram-WEI45ONY-B3nx1cYt.js +305 -0
  39. package/dist/ebnfDiagram-CCIWWBDH-BASj7BoO.js +139 -0
  40. package/dist/erDiagram-Q63AITRT-lujHq-S9.js +1239 -0
  41. package/dist/flowDiagram-23GEKE2U-BdsAVPgU.js +2349 -0
  42. package/dist/ganttDiagram-NO4QXBWP-DUUP4lsu.js +3733 -0
  43. package/dist/gitGraphDiagram-IHSO6WYX-BdIPAtb0.js +1374 -0
  44. package/dist/graph-CE8jV7cI.js +2043 -0
  45. package/dist/gui/assets/abnfDiagram-VRR7QNED-DE_Lwnyj.js +1 -0
  46. package/dist/gui/assets/arc-0XKFeKL1.js +1 -0
  47. package/dist/gui/assets/architectureDiagram-ZJ3FMSHR-WVMr6CTB.js +36 -0
  48. package/dist/gui/assets/blockDiagram-677ZJIJ3-JmkelTQ6.js +132 -0
  49. package/dist/gui/assets/c4Diagram-LMCZKHZV-BYvSE_vv.js +10 -0
  50. package/dist/gui/assets/channel-BhMtSKKb.js +1 -0
  51. package/dist/gui/assets/chunk-2Q5K7J3B-cgJ3ifz_.js +1 -0
  52. package/dist/gui/assets/chunk-32BRIVSS-DR-AYVVA.js +1 -0
  53. package/dist/gui/assets/chunk-5VM5RSS4-Di4z9gEz.js +15 -0
  54. package/dist/gui/assets/chunk-EX3LRPZG-CtCaJMGG.js +231 -0
  55. package/dist/gui/assets/chunk-JWPE2WC7-EjoKlGne.js +1 -0
  56. package/dist/gui/assets/chunk-MOJQB5TN-ndMzM7-f.js +88 -0
  57. package/dist/gui/assets/chunk-RYQCIY6F-CDdJsSDv.js +1 -0
  58. package/dist/gui/assets/chunk-V7JOEXUC-BptnbB4R.js +206 -0
  59. package/dist/gui/assets/chunk-VR4S4FIN-CF8Dsx8K.js +1 -0
  60. package/dist/gui/assets/chunk-XXDRQBXY-CgGWri-V.js +1 -0
  61. package/dist/gui/assets/classDiagram-OUVF2IWQ-DiPaZ7LY.js +1 -0
  62. package/dist/gui/assets/classDiagram-v2-EOCWNBFH-DiPaZ7LY.js +1 -0
  63. package/dist/gui/assets/cose-bilkent-JH36ORCC-Bm9uE-P8.js +1 -0
  64. package/dist/gui/assets/cynefin-VYW2F7L2-Dd-Apprt.js +178 -0
  65. package/dist/gui/assets/cynefinDiagram-TSTJHNR4-DpGBOFX2.js +62 -0
  66. package/dist/gui/assets/cytoscape.esm-OyMbaexL.js +331 -0
  67. package/dist/gui/assets/dagre-VKFMJZFB-DmKBW-UB.js +4 -0
  68. package/dist/gui/assets/defaultLocale-DX6XiGOO.js +1 -0
  69. package/dist/gui/assets/diagram-FQU43EPY-CYuUGN7Z.js +3 -0
  70. package/dist/gui/assets/diagram-G47NLZAW-BZ-zUUWn.js +24 -0
  71. package/dist/gui/assets/diagram-NH7WQ7WH-D2qb5dA_.js +24 -0
  72. package/dist/gui/assets/diagram-OA4YK3LP-BSy8-VUz.js +30 -0
  73. package/dist/gui/assets/diagram-WEI45ONY-B-vTVzM8.js +41 -0
  74. package/dist/gui/assets/ebnfDiagram-CCIWWBDH-cKb33glS.js +1 -0
  75. package/dist/gui/assets/erDiagram-Q63AITRT-DvWEFI1U.js +85 -0
  76. package/dist/gui/assets/flowDiagram-23GEKE2U-CfvFgLP2.js +156 -0
  77. package/dist/gui/assets/ganttDiagram-NO4QXBWP-BnDujV-k.js +292 -0
  78. package/dist/gui/assets/gitGraphDiagram-IHSO6WYX-Sv91FaB5.js +106 -0
  79. package/dist/gui/assets/graph-DOmOIIwC.js +1 -0
  80. package/dist/gui/assets/index-Bp9JnkhK.css +1 -0
  81. package/dist/gui/assets/index-Do-LzYBw.js +21 -0
  82. package/dist/gui/assets/infoDiagram-FWYZ7A6U-BE3WS_us.js +2 -0
  83. package/dist/gui/assets/init-Gi6I4Gst.js +1 -0
  84. package/dist/gui/assets/ishikawaDiagram-FXEZZL3T-FObQPAd_.js +70 -0
  85. package/dist/gui/assets/journeyDiagram-5HDEW3XC-D3RAFL7x.js +139 -0
  86. package/dist/gui/assets/kanban-definition-HUTT4EX6-Bx1DS2KG.js +89 -0
  87. package/dist/gui/assets/katex-HP8lGamR.js +257 -0
  88. package/dist/gui/assets/layout-D-LzfAck.js +1 -0
  89. package/dist/gui/assets/linear-oevdTPQK.js +1 -0
  90. package/dist/gui/assets/map-DxJ2ADlA.js +1 -0
  91. package/dist/gui/assets/mermaid.core-jn1Xktvs.js +314 -0
  92. package/dist/gui/assets/mindmap-definition-LN4V7U3C-xLT5IJki.js +96 -0
  93. package/dist/gui/assets/ordinal-Cboi1Yqb.js +1 -0
  94. package/dist/gui/assets/pegDiagram-2B236MQR-DToAMrXG.js +1 -0
  95. package/dist/gui/assets/pieDiagram-ENE6RG2P-Cw6tv4YJ.js +39 -0
  96. package/dist/gui/assets/quadrantDiagram-ABIIQ3AL-GW5Knopm.js +7 -0
  97. package/dist/gui/assets/railroadDiagram-RFXS5EU6-CuP1sa-2.js +1 -0
  98. package/dist/gui/assets/requirementDiagram-TGXJPOKE-D8IcCo1X.js +84 -0
  99. package/dist/gui/assets/sankeyDiagram-HTMAVEWB-CfT_C9uh.js +40 -0
  100. package/dist/gui/assets/sequenceDiagram-DBY2YBRQ-BwUwWFYe.js +162 -0
  101. package/dist/gui/assets/sizeCapture-X5ZJPWSS-DyBlcl4H.js +1 -0
  102. package/dist/gui/assets/stateDiagram-2N3HPSRC-yv8DkbvF.js +1 -0
  103. package/dist/gui/assets/stateDiagram-v2-6OUMAXLB-BspjtPpt.js +1 -0
  104. package/dist/gui/assets/swimlanes-5IMT3BWC-BnOmKdmr.js +2 -0
  105. package/dist/gui/assets/swimlanesDiagram-G3AALYLV-BgPC3dJX.js +8 -0
  106. package/dist/gui/assets/timeline-definition-FHXFAJF6-C6_-GVjE.js +120 -0
  107. package/dist/gui/assets/vennDiagram-L72KCM5P-D_N0uLk2.js +34 -0
  108. package/dist/gui/assets/wardleyDiagram-EHGQE667-CnNoxFYY.js +78 -0
  109. package/dist/gui/assets/xychartDiagram-FW5EYKEG-CloORw9z.js +7 -0
  110. package/dist/gui/index.html +13 -0
  111. package/dist/index--GoVvfUP.js +5447 -0
  112. package/dist/index-3-WDiDAh.js +5466 -0
  113. package/dist/index-CHBXZAxg.js +5460 -0
  114. package/dist/index-DeCq8xn7.js +5460 -0
  115. package/dist/infoDiagram-FWYZ7A6U-D9wo93kg.js +32 -0
  116. package/dist/init-DDGa2CQM.js +17 -0
  117. package/dist/ishikawaDiagram-FXEZZL3T-DZh3_kt2.js +968 -0
  118. package/dist/journeyDiagram-5HDEW3XC-C8RWHIn0.js +1256 -0
  119. package/dist/kanban-definition-HUTT4EX6-B7qQtB5a.js +1053 -0
  120. package/dist/katex-WjDlQEfU.js +14500 -0
  121. package/dist/layout-DQAYh_L7.js +2360 -0
  122. package/dist/linear-C_kZRZXS.js +341 -0
  123. package/dist/map-BElV7BMC.js +299 -0
  124. package/dist/mermaid.core-Dy_tFRs7.js +26495 -0
  125. package/dist/mindmap-definition-LN4V7U3C-BzHCd5Ab.js +1181 -0
  126. package/dist/ordinal-C2kkg180.js +77 -0
  127. package/dist/pegDiagram-2B236MQR-B046bQWM.js +127 -0
  128. package/dist/pieDiagram-ENE6RG2P-B5_W2CZy.js +316 -0
  129. package/dist/quadrantDiagram-ABIIQ3AL-Bbpt496h.js +1342 -0
  130. package/dist/railroadDiagram-RFXS5EU6-10XIH3X0.js +93 -0
  131. package/dist/requirementDiagram-TGXJPOKE-Dt1QyccY.js +1205 -0
  132. package/dist/sankeyDiagram-HTMAVEWB-CnqRAq7M.js +1274 -0
  133. package/dist/sequenceDiagram-DBY2YBRQ-DtJLSXoz.js +4515 -0
  134. package/dist/sizeCapture-X5ZJPWSS-DUl5ZEo3.js +63 -0
  135. package/dist/stateDiagram-2N3HPSRC-b-qzcVNj.js +449 -0
  136. package/dist/stateDiagram-v2-6OUMAXLB-KjDlRfc7.js +20 -0
  137. package/dist/swimlanes-5IMT3BWC-CAjGnQLa.js +8553 -0
  138. package/dist/swimlanesDiagram-G3AALYLV-DiOi9bzU.js +16 -0
  139. package/dist/timeline-definition-FHXFAJF6-Bme2FWbh.js +1597 -0
  140. package/dist/vennDiagram-L72KCM5P-BUQgnZDB.js +2516 -0
  141. package/dist/wardleyDiagram-EHGQE667-DHR2Avlu.js +976 -0
  142. package/dist/xychartDiagram-FW5EYKEG-V4K5eBMS.js +2000 -0
  143. package/package.json +73 -0
@@ -0,0 +1,1205 @@
1
+ #!/usr/bin/env node
2
+ import { g as getDiagramElement } from "./chunk-XXDRQBXY-DhWucSRr.js";
3
+ import { s as setupViewPortForSVG } from "./chunk-VR4S4FIN-9AfN7RDF.js";
4
+ import { _ as __name, y as getConfig, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, n as setDiagramTitle, o as getDiagramTitle, c as getConfig2, l as log, p as clear, t as __export, u as getRegisteredLayoutAlgorithm, v as render, x as utils_default } from "./mermaid.core-Dy_tFRs7.js";
5
+ var parser = (function() {
6
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
7
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
8
+ return o2;
9
+ }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $V5 = [1, 22], $V6 = [2, 7], $V7 = [1, 26], $V8 = [1, 27], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 33], $Vc = [1, 34], $Vd = [1, 35], $Ve = [1, 36], $Vf = [1, 37], $Vg = [1, 38], $Vh = [1, 24], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 30], $Vl = [1, 39], $Vm = [1, 40], $Vn = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $Vo = [1, 61], $Vp = [89, 90], $Vq = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 29, 41, 42, 43, 44, 45, 46, 54, 61, 63, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $Vr = [27, 29], $Vs = [1, 70], $Vt = [1, 71], $Vu = [1, 72], $Vv = [1, 73], $Vw = [1, 74], $Vx = [1, 75], $Vy = [1, 76], $Vz = [1, 83], $VA = [1, 80], $VB = [1, 84], $VC = [1, 85], $VD = [1, 86], $VE = [1, 87], $VF = [1, 88], $VG = [1, 89], $VH = [1, 90], $VI = [1, 91], $VJ = [1, 92], $VK = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $VL = [63, 64], $VM = [1, 101], $VN = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 76, 77, 89, 90], $VO = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], $VP = [1, 110], $VQ = [1, 106], $VR = [1, 107], $VS = [1, 108], $VT = [1, 109], $VU = [1, 111], $VV = [1, 116], $VW = [1, 117], $VX = [1, 114], $VY = [1, 115];
10
+ var parser2 = {
11
+ trace: /* @__PURE__ */ __name(function trace() {
12
+ }, "trace"),
13
+ yy: {},
14
+ symbols_: { "error": 2, "start": 3, "directive": 4, "NEWLINE": 5, "RD": 6, "diagram": 7, "EOF": 8, "acc_title": 9, "acc_title_value": 10, "acc_descr": 11, "acc_descr_value": 12, "acc_descr_multiline_value": 13, "requirementDef": 14, "elementDef": 15, "relationshipDef": 16, "direction": 17, "styleStatement": 18, "classDefStatement": 19, "classStatement": 20, "direction_tb": 21, "direction_bt": 22, "direction_rl": 23, "direction_lr": 24, "requirementType": 25, "requirementName": 26, "STRUCT_START": 27, "requirementBody": 28, "STYLE_SEPARATOR": 29, "idList": 30, "ID": 31, "COLONSEP": 32, "id": 33, "TEXT": 34, "text": 35, "RISK": 36, "riskLevel": 37, "VERIFYMTHD": 38, "verifyType": 39, "STRUCT_STOP": 40, "REQUIREMENT": 41, "FUNCTIONAL_REQUIREMENT": 42, "INTERFACE_REQUIREMENT": 43, "PERFORMANCE_REQUIREMENT": 44, "PHYSICAL_REQUIREMENT": 45, "DESIGN_CONSTRAINT": 46, "LOW_RISK": 47, "MED_RISK": 48, "HIGH_RISK": 49, "VERIFY_ANALYSIS": 50, "VERIFY_DEMONSTRATION": 51, "VERIFY_INSPECTION": 52, "VERIFY_TEST": 53, "ELEMENT": 54, "elementName": 55, "elementBody": 56, "TYPE": 57, "type": 58, "DOCREF": 59, "ref": 60, "END_ARROW_L": 61, "relationship": 62, "LINE": 63, "END_ARROW_R": 64, "CONTAINS": 65, "COPIES": 66, "DERIVES": 67, "SATISFIES": 68, "VERIFIES": 69, "REFINES": 70, "TRACES": 71, "CLASSDEF": 72, "stylesOpt": 73, "CLASS": 74, "ALPHA": 75, "COMMA": 76, "STYLE": 77, "style": 78, "styleComponent": 79, "NUM": 80, "COLON": 81, "UNIT": 82, "SPACE": 83, "BRKT": 84, "PCT": 85, "MINUS": 86, "LABEL": 87, "SEMICOLON": 88, "unqString": 89, "qString": 90, "$accept": 0, "$end": 1 },
15
+ terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 21: "direction_tb", 22: "direction_bt", 23: "direction_rl", 24: "direction_lr", 27: "STRUCT_START", 29: "STYLE_SEPARATOR", 31: "ID", 32: "COLONSEP", 34: "TEXT", 36: "RISK", 38: "VERIFYMTHD", 40: "STRUCT_STOP", 41: "REQUIREMENT", 42: "FUNCTIONAL_REQUIREMENT", 43: "INTERFACE_REQUIREMENT", 44: "PERFORMANCE_REQUIREMENT", 45: "PHYSICAL_REQUIREMENT", 46: "DESIGN_CONSTRAINT", 47: "LOW_RISK", 48: "MED_RISK", 49: "HIGH_RISK", 50: "VERIFY_ANALYSIS", 51: "VERIFY_DEMONSTRATION", 52: "VERIFY_INSPECTION", 53: "VERIFY_TEST", 54: "ELEMENT", 57: "TYPE", 59: "DOCREF", 61: "END_ARROW_L", 63: "LINE", 64: "END_ARROW_R", 65: "CONTAINS", 66: "COPIES", 67: "DERIVES", 68: "SATISFIES", 69: "VERIFIES", 70: "REFINES", 71: "TRACES", 72: "CLASSDEF", 74: "CLASS", 75: "ALPHA", 76: "COMMA", 77: "STYLE", 80: "NUM", 81: "COLON", 82: "UNIT", 83: "SPACE", 84: "BRKT", 85: "PCT", 86: "MINUS", 87: "LABEL", 88: "SEMICOLON", 89: "unqString", 90: "qString" },
16
+ productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [17, 1], [17, 1], [17, 1], [17, 1], [14, 5], [14, 7], [28, 5], [28, 5], [28, 5], [28, 5], [28, 2], [28, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [37, 1], [37, 1], [37, 1], [39, 1], [39, 1], [39, 1], [39, 1], [15, 5], [15, 7], [56, 5], [56, 5], [56, 2], [56, 1], [16, 5], [16, 5], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [19, 3], [20, 3], [20, 3], [30, 1], [30, 3], [30, 1], [30, 3], [18, 3], [73, 1], [73, 3], [78, 1], [78, 2], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [26, 1], [26, 1], [33, 1], [33, 1], [35, 1], [35, 1], [55, 1], [55, 1], [58, 1], [58, 1], [60, 1], [60, 1]],
17
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
18
+ var $0 = $$.length - 1;
19
+ switch (yystate) {
20
+ case 4:
21
+ this.$ = $$[$0].trim();
22
+ yy.setAccTitle(this.$);
23
+ break;
24
+ case 5:
25
+ case 6:
26
+ this.$ = $$[$0].trim();
27
+ yy.setAccDescription(this.$);
28
+ break;
29
+ case 7:
30
+ this.$ = [];
31
+ break;
32
+ case 17:
33
+ yy.setDirection("TB");
34
+ break;
35
+ case 18:
36
+ yy.setDirection("BT");
37
+ break;
38
+ case 19:
39
+ yy.setDirection("RL");
40
+ break;
41
+ case 20:
42
+ yy.setDirection("LR");
43
+ break;
44
+ case 21:
45
+ yy.addRequirement($$[$0 - 3], $$[$0 - 4]);
46
+ break;
47
+ case 22:
48
+ yy.addRequirement($$[$0 - 5], $$[$0 - 6]);
49
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
50
+ break;
51
+ case 23:
52
+ yy.setNewReqId($$[$0 - 2]);
53
+ break;
54
+ case 24:
55
+ yy.setNewReqText($$[$0 - 2]);
56
+ break;
57
+ case 25:
58
+ yy.setNewReqRisk($$[$0 - 2]);
59
+ break;
60
+ case 26:
61
+ yy.setNewReqVerifyMethod($$[$0 - 2]);
62
+ break;
63
+ case 29:
64
+ this.$ = yy.RequirementType.REQUIREMENT;
65
+ break;
66
+ case 30:
67
+ this.$ = yy.RequirementType.FUNCTIONAL_REQUIREMENT;
68
+ break;
69
+ case 31:
70
+ this.$ = yy.RequirementType.INTERFACE_REQUIREMENT;
71
+ break;
72
+ case 32:
73
+ this.$ = yy.RequirementType.PERFORMANCE_REQUIREMENT;
74
+ break;
75
+ case 33:
76
+ this.$ = yy.RequirementType.PHYSICAL_REQUIREMENT;
77
+ break;
78
+ case 34:
79
+ this.$ = yy.RequirementType.DESIGN_CONSTRAINT;
80
+ break;
81
+ case 35:
82
+ this.$ = yy.RiskLevel.LOW_RISK;
83
+ break;
84
+ case 36:
85
+ this.$ = yy.RiskLevel.MED_RISK;
86
+ break;
87
+ case 37:
88
+ this.$ = yy.RiskLevel.HIGH_RISK;
89
+ break;
90
+ case 38:
91
+ this.$ = yy.VerifyType.VERIFY_ANALYSIS;
92
+ break;
93
+ case 39:
94
+ this.$ = yy.VerifyType.VERIFY_DEMONSTRATION;
95
+ break;
96
+ case 40:
97
+ this.$ = yy.VerifyType.VERIFY_INSPECTION;
98
+ break;
99
+ case 41:
100
+ this.$ = yy.VerifyType.VERIFY_TEST;
101
+ break;
102
+ case 42:
103
+ yy.addElement($$[$0 - 3]);
104
+ break;
105
+ case 43:
106
+ yy.addElement($$[$0 - 5]);
107
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
108
+ break;
109
+ case 44:
110
+ yy.setNewElementType($$[$0 - 2]);
111
+ break;
112
+ case 45:
113
+ yy.setNewElementDocRef($$[$0 - 2]);
114
+ break;
115
+ case 48:
116
+ yy.addRelationship($$[$0 - 2], $$[$0], $$[$0 - 4]);
117
+ break;
118
+ case 49:
119
+ yy.addRelationship($$[$0 - 2], $$[$0 - 4], $$[$0]);
120
+ break;
121
+ case 50:
122
+ this.$ = yy.Relationships.CONTAINS;
123
+ break;
124
+ case 51:
125
+ this.$ = yy.Relationships.COPIES;
126
+ break;
127
+ case 52:
128
+ this.$ = yy.Relationships.DERIVES;
129
+ break;
130
+ case 53:
131
+ this.$ = yy.Relationships.SATISFIES;
132
+ break;
133
+ case 54:
134
+ this.$ = yy.Relationships.VERIFIES;
135
+ break;
136
+ case 55:
137
+ this.$ = yy.Relationships.REFINES;
138
+ break;
139
+ case 56:
140
+ this.$ = yy.Relationships.TRACES;
141
+ break;
142
+ case 57:
143
+ this.$ = $$[$0 - 2];
144
+ yy.defineClass($$[$0 - 1], $$[$0]);
145
+ break;
146
+ case 58:
147
+ yy.setClass($$[$0 - 1], $$[$0]);
148
+ break;
149
+ case 59:
150
+ yy.setClass([$$[$0 - 2]], $$[$0]);
151
+ break;
152
+ case 60:
153
+ case 62:
154
+ this.$ = [$$[$0]];
155
+ break;
156
+ case 61:
157
+ case 63:
158
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
159
+ break;
160
+ case 64:
161
+ this.$ = $$[$0 - 2];
162
+ yy.setCssStyle($$[$0 - 1], $$[$0]);
163
+ break;
164
+ case 65:
165
+ this.$ = [$$[$0]];
166
+ break;
167
+ case 66:
168
+ $$[$0 - 2].push($$[$0]);
169
+ this.$ = $$[$0 - 2];
170
+ break;
171
+ case 68:
172
+ this.$ = $$[$0 - 1] + $$[$0];
173
+ break;
174
+ }
175
+ }, "anonymous"),
176
+ table: [{ 3: 1, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, o($V4, [2, 6]), { 3: 12, 4: 2, 6: $V0, 9: $V1, 11: $V2, 13: $V3 }, { 1: [2, 2] }, { 4: 17, 5: $V5, 7: 13, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, o($V4, [2, 4]), o($V4, [2, 5]), { 1: [2, 1] }, { 8: [1, 41] }, { 4: 17, 5: $V5, 7: 42, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 43, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 44, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 45, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 46, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 47, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 48, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 49, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 4: 17, 5: $V5, 7: 50, 8: $V6, 9: $V1, 11: $V2, 13: $V3, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: $V7, 22: $V8, 23: $V9, 24: $Va, 25: 23, 33: 25, 41: $Vb, 42: $Vc, 43: $Vd, 44: $Ve, 45: $Vf, 46: $Vg, 54: $Vh, 72: $Vi, 74: $Vj, 77: $Vk, 89: $Vl, 90: $Vm }, { 26: 51, 89: [1, 52], 90: [1, 53] }, { 55: 54, 89: [1, 55], 90: [1, 56] }, { 29: [1, 59], 61: [1, 57], 63: [1, 58] }, o($Vn, [2, 17]), o($Vn, [2, 18]), o($Vn, [2, 19]), o($Vn, [2, 20]), { 30: 60, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 30: 63, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 30: 64, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, o($Vp, [2, 29]), o($Vp, [2, 30]), o($Vp, [2, 31]), o($Vp, [2, 32]), o($Vp, [2, 33]), o($Vp, [2, 34]), o($Vq, [2, 81]), o($Vq, [2, 82]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 8: [2, 13] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 27: [1, 65], 29: [1, 66] }, o($Vr, [2, 79]), o($Vr, [2, 80]), { 27: [1, 67], 29: [1, 68] }, o($Vr, [2, 85]), o($Vr, [2, 86]), { 62: 69, 65: $Vs, 66: $Vt, 67: $Vu, 68: $Vv, 69: $Vw, 70: $Vx, 71: $Vy }, { 62: 77, 65: $Vs, 66: $Vt, 67: $Vu, 68: $Vv, 69: $Vw, 70: $Vx, 71: $Vy }, { 30: 78, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 73: 79, 75: $Vz, 76: $VA, 78: 81, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, o($VK, [2, 60]), o($VK, [2, 62]), { 73: 93, 75: $Vz, 76: $VA, 78: 81, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, { 30: 94, 33: 62, 75: $Vo, 76: $VA, 89: $Vl, 90: $Vm }, { 5: [1, 95] }, { 30: 96, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 5: [1, 97] }, { 30: 98, 33: 62, 75: $Vo, 89: $Vl, 90: $Vm }, { 63: [1, 99] }, o($VL, [2, 50]), o($VL, [2, 51]), o($VL, [2, 52]), o($VL, [2, 53]), o($VL, [2, 54]), o($VL, [2, 55]), o($VL, [2, 56]), { 64: [1, 100] }, o($Vn, [2, 59], { 76: $VA }), o($Vn, [2, 64], { 76: $VM }), { 33: 103, 75: [1, 102], 89: $Vl, 90: $Vm }, o($VN, [2, 65], { 79: 104, 75: $Vz, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }), o($VO, [2, 67]), o($VO, [2, 69]), o($VO, [2, 70]), o($VO, [2, 71]), o($VO, [2, 72]), o($VO, [2, 73]), o($VO, [2, 74]), o($VO, [2, 75]), o($VO, [2, 76]), o($VO, [2, 77]), o($VO, [2, 78]), o($Vn, [2, 57], { 76: $VM }), o($Vn, [2, 58], { 76: $VA }), { 5: $VP, 28: 105, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 27: [1, 112], 76: $VA }, { 5: $VV, 40: $VW, 56: 113, 57: $VX, 59: $VY }, { 27: [1, 118], 76: $VA }, { 33: 119, 89: $Vl, 90: $Vm }, { 33: 120, 89: $Vl, 90: $Vm }, { 75: $Vz, 78: 121, 79: 82, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }, o($VK, [2, 61]), o($VK, [2, 63]), o($VO, [2, 68]), o($Vn, [2, 21]), { 32: [1, 122] }, { 32: [1, 123] }, { 32: [1, 124] }, { 32: [1, 125] }, { 5: $VP, 28: 126, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, o($Vn, [2, 28]), { 5: [1, 127] }, o($Vn, [2, 42]), { 32: [1, 128] }, { 32: [1, 129] }, { 5: $VV, 40: $VW, 56: 130, 57: $VX, 59: $VY }, o($Vn, [2, 47]), { 5: [1, 131] }, o($Vn, [2, 48]), o($Vn, [2, 49]), o($VN, [2, 66], { 79: 104, 75: $Vz, 80: $VB, 81: $VC, 82: $VD, 83: $VE, 84: $VF, 85: $VG, 86: $VH, 87: $VI, 88: $VJ }), { 33: 132, 89: $Vl, 90: $Vm }, { 35: 133, 89: [1, 134], 90: [1, 135] }, { 37: 136, 47: [1, 137], 48: [1, 138], 49: [1, 139] }, { 39: 140, 50: [1, 141], 51: [1, 142], 52: [1, 143], 53: [1, 144] }, o($Vn, [2, 27]), { 5: $VP, 28: 145, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 58: 146, 89: [1, 147], 90: [1, 148] }, { 60: 149, 89: [1, 150], 90: [1, 151] }, o($Vn, [2, 46]), { 5: $VV, 40: $VW, 56: 152, 57: $VX, 59: $VY }, { 5: [1, 153] }, { 5: [1, 154] }, { 5: [2, 83] }, { 5: [2, 84] }, { 5: [1, 155] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [1, 156] }, { 5: [2, 38] }, { 5: [2, 39] }, { 5: [2, 40] }, { 5: [2, 41] }, o($Vn, [2, 22]), { 5: [1, 157] }, { 5: [2, 87] }, { 5: [2, 88] }, { 5: [1, 158] }, { 5: [2, 89] }, { 5: [2, 90] }, o($Vn, [2, 43]), { 5: $VP, 28: 159, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 160, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 161, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VP, 28: 162, 31: $VQ, 34: $VR, 36: $VS, 38: $VT, 40: $VU }, { 5: $VV, 40: $VW, 56: 163, 57: $VX, 59: $VY }, { 5: $VV, 40: $VW, 56: 164, 57: $VX, 59: $VY }, o($Vn, [2, 23]), o($Vn, [2, 24]), o($Vn, [2, 25]), o($Vn, [2, 26]), o($Vn, [2, 44]), o($Vn, [2, 45])],
177
+ defaultActions: { 8: [2, 2], 12: [2, 1], 41: [2, 3], 42: [2, 8], 43: [2, 9], 44: [2, 10], 45: [2, 11], 46: [2, 12], 47: [2, 13], 48: [2, 14], 49: [2, 15], 50: [2, 16], 134: [2, 83], 135: [2, 84], 137: [2, 35], 138: [2, 36], 139: [2, 37], 141: [2, 38], 142: [2, 39], 143: [2, 40], 144: [2, 41], 147: [2, 87], 148: [2, 88], 150: [2, 89], 151: [2, 90] },
178
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
179
+ if (hash.recoverable) {
180
+ this.trace(str);
181
+ } else {
182
+ var error = new Error(str);
183
+ error.hash = hash;
184
+ throw error;
185
+ }
186
+ }, "parseError"),
187
+ parse: /* @__PURE__ */ __name(function parse(input) {
188
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
189
+ var args = lstack.slice.call(arguments, 1);
190
+ var lexer2 = Object.create(this.lexer);
191
+ var sharedState = { yy: {} };
192
+ for (var k in this.yy) {
193
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
194
+ sharedState.yy[k] = this.yy[k];
195
+ }
196
+ }
197
+ lexer2.setInput(input, sharedState.yy);
198
+ sharedState.yy.lexer = lexer2;
199
+ sharedState.yy.parser = this;
200
+ if (typeof lexer2.yylloc == "undefined") {
201
+ lexer2.yylloc = {};
202
+ }
203
+ var yyloc = lexer2.yylloc;
204
+ lstack.push(yyloc);
205
+ var ranges = lexer2.options && lexer2.options.ranges;
206
+ if (typeof sharedState.yy.parseError === "function") {
207
+ this.parseError = sharedState.yy.parseError;
208
+ } else {
209
+ this.parseError = Object.getPrototypeOf(this).parseError;
210
+ }
211
+ function popStack(n) {
212
+ stack.length = stack.length - 2 * n;
213
+ vstack.length = vstack.length - n;
214
+ lstack.length = lstack.length - n;
215
+ }
216
+ __name(popStack, "popStack");
217
+ function lex() {
218
+ var token;
219
+ token = tstack.pop() || lexer2.lex() || EOF;
220
+ if (typeof token !== "number") {
221
+ if (token instanceof Array) {
222
+ tstack = token;
223
+ token = tstack.pop();
224
+ }
225
+ token = self.symbols_[token] || token;
226
+ }
227
+ return token;
228
+ }
229
+ __name(lex, "lex");
230
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
231
+ while (true) {
232
+ state = stack[stack.length - 1];
233
+ if (this.defaultActions[state]) {
234
+ action = this.defaultActions[state];
235
+ } else {
236
+ if (symbol === null || typeof symbol == "undefined") {
237
+ symbol = lex();
238
+ }
239
+ action = table[state] && table[state][symbol];
240
+ }
241
+ if (typeof action === "undefined" || !action.length || !action[0]) {
242
+ var errStr = "";
243
+ expected = [];
244
+ for (p in table[state]) {
245
+ if (this.terminals_[p] && p > TERROR) {
246
+ expected.push("'" + this.terminals_[p] + "'");
247
+ }
248
+ }
249
+ if (lexer2.showPosition) {
250
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
251
+ } else {
252
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
253
+ }
254
+ this.parseError(errStr, {
255
+ text: lexer2.match,
256
+ token: this.terminals_[symbol] || symbol,
257
+ line: lexer2.yylineno,
258
+ loc: yyloc,
259
+ expected
260
+ });
261
+ }
262
+ if (action[0] instanceof Array && action.length > 1) {
263
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
264
+ }
265
+ switch (action[0]) {
266
+ case 1:
267
+ stack.push(symbol);
268
+ vstack.push(lexer2.yytext);
269
+ lstack.push(lexer2.yylloc);
270
+ stack.push(action[1]);
271
+ symbol = null;
272
+ {
273
+ yyleng = lexer2.yyleng;
274
+ yytext = lexer2.yytext;
275
+ yylineno = lexer2.yylineno;
276
+ yyloc = lexer2.yylloc;
277
+ }
278
+ break;
279
+ case 2:
280
+ len = this.productions_[action[1]][1];
281
+ yyval.$ = vstack[vstack.length - len];
282
+ yyval._$ = {
283
+ first_line: lstack[lstack.length - (len || 1)].first_line,
284
+ last_line: lstack[lstack.length - 1].last_line,
285
+ first_column: lstack[lstack.length - (len || 1)].first_column,
286
+ last_column: lstack[lstack.length - 1].last_column
287
+ };
288
+ if (ranges) {
289
+ yyval._$.range = [
290
+ lstack[lstack.length - (len || 1)].range[0],
291
+ lstack[lstack.length - 1].range[1]
292
+ ];
293
+ }
294
+ r = this.performAction.apply(yyval, [
295
+ yytext,
296
+ yyleng,
297
+ yylineno,
298
+ sharedState.yy,
299
+ action[1],
300
+ vstack,
301
+ lstack
302
+ ].concat(args));
303
+ if (typeof r !== "undefined") {
304
+ return r;
305
+ }
306
+ if (len) {
307
+ stack = stack.slice(0, -1 * len * 2);
308
+ vstack = vstack.slice(0, -1 * len);
309
+ lstack = lstack.slice(0, -1 * len);
310
+ }
311
+ stack.push(this.productions_[action[1]][0]);
312
+ vstack.push(yyval.$);
313
+ lstack.push(yyval._$);
314
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
315
+ stack.push(newState);
316
+ break;
317
+ case 3:
318
+ return true;
319
+ }
320
+ }
321
+ return true;
322
+ }, "parse")
323
+ };
324
+ var lexer = /* @__PURE__ */ (function() {
325
+ var lexer2 = {
326
+ EOF: 1,
327
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
328
+ if (this.yy.parser) {
329
+ this.yy.parser.parseError(str, hash);
330
+ } else {
331
+ throw new Error(str);
332
+ }
333
+ }, "parseError"),
334
+ // resets the lexer, sets new input
335
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
336
+ this.yy = yy || this.yy || {};
337
+ this._input = input;
338
+ this._more = this._backtrack = this.done = false;
339
+ this.yylineno = this.yyleng = 0;
340
+ this.yytext = this.matched = this.match = "";
341
+ this.conditionStack = ["INITIAL"];
342
+ this.yylloc = {
343
+ first_line: 1,
344
+ first_column: 0,
345
+ last_line: 1,
346
+ last_column: 0
347
+ };
348
+ if (this.options.ranges) {
349
+ this.yylloc.range = [0, 0];
350
+ }
351
+ this.offset = 0;
352
+ return this;
353
+ }, "setInput"),
354
+ // consumes and returns one char from the input
355
+ input: /* @__PURE__ */ __name(function() {
356
+ var ch = this._input[0];
357
+ this.yytext += ch;
358
+ this.yyleng++;
359
+ this.offset++;
360
+ this.match += ch;
361
+ this.matched += ch;
362
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
363
+ if (lines) {
364
+ this.yylineno++;
365
+ this.yylloc.last_line++;
366
+ } else {
367
+ this.yylloc.last_column++;
368
+ }
369
+ if (this.options.ranges) {
370
+ this.yylloc.range[1]++;
371
+ }
372
+ this._input = this._input.slice(1);
373
+ return ch;
374
+ }, "input"),
375
+ // unshifts one char (or a string) into the input
376
+ unput: /* @__PURE__ */ __name(function(ch) {
377
+ var len = ch.length;
378
+ var lines = ch.split(/(?:\r\n?|\n)/g);
379
+ this._input = ch + this._input;
380
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
381
+ this.offset -= len;
382
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
383
+ this.match = this.match.substr(0, this.match.length - 1);
384
+ this.matched = this.matched.substr(0, this.matched.length - 1);
385
+ if (lines.length - 1) {
386
+ this.yylineno -= lines.length - 1;
387
+ }
388
+ var r = this.yylloc.range;
389
+ this.yylloc = {
390
+ first_line: this.yylloc.first_line,
391
+ last_line: this.yylineno + 1,
392
+ first_column: this.yylloc.first_column,
393
+ 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
394
+ };
395
+ if (this.options.ranges) {
396
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
397
+ }
398
+ this.yyleng = this.yytext.length;
399
+ return this;
400
+ }, "unput"),
401
+ // When called from action, caches matched text and appends it on next action
402
+ more: /* @__PURE__ */ __name(function() {
403
+ this._more = true;
404
+ return this;
405
+ }, "more"),
406
+ // 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.
407
+ reject: /* @__PURE__ */ __name(function() {
408
+ if (this.options.backtrack_lexer) {
409
+ this._backtrack = true;
410
+ } else {
411
+ 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(), {
412
+ text: "",
413
+ token: null,
414
+ line: this.yylineno
415
+ });
416
+ }
417
+ return this;
418
+ }, "reject"),
419
+ // retain first n characters of the match
420
+ less: /* @__PURE__ */ __name(function(n) {
421
+ this.unput(this.match.slice(n));
422
+ }, "less"),
423
+ // displays already matched input, i.e. for error messages
424
+ pastInput: /* @__PURE__ */ __name(function() {
425
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
426
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
427
+ }, "pastInput"),
428
+ // displays upcoming input, i.e. for error messages
429
+ upcomingInput: /* @__PURE__ */ __name(function() {
430
+ var next = this.match;
431
+ if (next.length < 20) {
432
+ next += this._input.substr(0, 20 - next.length);
433
+ }
434
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
435
+ }, "upcomingInput"),
436
+ // displays the character position where the lexing error occurred, i.e. for error messages
437
+ showPosition: /* @__PURE__ */ __name(function() {
438
+ var pre = this.pastInput();
439
+ var c = new Array(pre.length + 1).join("-");
440
+ return pre + this.upcomingInput() + "\n" + c + "^";
441
+ }, "showPosition"),
442
+ // test the lexed token: return FALSE when not a match, otherwise return token
443
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
444
+ var token, lines, backup;
445
+ if (this.options.backtrack_lexer) {
446
+ backup = {
447
+ yylineno: this.yylineno,
448
+ yylloc: {
449
+ first_line: this.yylloc.first_line,
450
+ last_line: this.last_line,
451
+ first_column: this.yylloc.first_column,
452
+ last_column: this.yylloc.last_column
453
+ },
454
+ yytext: this.yytext,
455
+ match: this.match,
456
+ matches: this.matches,
457
+ matched: this.matched,
458
+ yyleng: this.yyleng,
459
+ offset: this.offset,
460
+ _more: this._more,
461
+ _input: this._input,
462
+ yy: this.yy,
463
+ conditionStack: this.conditionStack.slice(0),
464
+ done: this.done
465
+ };
466
+ if (this.options.ranges) {
467
+ backup.yylloc.range = this.yylloc.range.slice(0);
468
+ }
469
+ }
470
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
471
+ if (lines) {
472
+ this.yylineno += lines.length;
473
+ }
474
+ this.yylloc = {
475
+ first_line: this.yylloc.last_line,
476
+ last_line: this.yylineno + 1,
477
+ first_column: this.yylloc.last_column,
478
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
479
+ };
480
+ this.yytext += match[0];
481
+ this.match += match[0];
482
+ this.matches = match;
483
+ this.yyleng = this.yytext.length;
484
+ if (this.options.ranges) {
485
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
486
+ }
487
+ this._more = false;
488
+ this._backtrack = false;
489
+ this._input = this._input.slice(match[0].length);
490
+ this.matched += match[0];
491
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
492
+ if (this.done && this._input) {
493
+ this.done = false;
494
+ }
495
+ if (token) {
496
+ return token;
497
+ } else if (this._backtrack) {
498
+ for (var k in backup) {
499
+ this[k] = backup[k];
500
+ }
501
+ return false;
502
+ }
503
+ return false;
504
+ }, "test_match"),
505
+ // return next match in input
506
+ next: /* @__PURE__ */ __name(function() {
507
+ if (this.done) {
508
+ return this.EOF;
509
+ }
510
+ if (!this._input) {
511
+ this.done = true;
512
+ }
513
+ var token, match, tempMatch, index;
514
+ if (!this._more) {
515
+ this.yytext = "";
516
+ this.match = "";
517
+ }
518
+ var rules = this._currentRules();
519
+ for (var i = 0; i < rules.length; i++) {
520
+ tempMatch = this._input.match(this.rules[rules[i]]);
521
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
522
+ match = tempMatch;
523
+ index = i;
524
+ if (this.options.backtrack_lexer) {
525
+ token = this.test_match(tempMatch, rules[i]);
526
+ if (token !== false) {
527
+ return token;
528
+ } else if (this._backtrack) {
529
+ match = false;
530
+ continue;
531
+ } else {
532
+ return false;
533
+ }
534
+ } else if (!this.options.flex) {
535
+ break;
536
+ }
537
+ }
538
+ }
539
+ if (match) {
540
+ token = this.test_match(match, rules[index]);
541
+ if (token !== false) {
542
+ return token;
543
+ }
544
+ return false;
545
+ }
546
+ if (this._input === "") {
547
+ return this.EOF;
548
+ } else {
549
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
550
+ text: "",
551
+ token: null,
552
+ line: this.yylineno
553
+ });
554
+ }
555
+ }, "next"),
556
+ // return next match that has a token
557
+ lex: /* @__PURE__ */ __name(function lex() {
558
+ var r = this.next();
559
+ if (r) {
560
+ return r;
561
+ } else {
562
+ return this.lex();
563
+ }
564
+ }, "lex"),
565
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
566
+ begin: /* @__PURE__ */ __name(function begin(condition) {
567
+ this.conditionStack.push(condition);
568
+ }, "begin"),
569
+ // pop the previously active lexer condition state off the condition stack
570
+ popState: /* @__PURE__ */ __name(function popState() {
571
+ var n = this.conditionStack.length - 1;
572
+ if (n > 0) {
573
+ return this.conditionStack.pop();
574
+ } else {
575
+ return this.conditionStack[0];
576
+ }
577
+ }, "popState"),
578
+ // produce the lexer rule set which is active for the currently active lexer condition state
579
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
580
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
581
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
582
+ } else {
583
+ return this.conditions["INITIAL"].rules;
584
+ }
585
+ }, "_currentRules"),
586
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
587
+ topState: /* @__PURE__ */ __name(function topState(n) {
588
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
589
+ if (n >= 0) {
590
+ return this.conditionStack[n];
591
+ } else {
592
+ return "INITIAL";
593
+ }
594
+ }, "topState"),
595
+ // alias for begin(condition)
596
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
597
+ this.begin(condition);
598
+ }, "pushState"),
599
+ // return the number of states currently on the stack
600
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
601
+ return this.conditionStack.length;
602
+ }, "stateStackSize"),
603
+ options: { "case-insensitive": true },
604
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
605
+ switch ($avoiding_name_collisions) {
606
+ case 0:
607
+ return "title";
608
+ case 1:
609
+ this.begin("acc_title");
610
+ return 9;
611
+ case 2:
612
+ this.popState();
613
+ return "acc_title_value";
614
+ case 3:
615
+ this.begin("acc_descr");
616
+ return 11;
617
+ case 4:
618
+ this.popState();
619
+ return "acc_descr_value";
620
+ case 5:
621
+ this.begin("acc_descr_multiline");
622
+ break;
623
+ case 6:
624
+ this.popState();
625
+ break;
626
+ case 7:
627
+ return "acc_descr_multiline_value";
628
+ case 8:
629
+ return 21;
630
+ case 9:
631
+ return 22;
632
+ case 10:
633
+ return 23;
634
+ case 11:
635
+ return 24;
636
+ case 12:
637
+ return 5;
638
+ case 13:
639
+ break;
640
+ case 14:
641
+ break;
642
+ case 15:
643
+ break;
644
+ case 16:
645
+ return 8;
646
+ case 17:
647
+ return 6;
648
+ case 18:
649
+ return 27;
650
+ case 19:
651
+ return 40;
652
+ case 20:
653
+ return 29;
654
+ case 21:
655
+ return 32;
656
+ case 22:
657
+ return 31;
658
+ case 23:
659
+ return 34;
660
+ case 24:
661
+ return 36;
662
+ case 25:
663
+ return 38;
664
+ case 26:
665
+ return 41;
666
+ case 27:
667
+ return 42;
668
+ case 28:
669
+ return 43;
670
+ case 29:
671
+ return 44;
672
+ case 30:
673
+ return 45;
674
+ case 31:
675
+ return 46;
676
+ case 32:
677
+ return 47;
678
+ case 33:
679
+ return 48;
680
+ case 34:
681
+ return 49;
682
+ case 35:
683
+ return 50;
684
+ case 36:
685
+ return 51;
686
+ case 37:
687
+ return 52;
688
+ case 38:
689
+ return 53;
690
+ case 39:
691
+ return 54;
692
+ case 40:
693
+ return 65;
694
+ case 41:
695
+ return 66;
696
+ case 42:
697
+ return 67;
698
+ case 43:
699
+ return 68;
700
+ case 44:
701
+ return 69;
702
+ case 45:
703
+ return 70;
704
+ case 46:
705
+ return 71;
706
+ case 47:
707
+ return 57;
708
+ case 48:
709
+ return 59;
710
+ case 49:
711
+ this.begin("style");
712
+ return 77;
713
+ case 50:
714
+ return 75;
715
+ case 51:
716
+ return 81;
717
+ case 52:
718
+ return 88;
719
+ case 53:
720
+ return "PERCENT";
721
+ case 54:
722
+ return 86;
723
+ case 55:
724
+ return 84;
725
+ case 56:
726
+ break;
727
+ case 57:
728
+ this.begin("string");
729
+ break;
730
+ case 58:
731
+ this.popState();
732
+ break;
733
+ case 59:
734
+ this.begin("style");
735
+ return 72;
736
+ case 60:
737
+ this.begin("style");
738
+ return 74;
739
+ case 61:
740
+ return 61;
741
+ case 62:
742
+ return 64;
743
+ case 63:
744
+ return 63;
745
+ case 64:
746
+ this.begin("string");
747
+ break;
748
+ case 65:
749
+ this.popState();
750
+ break;
751
+ case 66:
752
+ return "qString";
753
+ case 67:
754
+ yy_.yytext = yy_.yytext.trim();
755
+ return 89;
756
+ case 68:
757
+ return 75;
758
+ case 69:
759
+ return 80;
760
+ case 70:
761
+ return 76;
762
+ }
763
+ }, "anonymous"),
764
+ rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::{3})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:style\b)/i, /^(?:\w+)/i, /^(?::)/i, /^(?:;)/i, /^(?:%)/i, /^(?:-)/i, /^(?:#)/i, /^(?: )/i, /^(?:["])/i, /^(?:\n)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i, /^(?:\w+)/i, /^(?:[0-9]+)/i, /^(?:,)/i],
765
+ conditions: { "acc_descr_multiline": { "rules": [6, 7, 68, 69, 70], "inclusive": false }, "acc_descr": { "rules": [4, 68, 69, 70], "inclusive": false }, "acc_title": { "rules": [2, 68, 69, 70], "inclusive": false }, "style": { "rules": [50, 51, 52, 53, 54, 55, 56, 57, 58, 68, 69, 70], "inclusive": false }, "unqString": { "rules": [68, 69, 70], "inclusive": false }, "token": { "rules": [68, 69, 70], "inclusive": false }, "string": { "rules": [65, 66, 68, 69, 70], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70], "inclusive": true } }
766
+ };
767
+ return lexer2;
768
+ })();
769
+ parser2.lexer = lexer;
770
+ function Parser() {
771
+ this.yy = {};
772
+ }
773
+ __name(Parser, "Parser");
774
+ Parser.prototype = parser2;
775
+ parser2.Parser = Parser;
776
+ return new Parser();
777
+ })();
778
+ parser.parser = parser;
779
+ var requirementDiagram_default = parser;
780
+ var RequirementDB = class {
781
+ constructor() {
782
+ this.relations = [];
783
+ this.latestRequirement = this.getInitialRequirement();
784
+ this.requirements = /* @__PURE__ */ new Map();
785
+ this.latestElement = this.getInitialElement();
786
+ this.elements = /* @__PURE__ */ new Map();
787
+ this.classes = /* @__PURE__ */ new Map();
788
+ this.direction = "TB";
789
+ this.RequirementType = {
790
+ REQUIREMENT: "Requirement",
791
+ FUNCTIONAL_REQUIREMENT: "Functional Requirement",
792
+ INTERFACE_REQUIREMENT: "Interface Requirement",
793
+ PERFORMANCE_REQUIREMENT: "Performance Requirement",
794
+ PHYSICAL_REQUIREMENT: "Physical Requirement",
795
+ DESIGN_CONSTRAINT: "Design Constraint"
796
+ };
797
+ this.RiskLevel = {
798
+ LOW_RISK: "Low",
799
+ MED_RISK: "Medium",
800
+ HIGH_RISK: "High"
801
+ };
802
+ this.VerifyType = {
803
+ VERIFY_ANALYSIS: "Analysis",
804
+ VERIFY_DEMONSTRATION: "Demonstration",
805
+ VERIFY_INSPECTION: "Inspection",
806
+ VERIFY_TEST: "Test"
807
+ };
808
+ this.Relationships = {
809
+ CONTAINS: "contains",
810
+ COPIES: "copies",
811
+ DERIVES: "derives",
812
+ SATISFIES: "satisfies",
813
+ VERIFIES: "verifies",
814
+ REFINES: "refines",
815
+ TRACES: "traces"
816
+ };
817
+ this.setAccTitle = setAccTitle;
818
+ this.getAccTitle = getAccTitle;
819
+ this.setAccDescription = setAccDescription;
820
+ this.getAccDescription = getAccDescription;
821
+ this.setDiagramTitle = setDiagramTitle;
822
+ this.getDiagramTitle = getDiagramTitle;
823
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().requirement, "getConfig");
824
+ this.clear();
825
+ this.setDirection = this.setDirection.bind(this);
826
+ this.addRequirement = this.addRequirement.bind(this);
827
+ this.setNewReqId = this.setNewReqId.bind(this);
828
+ this.setNewReqRisk = this.setNewReqRisk.bind(this);
829
+ this.setNewReqText = this.setNewReqText.bind(this);
830
+ this.setNewReqVerifyMethod = this.setNewReqVerifyMethod.bind(this);
831
+ this.addElement = this.addElement.bind(this);
832
+ this.setNewElementType = this.setNewElementType.bind(this);
833
+ this.setNewElementDocRef = this.setNewElementDocRef.bind(this);
834
+ this.addRelationship = this.addRelationship.bind(this);
835
+ this.setCssStyle = this.setCssStyle.bind(this);
836
+ this.setClass = this.setClass.bind(this);
837
+ this.defineClass = this.defineClass.bind(this);
838
+ this.setAccTitle = this.setAccTitle.bind(this);
839
+ this.setAccDescription = this.setAccDescription.bind(this);
840
+ }
841
+ static {
842
+ __name(this, "RequirementDB");
843
+ }
844
+ getDirection() {
845
+ return this.direction;
846
+ }
847
+ setDirection(dir) {
848
+ this.direction = dir;
849
+ }
850
+ resetLatestRequirement() {
851
+ this.latestRequirement = this.getInitialRequirement();
852
+ }
853
+ resetLatestElement() {
854
+ this.latestElement = this.getInitialElement();
855
+ }
856
+ getInitialRequirement() {
857
+ return {
858
+ requirementId: "",
859
+ text: "",
860
+ risk: "",
861
+ verifyMethod: "",
862
+ name: "",
863
+ type: "",
864
+ cssStyles: [],
865
+ classes: ["default"]
866
+ };
867
+ }
868
+ getInitialElement() {
869
+ return {
870
+ name: "",
871
+ type: "",
872
+ docRef: "",
873
+ cssStyles: [],
874
+ classes: ["default"]
875
+ };
876
+ }
877
+ addRequirement(name, type) {
878
+ if (!this.requirements.has(name)) {
879
+ this.requirements.set(name, {
880
+ name,
881
+ type,
882
+ requirementId: this.latestRequirement.requirementId,
883
+ text: this.latestRequirement.text,
884
+ risk: this.latestRequirement.risk,
885
+ verifyMethod: this.latestRequirement.verifyMethod,
886
+ cssStyles: [],
887
+ classes: ["default"]
888
+ });
889
+ }
890
+ this.resetLatestRequirement();
891
+ return this.requirements.get(name);
892
+ }
893
+ getRequirements() {
894
+ return this.requirements;
895
+ }
896
+ setNewReqId(id) {
897
+ if (this.latestRequirement !== void 0) {
898
+ this.latestRequirement.requirementId = id;
899
+ }
900
+ }
901
+ setNewReqText(text) {
902
+ if (this.latestRequirement !== void 0) {
903
+ this.latestRequirement.text = text;
904
+ }
905
+ }
906
+ setNewReqRisk(risk) {
907
+ if (this.latestRequirement !== void 0) {
908
+ this.latestRequirement.risk = risk;
909
+ }
910
+ }
911
+ setNewReqVerifyMethod(verifyMethod) {
912
+ if (this.latestRequirement !== void 0) {
913
+ this.latestRequirement.verifyMethod = verifyMethod;
914
+ }
915
+ }
916
+ addElement(name) {
917
+ if (!this.elements.has(name)) {
918
+ this.elements.set(name, {
919
+ name,
920
+ type: this.latestElement.type,
921
+ docRef: this.latestElement.docRef,
922
+ cssStyles: [],
923
+ classes: ["default"]
924
+ });
925
+ log.info("Added new element: ", name);
926
+ }
927
+ this.resetLatestElement();
928
+ return this.elements.get(name);
929
+ }
930
+ getElements() {
931
+ return this.elements;
932
+ }
933
+ setNewElementType(type) {
934
+ if (this.latestElement !== void 0) {
935
+ this.latestElement.type = type;
936
+ }
937
+ }
938
+ setNewElementDocRef(docRef) {
939
+ if (this.latestElement !== void 0) {
940
+ this.latestElement.docRef = docRef;
941
+ }
942
+ }
943
+ addRelationship(type, src, dst) {
944
+ this.relations.push({
945
+ type,
946
+ src,
947
+ dst
948
+ });
949
+ }
950
+ getRelationships() {
951
+ return this.relations;
952
+ }
953
+ clear() {
954
+ this.relations = [];
955
+ this.resetLatestRequirement();
956
+ this.requirements = /* @__PURE__ */ new Map();
957
+ this.resetLatestElement();
958
+ this.elements = /* @__PURE__ */ new Map();
959
+ this.classes = /* @__PURE__ */ new Map();
960
+ clear();
961
+ }
962
+ setCssStyle(ids, styles) {
963
+ for (const id of ids) {
964
+ const node = this.requirements.get(id) ?? this.elements.get(id);
965
+ if (!styles || !node) {
966
+ return;
967
+ }
968
+ for (const s of styles) {
969
+ if (s.includes(",")) {
970
+ node.cssStyles.push(...s.split(","));
971
+ } else {
972
+ node.cssStyles.push(s);
973
+ }
974
+ }
975
+ }
976
+ }
977
+ setClass(ids, classNames) {
978
+ for (const id of ids) {
979
+ const node = this.requirements.get(id) ?? this.elements.get(id);
980
+ if (node) {
981
+ for (const _class of classNames) {
982
+ node.classes.push(_class);
983
+ const styles = this.classes.get(_class)?.styles;
984
+ if (styles) {
985
+ node.cssStyles.push(...styles);
986
+ }
987
+ }
988
+ }
989
+ }
990
+ }
991
+ defineClass(ids, style) {
992
+ for (const id of ids) {
993
+ let styleClass = this.classes.get(id);
994
+ if (styleClass === void 0) {
995
+ styleClass = { id, styles: [], textStyles: [] };
996
+ this.classes.set(id, styleClass);
997
+ }
998
+ if (style) {
999
+ style.forEach(function(s) {
1000
+ if (/color/.exec(s)) {
1001
+ const newStyle = s.replace("fill", "bgFill");
1002
+ styleClass.textStyles.push(newStyle);
1003
+ }
1004
+ styleClass.styles.push(s);
1005
+ });
1006
+ }
1007
+ this.requirements.forEach((value) => {
1008
+ if (value.classes.includes(id)) {
1009
+ value.cssStyles.push(...style.flatMap((s) => s.split(",")));
1010
+ }
1011
+ });
1012
+ this.elements.forEach((value) => {
1013
+ if (value.classes.includes(id)) {
1014
+ value.cssStyles.push(...style.flatMap((s) => s.split(",")));
1015
+ }
1016
+ });
1017
+ }
1018
+ }
1019
+ getClasses() {
1020
+ return this.classes;
1021
+ }
1022
+ getData() {
1023
+ const config = getConfig2();
1024
+ const nodes = [];
1025
+ const edges = [];
1026
+ for (const requirement of this.requirements.values()) {
1027
+ const node = requirement;
1028
+ node.id = requirement.name;
1029
+ node.cssStyles = requirement.cssStyles;
1030
+ node.cssClasses = requirement.classes.join(" ");
1031
+ node.shape = "requirementBox";
1032
+ node.look = config.look;
1033
+ node.colorIndex = nodes.length;
1034
+ nodes.push(node);
1035
+ }
1036
+ for (const element of this.elements.values()) {
1037
+ const node = element;
1038
+ node.shape = "requirementBox";
1039
+ node.look = config.look;
1040
+ node.id = element.name;
1041
+ node.cssStyles = element.cssStyles;
1042
+ node.cssClasses = element.classes.join(" ");
1043
+ node.colorIndex = nodes.length;
1044
+ nodes.push(node);
1045
+ }
1046
+ for (const relation of this.relations) {
1047
+ let counter = 0;
1048
+ const isContains = relation.type === this.Relationships.CONTAINS;
1049
+ const edge = {
1050
+ id: `${relation.src}-${relation.dst}-${counter}`,
1051
+ start: this.requirements.get(relation.src)?.name ?? this.elements.get(relation.src)?.name,
1052
+ end: this.requirements.get(relation.dst)?.name ?? this.elements.get(relation.dst)?.name,
1053
+ label: `&lt;&lt;${relation.type}&gt;&gt;`,
1054
+ classes: "relationshipLine",
1055
+ style: ["fill:none", isContains ? "" : "stroke-dasharray: 10,7"],
1056
+ labelpos: "c",
1057
+ thickness: "normal",
1058
+ type: "normal",
1059
+ pattern: isContains ? "normal" : "dashed",
1060
+ arrowTypeStart: isContains ? "requirement_contains" : "",
1061
+ arrowTypeEnd: isContains ? "" : "requirement_arrow",
1062
+ look: config.look,
1063
+ labelType: "markdown"
1064
+ };
1065
+ edges.push(edge);
1066
+ counter++;
1067
+ }
1068
+ return { nodes, edges, other: {}, config, direction: this.getDirection() };
1069
+ }
1070
+ };
1071
+ var genColor = /* @__PURE__ */ __name((options) => {
1072
+ const config = getConfig();
1073
+ const { themeVariables, look } = config;
1074
+ const { bkgColorArray, borderColorArray } = themeVariables;
1075
+ if (!borderColorArray?.length) {
1076
+ return "";
1077
+ }
1078
+ let sections = "";
1079
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1080
+ sections += `
1081
+
1082
+ [data-look="${look}"][data-color-id="color-${i}"].node path {
1083
+ stroke: ${borderColorArray[i]};
1084
+ fill: ${bkgColorArray?.length ? bkgColorArray[i] : ""};
1085
+ }
1086
+
1087
+ [data-look="${look}"][data-color-id="color-${i}"].node rect {
1088
+ stroke: ${borderColorArray[i]};
1089
+ fill: ${bkgColorArray?.length ? bkgColorArray[i] : ""};
1090
+ }
1091
+ `;
1092
+ }
1093
+ return sections;
1094
+ }, "genColor");
1095
+ var getStyles = /* @__PURE__ */ __name((options) => {
1096
+ const config = getConfig();
1097
+ const { look, themeVariables } = config;
1098
+ const { requirementEdgeLabelBackground } = themeVariables;
1099
+ return `
1100
+ ${genColor(options)}
1101
+ marker {
1102
+ fill: ${options.relationColor};
1103
+ stroke: ${options.relationColor};
1104
+ }
1105
+
1106
+ marker.cross {
1107
+ stroke: ${options.lineColor};
1108
+ }
1109
+
1110
+ svg {
1111
+ font-family: ${options.fontFamily};
1112
+ font-size: ${options.fontSize};
1113
+ }
1114
+
1115
+ .reqBox {
1116
+ fill: ${options.requirementBackground};
1117
+ fill-opacity: 1.0;
1118
+ stroke: ${options.requirementBorderColor};
1119
+ stroke-width: ${options.requirementBorderSize};
1120
+ }
1121
+
1122
+ .reqTitle, .reqLabel{
1123
+ fill: ${options.requirementTextColor};
1124
+ }
1125
+ .reqLabelBox {
1126
+ fill: ${options.relationLabelBackground};
1127
+ fill-opacity: 1.0;
1128
+ }
1129
+
1130
+ .req-title-line {
1131
+ stroke: ${options.requirementBorderColor};
1132
+ stroke-width: ${options.requirementBorderSize};
1133
+ }
1134
+ .relationshipLine {
1135
+ stroke: ${options.relationColor};
1136
+ stroke-width: ${look === "neo" ? options.strokeWidth : "1px"};
1137
+ }
1138
+ .relationshipLabel {
1139
+ fill: ${options.relationLabelColor};
1140
+ }
1141
+ .edgeLabel {
1142
+ background-color: ${options.edgeLabelBackground};
1143
+ }
1144
+ .edgeLabel .label rect {
1145
+ fill: ${options.edgeLabelBackground};
1146
+ }
1147
+ .edgeLabel .label text {
1148
+ fill: ${options.relationLabelColor};
1149
+ }
1150
+ .divider {
1151
+ stroke: ${options.nodeBorder};
1152
+ stroke-width: 1;
1153
+ }
1154
+ .label {
1155
+ font-family: ${options.fontFamily};
1156
+ color: ${options.nodeTextColor || options.textColor};
1157
+ }
1158
+ .label text,span {
1159
+ fill: ${options.nodeTextColor || options.textColor};
1160
+ color: ${options.nodeTextColor || options.textColor};
1161
+ }
1162
+ .labelBkg {
1163
+ background-color: ${requirementEdgeLabelBackground ?? options.edgeLabelBackground};
1164
+ }
1165
+
1166
+ `;
1167
+ }, "getStyles");
1168
+ var styles_default = getStyles;
1169
+ var requirementRenderer_exports = {};
1170
+ __export(requirementRenderer_exports, {
1171
+ draw: () => draw
1172
+ });
1173
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
1174
+ log.info("REF0:");
1175
+ log.info("Drawing requirement diagram (unified)", id);
1176
+ const { securityLevel, state: conf, layout, look } = getConfig2();
1177
+ const data4Layout = diag.db.getData();
1178
+ const svg = getDiagramElement(id, securityLevel);
1179
+ data4Layout.type = diag.type;
1180
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
1181
+ data4Layout.nodeSpacing = conf?.nodeSpacing ?? 50;
1182
+ data4Layout.rankSpacing = conf?.rankSpacing ?? 50;
1183
+ data4Layout.markers = look === "neo" ? ["requirement_contains_neo", "requirement_arrow_neo"] : ["requirement_contains", "requirement_arrow"];
1184
+ data4Layout.diagramId = id;
1185
+ await render(data4Layout, svg);
1186
+ const padding = 8;
1187
+ utils_default.insertTitle(
1188
+ svg,
1189
+ "requirementDiagramTitleText",
1190
+ conf?.titleTopMargin ?? 25,
1191
+ diag.db.getDiagramTitle()
1192
+ );
1193
+ setupViewPortForSVG(svg, padding, "requirementDiagram", conf?.useMaxWidth ?? true);
1194
+ }, "draw");
1195
+ var diagram = {
1196
+ parser: requirementDiagram_default,
1197
+ get db() {
1198
+ return new RequirementDB();
1199
+ },
1200
+ renderer: requirementRenderer_exports,
1201
+ styles: styles_default
1202
+ };
1203
+ export {
1204
+ diagram
1205
+ };