@openbkn/workshop 0.2.2-rc.5 → 0.2.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 (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,2583 @@
1
+ import { g as k1 } from "./chunk-5VM5RSS4-BdpQuzmO.js";
2
+ import { g as E1 } from "./chunk-XXDRQBXY-CPYrcdVW.js";
3
+ import { s as C1 } from "./chunk-VQ5W62QI-BiVKc40w.js";
4
+ import { _ as k, q as t1, l as oe, c as Ce, r as S1, t as x1, u as Gt, b as T1, s as D1, v as _1, a as v1, g as F1, x as V1, m as I1, y as s1, J as i1, z as L1, A as Rt, k as Ot, B as B1, D as M1, E as y1, F as w1, G as N1, H as R1, I as O1, K as P1 } from "./mermaid.core-yQghUlIz.js";
5
+ import { c as G1 } from "./chunk-55XCU76K-dcpLOktb.js";
6
+ import { c as U1 } from "./channel-B034hcOF.js";
7
+ var tt = {
8
+ /**
9
+ * Shape annotation that v0.8.1 does *not* remove explicitly but the
10
+ * renderer doesn't recognise. The renderer falls back to roundedRect.
11
+ * Distinct from `SHAPE_REMOVED`, which is a hard error.
12
+ */
13
+ SHAPE_UNSUPPORTED: "SHAPE_UNSUPPORTED",
14
+ /**
15
+ * Shape explicitly removed in v0.8.1 (§4.3.3): `doc`, `stadium`,
16
+ * `terminal`, `circle`, `trapezoid`/`inv-trapezoid`, `double-circle`,
17
+ * `typeDeclaration`, `procs`, the five per-kind instance shapes, plus
18
+ * `cylinder`, `ellipse`, `odd`, `lean_left`. Hard error.
19
+ */
20
+ SHAPE_REMOVED: "SHAPE_REMOVED",
21
+ /**
22
+ * Edge operator removed in v0.8.1 (§5.1): `==>`, `~~`, `-.->`, plus
23
+ * marker variants of `--` (`<-->`, `o--o`, `--o`, `-->>`). Hard error.
24
+ *
25
+ * Reserved — emitted by the semantics module, never by this package.
26
+ */
27
+ EDGE_OPERATOR_UNSUPPORTED: "EDGE_OPERATOR_UNSUPPORTED",
28
+ /**
29
+ * A label was authored on a `-.-` reference edge. Per §5.2 reference
30
+ * edges carry no parameter/channel meaning so a label "would not mean
31
+ * anything"; the label is ignored. Warn tier.
32
+ *
33
+ * Reserved — emitted by the semantics module, never by this package.
34
+ */
35
+ REFERENCE_EDGE_LABEL_REJECTED: "REFERENCE_EDGE_LABEL_REJECTED",
36
+ /**
37
+ * A `connectorRef` value's prefix (or whole bare-id form) doesn't
38
+ * resolve to a declared `connector`. Per §8.1. Warn-only pre-1.0;
39
+ * error from v1.0.
40
+ *
41
+ * Reserved — emitted by the semantics module, never by this package.
42
+ */
43
+ CONNECTOR_REF_UNRESOLVED: "CONNECTOR_REF_UNRESOLVED",
44
+ /**
45
+ * A `connectorRef` value resolves to an id that exists but isn't a
46
+ * connector declaration (it's a vertex, flow, etc.). Per §8.1
47
+ * connectors must be declared with the `connector` keyword. Warn pre-
48
+ * 1.0; error from v1.0.
49
+ *
50
+ * Reserved — emitted by the semantics module, never by this package.
51
+ */
52
+ CONNECTOR_REF_NOT_A_CONNECTOR: "CONNECTOR_REF_NOT_A_CONNECTOR",
53
+ /**
54
+ * A known domain metadata key appears on an element kind it isn't
55
+ * declared for per the §10 applicability table (e.g. `params` on a
56
+ * `refdoc`, or `protocol` on a `flow`). Universal keys (`description`,
57
+ * `instruction`, plus structural and presentation controls) are
58
+ * excluded. Warn pre-1.0; error from v1.0.
59
+ *
60
+ * Reserved — emitted by the semantics module, never by this package.
61
+ */
62
+ METADATA_KEY_MISAPPLIED: "METADATA_KEY_MISAPPLIED",
63
+ /**
64
+ * Two declarations in the node-or-container namespace (§9) share an
65
+ * id — e.g. two `a["..."]` vertex declarations, or a vertex and a
66
+ * container with the same id. Implicit vertices created by edge
67
+ * resolution do not count as declarations. Warn-only pre-1.0; error
68
+ * from v1.0 behind `agentflow.strictIds`.
69
+ *
70
+ * Reserved — emitted by the semantics module, never by this package.
71
+ */
72
+ DUPLICATE_ID_NODE: "DUPLICATE_ID_NODE",
73
+ /**
74
+ * An author declared an id reserved for synthetic renderer output.
75
+ * v0.8.1 keeps `connectors` reserved through pre-1.0 even though the
76
+ * real `connector` keyword removes the synthesised group; reservation
77
+ * stays for forward compat. Warn-only.
78
+ *
79
+ * Reserved — emitted by the semantics module, never by this package.
80
+ */
81
+ RESERVED_SYNTHETIC_ID: "RESERVED_SYNTHETIC_ID",
82
+ /**
83
+ * A container's child violates the §3.3 containment matrix. In v0.8.1
84
+ * the matrix is trivial — only `flow` is a container, and it accepts
85
+ * nested `flow` plus any node. Warn-only pre-1.0; error from v1.0
86
+ * behind `agentflow.strictContainment`.
87
+ */
88
+ CONTAINMENT_VIOLATION: "CONTAINMENT_VIOLATION",
89
+ /**
90
+ * An edge's §5.1 semantic is incompatible with the kinds of its
91
+ * endpoints. v0.8.1 covers two cases:
92
+ *
93
+ * - A `-.-` reference edge has no `refdoc`-shape endpoint (the only
94
+ * meaningful target for §16.2 reference-document attachment).
95
+ * - A `--x` failure edge originates from a non-flow endpoint.
96
+ *
97
+ * Warn-only pre-1.0; error from v1.0 behind the future
98
+ * `agentflow.strictEdgeSemantics` flag.
99
+ *
100
+ * Reserved — emitted by the semantics module, never by this package.
101
+ */
102
+ EDGE_SEMANTIC_CONTRADICTION: "EDGE_SEMANTIC_CONTRADICTION",
103
+ /**
104
+ * A `flow` container's tree contains no input node (`shape: input`,
105
+ * canonical `lean-right`). Per §10.2 a flow must declare its required
106
+ * inputs; the runtime / editor prompts the user for any missing
107
+ * values. Warn pre-1.0; error from v1.0.
108
+ *
109
+ * Reserved — emitted by the semantics module, never by this package.
110
+ */
111
+ FLOW_NO_INPUT: "FLOW_NO_INPUT"
112
+ }, j1 = /* @__PURE__ */ new Set([
113
+ tt.SHAPE_UNSUPPORTED,
114
+ tt.SHAPE_REMOVED,
115
+ tt.CONTAINMENT_VIOLATION
116
+ ]);
117
+ new Set(
118
+ Object.values(tt).filter(
119
+ (s) => !j1.has(s)
120
+ )
121
+ );
122
+ var z1 = /* @__PURE__ */ new Map([
123
+ ["task", "roundedRect"],
124
+ ["tool", "subroutine"],
125
+ ["input", "lean-right"],
126
+ ["decision", "diamond"],
127
+ ["refdoc", "lin-doc"],
128
+ ["action", "hexagon"],
129
+ ["round", "rect"]
130
+ ]), W1 = /* @__PURE__ */ new Set([
131
+ "doc",
132
+ "stadium",
133
+ "terminal",
134
+ "circle",
135
+ "trapezoid",
136
+ "inv_trapezoid",
137
+ "inv-trapezoid",
138
+ "doublecircle",
139
+ "double-circle",
140
+ "typeDeclaration",
141
+ "procs",
142
+ "lean_left",
143
+ "lean-left",
144
+ "in-out",
145
+ "cylinder",
146
+ "ellipse",
147
+ "odd",
148
+ // Instance shapes — instancing mechanism removed entirely.
149
+ "tag-rect",
150
+ "tagged-rectangle",
151
+ "delay",
152
+ "half-rounded-rectangle",
153
+ "lin-rect",
154
+ "lined-rectangle",
155
+ "win-pane",
156
+ "window-pane",
157
+ "curv-trap",
158
+ "curved-trapezoid"
159
+ ]), K1 = /* @__PURE__ */ new Set([
160
+ "roundedRect",
161
+ "subroutine",
162
+ "subprocess",
163
+ "subproc",
164
+ "framed-rectangle",
165
+ "lean-right",
166
+ "diamond",
167
+ "lin-doc",
168
+ "lined-document",
169
+ "hexagon",
170
+ "hex",
171
+ "connector",
172
+ // Collapsed flow container
173
+ "collapsedGroup"
174
+ ]), $e = "roundedRect";
175
+ function et(s) {
176
+ return s && (z1.get(s) ?? s);
177
+ }
178
+ k(et, "resolveShapeAlias");
179
+ function r1(s, i) {
180
+ for (const n of s)
181
+ if (!n.isGroup) {
182
+ if ((!n.shape || n.shape === "squareRect" || n.shape === "rect") && (n.shape = $e), W1.has(n.shape)) {
183
+ const r = `shape "${n.shape}" was removed in v0.8.1, using "${$e}"`;
184
+ i?.emitError ? i.emitError("SHAPE_REMOVED", r, { nodeId: n.id }) : oe.warn(`agentflow: ${r}`), n.shape = $e;
185
+ continue;
186
+ }
187
+ if (!K1.has(n.shape)) {
188
+ const r = `shape "${n.shape}" is not supported, using "${$e}"`;
189
+ i?.emitWarning ? i.emitWarning("SHAPE_UNSUPPORTED", r, { nodeId: n.id }) : oe.warn(`agentflow: ${r}`), n.shape = $e;
190
+ }
191
+ }
192
+ }
193
+ k(r1, "normaliseNodeShapes");
194
+ var Lt = /* @__PURE__ */ new Map([
195
+ ["tool", 0],
196
+ ["task", 1],
197
+ ["decision", 2],
198
+ ["input", 3],
199
+ ["refdoc", 4],
200
+ ["connector", 5],
201
+ ["action", 6]
202
+ ]), a1 = Lt.size, o1 = /* @__PURE__ */ k((s) => `af-kind-${s}`, "kindClass"), H1 = [...Lt.keys()], u1 = /* @__PURE__ */ k((s) => Math.max(1, s - a1), "containerSlotCount"), l1 = /* @__PURE__ */ k((s, i) => {
203
+ const n = a1 + s % u1(i);
204
+ return i > 0 ? n % i : n;
205
+ }, "containerSlot");
206
+ function c1(s, i, n) {
207
+ const r = Ce().themeVariables?.borderColorArray, u = Array.isArray(r) ? r.length : 0;
208
+ let l = n.size;
209
+ for (const c of s ?? []) {
210
+ if (c.isGroup || c.shape === "collapsedGroup") {
211
+ const h = n.get(String(c.id)) ?? l++;
212
+ c.colorIndex = l1(h, u);
213
+ continue;
214
+ }
215
+ const a = i(String(c.id));
216
+ a && Lt.has(a) && (c.cssClasses = `${c.cssClasses ?? ""} ${o1(a)}`.replace(/\s+/g, " ").trim());
217
+ }
218
+ }
219
+ k(c1, "assignColorSlots");
220
+ var n1 = "agentflow-", Pt = /* @__PURE__ */ new Set([
221
+ "shape",
222
+ "view",
223
+ "icon",
224
+ "img",
225
+ "form",
226
+ "pos",
227
+ "w",
228
+ "h",
229
+ "class",
230
+ "style",
231
+ "labelType"
232
+ ]), Y1 = /* @__PURE__ */ new Set([
233
+ "subroutine",
234
+ "subprocess",
235
+ "subproc",
236
+ "framed-rectangle",
237
+ "tool"
238
+ ]), q1 = {
239
+ flow: "flowGroup"
240
+ };
241
+ function It(s) {
242
+ if (Array.isArray(s))
243
+ return s.map((n) => It(n));
244
+ if (s === null || typeof s != "object")
245
+ return s;
246
+ const i = {};
247
+ for (const n of Object.keys(s))
248
+ n === "__proto__" || n === "constructor" || n === "prototype" || (i[n] = It(s[n]));
249
+ return i;
250
+ }
251
+ k(It, "stripPrototypeKeys");
252
+ function d1(s) {
253
+ let i = !1, n = !1, r = 0, u;
254
+ const l = [];
255
+ for (const c of s.split(`
256
+ `)) {
257
+ if (u !== void 0) {
258
+ const p = c.length - c.trimStart().length;
259
+ if (c.trim() === "" || p > u) {
260
+ l.push(c);
261
+ continue;
262
+ }
263
+ u = void 0;
264
+ }
265
+ let a = -1;
266
+ for (let p = 0; p < c.length; p++) {
267
+ const A = c[p];
268
+ if (n)
269
+ A === "\\" ? p++ : A === '"' && (n = !1);
270
+ else if (i)
271
+ A === "'" && (i = !1);
272
+ else if (A === '"')
273
+ n = !0;
274
+ else if (A === "'")
275
+ i = !0;
276
+ else if (A === "#" && (p === 0 || c[p - 1] === " " || c[p - 1] === " ")) {
277
+ a = p;
278
+ break;
279
+ } else A === "[" || A === "{" ? r++ : (A === "]" || A === "}") && (r = Math.max(0, r - 1));
280
+ }
281
+ if (i || n || r > 0) {
282
+ l.push(c);
283
+ continue;
284
+ }
285
+ const h = a >= 0 ? c.slice(0, a) : c, g = a >= 0 ? c.slice(a) : "";
286
+ if (/:\s*[>|][\d+-]*\s*$/.test(h)) {
287
+ u = c.length - c.trimStart().length, l.push(c);
288
+ continue;
289
+ }
290
+ l.push(h.replace(/,([\t ]*)$/, "$1") + g);
291
+ }
292
+ return l.join(`
293
+ `);
294
+ }
295
+ k(d1, "stripLineTrailingCommas");
296
+ var Ze, X1 = (Ze = class {
297
+ // cspell:ignore funs
298
+ constructor() {
299
+ this.vertexCounter = 0, this.config = Ce(), this.vertices = /* @__PURE__ */ new Map(), this.edges = [], this.classes = /* @__PURE__ */ new Map(), this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.globalNodes = /* @__PURE__ */ new Set(), this.connectors = /* @__PURE__ */ new Map(), this.tooltips = /* @__PURE__ */ new Map(), this.subCount = 0, this.firstGraphFlag = !0, this.secCount = -1, this.posCrossRef = [], this.diagramId = "", this.preserveCommentsWhenParsing = !0, this.frontmatterLineOffset = 0, this.elementMappings = [], this.bareVertexMappings = /* @__PURE__ */ new WeakSet(), this.diagnostics = [], this.postParseValidationRun = !1, this.funs = [], this.setAccTitle = T1, this.setAccDescription = D1, this.setDiagramTitle = _1, this.getAccTitle = v1, this.getAccDescription = F1, this.getDiagramTitle = V1, this.funs.push(this.setupToolTips.bind(this)), this.addVertex = this.addVertex.bind(this), this.firstGraph = this.firstGraph.bind(this), this.setDirection = this.setDirection.bind(this), this.addSubGraph = this.addSubGraph.bind(this), this.addGlobal = this.addGlobal.bind(this), this.addConnector = this.addConnector.bind(this), this.addConnectorMapping = this.addConnectorMapping.bind(this), this.addLink = this.addLink.bind(this), this.setLink = this.setLink.bind(this), this.updateLink = this.updateLink.bind(this), this.addClass = this.addClass.bind(this), this.setClass = this.setClass.bind(this), this.destructLink = this.destructLink.bind(this), this.setClickEvent = this.setClickEvent.bind(this), this.setTooltip = this.setTooltip.bind(this), this.updateLinkInterpolate = this.updateLinkInterpolate.bind(this), this.setClickFun = this.setClickFun.bind(this), this.bindFunctions = this.bindFunctions.bind(this), this.setFrontmatterLineOffset = this.setFrontmatterLineOffset.bind(this), this.addVertexMapping = this.addVertexMapping.bind(this), this.extendVertexMapping = this.extendVertexMapping.bind(this), this.addEdgeMapping = this.addEdgeMapping.bind(this), this.addSubgraphMapping = this.addSubgraphMapping.bind(this), this.emitWarning = this.emitWarning.bind(this), this.emitError = this.emitError.bind(this), this.getDiagnostics = this.getDiagnostics.bind(this), this.lex = {
300
+ firstGraph: this.firstGraph.bind(this)
301
+ }, this.clear(), this.setGen("gen-2");
302
+ }
303
+ sanitizeText(i) {
304
+ return I1.sanitizeText(i, this.config);
305
+ }
306
+ sanitizeNodeLabelType(i) {
307
+ switch (i) {
308
+ case "markdown":
309
+ case "string":
310
+ case "text":
311
+ return i;
312
+ default:
313
+ return "markdown";
314
+ }
315
+ }
316
+ /**
317
+ * Sets the diagram's SVG element ID, used to prefix domIds for uniqueness
318
+ * across multiple diagrams on the same page.
319
+ */
320
+ setDiagramId(i) {
321
+ this.diagramId = i;
322
+ }
323
+ /**
324
+ * Function to lookup domId from id in the graph definition.
325
+ * When diagramId is set, returns the prefixed version for DOM uniqueness.
326
+ *
327
+ * @param id - id of the node
328
+ */
329
+ lookUpDomId(i) {
330
+ for (const n of this.vertices.values())
331
+ if (n.id === i)
332
+ return this.diagramId ? `${this.diagramId}-${n.domId}` : n.domId;
333
+ return this.diagramId ? `${this.diagramId}-${i}` : i;
334
+ }
335
+ /**
336
+ * Function called by parser when a node definition has been found
337
+ */
338
+ addVertex(i, n, r, u, l, c, a = {}, h, g) {
339
+ if (!i || i.trim().length === 0)
340
+ return;
341
+ let p;
342
+ if (h !== void 0) {
343
+ let m;
344
+ h.includes(`
345
+ `) ? m = h + `
346
+ ` : m = `{
347
+ ` + h + `
348
+ }`;
349
+ try {
350
+ p = s1(m, { schema: i1 }) ?? {};
351
+ } catch (d) {
352
+ const f = h.includes(`
353
+ `) ? d1(h) : h;
354
+ if (f !== h)
355
+ try {
356
+ p = s1(f + `
357
+ `, { schema: i1 }) ?? {};
358
+ } catch {
359
+ this.rethrowMetadataYamlError(d, h, g);
360
+ }
361
+ else
362
+ this.rethrowMetadataYamlError(d, h, g);
363
+ }
364
+ p = It(p);
365
+ }
366
+ let A;
367
+ if (p && typeof p.shape == "string") {
368
+ const m = p;
369
+ A = m.shape;
370
+ const d = et(A);
371
+ d && d !== A && (m.shape = d);
372
+ }
373
+ const x = this.subGraphLookup.get(i);
374
+ if (x && p) {
375
+ x.metadata = { ...x.metadata, ...p };
376
+ return;
377
+ }
378
+ const L = this.connectors.get(i);
379
+ if (L && p) {
380
+ L.metadata = {
381
+ ...L.metadata,
382
+ ...p
383
+ };
384
+ return;
385
+ }
386
+ if (i === "connectors")
387
+ return;
388
+ const C = this.edges.find((m) => m.id === i);
389
+ if (C) {
390
+ const m = p;
391
+ m?.animate !== void 0 && (C.animate = m.animate), m?.animation !== void 0 && (C.animation = m.animation), m?.curve !== void 0 && (C.interpolate = m.curve), p && (C.metadata = { ...C.metadata, ...p });
392
+ return;
393
+ }
394
+ let M, T = this.vertices.get(i);
395
+ if (T === void 0 && (T = {
396
+ id: i,
397
+ labelType: "text",
398
+ domId: n1 + i + "-" + this.vertexCounter,
399
+ styles: [],
400
+ classes: []
401
+ }, this.vertices.set(i, T)), this.vertexCounter++, n !== void 0 ? (this.config = Ce(), M = this.sanitizeText(n.text.trim()), T.labelType = n.type, M.startsWith('"') && M.endsWith('"') && (M = M.substring(1, M.length - 1)), T.text = M) : T.text === void 0 && (T.text = i), r !== void 0 && (T.type = r), u?.forEach((m) => {
402
+ T.styles.push(m);
403
+ }), l?.forEach((m) => {
404
+ T.classes.push(m);
405
+ }), c !== void 0 && (T.dir = c), T.props === void 0 ? T.props = a : a !== void 0 && Object.assign(T.props, a), p) {
406
+ if (T.metadata = { ...T.metadata, ...p }, p.shape) {
407
+ const m = A ?? p.shape;
408
+ if (typeof m != "string")
409
+ throw this.positionedShapeError(
410
+ `No such shape: ${JSON.stringify(m)}.`,
411
+ g
412
+ );
413
+ if (m !== m.toLowerCase() || m.includes("_"))
414
+ throw this.positionedShapeError(
415
+ `No such shape: ${m}. Shape names should be lowercase.`,
416
+ g
417
+ );
418
+ if (!L1(p.shape))
419
+ throw this.positionedShapeError(`No such shape: ${p.shape}.`, g);
420
+ T.type = p?.shape;
421
+ }
422
+ p?.label && (T.text = this.sanitizeText(p.label), T.labelType = this.sanitizeNodeLabelType(p?.labelType));
423
+ }
424
+ }
425
+ /**
426
+ * Translate a js-yaml failure raised while parsing an `<id>@{ ... }` block
427
+ * from block-relative coordinates into absolute source coordinates, then
428
+ * rethrow (issue #56 part 2).
429
+ *
430
+ * js-yaml's `mark.line` / `mark.column` (and the `(R:C)` reference plus the
431
+ * `N |` excerpt prefixes baked into `message`) count from the start of the
432
+ * block buffer the DB hands it — either the synthetic `{\n … \n}` wrapper
433
+ * (single-line `@{ … }`) or the verbatim multi-line body. Neither matches
434
+ * the line the user sees. Using the `shapeData` symbol's JISON location
435
+ * (`@{`'s position) plus the frontmatter offset, we map the reported
436
+ * coordinate back to source space, rewrite the message's `(R:C)` and excerpt
437
+ * prefixes, update `mark`, and attach a JISON-style `hash.loc` so downstream
438
+ * tooling can read source coordinates structurally instead of re-deriving
439
+ * them from the buffer.
440
+ *
441
+ * Defensive: if the error isn't a positioned js-yaml exception, or we lack
442
+ * the block location, the original error propagates untouched — translation
443
+ * never makes a failure harder to read than it already was.
444
+ */
445
+ /**
446
+ * Build a shape error carrying a JISON-shaped `hash.loc`, so the position is
447
+ * readable structurally rather than only as prose. Mirrors what
448
+ * `rethrowMetadataYamlError` attaches for YAML failures.
449
+ */
450
+ positionedShapeError(i, n) {
451
+ const r = new Error(i);
452
+ if (!n)
453
+ return r;
454
+ const u = n.first_line + this.frontmatterLineOffset;
455
+ return Object.assign(r, {
456
+ hash: {
457
+ text: "",
458
+ token: null,
459
+ line: u - 1,
460
+ loc: {
461
+ first_line: u,
462
+ last_line: n.last_line + this.frontmatterLineOffset,
463
+ first_column: n.first_column,
464
+ last_column: n.last_column
465
+ },
466
+ expected: []
467
+ }
468
+ }), r;
469
+ }
470
+ rethrowMetadataYamlError(i, n, r) {
471
+ const u = i;
472
+ if (!u || u.name !== "YAMLException" || !u.mark || !r)
473
+ throw i;
474
+ let l;
475
+ try {
476
+ const c = !n.includes(`
477
+ `), a = c ? `{
478
+ ` + n + `
479
+ }` : n + `
480
+ `, h = r.first_line + this.frontmatterLineOffset, g = r.first_column + 2, p = /* @__PURE__ */ k((m, d) => c ? { line: h, column: g + (m === 1 ? d : 0) } : {
481
+ line: h + m,
482
+ column: m === 0 ? g + d : d
483
+ }, "toSource"), A = p(u.mark.line, u.mark.column), x = u.reason ?? (u.message ?? "").split(`
484
+ `)[0].replace(/\s*\(\d+:\d+\)\s*$/, ""), L = a.split(`
485
+ `), C = [];
486
+ if (c)
487
+ C.push(1);
488
+ else
489
+ for (let m = u.mark.line - 1; m <= u.mark.line + 1; m++)
490
+ m < 0 || m >= L.length || m === L.length - 1 && L[m] === "" && m !== u.mark.line || C.push(m);
491
+ const M = Math.max(...C.map((m) => String(p(m, 0).line).length)), T = [];
492
+ for (const m of C) {
493
+ const d = p(m, 0).line, f = ` ${String(d).padStart(M)} | `;
494
+ T.push(f + L[m].replace(/\t/g, "→")), m === u.mark.line && T.push("-".repeat(f.length + u.mark.column) + "^");
495
+ }
496
+ l = {
497
+ message: `${x} (${A.line}:${A.column + 1})
498
+
499
+ ${T.join(`
500
+ `)}`,
501
+ markLine: A.line - 1,
502
+ markColumn: A.column,
503
+ // JISON-style hash so editors can consume source coordinates directly.
504
+ hash: {
505
+ text: "",
506
+ token: null,
507
+ line: A.line - 1,
508
+ loc: {
509
+ first_line: A.line,
510
+ last_line: A.line,
511
+ first_column: A.column,
512
+ last_column: A.column + 1
513
+ },
514
+ expected: []
515
+ }
516
+ };
517
+ } catch {
518
+ }
519
+ throw l && (u.message = l.message, u.mark.line = l.markLine, u.mark.column = l.markColumn, u.hash = l.hash), u;
520
+ }
521
+ /**
522
+ * Function called by parser when a link/edge definition has been found
523
+ *
524
+ */
525
+ addSingleLink(i, n, r, u) {
526
+ const a = {
527
+ start: i,
528
+ end: n,
529
+ type: void 0,
530
+ text: "",
531
+ labelType: "text",
532
+ classes: [],
533
+ isUserDefinedId: !1,
534
+ interpolate: this.edges.defaultInterpolate
535
+ };
536
+ oe.info("abc78 Got edge...", a);
537
+ const h = r.text;
538
+ if (h !== void 0 && (a.text = this.sanitizeText(h.text.trim()), a.text.startsWith('"') && a.text.endsWith('"') && (a.text = a.text.substring(1, a.text.length - 1)), a.labelType = this.sanitizeNodeLabelType(h.type)), r !== void 0 && (a.type = r.type, a.stroke = r.stroke, a.length = r.length > 10 ? 10 : r.length, r.edgeSemantic && (a.edgeSemantic = r.edgeSemantic)), u && !this.edges.some((g) => g.id === u))
539
+ a.id = u, a.isUserDefinedId = !0;
540
+ else {
541
+ const g = this.edges.filter((p) => p.start === a.start && p.end === a.end);
542
+ g.length === 0 ? a.id = Rt(a.start, a.end, { counter: 0, prefix: "L" }) : a.id = Rt(a.start, a.end, {
543
+ counter: g.length + 1,
544
+ prefix: "L"
545
+ });
546
+ }
547
+ if (this.edges.length < (this.config.maxEdges ?? 500))
548
+ oe.info("Pushing edge..."), this.edges.push(a);
549
+ else
550
+ throw new Error(
551
+ `Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
552
+
553
+ Initialize mermaid with maxEdges set to a higher number to allow more edges.
554
+ You cannot set this config via configuration inside the diagram as it is a secure config.
555
+ You have to call mermaid.initialize.`
556
+ );
557
+ }
558
+ isLinkData(i) {
559
+ return i !== null && typeof i == "object" && "id" in i && typeof i.id == "string";
560
+ }
561
+ addLink(i, n, r) {
562
+ const u = this.isLinkData(r) ? r.id.replace("@", "") : void 0;
563
+ oe.info("addLink", i, n, u);
564
+ for (const l of i)
565
+ for (const c of n) {
566
+ const a = l === i[i.length - 1], h = c === n[0];
567
+ a && h ? this.addSingleLink(l, c, r, u) : this.addSingleLink(l, c, r, void 0);
568
+ }
569
+ }
570
+ /**
571
+ * Updates a link's line interpolation algorithm
572
+ */
573
+ updateLinkInterpolate(i, n) {
574
+ i.forEach((r) => {
575
+ if (r === "default") {
576
+ this.edges.defaultInterpolate = n;
577
+ return;
578
+ }
579
+ if (typeof r == "number" && r >= this.edges.length)
580
+ throw new Error(
581
+ `The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)`
582
+ );
583
+ this.edges[r].interpolate = n;
584
+ });
585
+ }
586
+ /**
587
+ * Updates a link with a style
588
+ *
589
+ */
590
+ updateLink(i, n) {
591
+ i.forEach((r) => {
592
+ if (typeof r == "number" && r >= this.edges.length)
593
+ throw new Error(
594
+ `The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)`
595
+ );
596
+ r === "default" ? this.edges.defaultStyle = n : (this.edges[r].style = n, (this.edges[r]?.style?.length ?? 0) > 0 && !this.edges[r]?.style?.some((u) => u?.startsWith("fill")) && this.edges[r]?.style?.push("fill:none"));
597
+ });
598
+ }
599
+ addClass(i, n) {
600
+ const r = n.join().replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
601
+ i.split(",").forEach((u) => {
602
+ let l = this.classes.get(u);
603
+ l === void 0 && (l = { id: u, styles: [], textStyles: [] }, this.classes.set(u, l)), r?.forEach((c) => {
604
+ if (/color/.exec(c)) {
605
+ const a = c.replace("fill", "bgFill");
606
+ l.textStyles.push(a);
607
+ }
608
+ l.styles.push(c);
609
+ });
610
+ });
611
+ }
612
+ /**
613
+ * Called by parser when a graph definition is found, stores the direction of the chart.
614
+ *
615
+ */
616
+ setDirection(i) {
617
+ this.direction = i.trim(), /.*</.exec(this.direction) && (this.direction = "RL"), /.*\^/.exec(this.direction) && (this.direction = "BT"), /.*>/.exec(this.direction) && (this.direction = "LR"), /.*v/.exec(this.direction) && (this.direction = "TB"), this.direction === "TD" && (this.direction = "TB");
618
+ }
619
+ /**
620
+ * Called by parser when a special node is found, e.g. a clickable element.
621
+ *
622
+ * @param ids - Comma separated list of ids
623
+ * @param className - Class to add
624
+ */
625
+ setClass(i, n) {
626
+ for (const r of i.split(",")) {
627
+ const u = this.vertices.get(r);
628
+ u && u.classes.push(n);
629
+ const l = this.edges.find((a) => a.id === r);
630
+ l && l.classes.push(n);
631
+ const c = this.subGraphLookup.get(r);
632
+ c && c.classes.push(n);
633
+ }
634
+ }
635
+ setTooltip(i, n) {
636
+ if (n !== void 0) {
637
+ n = this.sanitizeText(n);
638
+ for (const r of i.split(","))
639
+ this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(r) : r, n);
640
+ }
641
+ }
642
+ setClickFun(i, n, r) {
643
+ if (Ce().securityLevel !== "loose" || n === void 0)
644
+ return;
645
+ let u = [];
646
+ if (typeof r == "string") {
647
+ u = r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
648
+ for (let c = 0; c < u.length; c++) {
649
+ let a = u[c].trim();
650
+ a.startsWith('"') && a.endsWith('"') && (a = a.substr(1, a.length - 2)), u[c] = a;
651
+ }
652
+ }
653
+ u.length === 0 && u.push(i);
654
+ const l = this.vertices.get(i);
655
+ l && (l.haveCallback = !0, this.funs.push(() => {
656
+ const c = this.lookUpDomId(i), a = document.querySelector(`[id="${c}"]`);
657
+ a !== null && a.addEventListener(
658
+ "click",
659
+ () => {
660
+ Gt.runFunc(n, ...u);
661
+ },
662
+ !1
663
+ );
664
+ }));
665
+ }
666
+ /**
667
+ * Called by parser when a link is found. Adds the URL to the vertex data.
668
+ *
669
+ * @param ids - Comma separated list of ids
670
+ * @param linkStr - URL to create a link for
671
+ * @param target - Target attribute for the link
672
+ */
673
+ setLink(i, n, r) {
674
+ i.split(",").forEach((u) => {
675
+ const l = this.vertices.get(u);
676
+ l !== void 0 && (l.link = Gt.formatUrl(n, this.config), l.linkTarget = r);
677
+ }), this.setClass(i, "clickable");
678
+ }
679
+ getTooltip(i) {
680
+ return this.tooltips.get(i);
681
+ }
682
+ /**
683
+ * Called by parser when a click definition is found. Registers an event handler.
684
+ *
685
+ * @param ids - Comma separated list of ids
686
+ * @param functionName - Function to be called on click
687
+ * @param functionArgs - Arguments to be passed to the function
688
+ */
689
+ setClickEvent(i, n, r) {
690
+ i.split(",").forEach((u) => {
691
+ this.setClickFun(u, n, r);
692
+ }), this.setClass(i, "clickable");
693
+ }
694
+ bindFunctions(i) {
695
+ this.funs.forEach((n) => {
696
+ n(i);
697
+ });
698
+ }
699
+ getDirection() {
700
+ return this.direction?.trim();
701
+ }
702
+ /**
703
+ * Retrieval function for fetching the found nodes after parsing has completed.
704
+ *
705
+ */
706
+ getVertices() {
707
+ return this.vertices;
708
+ }
709
+ /**
710
+ * Retrieval function for fetching the found links after parsing has completed.
711
+ *
712
+ */
713
+ getEdges() {
714
+ return this.edges;
715
+ }
716
+ /**
717
+ * Returns true when `vertex` is a **tool definition** per
718
+ * the agentflow syntax specification §8 — its resolved shape is `subroutine` or one
719
+ * of the accepted aliases (`subprocess`, `subproc`, `framed-rectangle`).
720
+ *
721
+ * This is the source of truth for "is this a tool?" — there is no
722
+ * separate kind tag stored on the vertex; tool-ness is derived from
723
+ * shape on every check. Downstream consumers reading the semantic model
724
+ * see this surfaced as `vertexKind: 'tool'` (see `getSemanticModel`).
725
+ */
726
+ isToolDefinition(i) {
727
+ return Y1.has(i.type);
728
+ }
729
+ /**
730
+ * Returns every vertex that is a tool definition (per `isToolDefinition`).
731
+ * Derived view; not cached.
732
+ */
733
+ getTools() {
734
+ const i = [];
735
+ for (const n of this.vertices.values())
736
+ this.isToolDefinition(n) && i.push(n);
737
+ return i;
738
+ }
739
+ /**
740
+ * Retrieval function for fetching the found class definitions after parsing has completed.
741
+ *
742
+ */
743
+ getClasses() {
744
+ return this.classes;
745
+ }
746
+ setupToolTips(i) {
747
+ const n = G1();
748
+ Ot(i).select("svg").selectAll("g.node").on("mouseover", (l) => {
749
+ const c = Ot(l.currentTarget), a = c.attr("title");
750
+ if (a === null)
751
+ return;
752
+ const h = l.currentTarget?.getBoundingClientRect();
753
+ n.transition().duration(200).style("opacity", ".9"), n.text(c.attr("title")).style("left", window.scrollX + h.left + (h.right - h.left) / 2 + "px").style("top", window.scrollY + h.bottom + "px"), n.html(B1.sanitize(a)), c.classed("hover", !0);
754
+ }).on("mouseout", (l) => {
755
+ n.transition().duration(500).style("opacity", 0), Ot(l.currentTarget).classed("hover", !1);
756
+ });
757
+ }
758
+ /**
759
+ * Clears the internal graph db so that a new graph can be parsed.
760
+ *
761
+ */
762
+ clear(i = "gen-2") {
763
+ this.vertices = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.edges = [], this.funs = [this.setupToolTips.bind(this)], this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.globalNodes = /* @__PURE__ */ new Set(), this.connectors = /* @__PURE__ */ new Map(), this.subCount = 0, this.tooltips = /* @__PURE__ */ new Map(), this.firstGraphFlag = !0, this.version = i, this.config = Ce(), this.diagramId = "", this.vertexCounter = 0, this.direction = void 0, this.secCount = -1, this.posCrossRef = [], this.frontmatterLineOffset = 0, this.elementMappings = [], this.bareVertexMappings = /* @__PURE__ */ new WeakSet(), this.diagnostics = [], this.postParseValidationRun = !1, M1();
764
+ }
765
+ setGen(i) {
766
+ this.version = i || "gen-2";
767
+ }
768
+ /**
769
+ * Legacy `linkStyle default` colours, byte-identical to `flowDb`. Hardcoded
770
+ * rather than theme-derived on purpose: nothing in the repo calls this, and
771
+ * changing the values would diverge from flowchart for no visible gain.
772
+ */
773
+ defaultStyle() {
774
+ return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
775
+ }
776
+ addSubGraph(i, n, r, u) {
777
+ let l = i?.text?.trim(), c = r?.text;
778
+ i === r && r?.text && /\s/.exec(r.text) && (l = void 0);
779
+ const h = (/* @__PURE__ */ k((C) => {
780
+ const M = { boolean: {}, number: {}, string: {} }, T = [];
781
+ let m;
782
+ return { nodeList: C.filter(function(f) {
783
+ const B = typeof f;
784
+ return f.stmt && f.stmt === "dir" ? (m = f.value, !1) : f.trim() === "" ? !1 : B in M ? M[B].hasOwnProperty(f) ? !1 : M[B][f] = !0 : T.includes(f) ? !1 : T.push(f);
785
+ }), dir: m };
786
+ }, "uniq"))(n.flat()), g = h.nodeList;
787
+ let p = h.dir;
788
+ const A = Ce().flowchart ?? {};
789
+ if (p = p ?? (A.inheritDir ? this.getDirection() ?? Ce().direction ?? void 0 : void 0), this.version === "gen-1")
790
+ for (let C = 0; C < g.length; C++)
791
+ g[C] = this.lookUpDomId(g[C]);
792
+ l = l ?? "subGraph" + this.subCount, c = c || "", c = this.sanitizeText(c), this.subCount = this.subCount + 1;
793
+ const x = {
794
+ id: l,
795
+ // A subgraph is never a member of itself. In-block edge endpoints are
796
+ // folded into the member list, so `a --> myFlow` written inside
797
+ // `flow myFlow … end` would otherwise make the flow its own member and
798
+ // self-parent, crashing the renderer with graphlib's "would create a
799
+ // cycle" (issue #70). Globally scoped nodes (`global … end`, issue #80)
800
+ // are exempt from membership the same way — referencing one inside a
801
+ // flow must not adopt it.
802
+ nodes: g.filter((C) => C !== l && !this.globalNodes.has(C)),
803
+ title: c.trim(),
804
+ classes: [],
805
+ dir: p,
806
+ labelType: this.sanitizeNodeLabelType(r?.type),
807
+ type: u ?? "flow"
808
+ };
809
+ oe.info("Adding", x.id, x.nodes, x.dir), x.nodes = this.makeUniq(x, this.subGraphs).nodes;
810
+ const L = this.getPosForId(l);
811
+ if (L !== -1) {
812
+ const C = this.subGraphs[L];
813
+ for (const M of x.nodes)
814
+ C.nodes.includes(M) || C.nodes.push(M);
815
+ x.title && (C.title = x.title), x.dir && (C.dir = x.dir), x.type && (C.type = x.type), this.subGraphLookup.set(l, C);
816
+ } else
817
+ this.subGraphs.push(x), this.subGraphLookup.set(l, x);
818
+ return l;
819
+ }
820
+ /**
821
+ * Registers every node id that appears inside a `global … end` block as
822
+ * globally scoped (issue #80): the node keeps no parent even when it is
823
+ * referenced inside a `flow … end` block, opting out of the textual
824
+ * membership rule that would otherwise pull it in. Edges declared inside
825
+ * the block are ordinary top-level edges — only the membership exemption
826
+ * is recorded here, and no container is emitted for the block.
827
+ */
828
+ addGlobal(i) {
829
+ for (const n of i.flat()) {
830
+ if (typeof n != "string")
831
+ continue;
832
+ const r = n.trim();
833
+ r !== "" && this.globalNodes.add(r);
834
+ }
835
+ for (const n of this.subGraphs)
836
+ n.nodes = n.nodes.filter((r) => !this.globalNodes.has(r));
837
+ }
838
+ getPosForId(i) {
839
+ for (const [n, r] of this.subGraphs.entries())
840
+ if (r.id === i)
841
+ return n;
842
+ return -1;
843
+ }
844
+ indexNodes2(i, n) {
845
+ const r = this.subGraphs[n].nodes;
846
+ if (this.secCount = this.secCount + 1, this.secCount > 2e3)
847
+ return {
848
+ result: !1,
849
+ count: 0
850
+ };
851
+ if (this.posCrossRef[this.secCount] = n, this.subGraphs[n].id === i)
852
+ return {
853
+ result: !0,
854
+ count: 0
855
+ };
856
+ let u = 0, l = 1;
857
+ for (; u < r.length; ) {
858
+ const c = this.getPosForId(r[u]);
859
+ if (c >= 0) {
860
+ const a = this.indexNodes2(i, c);
861
+ if (a.result)
862
+ return {
863
+ result: !0,
864
+ count: l + a.count
865
+ };
866
+ l = l + a.count;
867
+ }
868
+ u = u + 1;
869
+ }
870
+ return {
871
+ result: !1,
872
+ count: l
873
+ };
874
+ }
875
+ getDepthFirstPos(i) {
876
+ return this.posCrossRef[i];
877
+ }
878
+ indexNodes() {
879
+ this.secCount = -1, this.subGraphs.length > 0 && this.indexNodes2("none", this.subGraphs.length - 1);
880
+ }
881
+ /**
882
+ * Called by parser when a `connector <id>["Title"]` declaration is
883
+ * encountered (§8). Stores the connector as a FlowVertex with
884
+ * `isConnector: true` so the connector flows through the renderer
885
+ * alongside vertices, while keeping a separate index for connector-
886
+ * specific lookups (e.g. `connectorRef` resolution).
887
+ */
888
+ addConnector(i, n) {
889
+ const r = i?.text?.trim();
890
+ if (!r)
891
+ return "";
892
+ const u = n?.text?.trim() ?? "", l = u.length > 0 ? this.sanitizeText(u) : r;
893
+ let c = this.connectors.get(r);
894
+ return c ? u.length > 0 && (c.text = l) : (c = {
895
+ id: r,
896
+ labelType: "text",
897
+ domId: n1 + r + "-" + this.vertexCounter,
898
+ styles: [],
899
+ classes: [],
900
+ isConnector: !0,
901
+ text: l
902
+ }, this.connectors.set(r, c), this.vertices.set(r, c), this.vertexCounter++), r;
903
+ }
904
+ /**
905
+ * Live array. `getData()` and the JISON actions read it on the hot path and a
906
+ * per-call copy would be wasted work; unlike `getDiagnostics()` this is not an
907
+ * accessor built for external consumers. Same for `getVertices()` /
908
+ * `getEdges()`, whose `defaultStyle` / `defaultInterpolate` side-properties a
909
+ * copy would drop.
910
+ */
911
+ getSubGraphs() {
912
+ return this.subGraphs;
913
+ }
914
+ /** Returns connectors declared via the `connector` keyword (§8). */
915
+ getConnectors() {
916
+ return [...this.connectors.values()];
917
+ }
918
+ firstGraph() {
919
+ return this.firstGraphFlag ? (this.firstGraphFlag = !1, !0) : !1;
920
+ }
921
+ /**
922
+ * Maps the post-`destructLink` `(type, stroke)` pair onto the canonical
923
+ * `edgeSemantic` value defined by the agentflow syntax specification §5.1 (v0.8.1).
924
+ * The three-way table:
925
+ * - `-->` → arrow_point + normal → sequence
926
+ * - `-.-` → arrow_open + dotted → reference
927
+ * - `--x` → arrow_cross + normal → failure
928
+ * Returns `undefined` for combinations the spec no longer permits.
929
+ */
930
+ computeEdgeSemantic(i, n) {
931
+ if (i === "arrow_point" && n === "normal")
932
+ return "sequence";
933
+ if (i === "arrow_cross" && n === "normal")
934
+ return "failure";
935
+ if (i === "arrow_open" && n === "dotted")
936
+ return "reference";
937
+ }
938
+ destructStartLink(i) {
939
+ const n = i.trim(), r = "arrow_open";
940
+ let u = "normal";
941
+ return n.includes(".") && (u = "dotted"), { type: r, stroke: u };
942
+ }
943
+ countChar(i, n) {
944
+ const r = n.length;
945
+ let u = 0;
946
+ for (let l = 0; l < r; ++l)
947
+ n[l] === i && ++u;
948
+ return u;
949
+ }
950
+ destructEndLink(i) {
951
+ const n = i.trim();
952
+ let r = n.slice(0, -1), u = "arrow_open";
953
+ switch (n.slice(-1)) {
954
+ case "x":
955
+ u = "arrow_cross";
956
+ break;
957
+ case ">":
958
+ u = "arrow_point";
959
+ break;
960
+ case "-":
961
+ case ".":
962
+ u = "arrow_open", r = n;
963
+ break;
964
+ }
965
+ let l = "normal", c = r.length - 1;
966
+ const a = this.countChar(".", r);
967
+ return a > 0 && (l = "dotted", c = a), { type: u, stroke: l, length: c };
968
+ }
969
+ destructLink(i, n) {
970
+ const r = this.destructEndLink(i);
971
+ let u;
972
+ return n ? (u = this.destructStartLink(n), u.stroke !== r.stroke ? { type: "INVALID", stroke: "INVALID" } : (u.type = r.type, u.length = r.length, {
973
+ ...u,
974
+ edgeSemantic: this.computeEdgeSemantic(
975
+ u.type,
976
+ u.stroke
977
+ )
978
+ })) : {
979
+ ...r,
980
+ edgeSemantic: this.computeEdgeSemantic(r.type, r.stroke)
981
+ };
982
+ }
983
+ // Todo optimizer this by caching existing nodes
984
+ exists(i, n) {
985
+ for (const r of i)
986
+ if (r.nodes.includes(n))
987
+ return !0;
988
+ return !1;
989
+ }
990
+ /**
991
+ * Deletes an id from all subgraphs
992
+ *
993
+ */
994
+ makeUniq(i, n) {
995
+ const r = [];
996
+ return i.nodes.forEach((u, l) => {
997
+ this.exists(n, u) || r.push(i.nodes[l]);
998
+ }), { nodes: r };
999
+ }
1000
+ getTypeFromVertex(i) {
1001
+ const n = typeof i.type == "string" ? et(i.type) : i.type;
1002
+ switch (n) {
1003
+ case "square":
1004
+ case void 0:
1005
+ return "squareRect";
1006
+ case "round":
1007
+ return "roundedRect";
1008
+ case "ellipse":
1009
+ return "ellipse";
1010
+ default:
1011
+ return n;
1012
+ }
1013
+ }
1014
+ findNode(i, n) {
1015
+ return i.find((r) => r.id === n);
1016
+ }
1017
+ destructEdgeType(i) {
1018
+ let n = "none", r = "arrow_point";
1019
+ switch (i) {
1020
+ case "arrow_point":
1021
+ case "arrow_circle":
1022
+ case "arrow_cross":
1023
+ case "arrow_hierarchy":
1024
+ r = i;
1025
+ break;
1026
+ case "double_arrow_point":
1027
+ case "double_arrow_circle":
1028
+ case "double_arrow_cross":
1029
+ n = i.replace("double_", ""), r = n;
1030
+ break;
1031
+ }
1032
+ return { arrowTypeStart: n, arrowTypeEnd: r };
1033
+ }
1034
+ addNodeFromVertex(i, n, r, u, l, c) {
1035
+ const a = r.get(i.id), h = u.get(i.id) ?? !1, g = this.findNode(n, i.id);
1036
+ if (g)
1037
+ g.cssStyles = i.styles, g.cssCompiledStyles = this.getCompiledStyles(i.classes), g.cssClasses = i.classes.join(" ");
1038
+ else {
1039
+ const p = {
1040
+ id: i.id,
1041
+ label: i.text,
1042
+ labelType: i.labelType,
1043
+ labelStyle: "",
1044
+ parentId: a,
1045
+ padding: l.flowchart?.padding || 8,
1046
+ cssStyles: i.styles,
1047
+ cssCompiledStyles: this.getCompiledStyles(["default", "node", ...i.classes]),
1048
+ cssClasses: "default " + i.classes.join(" "),
1049
+ dir: i.dir,
1050
+ domId: i.domId,
1051
+ look: c,
1052
+ link: i.link,
1053
+ linkTarget: i.linkTarget,
1054
+ tooltip: this.getTooltip(i.id),
1055
+ metadata: i.metadata
1056
+ };
1057
+ h ? n.push({
1058
+ ...p,
1059
+ isGroup: !0,
1060
+ shape: "rect"
1061
+ }) : n.push({
1062
+ ...p,
1063
+ isGroup: !1,
1064
+ shape: this.getTypeFromVertex(i),
1065
+ wrappingWidth: l.agentflow?.wrappingWidth,
1066
+ minWidth: l.agentflow?.minNodeWidth
1067
+ });
1068
+ }
1069
+ }
1070
+ getCompiledStyles(i) {
1071
+ let n = [];
1072
+ for (const r of i) {
1073
+ const u = this.classes.get(r);
1074
+ u?.styles && (n = [...n, ...u.styles ?? []].map((l) => l.trim())), u?.textStyles && (n = [...n, ...u.textStyles ?? []].map((l) => l.trim()));
1075
+ }
1076
+ return n;
1077
+ }
1078
+ /**
1079
+ * Post-parse hook. Property-level metadata validation and semantic checks
1080
+ * (§10 applicability, connector-ref resolution, §3.3 containment, edge
1081
+ * endpoint kinds, flow input, identifier namespace) were removed from the
1082
+ * parser in v0.8.2 (issue #64) — they are semantic concerns owned by the
1083
+ * semantics module. The parser keeps only structural parsing plus `shape`
1084
+ * (unknown-shape errors, see `transformData`) and `view` handling. This hook
1085
+ * remains as a no-op so downstream callers and the run-once guard are intact.
1086
+ */
1087
+ runPostParseValidators() {
1088
+ this.postParseValidationRun || (this.postParseValidationRun = !0);
1089
+ }
1090
+ getData() {
1091
+ this.runPostParseValidators();
1092
+ const i = Ce(), n = [], r = [], u = this.getSubGraphs(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ k((d, f, B = /* @__PURE__ */ new Set()) => {
1093
+ if (B.has(d))
1094
+ return;
1095
+ B.add(d);
1096
+ const R = this.subGraphLookup.get(d);
1097
+ if (R)
1098
+ for (const se of R.nodes)
1099
+ se === f || B.has(se) || (a.add(se), h.set(se, f), g(se, f, B));
1100
+ }, "collectDescendants");
1101
+ for (const d of u)
1102
+ d.metadata?.view === "collapsed" && !a.has(d.id) && g(d.id, d.id);
1103
+ const p = /* @__PURE__ */ k((d, f) => {
1104
+ const B = /* @__PURE__ */ new Set();
1105
+ let R = f;
1106
+ for (; R !== void 0 && !B.has(R); ) {
1107
+ if (R === d)
1108
+ return !0;
1109
+ B.add(R), R = l.get(R);
1110
+ }
1111
+ return !1;
1112
+ }, "wouldCloseContainmentCycle");
1113
+ for (let d = u.length - 1; d >= 0; d--) {
1114
+ const f = u[d];
1115
+ if (!a.has(f.id)) {
1116
+ f.nodes.length > 0 && c.set(f.id, !0);
1117
+ for (const B of f.nodes) {
1118
+ if (p(B, f.id)) {
1119
+ this.emitWarning(
1120
+ tt.CONTAINMENT_VIOLATION,
1121
+ `Container "${f.id}" cannot contain "${B}" because "${B}" already contains it. The nesting that would close the loop is dropped.`,
1122
+ { nodeId: B }
1123
+ );
1124
+ continue;
1125
+ }
1126
+ l.set(B, f.id);
1127
+ }
1128
+ }
1129
+ }
1130
+ for (let d = u.length - 1; d >= 0; d--) {
1131
+ const f = u[d];
1132
+ if (a.has(f.id))
1133
+ continue;
1134
+ if (f.metadata?.view === "collapsed") {
1135
+ const R = {
1136
+ ...f.metadata,
1137
+ containerType: f.type
1138
+ };
1139
+ n.push({
1140
+ id: f.id,
1141
+ label: f.title,
1142
+ labelStyle: "",
1143
+ labelType: f.labelType,
1144
+ parentId: l.get(f.id),
1145
+ padding: 8,
1146
+ cssCompiledStyles: this.getCompiledStyles(f.classes),
1147
+ cssClasses: f.classes.join(" "),
1148
+ shape: "collapsedGroup",
1149
+ dir: f.dir,
1150
+ isGroup: !1,
1151
+ look: i.look,
1152
+ metadata: R
1153
+ });
1154
+ } else
1155
+ n.push({
1156
+ id: f.id,
1157
+ label: f.title,
1158
+ labelStyle: "",
1159
+ labelType: f.labelType,
1160
+ parentId: l.get(f.id),
1161
+ padding: 8,
1162
+ cssCompiledStyles: this.getCompiledStyles(f.classes),
1163
+ cssClasses: f.classes.join(" "),
1164
+ shape: q1[f.type ?? "flow"],
1165
+ dir: f.dir,
1166
+ isGroup: !0,
1167
+ look: i.look,
1168
+ metadata: f.metadata
1169
+ });
1170
+ }
1171
+ this.getVertices().forEach((d) => {
1172
+ a.has(d.id) || this.addNodeFromVertex(d, n, l, c, i, i.look || "classic");
1173
+ });
1174
+ const x = this.getEdges();
1175
+ x.forEach((d, f) => {
1176
+ const B = h.get(d.start) ?? d.start, R = h.get(d.end) ?? d.end;
1177
+ if (B === R && d.start !== d.end)
1178
+ return;
1179
+ const { arrowTypeStart: se, arrowTypeEnd: de } = this.destructEdgeType(d.type), le = [...x.defaultStyle ?? []];
1180
+ d.style && le.push(...d.style);
1181
+ const O = {
1182
+ id: Rt(B, R, { counter: f, prefix: "L" }, d.id),
1183
+ isUserDefinedId: d.isUserDefinedId,
1184
+ start: B,
1185
+ end: R,
1186
+ type: d.type ?? "normal",
1187
+ label: d.text,
1188
+ labelType: d.labelType,
1189
+ labelpos: "c",
1190
+ thickness: d.stroke,
1191
+ minlen: d.length,
1192
+ classes: d?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
1193
+ arrowTypeStart: d?.stroke === "invisible" || d?.type === "arrow_open" ? "none" : se,
1194
+ arrowTypeEnd: d?.stroke === "invisible" || d?.type === "arrow_open" ? "none" : de,
1195
+ // Inert: `Edge.arrowheadStyle` is declared but never read by the
1196
+ // renderer. Kept at flowchart parity rather than theme-derived.
1197
+ arrowheadStyle: "fill: #333",
1198
+ cssCompiledStyles: this.getCompiledStyles(d.classes),
1199
+ labelStyle: le,
1200
+ style: le,
1201
+ pattern: d.stroke,
1202
+ look: i.look,
1203
+ animate: d.animate,
1204
+ animation: d.animation,
1205
+ curve: d.interpolate || this.edges.defaultInterpolate || i.flowchart?.curve,
1206
+ // §5.3 edge metadata (e.g. `instruction`) — carried to the IR so
1207
+ // downstream tooling (dispatch compile) can read it (issue #62).
1208
+ metadata: d.metadata
1209
+ };
1210
+ r.push(O);
1211
+ }), r1(n, this);
1212
+ const L = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
1213
+ for (const d of u) {
1214
+ const f = l.get(d.id);
1215
+ f !== void 0 && C.set(f, [...C.get(f) ?? [], d.id]);
1216
+ }
1217
+ let M = 0;
1218
+ const T = /* @__PURE__ */ k((d) => {
1219
+ if (!L.has(d)) {
1220
+ L.set(d, M++);
1221
+ for (const f of C.get(d) ?? [])
1222
+ T(f);
1223
+ }
1224
+ }, "walkContainers");
1225
+ for (const d of u)
1226
+ l.get(d.id) === void 0 && T(d.id);
1227
+ const m = new Set(this.getConnectors().map((d) => d.id));
1228
+ return c1(
1229
+ n,
1230
+ (d) => {
1231
+ if (m.has(d))
1232
+ return "connector";
1233
+ const f = this.vertices.get(d);
1234
+ return f ? this.deriveVertexKind(f, et(f.type)) : void 0;
1235
+ },
1236
+ L
1237
+ ), {
1238
+ nodes: n,
1239
+ edges: r,
1240
+ other: {},
1241
+ config: i,
1242
+ connectors: this.getConnectors()
1243
+ };
1244
+ }
1245
+ defaultConfig() {
1246
+ return y1.flowchart;
1247
+ }
1248
+ // ── Semantic-model projection (PR 3) ─────────────────────────────────
1249
+ //
1250
+ // `getSemanticModel()` returns a presentation-stripped view of the
1251
+ // diagram state for downstream tooling. Per the agentflow syntax specification §13
1252
+ // `view`, `classDef` / `class` / `style` / `linkStyle`, `icon`, `img`,
1253
+ // `w`, `h`, collapsed/expanded state, element mappings, and interactivity
1254
+ // bindings are presentation-only and MUST NOT influence semantic
1255
+ // interpretation — so none of them appear in the returned model. Fields
1256
+ // that carry meaning (ids, labels, shape, domain metadata, edge
1257
+ // arrow/stroke/label, subgraph membership, type/template declarations,
1258
+ // diagnostics) are kept.
1259
+ /**
1260
+ * The v0.8.1 §4 vertex kind for a parsed vertex.
1261
+ *
1262
+ * Extracted so the semantic model and `getData()`'s palette slots read the same rules
1263
+ * from one place. Kind is NOT recoverable from the resolved shape alone — a tool and a
1264
+ * task can both land on `roundedRect` — which is why this takes the vertex and not just
1265
+ * its shape.
1266
+ */
1267
+ deriveVertexKind(i, n) {
1268
+ return this.isToolDefinition(i) ? "tool" : n === "hexagon" || n === "hex" ? "action" : n === "lean-right" || n === "lean_right" ? "input" : n === "lin-doc" || n === "lined-document" ? "refdoc" : n === "diamond" ? "decision" : "task";
1269
+ }
1270
+ getSemanticModel() {
1271
+ this.runPostParseValidators();
1272
+ const i = new Set(this.subGraphs.map((a) => a.id)), n = [], r = [];
1273
+ for (const [a, h] of this.vertices) {
1274
+ if (i.has(a))
1275
+ continue;
1276
+ if (h.isConnector) {
1277
+ const A = { id: a };
1278
+ if (h.text !== void 0 && h.text !== a && (A.title = h.text), h.metadata && Object.keys(h.metadata).length > 0) {
1279
+ const x = {};
1280
+ for (const [L, C] of Object.entries(h.metadata))
1281
+ Pt.has(L) || (x[L] = C);
1282
+ Object.keys(x).length > 0 && (A.metadata = x);
1283
+ }
1284
+ r.push(A);
1285
+ continue;
1286
+ }
1287
+ const g = { id: a };
1288
+ h.text !== void 0 && (g.label = h.text);
1289
+ const p = typeof h.type == "string" ? et(h.type) : h.type;
1290
+ if (p !== void 0 && (g.shape = p), g.vertexKind = this.deriveVertexKind(h, p), h.metadata && Object.keys(h.metadata).length > 0) {
1291
+ const A = {};
1292
+ for (const [x, L] of Object.entries(h.metadata))
1293
+ Pt.has(x) || (A[x] = L);
1294
+ Object.keys(A).length > 0 && (g.metadata = A);
1295
+ }
1296
+ n.push(g);
1297
+ }
1298
+ const u = this.edges.map((a) => {
1299
+ const h = { start: a.start, end: a.end };
1300
+ return a.id !== void 0 && (h.id = a.id), typeof a.text == "string" && a.text.length > 0 && (h.label = a.text), a.type !== void 0 && (h.type = a.type), a.stroke !== void 0 && (h.stroke = a.stroke), a.edgeSemantic !== void 0 && (h.edgeSemantic = a.edgeSemantic), a.length !== void 0 && (h.length = a.length), a.metadata && Object.keys(a.metadata).length > 0 && (h.metadata = { ...a.metadata }), h;
1301
+ }), l = this.subGraphs.map((a) => {
1302
+ const h = {
1303
+ id: a.id,
1304
+ nodes: [...a.nodes]
1305
+ };
1306
+ if (a.type !== void 0 && (h.type = a.type), a.title !== void 0 && (h.title = a.title), a.dir !== void 0 && (h.direction = a.dir), a.metadata && Object.keys(a.metadata).length > 0) {
1307
+ const g = {};
1308
+ for (const [p, A] of Object.entries(a.metadata))
1309
+ Pt.has(p) || (g[p] = A);
1310
+ Object.keys(g).length > 0 && (h.metadata = g);
1311
+ }
1312
+ return h;
1313
+ }), c = {
1314
+ vertices: n,
1315
+ edges: u,
1316
+ subGraphs: l,
1317
+ connectors: r,
1318
+ diagnostics: this.diagnostics
1319
+ };
1320
+ return this.direction !== void 0 && (c.direction = this.direction), c;
1321
+ }
1322
+ // ── Element-mapping infrastructure (PR 2a) ────────────────────────────
1323
+ //
1324
+ // JISON action blocks call the `add*Mapping` methods alongside the
1325
+ // structural `add*` methods; see `agentflow.jison`. When a diagram DB
1326
+ // does not expose these methods the JISON guard `if (yy.addVertexMapping)`
1327
+ // simply skips them, so the mapping layer is opt-in and has no effect on
1328
+ // diagrams that don't consume positions.
1329
+ setFrontmatterLineOffset(i) {
1330
+ this.frontmatterLineOffset = i ?? 0;
1331
+ }
1332
+ toElementPosition(i) {
1333
+ const n = i?.first_line ?? 0, r = i?.first_column ?? 0, u = i?.last_line ?? n, l = i?.last_column ?? r, [c, a] = i?.range ?? [0, 0];
1334
+ return {
1335
+ startLine: n + this.frontmatterLineOffset,
1336
+ startColumn: r,
1337
+ endLine: u + this.frontmatterLineOffset,
1338
+ endColumn: l,
1339
+ startIndex: c,
1340
+ endIndex: a
1341
+ };
1342
+ }
1343
+ pushMapping(i, n, r) {
1344
+ if (!i)
1345
+ return;
1346
+ const u = {
1347
+ id: i,
1348
+ type: n,
1349
+ position: this.toElementPosition(r)
1350
+ };
1351
+ return this.elementMappings.push(u), u;
1352
+ }
1353
+ addVertexMapping(i, n, r, u) {
1354
+ const l = this.pushMapping(i, "vertex", u);
1355
+ l && r == null && this.bareVertexMappings.add(l);
1356
+ }
1357
+ /**
1358
+ * Extend a vertex's mapping end to cover a trailing inline metadata block
1359
+ * (`id["..."]@{ ... }`). The node declaration already pushed a mapping
1360
+ * spanning just the declaration; when the `@{ ... }` block reduces we widen
1361
+ * that mapping's end to the block's closing `}` so editor cursors inside the
1362
+ * block resolve to the node rather than the containing flow (issue #60).
1363
+ * `loc` is the `shapeData` symbol's location, so only the end moves — the
1364
+ * declaration start is preserved. Falls back to a fresh mapping if the node
1365
+ * has none yet.
1366
+ *
1367
+ * When the mapping being widened came from a bare `id` reference (no
1368
+ * label/shape brackets), the statement is a standalone attachment
1369
+ * (`id@{ ... }`) annotating an element declared elsewhere — retype it to
1370
+ * 'attachment' so consumers can tell it apart from a declaration
1371
+ * (issue #75).
1372
+ */
1373
+ extendVertexMapping(i, n) {
1374
+ if (!i || !n)
1375
+ return;
1376
+ const r = this.toElementPosition(n);
1377
+ for (let u = this.elementMappings.length - 1; u >= 0; u--) {
1378
+ const l = this.elementMappings[u];
1379
+ if (l.type === "vertex" && l.id === i) {
1380
+ this.bareVertexMappings.has(l) && (l.type = "attachment", this.bareVertexMappings.delete(l)), (r.endLine > l.position.endLine || r.endLine === l.position.endLine && r.endColumn > l.position.endColumn) && (l.position.endLine = r.endLine, l.position.endColumn = r.endColumn, l.position.endIndex = r.endIndex);
1381
+ return;
1382
+ }
1383
+ }
1384
+ this.pushMapping(i, "attachment", n);
1385
+ }
1386
+ addEdgeMapping(i, n, r, u) {
1387
+ const l = Array.isArray(n) ? n.map((a) => typeof a == "string" ? a : a?.id ?? "").filter(Boolean) : [], c = l.length > 0 ? l.join(">") : "edge";
1388
+ this.pushMapping(c, "edge", u);
1389
+ }
1390
+ addSubgraphMapping(i, n, r, u) {
1391
+ const l = (typeof i == "string" ? i : i?.text) ?? "", c = this.toElementPosition(r), a = u ? this.toElementPosition(u) : c;
1392
+ l && this.elementMappings.push({
1393
+ id: l,
1394
+ type: "subgraph",
1395
+ // Range spans from the container keyword to its `end` — startLine from
1396
+ // the opener, endLine from the closer.
1397
+ position: {
1398
+ startLine: c.startLine,
1399
+ startColumn: c.startColumn,
1400
+ endLine: a.endLine,
1401
+ endColumn: a.endColumn,
1402
+ startIndex: c.startIndex,
1403
+ endIndex: a.endIndex
1404
+ }
1405
+ });
1406
+ }
1407
+ addConnectorMapping(i, n, r, u) {
1408
+ const l = i?.text?.trim() ?? "";
1409
+ if (!l)
1410
+ return;
1411
+ const c = this.toElementPosition(r), a = u ? this.toElementPosition(u) : c;
1412
+ this.elementMappings.push({
1413
+ id: l,
1414
+ type: "connector",
1415
+ position: {
1416
+ startLine: c.startLine,
1417
+ startColumn: c.startColumn,
1418
+ endLine: a.endLine,
1419
+ endColumn: a.endColumn,
1420
+ startIndex: c.startIndex,
1421
+ endIndex: a.endIndex
1422
+ }
1423
+ });
1424
+ }
1425
+ getElementMappings() {
1426
+ return [...this.elementMappings];
1427
+ }
1428
+ getElementById(i) {
1429
+ return this.elementMappings.find((n) => n.id === i);
1430
+ }
1431
+ getElementsOnLine(i) {
1432
+ return this.elementMappings.filter(
1433
+ (n) => i >= n.position.startLine && i <= n.position.endLine
1434
+ );
1435
+ }
1436
+ getElementAtPosition(i, n) {
1437
+ const r = this.elementMappings.filter((l) => {
1438
+ const { startLine: c, startColumn: a, endLine: h, endColumn: g } = l.position;
1439
+ return !(i < c || i > h || i === c && n < a || i === h && n > g);
1440
+ });
1441
+ if (r.length === 0)
1442
+ return;
1443
+ const u = /* @__PURE__ */ k(({ position: l }) => [
1444
+ l.endLine - l.startLine,
1445
+ l.endColumn - l.startColumn
1446
+ ], "span");
1447
+ return r.reduce((l, c) => {
1448
+ const [a, h] = u(l), [g, p] = u(c);
1449
+ return g !== a ? g < a ? c : l : p < h ? c : l;
1450
+ });
1451
+ }
1452
+ getMappingStats() {
1453
+ let i = 0, n = 0, r = 0, u = 0, l = 0;
1454
+ for (const c of this.elementMappings)
1455
+ c.type === "vertex" ? i++ : c.type === "edge" ? n++ : c.type === "subgraph" ? r++ : c.type === "connector" ? u++ : c.type === "attachment" && l++;
1456
+ return {
1457
+ vertices: i,
1458
+ edges: n,
1459
+ subgraphs: r,
1460
+ connectors: u,
1461
+ attachments: l,
1462
+ totalElements: this.elementMappings.length
1463
+ };
1464
+ }
1465
+ // ── Diagnostics (PR 2b) ────────────────────────────────────────────────
1466
+ //
1467
+ // `emitWarning` (and its error-severity counterpart `emitError`) record a
1468
+ // structured diagnostic and also fire `log.warn` so humans see the
1469
+ // message in the console. When the caller supplies a `nodeId` or
1470
+ // `edgeId`, the position is looked up through the element-mapping layer
1471
+ // added in PR 2a — so the diagnostic carries enough context for an
1472
+ // editor to highlight the offending element.
1473
+ emitDiagnostic(i, n, r, u) {
1474
+ const l = u?.nodeId ?? u?.edgeId, c = l ? this.getElementById(l) : void 0, a = {
1475
+ id: i,
1476
+ severity: n,
1477
+ message: r,
1478
+ ...u?.nodeId ? { nodeId: u.nodeId } : {},
1479
+ ...u?.edgeId && !u?.nodeId ? { edgeId: u.edgeId } : {},
1480
+ ...c ? { position: c.position } : {}
1481
+ };
1482
+ if (this.diagnostics.some(
1483
+ (p) => p.id === a.id && p.severity === a.severity && p.message === a.message && p.nodeId === a.nodeId && p.edgeId === a.edgeId
1484
+ ))
1485
+ return;
1486
+ this.diagnostics.push(a);
1487
+ const g = `agentflow[${i}]: ${r}`;
1488
+ n === "error" ? oe.error(g) : oe.warn(g);
1489
+ }
1490
+ emitWarning(i, n, r) {
1491
+ this.emitDiagnostic(i, "warning", n, r);
1492
+ }
1493
+ emitError(i, n, r) {
1494
+ this.emitDiagnostic(i, "error", n, r);
1495
+ }
1496
+ /**
1497
+ * `readonly` is erased at runtime, so hand back a copy — this is a
1498
+ * consumer-facing accessor and a caller sorting the result in place would
1499
+ * otherwise reorder the DB's own list.
1500
+ */
1501
+ getDiagnostics() {
1502
+ return [...this.diagnostics];
1503
+ }
1504
+ }, k(Ze, "AgentFlowDB"), Ze), J1 = /* @__PURE__ */ k(function(s, i) {
1505
+ return i.db.getClasses();
1506
+ }, "getClasses"), Q1 = /* @__PURE__ */ k(async function(s, i, n, r) {
1507
+ oe.debug("Drawing agentflow diagram", i);
1508
+ const { securityLevel: u, agentflow: l, layout: c } = Ce();
1509
+ r.db.setDiagramId(i), oe.debug("Before getData: ");
1510
+ const a = r.db.getData();
1511
+ oe.debug("Data: ", a);
1512
+ const h = E1(i, u), g = r.db.getDirection();
1513
+ a.type = r.type, a.layoutAlgorithm = S1(c), a.layoutAlgorithm === "dagre" && c === "elk" && oe.warn(
1514
+ "flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."
1515
+ ), a.direction = g, a.nodeSpacing = l?.nodeSpacing || 50, a.rankSpacing = l?.rankSpacing || 50, a.markers = ["point", "circle", "cross", "hierarchy"], a.diagramId = i, oe.debug("REF1:", a), await x1(a, h);
1516
+ const p = l?.diagramPadding ?? 8;
1517
+ Gt.insertTitle(
1518
+ h,
1519
+ "agentflowTitleText",
1520
+ l?.titleTopMargin ?? 0,
1521
+ r.db.getDiagramTitle()
1522
+ ), C1(h, p, "agentflow", l?.useMaxWidth ?? !0);
1523
+ }, "draw"), Z1 = {
1524
+ getClasses: J1,
1525
+ draw: Q1
1526
+ }, Ut = (function() {
1527
+ var s = /* @__PURE__ */ k(function(Te, b, E, S) {
1528
+ for (E = E || {}, S = Te.length; S--; E[Te[S]] = b) ;
1529
+ return E;
1530
+ }, "o"), i = [1, 5], n = [1, 4], r = [1, 3], u = [1, 6], l = [1, 8, 9, 10, 11, 12, 28, 35, 36, 38, 40, 42, 47, 63, 87, 88, 89, 90, 91, 92, 105, 108, 109, 112, 114, 117, 118, 119, 124, 125, 126, 127, 128], c = [2, 2], a = [1, 15], h = [1, 16], g = [1, 17], p = [1, 18], A = [1, 19], x = [1, 26], L = [1, 27], C = [1, 28], M = [1, 30], T = [1, 31], m = [1, 32], d = [1, 55], f = [1, 54], B = [1, 34], R = [1, 35], se = [1, 36], de = [1, 37], le = [1, 38], O = [1, 50], G = [1, 52], U = [1, 48], j = [1, 53], z = [1, 49], W = [1, 56], K = [1, 51], H = [1, 57], Y = [1, 58], De = [1, 39], _e = [1, 40], ve = [1, 41], Fe = [1, 42], Ve = [1, 43], Se = [1, 64], D = [1, 8, 9, 10, 11, 12, 28, 33, 35, 36, 38, 40, 42, 47, 63, 87, 88, 89, 90, 91, 92, 105, 108, 109, 112, 114, 117, 118, 119, 124, 125, 126, 127, 128], Z = [1, 70], $ = [1, 68], ee = [1, 67], te = [1, 69], Me = [8, 9, 10, 12, 78, 80, 81], ye = [1, 88], we = [1, 101], Ne = [1, 106], Re = [1, 105], Oe = [1, 102], Pe = [1, 98], Ge = [1, 104], Ue = [1, 100], je = [1, 107], ze = [1, 103], We = [1, 108], Ke = [1, 99], Ie = [8, 9, 10, 11, 12, 43, 78, 80, 81], X = [8, 9, 10, 11, 12, 43, 49, 78, 80, 81], ne = [8, 9, 10, 11, 12, 30, 43, 47, 49, 51, 53, 55, 57, 59, 61, 63, 66, 68, 70, 71, 73, 78, 80, 81, 92, 105, 108, 109, 112, 114, 117, 118, 119], jt = [8, 9, 10, 12, 47, 63, 78, 80, 81, 92, 105, 108, 109, 112, 114, 117, 118, 119], He = [47, 63, 92, 105, 108, 109, 112, 114, 117, 118, 119], zt = [1, 131], Wt = [1, 132], st = [1, 134], it = [1, 133], Kt = [47, 63, 65, 77, 92, 105, 108, 109, 112, 114, 117, 118, 119], nt = [1, 143], rt = [1, 157], at = [1, 158], ot = [1, 159], ut = [1, 162], lt = [1, 161], ct = [1, 160], dt = [1, 145], ht = [1, 147], pt = [1, 151], Ht = [1, 139], Yt = [1, 140], ft = [1, 152], gt = [1, 153], mt = [1, 154], bt = [1, 155], At = [1, 156], kt = [1, 163], Et = [1, 164], Ct = [1, 141], St = [1, 142], xt = [1, 149], Tt = [1, 144], Dt = [1, 148], _t = [1, 146], Ye = [8, 9, 10, 11, 12, 28, 33, 35, 36, 38, 40, 42, 47, 63, 87, 88, 89, 90, 91, 92, 105, 108, 109, 112, 114, 117, 118, 119, 124, 125, 126, 127, 128], qt = [1, 168], qe = [1, 170], P = [8, 9, 10, 12], re = [8, 9, 10, 11, 12, 15, 47, 63, 92, 108, 109, 112, 114, 117, 118, 119], _ = [1, 190], J = [1, 186], Q = [1, 187], v = [1, 191], F = [1, 188], V = [1, 189], Xe = [80, 119, 122], y = [8, 9, 10, 11, 12, 13, 15, 28, 30, 33, 35, 36, 43, 47, 63, 78, 87, 88, 89, 90, 91, 92, 93, 108, 112, 114, 117, 118, 119], Xt = [11, 109], xe = [32, 52, 54, 56, 58, 60, 65, 67, 69, 70, 72, 74, 119, 120, 121], he = [1, 269], pe = [1, 267], fe = [1, 271], ge = [1, 265], me = [1, 266], be = [1, 268], Ae = [1, 270], ke = [1, 272], Je = [1, 292], Jt = [8, 9, 10, 12, 109], ce = [8, 9, 10, 11, 12, 63, 87, 108, 109, 112, 113, 114, 115], Bt = {
1531
+ trace: /* @__PURE__ */ k(function() {
1532
+ }, "trace"),
1533
+ yy: {},
1534
+ symbols_: { error: 2, start: 3, graphConfig: 4, document: 5, line: 6, statement: 7, COMMENT: 8, SEMI: 9, NEWLINE: 10, SPACE: 11, EOF: 12, GRAPH: 13, NODIR: 14, DIR: 15, FirstStmtSeparator: 16, ending: 17, endToken: 18, spaceList: 19, spaceListNewline: 20, vertexStatement: 21, separator: 22, styleStatement: 23, linkStyleStatement: 24, classDefStatement: 25, classStatement: 26, clickStatement: 27, flow: 28, textNoTags: 29, SQS: 30, text: 31, SQE: 32, end: 33, shapeData: 34, global: 35, connector: 36, direction: 37, acc_title: 38, acc_title_value: 39, acc_descr: 40, acc_descr_value: 41, acc_descr_multiline_value: 42, SHAPE_DATA: 43, link: 44, node: 45, styledVertex: 46, AMP: 47, vertex: 48, STYLE_SEPARATOR: 49, idString: 50, DOUBLECIRCLESTART: 51, DOUBLECIRCLEEND: 52, PS: 53, PE: 54, "(-": 55, "-)": 56, STADIUMSTART: 57, STADIUMEND: 58, SUBROUTINESTART: 59, SUBROUTINEEND: 60, VERTEX_WITH_PROPS_START: 61, "NODE_STRING[field]": 62, COLON: 63, "NODE_STRING[value]": 64, PIPE: 65, CYLINDERSTART: 66, CYLINDEREND: 67, DIAMOND_START: 68, DIAMOND_STOP: 69, TAGEND: 70, TRAPSTART: 71, TRAPEND: 72, INVTRAPSTART: 73, INVTRAPEND: 74, linkStatement: 75, arrowText: 76, TESTSTR: 77, START_LINK: 78, edgeText: 79, LINK: 80, LINK_ID: 81, edgeTextToken: 82, STR: 83, MD_STR: 84, textToken: 85, keywords: 86, STYLE: 87, LINKSTYLE: 88, CLASSDEF: 89, CLASS: 90, CLICK: 91, DOWN: 92, UP: 93, textNoTagsToken: 94, stylesOpt: 95, "idString[vertex]": 96, "idString[class]": 97, CALLBACKNAME: 98, CALLBACKARGS: 99, HREF: 100, LINK_TARGET: 101, "STR[link]": 102, "STR[tooltip]": 103, alphaNum: 104, DEFAULT: 105, numList: 106, INTERPOLATE: 107, NUM: 108, COMMA: 109, style: 110, styleComponent: 111, NODE_STRING: 112, UNIT: 113, BRKT: 114, PCT: 115, idStringToken: 116, MINUS: 117, MULT: 118, UNICODE_TEXT: 119, TEXT: 120, TAGSTART: 121, EDGE_TEXT: 122, alphaNumToken: 123, direction_tb: 124, direction_bt: 125, direction_rl: 126, direction_lr: 127, direction_td: 128, $accept: 0, $end: 1 },
1535
+ terminals_: { 2: "error", 8: "COMMENT", 9: "SEMI", 10: "NEWLINE", 11: "SPACE", 12: "EOF", 13: "GRAPH", 14: "NODIR", 15: "DIR", 28: "flow", 30: "SQS", 32: "SQE", 33: "end", 35: "global", 36: "connector", 38: "acc_title", 39: "acc_title_value", 40: "acc_descr", 41: "acc_descr_value", 42: "acc_descr_multiline_value", 43: "SHAPE_DATA", 47: "AMP", 49: "STYLE_SEPARATOR", 51: "DOUBLECIRCLESTART", 52: "DOUBLECIRCLEEND", 53: "PS", 54: "PE", 55: "(-", 56: "-)", 57: "STADIUMSTART", 58: "STADIUMEND", 59: "SUBROUTINESTART", 60: "SUBROUTINEEND", 61: "VERTEX_WITH_PROPS_START", 62: "NODE_STRING[field]", 63: "COLON", 64: "NODE_STRING[value]", 65: "PIPE", 66: "CYLINDERSTART", 67: "CYLINDEREND", 68: "DIAMOND_START", 69: "DIAMOND_STOP", 70: "TAGEND", 71: "TRAPSTART", 72: "TRAPEND", 73: "INVTRAPSTART", 74: "INVTRAPEND", 77: "TESTSTR", 78: "START_LINK", 80: "LINK", 81: "LINK_ID", 83: "STR", 84: "MD_STR", 87: "STYLE", 88: "LINKSTYLE", 89: "CLASSDEF", 90: "CLASS", 91: "CLICK", 92: "DOWN", 93: "UP", 96: "idString[vertex]", 97: "idString[class]", 98: "CALLBACKNAME", 99: "CALLBACKARGS", 100: "HREF", 101: "LINK_TARGET", 102: "STR[link]", 103: "STR[tooltip]", 105: "DEFAULT", 107: "INTERPOLATE", 108: "NUM", 109: "COMMA", 112: "NODE_STRING", 113: "UNIT", 114: "BRKT", 115: "PCT", 117: "MINUS", 118: "MULT", 119: "UNICODE_TEXT", 120: "TEXT", 121: "TAGSTART", 122: "EDGE_TEXT", 124: "direction_tb", 125: "direction_bt", 126: "direction_rl", 127: "direction_lr", 128: "direction_td" },
1536
+ productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [17, 2], [17, 1], [18, 1], [18, 1], [18, 1], [16, 1], [16, 1], [16, 2], [16, 1], [20, 2], [20, 2], [20, 2], [20, 1], [20, 1], [20, 1], [19, 2], [19, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 10], [7, 6], [7, 7], [7, 4], [7, 4], [7, 7], [7, 8], [7, 4], [7, 5], [7, 1], [7, 2], [7, 2], [7, 1], [22, 1], [22, 1], [22, 1], [22, 1], [34, 2], [34, 1], [21, 4], [21, 3], [21, 4], [21, 2], [21, 2], [21, 1], [45, 1], [45, 6], [45, 5], [46, 1], [46, 3], [48, 4], [48, 4], [48, 6], [48, 4], [48, 4], [48, 4], [48, 8], [48, 4], [48, 4], [48, 4], [48, 6], [48, 4], [48, 4], [48, 4], [48, 4], [48, 4], [48, 1], [44, 2], [44, 3], [44, 3], [44, 1], [44, 3], [44, 4], [79, 1], [79, 2], [79, 1], [79, 1], [75, 1], [75, 2], [76, 3], [31, 1], [31, 2], [31, 1], [31, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [86, 1], [29, 1], [29, 2], [29, 1], [29, 1], [25, 5], [26, 5], [27, 2], [27, 4], [27, 3], [27, 5], [27, 3], [27, 5], [27, 5], [27, 7], [27, 2], [27, 4], [27, 2], [27, 4], [27, 4], [27, 6], [23, 5], [24, 5], [24, 5], [24, 9], [24, 9], [24, 7], [24, 7], [106, 1], [106, 3], [95, 1], [95, 3], [110, 1], [110, 2], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [111, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [116, 1], [85, 1], [85, 1], [85, 1], [85, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [94, 1], [82, 1], [82, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [123, 1], [50, 1], [50, 2], [104, 1], [104, 2], [37, 1], [37, 1], [37, 1], [37, 1], [37, 1]],
1537
+ performAction: /* @__PURE__ */ k(function(b, E, S, o, w, e, I) {
1538
+ var t = e.length - 1;
1539
+ switch (w) {
1540
+ case 2:
1541
+ this.$ = [];
1542
+ break;
1543
+ case 3:
1544
+ (!Array.isArray(e[t]) || e[t].length > 0) && e[t - 1].push(e[t]), this.$ = e[t - 1];
1545
+ break;
1546
+ case 4:
1547
+ case 198:
1548
+ this.$ = e[t];
1549
+ break;
1550
+ case 5:
1551
+ case 33:
1552
+ case 34:
1553
+ case 35:
1554
+ case 36:
1555
+ case 37:
1556
+ this.$ = [];
1557
+ break;
1558
+ case 13:
1559
+ o.setDirection("TB"), this.$ = "TB";
1560
+ break;
1561
+ case 14:
1562
+ o.setDirection(e[t - 1]), this.$ = e[t - 1];
1563
+ break;
1564
+ case 32:
1565
+ this.$ = e[t - 1].nodes;
1566
+ break;
1567
+ case 38:
1568
+ this.$ = o.addSubGraph(e[t - 6], e[t - 1], e[t - 4], "flow"), o.addSubgraphMapping && o.addSubgraphMapping(e[t - 6], e[t - 4], I[t - 8], I[t]);
1569
+ break;
1570
+ case 39:
1571
+ this.$ = o.addSubGraph(e[t - 7], e[t - 1], e[t - 5], "flow"), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, e[t - 3], I[t - 3]), o.addSubgraphMapping && o.addSubgraphMapping(e[t - 7], e[t - 5], I[t - 9], I[t]);
1572
+ break;
1573
+ case 40:
1574
+ this.$ = o.addSubGraph(e[t - 3], e[t - 1], { text: "", type: "text" }, "flow"), o.addSubgraphMapping && o.addSubgraphMapping(e[t - 3], { text: "", type: "text" }, I[t - 5], I[t]);
1575
+ break;
1576
+ case 41:
1577
+ this.$ = o.addSubGraph(e[t - 4], e[t - 1], { text: "", type: "text" }, "flow"), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, e[t - 3], I[t - 3]), o.addSubgraphMapping && o.addSubgraphMapping(e[t - 4], { text: "", type: "text" }, I[t - 6], I[t]);
1578
+ break;
1579
+ case 42:
1580
+ this.$ = o.addSubGraph(void 0, e[t - 1], void 0, "flow"), o.addSubgraphMapping && o.addSubgraphMapping(void 0, void 0, I[t - 3], I[t]);
1581
+ break;
1582
+ case 43:
1583
+ o.addGlobal(e[t - 1]), this.$ = [];
1584
+ break;
1585
+ case 44:
1586
+ this.$ = o.addConnector(e[t - 4], e[t - 2]), o.addConnectorMapping && o.addConnectorMapping(e[t - 4], e[t - 2], I[t - 6], I[t]);
1587
+ break;
1588
+ case 45:
1589
+ this.$ = o.addConnector(e[t - 5], e[t - 3]), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, e[t - 1], I[t - 1]), o.addConnectorMapping && o.addConnectorMapping(e[t - 5], e[t - 3], I[t - 7], I[t]);
1590
+ break;
1591
+ case 46:
1592
+ this.$ = o.addConnector(e[t - 1], { text: "", type: "text" }), o.addConnectorMapping && o.addConnectorMapping(e[t - 1], { text: "", type: "text" }, I[t - 3], I[t]);
1593
+ break;
1594
+ case 47:
1595
+ this.$ = o.addConnector(e[t - 2], { text: "", type: "text" }), o.addVertex(this.$, void 0, void 0, void 0, void 0, void 0, void 0, e[t - 1], I[t - 1]), o.addConnectorMapping && o.addConnectorMapping(e[t - 2], { text: "", type: "text" }, I[t - 4], I[t]);
1596
+ break;
1597
+ case 49:
1598
+ this.$ = e[t].trim(), o.setAccTitle(this.$);
1599
+ break;
1600
+ case 50:
1601
+ case 51:
1602
+ this.$ = e[t].trim(), o.setAccDescription(this.$);
1603
+ break;
1604
+ case 56:
1605
+ this.$ = e[t - 1] + e[t];
1606
+ break;
1607
+ case 57:
1608
+ this.$ = e[t];
1609
+ break;
1610
+ case 58:
1611
+ o.addVertex(e[t - 1][e[t - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, e[t], I[t]), o.extendVertexMapping && o.extendVertexMapping(e[t - 1][e[t - 1].length - 1], I[t]), o.addLink(e[t - 3].stmt, e[t - 1], e[t - 2]), o.addEdgeMapping && o.addEdgeMapping(e[t - 3].stmt, e[t - 1], e[t - 2], this._$), this.$ = { stmt: e[t - 1], nodes: e[t - 1].concat(e[t - 3].nodes) };
1612
+ break;
1613
+ case 59:
1614
+ o.addLink(e[t - 2].stmt, e[t], e[t - 1]), o.addEdgeMapping && o.addEdgeMapping(e[t - 2].stmt, e[t], e[t - 1], this._$), this.$ = { stmt: e[t], nodes: e[t].concat(e[t - 2].nodes) };
1615
+ break;
1616
+ case 60:
1617
+ o.addLink(e[t - 3].stmt, e[t - 1], e[t - 2]), o.addEdgeMapping && o.addEdgeMapping(e[t - 3].stmt, e[t - 1], e[t - 2], this._$), this.$ = { stmt: e[t - 1], nodes: e[t - 1].concat(e[t - 3].nodes) };
1618
+ break;
1619
+ case 61:
1620
+ this.$ = { stmt: e[t - 1], nodes: e[t - 1] };
1621
+ break;
1622
+ case 62:
1623
+ o.addVertex(e[t - 1][e[t - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, e[t], I[t]), o.extendVertexMapping && o.extendVertexMapping(e[t - 1][e[t - 1].length - 1], I[t]), this.$ = { stmt: e[t - 1], nodes: e[t - 1], shapeData: e[t] };
1624
+ break;
1625
+ case 63:
1626
+ this.$ = { stmt: e[t], nodes: e[t] };
1627
+ break;
1628
+ case 64:
1629
+ this.$ = [e[t]];
1630
+ break;
1631
+ case 65:
1632
+ o.addVertex(e[t - 5][e[t - 5].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, e[t - 4], I[t - 4]), o.extendVertexMapping && o.extendVertexMapping(e[t - 5][e[t - 5].length - 1], I[t - 4]), this.$ = e[t - 5].concat(e[t]);
1633
+ break;
1634
+ case 66:
1635
+ this.$ = e[t - 4].concat(e[t]);
1636
+ break;
1637
+ case 67:
1638
+ this.$ = e[t];
1639
+ break;
1640
+ case 68:
1641
+ this.$ = e[t - 2], o.setClass(e[t - 2], e[t]);
1642
+ break;
1643
+ case 69:
1644
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "square"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "square", this._$);
1645
+ break;
1646
+ case 70:
1647
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "doublecircle"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "doublecircle", this._$);
1648
+ break;
1649
+ case 71:
1650
+ this.$ = e[t - 5], o.addVertex(e[t - 5], e[t - 2], "circle"), o.addVertexMapping && o.addVertexMapping(e[t - 5], e[t - 2], "circle", this._$);
1651
+ break;
1652
+ case 72:
1653
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "ellipse"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "ellipse", this._$);
1654
+ break;
1655
+ case 73:
1656
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "stadium"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "stadium", this._$);
1657
+ break;
1658
+ case 74:
1659
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "subroutine"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "subroutine", this._$);
1660
+ break;
1661
+ case 75:
1662
+ this.$ = e[t - 7], o.addVertex(e[t - 7], e[t - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[e[t - 5], e[t - 3]]])), o.addVertexMapping && o.addVertexMapping(e[t - 7], e[t - 1], "rect", this._$);
1663
+ break;
1664
+ case 76:
1665
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "cylinder"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "cylinder", this._$);
1666
+ break;
1667
+ case 77:
1668
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "round"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "round", this._$);
1669
+ break;
1670
+ case 78:
1671
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "diamond"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "diamond", this._$);
1672
+ break;
1673
+ case 79:
1674
+ this.$ = e[t - 5], o.addVertex(e[t - 5], e[t - 2], "hexagon"), o.addVertexMapping && o.addVertexMapping(e[t - 5], e[t - 2], "hexagon", this._$);
1675
+ break;
1676
+ case 80:
1677
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "odd"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "odd", this._$);
1678
+ break;
1679
+ case 81:
1680
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "trapezoid"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "trapezoid", this._$);
1681
+ break;
1682
+ case 82:
1683
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "inv_trapezoid"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "inv_trapezoid", this._$);
1684
+ break;
1685
+ case 83:
1686
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "lean_right"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "lean_right", this._$);
1687
+ break;
1688
+ case 84:
1689
+ this.$ = e[t - 3], o.addVertex(e[t - 3], e[t - 1], "lean_left"), o.addVertexMapping && o.addVertexMapping(e[t - 3], e[t - 1], "lean_left", this._$);
1690
+ break;
1691
+ case 85:
1692
+ this.$ = e[t], o.addVertex(e[t]), o.addVertexMapping && o.addVertexMapping(e[t], void 0, void 0, this._$);
1693
+ break;
1694
+ case 86:
1695
+ e[t - 1].text = e[t], this.$ = e[t - 1];
1696
+ break;
1697
+ case 87:
1698
+ case 88:
1699
+ e[t - 2].text = e[t - 1], this.$ = e[t - 2];
1700
+ break;
1701
+ case 89:
1702
+ this.$ = e[t];
1703
+ break;
1704
+ case 90:
1705
+ var N = o.destructLink(e[t], e[t - 2]);
1706
+ this.$ = { type: N.type, stroke: N.stroke, length: N.length, edgeSemantic: N.edgeSemantic, text: e[t - 1] };
1707
+ break;
1708
+ case 91:
1709
+ var N = o.destructLink(e[t], e[t - 2]);
1710
+ this.$ = { type: N.type, stroke: N.stroke, length: N.length, edgeSemantic: N.edgeSemantic, text: e[t - 1], id: e[t - 3] };
1711
+ break;
1712
+ case 92:
1713
+ this.$ = { text: e[t], type: "text" };
1714
+ break;
1715
+ case 93:
1716
+ this.$ = { text: e[t - 1].text + "" + e[t], type: e[t - 1].type };
1717
+ break;
1718
+ case 94:
1719
+ this.$ = { text: e[t], type: "string" };
1720
+ break;
1721
+ case 95:
1722
+ this.$ = { text: e[t], type: "markdown" };
1723
+ break;
1724
+ case 96:
1725
+ var N = o.destructLink(e[t]);
1726
+ this.$ = { type: N.type, stroke: N.stroke, length: N.length, edgeSemantic: N.edgeSemantic };
1727
+ break;
1728
+ case 97:
1729
+ var N = o.destructLink(e[t]);
1730
+ this.$ = { type: N.type, stroke: N.stroke, length: N.length, edgeSemantic: N.edgeSemantic, id: e[t - 1] };
1731
+ break;
1732
+ case 98:
1733
+ this.$ = e[t - 1];
1734
+ break;
1735
+ case 99:
1736
+ this.$ = { text: e[t], type: "text" };
1737
+ break;
1738
+ case 100:
1739
+ this.$ = { text: e[t - 1].text + "" + e[t], type: e[t - 1].type };
1740
+ break;
1741
+ case 101:
1742
+ this.$ = { text: e[t], type: "string" };
1743
+ break;
1744
+ case 102:
1745
+ case 119:
1746
+ this.$ = { text: e[t], type: "markdown" };
1747
+ break;
1748
+ case 116:
1749
+ this.$ = { text: e[t], type: "text" };
1750
+ break;
1751
+ case 117:
1752
+ this.$ = { text: e[t - 1].text + "" + e[t], type: e[t - 1].type };
1753
+ break;
1754
+ case 118:
1755
+ this.$ = { text: e[t], type: "text" };
1756
+ break;
1757
+ case 120:
1758
+ this.$ = e[t - 4], o.addClass(e[t - 2], e[t]);
1759
+ break;
1760
+ case 121:
1761
+ this.$ = e[t - 4], o.setClass(e[t - 2], e[t]);
1762
+ break;
1763
+ case 122:
1764
+ case 130:
1765
+ this.$ = e[t - 1], o.setClickEvent(e[t - 1], e[t]);
1766
+ break;
1767
+ case 123:
1768
+ case 131:
1769
+ this.$ = e[t - 3], o.setClickEvent(e[t - 3], e[t - 2]), o.setTooltip(e[t - 3], e[t]);
1770
+ break;
1771
+ case 124:
1772
+ this.$ = e[t - 2], o.setClickEvent(e[t - 2], e[t - 1], e[t]);
1773
+ break;
1774
+ case 125:
1775
+ this.$ = e[t - 4], o.setClickEvent(e[t - 4], e[t - 3], e[t - 2]), o.setTooltip(e[t - 4], e[t]);
1776
+ break;
1777
+ case 126:
1778
+ this.$ = e[t - 2], o.setLink(e[t - 2], e[t]);
1779
+ break;
1780
+ case 127:
1781
+ this.$ = e[t - 4], o.setLink(e[t - 4], e[t - 2]), o.setTooltip(e[t - 4], e[t]);
1782
+ break;
1783
+ case 128:
1784
+ this.$ = e[t - 4], o.setLink(e[t - 4], e[t - 2], e[t]);
1785
+ break;
1786
+ case 129:
1787
+ this.$ = e[t - 6], o.setLink(e[t - 6], e[t - 4], e[t]), o.setTooltip(e[t - 6], e[t - 2]);
1788
+ break;
1789
+ case 132:
1790
+ this.$ = e[t - 1], o.setLink(e[t - 1], e[t]);
1791
+ break;
1792
+ case 133:
1793
+ this.$ = e[t - 3], o.setLink(e[t - 3], e[t - 2]), o.setTooltip(e[t - 3], e[t]);
1794
+ break;
1795
+ case 134:
1796
+ this.$ = e[t - 3], o.setLink(e[t - 3], e[t - 2], e[t]);
1797
+ break;
1798
+ case 135:
1799
+ this.$ = e[t - 5], o.setLink(e[t - 5], e[t - 4], e[t]), o.setTooltip(e[t - 5], e[t - 2]);
1800
+ break;
1801
+ case 136:
1802
+ this.$ = e[t - 4], o.addVertex(e[t - 2], void 0, void 0, e[t]);
1803
+ break;
1804
+ case 137:
1805
+ this.$ = e[t - 4], o.updateLink([e[t - 2]], e[t]);
1806
+ break;
1807
+ case 138:
1808
+ this.$ = e[t - 4], o.updateLink(e[t - 2], e[t]);
1809
+ break;
1810
+ case 139:
1811
+ this.$ = e[t - 8], o.updateLinkInterpolate([e[t - 6]], e[t - 2]), o.updateLink([e[t - 6]], e[t]);
1812
+ break;
1813
+ case 140:
1814
+ this.$ = e[t - 8], o.updateLinkInterpolate(e[t - 6], e[t - 2]), o.updateLink(e[t - 6], e[t]);
1815
+ break;
1816
+ case 141:
1817
+ this.$ = e[t - 6], o.updateLinkInterpolate([e[t - 4]], e[t]);
1818
+ break;
1819
+ case 142:
1820
+ this.$ = e[t - 6], o.updateLinkInterpolate(e[t - 4], e[t]);
1821
+ break;
1822
+ case 143:
1823
+ case 145:
1824
+ this.$ = [e[t]];
1825
+ break;
1826
+ case 144:
1827
+ case 146:
1828
+ e[t - 2].push(e[t]), this.$ = e[t - 2];
1829
+ break;
1830
+ case 148:
1831
+ this.$ = e[t - 1] + e[t];
1832
+ break;
1833
+ case 196:
1834
+ this.$ = e[t];
1835
+ break;
1836
+ case 197:
1837
+ this.$ = e[t - 1] + "" + e[t];
1838
+ break;
1839
+ case 199:
1840
+ this.$ = e[t - 1] + "" + e[t];
1841
+ break;
1842
+ case 200:
1843
+ this.$ = { stmt: "dir", value: "TB" };
1844
+ break;
1845
+ case 201:
1846
+ this.$ = { stmt: "dir", value: "BT" };
1847
+ break;
1848
+ case 202:
1849
+ this.$ = { stmt: "dir", value: "RL" };
1850
+ break;
1851
+ case 203:
1852
+ this.$ = { stmt: "dir", value: "LR" };
1853
+ break;
1854
+ case 204:
1855
+ this.$ = { stmt: "dir", value: "TD" };
1856
+ break;
1857
+ }
1858
+ }, "anonymous"),
1859
+ table: [{ 3: 1, 4: 2, 8: i, 10: n, 11: r, 13: u }, { 1: [3] }, s(l, c, { 5: 7 }), { 4: 8, 8: i, 10: n, 11: r, 13: u }, { 4: 9, 8: i, 10: n, 11: r, 13: u }, { 4: 10, 8: i, 10: n, 11: r, 13: u }, { 14: [1, 11], 15: [1, 12] }, { 1: [2, 1], 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, s(l, [2, 10]), s(l, [2, 11]), s(l, [2, 12]), s(l, [2, 13]), { 8: [1, 63], 9: [1, 60], 10: [1, 61], 11: Se, 16: 59, 19: 62 }, s(D, [2, 3]), s(D, [2, 4]), s(D, [2, 5]), s(D, [2, 6]), s(D, [2, 7]), s(D, [2, 8]), s(D, [2, 9]), { 8: Z, 9: $, 10: ee, 12: te, 22: 65, 44: 66, 75: 71, 78: [1, 72], 80: [1, 74], 81: [1, 73] }, { 8: Z, 9: $, 10: ee, 12: te, 22: 75 }, { 8: Z, 9: $, 10: ee, 12: te, 22: 76 }, { 8: Z, 9: $, 10: ee, 12: te, 22: 77 }, { 8: Z, 9: $, 10: ee, 12: te, 22: 78 }, { 8: Z, 9: $, 10: ee, 12: te, 22: 79 }, { 8: Z, 9: $, 10: ee, 11: [1, 80], 12: te, 22: 81 }, { 8: Z, 9: $, 10: ee, 12: te, 22: 82 }, { 11: [1, 83] }, s(D, [2, 48]), { 39: [1, 84] }, { 41: [1, 85] }, s(D, [2, 51]), s(Me, [2, 63], { 19: 86, 34: 87, 11: Se, 43: ye }), { 11: [1, 89] }, { 11: [1, 90] }, { 11: [1, 91] }, { 11: [1, 92] }, { 15: we, 47: Ne, 63: Re, 83: [1, 96], 92: Oe, 98: [1, 93], 100: [1, 94], 104: 95, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke, 123: 97 }, s(D, [2, 200]), s(D, [2, 201]), s(D, [2, 202]), s(D, [2, 203]), s(D, [2, 204]), s(Ie, [2, 64]), s(Ie, [2, 67], { 49: [1, 109] }), s(X, [2, 85], { 116: 122, 30: [1, 110], 47: d, 51: [1, 111], 53: [1, 112], 55: [1, 113], 57: [1, 114], 59: [1, 115], 61: [1, 116], 63: f, 66: [1, 117], 68: [1, 118], 70: [1, 119], 71: [1, 120], 73: [1, 121], 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 117: K, 118: H, 119: Y }), s(ne, [2, 196]), s(ne, [2, 157]), s(ne, [2, 158]), s(ne, [2, 159]), s(ne, [2, 160]), s(ne, [2, 161]), s(ne, [2, 162]), s(ne, [2, 163]), s(ne, [2, 164]), s(ne, [2, 165]), s(ne, [2, 166]), s(ne, [2, 167]), s(l, [2, 14]), s(l, [2, 20]), s(l, [2, 21]), { 10: [1, 123] }, s(l, [2, 23]), s(jt, [2, 31], { 19: 124, 11: Se }), s(D, [2, 32]), { 45: 125, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, s(D, [2, 52]), s(D, [2, 53]), s(D, [2, 54]), s(D, [2, 55]), s(He, [2, 89], { 76: 126, 65: [1, 128], 77: [1, 127] }), { 79: 129, 82: 130, 83: zt, 84: Wt, 119: st, 122: it }, { 78: [1, 135], 80: [1, 136] }, s(Kt, [2, 96]), s(D, [2, 33]), s(D, [2, 34]), s(D, [2, 35]), s(D, [2, 36]), s(D, [2, 37]), { 11: nt, 13: rt, 15: at, 28: ot, 29: 137, 33: ut, 35: lt, 36: ct, 47: dt, 63: ht, 78: pt, 83: Ht, 84: Yt, 86: 150, 87: ft, 88: gt, 89: mt, 90: bt, 91: At, 92: kt, 93: Et, 94: 138, 108: Ct, 112: St, 114: xt, 117: Tt, 118: Dt, 119: _t }, s(Ye, c, { 5: 165 }), s(Ye, c, { 5: 166 }), { 11: nt, 13: rt, 15: at, 28: ot, 29: 167, 33: ut, 35: lt, 36: ct, 47: dt, 63: ht, 78: pt, 83: Ht, 84: Yt, 86: 150, 87: ft, 88: gt, 89: mt, 90: bt, 91: At, 92: kt, 93: Et, 94: 138, 108: Ct, 112: St, 114: xt, 117: Tt, 118: Dt, 119: _t }, s(D, [2, 49]), s(D, [2, 50]), s(Me, [2, 61], { 47: qt }), s(Me, [2, 62], { 19: 169, 11: Se, 43: qe }), s(Ie, [2, 57]), { 47: d, 50: 171, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, { 105: [1, 172], 106: 173, 108: [1, 174] }, { 47: d, 50: 175, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, { 47: d, 50: 176, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, s(P, [2, 122], { 11: [1, 177], 99: [1, 178] }), { 83: [1, 179] }, s(P, [2, 130], { 123: 181, 11: [1, 180], 15: we, 47: Ne, 63: Re, 92: Oe, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke }), s(P, [2, 132], { 11: [1, 182] }), s(re, [2, 198]), s(re, [2, 185]), s(re, [2, 186]), s(re, [2, 187]), s(re, [2, 188]), s(re, [2, 189]), s(re, [2, 190]), s(re, [2, 191]), s(re, [2, 192]), s(re, [2, 193]), s(re, [2, 194]), s(re, [2, 195]), { 47: d, 50: 183, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, { 31: 184, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 192, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 194, 53: [1, 193], 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 195, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 196, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 197, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 112: [1, 198] }, { 31: 199, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 200, 68: [1, 201], 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 202, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 203, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 31: 204, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, s(ne, [2, 197]), s(l, [2, 22]), s(jt, [2, 30]), s(Me, [2, 59], { 34: 205, 19: 206, 11: Se, 43: ye }), s(He, [2, 86], { 11: [1, 207] }), { 11: [1, 208] }, { 31: 209, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 80: [1, 210], 82: 211, 119: st, 122: it }, s(Xe, [2, 92]), s(Xe, [2, 94]), s(Xe, [2, 95]), s(Xe, [2, 183]), s(Xe, [2, 184]), { 79: 212, 82: 130, 83: zt, 84: Wt, 119: st, 122: it }, s(Kt, [2, 97]), { 8: Z, 9: $, 10: ee, 11: nt, 12: te, 13: rt, 15: at, 22: 214, 28: ot, 30: [1, 213], 33: ut, 34: 215, 35: lt, 36: ct, 43: ye, 47: dt, 63: ht, 78: pt, 86: 150, 87: ft, 88: gt, 89: mt, 90: bt, 91: At, 92: kt, 93: Et, 94: 216, 108: Ct, 112: St, 114: xt, 117: Tt, 118: Dt, 119: _t }, s(y, [2, 116]), s(y, [2, 118]), s(y, [2, 119]), s(y, [2, 172]), s(y, [2, 173]), s(y, [2, 174]), s(y, [2, 175]), s(y, [2, 176]), s(y, [2, 177]), s(y, [2, 178]), s(y, [2, 179]), s(y, [2, 180]), s(y, [2, 181]), s(y, [2, 182]), s(y, [2, 103]), s(y, [2, 104]), s(y, [2, 105]), s(y, [2, 106]), s(y, [2, 107]), s(y, [2, 108]), s(y, [2, 109]), s(y, [2, 110]), s(y, [2, 111]), s(y, [2, 112]), s(y, [2, 113]), s(y, [2, 114]), s(y, [2, 115]), { 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 33: [1, 217], 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, { 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 33: [1, 218], 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, { 8: Z, 9: $, 10: ee, 11: nt, 12: te, 13: rt, 15: at, 22: 220, 28: ot, 30: [1, 219], 33: ut, 34: 221, 35: lt, 36: ct, 43: ye, 47: dt, 63: ht, 78: pt, 86: 150, 87: ft, 88: gt, 89: mt, 90: bt, 91: At, 92: kt, 93: Et, 94: 216, 108: Ct, 112: St, 114: xt, 117: Tt, 118: Dt, 119: _t }, { 11: Se, 19: 222 }, { 47: [1, 223] }, s(Ie, [2, 56]), { 11: [1, 224], 47: d, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 122, 117: K, 118: H, 119: Y }, { 11: [1, 225] }, { 11: [1, 226], 109: [1, 227] }, s(Xt, [2, 143]), { 11: [1, 228], 47: d, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 122, 117: K, 118: H, 119: Y }, { 11: [1, 229], 47: d, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 122, 117: K, 118: H, 119: Y }, { 83: [1, 230] }, s(P, [2, 124], { 11: [1, 231] }), s(P, [2, 126], { 11: [1, 232] }), { 83: [1, 233] }, s(re, [2, 199]), { 83: [1, 234], 101: [1, 235] }, s(Ie, [2, 68], { 116: 122, 47: d, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 117: K, 118: H, 119: Y }), { 32: [1, 236], 70: _, 85: 237, 119: v, 120: F, 121: V }, s(xe, [2, 99]), s(xe, [2, 101]), s(xe, [2, 102]), s(xe, [2, 168]), s(xe, [2, 169]), s(xe, [2, 170]), s(xe, [2, 171]), { 52: [1, 238], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 31: 239, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 54: [1, 240], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 56: [1, 241], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 58: [1, 242], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 60: [1, 243], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 63: [1, 244] }, { 67: [1, 245], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 69: [1, 246], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 31: 247, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, { 32: [1, 248], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 70: _, 72: [1, 249], 74: [1, 250], 85: 237, 119: v, 120: F, 121: V }, { 70: _, 72: [1, 252], 74: [1, 251], 85: 237, 119: v, 120: F, 121: V }, s(Me, [2, 58], { 19: 169, 11: Se, 43: qe }), s(Me, [2, 60], { 47: qt }), s(He, [2, 88]), s(He, [2, 87]), { 65: [1, 253], 70: _, 85: 237, 119: v, 120: F, 121: V }, s(He, [2, 90]), s(Xe, [2, 93]), { 80: [1, 254], 82: 211, 119: st, 122: it }, { 31: 255, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, s(Ye, c, { 5: 256 }), { 8: Z, 9: $, 10: ee, 12: te, 22: 257, 43: qe }, s(y, [2, 117]), s(D, [2, 42]), s(D, [2, 43]), { 31: 258, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, s(D, [2, 46]), { 8: Z, 9: $, 10: ee, 12: te, 22: 259, 43: qe }, { 46: 260, 47: d, 48: 45, 50: 46, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, { 11: Se, 19: 261 }, { 11: he, 63: pe, 87: fe, 95: 262, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 11: he, 63: pe, 87: fe, 95: 273, 107: [1, 274], 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 11: he, 63: pe, 87: fe, 95: 275, 107: [1, 276], 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 108: [1, 277] }, { 11: he, 63: pe, 87: fe, 95: 278, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 47: d, 50: 279, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, s(P, [2, 123]), { 83: [1, 280] }, { 83: [1, 281], 101: [1, 282] }, s(P, [2, 131]), s(P, [2, 133], { 11: [1, 283] }), s(P, [2, 134]), s(X, [2, 69]), s(xe, [2, 100]), s(X, [2, 70]), { 54: [1, 284], 70: _, 85: 237, 119: v, 120: F, 121: V }, s(X, [2, 77]), s(X, [2, 72]), s(X, [2, 73]), s(X, [2, 74]), { 112: [1, 285] }, s(X, [2, 76]), s(X, [2, 78]), { 69: [1, 286], 70: _, 85: 237, 119: v, 120: F, 121: V }, s(X, [2, 80]), s(X, [2, 81]), s(X, [2, 83]), s(X, [2, 82]), s(X, [2, 84]), s([11, 47, 63, 92, 105, 108, 109, 112, 114, 117, 118, 119], [2, 98]), s(He, [2, 91]), { 32: [1, 287], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 33: [1, 288], 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, s(Ye, c, { 5: 289 }), { 32: [1, 290], 70: _, 85: 237, 119: v, 120: F, 121: V }, s(D, [2, 47]), s(Ie, [2, 66]), { 46: 291, 47: d, 48: 45, 50: 46, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y }, s(P, [2, 136], { 109: Je }), s(Jt, [2, 145], { 111: 293, 11: he, 63: pe, 87: fe, 108: ge, 112: me, 113: be, 114: Ae, 115: ke }), s(ce, [2, 147]), s(ce, [2, 149]), s(ce, [2, 150]), s(ce, [2, 151]), s(ce, [2, 152]), s(ce, [2, 153]), s(ce, [2, 154]), s(ce, [2, 155]), s(ce, [2, 156]), s(P, [2, 137], { 109: Je }), { 11: [1, 294] }, s(P, [2, 138], { 109: Je }), { 11: [1, 295] }, s(Xt, [2, 144]), s(P, [2, 120], { 109: Je }), s(P, [2, 121], { 116: 122, 47: d, 63: f, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 117: K, 118: H, 119: Y }), s(P, [2, 125]), s(P, [2, 127], { 11: [1, 296] }), s(P, [2, 128]), { 101: [1, 297] }, { 54: [1, 298] }, { 65: [1, 299] }, { 69: [1, 300] }, { 8: Z, 9: $, 10: ee, 12: te, 22: 301, 34: 302, 43: ye }, s(D, [2, 40]), { 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 33: [1, 303], 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, { 8: Z, 9: $, 10: ee, 12: te, 22: 304, 34: 305, 43: ye }, s(Ie, [2, 65]), { 11: he, 63: pe, 87: fe, 108: ge, 110: 306, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, s(ce, [2, 148]), { 15: we, 47: Ne, 63: Re, 92: Oe, 104: 307, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke, 123: 97 }, { 15: we, 47: Ne, 63: Re, 92: Oe, 104: 308, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke, 123: 97 }, { 101: [1, 309] }, s(P, [2, 135]), s(X, [2, 71]), { 31: 310, 70: _, 83: J, 84: Q, 85: 185, 119: v, 120: F, 121: V }, s(X, [2, 79]), s(Ye, c, { 5: 311 }), { 8: Z, 9: $, 10: ee, 12: te, 22: 312, 43: qe }, s(D, [2, 41]), s(D, [2, 44]), { 8: Z, 9: $, 10: ee, 12: te, 22: 313, 43: qe }, s(Jt, [2, 146], { 111: 293, 11: he, 63: pe, 87: fe, 108: ge, 112: me, 113: be, 114: Ae, 115: ke }), s(P, [2, 141], { 123: 181, 11: [1, 314], 15: we, 47: Ne, 63: Re, 92: Oe, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke }), s(P, [2, 142], { 123: 181, 11: [1, 315], 15: we, 47: Ne, 63: Re, 92: Oe, 108: Pe, 109: Ge, 112: Ue, 114: je, 117: ze, 118: We, 119: Ke }), s(P, [2, 129]), { 32: [1, 316], 70: _, 85: 237, 119: v, 120: F, 121: V }, { 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 33: [1, 317], 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, s(Ye, c, { 5: 318 }), s(D, [2, 45]), { 11: he, 63: pe, 87: fe, 95: 319, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, { 11: he, 63: pe, 87: fe, 95: 320, 108: ge, 110: 263, 111: 264, 112: me, 113: be, 114: Ae, 115: ke }, s(X, [2, 75]), s(D, [2, 38]), { 6: 13, 7: 14, 8: a, 9: h, 10: g, 11: p, 12: A, 21: 20, 23: 21, 24: 22, 25: 23, 26: 24, 27: 25, 28: x, 33: [1, 321], 35: L, 36: C, 37: 29, 38: M, 40: T, 42: m, 45: 33, 46: 44, 47: d, 48: 45, 50: 46, 63: f, 87: B, 88: R, 89: se, 90: de, 91: le, 92: O, 105: G, 108: U, 109: j, 112: z, 114: W, 116: 47, 117: K, 118: H, 119: Y, 124: De, 125: _e, 126: ve, 127: Fe, 128: Ve }, s(P, [2, 139], { 109: Je }), s(P, [2, 140], { 109: Je }), s(D, [2, 39])],
1860
+ defaultActions: {},
1861
+ parseError: /* @__PURE__ */ k(function(b, E) {
1862
+ if (E.recoverable)
1863
+ this.trace(b);
1864
+ else {
1865
+ var S = new Error(b);
1866
+ throw S.hash = E, S;
1867
+ }
1868
+ }, "parseError"),
1869
+ parse: /* @__PURE__ */ k(function(b) {
1870
+ var E = this, S = [0], o = [], w = [null], e = [], I = this.table, t = "", N = 0, Qt = 0, g1 = 2, Zt = 1, m1 = e.slice.call(arguments, 1), q = Object.create(this.lexer), Le = { yy: {} };
1871
+ for (var Mt in this.yy)
1872
+ Object.prototype.hasOwnProperty.call(this.yy, Mt) && (Le.yy[Mt] = this.yy[Mt]);
1873
+ q.setInput(b, Le.yy), Le.yy.lexer = q, Le.yy.parser = this, typeof q.yylloc > "u" && (q.yylloc = {});
1874
+ var yt = q.yylloc;
1875
+ e.push(yt);
1876
+ var b1 = q.options && q.options.ranges;
1877
+ typeof Le.yy.parseError == "function" ? this.parseError = Le.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1878
+ function A1(ae) {
1879
+ S.length = S.length - 2 * ae, w.length = w.length - ae, e.length = e.length - ae;
1880
+ }
1881
+ k(A1, "popStack");
1882
+ function $t() {
1883
+ var ae;
1884
+ return ae = o.pop() || q.lex() || Zt, typeof ae != "number" && (ae instanceof Array && (o = ae, ae = o.pop()), ae = E.symbols_[ae] || ae), ae;
1885
+ }
1886
+ k($t, "lex");
1887
+ for (var ie, Be, ue, wt, Qe = {}, Ft, Ee, e1, Vt; ; ) {
1888
+ if (Be = S[S.length - 1], this.defaultActions[Be] ? ue = this.defaultActions[Be] : ((ie === null || typeof ie > "u") && (ie = $t()), ue = I[Be] && I[Be][ie]), typeof ue > "u" || !ue.length || !ue[0]) {
1889
+ var Nt = "";
1890
+ Vt = [];
1891
+ for (Ft in I[Be])
1892
+ this.terminals_[Ft] && Ft > g1 && Vt.push("'" + this.terminals_[Ft] + "'");
1893
+ q.showPosition ? Nt = "Parse error on line " + (N + 1) + `:
1894
+ ` + q.showPosition() + `
1895
+ Expecting ` + Vt.join(", ") + ", got '" + (this.terminals_[ie] || ie) + "'" : Nt = "Parse error on line " + (N + 1) + ": Unexpected " + (ie == Zt ? "end of input" : "'" + (this.terminals_[ie] || ie) + "'"), this.parseError(Nt, {
1896
+ text: q.match,
1897
+ token: this.terminals_[ie] || ie,
1898
+ line: q.yylineno,
1899
+ loc: yt,
1900
+ expected: Vt
1901
+ });
1902
+ }
1903
+ if (ue[0] instanceof Array && ue.length > 1)
1904
+ throw new Error("Parse Error: multiple actions possible at state: " + Be + ", token: " + ie);
1905
+ switch (ue[0]) {
1906
+ case 1:
1907
+ S.push(ie), w.push(q.yytext), e.push(q.yylloc), S.push(ue[1]), ie = null, Qt = q.yyleng, t = q.yytext, N = q.yylineno, yt = q.yylloc;
1908
+ break;
1909
+ case 2:
1910
+ if (Ee = this.productions_[ue[1]][1], Qe.$ = w[w.length - Ee], Qe._$ = {
1911
+ first_line: e[e.length - (Ee || 1)].first_line,
1912
+ last_line: e[e.length - 1].last_line,
1913
+ first_column: e[e.length - (Ee || 1)].first_column,
1914
+ last_column: e[e.length - 1].last_column
1915
+ }, b1 && (Qe._$.range = [
1916
+ e[e.length - (Ee || 1)].range[0],
1917
+ e[e.length - 1].range[1]
1918
+ ]), wt = this.performAction.apply(Qe, [
1919
+ t,
1920
+ Qt,
1921
+ N,
1922
+ Le.yy,
1923
+ ue[1],
1924
+ w,
1925
+ e
1926
+ ].concat(m1)), typeof wt < "u")
1927
+ return wt;
1928
+ Ee && (S = S.slice(0, -1 * Ee * 2), w = w.slice(0, -1 * Ee), e = e.slice(0, -1 * Ee)), S.push(this.productions_[ue[1]][0]), w.push(Qe.$), e.push(Qe._$), e1 = I[S[S.length - 2]][S[S.length - 1]], S.push(e1);
1929
+ break;
1930
+ case 3:
1931
+ return !0;
1932
+ }
1933
+ }
1934
+ return !0;
1935
+ }, "parse")
1936
+ }, f1 = /* @__PURE__ */ (function() {
1937
+ var Te = {
1938
+ EOF: 1,
1939
+ parseError: /* @__PURE__ */ k(function(E, S) {
1940
+ if (this.yy.parser)
1941
+ this.yy.parser.parseError(E, S);
1942
+ else
1943
+ throw new Error(E);
1944
+ }, "parseError"),
1945
+ // resets the lexer, sets new input
1946
+ setInput: /* @__PURE__ */ k(function(b, E) {
1947
+ return this.yy = E || this.yy || {}, this._input = b, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
1948
+ first_line: 1,
1949
+ first_column: 0,
1950
+ last_line: 1,
1951
+ last_column: 0
1952
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1953
+ }, "setInput"),
1954
+ // consumes and returns one char from the input
1955
+ input: /* @__PURE__ */ k(function() {
1956
+ var b = this._input[0];
1957
+ this.yytext += b, this.yyleng++, this.offset++, this.match += b, this.matched += b;
1958
+ var E = b.match(/(?:\r\n?|\n).*/g);
1959
+ return E ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), b;
1960
+ }, "input"),
1961
+ // unshifts one char (or a string) into the input
1962
+ unput: /* @__PURE__ */ k(function(b) {
1963
+ var E = b.length, S = b.split(/(?:\r\n?|\n)/g);
1964
+ this._input = b + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - E), this.offset -= E;
1965
+ var o = this.match.split(/(?:\r\n?|\n)/g);
1966
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), S.length - 1 && (this.yylineno -= S.length - 1);
1967
+ var w = this.yylloc.range;
1968
+ return this.yylloc = {
1969
+ first_line: this.yylloc.first_line,
1970
+ last_line: this.yylineno + 1,
1971
+ first_column: this.yylloc.first_column,
1972
+ last_column: S ? (S.length === o.length ? this.yylloc.first_column : 0) + o[o.length - S.length].length - S[0].length : this.yylloc.first_column - E
1973
+ }, this.options.ranges && (this.yylloc.range = [w[0], w[0] + this.yyleng - E]), this.yyleng = this.yytext.length, this;
1974
+ }, "unput"),
1975
+ // When called from action, caches matched text and appends it on next action
1976
+ more: /* @__PURE__ */ k(function() {
1977
+ return this._more = !0, this;
1978
+ }, "more"),
1979
+ // 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.
1980
+ reject: /* @__PURE__ */ k(function() {
1981
+ if (this.options.backtrack_lexer)
1982
+ this._backtrack = !0;
1983
+ else
1984
+ 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).
1985
+ ` + this.showPosition(), {
1986
+ text: "",
1987
+ token: null,
1988
+ line: this.yylineno
1989
+ });
1990
+ return this;
1991
+ }, "reject"),
1992
+ // retain first n characters of the match
1993
+ less: /* @__PURE__ */ k(function(b) {
1994
+ this.unput(this.match.slice(b));
1995
+ }, "less"),
1996
+ // displays already matched input, i.e. for error messages
1997
+ pastInput: /* @__PURE__ */ k(function() {
1998
+ var b = this.matched.substr(0, this.matched.length - this.match.length);
1999
+ return (b.length > 20 ? "..." : "") + b.substr(-20).replace(/\n/g, "");
2000
+ }, "pastInput"),
2001
+ // displays upcoming input, i.e. for error messages
2002
+ upcomingInput: /* @__PURE__ */ k(function() {
2003
+ var b = this.match;
2004
+ return b.length < 20 && (b += this._input.substr(0, 20 - b.length)), (b.substr(0, 20) + (b.length > 20 ? "..." : "")).replace(/\n/g, "");
2005
+ }, "upcomingInput"),
2006
+ // displays the character position where the lexing error occurred, i.e. for error messages
2007
+ showPosition: /* @__PURE__ */ k(function() {
2008
+ var b = this.pastInput(), E = new Array(b.length + 1).join("-");
2009
+ return b + this.upcomingInput() + `
2010
+ ` + E + "^";
2011
+ }, "showPosition"),
2012
+ // test the lexed token: return FALSE when not a match, otherwise return token
2013
+ test_match: /* @__PURE__ */ k(function(b, E) {
2014
+ var S, o, w;
2015
+ if (this.options.backtrack_lexer && (w = {
2016
+ yylineno: this.yylineno,
2017
+ yylloc: {
2018
+ first_line: this.yylloc.first_line,
2019
+ last_line: this.last_line,
2020
+ first_column: this.yylloc.first_column,
2021
+ last_column: this.yylloc.last_column
2022
+ },
2023
+ yytext: this.yytext,
2024
+ match: this.match,
2025
+ matches: this.matches,
2026
+ matched: this.matched,
2027
+ yyleng: this.yyleng,
2028
+ offset: this.offset,
2029
+ _more: this._more,
2030
+ _input: this._input,
2031
+ yy: this.yy,
2032
+ conditionStack: this.conditionStack.slice(0),
2033
+ done: this.done
2034
+ }, this.options.ranges && (w.yylloc.range = this.yylloc.range.slice(0))), o = b[0].match(/(?:\r\n?|\n).*/g), o && (this.yylineno += o.length), this.yylloc = {
2035
+ first_line: this.yylloc.last_line,
2036
+ last_line: this.yylineno + 1,
2037
+ first_column: this.yylloc.last_column,
2038
+ last_column: o ? o[o.length - 1].length - o[o.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + b[0].length
2039
+ }, this.yytext += b[0], this.match += b[0], this.matches = b, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(b[0].length), this.matched += b[0], S = this.performAction.call(this, this.yy, this, E, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), S)
2040
+ return S;
2041
+ if (this._backtrack) {
2042
+ for (var e in w)
2043
+ this[e] = w[e];
2044
+ return !1;
2045
+ }
2046
+ return !1;
2047
+ }, "test_match"),
2048
+ // return next match in input
2049
+ next: /* @__PURE__ */ k(function() {
2050
+ if (this.done)
2051
+ return this.EOF;
2052
+ this._input || (this.done = !0);
2053
+ var b, E, S, o;
2054
+ this._more || (this.yytext = "", this.match = "");
2055
+ for (var w = this._currentRules(), e = 0; e < w.length; e++)
2056
+ if (S = this._input.match(this.rules[w[e]]), S && (!E || S[0].length > E[0].length)) {
2057
+ if (E = S, o = e, this.options.backtrack_lexer) {
2058
+ if (b = this.test_match(S, w[e]), b !== !1)
2059
+ return b;
2060
+ if (this._backtrack) {
2061
+ E = !1;
2062
+ continue;
2063
+ } else
2064
+ return !1;
2065
+ } else if (!this.options.flex)
2066
+ break;
2067
+ }
2068
+ return E ? (b = this.test_match(E, w[o]), b !== !1 ? b : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
2069
+ ` + this.showPosition(), {
2070
+ text: "",
2071
+ token: null,
2072
+ line: this.yylineno
2073
+ });
2074
+ }, "next"),
2075
+ // return next match that has a token
2076
+ lex: /* @__PURE__ */ k(function() {
2077
+ var E = this.next();
2078
+ return E || this.lex();
2079
+ }, "lex"),
2080
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
2081
+ begin: /* @__PURE__ */ k(function(E) {
2082
+ this.conditionStack.push(E);
2083
+ }, "begin"),
2084
+ // pop the previously active lexer condition state off the condition stack
2085
+ popState: /* @__PURE__ */ k(function() {
2086
+ var E = this.conditionStack.length - 1;
2087
+ return E > 0 ? this.conditionStack.pop() : this.conditionStack[0];
2088
+ }, "popState"),
2089
+ // produce the lexer rule set which is active for the currently active lexer condition state
2090
+ _currentRules: /* @__PURE__ */ k(function() {
2091
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
2092
+ }, "_currentRules"),
2093
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
2094
+ topState: /* @__PURE__ */ k(function(E) {
2095
+ return E = this.conditionStack.length - 1 - Math.abs(E || 0), E >= 0 ? this.conditionStack[E] : "INITIAL";
2096
+ }, "topState"),
2097
+ // alias for begin(condition)
2098
+ pushState: /* @__PURE__ */ k(function(E) {
2099
+ this.begin(E);
2100
+ }, "pushState"),
2101
+ // return the number of states currently on the stack
2102
+ stateStackSize: /* @__PURE__ */ k(function() {
2103
+ return this.conditionStack.length;
2104
+ }, "stateStackSize"),
2105
+ options: {},
2106
+ performAction: /* @__PURE__ */ k(function(E, S, o, w) {
2107
+ switch (o) {
2108
+ case 0:
2109
+ return this.begin("acc_title"), 38;
2110
+ case 1:
2111
+ return this.popState(), "acc_title_value";
2112
+ case 2:
2113
+ return this.begin("acc_descr"), 40;
2114
+ case 3:
2115
+ return this.popState(), "acc_descr_value";
2116
+ case 4:
2117
+ this.begin("acc_descr_multiline");
2118
+ break;
2119
+ case 5:
2120
+ this.popState();
2121
+ break;
2122
+ case 6:
2123
+ return "acc_descr_multiline_value";
2124
+ case 7:
2125
+ return this.pushState("shapeData"), S.yytext = "", 43;
2126
+ case 8:
2127
+ return this.pushState("shapeDataStr"), 43;
2128
+ case 9:
2129
+ return this.popState(), 43;
2130
+ case 10:
2131
+ const e = /\n\s*/g;
2132
+ return S.yytext = S.yytext.replace(e, "<br/>"), 43;
2133
+ case 11:
2134
+ return 43;
2135
+ case 12:
2136
+ this.popState();
2137
+ break;
2138
+ case 13:
2139
+ this.begin("callbackname");
2140
+ break;
2141
+ case 14:
2142
+ this.popState();
2143
+ break;
2144
+ case 15:
2145
+ this.popState(), this.begin("callbackargs");
2146
+ break;
2147
+ case 16:
2148
+ return 98;
2149
+ case 17:
2150
+ this.popState();
2151
+ break;
2152
+ case 18:
2153
+ return 99;
2154
+ case 19:
2155
+ return "MD_STR";
2156
+ case 20:
2157
+ this.popState();
2158
+ break;
2159
+ case 21:
2160
+ this.begin("md_string");
2161
+ break;
2162
+ case 22:
2163
+ return "STR";
2164
+ case 23:
2165
+ this.popState();
2166
+ break;
2167
+ case 24:
2168
+ this.pushState("string");
2169
+ break;
2170
+ case 25:
2171
+ return 87;
2172
+ case 26:
2173
+ return 105;
2174
+ case 27:
2175
+ return 88;
2176
+ case 28:
2177
+ return 107;
2178
+ case 29:
2179
+ return 89;
2180
+ case 30:
2181
+ return 90;
2182
+ case 31:
2183
+ return 100;
2184
+ case 32:
2185
+ this.begin("click");
2186
+ break;
2187
+ case 33:
2188
+ this.popState();
2189
+ break;
2190
+ case 34:
2191
+ return 91;
2192
+ case 35:
2193
+ return E.lex.firstGraph() && this.begin("dir"), 13;
2194
+ case 36:
2195
+ return 28;
2196
+ case 37:
2197
+ return 36;
2198
+ case 38:
2199
+ return 35;
2200
+ case 39:
2201
+ return 33;
2202
+ case 40:
2203
+ return 101;
2204
+ case 41:
2205
+ return 101;
2206
+ case 42:
2207
+ return 101;
2208
+ case 43:
2209
+ return 101;
2210
+ case 44:
2211
+ return this.popState(), 14;
2212
+ case 45:
2213
+ return this.popState(), 15;
2214
+ case 46:
2215
+ return this.popState(), 15;
2216
+ case 47:
2217
+ return this.popState(), 15;
2218
+ case 48:
2219
+ return this.popState(), 15;
2220
+ case 49:
2221
+ return this.popState(), 15;
2222
+ case 50:
2223
+ return this.popState(), 15;
2224
+ case 51:
2225
+ return this.popState(), 15;
2226
+ case 52:
2227
+ return this.popState(), 15;
2228
+ case 53:
2229
+ return this.popState(), 15;
2230
+ case 54:
2231
+ return this.popState(), 15;
2232
+ case 55:
2233
+ return 124;
2234
+ case 56:
2235
+ return 125;
2236
+ case 57:
2237
+ return 126;
2238
+ case 58:
2239
+ return 127;
2240
+ case 59:
2241
+ return 128;
2242
+ case 60:
2243
+ return 81;
2244
+ case 61:
2245
+ return 108;
2246
+ case 62:
2247
+ return 114;
2248
+ case 63:
2249
+ return 49;
2250
+ case 64:
2251
+ return 63;
2252
+ case 65:
2253
+ return 47;
2254
+ case 66:
2255
+ return 9;
2256
+ case 67:
2257
+ return 109;
2258
+ case 68:
2259
+ return 118;
2260
+ case 69:
2261
+ return this.popState(), 80;
2262
+ case 70:
2263
+ return this.pushState("edgeText"), 78;
2264
+ case 71:
2265
+ return 122;
2266
+ case 72:
2267
+ return 80;
2268
+ case 73:
2269
+ break;
2270
+ case 74:
2271
+ return this.popState(), 56;
2272
+ case 75:
2273
+ return "TEXT";
2274
+ case 76:
2275
+ return this.pushState("ellipseText"), 55;
2276
+ case 77:
2277
+ return this.popState(), 58;
2278
+ case 78:
2279
+ return this.pushState("text"), 57;
2280
+ case 79:
2281
+ return this.popState(), 60;
2282
+ case 80:
2283
+ return this.pushState("text"), 59;
2284
+ case 81:
2285
+ return 61;
2286
+ case 82:
2287
+ return this.pushState("text"), 70;
2288
+ case 83:
2289
+ return this.popState(), 67;
2290
+ case 84:
2291
+ return this.pushState("text"), 66;
2292
+ case 85:
2293
+ return this.popState(), 52;
2294
+ case 86:
2295
+ return this.pushState("text"), 51;
2296
+ case 87:
2297
+ break;
2298
+ case 88:
2299
+ return this.popState(), 72;
2300
+ case 89:
2301
+ return this.popState(), 74;
2302
+ case 90:
2303
+ return 120;
2304
+ case 91:
2305
+ return this.pushState("trapText"), 71;
2306
+ case 92:
2307
+ return this.pushState("trapText"), 73;
2308
+ case 93:
2309
+ return 121;
2310
+ case 94:
2311
+ return 70;
2312
+ case 95:
2313
+ return 93;
2314
+ case 96:
2315
+ return "SEP";
2316
+ case 97:
2317
+ return 92;
2318
+ case 98:
2319
+ return 118;
2320
+ case 99:
2321
+ return 114;
2322
+ case 100:
2323
+ return 47;
2324
+ case 101:
2325
+ return 8;
2326
+ case 102:
2327
+ return 112;
2328
+ case 103:
2329
+ return 117;
2330
+ case 104:
2331
+ return 119;
2332
+ case 105:
2333
+ return this.popState(), 65;
2334
+ case 106:
2335
+ return this.pushState("text"), 65;
2336
+ case 107:
2337
+ return this.popState(), 54;
2338
+ case 108:
2339
+ return this.pushState("text"), 53;
2340
+ case 109:
2341
+ return this.popState(), 32;
2342
+ case 110:
2343
+ return this.pushState("text"), 30;
2344
+ case 111:
2345
+ return this.popState(), 69;
2346
+ case 112:
2347
+ return this.pushState("text"), 68;
2348
+ case 113:
2349
+ break;
2350
+ case 114:
2351
+ return "TEXT";
2352
+ case 115:
2353
+ return "QUOTE";
2354
+ case 116:
2355
+ return 10;
2356
+ case 117:
2357
+ return 11;
2358
+ case 118:
2359
+ return 12;
2360
+ }
2361
+ }, "anonymous"),
2362
+ rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:@\{)/, /^(?:["])/, /^(?:["])/, /^(?:[^\"]+)/, /^(?:[^}^"]+)/, /^(?:\})/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:agentflow-beta\b)/, /^(?:flow\b)/, /^(?:connector\b)/, /^(?:global\b[ \t]*)/, /^(?:end\b[ \t]*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:.*direction\s+TD[^\n]*)/, /^(?:[^\s\"]+@(?=[^\{\"]))/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*--+[x>]\s*)/, /^(?:\s*--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*-\.+-\s*)/, /^(?:%%(?!\{)[^\n]*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:%%(?!\{)[^\n]*)/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:[ \t]*%%(?!\{)[^\n]*)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:%%(?!\{)[^\n]*)/, /^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/],
2363
+ conditions: { shapeDataEndBracket: { rules: [21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, shapeDataStr: { rules: [9, 10, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, shapeData: { rules: [8, 11, 12, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, callbackargs: { rules: [17, 18, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, callbackname: { rules: [14, 15, 16, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, href: { rules: [21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, click: { rules: [21, 24, 33, 34, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, edgeText: { rules: [21, 24, 69, 71, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, trapText: { rules: [21, 24, 76, 78, 80, 84, 86, 87, 88, 89, 90, 91, 92, 106, 108, 110, 112], inclusive: !1 }, ellipseText: { rules: [21, 24, 73, 74, 75, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, text: { rules: [21, 24, 76, 77, 78, 79, 80, 83, 84, 85, 86, 91, 92, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114], inclusive: !1 }, vertex: { rules: [21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, dir: { rules: [21, 24, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, acc_descr_multiline: { rules: [5, 6, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, acc_descr: { rules: [3, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, acc_title: { rules: [1, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, md_string: { rules: [19, 20, 21, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, string: { rules: [21, 22, 23, 24, 76, 78, 80, 84, 86, 91, 92, 106, 108, 110, 112], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 13, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 76, 78, 80, 81, 82, 84, 86, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 106, 108, 110, 112, 115, 116, 117, 118], inclusive: !0 } }
2364
+ };
2365
+ return Te;
2366
+ })();
2367
+ Bt.lexer = f1;
2368
+ function vt() {
2369
+ this.yy = {};
2370
+ }
2371
+ return k(vt, "Parser"), vt.prototype = Bt, Bt.Parser = vt, new vt();
2372
+ })();
2373
+ Ut.parser = Ut;
2374
+ var h1 = Ut, p1 = Object.assign({}, h1);
2375
+ p1.parse = (s) => {
2376
+ const i = s.replace(/}[^\S\n]*\n/g, `}
2377
+ `);
2378
+ return h1.parse(i);
2379
+ };
2380
+ var $1 = p1, es = /* @__PURE__ */ k((s) => {
2381
+ const { theme: i, bkgColorArray: n, borderColorArray: r } = s;
2382
+ if (!w1(i, r))
2383
+ return "";
2384
+ const u = N1(s.look), l = R1(n), c = O1(s.THEME_COLOR_LIMIT, r), a = /* @__PURE__ */ k((p) => r[p % r.length], "border"), h = /* @__PURE__ */ k((p) => l ? `fill: ${n[p % n.length]};` : "", "fill");
2385
+ let g = "";
2386
+ for (const p of H1) {
2387
+ const A = Lt.get(p), x = `[data-look="${u}"].node.${o1(p)}`;
2388
+ g += `
2389
+
2390
+ ${x} rect,
2391
+ ${x} path,
2392
+ ${x} polygon {
2393
+ stroke: ${a(A)};
2394
+ ${h(A)}
2395
+ }
2396
+ `;
2397
+ }
2398
+ for (let p = 0; p < u1(c); p++) {
2399
+ const A = l1(p, c), x = `[data-look="${u}"][data-color-id="color-${A}"].cluster`, L = `[data-look="${u}"][data-color-id="color-${A}"].node`, C = /* @__PURE__ */ k((M) => `${x} ${M}, ${L} ${M}`, "rule");
2400
+ g += `
2401
+
2402
+ ${C("rect")},
2403
+ ${C("path")} {
2404
+ stroke: ${a(A)};
2405
+ ${h(A)}
2406
+ }
2407
+ `;
2408
+ }
2409
+ return g;
2410
+ }, "genColor"), ts = /* @__PURE__ */ k((s, i) => {
2411
+ const n = U1, r = n(s, "r"), u = n(s, "g"), l = n(s, "b");
2412
+ return P1(r, u, l, i);
2413
+ }, "fade"), ss = /* @__PURE__ */ k((s) => `${es(s)}
2414
+ .label {
2415
+ font-family: ${s.fontFamily};
2416
+ color: ${s.nodeTextColor || s.textColor};
2417
+ }
2418
+ .cluster-label text {
2419
+ fill: ${s.titleColor};
2420
+ }
2421
+ .cluster-label span {
2422
+ color: ${s.titleColor};
2423
+ }
2424
+ .cluster-label span p {
2425
+ background-color: transparent;
2426
+ }
2427
+
2428
+ .label text,span {
2429
+ fill: ${s.nodeTextColor || s.textColor};
2430
+ color: ${s.nodeTextColor || s.textColor};
2431
+ }
2432
+
2433
+ .node rect,
2434
+ .node circle,
2435
+ .node ellipse,
2436
+ .node polygon,
2437
+ .node path {
2438
+ fill: ${s.mainBkg};
2439
+ stroke: ${s.nodeBorder};
2440
+ stroke-width: ${s.strokeWidth ?? 1}px;
2441
+ }
2442
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
2443
+ text-anchor: middle;
2444
+ }
2445
+ .node .katex path {
2446
+ fill: ${s.nodeTextColor || s.textColor};
2447
+ stroke: ${s.nodeTextColor || s.textColor};
2448
+ stroke-width: 1px;
2449
+ }
2450
+
2451
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
2452
+ text-align: center;
2453
+ }
2454
+ .node.clickable {
2455
+ cursor: pointer;
2456
+ }
2457
+
2458
+
2459
+ .root .anchor path {
2460
+ fill: ${s.lineColor} !important;
2461
+ stroke-width: 0;
2462
+ stroke: ${s.lineColor};
2463
+ }
2464
+
2465
+ .arrowheadPath {
2466
+ fill: ${s.arrowheadColor};
2467
+ }
2468
+
2469
+ .edgePaths .path {
2470
+ stroke: ${s.lineColor};
2471
+ stroke-width: ${s.strokeWidth ?? 2}px;
2472
+ }
2473
+
2474
+ .flowchart-link {
2475
+ stroke: ${s.lineColor};
2476
+ fill: none;
2477
+ }
2478
+
2479
+ .edgeLabel {
2480
+ background-color: ${s.edgeLabelBackground};
2481
+ p {
2482
+ background-color: ${s.edgeLabelBackground};
2483
+ }
2484
+ rect {
2485
+ opacity: 0.5;
2486
+ background-color: ${s.edgeLabelBackground};
2487
+ fill: ${s.edgeLabelBackground};
2488
+ }
2489
+ text-align: center;
2490
+ }
2491
+
2492
+ /* For html labels only */
2493
+ .labelBkg {
2494
+ background-color: ${ts(s.edgeLabelBackground, 0.5)};
2495
+ }
2496
+
2497
+ .cluster rect {
2498
+ fill: ${s.clusterBkg};
2499
+ stroke: ${s.clusterBorder};
2500
+ stroke-width: 1px;
2501
+ }
2502
+
2503
+ .flow-cluster rect {
2504
+ fill: none;
2505
+ stroke: ${s.clusterBorder};
2506
+ stroke-width: 0.75px;
2507
+ }
2508
+
2509
+ .node .collapsed-indicator {
2510
+ fill: ${s.nodeBorder};
2511
+ stroke: none;
2512
+ stroke-width: 0;
2513
+ opacity: 0.5;
2514
+ }
2515
+
2516
+ .node .collapsed-separator {
2517
+ stroke-width: 0.75px;
2518
+ }
2519
+
2520
+ .cluster text {
2521
+ fill: ${s.titleColor};
2522
+ }
2523
+
2524
+ .cluster span {
2525
+ color: ${s.titleColor};
2526
+ }
2527
+ /* .cluster div {
2528
+ color: ${s.titleColor};
2529
+ } */
2530
+
2531
+ div.mermaidTooltip {
2532
+ position: absolute;
2533
+ text-align: center;
2534
+ max-width: 200px;
2535
+ padding: 2px;
2536
+ font-family: ${s.fontFamily};
2537
+ font-size: 12px;
2538
+ background: ${s.tertiaryColor};
2539
+ border: 1px solid ${s.border2};
2540
+ border-radius: 2px;
2541
+ pointer-events: none;
2542
+ z-index: 100;
2543
+ }
2544
+
2545
+ .agentflowTitleText {
2546
+ text-anchor: middle;
2547
+ font-size: 18px;
2548
+ fill: ${s.textColor};
2549
+ }
2550
+
2551
+ rect.text {
2552
+ fill: none;
2553
+ stroke-width: 0;
2554
+ }
2555
+
2556
+ .icon-shape, .image-shape {
2557
+ background-color: ${s.edgeLabelBackground};
2558
+ p {
2559
+ background-color: ${s.edgeLabelBackground};
2560
+ padding: 2px;
2561
+ }
2562
+ .label rect {
2563
+ opacity: 0.5;
2564
+ background-color: ${s.edgeLabelBackground};
2565
+ fill: ${s.edgeLabelBackground};
2566
+ }
2567
+ text-align: center;
2568
+ }
2569
+ ${k1()}
2570
+ `, "getStyles"), is = ss, cs = {
2571
+ parser: $1,
2572
+ get db() {
2573
+ return new X1();
2574
+ },
2575
+ renderer: Z1,
2576
+ styles: is,
2577
+ init: /* @__PURE__ */ k((s) => {
2578
+ s.agentflow ??= {}, s.layout && t1({ layout: s.layout }), s.flowchart ??= {}, s.flowchart.arrowMarkerAbsolute = s.arrowMarkerAbsolute, t1({ flowchart: { arrowMarkerAbsolute: s.arrowMarkerAbsolute } });
2579
+ }, "init")
2580
+ };
2581
+ export {
2582
+ cs as diagram
2583
+ };